This project implements an ensemble machine learning system for analyzing electroluminescence (EL) images of solar panels to predict power loss and assess panel health. The system combines a physics-based model with a deep learning ResNet model to provide accurate predictions of solar panel performance.
This project uses the ELPV dataset, released under the CC BY 4.0 License. Please download it directly from the official source.
We do not host the dataset files in this repository to respect bandwidth, license, and size limitations.
h-proj/
├── scripts/
│ ├── run_inference.sh # Main inference script
│ ├── inference.py # Python inference implementation
│ └── physics_ensemble_final.ipynb # Training notebook
├── models/
│ └── best_ensemble_model.pth # Trained ensemble model
├── data/
│ ├── data.csv # Dataset metadata (720 samples)
│ ├── processed.zip # Compressed processed images (322MB)
│ └── processed/ # Processed EL images (719 images)
└── results/
└── image_9_results.txt # Sample inference results
- Physics Model: Analyzes inactive pixel percentage using threshold-based calculations
- ResNet Model: Modified ResNet18 architecture adapted for grayscale EL images
- Meta Learner: Linear combination layer that optimally weights both model predictions
- Calculates inactive pixel percentage using configurable threshold
- Applies linear regression:
pred = 1.5752 * inactive_pct - 0.6471 - Provides interpretable physics-based predictions
- Modified ResNet18 architecture for single-channel (grayscale) input
- First layer adapted to handle grayscale images
- Outputs power prediction values
- Combines physics and ResNet predictions using learned weights
- Provides final ensemble prediction for power loss assessment
- Size: 720 samples with corresponding EL images
- Images: 719 processed PNG files (grayscale EL images)
- Metadata: CSV file containing:
- Peak power measurements
- Nominal power values
- Pressure readings
- Excitation class
- Module type and instance
- Power group classifications
- Cross-validation fold assignments
- Python 3.x with PyTorch
- Conda environment named "solar"
- CUDA-compatible GPU (optional but recommended)
-
Configure the script: Edit
scripts/run_inference.shto set your parameters:# Model Settings MODEL_PATH="/home/.../models/best_ensemble_model.pth" USE_GPU=true # Image Processing IMAGE_SIZE=224 THRESHOLD=0.2 # Input/Output INPUT_FILE="/home/.../data/processed/image_9.png" OUTPUT_DIR="results"
-
Run inference:
cd /home/.../ chmod +x scripts/run_inference.sh ./scripts/run_inference.sh
python scripts/inference.py \
--image /path/to/el/image.png \
--model /home/.../models/best_ensemble_model.pth \
--output results/ \
--gpu true \
--size 224 \
--threshold 0.2The system generates comprehensive analysis results including:
- Physics Model Prediction: Physics-based power prediction
- ResNet Model Prediction: Deep learning model prediction
- Ensemble Prediction: Final combined prediction
- Power Loss: Calculated as
1 - ensemble_prediction - Relative Power: Direct ensemble prediction value
- Inactive Pixel %: Percentage of inactive pixels detected
Physics Model Prediction: 0.9007
ResNet Model Prediction: 1.3446
Ensemble Prediction: 0.8933
Power Loss: 0.1067
Relative Power: 0.8933
Inactive Pixel %: 0.9007
| Parameter | Description | Default Value |
|---|---|---|
IMAGE_SIZE |
Input image resolution | 224 |
THRESHOLD |
Inactive pixel threshold | 0.2 |
USE_GPU |
Enable GPU acceleration | true |
CONDA_ENV |
Conda environment name | solar |
The ensemble model combines the interpretability of physics-based analysis with the pattern recognition capabilities of deep learning:
- Physics Model: Provides interpretable predictions based on inactive pixel analysis
- ResNet Model: Captures complex visual patterns in EL images
- Ensemble: Optimally combines both approaches for improved accuracy
run_inference.sh: Main bash script for running inference with configurationinference.py: Python implementation of the inference pipelinephysics_ensemble_final.ipynb: Jupyter notebook containing training and model development
best_ensemble_model.pth: Trained ensemble model weights (43MB)
data.csv: Dataset metadata with power measurements and cross-validation foldsprocessed/: Directory containing 719 processed EL imagesprocessed.zip: Compressed archive of processed images
<image_number>_results.txt: Sample inference results showing model predictions
- Input: Grayscale EL images (224x224 pixels)
- Physics Model: Threshold-based inactive pixel analysis
- ResNet Model: Modified ResNet18 with grayscale adaptation
- Output: Power prediction values (0-1 range)
- PyTorch
- torchvision
- PIL (Pillow)
- numpy
- argparse
This project is for research and development purposes. Please ensure compliance with relevant data usage agreements when working with solar panel EL images.
For questions or issues related to this solar panel EL image analysis system, please refer to the project documentation or contact the development team.
Codebase Creator: Harini Iyar
Project: Solar Panel Electroluminescence (EL) Image Analysis
Date: July 2025