Disclosure of Invention
The invention aims to solve the technical problem of overcoming the defect that the convolutional neural network is difficult to carry out feature extraction on numerical data in the prior art by utilizing the strong feature extraction capability of the convolutional neural network on image data, and provides a classification method for radar chart representation of the numerical data based on the convolutional neural network.
In order to solve the technical problem, the invention provides a classification method for radar chart representation of numerical data based on a convolutional neural network, which comprises the following steps:
s1, collecting and preprocessing numerical data, and establishing a training set:
each numerical data includes its characteristics and label;
s2, representing the numerical data in the data set obtained in the step S1 into image data, and establishing a picture numerical data set train _ x by using the obtained image data; the method comprises the following steps:
2.1, sequentially carrying out normalization processing on the characteristics of the numerical data in the training set;
wherein,a j-th dimension characteristic representing the i-th numerical type data,a j-dimension feature representing the normalized i-th numerical data; x is the number ofjFeatures of dimension j, max x, representing all numerical data in the training setjDenotes xjMaximum value of (1), minxjDenotes xjMinimum value of (1);
2.2, obtained according to step 2.1Utilizing a polar function to draw a radar map corresponding to numerical data, and utilizing the obtained radar map to establish a picture numerical data set train _ x;
s3, constructing a basic structure of the convolutional neural network;
s4, training by using the picture numerical data set train _ x obtained in the step S2 and the label thereof to obtain a convolutional neural network model;
and S5, representing the numerical data to be classified into image data and inputting the image data into the convolutional neural network model for classification.
The classification method of the numerical data radar chart representation based on the convolutional neural network is improved as follows:
the convolutional neural network comprises an input layer, two convolutional layers, two pooling layers, a full-connection layer and an output layer;
the activation function of the convolutional layer selects a sigmoid function, and the output layer adopts an RBF neural network for probability classification;
and selecting a root mean square error function as a final cost function of the convolutional neural network, and adjusting the weight W and the bias b by adopting back propagation of errors.
The classification method of the numerical data radar chart representation based on the convolutional neural network is further improved as follows:
the method for collecting and preprocessing numerical data in step S1 includes:
1.1, collecting numerical data, and performing characteristic sorting on the numerical data:
and 1.2, selecting an optimal feature combination by using the data after feature sorting, and establishing a training set according to numerical data corresponding to the optimal feature combination.
The classification method of the numerical data radar chart representation based on the convolutional neural network is further improved as follows:
the step 1.1 is to collect numerical data and perform characteristic sorting on the numerical data as follows:
(1a) collecting numerical data and establishing an initial training set S;
(1b) and (2) carrying out standardization processing on the numerical data in the initial training set S established in the step (1a), wherein the processing formula is as follows:
S={(x1,y1),(x2,y2),…,(xN,yN)}
wherein: 1,2, N, j 1,2, d; x is the number ofiDenotes the i-th numerical data, yiA tag indicating ith numerical type data;representing j dimension characteristic of i dimension training data; mu.sjMean value, σ, of j-th dimension characteristicjThe variance of the j-th dimension of the feature is represented,denotes xiThe j-th dimension feature of (2) is subjected to standardization processing to obtain a new feature;
normalized initial training setComprises the following steps:
whereinRepresenting the ith digitized data after the normalization processing;
(1c) respectively calculating the normalized initial training set obtained in the step (1b)Euclidean distance between the middle feature and the tag:
(1d) the Euclidean distance between each feature obtained according to the step (1c) and the labelThe feature combinations are obtained according to the sequence from big to small
WhereinIndicating Euclidean distance d between each feature obtained in the step (1c) and the labeljThe smallest one-dimensional feature data.
The classification method of the numerical data radar chart representation based on the convolutional neural network is further improved as follows:
the method for selecting the optimal feature combination by using the data after feature sorting in the step 1.2 comprises the following steps:
(2a) establishing an empty characteristic subset F;
(2b) combining the characteristics obtained in step (1d)Sequentially combining the characteristics of the characteristic data of each dimension in the sequence of the characteristic data of each dimension and adding the characteristics into a characteristic subset F; feature subsets
I.e. combining featuresIn(djThe largest one-dimensional feature data) is placed as a combination of features into the feature subset F, which is then placed into the feature subset FPut into F as a combination of features, and so on until willAll features are put into the feature subset F as a feature combination, resulting in d feature combinations.
Calculating the Euclidean distance between the features and the features in each feature combination in the obtained feature subset F and the labels, and then calculating the average value of the Euclidean distance;
selecting the feature combination with the maximum average value and at least 4 features as the optimal feature combination;
note: the above-described calculation method of the euclidean distance may refer to step (1 c).
When the number of the features in the feature combination with the maximum average value is less than 4, taking the feature combination obtained in the step (1d)The first 4 characteristics form the optimal characteristic combination;
the method for establishing the training set according to the numerical data corresponding to the optimal feature combination in the step 1.2 comprises the following steps:
and (3) according to the optimal feature combination selected in the step (2b), extracting the features corresponding to the optimal feature combination from the initial training set established in the step (1a) to establish a training set.
The classification method of the numerical data radar chart representation based on the convolutional neural network is further improved as follows:
the method for drawing the radar chart corresponding to the numerical data by using the polar function in the step 2.2 comprises the following steps:
and determining the number of the radiuses of the radar map according to the number of the characteristics in the optimal characteristic combination, wherein each radius represents the corresponding characteristic, and the length of each radius is the value of the normalized characteristic.
The classification method of the numerical data radar chart representation based on the convolutional neural network is further improved as follows:
the method for classifying the input convolution neural network model after expressing the numerical data to be classified as the image data by the S5 is as follows:
drawing a radar chart of numerical data to be classified by using a polar function, and inputting the radar chart into a convolutional neural network model for classification;
the method for drawing the radar map of the numerical data to be classified by the polar function comprises the following two ways:
the method comprises the following steps of 1, drawing a corresponding radar map by using a polar function according to the characteristics of numerical data to be classified;
and 2, preprocessing the numerical data to be classified according to the step S1, obtaining the optimal feature combination, and then drawing the radar map according to the features corresponding to the optimal feature combination by using the polar function.
Note: the specific steps of preprocessing the numerical data to be classified and drawing the radar map by using the polar function refer to the processing method for the numerical data.
On one hand, the numerical data are vividly represented by a radar map method, the correlation among the numerical data is reserved, the information loss among the numerical data is enabled to be as small as possible, the advantage of extracting features of a convolutional neural network is fully utilized, and the topological structure features among the radar maps are extracted. On the other hand, compared with the traditional data driving method, the method provided by the invention also provides an image thought of face thinking for other technical personnel, so that massive industrial numerical data can be identified and classified.
Compared with the prior art, the invention has the following technical advantages:
1. the invention effectively represents the numerical data in a graphical mode from the aspect of surface thinking by a radar map representation method, and fully utilizes the relation among all dimensions of the numerical data.
2. The invention extracts the topological structure characteristics and deep level characteristics of the radar map for classification through the convolutional neural network, and compared with the traditional data-driven classification method, the classification accuracy of numerical data is improved.
Embodiment 1, a classification method for radar chart representation of numerical data based on a convolutional neural network, as shown in fig. 1-2, the method includes the steps of firstly performing feature sorting on the numerical data, selecting an optimal feature combination by using the data after the feature sorting, and then representing the optimal feature combination numerical data into image data by using a radar chart, so that a basic structure of the convolutional neural network is constructed, and a convolutional neural network model is obtained through training. And then, the numerical data is effectively represented in a graphical mode from the aspect of surface thinking by a radar chart representation method, and the relationship among all dimensions of the numerical data is fully utilized. And finally, extracting the topological structure characteristics and deep level characteristics of the radar map for classification through the convolutional neural network model, and the classification accuracy is high.
The present embodiment incorporates numerical fault data generated by the TE process. The TE process has 52 variables and 22 working conditions (1 normal working condition and 21 fault working conditions), and d00 and 21 fault condition data sets are obtained by collecting data every 180s in the invention.
d00 is a training data set under normal operating conditions, comprising 500 sets of data (training data).
Each fault condition data set includes a training data set da and a test data set da _ test for the corresponding fault operating condition, where a ∈ {01, 02, …, 21 }. The training data set includes 480 sets of training data; the test data set includes 960 sets of test data, the first 160 sets of test data being normal data. Each set of data (i.e., training data and test data) is 53-dimensional, the first 52-dimensional represents the values (i.e., features) of 52 variables, the last dimension is a label, the label of normal working condition is 0, and the labels of the remaining 21 faults are 1,2, …, 21 in sequence.
The classification method of the radar chart representation of the numerical data based on the convolutional neural network specifically comprises the following steps:
(1) the method specifically comprises the following steps of performing characteristic sorting on numerical fault data generated in the TE process:
(1a) and establishing an initial training set S and an initial test set.
The initial training set S consists of d00 and da. The initial test set consists of da _ test.
Note: and establishing an initial training set and a test set corresponding to the fault working conditions by sequentially adopting a training data set da and a test data set da _ test in the 21 fault condition data sets.
Since each fault operation condition detection method is the same, only fault 1 is specifically described in this embodiment, that is, the initial training set in this embodiment is composed of d00 and d 01. The initial test set consists of d01_ test.
(1b) And carrying out standardization processing on the training data in the initial training set S, wherein the processing formula is as follows:
S={(x1,y1),(x2,y2),…,(xN,yN)}
wherein: 1,2, N, j 1,2, 980, 52. S represents the initial training set, x, established in step (1a)iDenotes the ith training data, yiA label representing the ith training data.A j-th dimension feature representing the i-th training data, e.g.,denotes xiThe first feature of (1). Mu.sjMean value, σ, of j-th dimension characteristicjThe variance of the j-th dimension of the feature is represented,denotes xiThe j-th dimension feature of (2) is normalized.
The feature of the training data is a 52-dimensional variable affecting the fault condition, the label is 0 under the normal condition, and the embodiment adopts the fault condition data set of the first fault condition, and the corresponding label is 1.
Note: in industry, the characteristics refer to the relevant factors that affect the output.
Normalized initial training setComprises the following steps:
whereinRepresenting the ith digitized data after the normalization processing;
(1c) sequentially calculating the normalized initial training set obtained in the step (1b)Euclidean distance between the middle feature and the tag:
wherein: 1,2, N, j 1,2, 980, 52. djRepresenting j-th dimension feature and its corresponding label yiThe euclidean distance between.Denotes xiThe j-th dimension feature of (2) is subjected to standardization processing to obtain a new feature; y isiThe label representing the ith training data, i.e., the output, may be the actual output value or an artificially given output value.
(1d) Sorting the Euclidean distances between the features and the labels obtained in the step (1c) from large to small, and recording the obtained feature combinations as
WhereinRepresenting the normalized training data obtained in step (1c)In djThe smallest one-dimensional feature data.
(2) Training data sorted by using the features obtained in the step (1d)And selecting the optimal feature combination.
The optimal feature combination is selected according to the Euclidean distance average value between the features and the labels, and the selection method comprises the following steps:
(2a) an empty feature subset F is created.
(2b) The feature combinations reordered according to step (1d)In the order of (1) sequentiallyThe features in (1) are combined and added into a feature subset F;
feature subsetsI.e. combining featuresIn(djThe largest one-dimensional feature data) is placed as a combination of features into the feature subset F, which is then placed into the feature subset FPut into F as a combination of features, and so on until willAll features are placed as one feature combination in the feature subset F.
The euclidean distance between the features and the features in each feature combination in the obtained feature subset F, and between the features and the tags is calculated (refer to the manner in which the euclidean distance is calculated in step (1c) above), and the average value thereof is calculated. The feature combination with the largest average value and at least 4 features is the optimal feature combination.
If the number of features in the feature combination with the largest average is less than 4, then the training data reordered from step (1d)The first 4 features are selected to form the optimal feature combination.
Since the methods of calculating features and features, euclidean distances between features and tags, and calculating their average values are prior art, they are not described in detail herein.
Such as: the combination of characteristics isThe algorithm for the average is as follows:
y refers to the label to which the feature corresponds.
The invention adopts the characteristics and the characteristics, and the Euclidean distance between the characteristics and the labels to combine and sort the characteristics, so that the new characteristic combination can fully reflect the relation with the output.
(3) And representing the optimal feature combination into image data by using the radar map. Using a MATLAB tool, a 32 x 32 size closed radar map image was drawn.
The process of representing numerical data into image data using radar mapping includes:
(3a) and (3) according to the optimal feature combination selected in the step (2b), extracting the features corresponding to the optimal feature combination from the initial training set (namely, the training set which is not subjected to standardization processing) established in the step (1a), thereby establishing a training set, namely, training data in the training set only comprises the features corresponding to the optimal feature combination.
(3b) And (3) carrying out normalization processing on the features selected in the step (3 a):
wherein x isjJ-dimension features representing all training data in the training set established in step (3a),representing the j-th dimension characteristic of the normalized i-th data. max xjDenotes xjMaximum value of (1), min xjDenotes xjMinimum value of (1).
(3c) Normalizing the data after step (3b)And drawing a closed radar map, namely a radar map corresponding to training data one by one, by using a polar function in MATLAB.
In this embodiment, the number of features in the optimal feature combination selected according to the above steps is 7, the number of radii of the radar map is 7, each radius represents a corresponding feature, and the length of the radius is a value obtained by normalizing the feature. These radii are connected to form a closed figure. Each training data corresponds to a radar map.
Note: and (4) correspondingly processing each test data in the initial test set and each actual numerical data to be classified according to the steps to obtain a radar map corresponding to the test data.
(3d) And (4) removing coordinate axes in the radar map obtained in the step (3c), and storing the radar map into a 32 × 32 gray scale picture in a PNG format.
The drawn radar map is stored as a picture training data set train _ x and a picture test data set test _ x, where the picture training data set train _ x includes 980 pictures and the picture test data set test _ x includes 960 pictures.
In the invention, numerical fault data in the TE process is represented by a radar map method, so that information among the data is converted, and the correlation among the data is kept. The conversion between the numerical type data and the image type data is completed.
In actual work, the labels corresponding to the picture training data set train _ x and the picture testing data set test _ x, that is, the output values of the convolutional neural network model, can be determined according to the needs of the user.
In this embodiment, a one-hot code (one-hot code) is used to determine a picture training data set tag train _ y and a picture testing data set tag test _ y. Since the present embodiment includes the normal operating condition and the fault operating condition, the code of the normal operating condition is (1,0), and the code of the fault operating condition is (0, 1). Therefore, train _ y is 980 x 2, the first 500 groups of data are labeled (1,0), and the 501-980 groups of data are labeled (0, 1). test _ y is 960 x 2, the first 160 groups of data are labeled (1,0), and the 161-960 groups of data are labeled (0, 1).
Through one-hot coding, the position corresponding to the maximum value of the predicted output and the position corresponding to the maximum value of the actual output can be conveniently compared, and if the positions are the same, the positions are considered to be the same type.
In conclusion, the invention selects the optimal features according to the features and the labels, draws the radar map with the optimal features, forms a new image training set, and endows the labels with one-hot coding again. In this embodiment, the radar map is composed of a trace _ x and a test _ x, and the trace _ y and the test _ y are composed by one-hot encoding, that is, the data finally input to the convolutional neural network are the trace _ x, the test _ x, the trace _ y and the test _ y.
(4) And constructing a basic structure of the convolutional neural network: the overall structure of the basic convolutional neural network is determined, as well as the initialized parameters.
The basic structure of the convolutional neural network constructed in this embodiment is shown in fig. 2, and includes an input layer, a convolutional layer 1, a pooling layer 1, a convolutional layer 2, a pooling layer 2, a full-link layer, and an output layer.
The convolution kernel size of convolution layers 1 and 2 in the figure can be selected to be 5 x 5 or 3 x 3; the weight W is randomly selected from (0-1), the initial value of the bias b is 0, and sigmoid functions are selected for the activation functions.
The pooling modes of the pooling layers 1 and 2 are both average pooling.
And the output layer adopts an RBF neural network to carry out probability classification.
The cost function of the convolutional neural network constructed in the embodiment selects a root mean square error function. And the error adopts back propagation to adjust the weight W and the bias b, and the adjustment mode is a gradient descent method.
Note: the sigmoid function and the root mean square error function are all the prior art, and the back propagation and gradient descent method is also the prior common technical means, so the specific work content is omitted in the specification.
In this embodiment, the convolutional neural network parameters for each fault condition are selected as follows:
table 1 convolutional neural network parameter selection under different conditions.
Note: the number of feature maps in table 1 refers to (the number of convolution kernels).
(5) And putting the picture training data set train _ x and the picture testing data set test _ x, and the picture training data set label train _ y and the picture testing data set label test _ y (namely, outputting) into a convolutional neural network for training to obtain training classification accuracy and testing classification accuracy and recording the sizes.
The method is a conventional technical means for constructing a convolutional neural network model by training a convolutional neural network by using a training set and a test set, and in the implementation, the convolutional neural network is trained by respectively changing the size of a convolutional kernel, the moving step length, the learning rate, the size of each batch, the iteration times and the like.
Finally, a group of convolutional neural network parameters is selected, so that the TE test classification accuracy is maximized on one hand, and the training classification accuracy and the test classification accuracy are close to each other on the other hand, and therefore the phenomenon of under-fitting or over-fitting is prevented. The classification accuracy of each fault is finally obtained as shown in table 2.
Table 2: training and test classification accuracy for different faults
And sequentially establishing a convolutional neural network model corresponding to each fault working condition according to the steps. And (4) bringing the test data of each fault into a respective model to detect whether the fault occurs.
In the actual use process, if redundant or useless features exist among the features of the numerical data to be classified, feature selection is carried out according to the steps, the optimal feature combination is selected, a radar map is drawn, and classification is carried out by utilizing the established convolutional neural network model. If the characteristics of the numerical data are all useful information and no useful or useless characteristics exist, the characteristics are not required to be selected, the radar chart can be drawn by directly utilizing the original data, and the classification can be carried out by utilizing the established convolutional neural network.
Compared with the prior art, the classification method based on the radar chart representation of the numerical data of the convolutional neural network is adopted, the numerical data are effectively represented into the image data through the radar chart representation method, the information of the numerical data and the correlation among the data are reserved, the topological structure characteristics of the image data are extracted through the convolutional neural network, the similarity and the rotation non-deformation between the image data are well utilized, the classification accuracy is improved, and the fault detection capability and the average detection level are improved.
The invention can convert numerical fault data generated in the TE process into image data, and simultaneously, the information among the data is kept as much as possible. The powerful feature extraction capability of the convolutional neural network is fully utilized, and topological structure features and deeper features among numerical data in the image data are extracted for classification. Compared with the traditional data driving method such as ELM, the average classification precision of the common method can only reach 65%, the method can reach 86.79, and the method fully shows that after numerical data are visually represented by a radar chart, the relationship among the data can be fully mined, and the classification precision is improved.
In summary, the present invention utilizes the radar map method to convert the industrial numerical data into the image data, and further can use the advantage of the convolutional neural network in image data processing. The present invention can compensate for this disadvantage.
Finally, it is also noted that the above-mentioned lists merely illustrate a few specific embodiments of the invention. It is obvious that the invention is not limited to the above embodiments, but that many variations are possible. All modifications which can be derived or suggested by a person skilled in the art from the disclosure of the present invention are to be considered within the scope of the invention.