Commit ·
a2c5eb5
0
Parent(s):
Duplicate from naman-jain7/convnext-solar-panel-defect-classifier-v1
Browse filesCo-authored-by: Naman Jain <naman-jain7@users.noreply.huggingface.co>
- .gitattributes +3 -0
- README.md +118 -0
- assets/conf_matrix.png +3 -0
- assets/o_epoch time vs epoch.png +3 -0
- assets/o_gpu memory used vs epoch.png +3 -0
- assets/o_step time vs epoch.png +3 -0
- assets/o_throughput vs epoch.png +3 -0
- assets/roc.png +3 -0
- assets/training.png +3 -0
- assets/uo_epoch time vs epoch.png +3 -0
- assets/uo_gpu memory used vs epoch.png +3 -0
- assets/uo_step time vs epoch.png +3 -0
- assets/uo_throughput vs epoch.png +3 -0
- fingerprint.pb +3 -0
- labels.json +8 -0
- requirements.txt +4 -0
- saved_model.pb +3 -0
- variables/variables.data-00000-of-00001 +3 -0
- variables/variables.index +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
variables/* filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: mit
|
| 4 |
+
tags:
|
| 5 |
+
- solar-panel
|
| 6 |
+
- defect-detection
|
| 7 |
+
- convnext
|
| 8 |
+
- computer-vision
|
| 9 |
+
- tensorflow
|
| 10 |
+
- sustainability
|
| 11 |
+
- renewable-energy
|
| 12 |
+
datasets:
|
| 13 |
+
- custom-solar-panel-defect
|
| 14 |
+
metrics:
|
| 15 |
+
- accuracy
|
| 16 |
+
- precision
|
| 17 |
+
- recall
|
| 18 |
+
- f1
|
| 19 |
+
library_name: tensorflow
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
# ☀️ ConvNeXt Solar Panel Defect Classifier 🔍
|
| 23 |
+
|
| 24 |
+
[](https://www.tensorflow.org/)
|
| 25 |
+
[](https://huggingface.co/models/naman-jain7/convnext-solar-panel-defect-classifier-v1)
|
| 26 |
+
[](https://opensource.org/licenses/MIT)
|
| 27 |
+
|
| 28 |
+
## 📖 Overview
|
| 29 |
+
This model is designed to automate the inspection of solar panels within a microgrid ecosystem. By identifying defects such as physical damage, dust accumulation, or electrical failures, it helps in maintaining peak efficiency and reducing manual maintenance costs.
|
| 30 |
+
|
| 31 |
+
The classifier is built upon the **ConvNeXt-Tiny** architecture, a modern pure convolutional neural network that rivals Transformers in performance while maintaining the efficiency of standard CNNs.
|
| 32 |
+
|
| 33 |
+
### 🎯 Key Features
|
| 34 |
+
- **Modern Architecture**: Leverages ConvNeXt-Tiny for high-accuracy feature extraction.
|
| 35 |
+
- **Robust Performance**: Achieved **97.18% Test Accuracy**.
|
| 36 |
+
- **6-Class Classification**: Specialized in detecting specific solar panel states.
|
| 37 |
+
|
| 38 |
+
---
|
| 39 |
+
|
| 40 |
+
## 🛠️ Model Details
|
| 41 |
+
- **Base Model**: ConvNeXt-Tiny (Pretrained on ImageNet-1K)
|
| 42 |
+
- **Input Resolution**: 224x224 px
|
| 43 |
+
- **Optimization**: Adam Optimizer with Categorical Cross-Entropy loss.
|
| 44 |
+
- **Framework**: TensorFlow / Keras
|
| 45 |
+
|
| 46 |
+
---
|
| 47 |
+
|
| 48 |
+
## 📊 Dataset & Classes
|
| 49 |
+
The model was fine-tuned on a curated dataset of solar panel imagery, specifically labeled for microgrid maintenance scenarios.
|
| 50 |
+
|
| 51 |
+
| Label | Description |
|
| 52 |
+
| :--- | :--- |
|
| 53 |
+
| ❄️ **Snow-covered** | Panels obstructed by snow |
|
| 54 |
+
| 🔨 **Physical-damage** | Cracks, broken glass, or structural issues |
|
| 55 |
+
| ⚡ **Electrical-damage** | Burning marks or internal circuit failure |
|
| 56 |
+
| 🌫️ **Dusty** | High accumulation of dirt/sand |
|
| 57 |
+
| ✨ **Clean** | Fully operational and clear panels |
|
| 58 |
+
| 🐦 **Bird-drop** | Obstruction due to wildlife |
|
| 59 |
+
|
| 60 |
+
---
|
| 61 |
+
|
| 62 |
+
## 📈 Performance & Metrics
|
| 63 |
+
|
| 64 |
+
### 🔄 Training Progress
|
| 65 |
+
Monitoring the learning curves for both accuracy and loss.
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
|
| 69 |
+
### 🧪 Error Analysis
|
| 70 |
+
A deeper look into model predictions via the Confusion Matrix and ROC Curve.
|
| 71 |
+
|
| 72 |
+
<p align="center">
|
| 73 |
+
<img src="assets/conf_matrix.png" width="45%" title="Confusion Matrix" />
|
| 74 |
+
<img src="assets/roc.png" width="45%" title="ROC Curve" />
|
| 75 |
+
</p>
|
| 76 |
+
|
| 77 |
+
### 📋 Classification Report
|
| 78 |
+
|
| 79 |
+
| Class | Precision | Recall | F1-Score | Support |
|
| 80 |
+
| :--- | :---: | :---: | :---: | :---: |
|
| 81 |
+
| **Bird-drop** | 0.95 | 0.90 | 0.93 | 41 |
|
| 82 |
+
| **Clean** | 0.86 | 1.00 | 0.92 | 30 |
|
| 83 |
+
| **Dusty** | 0.94 | 0.92 | 0.93 | 36 |
|
| 84 |
+
| **Electrical-damage** | 1.00 | 0.97 | 0.99 | 39 |
|
| 85 |
+
| **Physical-damage** | 1.00 | 0.97 | 0.98 | 32 |
|
| 86 |
+
| **Snow-covered** | 1.00 | 1.00 | 1.00 | 46 |
|
| 87 |
+
| **Average / Total** | **0.96** | **0.96** | **0.96** | **224** |
|
| 88 |
+
|
| 89 |
+
---
|
| 90 |
+
|
| 91 |
+
## 🚀 Usage
|
| 92 |
+
|
| 93 |
+
```python
|
| 94 |
+
from inference import predict
|
| 95 |
+
|
| 96 |
+
# Load image and predict
|
| 97 |
+
image_path = "solar_panel_test.jpg"
|
| 98 |
+
result = predict(image_path)
|
| 99 |
+
|
| 100 |
+
print(f"Prediction: {result['class']}")
|
| 101 |
+
print(f"Confidence: {result['confidence']:.2%}")
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
---
|
| 105 |
+
|
| 106 |
+
## 📄 License
|
| 107 |
+
This project is licensed under the **MIT License**.
|
| 108 |
+
|
| 109 |
+
## 🤝 Citation
|
| 110 |
+
If you use this model in your research or project, please cite:
|
| 111 |
+
```bibtex
|
| 112 |
+
@model{convnext_solar_defect_2024,
|
| 113 |
+
author = {Microgrid Efficiency Project Team},
|
| 114 |
+
title = {ConvNeXt Solar Panel Defect Classifier},
|
| 115 |
+
year = {2024},
|
| 116 |
+
publisher = {Hugging Face Hub}
|
| 117 |
+
}
|
| 118 |
+
```
|
assets/conf_matrix.png
ADDED
|
Git LFS Details
|
assets/o_epoch time vs epoch.png
ADDED
|
Git LFS Details
|
assets/o_gpu memory used vs epoch.png
ADDED
|
Git LFS Details
|
assets/o_step time vs epoch.png
ADDED
|
Git LFS Details
|
assets/o_throughput vs epoch.png
ADDED
|
Git LFS Details
|
assets/roc.png
ADDED
|
Git LFS Details
|
assets/training.png
ADDED
|
Git LFS Details
|
assets/uo_epoch time vs epoch.png
ADDED
|
Git LFS Details
|
assets/uo_gpu memory used vs epoch.png
ADDED
|
Git LFS Details
|
assets/uo_step time vs epoch.png
ADDED
|
Git LFS Details
|
assets/uo_throughput vs epoch.png
ADDED
|
Git LFS Details
|
fingerprint.pb
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c61d49c721717d13df990cb530bfd09503f1d66eb22982a7e5bead9b6abe176c
|
| 3 |
+
size 77
|
labels.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"0": "snow-covered",
|
| 3 |
+
"1": "physical-damage",
|
| 4 |
+
"2": "electrical-damage",
|
| 5 |
+
"3": "dusty",
|
| 6 |
+
"4": "clean",
|
| 7 |
+
"5": "bird-drop"
|
| 8 |
+
}
|
requirements.txt
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
tensorflow==2.19.0
|
| 2 |
+
numpy
|
| 3 |
+
pillow
|
| 4 |
+
gradio
|
saved_model.pb
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9755824099f5f790a24e20c445c62d90e0bd5fce0c0f0b3760a6ff7de91460de
|
| 3 |
+
size 1595341
|
variables/variables.data-00000-of-00001
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f13edb4f8ab7e27115c2cb442abc7c91a91aa78d886c13f49fd1bffcd95b69fd
|
| 3 |
+
size 222647428
|
variables/variables.index
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:440383ab2c6d2b36277f510418faa959b40fbc12df41d20544ec7c0187c0db24
|
| 3 |
+
size 21282
|