Model: YOLOv9
Domains: Renewable Energy | Thermal Vision | Computer Vision | FastAPI | YOLO
Photovoltaic (PV) systems are a cornerstone of sustainable energy solutions. Yet, their performance can suffer due to the absence of affordable and automated real-time inspection tools. This project presents a full AI pipeline designed to automatically detect thermal defects in solar panels using YOLOv9, delivered through a REST API powered by FastAPI and containerized with Docker.
Goal: Identify and classify 8 distinct thermal fault types in PV modules using labeled grayscale drone imagery.
- Raw Images: 2,723
- Post-Augmentation Samples: ~7,500
- Total Annotations: 7,772
- Label Format: YOLOv9 (Roboflow-generated)
- Resolution: 640Γ640
- Color Format: Grayscale
- 50% probability of horizontal and vertical flips
- Random rotations at 90Β° angles
- Shear transformations (Β±15Β°)
- Adjustments to hue, brightness, and exposure (Β±15%)
Single Hotspot
Multiple Hotspots
Single Diode Fault
Multiple Diode Faults
Single Bypassed Substring
Multiple Bypassed Substrings
Open Circuit (String)
Reversed Polarity (String)
- Conduct research on thermal faults and define taxonomy
- Collect and annotate data using Roboflow
- Preprocess (resize, grayscale, align)
- Apply data augmentation
- Train YOLOv9 model and evaluate performance
- Export final model as
Th_G_v9.pt
- Deploy API using FastAPI + Docker
Metric | Result |
---|---|
Precision | 74% |
Recall | 76% |
mAP@0.5 | 78% |
mAP@0.5:0.95 | 61% |
Fitness Score | 63% |
The YOLOv9 model performed well on unseen thermal images.
Endpoint: POST /predict/
Input Format: Grayscale thermal image (form-data)
Response Includes:
- πΌοΈ JPEG with detection boxes
- π¦ HTTP headers:
X-Anomaly-Count
andX-Detection-Result
You can run the API in an isolated and reproducible environment using Docker.
From the root directory of the project, run:
docker build -t solar-api .
docker run -p 8000:8000 solar-api
### π Sample curl Request
```bash
curl -X POST "http://localhost:8000/predict/" \
-H "accept: image/jpeg" \
-F "file=@sample.jpg" \
--output result.jpg