Wafer Fault Detection
Technical Walk-through on Clustering based K-Means Algorithm for wafer fault detection
Wafer Fault Detection
Technical Walk-through on Clustering based K-Means Algorithm for wafer fault detection
What is wafer?
Wafer or Silicon Wafer, today an age where electronics is used in almost every aspects of daily life and may be there is someone who is not using electronic devices.
Wafer (In electronics), also called a slice or substrate, is a thin slice of semiconductor, such as a crystalline silicon (c-Si), used for fabrication of integrated circuits and in photovoltaic to manufacture solar cells.
Availability
Silicon is not only the second most abundant mineral on earth & Seventh most abundant substance in the entire universe. This means it is widely located and easily mined from earth’s crust.
Manufacturing
How are silicon wafers made?
Silicon wafers are manufactured from highly pure single crystals of silicon, there are several types of processes that are used world wide to produce the ideal silicon wafers the most famous and reliable silicon wafers manufacturing process is CZOCHRALSKI METHOD named after polish scientist named Zen Czochralski .
This process involves forming a cylinder-shaped ingot of pure monocrystalline silicon. This method involves pulling a single crystal from the “melt” compound.
There are requirements where the silicon wafers need to be either an n-type or p-type extrinsic semiconductor. For this, the manufacturing process will also include a step where a ‘dopant’ ,is mixed before pulling the single crystal and forming the cylindrical ingot. The dopant can be in the form of phosphorus or boron.
Using advanced cutting tools these cylindrical ingots sliced into extremely thin pieces horizontally, this creates the round and thin silicon wafers that we generally used in our daily electronic items. With thjis reliable manufacturing and advanced cutting technique we are able to provide from 10 micrometer to 1 millimeter and diameters ranging in between 25.4mm or 1 inch to 450 mm or 17.6 inches. These silicon surfaces provides surface resistivity.
Uses
- Computers, laptops and other computing devices.
- Smart phones and tablets and smart wearable devices.
- Manufacturing of Semiconductor.
- Numerous Home Appliances.
- Artificial Intelligence
- Robotics.
- Autonomous(Self Driving Cars)
- Thin Film Deposition Process.
- Fabricating Integrated Circuits
- MEMS manufacturing
- Diodes, Transistors and Rectifiers.
- Optoelectronic Components.
- Microchips.
- Solar Cell Development.
In this article, I will walk through how to build an Clustering based K-Means Algorithm for wafer fault detection step by step. It is split into 7 parts as below.
- Problem Solved in this project
- Data Description
- Data Validation
- Data Insertion in Database
- Model Training
- Model prediction
- Result visualization
Problem Solved in this project
The inputs of various sensors for different wafers have been provided. The goal is to build a machine learning model which predicts whether a wafer needs to be replaced or not
(i.e whether it is working or not) based on the inputs from various sensors.
There are two classes: +1 and -1.
+1: Means that the wafer is in a working condition and it doesn’t need to be replaced.
- 1: Means that the wafer is faulty and it needs to be replaced.
Data Description
The client will send data in multiple sets of files in batches at a given location. Data will contain Wafer names and 590 columns of different sensor values for each wafer. The last column will have the “Good/Bad” value for each wafer.
**Apart from training files, we also require a "schema" file from the client, which contain all the relevant information about the training files such as:**
**Name of the files, Length of Date value in File Name, Length of Time value in File Name, Number of Columns, Name of Columns, and their data type.**
Data Validation
**In This step, we perform different sets of validation on the given set of training files.**
**Name Validation: We validate the name of the files based on the given name in the schema file. We have created a regex patterg as per the name given in the schema file to use for validation. After validating the pattern in the name, we check for the length of the date in the file name as well as the length of time in the file name. If all the values are as per requirements, we move such files to "Good_Data_Folder" else we move such files to "Bad_Data_Folder."**
**Number of Columns: We validate the number of columns present in the files, and if it doesn't match with the value given in the schema file, then the file id moves to "Bad_Data_Folder."**
**Name of Columns: The name of the columns is validated and should be the same as given in the schema file. If not, then the file is moved to "Bad_Data_Folder".**
**The datatype of columns: The datatype of columns is given in the schema file. This is validated when we insert the files into Database. If the datatype is wrong, then the file is moved to "Bad_Data_Folder."**
**Null values in columns: If any of the columns in a file have all the values as NULL or missing, we discard such a file and move it to "Bad_Data_Folder".**
Data Insertion in Database
Database Creation and Connection: Create a database with the given name passed. If the database is already created, open the connection to the database.
Table creation in the database: Table with name — “Good_Data”, is created in the database for inserting the files in the “Good_Data_Folder” based on given column names and datatype in the schema file. If the table is already present, then the new table is not created and new files are inserted in the already present table as we want training to be done on new as well as old training files.
Insertion of file in the table: All the files in the “Good_Data_Folder” are inserted in the above-created table. If any file has invalid data type in any of the columns, the file is not loaded in the table and is moved to “Bad_Data_Folder”.
Model Training
**Data Export from Db: The data in a stored database is exported as a CSV file to be used for model training.
Data Preprocessing: Check for null values in the columns. If present, impute the null values using the KNN imputer. Check if any column has zero standard deviation, remove such columns as they don’t give any information during model training.
Clustering: K-Means algorithm is used to create clusters in the preprocessed data. The optimum number of clusters is selected.**
Model prediction
Result visualization
Great! That’s all of the journeys! If you need the source code, visit my
**Github page🤞🤞 .**
메타데이터
- post_id
- 6e2e279d21dc
- slug
- wafer-fault-detection-6e2e279d21dc
- url
- https://medium.com/@dwivedi.prashant91/wafer-fault-detection-6e2e279d21dc
- canonical_url
- https://medium.com/@dwivedi.prashant91/wafer-fault-detection-6e2e279d21dc
- author_url
- https://medium.com/@dwivedi.prashant91
- status
- ok
- fetched_at
- 2026-07-23 23:41:22