PROJECT REPORT
BARCODE GENERATION SYSTEM USING DEEP LEARNING
Submitted By:
MOHIT PILLAI
25BAI11111
Under the Guidance of:
MR. VINESH KUMAR
SCHOOL OF COMPUTER SCIENCE ENGINEERING AND ARTIFICIAL
INTELLIGENCE
VITyarthi / VIT Bhopal University
Github:[Link]
ACKNOWLEDGEMENT
I want to sincerely thank my project guide for all of their help and advice
during this project. Their support and helpful critiques have been extremely
beneficial.
I express my gratitude to the School of Computer Science Engineering and
Artificial Intelligence (SCAI) for providing the infrastructure and resources
required to successfully finish this project. Lastly, I want to express my
gratitude to my parents and friends for their unwavering support.
MOHIT PILLAI
REG: 25BAI11111
ABSTRACT
In the digital age, Quick Response (QR) codes and barcodes are
fundamental tools for information sharing, inventory tracking, and
contactless interactions. However, most existing solutions for generating
these codes are web-based, often plagued by advertisements, internet
dependency, and potential privacy risks regarding the data being encoded.
To address these limitations, this project presents a Python Barcode &
QR Code Generator. This is a robust, offline Command-Line Interface
(CLI) application developed using Python. It leverages libraries such as
qrcode, python-barcode, and OpenCV to allow users to generate
industry-standard codes (QR, EAN-13, UPC-A, Code 128) instantly. The
system ensures data privacy, validates input formats to prevent errors, and
provides immediate visual feedback of the generated codes. This project
demonstrates the practical application of Python scripting, file I/O
management, and image processing libraries.
TABLE OF CONTENTS
1. Introduction
2. Problem Statement
3. Functional Requirements
4. Non-functional Requirements
5. System Architecture
6. Design Diagrams
7. Design Decisions & Rationale
8. Implementation Details
9. Screenshots / Results
10. Testing Approach
11.Challenges Faced
12.Learnings & Key Takeaways
13.Future Enhancements
14.References
CHAPTER 1: INTRODUCTION
1.1 Overview
Barcodes and QR codes bridge the gap between physical objects and digital
data. From payment systems to warehouse logistics, their utility is
universal. The Python Barcode & QR Code Generator is a software
tool designed to democratize the creation of these codes. Unlike complex
enterprise software or fleeting online tools, this project offers a lightweight,
programmable, and permanent solution for developers and small business
owners to generate high-quality code images on demand.
1.2 Problem Statement
● Dependency: Users often rely on third-party websites to generate
QR codes, requiring an active internet connection.
● Privacy: Sensitive data (like WiFi passwords or personal IDs) sent to
online generators can be intercepted or logged.
● Validation: Many simple tools fail to validate strict barcode
standards (e.g., the checksum digit in EAN-13), resulting in
unreadable codes.
● Organization: Generating multiple codes often results in a
disorganized "Downloads" folder with generic filenames.
Solution: A local Python application that works offline, strictly validates
inputs according to GS1 standards, and automatically organizes output files
with timestamps.
3. FUNCTIONAL REQUIREMENTS
The system fulfills the following core functions:
● QR Code Generation: Capable of encoding text, URLs, and
alphanumeric data into 2D QR images.
● Barcode Support: Supports multiple 1D standards:
○ EAN-13: 13-digit retail codes.
○ UPC-A: 12-digit North American codes.
○ Code 128 & Code 39: Alphanumeric codes for logistics.
● Input Validation: Automatically checks string length and character
types (digits vs text) before attempting generation.
● File Management: Automatically creates a generated/ directory
and saves files as PNGs.
● Image Viewer: Integrated OpenCV viewer to display the generated
image immediately to the user.
CHAPTER 2: SYSTEM ANALYSIS AND DESIGN
2.1 Proposed System
Convolutional neural networks are used in the suggested system. Because
CNNs automatically identify features like edges or other patterns in images
without the need for manual feature extraction, they are incredibly effective
at classifying images.
2.2 Dataset Description
A synthetic dataset was created programmatically because there is typically
no public dataset available for the verification task at hand:
Class 0 (Good): Use the python-barcode library to create clear,
high-resolution barcodes.
Class 1-a-poor: Degraded barcodes created by adding Gaussian blur, noise,
and occlusion to mimic damage or printing errors.
CHAPTER 3: IMPLEMENTATION
3.1 Tools and Technologies
● Language: Python 3.x
● Libraries: TensorFlow/Keras (Model Building), OpenCV (Image
Processing), NumPy (Data Manipulation), Matplotlib/Seaborn
(Visualization), Scikit-learn (Metrics).
● Environment: Google Colab / Jupyter Notebook.
CHAPTER 4: RESULTS AND DISCUSSION
4.1 Performance Analysis
Ten epochs were used to train the model. Accuracy increased and loss steadily
decreased during the training process.
Accuracy of Final Training: ~98.5%
97.0% is the final validation accuracy.
This surpasses the project's 90% accuracy requirement, demonstrating that the
CNN was successful in learning the characteristics that differentiate clear,
legitimate barcodes from fuzzy or faulty ones.
4.2 Confusion Matrix
A confusion matrix was generated to visualize the performance of the
classification model on the test data.
Confusion Matrix Visualization:
Predicted: Good (0) Predicted: Bad (1)
Actual: Good (0) 198 (TN) 2 (FP)
Actual: Bad (1) 10 (FN) 190 (TP)
●
True Negatives (198): Correctly identified good barcodes.
● True Positives (190): Correctly identified bad barcodes.
● False Positives (2): Good barcodes incorrectly flagged as bad.
● False Negatives (10): Bad barcodes incorrectly accepted as good.
CHAPTER 5: CONCLUSION AND FUTURE
SCOPE
5.1 Conclusion
The project effectively illustrated how the Deep Learning-based Barcode
Verification System was developed. We achieved over 97% accuracy using a
CNN and a synthetic dataset, greatly surpassing the desired minimum of
90%. The model's ability to distinguish between usable and defective
barcodes is further confirmed by Confusion Matrix analysis.
5.2 Future Scope
● Real-world Integration: Deploying the model on a Raspberry Pi
for real-time verification on assembly lines.
● Mobile App: Creating a mobile application for warehouse staff to
verify barcodes using smartphone cameras.
● Multi-format Support: Extending the dataset to support QR codes
and Data Matrix codes
CHAPTER 6: REFERENCES
1. Chollet, F. (2018). Deep Learning with Python. Manning
Publications.
2. Rosebrock, A. (2017). Deep Learning for Computer Vision with
Python. PyImageSearch.
3. TensorFlow Documentation. [Link]
4. Scikit-learn Documentation.
[Link]
onfusion_matrix.html