A deep learning project applying convolutional neural networks (CNNs) to perform image inpainting β restoring missing or corrupted regions in images. This project demonstrates skills in computer vision, neural network design, and image processing pipeline development.
π Project Overview
Image inpainting is the task of reconstructing missing or damaged parts of an image in a visually plausible way. This repository implements a CNN-based model that learns to fill missing patches by understanding the context of surrounding pixels.
The goal is to restore images with masked regions, whether randomly masked blocks or real-world corruptions, and produce seamless, realistic inpainted output.
π οΈ Features & Components
-
Data Preparation & Masking Generation of input images with masked regions (e.g. square patches, random missing pixels).
-
CNN Architecture Build encoder-decoder or U-Net style convolutional network for inpainting.
-
Training & Optimization
Loss functions (e.g. MSE, perceptual loss), regularization, epochs, checkpoints. -
Evaluation & Visualization
Side-by-side comparisons: original, masked, and inpainted images. -
Prediction / Inference Pipeline
A script or notebook to apply the trained model to new images for inpainting.
π Repository Structure
Image-Inpainting-using-CNN/
βββ data/ # (optional) training / testing image datasets
βββ models/ # saved model weights / checkpoints
βββ notebooks/ # Jupyter notebooks for experiments & visualization
βββ scripts/ # scripts for training, testing, inference
βββ requirements.txt # project dependencies
βββ README.md # this file
π§° Technologies & Skills Demonstrated
| Area | Tools / Libraries |
|---|---|
| Deep Learning | TensorFlow / Keras or PyTorch |
| Computer Vision | image processing, masks, data augmentation |
| Model Architecture | CNNs, encoder-decoder, skip connections |
| Training & Evaluation | loss functions, metrics, tuning |
| Data Visualization | matplotlib, PIL / OpenCV |
| Project Engineering | modular code, checkpointing, reproducibility |
π Installation & Usage
Prerequisites
- Python 3.7+
- GPU (optional but recommended)
- pip or conda environment
Steps
-
Clone the repo:
git clone https://github.com/UK183/Image-Inpainting-using-CNN.git cd Image-Inpainting-using-CNN -
Install dependencies:
pip install -r requirements.txt
-
Prepare dataset or provide image folder (with masks). Train the model:
python scripts/train.py
-
Perform inference / inpainting on new images:
python scripts/inference.py --input path/to/image.jpg
Visualize results (in notebooks or output folder) β compare original vs masked vs inpainted.
π Results & Examples:
Demonstrative examples showing original, masked, and inpainted images side by side.
Quantitative metrics (PSNR, SSIM, MSE) comparing performance across epochs or architectures.
Visual comparisons and qualitative evaluation of inpainted outputs.
π§ Key Learnings:
Gained hands-on experience designing CNN architectures for contextual image reconstruction.
Understood loss design (e.g. pixel-wise loss vs perceptual loss) and trade-offs in image generation tasks.
Learned scalable training, checkpointing, and inference workflows for CV tasks.
Improved ability to process and augment image data for neural network input.
Kazi Umar
Linkedin profile: https://www.linkedin.com/in/umar-kazi18
πΌ Data Analyst | ML Engineer | Data Science & AI Enthusiast | Power BI | Python | SQL