Disclosure of Invention
In order to solve the above problems, embodiments of the present invention provide an edge detection model construction method and apparatus for mechanical equipment anomaly detection.
In a first aspect, an embodiment of the present invention provides an edge detection model building method for mechanical device anomaly detection, including: establishing an unsupervised anomaly detection model, and performing model pruning training and quantitative training by using a historical normal data set to obtain a compressed unsupervised anomaly detection model; establishing a supervised anomaly detection model, and performing model pruning training and quantitative training by using a historical data training set with a label to obtain a compressed supervised anomaly detection model; and sending the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model to the edge hardware node for the edge hardware node to carry out ensemble learning so as to obtain an anomaly detected edge detection model.
Further, the establishing of the unsupervised anomaly detection model includes: acquiring historical data of normal operation of a plurality of mechanical devices to form a historical normal data set; establishing an initial unsupervised anomaly detection model, and training the initial unsupervised anomaly detection model by using the historical normal data set to obtain the unsupervised anomaly detection model; the establishing of the supervised anomaly detection model comprises the following steps: acquiring historical data of a plurality of mechanical devices, and acquiring abnormal result labels corresponding to the historical data to form a historical data training set with labels; establishing an initial supervised anomaly detection model, and training the initial supervised anomaly detection model by using a historical data training set with labels to obtain the supervised anomaly detection model.
Further, the performing model pruning training and quantitative training by using the historical normal data set to obtain a compressed unsupervised anomaly detection model includes: performing model pruning training by using a historical normal data set to obtain an unsupervised anomaly detection model after pruning; and carrying out quantitative training on the pruned unsupervised anomaly detection model by using historical normal data to obtain the compressed unsupervised anomaly detection model.
Further, the performing model pruning training and quantitative training by using the historical data training set with the label to obtain the compressed supervised anomaly detection model includes: performing model pruning training by using a historical data training set with a label to obtain a pruned supervised anomaly detection model; and carrying out quantitative training on the pruned supervised anomaly detection model by using a historical data training set with a label to obtain the compressed supervised anomaly detection model.
In a second aspect, an embodiment of the present invention provides an edge detection model building method for mechanical device anomaly detection, including: receiving an unsupervised anomaly detection model after compression and a supervised anomaly detection model after compression; performing ensemble learning on the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model to obtain an anomaly detected edge detection model; the compressed unsupervised anomaly detection model is obtained by using a historical normal data set by a cloud platform server and performing model pruning training and quantitative training on the unsupervised anomaly detection model; and the compressed supervised anomaly detection model is a cloud platform server, and is obtained by performing model pruning training and quantitative training on the supervised anomaly detection model by using sample data with a label.
Further, after receiving the post-compression unsupervised anomaly detection model and the post-compression supervised anomaly detection model, and before performing ensemble learning on the post-compression unsupervised anomaly detection model and the post-compression supervised anomaly detection model, the method further includes: and performing fine tuning operation on the compressed unsupervised anomaly detection model by using an edge normal data set, and performing fine tuning operation on the compressed supervised anomaly detection model by using an edge labeled training set.
In a third aspect, an embodiment of the present invention provides an edge detection model building apparatus for anomaly detection of mechanical equipment, including: the first model building module is used for building an unsupervised anomaly detection model, and performing model pruning training and quantitative training by using a historical normal data set to obtain a compressed unsupervised anomaly detection model; the second model building module is used for building a supervised anomaly detection model, and performing model pruning training and quantitative training by using a historical data training set with labels to obtain a compressed supervised anomaly detection model; and the sending module is used for sending the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model to the edge hardware nodes for the edge hardware nodes to carry out ensemble learning so as to obtain the anomaly detected edge detection model.
In a fourth aspect, an embodiment of the present invention provides an edge detection model building apparatus for anomaly detection of mechanical equipment, including: the receiving module is used for receiving the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model; the processing module is used for performing ensemble learning on the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model to obtain an anomaly detected edge detection model; the compressed unsupervised anomaly detection model is obtained by using a historical normal data set by a cloud platform server and performing model pruning training and quantitative training on the unsupervised anomaly detection model; and the compressed supervised anomaly detection model is a cloud platform server, and is obtained by performing model pruning training and quantitative training on the supervised anomaly detection model by using sample data with a label.
In a fifth aspect, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the method for constructing an edge detection model for detecting an anomaly of a mechanical device according to the first aspect of the present invention.
In a sixth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method for constructing an edge detection model for detecting an anomaly of a mechanical device according to the first aspect of the present invention.
According to the method and the device for constructing the edge detection model for anomaly detection of the mechanical equipment, the historical normal data set is used for model pruning training and quantitative training to obtain the compressed unsupervised anomaly detection model, the historical data training set with the label is used for model pruning training and quantitative training to obtain the compressed supervised anomaly detection model, the detection model with accurate detection result and large calculation scale in the cloud computing server can be effectively simplified, only a small amount of calculation precision is lost, the method and the device can be effectively suitable for the storage limitation and the calculation capacity limitation of edge nodes, the model volume and the calculation resource occupation are greatly compressed, and the edge calculation requirement is fully met. The compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model are sent to the edge hardware nodes, the detection models of the two types are simultaneously used for edge nodes to carry out detection analysis, and integrated learning is carried out through the edge hardware nodes, so that the detection advantages of the two models can be respectively combined, and the detection precision is improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of an edge detection model construction method for anomaly detection of mechanical equipment according to an embodiment of the present invention, and as shown in fig. 1, an edge detection model construction method for anomaly detection of mechanical equipment according to an embodiment of the present invention may be implemented by using a cloud computing server, and includes:
101. and establishing an unsupervised anomaly detection model, and performing model pruning training and quantitative training by using the historical normal data set to obtain the compressed unsupervised anomaly detection model.
The embodiment of the invention mainly realizes the detection of the abnormal state of the mechanical equipment. First, the cloud computing server may pre-establish a historical database for storing operation data of the mechanical device, such as vibration data, temperature data, and the like, where the data type is set according to specific requirements. In 101, a preliminary unsupervised anomaly detection model is established, such as a convolutional neural network model, and a convolutional neural network encoder and a convolutional neural network decoder are selected to form the unsupervised anomaly detection model.
The historical normal data set is obtained by selecting data in a normal operation state from historical data and constructing the data. And performing model pruning operation on the constructed unsupervised anomaly detection model by using a historical normal data set. Model Pruning (Model Pruning) is a Model compression method that introduces sparsity to dense connections of deep neural networks, reducing the number of non-zero weights by directly zeroing out "unimportant" weights. Through the above processing, a small-scale unsupervised abnormality detection model after compression is obtained. Quantization may be implemented by converting elements within the model into equivalent eight-bit versions (e.g., storing and computing 32 floating-point numbers approximately as 8-bit integers), involving operations including convolution, matrix multiplication, activation functions, pooling operations, and stitching. The pair model may be compressed to 1/4. Through the processing, a small-scale compressed unsupervised abnormity detection model is obtained
102. And establishing a supervised anomaly detection model, and performing model pruning training and quantitative training by using a historical data training set with labels to obtain a compressed supervised anomaly detection model.
At 102, a preliminary supervised anomaly detection model is established, for example, a Convolutional Neural Network (CNN) lengthened short-term memory network (LSTM) is selected to form the supervised anomaly detection model.
The labeled historical data training set is obtained by selecting data in a normal operation state and data in an abnormal state from historical data, and combining corresponding normal and abnormal labels to establish the labeled historical data training set. And performing model pruning operation on the constructed supervised anomaly detection model by using a historical normal data set. By the pruning treatment, a small-scale supervised anomaly detection model after pruning is obtained. And (4) carrying out quantitative operation on the obtained small-scale pruned supervised anomaly detection model by utilizing a historical data training set. By this processing, a small-scale compressed supervised anomaly detection model is obtained
103. And sending the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model to the edge hardware nodes for the edge hardware nodes to perform ensemble learning to obtain an anomaly detected edge detection model.
The edge hardware node is a detection device closest to the mechanical equipment, and may be a computer device for directly acquiring and analyzing the running state data of the mechanical equipment, or a mechanical equipment itself integrating a data acquisition and analysis function. And after receiving the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model, the edge hardware node performs ensemble learning.
Ensemble learning is a meta-algorithm that combines several machine learning model algorithms into a prediction model to achieve the effect of reducing variance (bagging), bias (boosting) or improving prediction (stacking). After ensemble learning, it becomes possible to obtain a smaller scale edge detection model for local detection. And the edge detection model is used for monitoring the abnormality of the mechanical equipment by the edge hardware node.
According to the edge detection model construction method for mechanical equipment anomaly detection, model pruning training and quantitative training are carried out by using a historical normal data set to obtain a compressed unsupervised anomaly detection model, model pruning training and quantitative training are carried out by using a historical data training set with a label to obtain a compressed supervised anomaly detection model, the detection model with accurate detection results and large calculation scale in a cloud computing server can be effectively simplified, only a small amount of calculation precision is lost, the edge detection model construction method can be effectively suitable for the storage limitation and the calculation capacity limitation of edge nodes, the model volume and the calculation resource occupation are greatly compressed, and the edge calculation requirements are fully met. The compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model are sent to the edge hardware nodes, the detection models of the two types are simultaneously used for edge nodes to carry out detection analysis, and integrated learning is carried out through the edge hardware nodes, so that the detection advantages of the two models can be respectively combined, and the detection precision is improved.
Based on the content of the foregoing embodiment, as an optional embodiment, establishing an unsupervised anomaly detection model includes: acquiring historical data of normal operation of a plurality of mechanical devices to form a historical normal data set; and establishing an initial unsupervised anomaly detection model, and training the initial unsupervised anomaly detection model by using a historical normal data set to obtain the unsupervised anomaly detection model. Establishing a supervised anomaly detection model, comprising: acquiring historical data of a plurality of mechanical devices, and acquiring abnormal result labels corresponding to the historical data to form a historical data training set with labels; and establishing an initial supervised anomaly detection model, and training the initial supervised anomaly detection model by using a historical data training set with labels to obtain the supervised anomaly detection model.
The process of establishing the unsupervised anomaly detection model is firstly the selection of a data set. The historical data of normal operation of a plurality of mechanical devices, namely the data without the result labels, are acquired when the devices are in normal operation, such as vibration data and temperature data, and the data form a historical normal data set. And establishing an unsupervised anomaly detection model with initialized parameters, such as the convolutional neural network model, and training the initialized unsupervised anomaly detection model by using the obtained historical normal data set to obtain the established unsupervised anomaly detection model. That is, before pruning training, the unsupervised anomaly detection model is trained, so that the precision of the model after pruning operation can be improved. The supervised anomaly detection model is similar to the supervised anomaly detection model, but the training of the supervised anomaly detection model is based on a historical data training set with result labels, wherein the historical data training set contains normal data and abnormal data, and a determined result is used as a label, so that the established supervised anomaly detection model is obtained after training.
Based on the content of the above embodiment, as an optional embodiment, performing model pruning training and quantization training using a historical normal data set to obtain a compressed unsupervised anomaly detection model, includes: performing model pruning training by using a historical normal data set to obtain an unsupervised anomaly detection model after pruning; and carrying out quantitative training on the unsupervised anomaly detection model after pruning by using the historical normal data to obtain the compressed unsupervised anomaly detection model.
And performing model pruning training on the unsupervised anomaly detection model by using the historical normal data set, and performing quantitative training on the unsupervised anomaly detection model after pruning by using a large amount of historical normal data again, so as to obtain the unsupervised anomaly detection model after quantitative training, namely the compressed unsupervised anomaly detection model. Through quantitative training, the unsupervised anomaly detection model after pruning can be further compressed, and the accuracy of the model is not influenced while the size of the model is further reduced.
Based on the content of the foregoing embodiment, as an optional embodiment, performing model pruning training and quantitative training using a labeled historical data training set to obtain a compressed supervised anomaly detection model, includes: performing model pruning training by using a historical data training set with a label to obtain a pruned supervised anomaly detection model; and carrying out quantitative training on the pruned supervised anomaly detection model by using a historical data training set with a label to obtain a compressed supervised anomaly detection model.
And performing model pruning training on the supervised anomaly detection model by using the historical data training set with the labels, and performing quantitative training on the pruned supervised anomaly detection model by using a large amount of historical data with the labels again to obtain the quantitatively trained supervised anomaly detection model, namely the compressed supervised anomaly detection model. Through quantitative training, the supervised anomaly detection model after pruning can be further compressed, and the accuracy of the model is not influenced while the size of the model is further reduced.
Fig. 2 is a flowchart of an edge detection model building method for anomaly detection of mechanical equipment according to another embodiment of the present invention, and as shown in fig. 2, an embodiment of the present invention provides an edge detection model building method for anomaly detection of mechanical equipment, which uses an edge hardware node as an execution main body, and includes:
201. receiving an unsupervised anomaly detection model after compression and a supervised anomaly detection model after compression;
202. performing ensemble learning on the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model to obtain an anomaly detected edge detection model;
the compressed unsupervised anomaly detection model is obtained by using a historical normal data set by a cloud platform server and performing model pruning training and quantitative training on the unsupervised anomaly detection model; and the compressed supervised anomaly detection model is a cloud platform server, and is obtained by performing model pruning training and quantitative training on the supervised anomaly detection model by using sample data with a label.
The embodiment of the method takes the edge hardware node as an execution main body, and the cloud platform server of the embodiment is a general finger of a cloud computing platform different from the edge node. For the related specific steps, reference may be made to the above method using the cloud computing server as an execution subject, which is not described herein again.
Based on the content of the foregoing embodiment, as an optional embodiment, after receiving the post-compression unsupervised anomaly detection model and the post-compression supervised anomaly detection model, before performing ensemble learning on the post-compression unsupervised anomaly detection model and the post-compression supervised anomaly detection model, the method further includes: and performing fine tuning operation on the compressed unsupervised anomaly detection model by using an edge normal data set, and performing fine tuning operation on the compressed supervised anomaly detection model by using an edge labeled training set.
The Fine tuning operation of the model is Fine-tune, and the transfer learning is a machine learning idea, and the Fine-tune is applied to the deep learning. The weights of the pre-trained network model are selectively loaded (usually all layers before the last fully-connected layer, also called bottleneck layer) by modifying the structure of the pre-trained network model (for example, modifying the number of output sample classes). Retraining the model with its own data set is the basic step of fine tuning. Fine tuning allows for fast training of a model, and better results can be achieved with relatively small amounts of data.
According to the embodiment of the invention, the edge data is used for performing tune-tune on the model, so that the method and the device are fully adaptive to the self condition of individual operation of the equipment, and the generalization of the model after the edge is issued is ensured.
Based on the above embodiments, fig. 3 is a flowchart of an edge detection model building method for detecting an anomaly of a mechanical device according to another embodiment of the present invention, as shown in fig. 3, and refer to the above embodiments specifically. The invention uses a plurality of complex neural networks to carry out ensemble learning to complete edge calculation, and the accuracy is far higher than that of a simple machine learning linear model. The invention can compress the complex neural network anomaly monitoring model of the cloud to be within 5% of the original anomaly monitoring model, the operation time is only 1/15 or even lower than the original anomaly monitoring model, and the edge calculation chip is ensured to be fully capable of operating the edge calculation algorithm. Through verification of a large amount of real data, all compression guarantees that the accuracy rate of the original neural network model is reduced by no more than 3%, and guarantees that the edge calculation effect is basically equal to the accuracy rate of cloud calculation under big data.
Fig. 4 is a structural diagram of an edge detection model building apparatus for anomaly detection of mechanical equipment according to an embodiment of the present invention, and as shown in fig. 4, the edge detection model building apparatus for anomaly detection of mechanical equipment is applied to a cloud computing server or a cloud computing platform, and includes: a first model building module 401, a second model building module 402 and a sending module 403. The first model building module 401 is configured to build an unsupervised anomaly detection model, and perform model pruning training and quantitative training by using a historical normal data set to obtain a compressed unsupervised anomaly detection model; the second model building module 402 is configured to build a supervised anomaly detection model, and perform model pruning training and quantitative training by using a labeled historical data training set to obtain a compressed supervised anomaly detection model; the sending module 403 is configured to send the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model to the edge hardware node for the edge hardware node to perform ensemble learning, so as to obtain an anomaly detected edge detection model.
Fig. 5 is a structural diagram of an edge detection model building apparatus for anomaly detection of mechanical equipment according to another embodiment of the present invention, and as shown in fig. 5, the edge detection model building apparatus for anomaly detection of mechanical equipment is applied to an edge hardware node, and includes: the receiving module 501 is configured to receive an unsupervised anomaly detection model after compression and a supervised anomaly detection model after compression; the processing module 502 is configured to perform ensemble learning on the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model to obtain an edge detection model for anomaly detection; the compressed unsupervised anomaly detection model is obtained by using a historical normal data set by a cloud platform server and performing model pruning training and quantitative training on the unsupervised anomaly detection model; and the compressed supervised anomaly detection model is a cloud platform server, and is obtained by performing model pruning training and quantitative training on the supervised anomaly detection model by using sample data with a label.
The device embodiment provided in the embodiments of the present invention is for implementing the above method embodiments, and for details of the process and the details, reference is made to the above method embodiments, which are not described herein again.
According to the edge detection model construction device for anomaly detection of mechanical equipment, provided by the embodiment of the invention, model pruning training and quantitative training are carried out by using the historical normal data set to obtain a compressed unsupervised anomaly detection model, and model pruning training and quantitative training are carried out by using the historical data training set with the label to obtain a compressed supervised anomaly detection model. The compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model are sent to the edge hardware nodes, the detection models of the two types are simultaneously used for edge nodes to carry out detection analysis, and integrated learning is carried out through the edge hardware nodes, so that the detection advantages of the two models can be respectively combined, and the detection precision is improved.
Fig. 6 is a schematic entity structure diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 6, the electronic device may include: a processor 601, a communication Interface 602, a memory 603 and a bus 604, wherein the processor 601, the communication Interface 602 and the memory 603 complete communication with each other through the bus 604. The communication interface 602 may be used for information transfer of an electronic device. The processor 601 may call logic instructions in the memory 603 to perform a method comprising: establishing an unsupervised anomaly detection model, and performing model pruning training and quantitative training by using a historical normal data set to obtain a compressed unsupervised anomaly detection model; establishing a supervised anomaly detection model, and performing model pruning training and quantitative training by using a historical data training set with a label to obtain a compressed supervised anomaly detection model; and sending the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model to the edge hardware nodes for the edge hardware nodes to perform ensemble learning to obtain an anomaly detected edge detection model.
In addition, the logic instructions in the memory 603 may be implemented in the form of software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the above-described method embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is implemented to perform the transmission method provided in the foregoing embodiments when executed by a processor, and for example, the method includes: establishing an unsupervised anomaly detection model, and performing model pruning training and quantitative training by using a historical normal data set to obtain a compressed unsupervised anomaly detection model; establishing a supervised anomaly detection model, and performing model pruning training and quantitative training by using a historical data training set with a label to obtain a compressed supervised anomaly detection model; and sending the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model to the edge hardware nodes for the edge hardware nodes to perform ensemble learning to obtain an anomaly detected edge detection model.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods of the various embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.