0% found this document useful (0 votes)
11 views15 pages

DLMini Project LP5

Uploaded by

Pradnya Ghule
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views15 pages

DLMini Project LP5

Uploaded by

Pradnya Ghule
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

A PRELIMENERY REPORT ON

“Colorizing Old B&W Images using CNN”

SUBMITTED TO THE SAVITRIBAIPHULE PUNE UNIVERSITY, PUNE


IN THE PARTIAL FULFILLMENT OF THE REQUIREMENTS
FOR THE AWARD OF THE DEGREE OF

FOURTH YEAR (COMPUTER ENGINEERING)

SUBMITTED BY

Vaishnavi Gitte Roll no: C33334


Vaishnavi Jyotik Roll no: C43339
Gayatri Khokrale Roll no: C43345

Under the guidance of


Prof. Amruta Patil

DEPARTMENT OF COMPUTER ENGINEERING

STES’S SMT. KASHIBAI NAVALE COLLEGE OF ENGINEERING

VADGAON BK, OFF SINHGAD ROAD, PUNE 411041


SAVITRIBAIPHULEPUNEUNIVERSITY

2024-2025

1
CERTIFICATE

This is to certify that the project report entitles

“Colorizing Old B&W Images using CNN”

Submitted by

Vaishnavi Gitte Roll no: C33334


Vaishnavi Jyotik Roll no: C43339
Gayatri Khokrale Roll no: C43345

Are bonafide students of this institute and the work has been carried out by them under the
supervision of Prof. Amruta Patil and it is approved for the partial fulfillment of the requirement of
Savitribai Phule Pune University, for the award of the degree of Bachelor of Engineering
(Computer Engineering)

Prof. Amruta Patil Prof. R. H. Borhade


Project Guide Head of Department
Department of Computer Engineering Department of Computer Engineering

Dr. A. V. Deshpande
Principal,
Smt. Kashibai Navale College of Engineering Pune – 41

Place: Pune

Date:

2
ACKNOWLEDGEMENT

The present world of competition there is a race of existence in which those are having will to come
forward succeed. Project is like a bridge between theoretical and practical working. With this willing
we joined this particular project. First of all, we would like to thank the supreme power the Almighty
God who is obviously the one has always guided us to work on the right path of life.

We sincerely thank Prof. R. H. Borhade sir Head of the Department of Computer Science of Smt.
Kashibai Navale college of engineering, for all the facilities provided to us in the pursuit of this
project.

We are indebted to our project guide Prof. Amruta Patil , Department of Computer Science of Smt.
Kashibai Navale college of engineering. We feel it’s a pleasure to be indebted to our guide for his
valuable support, advice and encouragement and we think him for his superb and constant guidance
towards this project.

We are deeply grateful to all the staff members of CS department, for supporting us in all aspects.
We acknowledge our deep sense of gratitude to our loving parents for being a constant source of
inspiration and motivation.

NAME OF THE STUDENTS


Vaishnavi Gitte
Vaishnavi Jyotik
Gayatri Khokrale

3
ABSTRACT

Colorizing black and white (B&W) images is a challenging task that requires an understanding of image
semantics and contextual details to generate realistic colors. This project, titled "Colorizing Old B&W Images
using Convolutional Neural Networks (CNN)," aims to develop a deep learning-based solution to
automatically colorize grayscale images. By leveraging the power of CNNs, the model is trained on a large
dataset of colored images, learning the complex relationships between grayscale pixel intensities and their
corresponding colors. The trained model can then infer plausible color versions of historical or monochrome
photographs. This approach eliminates the need for manual intervention or artistic input, making it efficient
for restoring old photographs and enhancing visual media archives. The implementation focuses on designing
an effective CNN architecture, preprocessing the data, and evaluating the model’s performance using
qualitative and quantitative metrics. The final output demonstrates the potential of deep learning in
automating the colorization process and preserving visual history in a more vibrant form.

4
INDEX

Sr. No. Title of Chapter Page No.

1 Introduction 6

2 Problem Definition 7

3 Objectives 8

4 Features 9

5 Implementation 11

6 Code and Output 12

7 Conclusion 15

8 References 16

5
INTRODUCTION

In the early days of photography, images were captured in black and white due to technological
limitations. While these images hold historical and emotional value, their monochromatic appearance
lacks the vibrancy of real life. The task of colorizing such black and white (B&W) images—once a
labor-intensive manual process—is now being revolutionized through the power of deep learning and
computer vision. This mini project explores the use of Convolutional Neural Networks (CNNs) for the
automatic colorization of grayscale images, aiming to restore and enrich old photos with realistic and
aesthetically pleasing colors.

Colorization is a challenging problem because it is inherently ill-posed—there can be multiple plausible


color mappings for a single grayscale image. For instance, the color of a shirt in a black and white photo
could be red, blue, or green, and all of them would look natural without any context. To address this,
deep learning models are trained on large datasets of color images, enabling them to learn patterns and
object-color associations from real-world data.

This project not only demonstrates practical applications of CNNs in image processing but also
highlights the integration of data preprocessing, deep learning model design, and image post-processing.
By automating the colorization process, we can revive historical images, enhance visual storytelling, and
apply the technology in areas such as media restoration, film colorization, and heritage preservation.

6
PROBLEM STATEMENT

Black and white images, though historically valuable, lack the visual richness and emotional depth
that color images provide. Manual colorization of such images is a labor-intensive process that requires
expert knowledge and artistic skill, making it inefficient and impractical for large-scale applications.
The challenge lies in accurately predicting plausible colors for different objects and scenes in a
grayscale image, which is inherently an ambiguous and complex task. This project aims to address
this problem by implementing an automated solution using Convolutional Neural Networks (CNNs)
that can learn to generate realistic colorized versions of grayscale images. By training on large datasets
of color images, the model learns to associate grayscale patterns with their corresponding color values,
thereby enabling the automatic colorization of old black and white photographs.

7
OBJECTIVE
The main objective of this project is to develop a deep learning-based model using Convolutional
Neural Networks (CNNs) that can automatically colorize black and white images into realistic, full-
color versions. The project aims to implement a reliable and efficient solution that eliminates the
need for manual colorization by training a model on a dataset of color images and their grayscale
counterparts. The objective is to enhance the visual quality of old monochrome photographs,
preserve historical images in a more engaging form, and demonstrate the practical application of
image processing and deep learning techniques in the field of digital restoration and media
enhancement.

8
FEATURES

• Automatic Colorization: The system takes a black and white image as input and automatically
generates a colorized version without any manual intervention.

• Deep Learning-Based Approach: Utilizes a Convolutional Neural Network (CNN) trained on large
datasets to learn patterns and color distributions for realistic output.

• Image Preprocessing: Includes resizing, grayscale conversion, and normalization of input images to
prepare them for model prediction.

• Model Architecture: A custom CNN architecture with multiple convolutional and upsampling layers
designed to effectively extract features and reconstruct color images.

• Pre-trained Weights Integration: Supports the use of pre-trained model weights for faster inference
and improved colorization accuracy.

• Post-Processing of Output: Enhances the final output by converting the predicted image into a format
suitable for viewing and saving.

• Scalability: The model can be extended or improved further by training on more diverse datasets to
increase generalization and accuracy.

9
IMPLEMENTATION

➢ Import Required Libraries


Import TensorFlow, Keras, NumPy, and image processing libraries for building and training the
CNN model.

➢ Load and Preprocess the Grayscale Image


Load the black and white image, resize it to a standard size (256x256), convert it to a NumPy array,
and normalize the pixel values between 0 and 1.

➢ Expand Image Dimensions


Reshape the image to add the batch dimension, making it compatible with the input requirements
of the CNN model.

➢ Build the CNN Model


Define the Convolutional Neural Network architecture using multiple convolutional and up sampling
layers with ReLU and tanh activations.

➢ Load Pre-trained Weights


Load pre-trained weights into the model from a .h5 file to utilize previously learned features for
colorization.

➢ Predict Color Channels


Use the model to predict the a and b channels from the grayscale input image.

➢ Post-process the Output


Convert the predicted output to appropriate color space values, combine it with the original L channel,
and clip pixel values to the 0–255 range.

➢ Convert to RGB Format


Convert the image from Lab color space to RGB format so it can be saved and viewed properly.

➢ Save the Colorized Image


Save the final colorized image to the disk in a standard image format (JPEG, PNG, etc.).

10
CODE

11
12
OUTPUT

13
CONCLUSION

The project “Colorizing Old B&W Images using CNN” successfully demonstrates the application of deep
learning techniques in image restoration and enhancement. By utilizing Convolutional Neural Networks and
pre-trained weights, the system is able to intelligently predict and restore colors in black and white images,
giving them a more realistic and visually appealing appearance. This not only revives old memories captured in
monochrome but also highlights the potential of artificial intelligence in solving real-world problems in the field
of digital image processing. The results obtained are promising and show that with sufficient training data and
model optimization, the quality of colorization can be further improved for more detailed and accurate outputs .

14
REFERENCES

1. Zhang, R., Isola, P., & Efros, A. A. (2016). Colorful Image Colorization. European Conference on
Computer Vision (ECCV), 649–666. https://doi.org/10.1007/978-3-319-46487-9_40
2. Larsson, G., Maire, M., & Shakhnarovich, G. (2016). Learning Representations for Automatic
Colorization. European Conference on Computer Vision (ECCV), 577–593.
https://doi.org/10.1007/978-3-319-46487-9_35
3. TensorFlow. (n.d.). TensorFlow: An end-to-end open source machine learning platform. Retrieved
from https://www.tensorflow.org/
4. Chollet, F. (2015). Keras: Deep Learning for humans. Retrieved from https://keras.io/
5. OpenCV. (n.d.). Open Source Computer Vision Library. Retrieved from https://opencv.org/
6. Jason Brownlee. (2019). How to Develop a CNN for Image Colorization. Retrieved from
https://machinelearningmastery.com/how-to-develop-a-cnn-for-image-colorization-from-scratch/
7. classification. Advances in neural information processing systems, 649-657

15

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy