Improved confidence-based SOM model clustering method
Through the preliminary classification of the k-means algorithm and the comprehensive judgment of the confidence matrix, the problems of the traditional SOM model in the small number of categories and data impact are solved, and the clustering accuracy and feature representativeness are improved.
Patent Information
- Application Number
- CN202410806604.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-09-13
AI Technical Summary
When the traditional SOM model has fewer training sample categories, the clustering results are easily affected by the input order, and new data categories cannot be added linearly. Moreover, different categories of data interact with each other when updating the weight matrix, resulting in inaccurate clustering results.
The k-means algorithm is used to initially classify the sample data to eliminate the influence between different classes, and a confidence matrix is introduced based on the traditional SOM model to comprehensively determine the confidence of the winning neuron and its Euclidean distance from the input data. to determine the cluster labels.
It improves the accuracy of clustering results, reduces clustering errors caused by data fuzzy, makes fuzzy points in the data set easier to be clustered, and enhances the model's representativeness of features.
Smart Images

Figure CN118643364A
Abstract
Description
Technical Field
[0001] The invention relates to an improved confidence-based SOM model clustering method, belonging to the technical field of machine learning in artificial intelligence. Background Art
[0002] With the advent of the big data era, as a subset of artificial intelligence (AI), machine learning (ML) has received widespread attention. The concept of ML was proposed by Samuel AL. Its core idea is to enable computers to learn without precise programming. ML studies how to simulate human learning behavior to enable computers to acquire new knowledge and skills, reorganize existing model structures and optimize their own performance. It is a method that can predict the future based on the past, that is, using historical data and prior knowledge as training data to train a model, and then using the model to predict test data and continuously optimize the algorithm itself. Models are the basic elements of ML. Building models with the ability to accurately predict data is inseparable from a large amount of representative training data. Depending on whether the training data has label information, ML can be divided into two categories: supervised learning and unsupervised learning.
[0003] Supervised learning refers to the use of labeled data to train a model, that is, the input variables and output variables are known, and the output variables of the test data are predicted by establishing a corresponding relationship between the input and output. If the output variable is an approximation of the true value (i.e. quantitative analysis), this is a regression problem; if the output variable is a category (i.e. qualitative analysis), this is a classification problem. Classic algorithms in supervised learning include: K-Nearest neighbor (KNN), decision trees (DTs), Naive Bayes (NB), etc.
[0004] Unsupervised learning refers to training models using sample data that only has feature vectors but no label information. Its biggest feature is to understand the data itself from the data. The purpose of analyzing data is not limited to classification, but to find data patterns according to the characteristics of different dimensions. This is different from the idea of obtaining an optimal model through training with a data set with existing labels in supervised learning. This is also the reason why unsupervised learning is more widely used. Unsupervised learning is often used to reduce the dimension and cluster data. Dimensionality reduction is a process of compressing data information, that is, removing redundant data while retaining the data structure as much as possible to reduce data complexity. The main algorithms include principal component analysis (PCA, singular value decomposition, etc. Clustering is the automatic classification of data that has not been labeled in advance. Common clustering algorithms include: k-means clustering (k-means), DBSCAN clustering, hierarchical clustering, etc.
[0005] Self-Organizing Map (SOM) is a classic clustering algorithm in unsupervised learning. In recent years, it has been widely used in various fields, such as data visualization, cluster analysis, feature extraction of high-dimensional data, anomaly detection, and data preprocessing for other unsupervised learning. The SOM model (improved confidence-based SOMmodel, icSOM) maps high-dimensional input data to low-dimensional space nodes through unsupervised learning. Each neuron node has a corresponding weight vector, which represents the position of the neuron node in the input layer. Sample data with similar features will be mapped to adjacent neuron nodes, so that the output layer maintains the topological structure of the input data and reflects the relationship between the input data. Therefore, the SOM model is widely used in data visualization, dimensionality reduction, cluster analysis, etc. The Kohonen algorithm used in the SOM model was originally proposed by Teuvo Kohonen. Its core ideas are "self-organization" and "competition": the neurons in the output layer compete, and the winning neurons get the opportunity to respond to the input data; and the influence of the winning neurons on the remaining neuron nodes conforms to the "Mexican hat" function, that is, the neuron nodes around the winning neuron are in an excited state, and the neuron nodes far away from the winning neuron are in an inhibited state, which allows the weight vector related to the winning neuron to be updated in a direction that is more conducive to its competition; through continuous learning of input data, the output layer eventually forms a topological structure that can characterize the distribution of input data. The traditional SOM model consists of two layers: the input layer and the output layer. The input layer accepts sample data, and its dimension is the same as that of the input data; the output layer is composed of neuron nodes, which get the opportunity to respond to the input data through competition, so it is also called the competition layer; the input layer and the output layer nodes are fully connected through weight vectors, and the weight vectors characterize the connection strength and reflect the topological structure of the input data. Before training begins, the weight matrix is initialized and a random value is assigned to each weight vector; sample data is input and the Euclidean distance between it and each neuron node is calculated. The node with the smallest distance is used as the activation point, i.e., the winning neuron; the parameters of the activation point and the nodes in its neighborhood are updated to update each weight vector; the neighborhood function and learning rate are updated during each iteration; after multiple iterations of training, test data is input and the winning neuron mapped on the output layer represents the clustering category of the data.
[0006] The traditional SOM model belongs to unsupervised learning and has strong adaptability. Through the competition among neurons in the output layer, it can map high-dimensional data features to low-dimensional space and maintain the topological structure. However, it also has certain limitations. For example, when there are fewer categories of training samples, the clustering results will be affected by the order of inputs of different categories. Before learning is completed, new training data categories cannot be added to it. When the SOM model learns training data to update the weight matrix, data of different categories will affect each other. Summary of the invention
[0007] The purpose of the present invention is to address the defects and shortcomings of the above-mentioned prior art and provide an improved clustering method based on the confidence SOM model. In this method, sample data is first preliminarily classified by the k-means algorithm, and the classified data are trained with the SOM model respectively to eliminate the influence between different classes; based on the traditional SOM model, the concept of confidence matrix is proposed, and the confidence neuron is finally obtained by comprehensively judging the confidence of the winning neuron and the Euclidean distance between the winning neuron and the input data, and clustering labels are assigned to the data according to the category to which the confidence neuron belongs; finally, the optimization goal of improving the accuracy of the clustering results is achieved.
[0008] The technical solution adopted by the present invention to solve the technical problem is: an improved clustering method based on the confidence SOM model, sample data is first preliminarily classified by the k-means algorithm, and traditional unsupervised learning provides more data information; the classified data are respectively trained with the SOM model to eliminate the influence between different classes; the concept of confidence matrix is proposed on the basis of the traditional SOM model, and the confidence neuron is finally obtained by comprehensively judging the confidence of the winning neuron and the Euclidean distance between the winning neuron and the input data, and clustering labels are assigned to the data according to the category to which the confidence neuron belongs; finally, the optimization goal of improving the accuracy of the clustering result is achieved, and the theoretical derivation steps include:
[0009] Assume that the input layer of each SOM model consists of D nodes, where D is the same as the input feature dimension; the output layer contains M neuron nodes, forming a two-dimensional matrix, where M = X*Y. According to the empirical formula, Where N is the number of training samples, and the weight vector value w corresponding to each neuron node is randomly initialized. ij (i=1,2...D,j=1,2...M), generate an initial weight matrix W of size M*D, set the initial learning rate η0, the initial neighborhood decay rate δ0, the number of iterations T, and set a zero matrix as the initial confidence matrix.
[0010] Sample data preprocessing: input training data and perform normalization and regularization preprocessing to make the sample data features have the same measurement scale and avoid data overfitting;
[0011]
[0012] Use the k-means algorithm to pre-classify the data, randomly select k points as the initial clustering centers; assign each sample data x∈datas to the center point closest to it, and recalculate the center of the class; after reaching the iteration termination condition, the data is pre-classified into k classes (datas1, datas2, ...datas k ), the characteristics of each type of data can be represented by its center point weight vector.
[0013] datas1,datas2,...datas k As training data, train the SOM models respectively to obtain SOM1, SOM2, ...SOM k , each model training process includes:
[0014] Select a sample data x∈datas and calculate the Euclidean distance between each neuron node:
[0015] dis=||xw ij || (3)
[0016] Select the point with the closest distance (c x ,c y ) is the activation point, that is, the winning neuron of sample x mapped to the output layer, and dis is the Euclidean distance between sample data x and each neuron node;
[0017] Calculate the weight coefficient, update the neighborhood function, and set the weight coefficient of the activation point to 1; other neuron nodes calculate the distance between themselves and the activation point to obtain their own weight coefficients, and obtain the neighborhood function corresponding to this iteration:
[0018]
[0019] Among them, g(i,j) is the neighborhood function of each neuron node in the current iteration, δ is the neighborhood attenuation rate, and δ decreases with the increase of iteration number to achieve the reduction of influence as the number of iterations increases. The update formula is as follows:
[0020]
[0021] Where t is the current iteration number, t max is the maximum number of iterations;
[0022] At the same time, update the learning rate,
[0023]
[0024] Update the weight matrix. This process is similar to finding the cluster center. Each update makes wij Closer to x:
[0025] W(t+1)=W(t)+ηgg(xW(t)) (7)
[0026] Among them, g is the neighborhood function matrix composed of the neighborhood functions of each neuron node in this iteration, and W(t) is the weight matrix at the tth iteration.
[0027] Update the confidence increment Δc of each neuron node:
[0028]
[0029] When the iteration termination condition is met, the training is completed and the weight matrix W and confidence matrix C corresponding to each SOM model are obtained. At this time, the weight vector of each neuron on the output layer of each SOM model is infinitely similar to the mean of the input data mapped thereon, so each neuron is used to characterize the characteristics of the input data:
[0030]
[0031] Among them, x mean is the mean of the input data mapped to this neuron.
[0032] Furthermore, the present invention provides more data information for subsequent unsupervised learning through data pre-classification, takes sample data as input of the k-means algorithm, initializes the cluster center, assigns data points to the nearest cluster cluster in each iteration, and then recalculates the cluster center point. As the number of iterations increases, the data is clustered, and the feature weights of the cluster center points represent the characteristics of this type of data. After the k-means algorithm iteration is terminated, the sample data is pre-classified.
[0033] Furthermore, the present invention uses the pre-classified data for training SOM models of different categories to eliminate the influence between different categories. Different categories of data will influence each other in the process of training the weight matrix of the model, so that the winning neuron feature vector corresponding to a certain category of data is updated in the feature direction of other categories of data.
[0034] Furthermore, the present invention proposes the concept of confidence matrix based on the traditional SOM model, uses the original weight matrix as the search matrix, and proposes the concept of confidence matrix, the content of which is: initialize a zero matrix of size M×1 for each SOM model to store the confidence of each neuron node, where M is the number of neuron nodes in the output layer; the confidence of the winning neuron corresponding to the data x is increased by 1, and other neuron nodes calculate the distance between the winning neuron and obtain their own confidence increment Δc(i, j). After traversing all the training data, the confidence matrix C of the SOM model is obtained, which is normalized and the measurement scale is unified to facilitate the subsequent horizontal comparison between the confidence matrices of different SOM models.
[0035] Furthermore, the present invention proposes the concept of confidence neurons, and obtains confidence neurons by comprehensively judging the confidence of winning neurons and the Euclidean distance between them and input data. Finally, clustering labels are assigned to data according to the categories to which the confidence neurons belong. Test data are input into trained SOM models of different categories, and the corresponding winning neurons in the current SOM model are obtained according to the search matrix. At the same time, the confidence corresponding to the neuron can be obtained from the confidence matrix. A reasonable confidence threshold is set, and neurons with confidences that meet the conditions are screened and retained. Then, the Euclidean distance between the test data and the retained neurons is compared, and the node with the closest distance is selected as the confidence neuron of the test data, and the SOM model category to which the neuron belongs is used as the clustering result of the data.
[0036] Beneficial effects:
[0037] 1. The present invention uses the k-means algorithm to preliminarily classify the training data, and to a certain extent classifies the data with similar features into one category. The feature weights of the cluster center points can represent the characteristics of this type of data, providing more data information for model training and narrowing the information gap between unsupervised learning and supervised learning.
[0038] 2. The present invention uses the pre-classified data for the training of different categories of SOM models, eliminating the mutual influence of different categories of data during the weight matrix update process, so that the winning neuron can better represent the characteristics of this type of data. In the traditional SOM model weight matrix update process, the winning neuron feature vector corresponding to a certain category of data is updated in the direction of the characteristics of other categories of data, which to a certain extent reduces the representativeness of the neuron for the characteristics of this category of data.
[0039] 3. The present invention proposes the concept of confidence matrix based on the traditional SOM model, inputs the test data into the trained SOM models of different categories, obtains the corresponding winning neuron in the current SOM model according to the weight matrix, and obtains the confidence corresponding to the neuron from the confidence matrix; sets a reasonable confidence threshold, screens and retains neurons with qualified confidence, and then compares the Euclidean distance between the test data and the retained neurons, selects the node with the closest distance as the confidence neuron of the test data, and uses the SOM model category where the neuron is located as the clustering result of the data. In the traditional SOM model, if the Euclidean distance between a training sample and multiple neuron nodes is equal, that is, the data is a boundary point belonging to different categories, only one of the nodes can be randomly selected as the winning neuron, which will cause judgment errors; the confidence neuron discrimination method proposed in the present invention can solve the above problems, reduce the clustering error caused by data fuzziness, and make the fuzzy points in the data set easier to be clustered. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a schematic diagram of the "Mexican Hat" function.
[0041] Figure 2 This is the SOM structure diagram.
[0042] Figure 3 Flowchart for SOM model training.
[0043] Figure 4 Schematic diagram of the change of neuron weight vector in the SOM model.
[0044] Figure 5 Schematic diagram of neuron weights and confidence in the icSOM model.
[0045] Figure 6 Schematic diagram of finding confidence neurons in the icSOM model.
[0046] Figure 7 This is the flow chart of the icSOM model.
[0047] Figure 8 Visualize clustering results for different algorithms. Specific implementation methods
[0049] The invention will be further described in detail below in conjunction with the accompanying drawings.
[0050] This paper uses the IRIS dataset as the data to be analyzed, analyzes the specific implementation method of the icSOM clustering method, and combines Figure 8The effect comparison of clustering analysis of data by icSOM clustering method, traditional SOM, k-means algorithm and hybrid SOM algorithm is described. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the protection scope of the present invention.
[0051] The IRIS data set contains 150 samples and is evenly divided into three categories. Each sample is composed of 4 feature data, which respectively characterize the four features of the sample's calyx length, calyx width, petal length, and petal width, so IRIS is a two-dimensional matrix of size 150*4. Data clustering is achieved by analyzing the feature vectors of the IRIS sample data. It is randomly divided into training data and test data at a ratio of 7:3; the icSOM algorithm is compared with the traditional SOM, k-means algorithm, and hybrid SOM algorithm, and the clustering results are visualized using a scatter plot, so that the clustering relationship between different sample data and the clustering effect of each algorithm can be more intuitively observed; and the model clustering effect is analyzed based on the internal evaluation index Silhouette Score (Silhouette Score, S), the external evaluation index Adjusted Rand Index (Adjusted Rand Index, ARI), F1, and Accuracy (Accuracy, AC), and the performance of the method proposed in the present invention is analyzed. Internal evaluation indicators are used to evaluate algorithm performance when the true label of the data is unknown, using only relevant statistical characteristics obtained from the clustering results; external evaluation indicators are used to evaluate algorithm performance by calculating the degree of conformity between the predicted label and the true label of the data.
[0052] (1) Performance analysis of the embodiment:
[0053] Figure 8The clustering results of different methods on the training set and test set are shown; points of different colors in the scatter plot represent different data categories; the horizontal axis and vertical axis represent petal length and petal width respectively, and different feature data can be represented in the corresponding positions of the scatter plot by the horizontal and vertical axes. These two features are selected to represent the data because after calculating the Pearson correlation coefficient of the linear correlation between the four features and the class in the IRIS dataset, it is found that the class correlation of the two features, petal length and petal width, is high and can better represent the class. By observing the scatter plot, we can see that when the petal length and petal width are used to characterize the three types of oriole flowers, they present different distribution characteristics, that is, different petal lengths and petal widths locate the position of the data on the scatter plot; when the model is trained with the training set, different colors represent different types of oriole flowers, and then the test data is input to test its clustering effect. It can be found that: the test data is represented by the color of the training data with similar characteristics, that is, the test data is clustered into the same category of the training data with the same characteristics; the number of points presented in the scatter plot is slightly less than the number of training data and test data set by the code. This is because when the petal lengths and petal widths of different data are extremely close or completely consistent, they will appear in the same position on the scatter plot, and because of the consistent characteristics, they will be clustered into the same category, and the colors presented in the scatter plot are also consistent.
[0054] Table 1 shows the results of various evaluation indicators obtained after clustering analysis of the IRIS dataset using traditional SOM, k-means algorithm, hybrid SOM algorithm, and icSOM algorithm. In the traditional SOM model, the input data topology is mapped to the output layer by finding the winning neuron and updating the weight matrix, and data with similar features are clustered into the same cluster; after inputting the test data, the corresponding winning neuron is obtained according to the weight matrix, and the category to which the neuron belongs is the clustering label of this data. When the k-means algorithm clusters the IRIS dataset, the k value is set to 3, and three clusters are formed after multiple iterations, and the feature vector of the cluster center node represents the category to which the cluster data belongs. The hybrid SOM algorithm combines the traditional SOM model with the KNN model. The SOM algorithm is trained on a healthy dataset with a small amount of noise. After fitting the healthy data, the nodes that are too sparse or below the threshold are removed to avoid the winning neuron being contaminated by noise; a layer of KNN model is added after the SOM model to classify the data based on the Euclidean distance between the centroid and the observed data point. The process of processing data sets by the icSOM model is as follows: the data is pre-classified by the k-means algorithm, and then the SOM models belonging to different categories of data are trained separately. The test data searches for confident neurons in different SOM models, and the category to which the neuron belongs is the clustering label of this data.
[0055] Table 1 Comparison of clustering effects of different methods on the IRIS dataset
[0056]
[0057] As can be seen from the table, the icSOM algorithm has the highest silhouette score, which is 0.5262, which is higher than the traditional SOM and k-means algorithms, indicating that the improved SOM model after the k-means algorithm pre-classification can achieve higher intra-cluster compactness and inter-cluster alienation; the silhouette coefficient is only derived from the statistical characteristics of the clustering results without referring to the real label of the data, so the hybrid SOM algorithm after KNN classification has no information advantage, and its value of this index is slightly lower. The real label of the IRIS data set is introduced for external evaluation index analysis. In a broad sense, ARI measures the degree of fit between two data. It is observed that the hybrid SOM algorithm has the highest ARI value of 0.9724. This is because when it uses the SOM model to denoise the data, it discards some neuron nodes that do not meet the threshold setting and the sample data mapped to these nodes, which may affect the final ARI value calculation; the icSOM algorithm has the second highest ARI value of 0.9697, which is also very close to 1. The F1 value of the traditional SOM model is 0.86 and the ACC value is 0.8986. After combining it with the KNN algorithm to improve it into a hybrid SOM model, the above two index values are improved to 0.91 and 0.9268 respectively, indicating that the method of removing part of the data information through threshold judgment to improve the effectiveness of the data set is feasible, and the algorithm reduces the number of input and output and the calculation time, thus reducing the complexity of the algorithm. However, there is also a situation where some effective information is lost and clustering errors are generated; the F1 value of the icSOM algorithm is 0.92 and the ACC value is 0.9333, which shows that according to the process of analyzing data proposed by this algorithm, including data pre-classification, comprehensive judgment of the confidence of neurons and the Euclidean distance between neurons and data, and then obtaining confidence neurons, and assigning clustering labels to data, a better clustering effect can be achieved.
[0058] (2) Conclusion:
[0059] An improved clustering method based on the confidence SOM model is proposed, which can be used for cluster analysis of data. The sample data is first preliminarily classified by the k-means algorithm, and the pre-classified data is used to train different SOM models. After the concept of confidence matrix is proposed, the confidence of the winning neuron and the Euclidean distance between it and the input data are comprehensively judged to finally obtain the confidence neuron, and the clustering label is assigned to the data according to the category to which the confidence neuron belongs. The model provides more data information for traditional unsupervised learning by pre-classifying the data; the classification training SOM model can eliminate the influence between different classes to a certain extent; the comprehensive judgment method of the winning neuron makes the fuzzy points in the data set easier to be clustered. This implementation scheme takes the IRIS data set as an example, and analyzes the performance of the algorithm according to various internal and external evaluation indicators. Its contour score is 0.5262, the ARI value is 0.9697, the F1 value is 0.92, and the ACC value is 0.9333. The results show that the method proposed in the present invention can better process the sample data and achieve better clustering effect.
[0060] like Figure 7 As shown, the present invention provides an improved confidence SOM model clustering method, which specifically includes the following steps:
[0061] Assume that the input layer of each SOM model consists of D nodes, where D is the same as the input feature dimension; the output layer contains M neuron nodes, forming a two-dimensional matrix, where M = X*Y. According to the empirical formula, Where N is the number of training samples. Randomly initialize the weight vector value w corresponding to each neuron node ij (i=1,2...D,j=1,2...M), generate the initial weight matrix W, whose size is M*D. Set the initial learning rate η0, neighborhood decay rate δ0, number of iterations T, and set a zero matrix as the initial confidence matrix.
[0062] Sample data preprocessing: Input training data datas and perform normalization and regularization preprocessing to make the sample data features have the same measurement scale and avoid data overfitting.
[0063]
[0064] Use the k-means algorithm to pre-classify the data. Randomly select k points as the initial cluster centers; assign each sample data x∈datas to the nearest center point, and recalculate the center of the class; after reaching the iteration termination condition, the data is pre-classified into k classes (datas1, datas2, ...datas k ), the characteristics of each type of data can be represented by its center point weight vector.
[0065] datas1,datas2,...datas k As training data, train the SOM models respectively to obtain SOM1, SOM2, ...SOM k The training process of each model is as follows:
[0066] Select a sample data x∈datas and calculate the Euclidean distance between each neuron node.
[0067] dis=||xw ij || (12)
[0068] Select the point with the closest distance (c x ,c y ) as the activation point, that is, the winning neuron of sample x mapped in the output layer.
[0069] Calculate the weight coefficient and update the neighborhood function. Set the weight coefficient of the activation point to 1; other neuron nodes calculate the distance between the activation point and obtain their own weight coefficients, and obtain the neighborhood function corresponding to this iteration.
[0070]
[0071] Among them, δ decreases as the number of iterations increases, so as to reduce the degree of influence as the number of iterations increases. The update formula is as follows:
[0072]
[0073] At the same time, update the learning rate,
[0074]
[0075] Update the weight matrix. This process is similar to finding the cluster center. Each update makes w ij Closer to x.
[0076] W(t+1)=W(t)+ηgg(xW(t)) (16)
[0077] Update the confidence increment Δc of each neuron node,
[0078]
[0079] When the iteration termination condition is met, the training is completed. The weight matrix W and confidence matrix C corresponding to each SOM model can be obtained. At this time, the weight vector of each neuron on the output layer of each SOM model is infinitely similar to the mean of the input data mapped on it, so each neuron can be used to characterize the characteristics of the input data.
[0080]
[0081] Assume that the training data is divided into three categories by the k-means algorithm. During the training of the icSOM model, the changes and confidence of the weight vectors of each neuron node are as follows: Figure 4 As shown. Among them, x Ⅰ , x Ⅱ , x Ⅲ Belong to datas Ⅰ , datas Ⅱ , datas Ⅲ . The SOM model is trained with three categories of data to obtain their respective weight matrices and confidence matrices. The circles of different colors in the figure represent the range of winning neuron nodes of different categories of data mapped in the output layer. The change in color depth represents the similarity between the current neuron and the feature mean of this type of data. The number marked on each neuron node represents the normalized confidence of the node after training. It should be noted that the winning neuron position and confidence value shown in the figure are only assumptions, and if the confidence value of the neuron node is too small, it is not marked in the figure. Comparison Figure 5 ,It was found that the icSOM model used different types of data for training separately, which eliminated the mutual influence of different categories of data in the process of updating the weight matrix, making the winning neuron better able to represent the characteristics of this type of data.
[0082] Assuming that there are three types of data in the data set, we first use different types of data for training and get SOM. Ⅰ 、SOM Ⅱ and SOM Ⅲ .like Figure 6 As shown in Figure 1, when a test data is input into the model, the red mark represents the winner neuron obtained by mapping the test data on the output layers of the three SOM models. Ⅰ 、winner Ⅱ and winner Ⅲ The position of the test data and the distance between the winning neuron are Ⅰ 、dis Ⅱ and dis Ⅲ , and the confidence c corresponding to the mapping winning neuron Ⅰ 、c Ⅱ and c Ⅲ At this time, assume that:
[0083]
[0084] It was observed that although the test data and the winning neuron winner Ⅱ The shortest distance between them means that the test data is close to the winning neuron winner. Ⅱ The similarity is the highest. However, its corresponding confidence cⅡ The lowest value indicates that the winning neuron is Ⅱ It cannot well characterize the characteristics of Class II data, so the test data cannot be clustered into this category; similarly, although the winning neuron winner of the test data mapping Ⅰ Corresponding confidence c Ⅰ The highest value represents the winning neuron of this mapping. Ⅰ It can best characterize the characteristics of the first type of data. However, the test data and the winning neuron winner Ⅰ The distance between them is the farthest, which means that the test data does not meet the characteristics of Class I data, so the test data cannot be clustered into this category. Finally, after comprehensively considering the similarity between the data and the winning neuron and the confidence of the winning neuron, the test data is clustered into Class III.
[0085] The present invention eliminates the mutual influence of different types of data on the update of the weight matrix during the training process of the traditional SOM model. The training data is first preliminarily classified by the k-means algorithm to provide more data information for model training; the pre-classified data is used to train SOM models of different categories to eliminate the influence between different categories; the concept of confidence matrix is proposed on the basis of the traditional SOM model, and the confidence of the winning neuron and the Euclidean distance between the winning neuron and the input data are comprehensively judged to obtain the confidence neuron, and finally the clustering label is assigned to the data according to the category to which the confidence neuron belongs.
Claims
1. An improved confidence SOM model clustering method, characterized by: The sample data is first classified by the k-means algorithm, and traditional unsupervised learning provides more data information. The classified data are used to train the SOM model separately to eliminate the influence between different classes. The concept of confidence matrix is proposed based on the traditional SOM model. The confidence of the winning neuron and its Euclidean distance with the input data are comprehensively judged to finally obtain the confidence neuron. The data is assigned cluster labels according to the category to which the confidence neuron belongs. Finally, the optimization goal of improving the accuracy of clustering results is achieved. The theoretical derivation steps include: Assume that the input layer of each SOM model consists of D nodes, where D is the same as the input feature dimension; the output layer contains M neuron nodes, forming a two-dimensional matrix, where M = X*Y. According to the empirical formula, Where N is the number of training samples, and the weight vector value w corresponding to each neuron node is randomly initialized. ij (i=1,2...D,j=1,2...M), generate the initial weight matrix W, whose size is M*D, set the initial learning rate η0, the initial neighborhood decay rate δ0, the number of iterations T, and set a zero matrix as the initial confidence matrix; Sample data preprocessing: input training data and perform normalization and regularization preprocessing to make the sample data features have the same measurement scale and avoid data overfitting; Use the k-means algorithm to pre-classify the data, randomly select k points as the initial clustering centers; assign each sample data x∈datas to the center point closest to it, and recalculate the center of the class; after reaching the iteration termination condition, the data is pre-classified into k classes (datas1, datas2, ...datas k ), the characteristics of each type of data can be represented by its center point weight vector; datas1,datas2,...datas k As training data, train the SOM models respectively to obtain SOM1, SOM2, ...SOM k , each model training process includes: Select a sample data x∈datas and calculate the Euclidean distance between each neuron node. dis=||x-w ij || (3) Select the point with the closest distance (c x ,c y ) is the activation point, that is, the winning neuron of sample x mapped to the output layer, and dis is the Euclidean distance between sample data x and each neuron node; Calculate the weight coefficient, update the neighborhood function, and set the weight coefficient of the activation point to 1; other neuron nodes calculate the distance between themselves and the activation point to obtain their own weight coefficients, and obtain the neighborhood function corresponding to this iteration: Among them, g(i,j) is the neighborhood function of each neuron node in the current iteration, δ is the neighborhood attenuation rate, and δ decreases with the increase of iteration number to achieve the reduction of influence as the number of iterations increases. The update formula is as follows: Where t is the current iteration number, t max is the maximum number of iterations; At the same time, update the learning rate, Update the weight matrix. This process is similar to finding the cluster center. Each update makes w ij Closer to x: W(t+1)=W(t)+ηgg(xW(t)) (7) Among them, g is the neighborhood function matrix composed of the neighborhood functions of each neuron node in this iteration, and W(t) is the weight matrix at the tth iteration; Update the confidence increment Δc of each neuron node: When the iteration termination condition is met, the training is completed and the weight matrix W and confidence matrix C corresponding to each SOM model are obtained. At this time, the weight vector of each neuron on the output layer of each SOM model is infinitely similar to the mean of the input data mapped thereon, so each neuron is used to characterize the characteristics of the input data: Among them, x mean is the mean of the input data mapped to this neuron.
2. The improved confidence SOM model clustering method according to claim 1, characterized in that: Through data pre-classification, more data information is provided for subsequent unsupervised learning. The sample data is used as the input of the k-means algorithm to initialize the cluster center. In each iteration, the data points are assigned to the nearest cluster cluster, and then the cluster center point is recalculated. As the number of iterations increases, the data is clustered, and the feature weights of the cluster center points represent the characteristics of this type of data. After the k-means algorithm iteration is terminated, the sample data is pre-classified.
3. The improved confidence-based SOM model clustering method according to claim 1, characterized in that: The pre-classified data is used to train SOM models of different categories to eliminate the influence between different categories. Different categories of data will influence each other in the process of training the weight matrix of the model, so that the winning neuron feature vector corresponding to a certain category of data is updated in the feature direction of other categories of data.
4. The improved confidence-based SOM model clustering method according to claim 1, characterized in that: Based on the traditional SOM model, the concept of confidence matrix is proposed. The original weight matrix is used as the search matrix, and the concept of confidence matrix is proposed. Its content is: for each SOM model, a zero matrix of size M×1 is initialized to store the confidence of each neuron node, where M is the number of neuron nodes in the output layer; the confidence of the winning neuron corresponding to the data x is increased by 1, and other neuron nodes calculate the distance between the winning neuron to obtain their own confidence increment Δc(i,j). After traversing all the training data, the confidence matrix C of the SOM model is obtained, which is normalized and the measurement scale is unified to facilitate the horizontal comparison between the confidence matrices of different SOM models in the future.
5. The improved confidence-based SOM model clustering method according to claim 1, characterized in that: The concept of confidence neuron is proposed. The confidence neuron is obtained by comprehensively judging the confidence of the winning neuron and the Euclidean distance between it and the input data. Finally, cluster labels are assigned to the data according to the category to which the confidence neuron belongs. The test data is input into the trained SOM models of different categories. The corresponding winning neuron in the current SOM model is obtained according to the search matrix, and the confidence corresponding to the neuron can be obtained from the confidence matrix. A reasonable confidence threshold is set, neurons with confidence levels that meet the conditions are screened and retained, and then the Euclidean distance between the test data and the retained neurons is compared. The node with the closest distance is selected as the confidence neuron of the test data, and the SOM model category of the neuron is used as the clustering result of the data.
