CN113541985B - Internet of things fault diagnosis method, model training method and related devices - Google Patents
Internet of things fault diagnosis method, model training method and related devices Download PDFInfo
- Publication number
- CN113541985B CN113541985B CN202010292445.7A CN202010292445A CN113541985B CN 113541985 B CN113541985 B CN 113541985B CN 202010292445 A CN202010292445 A CN 202010292445A CN 113541985 B CN113541985 B CN 113541985B
- Authority
- CN
- China
- Prior art keywords
- fault
- class
- internet
- things
- neural network
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
- G06F18/2415—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/047—Probabilistic or stochastic networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Health & Medical Sciences (AREA)
- Computational Linguistics (AREA)
- Mathematical Physics (AREA)
- Probability & Statistics with Applications (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Telephonic Communication Services (AREA)
- Maintenance And Management Of Digital Transmission (AREA)
Abstract
The embodiment of the invention relates to the technical field of neural networks, and discloses a training method of an Internet of things fault diagnosis model based on a feedforward neural network, which comprises the following steps: collecting fault data of the Internet of things to obtain a sample set, and dividing the sample set into a training sample set and a testing sample set; inputting the training sample set into a preset feedforward neural network for pre-training to obtain a trained feedforward neural network; calculating a prediction error; determining the current accuracy according to the prediction error, if the current accuracy does not reach the accuracy threshold, optimizing the trained feedforward neural network by adopting a gradient descent method, and initializing an Internet of things fault diagnosis model; and the test sample set verifies and corrects the initial Internet of things fault diagnosis model to obtain a target Internet of things fault diagnosis model. By the mode, the method and the device have the beneficial effects that the fault pre-diagnosis model of the Internet of things improves the accuracy of fault identification. The invention also provides a fault pre-diagnosis method and a related device for the Internet of things.
Description
Technical Field
The embodiment of the invention relates to the technical field of artificial intelligence, in particular to an Internet of things fault diagnosis method, a model training method, an Internet of things fault diagnosis device, equipment and a computer readable storage medium based on a feedforward neural network.
Background
At present, with the development of 5G, the service of the Internet of things shows explosive growth, and the Internet of things becomes a necessary trend. Whether the fault detection of the complaint of the Internet of things and the accurate positioning are efficient or not is a key point that the business of the Internet of things can be rapidly developed and promoted.
However, the current diagnosis of the internet of things has the following problems:
1. mass complaints: the service development of the Internet of things is rapid, complaints are rapidly increased, and the response speed is low;
2. the efficiency is low: the networking structure of the Internet of things has the advantages that multiple professions are needed to be crossed for fault detection, and the operation and maintenance efficiency is low;
3. the threshold is high: the after-sales delimiter of the Internet of things requires to have high-level skill requirements.
The prior common fault diagnosis method depends on core network element side data to carry out fault diagnosis and SVM support vector machine fault diagnosis, wherein the former depends on core network side single fault data and has high requirement on professional knowledge of operation and maintenance personnel; the SVM support vector machine algorithm is insensitive to kernel function selection, is suitable for classifying small sample sets, and can generate the phenomenon of over-fitting for large sample support vectors.
Therefore, there is a need for an internet of things fault diagnosis model with high accuracy to quickly and accurately diagnose massive internet of things faults.
Disclosure of Invention
In view of the above problems, the embodiments of the present invention provide a training method for an internet of things fault diagnosis model based on a feedforward neural network, an internet of things fault diagnosis method, an apparatus, a device and a computer readable storage medium, which are used for solving the technical problem in the prior art that a mass of internet of things faults are difficult to diagnose quickly and accurately.
According to an aspect of the embodiment of the invention, there is provided a training method of an internet of things fault diagnosis model based on a feedforward neural network, the method comprising:
collecting historical Internet of things fault characteristic sample data and corresponding fault class data, preprocessing to obtain a sample set, and dividing the sample set into a training sample set and a test sample set, wherein the sample set comprises the Internet of things fault sample characteristic data and corresponding fault class labels;
inputting the training sample set into a preset feedforward neural network for training to obtain a prediction error;
calculating a prediction error of the prediction error;
judging whether the current accuracy of the prediction error reaches a preset accuracy threshold according to the prediction error:
if the accuracy threshold is reached, taking the prediction error as an initial Internet of things fault diagnosis model;
If the accuracy threshold is not reached, optimizing the prediction error by adopting a gradient descent method until the current accuracy reaches the accuracy threshold, and obtaining an initial Internet of things fault diagnosis model;
and verifying and correcting the test Internet of things fault diagnosis model through the test sample set to obtain a target Internet of things fault diagnosis model.
In an optional manner, collecting historical internet of things fault feature sample data and corresponding fault class data, and preprocessing to obtain a sample set, wherein the sample set comprises the internet of things fault sample feature data and the corresponding fault class label, and further comprises:
data enhancement is carried out on samples corresponding to fault categories in the sample set, so that the corresponding sample number of each fault category is kept in the same order of magnitude:
if the number of samples of the first fault class is larger than the average number of samples, randomly deleting the number of samples corresponding to the first fault class;
if the number of samples of the second fault class is smaller than the average number of samples, increasing the number of samples of the second fault class by using a preset data transformation rule;
the preset data transformation rule is as follows: and keeping the sample data with strong correlation with the second fault class unchanged, randomly generating other values with preset probability for the sample data with strong correlation with the second fault class, and completely randomly generating values for the sample data with weak correlation with the second fault class to form new sample data.
In an optional manner, the training sample set is input into a preset feedforward neural network to perform training, so as to obtain a prediction error, and the method further includes:
the preset feedforward neural network comprises an input layer, a 2-layer hidden layer and an output layer, wherein each hidden layer comprises 256 neurons;
and training the preset neural network layer by a supervised training method to obtain a trained neural network.
In an alternative way, calculating the prediction error of the prediction error further comprises:
obtaining a connection weight corresponding to each fault category in the prediction error;
calculating the probability of each predicted fault category by adopting a multi-classification softmax activation function in combination with the connection weight, wherein each predicted fault category is obtained after a prediction error is input into each training sample set;
and calculating the prediction error of the prediction fault class according to the cross entropy error loss function by combining the probability of the prediction fault class.
In an alternative approach, the prediction error of the trained feedforward neural network is calculated by the following formula:
calculating a probability matrix sigma (Z) of output after a training sample corresponding to the fault type is input into the trained feedforward neural network j J represents the fault category:
Z j =x T w j
according to the probability matrix sigma (Z) j Obtaining the probability of the fault class j j :
t j =σ(Z) j
According to the probability of the fault class j j Calculating a prediction error E of the trained feedforward neural network for the fault class j:
E=-ln t j
wherein the number of fault categories k= 6,w j The trained feedforward neural network is the j-th classThe connection weight matrix is trained by the fault class; z is Z j Is the weight value of the j-th class fault class corresponding to the neuron of the previous layer; sigma (Z) j Inputting a probability matrix output by a trained feedforward neural network for a training sample of the j-th class of fault class, wherein x is input 37-dimensional fault characteristic sample data; t is t j Representing the probability that the outputted fault class belongs to the j-th class; e denotes a prediction error.
According to another aspect of the embodiment of the present invention, there is also provided a method for diagnosing an internet of things fault based on a feedforward neural network, including:
inputting the fault data of the Internet of things to be diagnosed into a target Internet of things fault diagnosis model, wherein the target Internet of things fault diagnosis model is obtained through training by the training method of the Internet of things fault diagnosis model based on the feedforward neural network;
performing fault diagnosis on the Internet of things data to be diagnosed through the target Internet of things fault diagnosis model, and outputting a target fault class probability matrix;
And obtaining the target fault class according to the target fault class probability matrix.
According to another aspect of the embodiment of the present invention, there is also provided a training device for an internet of things fault diagnosis model based on a feedforward neural network, including:
the sample processing module is used for collecting historical Internet of things fault characteristic sample data and corresponding fault class data, preprocessing the historical Internet of things fault characteristic sample data to obtain a sample set, and dividing the sample set into a training sample set and a test sample set, wherein the sample set comprises the Internet of things fault sample characteristic data and corresponding fault class labels;
the model pre-training module is used for inputting the training sample set into a preset feedforward neural network for training to obtain a prediction error;
a prediction error calculation module, configured to calculate a prediction error of the prediction error;
the judging module is used for judging whether the current accuracy of the prediction error reaches a preset accuracy threshold value according to the prediction error:
if the accuracy threshold is reached, taking the prediction error as an initial Internet of things fault diagnosis model;
the optimizing module is used for optimizing the prediction error by adopting a gradient descent method if the judging module judges that the accuracy threshold is not reached, and obtaining an initial Internet of things fault diagnosis model until the optimized accuracy reaches the accuracy threshold;
And the test correction module is used for verifying and correcting the test Internet of things fault diagnosis model through the test sample set so as to obtain a target Internet of things fault diagnosis model.
According to another aspect of the embodiment of the present invention, there is provided an internet of things fault diagnosis apparatus based on a feedforward neural network, the apparatus including:
the input module is used for inputting the fault data of the Internet of things to be diagnosed into a target Internet of things fault diagnosis model, wherein the target Internet of things fault diagnosis model is obtained through training by the training method of the Internet of things fault diagnosis model based on the feedforward neural network;
the diagnosis module is used for carrying out fault diagnosis on the Internet of things data to be diagnosed through the target Internet of things fault diagnosis model and outputting a target fault class probability matrix;
and the output module is used for obtaining the target fault class according to the target fault class probability matrix.
According to another aspect of an embodiment of the present invention, there is provided an electronic apparatus including: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
The memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the training method of the fault diagnosis model of the Internet of things or the operation of the fault diagnosis method of the Internet of things.
According to still another aspect of the embodiments of the present invention, there is provided a computer readable storage medium, where at least one executable instruction is stored in the storage medium, where the executable instruction when executed on an internet of things diagnosis device/apparatus causes the internet of things diagnosis device/apparatus to perform the operation of the training method of the internet of things fault diagnosis model or the operation of the internet of things fault diagnosis method described above.
According to the embodiment of the invention, the known deep learning of the full-quantity Internet of things fault information is utilized to train and establish the Internet of things fault pre-diagnosis model based on the feedforward neural network, the Internet of things fault probability matrix is output, and the demarcation is completed, so that the method is more efficient and intelligent.
Furthermore, the embodiment of the invention is based on a feedforward neural network, and through complete closed-loop training processes such as cross entropy error judgment, a small-batch gradient optimization algorithm, a multi-classification softmax activation function, test set verification and the like, the accuracy of the output of a fault pre-diagnosis model is ensured, and the accuracy of fault diagnosis is improved.
The foregoing description is only an overview of the technical solutions of the embodiments of the present invention, and may be implemented according to the content of the specification, so that the technical means of the embodiments of the present invention can be more clearly understood, and the following specific embodiments of the present invention are given for clarity and understanding.
Drawings
The drawings are only for purposes of illustrating embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
fig. 1 shows a flow diagram of a training method of an internet of things fault diagnosis model based on a feedforward neural network according to an embodiment of the present invention;
FIG. 2 shows a graph of actual fault class errors versus the fault class errors provided by an embodiment of the present invention;
fig. 3 shows a flow diagram of an internet of things fault diagnosis method based on a feedforward neural network according to an embodiment of the present invention;
fig. 4 shows a schematic structural diagram of a training device of an internet of things fault diagnosis model based on a feedforward neural network according to an embodiment of the present invention;
fig. 5 shows a schematic structural diagram of an internet of things fault diagnosis device based on a feedforward neural network according to an embodiment of the present invention;
Fig. 6 shows a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be limited to the embodiments set forth herein.
Fig. 1 shows a flow chart of a training method of an internet of things fault diagnosis model based on a feedforward neural network, which is provided by an embodiment of the invention, and the method is executed by a training device of the internet of things fault diagnosis model based on the feedforward neural network. As shown in fig. 1, the method comprises the steps of:
s110: collecting historical Internet of things fault characteristic sample data and corresponding fault class data, preprocessing to obtain a sample set, and dividing the sample set into a training sample set and a test sample set, wherein the sample set comprises the Internet of things fault sample characteristic data and corresponding fault class labels.
The fault sample feature data of the Internet of things comprise multidimensional fault expression data, and the fault type labels comprise card faults, terminal faults, wireless faults, transmission faults, core network faults and client side faults. And associating the fault class labels with the historical Internet of things fault sample characteristic data to form a multi-dimensional matrix sample.
In this embodiment, the faults of the internet of things are classified into 6 fault categories of cards, terminals, wireless, transmission, core networks and client sides, and large-scale 37-dimensional fault characteristic data are collected, and dimensional information is shown in table 1. According to the correlation, the 37-dimensional fault data are correlated with 6 fault categories, and according to the correlation with the fault categories, the correlation values are respectively defined as 1 (correlation), 0.5 (unknown) and 0 (irrelevant), so that a 37-dimensional fault feature matrix is formed and is used as the input of the fault diagnosis model of the Internet of things. Wherein each row in the 37-dimensional fault feature matrix represents a sample, and each column represents a property of the sample. And taking the constructed sample data as the input of the feedforward neural network.
TABLE 1
In order to reduce the overfitting phenomenon, the invention also preprocesses the collected samples. The number of each fault class is counted by a machine, and if the sample set of a certain class is too small, the connection weight of the class is inaccurate. Therefore, aiming at the weakly classified samples, the training data is transformed to strengthen the data set, so that the sample set with stronger generalization capability is obtained. Specifically, when classifying the multidimensional fault feature data, the generalization of model training on the test set is poor due to the unbalanced number of samples in the training set. Because the actual training samples are from actual complaints and fault handling, there are very many samples of one class or several classes, with relatively few other classes. In order to improve Accuracy (Accuracy), the data layer is processed, the distribution of each fault class is modified, and data enhancement is performed on samples corresponding to each class of fault class in the sample set, so that the samples of each fault class are kept in the same order of magnitude.
Data enhancement is carried out on samples corresponding to fault categories in the sample set so as to keep the number of the samples corresponding to each fault category in the same order of magnitude, and the specific process is as follows:
and if the number of the samples of the first fault class is larger than the average number of the samples, randomly deleting the number of the samples corresponding to the first fault class. In this embodiment, if the number of samples of the first failure category is greater than 2 times the average number of samples, 40% of the number of samples corresponding to the first failure category is randomly deleted.
If the number of samples of the second fault class is smaller than the average number of samples, the number of samples of the second fault class is increased by using a preset data transformation rule. In this embodiment, if the number of samples of the second fault class is less than 1 half of the average number of samples, the number of samples of the second fault class is increased by 40% using a preset data transformation rule.
The preset data transformation rule is as follows: and keeping the sample data with strong correlation with the second fault class unchanged, randomly generating other values with preset probability for the sample data with strong correlation with the second fault class, and completely randomly generating values for the sample data with weak correlation with the second fault class to form new sample data. In this embodiment, the preset probability is 50%.
After the sample set is formed, the sample set is divided into a training sample set and a test sample set. In this embodiment, the sample set may be divided into 80% training sample set and 20% test sample set.
S120: and inputting the training sample set into a preset feedforward neural network to perform pre-training to obtain the trained feedforward neural network.
In this embodiment, the preset feedforward neural network includes an input layer, a 2-layer hidden layer, and an output layer, where each hidden layer includes 256 neurons.
And training the input layer, the hidden layer and the output layer of the preset neural network layer by a supervised training method to obtain the trained neural network. Specifically, the connection weight of each fault class is updated by inputting samples one by one, an initial weight (generally random) is set first, sample data are input one by one, if the output sample class is identical to the real fault class label, the next sample is continuously input, if the output sample class is inconsistent with the real fault class label, the connection weight is updated, and then the connection weight is checked one by one again until the output fault class of each sample data is identical to the real fault class label, so that the connection weight corresponding to each fault class is finally determined.
Here, the feedforward neural network outputs a 6-dimensional matrix, each dimension representing the probability of which fault class belongs to. If a sample is input with a prediction error, the output 6-dimensional matrix is [0.1,0,0.2,0,0.1,0.6], which indicates that the probability of the failure category being a card failure is 0.1, the probability of the failure category being a terminal is 0, the probability of the failure category being wireless is 0.2, the probability of the failure category being transmission is 0, the probability of the failure category being a core network is 0.1, and the probability of the failure category being a client side is 0.6. The probability of the client side is the greatest, so the fault class is judged as the client side fault.
S130: and calculating the prediction error of the trained feedforward neural network.
Firstly, before calculating the prediction error of the trained feedforward neural network, inputting each class of training sample set into the trained feedforward neural network, and obtaining each 6 probability matrixes corresponding to each class of samples according to the connection weight of each class.
Specifically, for the j-th class of fault, the connection weight matrix is w j Calculating a probability matrix sigma (Z) obtained by inputting training samples corresponding to the j-th class fault category into the trained neural network by adopting a multi-class softmax activation function j As shown in equation 1, the output is a set of fault data 6-dimensional probability matrices. w (w) j The initial values of (a) are all matrices of 0. Equation 2 is the weight value of the j-th class fault class.
Z j =x T w j (2)
Wherein the fault classification number k= 6,w j The connection weight matrix is trained for the j-th fault class for the trained feedforward neural network; z is Z j Is the weight value of the j-th class of fault class; sigma (Z) j And x is the input 37-dimensional fault characteristic sample data for the probability matrix of the j-th class fault class. Obtaining probability that the output fault class belongs to the j-th class after the training sample of the j-th class is input into the trained feedforward neural network according to the formula 3 j :
t j =σ(Z) j (3)
Then, according to the probability t of the j-th class j And calculating the prediction error of the trained feedforward neural network for the j-th class fault class. As shown in formula 4, according to the cross entropy error loss function, the distance of probability distribution is utilized to obtain the prediction result and actual cause of the trained feedforward neural network for j fault typesPrediction error of the barrier class. The actual fault class is a fault class label.
E=-∑ j∈D O j ln t j (4)
Wherein D is a set of 6 major Internet of things fault categories, and if the actual fault category is the same as the predicted result of the trained feedforward neural network on the jth category, O j =1, otherwise O j =0;t j For the prediction result (0.ltoreq.t) of the j fault class j And is less than or equal to 1). O only when j is the actual barrier category j Is 1, so that the formula 4 can be simplified to the following formula 5, and because 0 is less than or equal to t j And 1. Ltoreq.so that the abscissas 0 to 1 are effective segments, as can be seen from FIG. 2, the prediction error E is greater as the calculated probability of the actual class is smaller.
E=-ln t j (5)
And finishing the calculation of the prediction error of each fault type in the trained feedforward neural network according to the formula.
S140: and determining the current accuracy of the trained feedforward neural network according to the prediction error.
Specifically, after the calculation of the prediction error of each fault class is completed, the current accuracy of the trained feedforward neural network for predicting each fault class can be calculated according to all the prediction errors. When the current accuracy is greater than a preset accuracy threshold, taking the trained feedforward neural network as an initial Internet of things fault diagnosis model, and performing a subsequent verification and correction step. The accuracy threshold can be set according to a specific scene, if the accuracy threshold is set to be 95%, the subsequent verification and correction steps can be performed when the current accuracy is greater than 95%.
S150: if the current accuracy is smaller than a preset accuracy threshold, optimizing the trained feedforward neural network by adopting a gradient descent method until the current accuracy reaches the accuracy threshold, and obtaining the optimized feedforward neural network as an initial Internet of things fault diagnosis model.
In this embodiment, a small batch gradient descent Method (MBGD) optimization function is used to optimize the trained feedforward neural network, and gradually optimize the connection weights, so as to obtain a more accurate pre-diagnosis model based on the feedforward neural network. Specifically, a small batch of samples with fixed size is used for calculation each time, for n samples, m samples are randomly used each time, gradient optimization is carried out on the connection weight, and the connection weight is tested, and meanwhile, the connection weight of each fault class is updated, and the algorithm flow is as follows:
setting batch_size=50 samples, and the number of samples m=10000;
initializing each connection weight gradient Deltaw i Is a random number with smaller absolute value;
for each < X, t > of the small batch of samples, a calculation is performed until the accuracy threshold is reached.
The order of the training samples is disturbed, and a new round of the optimization calculation is started.
In the gradient optimization process, the convergence speed and stability can be compromised to avoid missing the optimal solution.
S160: and if the current accuracy rate reaches a preset accuracy rate threshold value, taking the trained feedforward neural network as an initial Internet of things fault diagnosis model.
S170: and if the current accuracy rate reaches a preset accuracy rate threshold value, verifying and correcting the initial Internet of things fault diagnosis model through the test sample set to obtain a target Internet of things fault diagnosis model.
Specifically, if the current accuracy rate does not reach the accuracy rate threshold, optimizing the trained feedforward neural network by adopting a gradient descent method until the optimized accuracy rate reaches the accuracy rate threshold, so as to obtain an initial Internet of things fault diagnosis model.
And verifying the accuracy of the initial Internet of things fault diagnosis model through the test sample set, if the verification set does not accord with the fault pre-diagnosis model, re-entering an optimization stage, executing the same steps as S140-150, and re-adjusting the connection weight of the neural network to finally obtain the target Internet of things fault diagnosis model.
According to the training method of the fault diagnosis model of the Internet of things based on the feedforward neural network, the known deep learning of the total quantity of fault information of the Internet of things is utilized to train and establish the fault pre-diagnosis model of the Internet of things based on the feedforward neural network, the fault probability matrix of the Internet of things is output, and delimitation is completed, so that the training method is more efficient and intelligent.
Furthermore, the embodiment of the invention is based on a feedforward neural network, and through complete closed-loop training processes such as cross entropy error judgment, a small-batch gradient optimization algorithm, a multi-classification softmax activation function, test set verification and the like, the accuracy of the output of a fault pre-diagnosis model is ensured, and the accuracy of fault diagnosis is improved.
Fig. 3 is a flowchart of an embodiment of the fault diagnosis method of the internet of things based on the feedforward neural network, which is performed by the fault diagnosis device of the internet of things based on the feedforward neural network. As shown in fig. 3, the method comprises the steps of:
s210: inputting the fault data of the Internet of things to be diagnosed into a target Internet of things fault diagnosis model, wherein the target Internet of things fault diagnosis model is obtained through training by the training method of the Internet of things fault diagnosis model based on the feedforward neural network.
Specifically, the fault data of the internet of things to be diagnosed is a 37-dimensional fault feature matrix for representing fault features.
The input of the target Internet of things fault diagnosis model is a 37-dimensional fault feature matrix, and the output is a 6-class fault class probability matrix. The method is obtained through training by the training method of the fault diagnosis model of the Internet of things based on the feedforward neural network, and the training method is the same as the embodiment and is not repeated here.
S220: performing fault diagnosis on the Internet of things data to be diagnosed through the target Internet of things fault diagnosis model, and outputting a target fault class probability matrix.
The process of performing fault diagnosis on the internet of things data to be diagnosed by the target internet of things fault diagnosis model comprises the following steps: and calculating the 37-dimensional fault feature matrix according to the connection weight value to obtain a target fault class probability matrix corresponding to the data of the Internet of things to be diagnosed. In this embodiment, the probability matrix of the target fault class represents the probability of the corresponding class 6 fault class, and is characterized by a form of a 6-dimensional matrix. If the output 6-dimensional matrix is [0.1,0,0.2,0,0.1,0.6], the probability that the fault class is a card fault is 0.1, the probability that the fault class is a terminal is 0, the probability that the fault class is wireless is 0.2, the probability that the fault class is transmission is 0, the probability that the fault class is a core network is 0.1, and the probability that the fault class is a client side is 0.6.
S230: and obtaining the target fault class according to the target fault class probability matrix.
In the target fault class probability matrix, one fault class with the highest probability is the target fault class. For example, the probability of the client side is 0.6 maximum in the 6-dimensional matrix of the output [0.1,0,0.2,0,0.1,0.6], and thus the failure type is determined as the client side failure.
According to the Internet of things fault diagnosis method based on the feedforward neural network, the known deep learning of the full-quantity Internet of things fault information is utilized, the Internet of things fault pre-diagnosis model based on the feedforward neural network is built through training, the Internet of things fault probability matrix is output, delimitation is completed, and the method is efficient and intelligent.
Furthermore, the embodiment of the invention is based on a feedforward neural network, and for model training, the accuracy of fault pre-diagnosis model output is ensured and the accuracy of fault diagnosis is improved through complete closed loop training processes such as cross entropy error judgment, a small batch gradient optimization algorithm, a multi-classification softmax activation function, test set verification and the like.
Fig. 4 shows a schematic structural diagram of an embodiment of the training device of the fault diagnosis model of the internet of things based on the feedforward neural network. As shown in fig. 4, the apparatus 300 includes: sample processing module 310, model pre-training module 320, prediction error module 330, accuracy determination module 340, optimization module 350, test modification module 360.
The sample processing module 310 is configured to collect historical internet of things fault feature sample data and corresponding fault class data, preprocess the historical internet of things fault feature sample data to obtain a sample set, and divide the sample set into a training sample set and a test sample set, where the sample set includes the internet of things fault sample feature data and corresponding fault class labels.
The model pre-training module 320 is configured to input the training sample set into a preset feedforward neural network for training, so as to obtain a trained neural network.
A prediction error calculation module 330, configured to calculate a prediction error of the prediction error.
And the accuracy rate determining module 340 is configured to calculate the current accuracy rate of the trained feedforward neural network according to the prediction error.
The optimizing module 350 is configured to optimize the prediction error by using a gradient descent method if the current accuracy rate does not reach the accuracy rate threshold, until the optimized accuracy rate reaches the accuracy rate threshold, obtain an optimized feedforward neural network as an initial internet of things fault diagnosis model, and further use the trained feedforward neural network as the initial internet of things fault diagnosis model if the current accuracy rate reaches a preset accuracy rate threshold;
The test correction module 360 is configured to verify and correct the initial internet of things fault diagnosis model through the test sample set, so as to obtain a target internet of things fault diagnosis model.
The specific working process of each module is as follows:
the sample processing module 310 collects historical internet of things fault feature sample data and corresponding fault class data, preprocesses the historical internet of things fault feature sample data and the corresponding fault class data to obtain a sample set, and divides the sample set into a training sample set and a test sample set, wherein the sample set comprises the internet of things fault sample feature data and the corresponding fault class label.
The fault sample feature data of the Internet of things comprise multidimensional fault expression data, and the fault type labels comprise card faults, terminal faults, wireless faults, transmission faults, core network faults and client side faults. And associating the fault class labels with the historical Internet of things fault sample characteristic data to form a multi-dimensional matrix sample.
In this embodiment, the faults of the internet of things are classified into 6 fault categories of cards, terminals, wireless, transmission, core networks and client sides, and large-scale 37-dimensional fault characteristic data are collected. According to the correlation, the 37-dimensional fault data are correlated with 6 fault categories, and the correlation values are respectively defined as 1 (correlation), 0.5 (unknown) and 0 (irrelevant), so that a 37-dimensional fault feature matrix is formed and is used as the input of the fault diagnosis model of the Internet of things. Wherein each row in the 37-dimensional fault feature matrix represents a sample, and each column represents a property of the sample. And taking the constructed sample data as the input of the feedforward neural network.
In order to reduce the overfitting phenomenon, the invention also preprocesses the collected samples. The number of each fault class is counted by a machine, and if the sample set of a certain class is too small, the connection weight of the class is inaccurate. Therefore, aiming at the weakly classified samples, the training data is transformed to strengthen the data set, so that the sample set with stronger generalization capability is obtained. Specifically, when classifying the multidimensional fault feature data, the generalization of model training on the test set is poor due to the unbalanced number of samples in the training set. Because the actual training samples are from actual complaints and fault handling, there are very many samples of one class or several classes, with relatively few other classes. In order to improve Accuracy (Accuracy), the data layer is processed, the distribution of each fault class is modified, and data enhancement is performed on samples corresponding to each class of fault class in the sample set, so that the samples of each fault class are kept in the same order of magnitude.
Data enhancement is carried out on samples corresponding to fault categories in the sample set so as to keep the number of the samples corresponding to each fault category in the same order of magnitude, and the specific process is as follows:
and if the number of the samples of the first fault class is larger than the average number of the samples, randomly deleting the number of the samples corresponding to the first fault class. In this embodiment, if the number of samples of the first failure category is greater than 2 times the average number of samples, 40% of the number of samples corresponding to the first failure category is randomly deleted.
If the number of samples of the second fault class is smaller than the average number of samples, the number of samples of the second fault class is increased by using a preset data transformation rule. In this embodiment, if the number of samples of the second fault class is less than 1 half of the average number of samples, the number of samples of the second fault class is increased by 40% using a preset data transformation rule.
The preset data transformation rule is as follows: and keeping the sample data with strong correlation with the second fault class unchanged, randomly generating other values with preset probability for the sample data with strong correlation with the second fault class, and completely randomly generating values for the sample data with weak correlation with the second fault class to form new sample data. In this embodiment, the preset probability is 50%.
After the sample set is formed, the sample set is divided into a training sample set and a test sample set. In this embodiment, the sample set may be divided into 80% training sample set and 20% test sample set.
The model pre-training module 320 inputs the training sample set into a preset feedforward neural network for training, and obtains a trained neural network.
In this embodiment, the preset feedforward neural network includes an input layer, a 2-layer hidden layer, and an output layer, where each hidden layer includes 256 neurons.
And training the input layer, the hidden layer and the output layer of the preset neural network layer by a supervised training method to obtain the trained neural network. Specifically, the connection weight of each fault class is updated by inputting samples one by one, an initial weight (generally random) is set first, sample data are input one by one, if the output sample class is identical to the real fault class label, the next sample is continuously input, if the output sample class is inconsistent with the real fault class label, the connection weight is updated, and then the connection weight is checked one by one again until the output fault class of each sample data is identical to the real fault class label, so that the connection weight corresponding to each fault class is finally determined.
Here, the feedforward neural network outputs a 6-dimensional matrix, each dimension representing the probability of which fault class belongs to. If a sample is input with a prediction error, the output 6-dimensional matrix is [0.1,0,0.2,0,0.1,0.6], which indicates that the probability of the failure category being a card failure is 0.1, the probability of the failure category being a terminal is 0, the probability of the failure category being wireless is 0.2, the probability of the failure category being transmission is 0, the probability of the failure category being a core network is 0.1, and the probability of the failure category being a client side is 0.6. The probability of the client side is the greatest, so the fault class is judged as the client side fault.
The prediction error calculation module 330 calculates the prediction error of the trained feedforward neural network. Firstly, before calculating the prediction error of the trained feedforward neural network, inputting each class of training sample set into the trained feedforward neural network, and obtaining each 6 probability matrixes corresponding to each class of samples according to the connection weight of each class.
Specifically, for the j-th class of fault class, a training sample corresponding to the j-th class of fault class is obtained and is input into the trained feedforward neural network, and the connection weight matrix of the j-th class of fault class is w j Calculating a probability matrix sigma (Z) obtained after a training sample corresponding to the j-th fault class is input into the trained feedforward neural network by adopting a multi-class softmax activation function j As shown in equation 1, the output is a set of fault data 6-dimensional probability matrices. w (w) j The initial values of (a) are all matrices of 0. Equation 2 is the weight value of the corresponding j-th class fault class of the neuron of the previous layer.
Z j =x T w j (2)
Wherein the number of fault categories k= 6,w j The connection weight matrix is trained for the j-th fault class for the trained feedforward neural network; z is Z j Is the weight value of the j-th class fault class of the neuron of the previous layer; sigma (Z) j And x is the input 37-dimensional fault characteristic sample data for the probability matrix of the j-th class fault class. After obtaining a j-th training sample according to a formula 3 and inputting the j-th training sample into a trained feedforward neural network, outputting the probability t of the fault class j j :
t j =σ(Z) j (3)
Then, according to the probability t of the j-th class j And calculating the prediction error of the trained feedforward neural network for the j-th class fault class. As shown in equation 4, the cross entropy error loss function is utilizedAnd obtaining the prediction result of the trained feedforward neural network for the j fault class and the prediction error of the actual fault class by using the distance of the probability distribution. The actual fault class is a fault class label.
E=-∑ j∈D O j ln t j (4)
Wherein D is a set of 6 Internet of things fault categories, and if the actual fault category is the same as the predicted result of the trained feedforward neural network on the jth category, O j =1, otherwise O j =0;t j For the prediction result (0.ltoreq.t) of the j fault class j And is less than or equal to 1). O only when j is the actual barrier category j Is 1, so that the formula 4 can be simplified to the following formula 5, and because 0 is less than or equal to t j And 1. Ltoreq.so that the abscissas 0 to 1 are effective segments, as can be seen from FIG. 2, the prediction error E is greater as the calculated probability of the actual class is smaller.
E=-ln t j (5)
And finishing the calculation of the prediction error of each fault type in the trained feedforward neural network according to the formula.
The accuracy determination module 340 determines the current accuracy of the trained feedforward neural network based on the prediction error. Specifically, after the calculation of the prediction error of each fault type is completed, the current accuracy of the feedforward neural network prediction after training is calculated according to all the prediction errors. When the current accuracy is greater than a preset accuracy threshold, taking the trained feedforward neural network as an initial Internet of things fault diagnosis model, and performing a subsequent verification and correction step. The accuracy threshold can be set according to a specific scene, if the accuracy threshold is set to be 95%, the subsequent verification and correction steps can be performed when the current accuracy is greater than 95%.
And the optimization module 350 is used for optimizing the prediction error by adopting a gradient descent method when the current accuracy rate does not reach the accuracy rate threshold value, obtaining an initial Internet of things fault diagnosis model, and taking the trained feedforward neural network as the initial Internet of things fault diagnosis model if the current accuracy rate reaches a preset accuracy rate threshold value.
The test correction module 360 performs verification correction on the initial internet of things fault diagnosis model through a test sample set to obtain a target internet of things fault diagnosis model. Specifically, if the current accuracy rate does not reach the accuracy rate threshold, optimizing the trained feedforward neural network by adopting a gradient descent method until the optimized accuracy rate reaches the accuracy rate threshold, so as to obtain the optimized feedforward neural network as an initial Internet of things fault diagnosis model.
And verifying the accuracy of the initial Internet of things fault diagnosis model through the test sample set, if the verification set does not accord with the fault pre-diagnosis model, re-entering an optimization stage, and re-performing optimization calculation by the error calculation module 330, the accuracy determination module 340 and the optimization module 350 to re-adjust the connection weight of the neural network so as to finally obtain the target Internet of things fault diagnosis model.
According to the training device of the fault diagnosis model of the Internet of things based on the feedforward neural network, the known deep learning of the total quantity of fault information of the Internet of things is utilized to train the fault pre-diagnosis model of the Internet of things based on the feedforward neural network, the fault probability matrix of the Internet of things is output, and delimitation is completed, so that the training device is more efficient and intelligent.
Furthermore, the embodiment of the invention is based on a feedforward neural network, and for model training, the accuracy of fault pre-diagnosis model output is ensured and the accuracy of fault diagnosis is improved through complete closed loop training processes such as cross entropy error judgment, a small batch gradient optimization algorithm, a multi-classification softmax activation function, test set verification and the like.
Fig. 5 shows a schematic structural diagram of an embodiment of the fault diagnosis device of the internet of things based on the feedforward neural network. As shown in fig. 5, the apparatus 400 includes: an input module 410, a fault diagnosis module 420, and an output module 430.
The input module 410 is configured to input the fault data of the internet of things to be diagnosed to a target fault diagnosis model of the internet of things, where the target fault diagnosis model of the internet of things is obtained by training the training method of the fault diagnosis model of the internet of things based on the feedforward neural network in the above embodiment. Specifically, the fault data of the internet of things to be diagnosed is a 37-dimensional fault feature matrix for representing fault features.
The input of the target Internet of things fault diagnosis model is a 37-dimensional fault feature matrix, and the output is a 6-class fault class probability matrix. The method is obtained through training by the training method of the fault diagnosis model of the Internet of things based on the feedforward neural network, and the training method is the same as the embodiment and is not repeated here.
The fault diagnosis module 420 is configured to perform fault diagnosis on the internet of things data to be diagnosed through the target internet of things fault diagnosis model, and output a target fault class probability matrix.
The process of performing fault diagnosis on the internet of things data to be diagnosed by the target internet of things fault diagnosis model comprises the following steps: and calculating the 37-dimensional fault feature matrix according to the connection weight value to obtain a target fault class probability matrix corresponding to the data of the Internet of things to be diagnosed. In this embodiment, the probability matrix of the target fault class represents the probability of the corresponding class 6 fault class, and is characterized by a form of a 6-dimensional matrix. If the output 6-dimensional matrix is [0.1,0,0.2,0,0.1,0.6], the probability that the fault class is a card fault is 0.1, the probability that the fault class is a terminal is 0, the probability that the fault class is wireless is 0.2, the probability that the fault class is transmission is 0, the probability that the fault class is a core network is 0.1, and the probability that the fault class is a client side is 0.6.
And an output module 430, configured to obtain a target fault class according to the target fault class probability matrix.
In the target fault class probability matrix, one fault class with the highest probability is the target fault class. For example, the probability of the client side is 0.6 maximum in the 6-dimensional matrix of the output [0.1,0,0.2,0,0.1,0.6], and thus the failure type is determined as the client side failure.
According to the Internet of things fault diagnosis device based on the feedforward neural network, the known deep learning of the total amount of Internet of things fault information is utilized to train and establish the Internet of things fault pre-diagnosis model based on the feedforward neural network, the Internet of things fault probability matrix is output, delimitation is completed, and the device is efficient and intelligent.
Furthermore, the embodiment of the invention is based on a feedforward neural network, and for model training, the accuracy of fault pre-diagnosis model output is ensured and the accuracy of fault diagnosis is improved through complete closed loop training processes such as cross entropy error judgment, a small batch gradient optimization algorithm, a multi-classification softmax activation function, test set verification and the like.
Fig. 6 shows a schematic structural diagram of an embodiment of the electronic device of the present invention, which is not limited to the specific implementation of the electronic device.
As shown in fig. 6, the electronic device may include: a processor 502, a communication interface (Communications Interface) 504, a memory 506, and a communication bus 508.
Wherein: processor 502, communication interface 504, and memory 506 communicate with each other via communication bus 508. A communication interface 504 for communicating with network elements of other devices, such as clients or other application servers, etc. The processor 502 is configured to execute the program 510, and may specifically perform the relevant steps in the foregoing training method for the feedforward neural network-based internet of things fault diagnosis model and/or the feedforward neural network-based internet of things fault diagnosis method embodiment.
In particular, program 510 may include program code comprising computer-executable instructions.
The processor 502 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of the present invention. The one or more processors included in the diagnostic device of the internet of things may be the same type of processor, such as one or more CPUs; but may also be different types of processors such as one or more CPUs and one or more ASICs.
A memory 506 for storing a program 510. Memory 506 may comprise high-speed RAM memory or may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 510 may be specifically invoked by the processor 502 to cause the electronic device to:
collecting historical Internet of things fault characteristic sample data and corresponding fault class data, preprocessing to obtain a sample set, and dividing the sample set into a training sample set and a test sample set, wherein the sample set comprises the Internet of things fault sample characteristic data and corresponding fault class labels;
inputting the training sample set into a preset feedforward neural network for pre-training to obtain a trained feedforward neural network;
calculating a prediction error of the trained feedforward neural network;
determining the current accuracy of the trained feedforward neural network according to the prediction error;
if the current accuracy rate does not reach the accuracy rate threshold, optimizing the trained feedforward neural network by adopting a gradient descent method until the optimized accuracy rate reaches the accuracy rate threshold, and obtaining the optimized feedforward neural network as an initial Internet of things fault diagnosis model;
If the current accuracy rate reaches a preset accuracy rate threshold value, using the trained feedforward neural network as an initial Internet of things fault diagnosis model;
performing verification and correction on the initial Internet of things fault diagnosis model through the test sample set to obtain a target Internet of things fault diagnosis model; and/or
Inputting the fault data of the Internet of things to be diagnosed into a target Internet of things fault diagnosis model, wherein the target Internet of things fault diagnosis model is obtained through training by the training method of the Internet of things fault diagnosis model based on the feedforward neural network;
performing fault diagnosis on the Internet of things data to be diagnosed through the target Internet of things fault diagnosis model, and outputting a target fault class probability matrix;
and obtaining the target fault class according to the target fault class probability matrix.
In an optional manner, collecting historical internet of things fault feature sample data and corresponding fault class data, and preprocessing to obtain a sample set, wherein the sample set comprises the internet of things fault sample feature data and the corresponding fault class label, and further comprises:
data enhancement is carried out on samples corresponding to fault categories in the sample set, so that the corresponding sample number of each fault category is kept in the same order of magnitude:
If the number of samples of the first fault class is larger than the average number of samples, randomly deleting the number of samples corresponding to the first fault class;
if the number of samples of the second fault class is smaller than the average number of samples, increasing the number of samples of the second fault class by using a preset data transformation rule;
the preset data transformation rule is as follows: and keeping the sample data with strong correlation with the second fault class unchanged, randomly generating other values with preset probability for the sample data with strong correlation with the second fault class, and completely randomly generating values for the sample data with weak correlation with the second fault class to form new sample data.
In an optional manner, the training sample set is input into a preset feedforward neural network to perform training, so as to obtain a prediction error, and the method further includes:
the preset feedforward neural network comprises an input layer, a 2-layer hidden layer and an output layer, wherein each hidden layer comprises 256 neurons;
and training the preset neural network layer by a supervised training method to obtain a trained neural network.
In an alternative manner, calculating the prediction error of the trained feedforward neural network further includes:
Obtaining a connection weight corresponding to each fault class in the trained feedforward neural network;
combining the connection weight values, and calculating a fault class probability matrix corresponding to each training sample by adopting a multi-class softmax activation function;
and combining the fault class probability matrix, and calculating the prediction errors of the predicted fault class and the actual fault class corresponding to each training sample according to the cross entropy error loss function.
In an alternative approach, the prediction error of the trained feedforward neural network is calculated by the following formula:
calculating a probability matrix sigma (Z) of output after a training sample corresponding to the fault type is input into the trained feedforward neural network j J represents the fault category:
Z j =x T w j
according to the probability matrix sigma (Z) j Obtaining probability of fault class j j :
t j =σ(Z) j
According to probability t of fault class j j Calculating a prediction error E of the trained feedforward neural network for the fault class j:
E=-ln t j
wherein the number of fault categories k= 6,w j The connection weight matrix is trained for the j-th fault class for the trained feedforward neural network; z is Z j Is the weight value of the j-th class fault class corresponding to the neuron of the previous layer; sigma (Z) j Inputting a probability matrix output by a trained feedforward neural network for a training sample of the j-th class of fault class, wherein x is input 37-dimensional fault characteristic sample data; t is t j Representing the probability that the outputted fault class belongs to the j-th class; e denotes a prediction error.
The electronic equipment of the embodiment trains and establishes the fault pre-diagnosis model of the Internet of things based on the feedforward neural network by utilizing the deep learning of the known full-quantity Internet of things fault information, outputs the fault probability matrix of the Internet of things, and completes delimitation, thereby being more efficient and intelligent.
Furthermore, the embodiment of the invention is based on a feedforward neural network, and for model training, the accuracy of fault pre-diagnosis model output is ensured and the accuracy of fault diagnosis is improved through complete closed loop training processes such as cross entropy error judgment, a small batch gradient optimization algorithm, a multi-classification softmax activation function, test set verification and the like.
The embodiment of the invention provides a computer readable storage medium, wherein the storage medium stores at least one executable instruction, and when the executable instruction runs on an Internet of things diagnosis device/apparatus, the Internet of things diagnosis device/apparatus executes the training method of the Internet of things fault diagnosis model based on a feedforward neural network and the Internet of things fault diagnosis method in any method embodiment.
The executable instructions may be specifically configured to cause the internet of things diagnostic device/apparatus to:
Collecting historical Internet of things fault characteristic sample data and corresponding fault class data, preprocessing to obtain a sample set, and dividing the sample set into a training sample set and a test sample set, wherein the sample set comprises the Internet of things fault sample characteristic data and corresponding fault class labels;
inputting the training sample set into a preset feedforward neural network for pre-training to obtain a trained feedforward neural network;
calculating a prediction error of the trained feedforward neural network;
determining the current accuracy of the trained feedforward neural network according to the prediction error;
if the current accuracy rate does not reach the accuracy rate threshold, optimizing the trained feedforward neural network by adopting a gradient descent method until the optimized accuracy rate reaches the accuracy rate threshold, and obtaining the optimized feedforward neural network as an initial Internet of things fault diagnosis model;
if the current accuracy rate reaches a preset accuracy rate threshold value, using the trained feedforward neural network as an initial Internet of things fault diagnosis model;
performing verification and correction on the initial Internet of things fault diagnosis model through the test sample set to obtain a target Internet of things fault diagnosis model; and/or
Inputting to-be-diagnosed Internet of things fault data into a target Internet of things fault diagnosis model, wherein the target Internet of things fault diagnosis model is obtained by training a training method of the Internet of things fault diagnosis model based on a feedforward neural network;
performing fault diagnosis on the Internet of things data to be diagnosed through the target Internet of things fault diagnosis model, and outputting a target fault class probability matrix;
and obtaining the target fault class according to the target fault class probability matrix.
In an optional manner, collecting historical internet of things fault feature sample data and corresponding fault class data, and preprocessing to obtain a sample set, wherein the sample set comprises the internet of things fault sample feature data and the corresponding fault class label, and further comprises:
data enhancement is carried out on samples corresponding to fault categories in the sample set, so that the corresponding sample number of each fault category is kept in the same order of magnitude:
if the number of samples of the first fault class is larger than the average number of samples, randomly deleting the number of samples corresponding to the first fault class;
if the number of samples of the second fault class is smaller than the average number of samples, increasing the number of samples of the second fault class by using a preset data transformation rule;
The preset data transformation rule is as follows: and keeping the sample data with strong correlation with the second fault class unchanged, randomly generating other values with preset probability for the sample data with strong correlation with the second fault class, and completely randomly generating values for the sample data with weak correlation with the second fault class to form new sample data.
In an optional manner, the training sample set is input into a preset feedforward neural network to perform training, so as to obtain a prediction error, and the method further includes:
the preset feedforward neural network comprises an input layer, a 2-layer hidden layer and an output layer, wherein each hidden layer comprises 256 neurons;
and training the preset neural network layer by a supervised training method to obtain a trained neural network.
In an alternative manner, calculating the prediction error of the trained feedforward neural network further includes:
obtaining a connection weight corresponding to each fault class in the trained feedforward neural network;
combining the connection weight values, and calculating a fault class probability matrix corresponding to each training sample by adopting a multi-class softmax activation function;
and combining the fault class probability matrix, and calculating the prediction errors of the predicted fault class and the actual fault class corresponding to each training sample according to the cross entropy error loss function.
In an alternative approach, the prediction error of the trained feedforward neural network is calculated by the following formula:
calculating a probability matrix sigma (Z) of output after a training sample corresponding to the fault type is input into the trained feedforward neural network j J represents the fault category:
Z j =x T w j
according to the probability matrix sigma (Z) j Obtaining the probability t of the fault class j j :
t j =σ(Z) j
According to the probability t of the fault class j j Calculating a prediction error E of the trained feedforward neural network for the fault class j:
E=-ln t j
wherein the number of fault categories k= 6,w j The connection weight matrix is trained for the j-th fault class for the trained feedforward neural network; z is Z j Is the weight value of the j-th class fault class corresponding to the neuron of the previous layer; sigma (Z) j Inputting a probability matrix output by a trained feedforward neural network for a training sample of the j-th class of fault class, wherein x is input 37-dimensional fault characteristic sample data; t is t j Representing the probability that the outputted fault class belongs to the j-th class; e denotes a prediction error.
According to the embodiment, the known deep learning of the full-quantity Internet of things fault information is utilized, the Internet of things fault pre-diagnosis model based on the feedforward neural network is trained and established, the Internet of things fault probability matrix is output, delimitation is completed, and the method is efficient and intelligent.
Furthermore, the embodiment of the invention is based on a feedforward neural network, and for model training, the accuracy of fault pre-diagnosis model output is ensured and the accuracy of fault diagnosis is improved through complete closed loop training processes such as cross entropy error judgment, a small batch gradient optimization algorithm, a multi-classification softmax activation function, test set verification and the like.
The embodiment of the invention provides a training device of an Internet of things fault diagnosis model based on a feedforward neural network, which is used for executing the training method of the Internet of things fault diagnosis model based on the feedforward neural network.
The embodiment of the invention provides an Internet of things fault diagnosis device based on a feedforward neural network, which is used for executing the Internet of things fault diagnosis method based on the feedforward neural network.
The embodiment of the invention provides a computer program which can be called by a processor to enable electronic equipment to execute the training method of the Internet of things fault diagnosis model based on the feedforward neural network and/or the Internet of things fault diagnosis method based on the feedforward neural network in any method embodiment.
An embodiment of the present invention provides a computer program product, where the computer program product includes a computer program stored on a computer readable storage medium, where the computer program includes program instructions, when the program instructions are executed on a computer, cause the computer to execute the training method of the internet of things fault diagnosis model based on a feedforward neural network and/or the internet of things fault diagnosis method based on the feedforward neural network in any of the above method embodiments.
The algorithms or displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general-purpose systems may also be used with the teachings herein. The required structure for a construction of such a system is apparent from the description above. In addition, embodiments of the present invention are not directed to any particular programming language. It will be appreciated that the teachings of the present invention described herein may be implemented in a variety of programming languages, and the above description of specific languages is provided for disclosure of enablement and best mode of the present invention.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the above description of exemplary embodiments of the invention, various features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed as reflecting the intention that: i.e., the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the apparatus of the embodiments may be adaptively changed and disposed in one or more apparatuses different from the embodiments. The modules or units or components of the embodiments may be combined into one module or unit or component and, furthermore, they may be divided into a plurality of sub-modules or sub-units or sub-components. Any combination of all features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or units of any method or apparatus so disclosed, may be used in combination, except insofar as at least some of such features and/or processes or units are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings), may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features but not others included in other embodiments, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, third, etc. do not denote any order. These words may be interpreted as names. The steps in the above embodiments should not be construed as limiting the order of execution unless specifically stated.
Claims (8)
1. The training method of the fault diagnosis model of the Internet of things based on the feedforward neural network is characterized by comprising the following steps of:
Collecting historical Internet of things fault characteristic sample data and corresponding fault class data, preprocessing to obtain a sample set, and dividing the sample set into a training sample set and a test sample set, wherein the sample set comprises the Internet of things fault sample characteristic data and corresponding fault class labels;
inputting the training sample set into a preset feedforward neural network for pre-training to obtain a trained feedforward neural network;
calculating a prediction error of the trained feedforward neural network, including: obtaining a connection weight corresponding to each fault class in the trained feedforward neural network; combining the connection weight values, and calculating a fault class probability matrix corresponding to each training sample by adopting a multi-class softmax activation function; calculating the prediction error of the predicted fault class and the actual fault class corresponding to each training sample according to the cross entropy error loss function by combining the fault class probability matrix; the prediction error of the feedforward neural network after training is calculated through the following formula:
calculating a probability matrix sigma (Z) of output after a training sample corresponding to the fault type is input into the trained feedforward neural network j The j represents the fault category:
According to the probability matrix sigma (Z) j Obtaining probability of fault class j j :
j =σ(Z) j
According to the probability of the fault class j j Calculating a prediction error E of the trained feedforward neural network for the fault class j:
E=-lnt j
wherein the number of fault categories k= 6,w j The connection weight matrix is trained for the j-th fault class for the trained feedforward neural network; z is Z j Is the weight value of the j-th class fault class corresponding to the neuron of the previous layer; sigma (sigma)(Z) j Inputting a probability matrix output by a trained feedforward neural network for a training sample of the j-th class of fault class, wherein x is input 37-dimensional fault characteristic sample data; j representing the probability that the outputted fault class belongs to the j-th class; e represents a prediction error;
determining the current accuracy of the trained feedforward neural network according to the prediction error;
if the current accuracy rate does not reach the accuracy rate threshold, optimizing the trained feedforward neural network by adopting a gradient descent method until the optimized accuracy rate reaches the accuracy rate threshold, and obtaining the optimized feedforward neural network as an initial Internet of things fault diagnosis model;
if the current accuracy rate reaches a preset accuracy rate threshold value, using the trained feedforward neural network as an initial Internet of things fault diagnosis model;
And verifying and correcting the initial Internet of things fault diagnosis model through the test sample set to obtain a target Internet of things fault diagnosis model.
2. The method of claim 1, wherein collecting historical internet of things fault feature data and corresponding fault class data, preprocessing to obtain a sample set, the sample set including internet of things fault sample feature data and corresponding fault class labels, further comprising:
data enhancement is carried out on samples corresponding to fault categories in the sample set, so that the corresponding sample number of each fault category is kept in the same order of magnitude:
if the number of samples of the first fault class is larger than the average number of samples, randomly deleting the number of samples corresponding to the first fault class;
if the number of samples of the second fault class is smaller than the average number of samples, increasing the number of samples of the second fault class by using a preset data transformation rule;
the preset data transformation rule is as follows: and keeping the sample data with strong correlation with the second fault class unchanged, randomly generating other values with preset probability for the sample data with strong correlation with the second fault class, and completely randomly generating values for the sample data with weak correlation with the second fault class to form new sample data.
3. The method of claim 1, wherein inputting the training sample set into a preset feedforward neural network for training to obtain a prediction error, further comprising:
the preset feedforward neural network comprises an input layer, a 2-layer hidden layer and an output layer, wherein each hidden layer comprises 256 neurons;
and training the preset neural network layer by a supervised training method to obtain a trained neural network.
4. The fault diagnosis method of the Internet of things based on the feedforward neural network is characterized by comprising the following steps of:
inputting to-be-diagnosed Internet of things fault data into a target Internet of things fault diagnosis model, wherein the target Internet of things fault diagnosis model is obtained by training the training method of the Internet of things fault diagnosis model based on the feedforward neural network according to any one of claims 1-3;
performing fault diagnosis on the Internet of things data to be diagnosed through the target Internet of things fault diagnosis model, and outputting a target fault class probability matrix;
and obtaining the target fault class according to the target fault class probability matrix.
5. An internet of things fault diagnosis model training device based on a feedforward neural network, which is characterized by comprising:
The sample processing module is used for collecting historical Internet of things fault characteristic sample data and corresponding fault class data, preprocessing the historical Internet of things fault characteristic sample data to obtain a sample set, and dividing the sample set into a training sample set and a test sample set, wherein the sample set comprises the Internet of things fault sample characteristic data and corresponding fault class labels;
the model pre-training module is used for inputting the training sample set into a preset feedforward neural network for training to obtain a trained neural network;
a prediction error calculation module, configured to calculate a prediction error of the prediction error, including: obtaining a connection weight corresponding to each fault class in the trained feedforward neural network; combining the connection weight values, and calculating a fault class probability matrix corresponding to each training sample by adopting a multi-class softmax activation function; calculating the prediction error of the predicted fault class and the actual fault class corresponding to each training sample according to the cross entropy error loss function by combining the fault class probability matrix; the prediction error of the feedforward neural network after training is calculated through the following formula:
calculating a probability matrix sigma (Z) of output after a training sample corresponding to the fault type is input into the trained feedforward neural network j The j represents the fault category:
Z j =x T w j
according to the probability matrix sigma (Z) j Obtaining the probability t of the fault class j j :
t j =σ(Z) j
According to the probability t of the fault class j j Calculating a prediction error E of the trained feedforward neural network for the fault class j:
E=-ln t j
wherein the number of fault categories k= 6,w j The connection weight matrix is trained for the j-th fault class for the trained feedforward neural network; z is Z j Is the weight value of the j-th class fault class corresponding to the neuron of the previous layer; sigma (Z) j Inputting a probability matrix output by a trained feedforward neural network for a training sample of the j-th class of fault class, wherein x is input 37-dimensional fault characteristic sample data; t is t j Representing the probability that the outputted fault class belongs to the j-th class; e tableShowing a prediction error;
the accuracy rate determining module is used for calculating the current accuracy rate of the trained feedforward neural network according to the prediction error;
the optimization module is used for optimizing the prediction error by adopting a gradient descent method until the optimized accuracy reaches the accuracy threshold value when the current accuracy does not reach the accuracy threshold value, obtaining an optimized feedforward neural network as an initial Internet of things fault diagnosis model, and taking the trained feedforward neural network as the initial Internet of things fault diagnosis model when the current accuracy reaches a preset accuracy threshold value;
And the test correction module is used for verifying and correcting the initial Internet of things fault diagnosis model through the test sample set so as to obtain a target Internet of things fault diagnosis model.
6. An internet of things fault diagnosis device based on a feedforward neural network, which is characterized by comprising:
the input module is used for inputting the fault data of the Internet of things to be diagnosed into a target fault diagnosis model of the Internet of things, wherein the target fault diagnosis model of the Internet of things is obtained by training the training method of the fault diagnosis model of the Internet of things based on the feedforward neural network according to any one of claims 1-3;
the fault diagnosis module is used for carrying out fault diagnosis on the Internet of things data to be diagnosed through the target Internet of things fault diagnosis model and outputting a target fault class probability matrix;
and the output module is used for obtaining the target fault class according to the target fault class probability matrix.
7. An electronic device, comprising: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
the memory is configured to store at least one executable instruction that causes the processor to perform the operations of the method of any one of claims 1-4.
8. A computer readable storage medium, wherein at least one executable instruction is stored in the storage medium, which when executed by a processor, implements the steps of the method according to any of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010292445.7A CN113541985B (en) | 2020-04-14 | 2020-04-14 | Internet of things fault diagnosis method, model training method and related devices |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010292445.7A CN113541985B (en) | 2020-04-14 | 2020-04-14 | Internet of things fault diagnosis method, model training method and related devices |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113541985A CN113541985A (en) | 2021-10-22 |
CN113541985B true CN113541985B (en) | 2023-07-14 |
Family
ID=78120309
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010292445.7A Active CN113541985B (en) | 2020-04-14 | 2020-04-14 | Internet of things fault diagnosis method, model training method and related devices |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113541985B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115034334A (en) * | 2022-06-30 | 2022-09-09 | 苏州市佳路防务科技有限公司 | Military mobile air conditioner fault diagnosis method based on machine learning BSVM |
CN116107796B (en) * | 2023-04-17 | 2023-06-20 | 四川观想科技股份有限公司 | Internet of things data management system and method |
CN117060353A (en) * | 2023-07-31 | 2023-11-14 | 中国南方电网有限责任公司超高压输电公司电力科研院 | Fault diagnosis method and system for high-voltage direct-current transmission system based on feedforward neural network |
CN116881832B (en) * | 2023-09-07 | 2023-12-08 | 山东能源数智云科技有限公司 | Construction method and device of fault diagnosis model of rotary mechanical equipment |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106769048B (en) * | 2017-01-17 | 2019-05-24 | 苏州大学 | Adaptive deep confidence network bearing fault diagnosis method based on Nesterov momentum method |
CN109871877A (en) * | 2019-01-23 | 2019-06-11 | 淮海工学院 | Using the method for diagnosing faults of Artificial neural network ensemble |
CN109918752B (en) * | 2019-02-26 | 2022-12-16 | 华南理工大学 | Mechanical fault diagnosis method, equipment and medium based on migration convolution neural network |
CN109902741A (en) * | 2019-02-28 | 2019-06-18 | 上海理工大学 | A kind of breakdown of refrigeration system diagnostic method |
CN110081966A (en) * | 2019-05-27 | 2019-08-02 | 苏州工业职业技术学院 | The fault diagnosis system and method for fan vibration sensor |
-
2020
- 2020-04-14 CN CN202010292445.7A patent/CN113541985B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN113541985A (en) | 2021-10-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113541985B (en) | Internet of things fault diagnosis method, model training method and related devices | |
CN110473083B (en) | Tree risk account identification method, device, server and storage medium | |
CN106991047B (en) | Method and system for predicting object-oriented software defects | |
CN113923104B (en) | Network fault diagnosis method, equipment and storage medium based on wavelet neural network | |
CN113228062B (en) | Deep integration model training method based on feature diversity learning | |
CN110135505B (en) | Image classification method and device, computer equipment and computer readable storage medium | |
CN115563610B (en) | Training method, recognition method and device for intrusion detection model | |
CN114048468A (en) | Intrusion detection method, intrusion detection model training method, device and medium | |
CN110110845A (en) | Learning method based on parallel multi-level width neural network | |
CN109101984B (en) | Image identification method and device based on convolutional neural network | |
CN114330650A (en) | Small sample characteristic analysis method and device based on evolutionary element learning model training | |
CN113610747A (en) | Automatically selecting an algorithm module to examine a sample | |
WO2020190951A1 (en) | Neural network trained by homographic augmentation | |
CN113011893B (en) | Data processing method, device, computer equipment and storage medium | |
CN114169460A (en) | Sample screening method, sample screening device, computer equipment and storage medium | |
CN113255927A (en) | Logistic regression model training method and device, computer equipment and storage medium | |
CN111783688A (en) | Remote sensing image scene classification method based on convolutional neural network | |
US20230041338A1 (en) | Graph data processing method, device, and computer program product | |
CN112203311A (en) | Network element abnormity diagnosis method, device, equipment and computer storage medium | |
CN115713669A (en) | Image classification method and device based on inter-class relation, storage medium and terminal | |
CN115907954A (en) | Account identification method and device, computer equipment and storage medium | |
CN114357219A (en) | Mobile-end-oriented instance-level image retrieval method and device | |
CN114528906A (en) | Fault diagnosis method, device, equipment and medium for rotary machine | |
CN113257329A (en) | Memory fault diagnosis method based on machine learning | |
CN113971737A (en) | Object recognition method for robot, electronic device, medium, and program product |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |