# Anomaly Segmentation Based on Depth Image for Quality Inspection Processes in Tire Manufacturing
## 2 Materials and Methods
### System Architecture
#### 2.6.2 Tire Fault Inspection System  
The system trains tire defects and inspects defects, using the trained weights. When the tire inspection is completed, the detected defect area is visually communicated to the operator. If erroneous detection or non-detection error occurs, the operator re-labels relevant parts, and includes them in the training data.  
* Data loader  
The data loader loads tire depth images for defect detection and training. If the load data are training, the label data paired with the training data are also loaded.  
Data matching module: This module lists data for training and inspection and loads in order. When importing training data, it lists label data pairs that match the data. In addition, it separates the data into training data and validation data. When one epoch is finished during training, the training data set is randomly shuffled, and then loaded in order.  
Data slice module: The tire depth image is a long horizontal rectangle and is very large. Therefore, a significant amount of GPU memory is required for training and detection. Thus, the imported tire data are cut and used for training and detection. Tire data are cut  
Figure 10: The tire fault inspection system.  
into a square shape. If the error region is located on the cut surface, it may not train the complete error form. Considering this, when slicing the image, we slide by 1/2 of the slice size. In this paper, data are sliced with a step of 64 px in a 128 px square shape. The excess area that may occur while cutting the data is solved by filling the remaining area with zeros.  
Data stacking module: A three-channel image is created through the four processes proposed in this paper. Finally, we use this image for training and error detection.  
* Inspector  
Deep learning network training is performed through preprocessed data. Tire defect inspection is performed based on the weights that are trained.  
Model training module: If previously trained model weights exist, deep learning model training is performed based on those model weights. If there are no trained model weights, training is performed from the beginning.  
Weight applying module: The training result weight is applied to the tire inspection module. One of two types of weights can be used: (1) the weight of the epoch with the highest validation accuracy during training, or (2) the weight of the last epoch considering further training.  
Fault inspecting module: Defect areas are detected in the tire image based on the applied weights.  
* Visualizer  
The visualizer visually shows the training process or actual tire error detection results.  
Result visualizing module: When training, this module shows various training indicators, such as test, validation data-based loss, mean IoU, and validation results in real-time. In the case of tire error detection, the cut-out tire images are merged to show the area of the defect in the entire tire image.  
Feedback module: As a result of detecting a tire defect, false detection or data requiring additional training may be generated. At this time, the corresponding data are additionally labeled, and later included in the training data.