## 4 Experiment
### Data Preprocessing  
(1) Numerical processing: In this paper, the numerical processing of data uses the currently more commonly used label encoding. Label encoding is an encoding method that maps categorical variables to integer labels. Its basic idea is to assign a distinct integer label to each distinct categorical variable, and these labels are usually continuous integers from 0 to \(n-1\), where \(n\) is the number of distinct values of the categorical variable. (2) Data standardization: In this paper, we use Z-score standardization, which is the process of dividing the difference between each raw value and the mean by the standard deviation. This method can make the data distribution near the mean and at the same time unify the scale of the data for better comparison and analysis. And it prevents the raw data from being too explosive. Its mathematical Formula (10) is as follows:  
\[x^{\prime}=\frac{x-mean}{std} \tag{10}\]  
where mean represents the mean of the original data, and std represents the standard deviation of the original data. (3) Data sampling: Due to the large amount of data in the dataset, this paper uses the K-means cluster sampling method to sample the dataset. The basic idea of K-means sampling is to use the K-means algorithm to cluster the dataset, and then randomly select a small number of samples from each cluster as representative samples, and the final representative sample set is the sampling result. The K-means can reduce the size of the dataset to reduce the amount of calculation and storage space and can remove some redundant information and noise. (4) SMOTE method: There is a clear class imbalance in the collected dataset, which is the over-representation of normal samples in the dataset. This can lead to biased results of model training as well as reduced accuracy. In this paper, we propose the SMOTE method to deal with the class imbalance problem which is called Synthetic Minority Oversampling Technique. It creates new instances for a small number of classes to balance the dataset. The principle of SMOTE is based on the concept of KNN to synthesize high-quality instances and it does not simply replicate the instances as in random sampling which leads to overfitting. For each instance, \(X\) in the minority class, assuming that \(X_{i}\) is a random sample drawn from the \(k\) nearest neighbors of \(X\); a new synthetic instance \(X_{new}\) can be expressed by Formula (11) as:  
\[X_{new}=X+rand(0,1)\times(X_{i}-X),i=1,2,\ldots,k \tag{11}\]  
where \(rand(0,1)\) denotes a random number in the range (0,1), \(X_{i}\) is a randomly selected sample from the \(k\) nearest neighbors of \(X\) and \(X_{new}\) is a newly synthesized instance. So far, we have carried out data preprocessing work as well as feature selection work based on IG-FCBF. Finally we selected 22-dimensional feature data among the massive dimensional data. In order to reduce the complexity of the intrusion detection model, this paper adopts the Pearson correlation coefficient to analyze the influencing factors of the flow of robotic arm system. The Pearson correlation coefficient is a measure of the degree of linear correlation between two feature variables [34]. The exact principle is obtained by calculating the ratio between the covariance and the standard deviation of the two variables. If the correlation coefficient is closer to the value 1, it means that the two variables are closer to being perfectly positively correlated. Conversely, the closer the correlation is to a perfect negative correlation. If the correlation coefficient is 0, then there is no correlation between the two variables. As shown in Figure 4, darker colors indicate stronger correlations. We put the 22-dimensional feature data into the heat map display. The last column in the figure is class features, i.e., labeled data. The numbers in the figure illustrate the degree of association of each feature with the labeled data.