Cutter state abnormity monitoring method based on hybrid resampling
Through vibration sensor acquisition and feature extraction, combined with weighted K-nearest algorithm and undersampling and oversampling technology, the sample imbalance problem during tool processing is solved, and the model detection accuracy and tool abnormality monitoring are improved.
Patent Information
- Application Number
- CN202310569954.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-19
- Publication Date
- 2024-12-13
AI Technical Summary
The existing technology cannot effectively solve the problem of sample imbalance during tool processing, resulting in insufficient recognition of abnormal state samples during training, and the inability to timely and accurately identify abnormal tool processing status.
Vibration sensors are used to collect vibration signals during processing, extract time-domain and frequency-domain features and dimensionality reduction fusion, and combine weighted K-nearest algorithm and undersampling and oversampling technology to build a model to achieve balance and tool of unbalanced samples Status abnormality monitoring.
It improves the accuracy of model detection, can handle imbalanced samples more scientifically, enhances the impact of subclass samples on the model, and improves the accuracy of tool abnormality monitoring.
Smart Images

Figure CN119128471A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of detection methods, and in particular to a tool state abnormality monitoring method based on hybrid resampling. Background Art
[0002] With the rapid development of intelligent manufacturing, the requirements for safe and stable operation of machine tools are becoming higher and higher. In particular, tools are the most important execution end in the manufacturing process. About 70% of the parts in the production process need to be cut by tools. Therefore, the health and stability of tools have important engineering application value for ensuring processing quality and improving production efficiency. In the actual production process, compared with the normal processing state, the abnormal processing of tools only occupies a very small part of the entire production cycle. Therefore, the collected processing data is extremely unbalanced in both quality and quantity. This unbalanced data will be amplified in the subsequent model training process based on AI recognition and whether the tool is in a healthy working state, making the normal state sample have a much greater impact on the model than the abnormal state sample. This will cause the monitoring method that relies too much on balanced samples to fail, and it will not be able to identify the abnormal processing state of the tool in a timely and accurate manner.
[0003] Due to the above reasons, how to solve the problem of sample imbalance in the tool processing process is the key technical point to improve the model's ability to effectively distinguish abnormal state samples during training. The existing technology mainly identifies abnormal state samples in the following ways. Method 1: Incorporate the idea of clustering into the undersampling method, and balance the data set by deleting the cluster center of the majority class sample and the neighboring samples of the cluster center. Method 2: Introduce the idea of feature boundaries into the undersampling method, fully and effectively utilize the distribution of the original sample set, and reduce the elimination of effective information. Method 3: Through the minority sample synthesis oversampling technology, the strategy of random linear interpolation is adopted to improve the overfitting problem caused by sample duplication. Although the above methods balance the data ratio to a certain extent, due to technical limitations, on the one hand, the single balanced sampling process only reduces the impact of large-class data samples on model training, and does not fully utilize the information of small-class samples; on the other hand, when amplifying small samples, the single oversampling does not take into account the problem of data distribution differences, and it is easy to generate marginalized small data samples, thereby blurring the boundaries of samples of different categories. In summary, how to balance the unbalanced samples more scientifically and how to better improve the impact of small class samples on the model are still urgent problems to be solved. Summary of the invention
[0004] In order to overcome the disadvantages that the prior art cannot effectively solve the imbalance problem of samples in the tool processing process, which will have an adverse effect on the actual processing of the workpiece by the tool, the present invention provides a tool state abnormality monitoring method based on hybrid resampling, which uses a vibration sensor to collect vibration signals in the processing process under the joint action of relevant processes, extracts features from the collected signals, and performs dimensionality reduction fusion on the extracted indicators, then removes data points with redundant information, adds small class sample data points, selects the hyperparameters of the weighted K-nearest neighbor algorithm, and then conducts model training in the feature space to establish a model, thereby realizing tool abnormality monitoring under unbalanced samples and improving the model detection accuracy.
[0005] The technical solution adopted by the present invention to solve the technical problem is:
[0006] The tool state abnormality monitoring method based on hybrid resampling is characterized in that it includes the following steps: step A: through a vibration sensor installed on the main shaft of a machine tool, data including normal processing and abnormal processing of the tool are collected, and then the time domain and frequency domain features of the data are calculated, and all the features of the data are constructed into a feature space W of N*(14*n); step B: the space W obtained in step A is processed by principal component analysis technology, so that the data retains features with high discrimination while reducing the dimension and removes features with low correlation or discrimination. In order to facilitate the visualization of the feature space, the original high-dimensional feature space W is reduced to a three-dimensional feature space S, that is, the first three principal components after the dimension reduction are retained. quantity; step C: the three-dimensional feature space S data obtained in step B is processed by unilateral selection undersampling technology to obtain a data set T, and the cluster center neighbor samples and noise samples of some large categories of samples are removed by undersampling technology to preliminarily balance the data set; step D: the data set T obtained in step C is processed by boundary synthesis minority oversampling technology to obtain a data set A; step E: a fault recognition model is constructed by performing a weighted KNN algorithm on the final data set A; step F: the newly collected vibration data is preprocessed by steps A and B to obtain a three-dimensional feature S, and then sent to the fault recognition model constructed in step E for abnormal monitoring to determine whether the tool is in an abnormal working state.
[0007] Furthermore, in step A, the time domain includes eight features, namely, mean, variance, pulse factor, waveform factor, margin factor, skewness, peak-to-peak value, and kurtosis value; the frequency includes six features, namely, centroid frequency, mean square frequency, frequency variance, information entropy, spectrum energy ratio, and frequency conversion energy.
[0008] Furthermore, the step C includes the following sub-steps: step a: first initialize the data set N, which includes the centroids of all small class samples and large class samples. The centroid is obtained by calculating the mean of the large class sample data. The calculation formula is as follows: Step b: Construct a KNN classifier with a K value of 1 for the set N, and use this classifier to classify all large-category samples, that is, calculate the Euclidean distance from each large-category sample to the nearest small-category sample and the centroid of the large-category sample. The calculation formula is as follows: Step c: directly classify according to distance, and merge the misclassified large-category data into set N; Step d: after traversing all the large-category data, use the Tomek link method to remove the large-category data from the data set N to obtain the data set T.
[0009] Furthermore, in step C, the specific process of the Tomek link method is to take sample points x and y of different classes, d(x, y) represents the distance between the two sample points, and the Euclidean distance is also used. If for any third sample point z, the formula condition is satisfied Then (x, y) is called a Tomek link pair, and the sample points belonging to the large category in the Tomek link pair are removed.
[0010] Furthermore, in step D, the sub-category data in the data set T is divided into three categories, including safety, danger and noise. For the sub-category data of the danger category, according to the formula The synthetic minority oversampling technique is used to generate new data and obtain the final data set A.
[0011] Furthermore, in step E, firstly according to the formula The final data set A is standardized and calculated. Then, based on the K nearest neighbor algorithm, different types of samples are multiplied by the inverse of the data ratio after mixed sampling. Then, the random search optimization algorithm is used to adaptively select the hyperparameter K value and the metric distance, and a five-fold cross-validation scheme is adopted. The error is given by the formula Conduct monitoring model training and complete monitoring model construction.
[0012] The beneficial effect of the present invention is that, under the joint action of relevant data and steps, the present invention can resample the unbalanced samples more scientifically to improve the model detection accuracy. Specifically, firstly, a vibration sensor is used to collect the vibration signal in the processing process, and then the features (time domain features, frequency domain features and time-frequency domain) of the collected signal are extracted, and the principal component analysis technology is used to reduce the dimension of the extracted indicators; then, the unilateral selection undersampling technology is used to undersample the large class samples in the feature space after the dimensionality reduction fusion, and the data points with redundant information are removed; then, the boundary synthesis minority oversampling technology is used to oversample the small class samples in the feature space after the undersampling processing, and the data points of the small class samples are increased; finally, the random search optimization algorithm is used to adaptively select the hyperparameters of the weighted K-nearest neighbor algorithm, and the model training is performed in the feature space to establish the model, which realizes the tool abnormality monitoring under the unbalanced sample, and provides favorable technical support for effectively obtaining the tool health status. Based on the above, the present invention has a good application prospect. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 It is a schematic diagram of the experimental platform structure and sensor installation of the present invention.
[0014] Figure 2 It is a schematic flow chart of the method of the present invention.
[0015] Figure 3 It is a schematic diagram of the original feature space S after dimensionality reduction of the present invention.
[0016] Figure 4 It is a schematic diagram of the feature space T after being processed by the unilateral selection undersampling technology of the present invention.
[0017] Figure 5 It is a schematic diagram of feature space A after being processed by the boundary synthesis minority oversampling technology of the present invention.
[0018] Figure 6 It is a schematic diagram of the adaptive selection process of the hyperparameter K value and the distance metric of the present invention.
[0019] Figure 7 , 8 It is a test result diagram of the test set data before and after the mixed resampling processing of the present invention. DETAILED DESCRIPTION
[0020] The following will take the milling cutter processing status data on a CNC machine tool as an example to illustrate. The machine tool structure mainly includes several parts such as the workbench, tool, and tool holder. In order to ensure the accuracy and real-time nature of the data, a three-axis vibration sensor is installed on the tool holder connected to the tool handle. The sensor is connected to the industrial computer through a data acquisition module to realize the collection and transmission of three-directional vibration signals. The experimental table structure and the sensor installation position are shown in the figure. Figure 1 shown.
[0021] The tool state abnormality monitoring method based on hybrid resampling, the method flow is as follows Figure 2 As shown, in step 1, a vibration sensor installed on a machine tool is used to collect multiple sets of vibration data including two machining states of normal tool and chip jam, wherein the sampling frequency of the sensor is 2KHz and the speed of the milling cutter is 2000rpm; then the data is calculated including time domain and frequency domain features, the time domain includes 8 features including mean, variance, pulse factor, waveform factor, margin factor, skewness, peak-to-peak value, and kurtosis value, and the frequency includes 6 features including center of gravity frequency, mean square frequency, frequency variance, information entropy, spectrum energy proportion, and frequency energy; then, all the features of the data are constructed into a feature space W of N*(14*3), wherein N is the total number of positive and negative samples, and 14*3 is the total feature of the above-mentioned calculated features in three directions; the original data collected in this example include 780 normal machining states and 20 abnormal chip jam states, wherein the chip jam state refers to the state of the tool when the chips are attached to the tool handle during the machining process, which will seriously affect the stability and accuracy of the tool machining process. This step provides data for step 2.
[0022] Step 2: Use principal component analysis (PCA) on the feature space W obtained in step 1 to reduce the dimension of the data while retaining as many features with high discrimination as possible and removing features with low correlation or discrimination. To facilitate the visualization of the feature space, the original high-dimensional feature space W is reduced to a three-dimensional feature space S, that is, the first three principal components are retained after the dimension reduction. The initial data in this example is distributed as follows after dimension reduction: Figure 3 This step performs dimensionality reduction processing on the data provided in step one, removes features with low correlation or discrimination, and provides data for step three.
[0023] Step 3: Perform one-sided selection undersampling technology on the three-dimensional feature space S data obtained in step 2. Specifically, first, initialize the data set N, which includes the centroids of all the chip samples and normal samples. The centroid is calculated by calculating the mean of the normal sample data, as shown in formula (1): In the formula, x i ,y i 、z i is the data of three dimensions of normal samples, n is the total number of normal samples, is the data of the three dimensions of the centroid. Then, a KNN (K-Nearest Neighbor) classifier with a K value of 1 is constructed for the set N, and this classifier is used to classify all normal samples, that is, the Euclidean distance from each normal sample to the nearest card crumb sample and the centroid of the normal sample is calculated, as shown in formula (2). Where x i ,y i is the data of point x and point y, i represents the different dimensions of the data, and d is the Euclidean distance between points x and y. Then, the data is directly classified according to the distance, and the misclassified normal data is merged into the set N; after traversing all the normal data, the Tomek link method is used to remove the normal data from the data set N to obtain the data set T. The specific process of the Tomek link method is to take sample points x and y of different classes. d(x,y) represents the distance between the two sample points, and the Euclidean distance is also used. If for any third sample point z, the formula condition is satisfied Then (x, y) is called a Tomek link pair. Sample points belonging to the large category in the Tomek link pair are removed to obtain the data set T. Finally, the cluster center neighbor samples and noise samples of some normal samples are removed by undersampling technology. The original data set changes from 780 normal data and 20 card chip data to 400 normal data and 20 card chip data; the data ratio changes from 39:1 to 20:1, achieving the purpose of preliminary balancing the data set. The data distribution after the change is as follows Figure 4 This step uses undersampling technology to process the data provided in step 2, removes redundant data and outlier data in normal data, and provides data for step 4.
[0024] Step 4. First, the data set T obtained in step 3 is processed by borderline synthetic minority over-sampling technique (Borderline SMOTE); specifically, the chip data is divided into three categories, including safety, danger and noise. Safety means that more than half of the data point is surrounded by chip data; danger means that more than half of the data point is surrounded by normal data; noise means that all the data is surrounded by normal data. In the present invention, only the dangerous chip data is processed by synthetic minority over-sampling technique to generate new data and obtain the final training set data A. The generated new chip data is as shown in the formula As shown; where x is a minority sample defined as a dangerous class, is a small number of neighboring samples near x, x new The newly generated minority samples are generated by oversampling technology using boundary information to generate data for the chip samples. The training set changes from 400 normal data and 20 chip data to 400 normal data and 400 chip data; the data ratio changes from 20:1 to 1:1, achieving the purpose of balancing the data set. The data distribution after the change is as follows: Figure 5As shown in the figure. The change in data ratio shows that this method can effectively solve the problem of data imbalance in the training set and provide more sufficient data for the subsequent model training. This step uses oversampling technology to process the data provided in step three, and generates new chip data by classifying the chip data and using the boundary information, providing data for step five.
[0025] Step 5: Construct a fault identification model by applying the weighted KNN algorithm to the final data set A. First, according to the formula The final data set A is standardized; where σ(x) is the standard deviation of the data set, is the mean of the data set, x i is the original data, and x′ is the standardized data. Then, based on the K nearest neighbor algorithm, different types of samples are multiplied by the inverse of the ratio of the mixed sampling data. Then, the random search optimization algorithm is used to adaptively select the hyperparameter K value and the metric distance, and a five-fold cross validation scheme is used. The error is given by the formula Train the monitoring model and complete the construction of the monitoring model, where MSE i is the error each time, CV is the average of five errors, and the model training process is as follows Figure 6 This step uses the data provided in step 4 to train the model, completes the construction of the monitoring model, and provides a usable monitoring model for step 6.
[0026] Step 6: Preprocess the newly collected vibration data in steps 1 and 2 to obtain the three-dimensional feature S, and then use the fault recognition model built in step 5 to perform abnormality detection. In this example, the test set data selects 50 groups of normal and stuck samples. The impact of mixed sampling on the prediction results of the test set is as follows: Figure 7 , 8 As shown in the figure, it can be clearly seen that for large-class samples, whether mixed sampling is performed or not has no effect; for small-class samples, after mixed processing, the prediction result is improved from the original 76% accuracy to 86%, which fully demonstrates that the method proposed in this patent samples the data more scientifically and effectively improves the influence of small-class samples on the model.
[0027] Figure 1 , 2As shown in , 3, 4, 5, 6, 7, and 8, the present invention can resample the unbalanced samples more scientifically to improve the model detection accuracy under the joint action of relevant data and steps. First, a vibration sensor is used to collect vibration signals in the processing process; then, the collected signals are subjected to feature extraction, including time domain features, frequency domain features, and time-frequency domain features. The principal components analysis (PCA) technique is used to reduce the dimension of the extracted indicators; then, the one-sided selection undersampling technique (One-Sided Selection) is used to undersample the large class samples in the feature space after the dimensionality reduction fusion, and the data points with redundant information are removed; then, the borderline synthetic minority over-sampling technique (Borderline SMOTE) is used to oversample the small class samples in the feature space after the undersampling processing, and the data points of the small class samples are increased; finally, the random search optimization algorithm is used to adaptively select the hyperparameters of the weighted K-nearest neighbor algorithm (K-NearestNeighbor), and then the model training is performed in the feature space to establish the model, so as to realize the tool abnormality monitoring under the unbalanced samples. Compared with the traditional method of adding data, the present invention adopts a mixed sampling method, which, on the one hand, reduces the redundancy of large-class sample information and reduces the weight of the large-class sample cluster center in the subsequent model training. On the other hand, it makes full use of the easily confused information between small-class samples and large-class samples, increases the small-class data at the cross-border, and scientifically reduces the imbalance ratio of positive and negative samples, providing effective data for subsequent model learning. Compared with the traditional K-nearest neighbor algorithm classification method, this method uses a random search optimization algorithm to adaptively select the hyperparameter K value and metric distance of the K-nearest neighbor algorithm, and fully applies the influence of the imbalance ratio to the model training, which improves the accuracy of model construction, improves the overfitting of the model by imbalanced data, and provides favorable technical support for effectively obtaining the health status of the tool.
[0028] It will be apparent to those skilled in the art that the present invention is limited to the details of the exemplary embodiments described above and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, the embodiments should be considered exemplary and non-restrictive in all respects, and the scope of the present invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations that fall within the meaning and scope of the equivalent elements of the claims be included in the present invention.
[0029] In addition, it should be understood that although the present specification is described according to the implementation mode, the implementation mode does not only include an independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in the embodiments can also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A tool state abnormality monitoring method based on hybrid resampling, characterized in that: The method comprises the following steps: step A: collecting data including normal processing and abnormal processing of the tool by means of a vibration sensor installed on the main shaft of the machine tool, then calculating the time domain and frequency domain features of the data, and constructing all the features of the data into a feature space W of N*(14*n); step B: processing the space W obtained in step A by using the principal component analysis technology, so that the data retains the features with high discrimination while reducing the dimension and removes the features with low correlation or discrimination, and in order to facilitate the visualization of the feature space, the original high-dimensional feature space W is reduced to a three-dimensional feature space S, that is, the first three principal components after the dimension reduction are retained; step C: The three-dimensional feature space S data is processed by unilateral selection undersampling technology to obtain a data set T. The cluster center neighbor samples and noise samples of some large categories of samples are removed by undersampling technology to preliminarily balance the data set; step D: the data set T obtained in step C is processed by boundary synthesis minority oversampling technology to obtain a data set A; step E: a fault recognition model is constructed by performing weighted KNN algorithm on the final data set A; step F: the newly collected vibration data is preprocessed by steps A and B to obtain a three-dimensional feature S, which is then sent to the fault recognition model constructed in step E for abnormal monitoring to determine whether the tool is in an abnormal working state.
2. The tool state abnormality monitoring method based on hybrid resampling according to claim 1 is characterized in that: In step A, the time domain includes eight features, namely, mean, variance, pulse factor, waveform factor, margin factor, skewness, peak-to-peak value, and kurtosis value; the frequency includes six features, namely, centroid frequency, mean square frequency, frequency variance, information entropy, spectrum energy ratio, and frequency conversion energy.
3. The tool state abnormality monitoring method based on hybrid resampling according to claim 1 is characterized in that: Step C includes the following steps: Step a: First, initialize the data set N, which includes the centroids of all small class samples and large class samples. The centroid is obtained by calculating the mean of the large class sample data. The calculation formula is as follows: Step b: Construct a KNN classifier with a K value of 1 for the set N, and use this classifier to classify all large-category samples, that is, calculate the Euclidean distance from each large-category sample to the nearest small-category sample and the centroid of the large-category sample. The calculation formula is as follows: Step c: directly classify according to distance, and merge the misclassified large-category data into set N; Step d: after traversing all the large-category data, use the Tomek link method to remove the large-category data from the data set N to obtain the data set T.
4. The tool state abnormality monitoring method based on hybrid resampling according to claim 1 is characterized in that: In step C, the specific process of the Tomek link method is to take sample points x and y of different classes, and d(x, y) represents the distance between the two sample points. The Euclidean distance is also used. If for any third sample point z, the formula condition is satisfied Then (x, y) is called a Tomek link pair, and the sample points belonging to the large category in the Tomek link pair are removed.
5. The tool state abnormality monitoring method based on hybrid resampling according to claim 1 is characterized in that: In step D, the sub-category data in the data set T is divided into three categories, including safety, danger and noise. For the sub-category data of danger, according to the formula The synthetic minority oversampling technique is used to generate new data and obtain the final data set A.
6. The tool state abnormality monitoring method based on hybrid resampling according to claim 1 is characterized in that: In step E, first, according to the formula The final data set A is standardized and calculated. Then, based on the K nearest neighbor algorithm, different types of samples are multiplied by the inverse of the data ratio after mixed sampling. Then, the random search optimization algorithm is used to adaptively select the hyperparameter K value and the metric distance, and a five-fold cross-validation scheme is adopted. The error is given by the formula Conduct monitoring model training and complete monitoring model construction.
Citation Information
Patent Citations
Micro milling cutter wear online monitoring method based on principal component analysis and BP neural network
CN111611946A
Bearing state monitoring and fault diagnosis method under multiple working conditions
CN115688018A
Cited By
Fault identification method for boring and milling process of horizontal numerical control boring and milling machine
CN120116022A
