Skip to content

kovendhan5/intel-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pixelated Image Detection & Correction using Machine Learning

This project aims to correct pixelated images by utilizing a Convolutional Neural Network (CNN) model and SRGAN model is used to upscale pixelated images to higher resolutions. The project consists of two main parts: training the model and using the trained model to upscale and correct pixelated images.

Table of Contents

Introduction

Pixelated images are common in various scenarios, such as low-resolution cameras or privacy-preserving image sharing. This project addresses the challenge of restoring high-quality images from pixelated versions by leveraging deep learning techniques. The project is specifically designed to handle images with a resolution of 1920x1080 pixels, ensuring optimal performance and accuracy for high-definition images.

Project Structure

├── train_model.py # Code for training the model
├── upscaling.py # Code for upscaling and correcting pixelated images
├── README.md # Project documentation
├── /content/train # Directory containing training images
├── /content/test # Directory containing test images
├── /content/Image/Pixelated # Directory containing pixelated images for upscaling
├── /content/Image/Output # Directory for storing output images

Dependencies

To run this project, you will need the following dependencies:

  • Python 3.x
  • TensorFlow
  • NumPy
  • Pillow
  • Matplotlib
  • scikit-learn

You can install the dependencies using pip:

pip install tensorflow numpy pillow matplotlib scikit-learn

Dataset

The dataset should consist of two main directories:

/content/train: Contains training images with subdirectories for each class (e.g., Non-pixelated and Pixelated).
/content/test: Contains test images with subdirectories for each class.(e.g., Non-pixelated and Pixelated).
Ensure that the dataset is organized properly for the ImageDataGenerator to work correctly.

Model Training

The train_model.py script is used to train the CNN model. The script performs the following steps:

Defines image dimensions and batch size. Creates image data generators for training and testing datasets. Builds a lightweight CNN model for binary classification (non-pixelated vs. pixelated). Compiles and trains the model. Evaluates the model and prints the test accuracy. Saves the trained model and quantizes it for better performance. Usage
Run the following command to train the model:

python train_model.py

Upscaling Pixelated Images

The upscaling.py script is used to upscale and correct pixelated images using the trained and quantized TFLite model. The script performs the following steps:

Preprocesses the input image. Loads the TFLite model and allocates tensors. Invokes the model to process the image. Saves and plots the super-resolution image. Usage
Run the following command to upscale pixelated images:

python upscaling.py

Results

The model is evaluated using test accuracy, F1 Score, Precision, Recall, and Confusion Matrix. The quantized TFLite model size is also displayed for performance comparison.

How to Use

Prepare the dataset and place it in the appropriate directories (/content/train and /content/test).
Train the model using train_model.py.
Place the pixelated images to be corrected in /content/Image/Pixelated.
Run the upscaling.py script to generate the corrected images in /content/Image/Output.

Contributors

This project was a collaborative effort by a team of five friends. Each member contributed to different aspects of the project:

Bejisto Joseph.B : Data Collection,Model Architecture and Training.
Kamalesh.B : Model Evaluation and Quantization.
VijayaKumar.M : Upscaling Script and TFLite Integration.
Surya L : Documentation and Results Analysis.
Kovendhan.P : Project Coordination, Code Integration,Testing and GitHub Maintenance.

About

Pixelated Image Detection & Correction using Machine Learning

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages