Skip to content

Education

High-Resolution Face Generation Using DDPM

A deep learning project implementing Denoising Diffusion Probabilistic Models (DDPM) in PyTorch to generate realistic 256×256 human face images from random noise. Built using a U-Net architecture with self-attention and time embeddings, the model was trained on the CelebA-HQ dataset using dual NVIDIA T4 GPUs.

High-Resolution Face Generation Using DDPM

The challenge

Generating realistic, high-resolution human faces from scratch is a challenging generative AI task. The model must learn complex facial features, textures, lighting, and structural relationships while progressively removing noise from randomly initialized images. Achieving stable training and visually coherent results also requires an effective neural network architecture and a carefully configured diffusion process. 

Context

This project explores modern generative AI through Denoising Diffusion Probabilistic Models (DDPM), an alternative to Generative Adversarial Networks (GANs). The objective was to train a diffusion model from scratch using the CelebA-HQ dataset and generate synthetic human face images at 256×256 resolution. The implementation uses PyTorch and GPU-accelerated training to explore the practical challenges of high-resolution image synthesis.

The solution

Implemented a DDPM pipeline that learns to predict and remove noise over a sequence of diffusion timesteps. A U-Net neural network with self-attention and time embeddings serves as the noise predictor, while a linear noise schedule defines the forward and reverse diffusion processes. Mixed-precision training and GPU acceleration were used to improve training efficiency. The trained model can generate new synthetic face images from random noise without requiring a real face image as input during inference. 

Design

The model architecture was designed around a U-Net encoder-decoder structure with skip connections to preserve spatial information throughout the denoising process. Time embeddings provide the network with information about the current diffusion timestep, while self-attention helps capture relationships between different facial regions. The generation pipeline progressively transforms random noise into a structured image through iterative denoising. 

Architecture

  • Framework: PyTorch
  • Model: Denoising Diffusion Probabilistic Model (DDPM)
  • Neural Network: U-Net with self-attention and timestep embeddings
  • Dataset: CelebA-HQ
  • Image Resolution: 256 × 256 pixels
  • Diffusion Timesteps: 1,000
  • Noise Schedule: Linear
  • Optimizer: AdamW
  • Learning Rate: 0.0001
  • Training Acceleration: Automatic Mixed Precision (AMP) with dual NVIDIA T4 GPUs

Development

The model was implemented in Python using PyTorch, with a training pipeline for loading face images, adding scheduled noise, predicting noise, and optimizing the network using mean squared error (MSE) loss. Training was conducted for 46 epochs using GPU acceleration. An inference pipeline loads the trained checkpoint and generates synthetic face images through the reverse diffusion process. 

Results

The model completed 46 training epochs and achieved a reported MSE noise-prediction loss of 0.0266. The trained checkpoint supports generating 256×256 synthetic face images from random noise. This project demonstrates a practical implementation of diffusion-based image generation and provides a foundation for further experimentation with alternative noise schedules, faster sampling techniques, and improved image quality evaluation. 

Technology

Python PyTorch

Have a similar project in mind?

Your Privacy Matters

We use necessary cookies to keep INFORSORSA working properly. With your permission, we may also use optional cookies for preferences, analytics and marketing. You can manage your choices at any time. Privacy Policy · Cookie Policy