YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
DeepSolarEye - Solar Panel Cleaning Quality & Vendor Rating
π¬ Overview
A complete pipeline for assessing solar rooftop panel cleaning quality and rating cleaning vendor performance. Based on the architecture from:
"DeepSolarEye: Power Loss Prediction and Weakly Supervised Soiling Localization via Fully Convolutional Networks for Solar Panels"
Mehta et al., 2017 (arxiv:1710.03811)
π¦ What's Included
| File | Description |
|---|---|
model.pth |
Trained model weights (49MB) |
deepsolar_config.json |
Model config with classes & quality ratings |
inference.py |
Single-image prediction script |
auto_label.py |
Auto-label unlabeled images using SigLIP zero-shot + vendor report |
train.py |
Full training script (data generation + training + Hub push) |
DeepSolarEye_Training.ipynb |
Google Colab notebook β train on free T4 GPU |
π Quick Start: 3-Step Pipeline
Step 1: Auto-Label Your Images (if unlabeled)
Uses Google's SigLIP model to automatically classify your solar panel images β no training data needed.
pip install transformers torch pillow tqdm
python auto_label.py \
--input_dir /path/to/your/solar/images/ \
--output_dir /path/to/labeled/ \
--vendor_name "SolarClean Pro"
Output:
labeled/train/β Auto-labeled images organized by class (ready for training)labeled/review/β Low-confidence images for manual reviewvendor_report.jsonβ Cleaning quality grade (A+ to F)
Step 2: Train on Your Data (Google Colab)
- Open the Colab notebook
- Upload your labeled images (zip)
- Train on free T4 GPU (50 epochs, ~30 min)
- Push trained model to Hub
Step 3: Rate a Cleaning Vendor
python auto_label.py \
--input_dir /photos/after_vendor_cleaning/ \
--output_dir /reports/vendor_abc/ \
--vendor_name "ABC Solar Cleaning"
Sample Output: ``` π’ VENDOR CLEANING QUALITY REPORT
Vendor: ABC Solar Cleaning Grade: B Panels Inspected: 150
π Quality Score: 3.67/5.0 β Clean Panels: 45.3% β Acceptable (Clean + Light-Dust): 72.0%
β οΈ Issues Found: - Heavy-Dust: 12 panels - Bird-Dropping: 8 panels
π° Recommendation: Good cleaning. Minor issues to address.
## ποΈ Architecture
**ResNet-18 + BiDIAF (Bi-Directional Input-Aware Fusion)** β 12.8M parameters
Input Image (224Γ224Γ3)
β
βββ ResNet Stem (convβbnβreluβmaxpool)
βββ Stage 1 (64ch) + BiDIAF Block 1 + Spatial Dropout
βββ Stage 2 (128ch) + BiDIAF Block 2 + Spatial Dropout
βββ Stage 3 (256ch) + BiDIAF Block 3 + Spatial Dropout
βββ Stage 4 (512ch) + BiDIAF Block 4 + Spatial Dropout
βββ Global Average Pooling
βββ FC Classifier β 6 classes β Quality Rating (1-5β)
**Key design decisions from the paper:**
- BiDIAF reinforces input image at every spatial level β preserves color/texture features critical for soiling
- Random weight init (not ImageNet) β learns domain-specific features
- No color augmentation β color IS the signal for soiling detection
- Inverse class-frequency weighted loss β handles imbalanced cleaning data
## π Classes & Quality Ratings
| Class | Rating | Stars | Vendor Action |
|-------|--------|-------|---------------|
| Clean | 5/5 | βββββ | Approve payment |
| Light-Dust | 4/5 | βββββ | Acceptable, note for next visit |
| Bird-Dropping | 3/5 | βββββ | Deduct, request spot-clean |
| Partial-Shadow | 3/5 | βββββ | Flag obstruction for removal |
| Heavy-Dust | 2/5 | βββββ | Reject, request re-cleaning |
| Snow-Covered | 1/5 | βββββ | Immediate attention required |
**Vendor Grading Scale:**
| Avg Score | Grade | Action |
|-----------|-------|--------|
| β₯ 4.5 | A+ | Excellent β approve full payment |
| β₯ 4.0 | A | Great β approve payment |
| β₯ 3.5 | B | Good β minor issues to discuss |
| β₯ 3.0 | C | Acceptable β needs improvement |
| β₯ 2.0 | D | Poor β deduct payment |
| < 2.0 | F | Unacceptable β request re-clean |
## π» Usage: Single Image Inference
```python
python inference.py --image panel_photo.jpg
Or in Python:
from inference import load_model, predict
model = load_model() # Downloads from Hub automatically
result = predict(model, "panel.jpg")
print(f"Condition: {result['predicted_class']}")
print(f"Rating: {result['quality_rating']}/5")
print(f"Confidence: {result['confidence']:.1%}")
π Training on Your Own Data
Option A: Google Colab (recommended)
- Open
DeepSolarEye_Training.ipynbin Colab - Free T4 GPU, ~30 min for 50 epochs
Option B: HF Jobs (requires Pro)
# After getting HF Pro subscription
pip install huggingface_hub
python train.py
Option C: Local GPU
pip install torch torchvision transformers datasets evaluate accelerate scikit-learn
python train.py # Modify DATA_DIR to point to your data
π References
- DeepSolarEye (WACV 2018) β Core architecture
- CNN Fault Detection for PV Panels β Multi-class PV classification
- PV-DDPM β Synthetic defect generation for PV
π License
MIT