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 review
  • vendor_report.json β€” Cleaning quality grade (A+ to F)

Step 2: Train on Your Data (Google Colab)

Open In Colab

  1. Open the Colab notebook
  2. Upload your labeled images (zip)
  3. Train on free T4 GPU (50 epochs, ~30 min)
  4. 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.ipynb in 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

πŸ“ License

MIT

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Papers for nitishmehta/DeepSolarEye-cleaning-quality