|
|
--- |
|
|
license: mit |
|
|
tags: |
|
|
- image-classification |
|
|
- resnet50 |
|
|
- medical |
|
|
- acne-detection |
|
|
task: |
|
|
- image-classification |
|
|
output: |
|
|
- label: "level1" |
|
|
score: 0.98 |
|
|
widget: |
|
|
- text: "example_image.jpg" |
|
|
output: |
|
|
- label: "level3" |
|
|
score: 0.85 |
|
|
--- |
|
|
|
|
|
# ResNet-50 Model for Acne Severity Classification |
|
|
|
|
|
This is a fine-tuned ResNet-50 model designed to classify the severity of acne from medical images into five categories (Severity 1 to Severity 5). The model leverages transfer learning on ResNet-50 pre-trained on ImageNet and adapts it for acne severity classification tasks. |
|
|
|
|
|
--- |
|
|
|
|
|
## Model Overview |
|
|
|
|
|
## Model Details |
|
|
|
|
|
### Key Features |
|
|
- **Input:** Medical images of acne-affected skin. |
|
|
- **Output:** Severity classification with one of the following labels: |
|
|
- `level0` (No acne or minimal severity) |
|
|
- `level1` (Mild severity) |
|
|
- `level2` (Moderate severity) |
|
|
- `level3` (Severe or advanced acne) |
|
|
|
|
|
### Training Details |
|
|
- **Framework:** PyTorch |
|
|
- **Base Model:** ResNet-50 (pretrained on ImageNet) |
|
|
- **Dataset:** A balanced dataset of acne images annotated with severity levels (Severity 1 to 5). |
|
|
- **Preprocessing:** Images resized to 224x224 pixels, normalized using ImageNet statistics (mean: `[0.485, 0.456, 0.406]`, std: `[0.229, 0.224, 0.225]`). |
|
|
- **Optimizer:** Adam with a learning rate of 0.001. |
|
|
- **Loss Function:** CrossEntropyLoss. |
|
|
- **Epochs:** 10. |
|
|
- **Validation Accuracy:** 0.85 (on a held-out validation set). |
|
|
|
|
|
--- |
|
|
|
|
|
## How to Use the Model |
|
|
|
|
|
## Intended Use |
|
|
|
|
|
This model is intended for educational purposes and demonstrates image classification for medical images. It should not be used for clinical decision-making without further validation. |
|
|
|
|
|
## Example Usage |
|
|
|
|
|
You can use this model via the Hugging Face Transformers pipeline for inference. Ensure you have the `transformers` library installed: |
|
|
|
|
|
```bash |
|
|
pip install transformers |
|
|
``` |
|
|
|
|
|
### Hugging Face Inference API |
|
|
|
|
|
You can use the model via the Hugging Face Inference API by sending an image encoded in base64. Here’s an example: |
|
|
|
|
|
```bash |
|
|
curl -X POST https://api-inference.huggingface.co/models/YOUR_MODEL_NAME \ |
|
|
-H "Authorization: Bearer YOUR_API_KEY" \ |
|
|
-H "Content-Type: application/json" \ |
|
|
-d '{"inputs": "BASE64_ENCODED_IMAGE"}' |