
Back
June 25, 2024
Computer Vision
Quality Control in Manufacturing
Pfactorial
Share

Introduction
Welcome to the world of manufacturing, where getting things just right is not just a goal, but an absolute must. Imagine the process of turning basic materials into the gadgets, machines, or tools we use every day. It's a journey that requires careful attention to every tiny detail. This is where quality control steps in as the hero, making sure that every single part, whether it's a nut, a bolt, or a circuit, meets the high standards set by the industry.

In our blog, we're going to break down quality control in manufacturing, making it easy to understand. We'll explore why it's so important, what makes it work well . So, buckle up as we take a closer look at the world of quality control and discover how it plays a crucial role in creating top-quality products that we can rely on.
What is quality control and why is it used in manufacturing ?
Quality control (QC) is a systematic process implemented within manufacturing, production, or service-oriented industries to ensure that products or services meet specified standards and requirements. The primary goal of quality control is to detect and rectify deviations from established quality criteria, ensuring that the final output consistently adheres to predefined levels of excellence. This process involves comprehensive inspections, testing, and monitoring at various stages of production, from raw material acquisition to the final delivery of goods or services. Quality control measures are essential for enhancing product reliability, customer satisfaction, and overall organizational success by minimizing defects, optimizing processes, and maintaining consistency in output quality.
Deep learning has emerged as a powerful tool in the realm of quality control, revolutionizing the way industries monitor and enhance the precision of their manufacturing processes. Artificial neural networks, deep learning models can autonomously learn intricate patterns and features within vast datasets, allowing them to identify defects, anomalies, or deviations from quality standards with remarkable accuracy. In quality control applications, these models excel at image and signal processing tasks, such as inspecting manufactured products for imperfections, classifying defects, or predicting equipment failures. By continuously learning from data and adapting to evolving conditions, deep learning contributes to real-time decision-making, proactive issue resolution, and the overall optimization of quality assurance processes. This transformative technology not only bolsters efficiency and reliability but also opens doors to new possibilities for industries striving to achieve unparalleled levels of quality and consistency in their output.
Deep learning model for Casting Defect Detection
For this case study we are going to choose a casting product image dataset from Kaggle. You can download dataset from this link Visual Inspection of Casting Products using CNN | Kaggle.

Before going to implementation let us know about the dataset. Casting constitutes a manufacturing procedure where a liquid substance is typically poured into a mold featuring a hollow cavity mirroring the intended shape. The material is subsequently permitted to solidify, though this method introduces the possibility of defects. To mitigate such defective products, a quality inspection process is implemented. However, manual inspection proves to be time-consuming. So here we are going to build a model to automate this process.
Our dataset contains a combined total of 7328 image data points, divided into training and testing sets in two different folders. These all are the size of 300*300. There are mainly two categories. Defective and OK .
Train - def_front have 3758 and ok_front have 2875 images
Test - def_front have:- def_front have 453 and ok_front have 262 images
Let us see how our sample dataset looks. Here we are plotting one sample from defective and one from OK.

Data preprocessing :
Next we need to preprocess our image data. Preprocessing includes normalizing pixel values between 0 and 1 through division by 255, set image size to (300*300) and batch size to 64. Images are trained in batches, this improves the model while training. We have 2 classes so set class mode as binary. Set 20% as validation data. and generate train ,valid and test data accordingly.
So our data is ready. Now we have to build a model and train it. Here we are going to build a model with 2 convolutional layers followed by a max pooling layer. Finally fully connected layer and output layer with sigmoid activation.
Then train the model for 30 epochs.

Now, we create a model and save it for future use. Now it's time to evaluate our model. We are using a learning curve and confusion matrix for evaluation.
Accuracy is increasing after each epoch and loss is reduced.

Confusion matrix

Let's check our classification report. Our model is 98% accurate.

Next we are going to display our prediction. So that we can see how well our model is performing right?

Benefits of Quality Control
So hope you get an overview of what quality control is and its benefits. So we are going to sort out the benefits of quality control.
- Consistency and Standardization: Implementing quality control ensures that products adhere to consistent standards. This consistency is vital for meeting customer expectations and building a strong reputation for the brand.
- Cost Reduction: Detecting and addressing defects early in the manufacturing process helps prevent costly rework, recalls, or warranty claims. This proactive approach contributes to overall cost reduction.
- Customer Satisfaction: High-quality products lead to increased customer satisfaction. Meeting or exceeding customer expectations builds trust and loyalty.
- Process Improvement: Quality control involves continuous monitoring and analysis of manufacturing processes. Identifying areas for improvement can lead to increased efficiency, reduced waste, and optimize resource utilization.
Quality control in manufacturing is not just a procedure it is a necessity. Having quality control in place within a business helps ensure product quality and the overall success of a business. Applying machine learning and deep learning techniques make the process fast and precise. So, using quality control is not just a good idea—it's a smart move that brings success and reliability to a business.
Hope you could get an idea about quality control. Not only for casting , it can be applied across various industries to identify and address defective products. Wishing you joyful learning!

