Image Classification
Keras
LiteRT
TF-Keras
skin-disease
medical
efficientnet
dermatology
computer-vision
healthcare
Instructions to use Tanishq77/skin-condition-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use Tanishq77/skin-condition-classifier with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://Tanishq77/skin-condition-classifier") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,89 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- skin-disease
|
| 5 |
+
- medical
|
| 6 |
+
- image-classification
|
| 7 |
+
- keras
|
| 8 |
+
- efficientnet
|
| 9 |
+
- dermatology
|
| 10 |
+
- computer-vision
|
| 11 |
+
- healthcare
|
| 12 |
+
datasets:
|
| 13 |
+
- custom
|
| 14 |
+
widget:
|
| 15 |
+
- src: https://huggingface.co/spaces/Tanishq77/skin-condition-classifier
|
| 16 |
+
example_title: Try it live with Streamlit!
|
| 17 |
+
---
|
| 18 |
+
# π§ Skin Condition Classifier (EfficientNetV2B0)
|
| 19 |
+
|
| 20 |
+
This model classifies **facial skin images** into **6 common dermatological conditions** using a fine-tuned [EfficientNetV2B0](https://keras.io/api/applications/efficientnet/#efficientnetv2b0-function) architecture.
|
| 21 |
+
|
| 22 |
+
## π Supported Skin Conditions
|
| 23 |
+
- Acne
|
| 24 |
+
- Carcinoma
|
| 25 |
+
- Eczema
|
| 26 |
+
- Keratosis
|
| 27 |
+
- Milia
|
| 28 |
+
- Rosacea
|
| 29 |
+
|
| 30 |
+
## π§ͺ Model Performance
|
| 31 |
+
- **Final Test Accuracy**: `95.60%`
|
| 32 |
+
- Evaluated on a balanced, augmented custom dataset of real-world dermatological images.
|
| 33 |
+
- **Confusion Matrix** indicates strong separation for all classes, with minor overlap in visually similar conditions.
|
| 34 |
+
|
| 35 |
+
## ποΈ Model Architecture
|
| 36 |
+
|
| 37 |
+
- β
**Backbone**: EfficientNetV2B0 (pretrained on ImageNet)
|
| 38 |
+
- π Global Average Pooling + Dense(512, ReLU) + Dropout(0.4) + Dense(6, Softmax)
|
| 39 |
+
- π **Loss Function**: `sparse_categorical_crossentropy`
|
| 40 |
+
- βοΈ **Class Weights**: Applied to handle minor variations
|
| 41 |
+
- π§ Fine-tuned with learning rate scheduling and layer unfreezing
|
| 42 |
+
|
| 43 |
+
## π§ Usage
|
| 44 |
+
|
| 45 |
+
### π Load the model (Keras format)
|
| 46 |
+
|
| 47 |
+
```python
|
| 48 |
+
from tensorflow.keras.models import load_model
|
| 49 |
+
model = load_model("path/to/saved_skin_model")
|
| 50 |
+
````
|
| 51 |
+
|
| 52 |
+
### πΌοΈ Input Format
|
| 53 |
+
|
| 54 |
+
* Image size: **224x224**
|
| 55 |
+
* Input dtype: `float32`
|
| 56 |
+
* Preprocessing: Use `preprocess_input` from `tensorflow.keras.applications.efficientnet_v2`
|
| 57 |
+
|
| 58 |
+
```python
|
| 59 |
+
from tensorflow.keras.applications.efficientnet_v2 import preprocess_input
|
| 60 |
+
import numpy as np
|
| 61 |
+
img = preprocess_input(img) # Ensure shape is (1, 224, 224, 3)
|
| 62 |
+
pred = model.predict(img)
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
### π Output Format
|
| 66 |
+
|
| 67 |
+
* Softmax probabilities for 6 classes.
|
| 68 |
+
* `argmax(pred)` gives class index from 0β5.
|
| 69 |
+
|
| 70 |
+
---
|
| 71 |
+
|
| 72 |
+
## π§Ύ License
|
| 73 |
+
|
| 74 |
+
[MIT License](LICENSE)
|
| 75 |
+
|
| 76 |
+
---
|
| 77 |
+
|
| 78 |
+
## π¨βπ» Author
|
| 79 |
+
|
| 80 |
+
**Tanishq Shinde**
|
| 81 |
+
B.E. Computer Engineering, PICT
|
| 82 |
+
π [GitHub](https://github.com/Tanishq-789) | [LinkedIn](https://linkedin.com/in/tanishqshinde) | [Hugging Face](https://huggingface.co/Tanishq77)
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
+
|
| 86 |
+
> π¬ For educational and non-diagnostic purposes only. Always consult a medical professional.
|
| 87 |
+
|
| 88 |
+
```
|
| 89 |
+
---
|