Skip to content

This repository contains the implementation of a Deep Convolutional Generative Adversarial Network (DCGAN) for generating handwritten digit images using the MNIST dataset.

Notifications You must be signed in to change notification settings

NDK22/DCGAN-for-MNIST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Digitscape: Handwritten Digit Generation with DCGAN

This project implements a Deep Convolutional Generative Adversarial Network (DCGAN) to generate handwritten digit images using the MNIST dataset. The DCGAN consists of a generator and a discriminator, trained together in an adversarial manner.

Requirements

  • Python 3.x
  • TensorFlow
  • Keras
  • NumPy
  • Matplotlib

Project Structure

  • Karavatt_05_01.py: Main script implementing the DCGAN model for generating digit images.
  • generated_images: Directory to save the generated images during training.
  • generator.h5: Saved trained generator model for future image generation.

Usage

  1. Ensure all required dependencies are installed.
  2. Run the Karavatt_05_01.py script to train the DCGAN on the MNIST dataset.
  3. Trained model and generated images will be saved in the project directory.

Key Components

  • Generator: Builds fake images from random noise vectors.
  • Discriminator: Distinguishes between real and fake images.
  • DCGAN Model: Combines the generator and discriminator into a single model for training.
  • Training Callback: Generates sample images during training for visualization.

Training Process

  1. Load the MNIST dataset and preprocess the images.
  2. Build the discriminator and generator models.
  3. Compile the DCGAN model with appropriate optimizers and loss function.
  4. Train the DCGAN on the MNIST dataset for a specified number of epochs.
  5. Save the trained generator model for future image generation.

Generated Images

  • Real Images: A sample of 10 real images from the MNIST dataset.
  • Generated Images: Images generated by the trained generator model during the training process.

Results

The DCGAN is capable of generating realistic-looking handwritten digit images resembling those from the MNIST dataset. The generated images exhibit similar characteristics to the real images, demonstrating the effectiveness of the DCGAN architecture for image generation tasks.

About

This repository contains the implementation of a Deep Convolutional Generative Adversarial Network (DCGAN) for generating handwritten digit images using the MNIST dataset.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages