# Data Cleaning Model of Mine Wind Speed Sensor Based on LOF-GMM and SGAIN
## 4 Experiment on Outlier Detection and Imputation for Mining Ventilation Sensor Data  
### Anomaly and Fault Identification  
#### 4.1.1 Abnormal Data Identification  
Based on the wind speed data monitored by a wind speed sensor at a mine in Tangshan, the data were provided by the wind speed monitoring system of the north wing of the mine's ventilation shaft. The sensor data collected on 25 January 2024 were used as the sample data \(E_{\text{e}}\). To validate the model's effectiveness, data points 21, 66, and 167-170 \(E_{\text{e}}\) were removed, while data points 133, 214, and 288 were introduced as outliers to form a cleaned data sample. Data points 21 and 66 represent random single-point outliers with values of 0; data points 167-170 are local outliers with values of 0; and data points 133, 214, and 288 are random single-point outliers with randomly assigned values. The LOF values for these data points were all greater than the threshold, and manual simulations of two types of anomalies (types 2 and 3) from Step 3 in a real-world environment were conducted. For the noisy data, the LOF algorithm was applied to calculate the anomaly factor value for each data point. Due to the large scale of mine ventilation sensor data in practical applications, the number of neighbors was set to 100 in order to obtain more stable results, with different anomaly factor thresholds set. The accuracy of the LOF algorithm in the outlier detection process was compared under various thresholds. Table 1 presents the performance of the LOF algorithm in identifying outliers at different thresholds, while Figure 2 illustrates the effect of the LOF algorithm in outlier detection at different thresholds. When a sample point is identified as an outlier, it will be enclosed in a circle, with the circle's radius representing the degree of anomaly for each data point. A larger circle radius indicates that the data point deviates more from the normal value. Since the LOF algorithm cannot automatically determine the threshold, the GMM clustering algorithm was used to cluster the local anomaly factors of the LOF algorithm. First, the local anomaly factors generated by the noisy data were arranged in ascending order, and the GMM algorithm was applied to cluster the sorted local anomaly factors. The clustering results are shown in Figure 3. Based on the analysis of the clustering, the LOF threshold was automatically determined, and sample points with LOF values greater than the threshold were classified as outliers. By analyzing Table 1 and Figure 2, it can be concluded that the optimal threshold for local outliers in this dataset lay between 5 and 14, where the LOF algorithm achieved the best outlier detection performance without any misclassification. As shown in Figure 3, the GMM algorithm clustered the local anomaly factors into two categories, represented by blue and red circles. The classification points of the local anomaly factors in the dataset fell between 5 and 14. By setting the LOF algorithm threshold within this range and running the algorithm, the detection results were as shown in Figure 4. From Figure 4, it can be observed that the LOF algorithm provided the best detection performance. Therefore, it