πŸŒ€ Fashion-MNIST Diffusion (Class-Conditional UNet)

This repository hosts a class-conditional diffusion model trained on the Fashion-MNIST dataset.
The model uses a UNet-based architecture with timestep and label conditioning, implemented using PyTorch and integrated with the πŸ€— Hugging Face Hub via PyTorchModelHubMixin.


🧩 Model Details

Property Description
Architecture Conditional UNet with residual and skip connections
Conditioning Class embedding (10 Fashion-MNIST labels) + timestep embedding
Framework PyTorch
Pipeline text-to-image (adapted for diffusion)
License MIT
Author Sherwin Roger

The model learns to denoise images progressively, generating class-conditional samples (e.g., shoes, shirts, coats) from Gaussian noise through iterative diffusion steps.


πŸš€ Load from Hugging Face

You can directly load the model using huggingface_hub:

from huggingface_hub import hf_hub_download
import sys
import importlib.util

model_file = hf_hub_download(
    repo_id="Sherwinroger002/fashion_mnist_diffusion_class_conditional",
    filename="modeling.py"
)

spec = importlib.util.spec_from_file_location("modeling", model_file)
modeling = importlib.util.module_from_spec(spec)
sys.modules["modeling"] = modeling
spec.loader.exec_module(modeling)

model = modeling.EmbUnetModel.from_pretrained(
    "Sherwinroger002/fashion_mnist_diffusion_class_conditional"
)

image = modeling.generate("Sneaker", model)
modeling.show_image(image)

Sample output

image

Usage

This model can generate only these classes [ 'T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat', 'Sandal', 'Shirt', 'Sneaker', 'Bag', 'Ankle boot' ] Pass the class name to make the model to generate the image

πŸͺͺ License

Released under the MIT License β€” free for commercial and research use.
If you use this model, please cite the repository and give credit to Sherwin Roger.


Citation

@software{fashion_mnist_diffusion_2025,
  author = {Sherwin Roger},
  title = {Fashion-MNIST Diffusion (Class-Conditional UNet)},
  year = {2025},
  url = {https://huggingface.co/Sherwinroger002/fashion_mnist_diffusion_class_conditional}
}
Downloads last month
84
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Dataset used to train Sherwinroger002/fashion_mnist_diffusion_class_conditional