Bhavi23 commited on
Commit
20f5cb7
ยท
verified ยท
1 Parent(s): 960bff4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +264 -12
README.md CHANGED
@@ -1,12 +1,264 @@
1
- ---
2
- title: ModelApp
3
- emoji: ๐Ÿ“‰
4
- colorFrom: gray
5
- colorTo: yellow
6
- sdk: gradio
7
- sdk_version: 5.38.0
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ๐Ÿ›ฐ๏ธ Satellite Classification Dashboard
2
+ A streamlined deep learning application for classifying satellite images using state-of-the-art neural network models. This interactive Gradio-based dashboard allows users to upload satellite images, select multiple models for classification, and view predictions with confidence scores and visualizations, all hosted on Hugging Face Spaces.
3
+ ๐ŸŒŸ Features
4
+
5
+ Interactive Interface: Built with Gradio for a simple, user-friendly web experience.
6
+ Real-Time Image Classification: Upload PNG, JPG, or JPEG images to classify satellites and space debris.
7
+ Multiple Model Support: Choose from four pre-trained models with varying strengths:
8
+ Custom CNN: Tailored for satellite imagery (95.2% accuracy).
9
+ MobileNetV2: Lightweight and fast (92.8% accuracy, 18ms inference).
10
+ EfficientNetB0: Best accuracy-efficiency balance (96.4% accuracy).
11
+ DenseNet121: Complex pattern recognition (94.7% accuracy).
12
+
13
+
14
+ Visualizations: Interactive Plotly charts for confidence comparison and class probability distribution.
15
+ Model Recommendation: Automatically suggests the best model based on confidence and performance metrics.
16
+ Supported Classes: Classifies 11 categories:
17
+ AcrimSat, Aquarius, Aura, Calipso, Cloudsat, CubeSat, Debris, Jason, Sentinel-6, TRMM, Terra
18
+
19
+
20
+
21
+ ๐ŸŽฏ Quick Start
22
+ Try the Live Demo
23
+ Visit the Hugging Face Space to use the application directly in your browser: https://huggingface.co/spaces/your-username/Satellite-Classification-Gradio
24
+ Local Installation
25
+
26
+ Clone the repository:git clone https://huggingface.co/spaces/your-username/Satellite-Classification-Gradio
27
+ cd Satellite-Classification-Gradio
28
+
29
+
30
+ Create a virtual environment (optional but recommended):python -m venv venv
31
+ source venv/bin/activate # On Windows: venv\Scripts\activate
32
+
33
+
34
+ Install dependencies:pip install -r requirements.txt
35
+
36
+
37
+ Run the application:python app.py
38
+
39
+
40
+ Open your browser and navigate to http://localhost:7860.
41
+
42
+ ๐Ÿ“ฆ Dependencies
43
+ Listed in requirements.txt:
44
+
45
+ gradio==5.0.2
46
+ tensorflow-cpu==2.15.0
47
+ numpy==1.26.4
48
+ pandas==2.2.2
49
+ plotly==5.22.0
50
+ Pillow==10.4.0
51
+ requests==2.32.3
52
+ protobuf==3.20.3
53
+
54
+ ๐ŸŽฎ How to Use
55
+
56
+ Upload Image: Upload a satellite image (PNG, JPG, or JPEG).
57
+ Select Models: Choose one or more models (Custom CNN, MobileNetV2, EfficientNetB0, DenseNet121).
58
+ Classify: Click "Classify Image" to get predictions.
59
+ View Results:
60
+ Table of predictions (model, predicted class, confidence, inference time).
61
+ Recommended model based on confidence and performance.
62
+ Confidence comparison bar chart.
63
+ Top 5 class probabilities for the recommended model.
64
+
65
+
66
+
67
+ ๐Ÿ“Š Model Performance
68
+
69
+
70
+
71
+ Model
72
+ Accuracy
73
+ Precision
74
+ Recall
75
+ F1-Score
76
+ Inference Time
77
+ Model Size
78
+
79
+
80
+
81
+ EfficientNetB0
82
+ 96.4%
83
+ 96.1%
84
+ 96.2%
85
+ 96.1%
86
+ 35ms
87
+ 20.1MB
88
+
89
+
90
+ Custom CNN
91
+ 95.2%
92
+ 94.8%
93
+ 95.1%
94
+ 94.9%
95
+ 45ms
96
+ 25.3MB
97
+
98
+
99
+ DenseNet121
100
+ 94.7%
101
+ 94.2%
102
+ 94.5%
103
+ 94.3%
104
+ 52ms
105
+ 32.8MB
106
+
107
+
108
+ MobileNetV2
109
+ 92.8%
110
+ 92.1%
111
+ 92.5%
112
+ 92.3%
113
+ 18ms
114
+ 8.7MB
115
+
116
+
117
+ ๐ŸŽฏ Model Selection Guide
118
+
119
+ Best Overall Accuracy: EfficientNetB0 (96.4%)
120
+ Fastest Inference: MobileNetV2 (18ms)
121
+ Most Lightweight: MobileNetV2 (8.7MB)
122
+ Best Balance: EfficientNetB0 (High accuracy + efficiency)
123
+ Mobile/Edge Deployment: MobileNetV2
124
+ Research/High Accuracy: EfficientNetB0 or DenseNet121
125
+
126
+ ๐Ÿ—๏ธ Architecture
127
+ Model Sources
128
+ All models are hosted on Hugging Face Model Hub:
129
+
130
+ Custom CNN: Bhavi23/Custom_CNN
131
+ MobileNetV2: Bhavi23/MobilenetV2
132
+ EfficientNetB0: Bhavi23/EfficientNet_B0
133
+ DenseNet121: Bhavi23/DenseNet
134
+
135
+ Data Pipeline
136
+
137
+ Image Upload: Supports PNG, JPG, JPEG formats.
138
+ Preprocessing: Resize to 224x224, normalize to [0,1].
139
+ Model Inference: Multi-model prediction with timing.
140
+ Post-processing: Confidence scoring and model recommendations.
141
+
142
+ ๐Ÿ”ง Technical Details
143
+
144
+ Input Requirements:
145
+ Image Format: PNG, JPG, JPEG
146
+ Input Size: 224x224x3 (RGB)
147
+ Preprocessing: Automatic resizing and normalization
148
+
149
+
150
+ Output Format:
151
+ Class Prediction: One of 11 satellite categories
152
+ Confidence Score: Percentage confidence (0-100%)
153
+ Inference Time: Milliseconds for prediction
154
+ Probability Distribution: Full softmax output for all classes
155
+
156
+
157
+ Performance Optimization:
158
+ Model Caching: Models loaded on-demand.
159
+ Efficient Preprocessing: Optimized image pipeline.
160
+ Memory Management: Automatic cleanup of model objects.
161
+
162
+
163
+
164
+ ๐Ÿšข Deployment
165
+ The application is deployed on Hugging Face Spaces using:
166
+
167
+ Runtime: Python 3.9
168
+ Framework: Gradio
169
+ Resources: CPU-optimized for inference
170
+
171
+ Docker Deployment (Optional)
172
+ If needed, use this Dockerfile:
173
+ FROM python:3.9-slim
174
+ WORKDIR /app
175
+ COPY requirements.txt .
176
+ RUN pip install --no-cache-dir -r requirements.txt
177
+ COPY . .
178
+ EXPOSE 7860
179
+ CMD ["python", "app.py"]
180
+
181
+ ๐Ÿค Contributing
182
+ We welcome contributions! Please follow these steps:
183
+
184
+ Fork the repository.
185
+ Create a feature branch (git checkout -b feature/amazing-feature).
186
+ Commit changes (git commit -m 'Add amazing feature').
187
+ Push to branch (git push origin feature/amazing-feature).
188
+ Open a Pull Request.
189
+
190
+ Development Setup
191
+ # Clone your fork
192
+ git clone https://huggingface.co/spaces/your-username/Satellite-Classification-Gradio
193
+ # Create virtual environment
194
+ python -m venv venv
195
+ source venv/bin/activate # On Windows: venv\Scripts\activate
196
+ # Install dependencies
197
+ pip install -r requirements.txt
198
+ # Run in development mode
199
+ python app.py
200
+
201
+ ๐Ÿ“„ License
202
+ This project is licensed under the MIT License - see the LICENSE file for details.
203
+ ๐Ÿ™ Acknowledgments
204
+
205
+ Dataset: Spark 2021 dataset used for training.
206
+ Frameworks: TensorFlow, Gradio, Plotly.
207
+ Models: Pre-trained architectures from TensorFlow/Keras.
208
+ Hosting: Hugging Face Spaces for deployment.
209
+
210
+ ๐Ÿ“ž Support
211
+
212
+ Issues: GitHub Issues
213
+ Discussions: Hugging Face Discussions
214
+ Email: bhavithrass@gmail.com
215
+
216
+ ๐Ÿ”ฎ Future Enhancements
217
+
218
+ Real-time video classification.
219
+ Batch processing for multiple images.
220
+ API endpoint for programmatic access.
221
+ Advanced visualizations with satellite orbit data.
222
+
223
+ ๐Ÿ› ๏ธ Troubleshooting
224
+ If you encounter errors during deployment or runtime, try the following:
225
+ ModuleNotFoundError: No module named 'tensorflow'
226
+
227
+ Cause: TensorFlow failed to install during the Space build.
228
+ Fix:
229
+ Ensure requirements.txt includes tensorflow-cpu==2.15.0 and protobuf==3.20.3.
230
+ Verify the file is in the repository root:git add requirements.txt
231
+ git commit -m "Update requirements.txt"
232
+ git push
233
+
234
+
235
+ Check build logs in the Spaceโ€™s Settings tab for dependency installation errors.
236
+ Test locally to confirm compatibility:python -m venv venv
237
+ source venv/bin/activate
238
+ pip install -r requirements.txt
239
+ python app.py
240
+
241
+
242
+ If the issue persists, use a Dockerfile to enforce Python 3.9:FROM python:3.9-slim
243
+ WORKDIR /app
244
+ COPY requirements.txt .
245
+ RUN pip install --no-cache-dir -r requirements.txt
246
+ COPY . .
247
+ EXPOSE 7860
248
+ CMD ["python", "app.py"]
249
+
250
+
251
+ Restart the Space after pushing changes.
252
+
253
+
254
+ Contact Support: If unresolved, open an issue on Hugging Face or check the Hugging Face Forums.
255
+
256
+ ๐Ÿ“Š Usage Statistics
257
+ Track your application usage:
258
+
259
+ Classifications Performed: Real-time counter.
260
+ Popular Models: Usage analytics.
261
+ Performance Metrics: Response time tracking.
262
+
263
+ Built with โค๏ธ using Gradio and TensorFlow
264
+ For more information, visit our Hugging Face Space