Downloads · 30 days
0
Radubotchway/dermaid-skin-condition-classifier
dermaid-skin-condition-classifier is a image classification model from Radubotchway. Use it when you need a label for an image. It is set up for keras. The card lists the license as mit.
A MobileNetV2 transfer-learning classifier that sorts a photograph of a skin condition into one of nine classes. Built as my final year project for BSc Computer Engineering at KNUST, 2024.
Downloads · 30 days
0
Access
Public
Updated Sep 1, 2026
Repo size
11.5 MB
Likes
0
Public
Click a slice to open those files.
.h511.4 MB · 99%
From the Hugging Face model README
A MobileNetV2 transfer-learning classifier that sorts a photograph of a skin condition into one of nine classes. Built as my final year project for BSc Computer Engineering at KNUST, 2024.
It was trained on a small public dataset for an undergraduate project. It has not been clinically validated, it has not been reviewed by a dermatologist, and it must not be used to make a medical decision. If you are worried about something on your skin, see a clinician.
| Condition | Type |
|---|---|
| Cellulitis | Bacterial |
| Impetigo | Bacterial |
| Clear Skin | Negative class |
| Athlete's Foot | Fungal |
| Nail Fungus | Fungal |
| Ringworm | Fungal |
| Cutaneous Larva Migrans | Parasitic |
| Chicken Pox | Viral |
| Shingles | Viral |
Index order in class_names.txt matches the softmax output order.
| Base | MobileNetV2, ImageNet weights, frozen |
| Head | GlobalAveragePooling2D, Dense(128, ReLU), Dense(9, softmax) |
| Input | 128 x 128 RGB, rescaled to [0, 1] |
| Loss | Sparse categorical cross-entropy |
| Optimiser | Adam |
| Training | 20 epochs, 80/20 train and validation split |
MobileNetV2 was chosen for size: the model has to load and run inference inside a Flask process on modest hardware, which rules out heavier backbones. The base is frozen, so only the classification head was trained.
Trained on 762 labelled images across nine classes, roughly 85 per class.
| Metric | Value |
|---|---|
| Best validation accuracy | 95.2% (epoch 8) |
| Final validation accuracy | ~94.5% |
| Final validation loss | ~0.19 |
| Training accuracy | 100% from epoch 3 onward |

Training accuracy reaches 1.0 by the third epoch and training loss falls to nearly zero, while validation loss flattens at 0.19 and stops improving. That is the model memorising the training set, not continuing to learn from it. The validation figure is real, but it sits on a validation split of a 762-image dataset, so a handful of images decide the last percentage point.
Treat 95% as "reasonable for this dataset size", not as a claim about performance in the wild.
Skin tone. This is the most important one. Public dermatology datasets skew heavily toward lighter skin tones, and this model inherits that. It will underperform on darker skin, which is exactly the population the project was built for. That gap is the motivation for the companion repository GAN-FOR-SKIN-COLOUR, a StarGAN implementation that translates lesion images across skin-tone domains to augment the training set.
Also:
The checkpoint is weights-only, so rebuild the architecture and load into it:
import numpy as np, tensorflow as tf
from tensorflow.keras import layers, models
from huggingface_hub import hf_hub_download
REPO = "Radubotchway/dermaid-skin-condition-classifier"
base = tf.keras.applications.MobileNetV2(
input_shape=(128, 128, 3), include_top=False, weights="imagenet")
base.trainable = False
model = models.Sequential([
base,
layers.GlobalAveragePooling2D(),
layers.Dense(128, activation="relu"),
layers.Dense(9, activation="softmax"),
])
model.load_weights(hf_hub_download(REPO, "model.weights.h5"))
class_names = open(hf_hub_download(REPO, "class_names.txt")).read().split("\n")
img = tf.keras.utils.load_img("photo.jpg", target_size=(128, 128))
x = np.expand_dims(tf.keras.utils.img_to_array(img) / 255.0, axis=0)
probs = model.predict(x)[0]
print(class_names[int(np.argmax(probs))], float(probs.max()))
Preprocessing must match training: resize to 128 x 128 RGB and divide by 255.
The skin disease dataset as published on Kaggle. The dataset itself is not redistributed here; download it from the original source.
MIT.