DhruvParth's picture
Upload README.md with huggingface_hub
11719a8 verified
|
raw
history blame
No virus
2.32 kB
---
license: mit
tags:
- pytorch
- diffusers
- unconditional-image-generation
- diffusion-models-class
---
### Fine-tuned Skin Rash Detection Model v2
#### Model Overview
- **Base Model**: `google/ddpm-celebahq-256`
- **Fine-tuning Dataset**: Skin Rash Dataset
- **Output Image Size**: 256 x 256 pixels
#### Updates and Changes
1. **Parameter Increase**:
- Previous Model: 18.54 Million Parameters
- Current Model: 113.67 Million Parameters
2. **Image Output Size**:
- Previous: 32 x 32 pixels
- Current: 256 x 256 pixels
3. **Batch Size**:
- Previous: 64 samples per batch
- Current: 6 samples per batch
4. **Gradient Accumulation**:
- Implemented gradient accumulation to simulate a larger batch size without exceeding GPU memory limits.
5. **Timesteps**:
- Reduced timesteps from 1000 to 40 for faster training and inference.
#### Training Details
- **Epochs**: 12
- **Number of Training Images**: 656
- **Optimizer**: AdamW with learning rate adjusted for gradient accumulation
- **Learning Rate**: Initially set at \(1 imes 10^-5\), adjusted for gradient accumulation
- **Gradient Accumulation Steps**: 2
- **Loss Function**: Mean Squared Error (MSE) Loss
#### Performance
- **Training Loss**: Monitored and recorded over 12 epochs, with periodic visualization of generated images to ensure the model learns effectively.
#### Training Environment
- **Hardware**: GPU with 15GB RAM
- **Software**: PyTorch, torchvision, diffusers library
#### Usage
- The fine-tuned model can generate high-resolution images of skin rashes, which can be useful for medical analysis and diagnosis.
- Due to the increased parameter count and higher resolution, the model is more accurate in capturing fine details in the images.
#### Example Usage Code
```python
from diffusers import DDPMPipeline
pipeline = DDPMPipeline.from_pretrained('DhruvParth/ddpm-celebahq-256-fineTuned-skin_rash_v2_12epochs')
image = pipeline().images[0]
image
```
```
#### Considerations
- **Batch Size**: Due to GPU memory constraints, batch size is limited to 6 samples.
- **Training Time**: Reduced timesteps to 40, allowing faster training and inference without significantly compromising on quality.
- **Gradient Accumulation**: Enabled to manage large model parameter count and small batch size effectively.