Swarmdrones naman-jain7 commited on
Commit
a2c5eb5
·
0 Parent(s):

Duplicate from naman-jain7/convnext-solar-panel-defect-classifier-v1

Browse files

Co-authored-by: Naman Jain <naman-jain7@users.noreply.huggingface.co>

.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
+ [![TensorFlow](https://img.shields.io/badge/TensorFlow-2.x-orange?logo=tensorflow)](https://www.tensorflow.org/)
25
+ [![Hugging Face Model](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Model-blue)](https://huggingface.co/models/naman-jain7/convnext-solar-panel-defect-classifier-v1)
26
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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
+ ![Training Metrics](assets/training.png)
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

  • SHA256: d0ae8966466a370e325746efa2a03f077429a831985c369b8cbbd494914d164d
  • Pointer size: 130 Bytes
  • Size of remote file: 53.3 kB
assets/o_epoch time vs epoch.png ADDED

Git LFS Details

  • SHA256: 786dc228ee3449f946e14a47e6c0afd251aa57ff44bf245bfa34400337677438
  • Pointer size: 130 Bytes
  • Size of remote file: 47.4 kB
assets/o_gpu memory used vs epoch.png ADDED

Git LFS Details

  • SHA256: e9541ac031fac1cd5b96221f444f3b2352da6f4c37f6dd4fbbbf9e955afb3926
  • Pointer size: 130 Bytes
  • Size of remote file: 57.8 kB
assets/o_step time vs epoch.png ADDED

Git LFS Details

  • SHA256: 81c856ecb0d52df3e4886f3e3c96c20ca2e513ff4abe9186cbef3b3e14213afa
  • Pointer size: 130 Bytes
  • Size of remote file: 41.7 kB
assets/o_throughput vs epoch.png ADDED

Git LFS Details

  • SHA256: 38953665a3fa31a7971b7116b4086d665cf5ad375afb77de01a8471bf1e1c368
  • Pointer size: 130 Bytes
  • Size of remote file: 53.8 kB
assets/roc.png ADDED

Git LFS Details

  • SHA256: 16402685d3c3356121a71231c0bf93c91bf8def4448ae52be07b9be39c58c98b
  • Pointer size: 130 Bytes
  • Size of remote file: 55.2 kB
assets/training.png ADDED

Git LFS Details

  • SHA256: 366e7fedc059910b5814989bb169c4872ad2be60eb4ba7b360a534794406327f
  • Pointer size: 131 Bytes
  • Size of remote file: 112 kB
assets/uo_epoch time vs epoch.png ADDED

Git LFS Details

  • SHA256: 122a95b59fd563e20bb68ae54d39110b8fdbb0b46243e482e3f223a2aec2c857
  • Pointer size: 130 Bytes
  • Size of remote file: 60.2 kB
assets/uo_gpu memory used vs epoch.png ADDED

Git LFS Details

  • SHA256: 19b6fac1859092128c772c9b4832c5dbf390df6beff71794887aee680b4488ea
  • Pointer size: 130 Bytes
  • Size of remote file: 59.9 kB
assets/uo_step time vs epoch.png ADDED

Git LFS Details

  • SHA256: ebb5a0288d236d1ba2980ef5d53a3cfe3b7ddb53e6ac779ed0e467a703205c05
  • Pointer size: 130 Bytes
  • Size of remote file: 53.1 kB
assets/uo_throughput vs epoch.png ADDED

Git LFS Details

  • SHA256: 90037163134ace4ffa6d82458e7d843e045961266e9680789965fe0f122b6dee
  • Pointer size: 130 Bytes
  • Size of remote file: 66.2 kB
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