Disclosure of Invention
In order to solve the problems, the embodiment of the invention provides a method and a device for constructing an edge detection model for detecting abnormality of mechanical equipment.
In a first aspect, an embodiment of the present invention provides a method for constructing an edge detection model for detecting an abnormality of a mechanical device, including: establishing an unsupervised anomaly detection model, performing model pruning training and quantization training by using a historical normal data set, and obtaining a compressed unsupervised anomaly detection model; establishing a supervised anomaly detection model, performing model pruning training and quantization training by using a historical data training set with a label, and obtaining a compressed supervised anomaly detection model; and sending the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model to an edge hardware node for the edge hardware node to perform integrated learning so as to obtain an anomaly detection edge detection model.
Further, the 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; 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 a supervised anomaly detection model includes: 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 a label to obtain the supervised anomaly detection model.
Further, the model pruning training and quantization training are performed by using the historical normal data set to obtain a compressed unsupervised anomaly detection model, which comprises: 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 the historical normal data to obtain the compressed unsupervised anomaly detection model.
Further, the training set of historical data with labels is used for model pruning training and quantization training to obtain a compressed supervised anomaly detection model, which comprises the following steps: performing model pruning training by using a historical data training set with labels to obtain a supervised anomaly detection model after pruning; 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 a method for constructing an edge detection model for detecting an abnormality of a mechanical device, including: receiving the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model; performing integrated learning on the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model to obtain an anomaly detection edge detection model; the compressed unsupervised anomaly detection model is obtained by using a historical normal data set by a cloud platform server, performing model pruning training and quantitative training on the unsupervised anomaly detection model; the compressed supervised anomaly detection model is a cloud platform server, and model pruning training and quantitative training are carried out on the supervised anomaly detection model by using sample data with labels.
Further, after receiving the post-compression unsupervised anomaly detection model and the post-compression supervised anomaly detection model, before performing the integrated 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 construction apparatus for detecting an abnormality of a mechanical device, including: the first model construction module is used for establishing an unsupervised anomaly detection model, performing model pruning training and quantitative training by using a historical normal data set, and obtaining a compressed unsupervised anomaly detection model; the second model construction module is used for building a supervised anomaly detection model, performing model pruning training and quantitative training by using a historical data training set with a label, and obtaining 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 so as to enable the edge hardware nodes to perform integrated learning and obtain the anomaly detection edge detection model.
In a fourth aspect, an embodiment of the present invention provides an edge detection model construction apparatus for detecting an abnormality of a mechanical device, 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 carrying out integrated learning on the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model to obtain an anomaly detection edge detection model; the compressed unsupervised anomaly detection model is obtained by using a historical normal data set by a cloud platform server, performing model pruning training and quantitative training on the unsupervised anomaly detection model; the compressed supervised anomaly detection model is a cloud platform server, and model pruning training and quantitative training are carried out on the supervised anomaly detection model by using sample data with labels.
In a fifth aspect, an embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor executes the program to implement the steps of the method for constructing an edge detection model for detecting an abnormality of a mechanical device according to the first aspect of the present invention.
In a sixth aspect, embodiments of the present invention provide a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the edge detection model construction method for mechanical device anomaly detection of the first aspect of the present invention.
According to the edge detection model construction method and device for the mechanical equipment anomaly detection, the historical normal data set is used for model pruning training and quantization training, the compressed unsupervised anomaly detection model is obtained, the historical data training set with the labels is used for model pruning training and quantization training, the compressed supervised anomaly detection model is obtained, the detection model with accurate detection results but larger calculation scale in the cloud computing server can be effectively simplified, only a small amount of calculation precision is lost, the method and device can be effectively applied to storage limitation and calculation capacity limitation of edge nodes, the model volume and calculation resource occupation are greatly compressed, and the edge calculation requirement is fully met. The compressed unsupervised abnormal detection model and the compressed supervised abnormal detection model are sent to the edge hardware nodes, the two types of detection models are used for detection analysis of the edge nodes at the same time, and the edge hardware nodes are used for integrated learning, so that the detection advantages of the two models can be combined respectively, and the detection precision is improved.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Fig. 1 is a flowchart of a method for constructing an edge detection model for detecting an abnormality of a mechanical device according to an embodiment of the present invention, as shown in fig. 1, where the method for constructing an edge detection model for detecting an abnormality of a mechanical device according to an embodiment of the present invention may include, as an execution body, a cloud computing server including:
101. and establishing an unsupervised anomaly detection model, performing model pruning training and quantitative training by using the historical normal data set, and obtaining 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 history database for storing operation data of the mechanical device, for example, vibration data, temperature data, etc., and the data type is set according to specific requirements. In 101, a preliminary unsupervised anomaly detection model, such as a convolutional neural network model, is created, 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 running state from historical data and constructing the data. And carrying out model pruning operation on the constructed unsupervised anomaly detection model by using the historical normal data set. Model Pruning (Model Pruning) is a Model compression method, introduces sparsity into dense connections of the deep neural network, and reduces the number of non-zero weights by directly zeroing the "unimportant" weights. By the processing, a small-scale compressed unsupervised anomaly detection model is obtained. Quantization may be implemented by converting the intra-model elements to an equivalent eight-bit version (e.g., storing and computing 32 floating-point numbers approximately with 8-bit integers), involving operations including convolution, matrix multiplication, activation of functions, pooling operations, and stitching. The pair model can be compressed to 1/4. By the processing, a small-scale unsupervised anomaly detection model after compression is obtained
102. And establishing a supervised anomaly detection model, and performing model pruning training and quantization 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 created, such as selecting a Convolutional Neural Network (CNN) extended short-time memory network (LSTM) to form the supervised anomaly detection model.
The history data training set with the labels is obtained by selecting data in a normal running state and data in an abnormal state from history data, and combining the corresponding normal and abnormal labels. And carrying out model pruning operation on the constructed supervised anomaly detection model by using the historical normal data set. Through the pruning treatment, a small-scale supervised anomaly detection model after pruning is obtained. And (3) quantifying the obtained small-scale supervised anomaly detection model after pruning by using the historical data training set. By the processing, a small-scale supervised anomaly detection model after compression 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 integrated learning so as to obtain an anomaly detection edge detection model.
The edge hardware node is a detection device closest to the mechanical equipment, and can be a computer device which directly acquires and analyzes the operation state data of the mechanical equipment or the mechanical equipment which integrates the data acquisition and analysis functions. And the edge hardware node performs integrated learning after receiving the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model.
The ensemble learning is a meta algorithm that combines several machine learning model algorithms into one prediction model to achieve the effect of reducing variance (bagging), bias (boosting), or improving prediction (stacking). After the ensemble learning, a smaller-scale edge detection model can be obtained for detection locally. 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 the mechanical equipment anomaly detection, the model pruning training and the quantization training are carried out by using the historical normal data set to obtain the compressed unsupervised anomaly detection model, and the model pruning training and the quantization training are carried out by using the historical data training set with the label to obtain the compressed supervised anomaly detection model, so that the detection model with accurate detection results but larger calculation scale in the cloud calculation server can be effectively simplified, only a small amount of calculation precision is lost, the method can be effectively applied to storage limitation and calculation capacity limitation of edge nodes, and the model volume and the calculation resource occupation are greatly compressed, so that the edge calculation requirement is fully met. The compressed unsupervised abnormal detection model and the compressed supervised abnormal detection model are sent to the edge hardware nodes, the two types of detection models are used for detection analysis of the edge nodes at the same time, and the edge hardware nodes are used for integrated learning, so that the detection advantages of the two models can be combined respectively, and the detection precision is improved.
Based on the content of the above embodiment, as an alternative 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 a label to obtain the supervised anomaly detection model.
The process of establishing the unsupervised anomaly detection model is first the selection of the dataset. The historical data of normal operation of a plurality of mechanical devices, namely the data without a result label, are all data 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 a parameter initialized unsupervised anomaly detection model, 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 accuracy of the model after pruning operation can be improved. The method is characterized in that the supervised anomaly detection model is trained based on a history data training set with result labels, normal data and abnormal data exist in the history data training set, and a determined result is used as a label, so that the built supervised anomaly detection model is obtained after training.
Based on the foregoing embodiment, as an alternative embodiment, performing model pruning training and quantization training using a historical normal data set to obtain a compressed unsupervised anomaly detection model, including: 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 the historical normal data to obtain a compressed unsupervised anomaly detection model.
After the model pruning training is carried out on the non-supervision abnormal detection model by using the historical normal data set, a large amount of historical normal data is used for carrying out quantization training on the pruned non-supervision abnormal detection model, so that the non-supervision abnormal detection model after the quantization training, namely the compressed non-supervision abnormal detection model, is obtained. Through quantization training, the unsupervised anomaly detection model after pruning can be further compressed, and the model size is further reduced without affecting the accuracy of the model.
Based on the foregoing embodiment, as an alternative embodiment, using the labeled historical data training set to perform model pruning training and quantization training, a compressed supervised anomaly detection model is obtained, including: performing model pruning training by using a historical data training set with labels to obtain a supervised anomaly detection model after pruning; 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.
After model pruning training is carried out on the supervised anomaly detection model by using the historical data training set with the label, a large amount of historical data with the label is used for carrying out quantization training on the pruned supervised anomaly detection model, so that the quantized trained supervised anomaly detection model, namely the compressed supervised anomaly detection model, is obtained. Through quantization training, the supervised anomaly detection model after pruning can be further compressed, and the model size is further reduced without affecting the accuracy of the model.
Fig. 2 is a flowchart of an edge detection model construction method for detecting an abnormality of a mechanical device according to another embodiment of the present invention, where, as shown in fig. 2, the embodiment of the present invention provides an edge detection model construction method for detecting an abnormality of a mechanical device, and uses an edge hardware node as an execution body, including:
201. receiving the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model;
202. performing integrated learning on the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model to obtain an anomaly detection edge detection model;
the compressed unsupervised anomaly detection model is obtained by using a historical normal data set by a cloud platform server, performing model pruning training and quantitative training on the unsupervised anomaly detection model; the compressed supervised anomaly detection model is a cloud platform server, and model pruning training and quantitative training are carried out on the supervised anomaly detection model by using sample data with labels.
In the embodiment of the method, the edge hardware node is taken as an execution main body, and the cloud platform server in the embodiment is a general reference to a cloud computing platform different from the edge node. The related specific steps can be referred to the method using the cloud computing server as the execution body, and are not described herein.
Based on 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 integrated 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 the edge normal data set, and performing fine tuning operation on the compressed supervised anomaly detection model by using the edge labeled training set.
The Fine tuning operation of the model, namely, fine-tune, and the transfer learning is a machine learning idea, and is applied to deep learning, namely, fine-tune (Fine-tune). The pre-training network model weights (typically all layers before the last fully connected layer, also called bottleneck layer) are selectively loaded by modifying the pre-training network model structure (e.g., modifying the number of sample class outputs). Re-training the model with its own data set is the basic step in fine tuning. The fine tuning can quickly train a model, and can achieve better results with a relatively smaller data size.
According to the embodiment of the invention, the edge data is used for carrying out the Fine-tune on the model, so that the model is fully adapted to the self-condition of the individual operation of the equipment, and the generalization of the model after issuing the edge end is ensured.
Based on the above embodiments, fig. 3 is a flowchart of an edge detection model construction method for detecting an abnormality of a mechanical device according to still another embodiment of the present invention, as shown in fig. 3, specifically referring to the above embodiments. The invention uses a plurality of complex neural networks to perform integrated learning to complete edge calculation, and the accuracy is far higher than that of a simple machine learning linear model. According to the invention, the cloud complex neural network anomaly monitoring model can be compressed to within 5% of the original model, the operation time is only 1/15 or even lower, and the edge computing chip is ensured to be capable of fully operating the edge computing algorithm. Through a large number of real data verification, all compression ensures that the accuracy of the original neural network model is reduced by not more than 3%, and ensures that the edge calculation effect is basically equivalent to the accuracy of cloud calculation under big data.
Fig. 4 is a block diagram of an edge detection model construction device for detecting an abnormality of a mechanical device according to an embodiment of the present invention, where, as shown in fig. 4, the edge detection model construction device for detecting an abnormality of a mechanical device 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, perform model pruning training and quantization training by using a historical normal data set, and obtain a compressed unsupervised anomaly detection model; the second model building module 402 is configured to build a supervised anomaly detection model, perform model pruning training and quantization training using a labeled historical data training set, and 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 an edge hardware node, so that the edge hardware node performs integrated learning to obtain an anomaly detection model.
Fig. 5 is a block diagram of an edge detection model building device for detecting an abnormality of a mechanical device according to another embodiment of the present invention, where, as shown in fig. 5, the edge detection model building device for detecting an abnormality of a mechanical device is applied to an edge hardware node, and includes: the receiving module 501 is configured to receive the compressed unsupervised anomaly detection model and the compressed supervised anomaly detection model; the processing module 502 is configured to perform integrated 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, performing model pruning training and quantitative training on the unsupervised anomaly detection model; the compressed supervised anomaly detection model is a cloud platform server, and model pruning training and quantitative training are carried out on the supervised anomaly detection model by using sample data with labels.
The embodiment of the device provided by the embodiment of the present invention is for implementing the above embodiments of the method, and specific flow and details refer to the above embodiments of the method, which are not repeated herein.
According to the edge detection model construction device for the mechanical equipment anomaly detection, the model pruning training and the quantitative training are carried out by using the historical normal data set to obtain the compressed unsupervised anomaly detection model, and the model pruning training and the quantitative training are carried out by using the historical data training set with the label to obtain the compressed supervised anomaly detection model, so that the detection model with accurate detection results but larger calculation scale in the cloud calculation server can be effectively simplified, only a small amount of calculation precision is lost, the device can be effectively applied to storage limitation and calculation capacity limitation of edge nodes, and the device is greatly compressed in terms of model volume and calculation resource occupation, so that the edge calculation requirement is fully met. The compressed unsupervised abnormal detection model and the compressed supervised abnormal detection model are sent to the edge hardware nodes, the two types of detection models are used for detection analysis of the edge nodes at the same time, and the edge hardware nodes are used for integrated learning, so that the detection advantages of the two models can be combined respectively, and the detection precision is improved.
Fig. 6 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention, where, as shown in fig. 6, the electronic device may include: processor 601, communication interface (Communications Interface) 602, memory 603 and bus 604, wherein processor 601, communication interface 602, memory 603 complete communication with each other through 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, performing model pruning training and quantization training by using a historical normal data set, and obtaining a compressed unsupervised anomaly detection model; establishing a supervised anomaly detection model, performing model pruning training and quantization training by using a historical data training set with a label, and obtaining 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 integrated learning so as to obtain an anomaly detection edge detection model.
Further, the logic instructions in the memory 603 described above may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform 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, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, embodiments of the present invention further provide a non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor is implemented to perform the transmission method provided in the above embodiments, for example, including: establishing an unsupervised anomaly detection model, performing model pruning training and quantization training by using a historical normal data set, and obtaining a compressed unsupervised anomaly detection model; establishing a supervised anomaly detection model, performing model pruning training and quantization training by using a historical data training set with a label, and obtaining 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 integrated learning so as to obtain an anomaly detection edge detection model.
The apparatus embodiments described above are merely illustrative, wherein elements illustrated as separate elements may or may not be physically separate, and elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on such understanding, the foregoing technical solutions may be embodied essentially or in part in the form of a software product, which may be stored in a computer-readable storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the various embodiments or methods of some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the 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 scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.