File size: 2,018 Bytes
b9fe647 0555c53 b9fe647 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# Model Overview
This model is a fine-tuned Denoising Diffusion Probabilistic Model (DDPM) for generating images of flowers using the Oxford Flowers dataset. It builds upon the pretrained google/ddpm-cifar10-32 model and is optimized for training on a GPU.
# Model Details
```
Architecture: UNet2DModel
Noise Scheduler: DDPMScheduler
Training Data: Oxford Flowers dataset (nelorth/oxford-flowers)
Optimizer: AdamW
Learning Rate: 1e-4, adjusted using a cosine scheduler
Training Steps: 100 epochs
Batch Size: 64
Image Size: 32x32 pixels
```
# Training Configuration
The training process involves the following steps:
# Data Preprocessing:
Images resized to 32x32.
Random horizontal flipping applied for augmentation.
Normalized to the range [-1, 1].
# Noise Addition:
Random noise added to images using a linear beta schedule.
# Model Training:
The UNet model predicts the noise added to images.
The Mean Squared Error (MSE) loss is used.
The learning rate is adjusted with a cosine scheduler.
# Checkpointing:
Model checkpoints are saved every 1000 steps.
# Usage
Once trained, the model can be used for generating images of flowers. The trained model is saved as a DDPMPipeline and can be loaded for inference.
# Model Inference
```python
from optimum.intel.openvino import OVModelForImageGeneration
pipeline = OVModelForImageGeneration.from_pretrained("flower_diffusion_quantized", export=True)
images = pipeline(batch_size=4, num_inference_steps=50).images
images[0].show()
```
# Model Variants
FP32 Version: Standard precision model.
FP16 Version: Reduced precision for lower memory usage.
# Limitations and Considerations
Image Resolution: Trained at 32x32, which may limit the fine details.
Computational Requirements: A GPU is recommended for inference.
Dataset Bias: The model is trained solely on Oxford Flowers, so its generalization to other datasets is limited.
Quantized Model Accuracy: INT8 quantization may slightly reduce output quality but speeds up inference.
|