0% found this document useful (0 votes)
21 views56 pages

Project Documentation PDF

The document presents a project report on an Industrial Casting Defect Identification System using Convolutional Neural Networks (CNN) aimed at automating the defect detection process in manufacturing. It highlights the limitations of manual inspection and proposes a deep learning approach to improve accuracy and efficiency in identifying casting defects. The system includes a web-based interface for real-time image analysis, ultimately supporting better quality control in manufacturing industries.

Uploaded by

pranavkarle986
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)
21 views56 pages

Project Documentation PDF

The document presents a project report on an Industrial Casting Defect Identification System using Convolutional Neural Networks (CNN) aimed at automating the defect detection process in manufacturing. It highlights the limitations of manual inspection and proposes a deep learning approach to improve accuracy and efficiency in identifying casting defects. The system includes a web-based interface for real-time image analysis, ultimately supporting better quality control in manufacturing industries.

Uploaded by

pranavkarle986
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

Vishwakarma College of Arts, Commerce and Science, Pune

A Project Report on
INDUSTRIAL CASTING DEFECT IDENTIFICATION SYSTEM USING
CONVOLUTIONAL NEURAL NETWORK (CNN)

Under the guidance of


Dr. Sudhir Chitins

: Submitted By :
Mansi Karande
Pranav Karle
Janhavi Khamkar

For
Savitribai Phule Pune University
[Link] (Comp. Sci.) Sem VI
Year 2025-26

1
BRACT’s
Vishwakarma College of Arts, Commerce and Science, Pune

CERTIFICATE

This is to certify that__________________, _________________of


[Link].(Comp. Sci.) Seat no. ________, ________has completed /
partially completed / not completed his/her academic Project titled
“__________________________” during the academic year 2025-2026
as partial fulfillment of the [Link]. (Comp. Sci.) course.

Project Guide HOD Principal

Internal Examiner External Examiner

2
INDEX
[Link] Contents Page No

1 Abstract Introduction

1.1 Motivation 6

1.2 Problem Statement 7-9

1.3 Purpose/Objective and Goals 10-11

1.4 Literature Survey 12-13

1.5 Project Scope and Limitations 14

2 System analysis

2.1 Existing systems 15

2.2 scope and limitations of existing systems 16-17

2.3 project perspective, features 18-19

2.4 stakeholders 20

2.5 Requirement analysis - Functional requirements, performance requirements, security 21-22


requirements etc.

3 System Design

3.1 Data Dictionary 23-24

3.2 Design constraints 25-26

3.3 System Model: Using OOSE 27-36

3.4 Data Model 37

3.5 User interfaces 38-39

4 Implementation details

4.1 Software/hardware specifications 40-42

5 Outputs and Reports Testing

5.1 Test Plan, Black Box Testing or Data Validation Test Cases, White Box Testing or 43-45
Functional Validation Test cases ,BVA(Boundary Value Analysis) and results

6 Screen Designing

6.1 I/O Screen 46-49

6.2 Reports 50-54

7 Conclusion and Recommendations Future Scope Bibliography and References 55

3
1. ABSTRACT INTRODUCTION

Abstract:-

In the manufacturing industry, quality inspection plays a very important role in ensuring that
products meet required standards. Casting is a manufacturing process in which molten metal is
poured into a mould cavity and allowed to solidify into the desired shape. However, during this
process various defects such as blow holes, pinholes, burrs, and shrinkage defects may occur.
These defects reduce the quality of the final product and may lead to rejection of the entire batch.
In many industries, defect inspection is still performed manually by human inspectors. This manual
inspection process is time-consuming, labor-intensive, and may lead to inaccurate results due to
human error.

To overcome these challenges, we propose an Industrial Casting Defect Detection System using
Convolutional Neural Networks (CNN). The system uses deep learning techniques to
automatically detect defects in casting products. A dataset containing grayscale images of
submersible pump impellers is used to train the CNN model. The model learns to classify images
into defective and non-defective categories based on visual features extracted during training.
Additionally, a web-based interface is developed using FastAPI to allow users to upload images
and obtain real-time defect detection results.

This system helps automate the inspection process, improves detection accuracy, and reduces the
time required for quality control. By implementing this solution, manufacturing industries can
reduce product rejection, minimize financial losses, and enhance overall production efficiency.

Keywords:- Industrial Automation, Casting Defect Detection, Convolutional Neural Network


(CNN), Deep Learning, Image Classification, FastAPI Web Application, Manufacturing Quality
Control.

4
Introduction:-

The accuracy of manual inspection is not always consistent because it depends on factors such as
human fatigue, concentration, lighting conditions, and differences in individual experience.
Studies show that manual inspection usually achieves around 85–90% accuracy, which means
some defective products may pass through inspection while some good products may be wrongly
rejected. Such errors can lead to financial losses, increased material waste, and reduced production
efficiency for manufacturing companies.

With the advancement of Artificial Intelligence (AI), Deep Learning, and Computer Vision,
automated inspection systems are becoming a promising solution for industrial quality control. In
this project, we develop an Industrial Casting Defect Detection System using Convolutional
Neural Networks (CNN). The system uses image-based analysis to automatically classify casting
components as defective or non-defective. A dataset containing grayscale images of submersible
pump impellers is used to train the CNN model so that it can recognize defect patterns effectively.

Furthermore, a web-based application developed using FastAPI allows users to upload casting
images and obtain real-time predictions from the trained model. By automating the inspection
process, this system helps improve defect detection accuracy, reduce manual effort, and increase
productivity in manufacturing environments.

Overall, the proposed system demonstrates how modern deep learning technologies can support
smart manufacturing and automated quality inspection, helping industries reduce losses and
maintain high product quality.

5
1.1 Motivation

The motivation behind this project arises from the challenges faced by manufacturing industries
in maintaining consistent product quality during the casting process. Casting components such as
submersible pump impellers are produced in large quantities, and even small defects can affect the
performance, durability, and reliability of the final product. Therefore, early and accurate detection
of casting defects is very important for ensuring high-quality standards.

Although experienced inspectors can identify many defects, this process is slow and highly
dependent on human judgment. As a result, some defective parts may pass through the inspection
process, while some good parts may be rejected unnecessarily, causing financial losses and reduced
efficiency.

The rapid advancement of Artificial Intelligence, Deep Learning, and Computer Vision
technologies provides an opportunity to improve traditional inspection methods. Convolutional
Neural Networks (CNNs) have proven to be highly effective for image analysis and pattern
recognition tasks, making them suitable for identifying defects in industrial products.

This project is motivated by the need to develop an automated casting defect detection system
that can assist industries in improving inspection accuracy and reducing dependency on manual
inspection. By using CNN-based image classification and integrating the model with a web
application using FastAPI, the system can analyze images of casting components and provide
quick defect detection results.

The main motivation of this work is to support smart manufacturing and automated quality
control, helping industries reduce production losses, improve product reliability, and increase
overall operational efficiency.

6
1.2 Problem Statement

A. What is the problem?


In the casting manufacturing industry, maintaining product quality is a major challenge. During
the casting process, defects such as blow holes, pinholes, shrinkage cavities, cracks, and surface
irregularities may occur due to improper mould design, temperature variation, or material
impurities. Currently, most industries rely on manual visual inspection by quality inspectors to
detect these defects. This process is time-consuming, labor-intensive, and not always accurate,
especially when large numbers of components need to be inspected.

B. What happens if the problem is not solved?


If this problem is not addressed, several issues may occur in manufacturing operations:

• Defective casting parts may pass through inspection and reach customers.

• Entire production batches may be rejected due to undetected defects.

• Increased production costs due to scrap, rework, and material waste.

• Reduced efficiency and slower production due to manual inspection delays.

• Damage to the company’s reputation and loss of customer trust.

C. Who will suffer from this problem?


The following stakeholders may be affected:

• Manufacturing companies – financial losses due to rejected products and rework.

• Quality inspection departments – increased workload and pressure during manual


inspection.
7
• Customers and industries using the products – may receive defective components that
affect machine performance.

• Production management teams – face delays and operational inefficiencies.

D. Why is it important to solve this problem?

• To improve the accuracy and reliability of defect detection.

• To reduce dependence on manual inspection processes.

• To minimize production losses caused by defective products.

• To improve manufacturing efficiency and productivity.

• To maintain consistent product quality and customer satisfaction.

E. How can the problem be solved?

The problem can be addressed by implementing an automated defect detection system using
Artificial Intelligence and Convolutional Neural Networks (CNNs). By training a deep
learning model on casting images, the system can automatically identify defective and non-
defective parts with high accuracy. Integrating the model with a web-based application allows
users to upload images and receive instant inspection results, making the system practical for real
industrial environments.

8
• The graph shows a general increasing trend in defect-related losses from 2009 to 2020,
followed by a gradual decline from 2021 to 2024.

• Losses steadily increased from ₹1,850 Cr (2009) to ₹3,200 Cr (2019).

• This rise is due to increased production, more foundries, and reliance on manual inspection.

• The highest loss occurred in 2020 (₹3,800 Cr).

• This spike is mainly due to the COVID-19 pandemic, which disrupted operations and
reduced inspection efficiency.

• After 2020, losses gradually decreased to ₹2,700 Cr (2024).

• This improvement is linked to:

o Better quality control systems

o Smart manufacturing initiatives

9
1.3 Purpose

The purpose of this project is to develop an automated system for detecting casting defects in
industrial manufacturing using Convolutional Neural Networks (CNN). In casting industries,
maintaining product quality is essential because defects in metal components can reduce
performance, reliability, and safety. Traditionally, defect detection is performed through manual
inspection, which is time-consuming and prone to human error.

This project aims to assist the quality inspection process by introducing an intelligent system that
can automatically analyze images of casting products and identify defects. By using deep learning
techniques and computer vision, the system can detect defects more quickly and consistently than
traditional manual inspection methods.

Additionally, the project includes a web-based interface using FastAPI, allowing users to upload
images of casting components and obtain instant predictions regarding whether the component is
defective or non-defective. This helps industries improve quality control, reduce inspection time,
and minimize production losses.

1.3 Objectives

• To develop a CNN-based deep learning model for detecting defects in casting products.

• To automatically classify casting images into defective and non-defective categories.

• To reduce dependency on manual visual inspection in quality control processes.

• To improve defect detection accuracy and consistency using machine learning


techniques.

10
• To develop a user-friendly web application using FastAPI for uploading images and
viewing prediction results.

• To assist manufacturing industries in reducing product rejection and financial losses.

• To support smart manufacturing and automated quality inspection systems.

1.3 Goals

The main goal of this project is to create an efficient, reliable, and automated defect detection
system for casting products using deep learning technology. The system is designed to improve
the quality inspection process by providing faster and more accurate defect detection compared to
traditional manual inspection methods.

By implementing this system, manufacturing industries can reduce inspection time, minimize
product rejection rates, and improve overall production efficiency. The project also aims to
demonstrate how Artificial Intelligence and computer vision technologies can be applied in
industrial environments to enhance quality assurance and support modern automated
manufacturing systems.

11
1.4 Literature Survey

The study [1] This work aims to improve large-scale image classification using deep learning on
the ImageNet dataset. The objective is to accurately classify high-resolution images into 1000
categories by using a powerful model. The authors use a deep convolutional neural network with
multiple convolutional, pooling, and fully connected layers, along with techniques like ReLU
activation, dropout, and GPU-based training to improve speed and reduce overfitting. Their
method achieves significantly better performance compared to earlier approaches, especially in
top-5 error rates. However, the model requires very high computational resources, taking several
days to train on GPUs. It also depends on large labeled datasets, which may not always be
available. Additionally, overfitting remains a challenge despite using regularization techniques like
dropout.

The study [2] this work aims to study how increasing the depth of convolutional neural networks
affects image classification accuracy. The objective is to improve performance on large-scale
datasets like ImageNet by using deeper architectures. The authors use ConvNets with very small
(3×3) filters and increase the number of layers to 16–19 while keeping other parameters fixed.
Their method achieves state-of-the-art results in image classification and localization tasks and
performs well on other datasets as well. However, deeper networks require more computational
power and longer training time. They can also be harder to train and tune effectively. Additionally,
the approach still depends on large labeled datasets for best performance.

The study [3] This work aims to solve the problem of training very deep neural networks and
improving image recognition accuracy. The objective is to make deeper networks easier to train
while achieving better performance. The authors introduce a residual learning method, where
shortcut connections are used to learn residual functions instead of direct mappings. This approach

12
allows networks to go as deep as 152 layers and still perform efficiently, achieving top results on
ImageNet and other datasets. The method improves accuracy and avoids the degradation problem
seen in deeper networks. However, the model still requires high computational resources and
complex architecture design. Additionally, training extremely deep networks can be time-
consuming and may need careful tuning.

The study [4] This work aims to improve object detection by making it faster and simpler using a
single neural network. The objective is to detect objects and their locations in an image in real
time. The authors propose YOLO, which treats object detection as a regression problem and
predicts bounding boxes and class probabilities directly from the full image. This method processes
images very quickly and can run in real time, making it suitable for applications like video analysis.
It also uses global image information, reducing false detections compared to earlier methods.
However, YOLO has lower accuracy than some state-of-the-art models, especially in precisely
locating small objects. Additionally, it may produce localization errors despite its high speed.

The study [4] This work aims to improve decision-making in sustainability and conservation
systems using an algorithmic approach. The objective is to develop a framework called algorithmic
reflexive governance that supports better management of socio-techno-ecological systems. The
authors combine ideas from artificial intelligence and democratic theory to design systems that
consider interactions between social, technological, and environmental factors. This method helps
create more adaptive and informed policies, especially for addressing climate change. However,
the approach is mostly theoretical and lacks practical implementation details. It may also be
difficult to apply in real-world systems due to complexity and interdisciplinary challenges.
Additionally, integrating diverse data and stakeholder inputs can be challenging.

13
1.5 Project Scope and Limitations

The scope of this project focuses on developing an automated casting defect detection system using
Convolutional Neural Networks (CNN) to assist industries in improving their quality inspection
process. The system is designed to analyze images of casting products, specifically submersible
pump impellers, and automatically identify whether the product is defective or non-defective.

The project includes the development of a deep learning model trained on a dataset of grayscale
images of casting components. The trained CNN model learns defect patterns and helps in
identifying common casting defects such as blow holes, pinholes, cracks, and surface irregularities.

Additionally, the system provides a web-based interface developed using FastAPI, allowing
users to upload images of casting parts and receive instant predictions from the trained model. This
system can support manufacturing industries by reducing manual inspection time, improving
detection accuracy, and supporting automated quality control processes.

Although the proposed system improves defect detection efficiency, it has certain limitations:

• The accuracy of the system depends on the quality and quantity of the training dataset
used for the CNN model.

• The model currently works only with images of submersible pump impellers and may
not directly support other casting products without additional training.

• If the input images are blurred, poorly illuminated, or captured from different angles,
the detection accuracy may decrease.

• The system focuses only on surface defect detection through images and may not detect
internal defects within the casting material.

• High computational resources may be required during model training, especially when
using large datasets.

14
2. SYSTEM ANALYSIS

2.1 Existing Systems for Defect Detection (Other Than Manual


Workers)
Apart from manual inspection by workers, several technologies are currently used in industries for
defect detection. However, these systems also have certain limitations.

Traditional image processing systems: Some industries use basic image processing techniques
where cameras capture images of casting parts and software analyzes them using predefined rules
such as edge detection or thresholding. These systems can detect simple surface defects but
struggle with complex defect patterns and variations in lighting conditions.

X-Ray Inspection Systems: X-ray inspection is used to detect internal defects inside casting
components, such as cavities or structural weaknesses. While this method is effective for internal
defect detection, it is expensive, requires specialized equipment, and may not be suitable for all
production environments.

Ultrasonic Testing Systems: Ultrasonic testing uses sound waves to detect internal flaws in metal
components. The waves travel through the material and reflect when they encounter defects.
Although this method is reliable, it requires skilled operators and additional equipment, making it
costly for small or medium industries.

Laser Scanning and Optical Inspection: Some advanced manufacturing facilities use laser
scanners or optical inspection systems to detect surface irregularities and dimensional errors. These
systems provide accurate measurements but are expensive and may require complex setup and
calibration.

Machine Vision Systems with Rule-Based Algorithms: Machine vision systems use cameras
and rule-based algorithms to detect defects automatically. However, these systems rely on
predefined parameters and cannot easily adapt to new defect types or variations in casting surfaces.

15
2.2 Scope of the Existing System

The existing defect detection systems in casting industries mainly focus on identifying visible
defects in manufactured components using manual inspection or basic inspection technologies.
These systems are used to ensure that defective products are identified before they are delivered
to customers. The inspection process generally involves visual examination of casting parts,
measurement of dimensions, and checking surface quality using traditional tools and equipment.

Some industries also use basic machine vision systems, X-ray inspection, or ultrasonic testing to
detect defects in metal components. These systems help in identifying certain types of defects such
as surface cracks, cavities, or internal flaws. However, these technologies are usually limited to
specific types of defects and require specialized equipment and trained operators.

The scope of the existing system is mainly restricted to basic defect identification and quality
control during the manufacturing process. These systems help industries maintain minimum
quality standards and reduce the chances of delivering defective products to customers.

However, the existing systems have limited capabilities in terms of automation, accuracy, and
real-time analysis. They often require human supervision and cannot easily adapt to new defect
patterns or variations in casting products. As a result, industries are now exploring advanced
technologies such as Artificial Intelligence and Deep Learning to enhance the defect detection
process and improve manufacturing efficiency.

16
2.2 Limitations of Existing Systems

• High installation and maintenance cost

• Difficulty in detecting complex defect patterns

• Limited flexibility for different casting products

• Requirement of specialized equipment and trained operators

• Lower adaptability compared to AI-based solutions

Because of these limitations, modern industries are moving toward AI-based defect detection
systems using Convolutional Neural Networks (CNN), which can automatically learn defect
patterns from images and provide higher accuracy and efficiency.

17
2.3 Project Perspective and Features

1. Project Perspective

From a system perspective, the project follows a layered architecture consisting of input,
processing, and output components. Initially, images of casting components, specifically
submersible pump impellers, are captured using cameras or uploaded through a web interface.
These images act as input to the system.

The core processing is performed by a trained Convolutional Neural Network (CNN) model,
which analyzes the images and extracts relevant features for classification. The model identifies
whether a given casting component is defective or non-defective based on learned patterns from
the training dataset.

The system is integrated with a web-based application developed using FastAPI, which serves
as the interface between users and the model. Users such as quality inspectors or machine
operators can upload images and receive real-time predictions.

The output of the system is displayed in the form of classification results along with prediction
confidence. The system is designed to be user-friendly, efficient, and suitable for real-time
industrial applications.

Overall, the project contributes to the development of smart manufacturing systems by


combining deep learning with web technologies to automate the quality inspection process.

18
2.3 Features of the System

Automated Defect Detection

The system automatically detects defects in casting components using a CNN model, reducing
the need for manual inspection and human intervention.

High Accuracy and Reliability

The use of deep learning ensures higher accuracy and consistent performance compared to
traditional inspection methods, minimizing human errors.

Real-Time Processing

The system provides instant predictions when images are uploaded, enabling quick decision-
making during the manufacturing process.

User-Friendly Interface

A web-based interface developed using FastAPI allows users to easily upload images and view
results without requiring technical expertise.

Image-Based Classification

The system processes grayscale images of casting products and identifies surface defects such as
cracks, blow holes, and pinholes.

Cost Efficiency

By minimizing manual labor and reducing defective product output, the system helps in lowering
overall operational costs.

Scalability

The system can be extended to support different types of casting components by retraining the
CNN model with new datasets.

19
2.4 Primary Stakeholders

• Quality Inspection Engineers – They use the system to detect defects in casting
components and ensure product quality.

• Manufacturing Companies / Foundry Industries – They implement the system to


improve quality control and reduce production losses.

• Production Managers – They monitor the inspection process and ensure that defective
products are identified during manufacturing.

• Machine Operators – They capture images of casting components and upload them to the
system for defect detection.

Secondary Stakeholders

• AI and Software Developers – They design, develop, and maintain the CNN model and
the web application.

• Maintenance Engineers – They ensure that the inspection system and hardware
components such as cameras function properly.

• Customers / End Users of Products – They benefit from receiving high-quality casting
components without defects.

• Management and Business Stakeholders – They evaluate system performance and


benefit from reduced production losses and improved efficiency.

20
2.5 Requirements Analysis

The requirements analysis defines the functional and system requirements needed to develop the
Industrial Casting Defect Detection System using CNN. These requirements ensure that the system
operates effectively and provides accurate defect detection in casting components.

• The system must accept images of casting components as input for defect analysis.

• The system must use a Convolutional Neural Network (CNN) model to analyze images
and detect defects.

• The system must classify casting images into defective and non-defective categories.

• The system must provide accurate and fast predictions to support industrial inspection
processes.

• The system must include a web-based interface (FastAPI) for uploading images and
displaying results.

• The system must store and manage the trained CNN model for efficient prediction.

• The system must handle grayscale images of size 300×300 pixels from the dataset.

• The system must provide reliable performance and consistent results during defect
detection.

• The system must be easy to use for quality inspectors and manufacturing operators.

• The system should support future improvements and scalability for detecting defects in
other casting components.

These requirements help ensure that the proposed system provides an efficient, accurate, and
user-friendly solution for automated casting defect detection in manufacturing industries

21
Functional Requirements

• Should correctly identify common casting defects like cracks, porosity, blowholes, etc.
• Image processing and defect detection should be completed within 1–3 seconds per image
• Capable of processing multiple images simultaneously (batch processing).
• Should work on moderate hardware (GPU/CPU) without heavy lag.
• System should provide consistent results under different lighting and image conditions.
• Easy upload and quick display of results.

Security Requirements:-

• Protect casting images and defect data from unauthorized access


• Allow access only to authorized users
• Protect trained CNN model from tampering or theft
• Prevent adversarial attacks (fake/manipulated images)
• Use secure communication protocols (HTTPS, SSL/TLS)
• Validate all input images before processing
• Secure APIs used for prediction
• Regularly update software and libraries

22
3. SYSTEM DESIGN

3.1 Data Dictionary Table

1. Input Data (Image Upload)

FIELD NAME DATA TYPE DESCRIPTION EXAMPLE

Unique identifier for each


Image_ID String captured image cast_ok_0_1

Input image of casting [Link]


Image_File File (JPEG/PNG) component

Image Resolution String Resolution of image


512x512

Image Size Integer Size of image in KB 8-12 KB

2. Processed Data (Preprocessing Stage)

FIELD NAME DATA TYPE DESCRIPTION EXAMPLE

Grayscale Image Array Converted grayscale image matrix Pixel values

Normalized Image Array Image after normalization 0–1 pixel range

Resized_Image Array Image resized for CNN input 224x224

23
3. Model Output Data

FIELD NAME DATA TYPE DESCRIPTION EXAMPLE

Output classification (Defective /


Prediction_Label String Defective
Non-Defective)

Float
Confidence_Score Probability score of prediction 0.92

Image_Type String Type of defect detected Non-Defective

4. User Data (Web Application)

FIELD NAME DATA TYPE DESCRIPTION EXAMPLE

User_ID String Unique user identifier novo@123

Password String User Verification admin123

User Department String Role Quality Control

Summary

The data dictionary provides a clear understanding of all data elements used in the system,
including input images, processed data, model outputs, user information. It ensures consistency,
improves system design, and helps developers and stakeholders understand how data flows within
the application.

24
3.2 Design Constraints

Hardware Constraints

The performance of the system depends on the availability of adequate hardware resources.
Training the CNN model requires high computational power, preferably a GPU, along with
sufficient memory. Limited hardware resources may result in increased training time and reduced
system efficiency. Additionally, image acquisition devices such as cameras are required for
capturing casting images.

Software Constraints

The system is developed using Python and deep learning frameworks such as TensorFlow/Keras
or PyTorch, along with FastAPI for the web interface. Proper compatibility with the operating
system (Windows or Linux) must be ensured. Dependency management and correct installation of
required libraries are essential for smooth functioning of the system.

Dataset Constraints

The accuracy and effectiveness of the CNN model largely depend on the dataset used for training.
A limited or unbalanced dataset may lead to poor model performance. Therefore, the dataset must
contain sufficient images representing both defective and non-defective classes with various defect
types.

Image Quality Constraints

The system relies on image input; hence, the quality of images plays a critical role. Poor lighting
conditions, low resolution, or blurred images may reduce the accuracy of defect detection.
Consistent image capturing conditions are required for better performance.

Performance Constraints

The system is expected to provide real-time or near real-time predictions. High processing delays
may affect usability in industrial environments. Therefore, model optimization and efficient
processing techniques must be considered to maintain acceptable response time.

25
Scalability Constraints

The current system is designed specifically for submersible pump impellers. Extending the system
to other casting products requires retraining the model with new datasets. The system should be
designed in a way that supports future scalability.

Security Constraints

The system must ensure the security of uploaded images and user data. Unauthorized access should
be prevented through proper authentication and access control mechanisms. Data privacy must be
maintained during storage and processing.

Integration Constraints

The system should be compatible with existing industrial processes and equipment. Integration
with cameras, databases, and other manufacturing systems must be considered for smooth
deployment.

Cost Constraints

The implementation of the system may involve costs related to hardware (such as GPUs), software
setup, and maintenance. Budget limitations may affect the adoption of the system, especially in
small-scale industries.

Maintenance Constraints

Regular maintenance is required to ensure system reliability. The CNN model may need periodic
retraining with new data, and the application must be updated to handle changing requirements
and technologies.

Summary

System design constraints define the boundaries within which the system must operate. By
considering constraints related to hardware, software, dataset, performance, scalability, and
security, the proposed system can be designed to be efficient, reliable, and suitable for real-world
industrial applications.

26
3.3 System model using OOSE (Object-Oriented Software
Engineering):-
OOSE helps design the system using real-world [Link] makes the system easy to understand
and reuse.

1. Object Modeling

Object modeling identifies the main objects (classes) in the system along with their attributes and
[Link] the proposed system, the main objects are:

• User
Represents the system user (Quality Inspector).
Attributes: user_id, username, role
Functions: login(), upload_image()

• Image
Represents the uploaded casting image.
Attributes: image_id, file_path, resolution
Functions: preprocess()

• CNN Model
Represents the deep learning model used for defect detection.
Attributes: model_parameters
Functions: predict(), train()

• Result
Stores the output of prediction.
Attributes: prediction_label, confidence_score
Functions: display_result()

• System/Application
Controls the overall workflow and integrates all components.

27
Relationships:

• User uploads Image

• Image is processed by CNN Model

• CNN Model generates Result

• Result is displayed to User

2. Dynamic Modeling

Dynamic modeling describes how objects interact with each other over time.

Working Flow:

• User logs into the system

• User uploads casting image

• System preprocesses the image

• CNN model analyzes the image

• Prediction result is generated

• Result is displayed to the user

Example Interaction:
User uploads image → System processes image → CNN model predicts → Result is displayed

3. Functional Modeling

Functional modeling explains what the system does from the user’s perspective.

The system provides the following functionalities:

28
• User Authentication (Login)
Allows secure access to the system

• Image Upload
Enables users to upload casting images

• Image Processing
Prepares image for CNN model

• Defect Detection
Classifies image as defective or non-defective

• Result Display
Shows prediction results with confidence score

Tools Used:-

• Use Case Diagram – shows user interactions.

• Class Diagram – shows system structure.

• Sequence Diagram – shows flow of actions.

Identification of Actors

Actors are external entities that interact with the system.

1. Primary Actors

• Quality Inspector – Uploads images and views defect detection results

• Machine Operator – Captures and uploads casting images

[Link] Actors

• System Administrator – Manages users and system operations

29
• CNN Model (Internal Component) – Processes images and generates predictions

Use Case Model


The system provides the following main functionalities:

• User Login

• Upload Image

• Image Preprocessing (Backend)

• Defect Detection using CNN

• Display Result

30
Use Case Table

Field Description

Use Case Name Detect Casting Defect

Actor Quality Inspector

Description User uploads image to detect defect

Preconditions User must be logged in

Postconditions Prediction result is displayed

Basic Flow Login → Upload Image → Process → Predict → Display Result

Alternate Flow Invalid image → Error message

31
4. Class Model

The system is represented using the following classes:

• User Class

o Attributes: user_id, username, password, department

o Methods: login(), logout()

• Image Class

o Attributes: image_id, file_path, resolution

o Methods: preprocess()

• CNN_Model Class

o Attributes: model_parameters

o Methods: train(), predict()

• Result Class

o Attributes: prediction_label, confidence_score

o Methods: display()

• System Class

o Methods: manage_flow(), integrate_modules

32
o

5. Sequence Model

The sequence of operations in the system is as follows:

1. User logs into the system

2. User uploads casting image

3. System receives and preprocesses image

4. CNN model analyzes the image

5. Prediction is generated

6. Result is displayed to the user

33
6. Activity Model

The workflow of the system is:

Start → Login → Upload Image → Validate Image →


Preprocess Image → Apply CNN Model → Generate Prediction →
Display Result → End

If invalid input → Show error → End

34
35
7. ER Diagram

36
3.4 Data Model

Data Collection

A dataset consisting of grayscale images of submersible pump impellers is used. The dataset
includes both defective and non-defective samples, which are essential for training the CNN
model.

Data Preprocessing

Before training the model, the input images undergo preprocessing steps:

• Conversion to grayscale

• Resizing images to a fixed dimension (e.g., 224×224)

• Normalization of pixel values (0–1 range)

• Splitting dataset into training and testing sets

37
3.5 User Interface Modules

Login Screen

The login interface is the entry point of the system where authorized users can access the
application. Features:

• Username and password input fields

• Secure authentication mechanism

• Login button for access

• Error message for invalid credentials

Purpose:
Ensures that only authorized users such as quality inspectors and administrators can access the
system.

Quality Control Dashboard

The dashboard provides an overview of the system and acts as the main navigation panel.

• Summary of inspection activities

• Navigation options (Defect detection with CNN, Detection with AI)

• Model overview

• User-friendly layout

Purpose:
Allows users to monitor inspection activities and navigate to different functionalities easily.

38
Model Image Upload Panel

This interface allows users to upload casting images for defect detection.

Features:

• File upload option (JPEG/PNG format)

• Upload/Submit button

• Image preview

• Instructions for proper image upload

Purpose:
Provides an easy way for users to input casting images into the system for analysis.

Result Display Interface

This interface displays the output generated by the CNN model after processing the image.

Features:

• Displays classification result (Defective / Non-Defective)

• Shows confidence score

• Option to upload another image

• Clear and readable result format

Purpose:
Helps users quickly understand whether the casting component is defective or not.

39
4. System Implementation

Model Development

A Convolutional Neural Network (CNN) model is developed for image classification. The model
includes:

• Convolutional layers for feature extraction

• Pooling layers for dimensionality reduction

• Fully connected layers for classification

• Activation functions such as ReLU and Softmax

The model is trained using labeled image data to learn defect patterns.

Model Training and Evaluation

• The dataset is divided into training and validation sets

• The model is trained using multiple epochs

• Performance is evaluated using accuracy and loss metrics

• Techniques like dropout may be used to prevent overfitting

Model Deployment

After training, the model is saved and integrated into a web application. The trained model is used
for real-time predictions on new images.

40
Web Application Development

A web application is developed using FastAPI:

• Provides an interface to upload images

• Sends images to the CNN model for prediction

• Displays results (defective/non-defective) with confidence score

Testing and Validation

The system is tested with new images to verify:

• Accuracy of predictions

• Response time

• System reliability

41
4.1 Software Specifications

Component Specification

Operating System Windows / Linux

Programming Language Python

Deep Learning Framework TensorFlow / Keras or PyTorch

Web Framework FastAPI

Development Environment VS Code / PyCharm / Jupyter Notebook

Libraries Used NumPy, Pandas, OpenCV, Matplotlib

API Testing Tool Postman (optional)

4.1 Hardware Specifications


Component Specification

Processor Intel i5 or higher

RAM Minimum 8 GB (16 GB recommended)

Storage Minimum 256 GB

GPU (Optional) NVIDIA GPU for faster training

Camera For capturing casting images

Internet Required for deployment and updates

42
5. Outputs Reports and Testing

5.1 Test Plan


2.1 Objectives of Testing

The main objectives of testing are:

• To verify the correctness of system functionalities

• To ensure accurate defect detection using the CNN model

• To validate user inputs and outputs

• To identify and eliminate errors or bugs

• To ensure system reliability and efficiency

2.2 Scope of Testing

The following modules are covered under testing:

• Login Module

• Dashboard Module

• Image Upload Module

• CNN Model Prediction

• Result Display Module

• Error Handling Mechanism

2.3 Testing Strategy

The system is tested using the following approaches:

• Black Box Testing – To validate input and output behavior

43
• White Box Testing – To verify internal logic and functionality

• Boundary Value Analysis (BVA) – To test edge cases

5.1 Black Box Testing (Data Validation Test Cases)


Black box testing focuses on validating system behavior without considering internal code
structure.

Test Case ID Input Expected Output Actual Output Result

TC01 Valid login credentials


Login successful Login successful Pass

TC02 Invalid login credentials Error message


Error message Pass
displayed
Upload valid image
TC03 Image accepted Image uploaded Pass
(JPEG)
Upload invalid file
TC04 Error message Error shown Pass
(PDF)

TC05 Upload corrupted image Error message Error shown Pass

TC06 Valid image input Prediction result Correct prediction Pass

5.1 White Box Testing (Functional Validation Test Cases)


White box testing verifies internal logic and code structure.

Test Case ID Input Expected Output Actual Output Result

Check authentication
TC07 Login Module Valid users allowed Pass
logic

Check preprocessing Image resized &


TC08 Image Processing Pass
steps normalized

TC09 CNN Model Check prediction logic Correct classification Pass

44
Check request/response
TC10 API Integration Proper data exchange Pass
flow

TC11 Error Handling Invalid input handling Proper error messages Pass

5.1 Boundary Value Analysis (BVA)


Boundary Value Analysis tests edge cases of input values.

Test Case ID Input Expected Output Actual Output Result

TC12 Image size (min) Very small image Process or reject Pass

TC13 Image size (max) Large image Process successfully Pass

Non-defective/low
TC14 Confidence score 0.0 Pass
confidence
Defective/high
TC15 Confidence score 1.0 Pass
confidence

TC16 Empty input No image uploaded Error message Pass

Test Results

• All modules were tested successfully

• The system correctly handled valid and invalid inputs

• CNN model provided accurate predictions

• No major errors were found during testing

• The system met all functional requirements

45
6. Screen Designing

6.1 I/O Screens

Input Screens

2.1 Login Screen (Input)

The login screen is used for user authentication.

Input Fields:

• Username

• Password

Description:
Users enter their credentials to access the system. Only authorized users are allowed to proceed.

46
2.2 Image Upload Screen (Input)
This screen allows users to upload casting images for defect detection.

Input Fields:

• Image File (JPEG/PNG format)

Description:
Users select and upload an image of the casting component. The system accepts only valid image
formats and prepares the image for processing.

3. Output Screens

Result Display Screen (Output)

This screen shows the defect detection result generated by the CNN model.

Output Details:

• Prediction result (Defective / Non-Defective)

• Confidence score
• Uploaded image preview (optional)

47
Description:
Displays the final output after processing the image. It helps users quickly understand whether
the casting component has defects.

3.3 Error Message Screen (Output)

This screen displays error messages for invalid inputs.

Output Details:

• Invalid file format message


• No image uploaded message

• Login failure message

48
Description:
Guides users to correct their input and ensures smooth system operation.

49
6.2 Report

Class-wise Performance

• For Non-Defect (Class 0):

o Precision is 0.98, meaning most samples predicted as non-defective are correct.

o Recall is 0.96, indicating the model correctly identifies most non-defective items.

o F1-score of 0.97 shows a strong balance between precision and recall.

• For Defect (Class 1):

o Precision is 0.95, meaning most predicted defects are correct.

o Recall is 0.98, which is very high and indicates the model successfully detects
almost all defective items.

o F1-score of 0.96 confirms reliable performance.

The slightly higher recall for defects is important, as it ensures very few defective products are
missed.

50
Overall Model Performance

• The model achieved an accuracy of 97%, indicating excellent classification capability.

• Both macro average and weighted average precision, recall, and F1-score are 0.97,
showing:

o Balanced performance across both classes

o No significant class imbalance issue

o Consistent and stable predictions

51
Accuracy Graph

• Training accuracy shows a steady and consistent increase from ~73% to ~89%, indicating
effective learning.

• The model is successfully capturing patterns from the training data.

• Validation accuracy shows improvement in the final epochs, suggesting the model starts
generalizing better.

• No sudden drops in training accuracy, which indicates stable learning behavior.

Loss Graph

• Training loss continuously decreases smoothly, showing proper optimization.

• The model is minimizing errors effectively during training.

• Validation loss shows a significant drop in later epochs, indicating improved performance
on unseen data.

• The final validation loss is much lower than earlier epochs, suggesting better
generalization at the end.

52
Confusion Matrix (Validation Set)

The confusion matrix is used to evaluate the performance of the CNN model in classifying casting
defects into two categories: Defect and Non-Defect.

From the matrix:

• 721 samples were correctly classified as Non-Defect (True Negatives).

• 563 samples were correctly classified as Defect (True Positives).

• 30 samples were incorrectly classified as Defect when they were actually Non-Defect
(False Positives).

• 12 samples were incorrectly classified as Non-Defect when they were actually Defects
(False Negatives).

53
Performance Analysis

The model achieved an overall accuracy of approximately 96.8%, indicating very high
classification performance.

• The precision for defect detection is high, meaning most predicted defects are actually
correct.

• The recall is also very high (~97.9%), which shows the model is highly effective in
identifying actual defective components.

• The number of false negatives (12) is very low, which is critical in industrial applications
because missing a defect can lead to serious quality issues.

• Although there are 30 false positives, this is acceptable since detecting extra defects is
safer than missing real ones.

In manufacturing systems, especially for casting defect detection:

• Minimizing false negatives is more important than minimizing false positives.

• The proposed CNN model performs well in this aspect, making it reliable for real-world
quality inspection.

54
References:-

Krizhevsky, A., Sutskever, I., & Hinton, G. E. (2012). ImageNet classification with deep
convolutional neural networks. Advances in Neural Information Processing Systems, 25,
1097–1105.
[Link]
[Link]

Simonyan, K., & Zisserman, A. (2014). Very deep convolutional networks for large-scale
image recognition. arXiv preprint arXiv:1409.1556.
[Link]

He, K., Zhang, X., Ren, S., & Sun, J. (2016). Deep residual learning for image
recognition. CVPR 2016, 770–778.
[Link]
VPR_2016_paper.html

Redmon, J., Divvala, S., Girshick, R., & Farhadi, A. (2016). You only look once: Unified,
real-time object detection. CVPR 2016, 779–788.
[Link]

Szegedy, C., Liu, W., Jia, Y., et al. (2015). Going deeper with convolutions. CVPR 2015,
1–9.
[Link]

Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep Learning. MIT Press.

[Link]

Mohan, A., & Raj, B. (2020). Deep learning for anomaly and threat detection in
surveillance systems. IEEE Access, 8, 112345–112362.

[Link]

55
56

You might also like