Skip to content

HBX814/ClassifierAndCustom_GAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation


AI vs Real Classification

Location:

AI_Vs_Real/Classifier.ipynb

Vision Transformer (ViT) Image Classification

This project leverages the Vision Transformer (ViT) model for classifying images into different categories. The code includes data preprocessing, model training, evaluation, and testing using the Hugging Face transformers library. The model is fine-tuned using a dataset stored locally, and predictions are made on a separate test dataset.

Requirements

Before running the code, ensure that the following dependencies are installed:

  1. TensorFlow: For model training and Keras functionality.
  2. tqdm: To visualize the progress during training and processing.
  3. scikit-learn: For Label Encoding and dataset handling.
  4. transformers: To use pre-trained Vision Transformer (ViT) models from Hugging Face.
  5. datasets: For loading and processing datasets.
  6. accelerate: To optimize model training and inference performance.
  7. PIL (Pillow): For image manipulation and resizing.
  8. torch and torchvision: For tensor operations and model predictions.

FFHQ Dataset with GAN: Image Generation and Classification

This repository provides code for training a Generative Adversarial Network (GAN) using the FFHQ dataset and uses generated images to train a simple CNN classifier.

Dataset Link:

Visit

Overview

  • Data: The FFHQ dataset (Flickr-Faces-HQ) is used for training the GAN. This dataset contains high-quality images of human faces.
  • Model: A WGAN-GP (Wasserstein GAN with Gradient Penalty) architecture is implemented, consisting of:
    • Generator: A neural network that generates synthetic images.
    • Discriminator: A neural network that distinguishes between real and generated images.
  • Training: The model is trained to generate high-quality images of human faces. The discriminator is trained to correctly classify real vs fake images while the generator tries to fool it.
  • Synthetic Data Generation: Once trained, synthetic images generated by the GAN are used to train a CNN classifier to distinguish between real and synthetic images.

Location:

GAN/Training.ipynb

Requirements

The following dependencies are required for the code:

  • Python 3.x
  • TensorFlow (>=2.0)
  • Numpy
  • Matplotlib
  • OpenCV
  • tqdm
  • Pillow
  • os
  • shutil

To install the required packages, you can use the following command:

pip install -r requirements_custom_gan.txt

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors