# Intelligent Framework Design for Quality Control in Industry 4.0
## 3 Materials and Methods  
Figure 3 depicts the proposed framework of pre-production and post-production quality control. For the pre-production model, vibration data are collected from the sensors installed on the surface of the induction motor. The sensors collect the data from the gearbox via the shaft of the motors. The data are routed from the sensor to the AI engines via internet gateways. The AI engine runs the deep learning model and monitors the health of the gear of the induction motor. The health condition is displayed on the screen attached to the AI engine. The database server is continuously storing the historic data and fault conditions. The display system helps the engineers and operators in the industries if any prognostic measures are required to avoid unexpected shutdowns. The post-production part is depicted in the top left of the figure. The machine vision system consists of a lighting system and camera to capture images of the final product on the conveyor belt of the production line. The images are sent to the AI engines, which are also trained for images of defective and good products. The AI engines perform preprocessing on the vibration data and image data set prior to making the classification and prediction of fault conditions. The database server will similarly store the historical data of faulty products and defect-free products. An alarm system can be added to the display to inform packaging personnel of defective products. Figure 4 provides the methodology for the proposed quality control framework; the framework consists of the following parts:  
1. Collection of vibration data from sensors;
2. Data cleaning and preprocessing;
3. Training and testing the ANN model for vibration data;
4. Collection and cleaning of product images;
5. Post-fabrication product fault detection using a CNN. Figure 3: Proposed intelligent framework. The proposed framework is divided into two parts, pre-production quality control and post-production quality control. In the pre-production quality control, the vibration pattern obtained from sensors installed on the surface of the motor is inspected for gear faults. The gear health of a production motor has a direct relation with the quality of the product. The faulty gear system of a motor will result in different surface faults on the product. Therefore, to make sure the product is manufactured as per quality standards, the health of the gear system of the production motor needs to be monitored. In the pre-production phase, an experiment is performed to ensure the health of the gear system of the motors used in production. The data are collected from two sensors installed on the surface of the induction motor. The sensors used in the data collection are accelerometers. Two sensors are installed horizontally and vertically near the shaft of the motor, respectively, to collect data along the x-axis and y-axis. Different experiments are performed to monitor the health of the gear system. The second part takes into account the images of the product already manufactured. The images are collected with a machine vision system and processed for fault detection using a convolutional neural network (CNN). The metal hex nut data are used as a test case for the fault detection experiment. The first experiment in the study involves utilizing an artificial neural network (ANN) to monitor the gear system's health under varying loads. Data from the sensors are categorized as sensor 1 data along the x-axis of the shaft and sensor 2 data along the y-axis of the shaft. The vibration data collected from the sensors are recorded as data points in a CSV file, encompassing 900,000 points from sensor 1 and sensor 2. The gear system operates at two load conditions, 0 Nm and 80 Nm, with the load controlled by a brake connected to the shaft. The sampling period is set at 0.0002 s, equivalent to 5000 samples per second. The gear data are recorded for six fault conditions: eccentricity fault, missing tooth, no fault, root crack, surface faults, and chipping tip.