CN113541985A - Internet of things fault diagnosis method, training method of model and related device - Google Patents

Internet of things fault diagnosis method, training method of model and related device Download PDF

Info

Publication number
CN113541985A
CN113541985A CN202010292445.7A CN202010292445A CN113541985A CN 113541985 A CN113541985 A CN 113541985A CN 202010292445 A CN202010292445 A CN 202010292445A CN 113541985 A CN113541985 A CN 113541985A
Authority
CN
China
Prior art keywords
fault
internet
things
neural network
feedforward neural
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.)
Granted
Application number
CN202010292445.7A
Other languages
Chinese (zh)
Other versions
CN113541985B (en
Inventor
陈昶
章栋炯
沈敏儿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Group Zhejiang Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Group Zhejiang Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Group Zhejiang Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202010292445.7A priority Critical patent/CN113541985B/en
Publication of CN113541985A publication Critical patent/CN113541985A/en
Application granted granted Critical
Publication of CN113541985B publication Critical patent/CN113541985B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/047Probabilistic or stochastic networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning 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 method for training a fault diagnosis model of an Internet of things based on a feedforward neural network, which comprises the following steps: acquiring 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, and if the current accuracy does not reach the accuracy threshold, optimizing the trained feedforward neural network by adopting a gradient descent method to initiate a fault diagnosis model of the Internet of things; 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. Through the mode, the embodiment of the invention has the beneficial effect that the accuracy of fault identification is improved by the Internet of things fault pre-diagnosis model. The invention also provides a method for pre-diagnosing the faults of the Internet of things and a related device.

Description

Internet of things fault diagnosis method, training method of model and related device
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 business of the Internet of things is increased explosively, and the Internet of things becomes a necessary trend. Whether the fault detection and the accurate positioning of the complaints of the Internet of things are efficient or not is the key point for the rapid development and popularization of the business of the Internet of things.
However, the current diagnosis of the internet of things has the following problems:
1. mass complaints are as follows: the service development of the Internet of things is rapid, the complaint amount is increased rapidly, and the response speed is slow;
2. the efficiency is low: due to the networking structure of the Internet of things, multiple specialties need to be crossed for troubleshooting, and the operation and maintenance efficiency is low;
3. the threshold is high: the internet of things after-sale delimitation personnel require high-level skill requirements.
The existing common fault diagnosis method relying on core network element side data for fault diagnosis and SVM (support vector machine) fault diagnosis depends on core network side single fault data, and has high requirements on professional knowledge of operation and maintenance personnel; the SVM support vector machine algorithm is insensitive to kernel function selection, is suitable for classification of small sample sets, and can generate overfitting phenomenon when too many support vectors of large samples are used.
Therefore, an internet of things fault diagnosis model with high accuracy is needed to quickly and accurately diagnose massive internet of things faults.
Disclosure of Invention
In view of the above problems, 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 internet of things fault diagnosis device, and a computer-readable storage medium, which are used to solve the technical problem in the prior art that a large number of internet of things faults are difficult to diagnose quickly and accurately.
According to an aspect of the embodiments of the present invention, there is provided a training method for a fault diagnosis model of an internet of things based on a feedforward neural network, the method including:
acquiring historical internet of things fault feature sample data and corresponding fault category data, preprocessing to obtain a sample set, and dividing the sample set into a training sample set and a testing sample set, wherein the sample set comprises the internet of things fault sample feature data and corresponding fault category 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 rate threshold is reached, taking the prediction error as an initial internet of things fault diagnosis model;
if the accuracy rate threshold is not reached, optimizing the prediction error by adopting a gradient descent method until the current accuracy rate reaches the accuracy rate threshold to obtain 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 mode, historical internet of things fault feature sample data and corresponding fault category data are collected, a sample set is obtained through preprocessing, the sample set comprises internet of things fault sample feature data and corresponding fault category labels, and the method further comprises the following steps:
and performing data enhancement on samples corresponding to the fault categories in the sample set so as to keep the number of the samples corresponding to each fault category at the same order of magnitude:
if the number of samples of the first fault category is larger than the average number of samples, randomly deleting the number of samples corresponding to the first fault category;
if the number of samples of the second fault category is smaller than the average number of samples, increasing the number of samples of the second fault category by using a preset data transformation rule;
the preset data transformation rule is as follows: keeping the sample data with strong correlation with the second fault category unchanged, randomly generating other numerical values according to the sample data with the second fault category correlation according to a preset probability, and completely randomly generating the sample data with weak correlation with the second fault category to form new sample data.
In an optional manner, inputting the training sample set into a preset feedforward neural network for training, so as to obtain a prediction error, further including:
the preset feedforward neural network comprises an input layer, 2 hidden layers 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 the trained neural network.
In an alternative, calculating a prediction error of the prediction error further comprises:
acquiring 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 prediction errors are input into each training sample set;
and calculating the prediction error of the predicted fault category according to a cross entropy error loss function by combining the probability of the predicted fault category.
In an alternative approach, the prediction error of the trained feedforward neural network is calculated by the following formula:
calculating the probability matrix sigma (Z) of the output after the training sample corresponding to the fault category is input into the trained feedforward neural networkjAnd j represents the fault category:
Figure BDA0002450930680000031
Zj=xTwj
according to the probability matrix sigma (Z)jObtaining the probability of the fault category jj
tj=σ(Z)j
According to the probability of the fault class jjCalculating the prediction error E of the trained feedforward neural network to the fault class j:
E=-ln tj
wherein, the number k of fault categories is 6, wjTraining a connection weight matrix for the j-th fault category for the trained feedforward neural network; zjThe weighted value of the corresponding j-th fault category of the neuron in the previous layer; sigma (Z)jInputting a training sample of the jth fault category into a trained probability matrix output after the feedforward neural network is trained, wherein x is input 37-dimensional fault feature sample data; t is tjRepresenting the probability that the output fault category belongs to the jth category; and E represents a prediction error.
According to another aspect of the embodiments of the present invention, there is also provided a fault diagnosis method for an internet of things based on a feedforward neural network, including:
inputting 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 by training through 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 category probability matrix;
and obtaining the target fault category according to the target fault category probability matrix.
According to another aspect of the embodiments 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 system comprises a sample processing module, a fault classification module and a fault classification module, wherein the sample processing module is used for acquiring historical internet of things fault characteristic sample data and corresponding fault classification data, preprocessing the sample set to obtain a sample set, and dividing the sample set into a training sample set and a testing sample set, wherein the sample set comprises the internet of things fault characteristic sample data and a corresponding fault classification label;
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 for calculating 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 according to the prediction error:
if the accuracy rate threshold is reached, taking the prediction error as an initial internet of things fault diagnosis model;
the optimization module is used for optimizing the prediction error by adopting a gradient descent method if the judgment module judges that the accuracy rate threshold is not reached, until the optimized accuracy rate reaches the accuracy rate threshold, and obtaining an initial fault diagnosis model of the internet of things;
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 embodiments of the present invention, there is provided a fault diagnosis apparatus for an internet of things based on a feedforward neural network, the apparatus including:
the system comprises an input module, a target internet of things fault diagnosis module and a fault diagnosis module, wherein the input module is used for inputting the fault data of the internet of things to be diagnosed into the target internet of things fault diagnosis model, and the target internet of things fault diagnosis model is obtained by training through 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 category probability matrix;
and the output module is used for obtaining the target fault category according to the target fault category probability matrix.
According to another aspect of the embodiments of the present invention, there is provided an electronic device including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication 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 operation of the training method of the internet of things fault diagnosis model or the internet of things fault diagnosis method.
According to a further aspect of the embodiments of the present invention, there is provided a computer-readable storage medium, in which at least one executable instruction is stored, and when the executable instruction is executed 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 or the operation of the internet of things fault diagnosis method.
According to the embodiment of the invention, the fault pre-diagnosis model of the internet of things based on the feedforward neural network is trained and established by utilizing the deep learning of the known fault information of the full internet of things, the probability matrix of the faults of the internet of things is output, the delimitation is completed, and the method is efficient and intelligent.
Furthermore, the embodiment of the invention is based on the feedforward neural network, and the accuracy of the output of the fault pre-diagnosis model is ensured and the accuracy of the 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 foregoing description is only an overview of the technical solutions of the embodiments of the present invention, and the embodiments of the present invention can be implemented according to the content of the description in order to make the technical means of the embodiments of the present invention more clearly understood, and the detailed description of the present invention is provided below in order to make the foregoing and other objects, features, and advantages of the embodiments of the present invention more clearly understandable.
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 refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic flow chart illustrating a training method of a fault diagnosis model of the internet of things based on a feedforward neural network according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating the relationship between an actual fault category error and the fault category error provided by an embodiment of the present invention;
fig. 3 is a schematic flow chart of a fault diagnosis method of the internet of things based on a feedforward neural network according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a training device of an Internet of things fault diagnosis model based on a feedforward neural network provided by an embodiment of the invention;
fig. 5 is a schematic structural diagram of a fault diagnosis device of the internet of things based on a feed-forward neural network provided by an embodiment of the invention;
fig. 6 shows a schematic structural diagram of an electronic device provided in 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 invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein.
Fig. 1 is a schematic flow chart of a training method of a fault diagnosis model of the internet of things based on a feedforward neural network, which is provided by an embodiment of the invention and is executed by a training device of the fault diagnosis model of the internet of things based on the feedforward neural network. As shown in fig. 1, the method comprises the steps of:
s110: the method comprises the steps of collecting historical internet of things fault feature sample data and corresponding fault category data, preprocessing the sample set to obtain a sample set, and dividing the sample set into a training sample set and a testing sample set, wherein the sample set comprises the internet of things fault sample feature data and corresponding fault category labels.
The internet of things fault sample characteristic data comprises multidimensional fault representation data, and the fault category labels comprise card faults, terminal faults, wireless faults, transmission faults, core network faults and client side faults. And associating the fault category label with the historical internet of things fault sample characteristic data to form a multi-dimensional matrix type sample.
In this embodiment, the internet of things fault is divided into 6 fault categories, namely, card, terminal, wireless, transmission, core network and client side, large-scale 37-dimensional fault characteristic data is collected, and the dimension information is shown in table 1. According to the correlation, the 37-dimensional fault data are associated with 6 fault categories, correlation values are respectively defined as 1 (correlated), 0.5 (unknown) and 0 (irrelevant) according to the correlation with the fault categories, and a 37-dimensional fault feature matrix is formed and serves 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 the attribute of the sample. And taking the constructed sample data as the input of the feedforward neural network.
Figure BDA0002450930680000071
TABLE 1
In order to reduce the overfitting phenomenon, the collected samples are preprocessed. 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 weak classification samples, the training data is transformed to enhance the data set, so that the sample set with stronger generalization capability is obtained. Specifically, when multi-dimensional fault feature data is classified, because the number of each sample in the training set is unbalanced, the generalization of model training on the test set is not good. Because the actual training samples come from actual complaints and failure handling, there are very many samples of one class or classes, and relatively few samples of other classes. In order to improve Accuracy (Accuracy), data layer processing is performed, distribution of each fault type is modified, data enhancement is performed on samples corresponding to each fault type in a sample set, and the samples of each fault type are kept in the same order of magnitude.
Performing data enhancement on samples corresponding to fault categories in the sample set so as to keep the number of the samples corresponding to each fault category at the same order of magnitude, wherein the specific process is as follows:
and if the number of the samples of the first fault category is larger than the average number of the samples, randomly deleting the number of the samples corresponding to the first fault category. 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.
And if the number of the samples of the second fault category is smaller than the average number of the samples, increasing the number of the samples of the second fault category by using a preset data transformation rule. In this embodiment, if the number of samples of the second failure category is less than 1 and half of the average number of samples, the number of samples of the second failure category is increased by 40% by using a preset data transformation rule.
The preset data transformation rule is as follows: keeping the sample data with strong correlation with the second fault category unchanged, randomly generating other numerical values according to the sample data with the second fault category correlation according to a preset probability, and completely randomly generating the sample data with weak correlation with the second fault category to form new sample data. In this embodiment, the predetermined probability is 50%.
After the sample set is formed, the sample set is divided into a training sample set and a testing sample set. In this embodiment, the sample set may be divided into 80% training sample set and 20% testing sample set.
S120: and inputting the training sample set into a preset feedforward neural network for pre-training to obtain the trained feedforward neural network.
In this embodiment, the preset feedforward neural network includes an input layer, 2 hidden layers, and an output layer, and each hidden layer includes 256 neurons.
And training the preset input layer, the preset layer hiding layer and the preset output layer of the neural network layer by layer through a supervised training method to obtain the trained neural network. Specifically, the connection weight of each fault category is updated by inputting samples one by one, initial weights (generally random) are set, sample data are input one by one, if the output sample category is the same as the label of the real fault category, the next sample is continuously input, if the output sample category is not the same as the label of the real fault category, the connection weight is updated, then the connection weight is checked one by one again until the output fault category of each sample data is the same as the label of the real fault category, and therefore the connection weight corresponding to each fault category is finally determined.
Here, the feedforward neural network outputs a 6-dimensional matrix, each dimension representing the probability of which fault class it belongs to. If a sample inputs a prediction error, the output 6-dimensional matrix is [0.1, 0, 0.2, 0, 0.1, 0.6], which indicates that the probability that the fault type is a card fault is 0.1, the probability that the fault type is a terminal is 0, the probability that the fault type is a wireless is 0.2, the probability that the fault type is a transmission is 0, the probability that the fault type is a core network is 0.1, and the probability that the fault type is a client side is 0.6. The probability of the client side is the maximum, so the fault type is judged to be 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 sample according to the connection weight of each class.
Specifically, for the jth fault category, the connection weight matrix is wjAdopting a multi-classification softmax activation function to calculate a probability matrix sigma (Z) obtained by inputting training samples corresponding to the jth fault category into the trained neural networkjThe output is a set of fault data 6-dimensional probability matrix as shown in equation 1. w is ajIs a matrix of 0 in each case. Equation 2 is the weight value for the jth class of failure.
Figure BDA0002450930680000091
Zj=xTwj (2)
Wherein the fault classification number k is 6, wjTraining a connection weight matrix for the j-th fault category for the trained feedforward neural network; zjIs the weight value of the jth fault category; sigma (Z)jAs a class j faultAnd (4) a probability matrix of the category, wherein x is input 37-dimensional fault feature sample data. Obtaining the probability that the output fault class belongs to the jth class after the jth class of training samples are input into the trained feedforward neural network according to the formula 3j
tj=σ(Z)j (3)
Then, according to the probability t of the j-th classjAnd calculating the prediction error of the trained feedforward neural network for the j-th fault category. And as shown in formula 4, according to the cross entropy error loss function, the prediction error of the trained feedforward neural network for the j fault category and the prediction error of the actual fault category are obtained by using the distance of the probability distribution. The actual failure category is a failure category label.
E=-∑j∈DOj ln tj (4)
D is a set of 6 major classes of Internet of things fault classes, and if the actual fault class is the same as the prediction result of the trained feedforward neural network on the jth class, O is carried outj1, otherwise Oj=0;tjThe predicted result of the fault category of j (t is more than or equal to 0)jLess than or equal to 1). Only if j is the actual barrier class, OjIs 1, so equation 4 can be simplified to equation 5, and t is greater than or equal to 0j1, so the abscissa 0 to 1 is the valid segment, and as can be seen from FIG. 2, the prediction error E is larger when the calculation probability of the actual class is smaller.
E=-ln tj (5)
And according to the formula, calculating the prediction error of each fault category in the trained feedforward neural network.
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 category is completed, the current accuracy of the trained feedforward neural network for predicting each fault category can be calculated according to all the prediction errors. And when the current accuracy is greater than a preset accuracy threshold, performing subsequent verification and correction steps by taking the trained feedforward neural network as an initial Internet of things fault diagnosis model. The accuracy threshold can be set according to a specific scene, and if the accuracy threshold is set to be 95%, when the current accuracy is greater than 95%, the subsequent verification and correction steps can be performed.
S150: and 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 an 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 the connection weights are gradually optimized to obtain a more accurate feedforward neural network-based pre-diagnosis model. Specifically, a small batch of fixed-size samples are used for calculation each time, for n samples, m samples are randomly used each time, gradient optimization and testing are performed on the connection weight, and meanwhile, the connection weight of each fault category is updated, and the algorithm flow is as follows:
setting batch _ size to be 50 samples, and setting the number m of samples to be 10000;
initializing each connection weight gradient DeltawiThe random number is a random number with a small absolute value;
for each < X, t > of the small batch of samples, a calculation is made until a correct rate threshold is reached.
The sequence of the training samples is disturbed, and a new round of the optimization calculation is started.
In the gradient optimization process, the convergence rate and stability can be compromised to avoid missing the optimal solution.
S160: and if the current accuracy reaches a preset accuracy threshold, taking the trained feedforward neural network as an initial Internet of things fault diagnosis model.
S170: and if the current accuracy reaches a preset accuracy threshold, 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 using a gradient descent method until the optimized accuracy rate reaches the accuracy rate threshold so as to obtain an initial fault diagnosis model of the internet of things.
And verifying the accuracy of the initial internet of things fault diagnosis model through the test sample set, if the verification set does not conform to the fault pre-diagnosis model, re-entering an optimization stage, executing the steps same as the steps 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 internet of things fault diagnosis model based on the feedforward neural network, the internet of things fault pre-diagnosis model based on the feedforward neural network is trained and established through deep learning of the known full internet of things fault information, 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 the feedforward neural network, and the accuracy of the output of the fault pre-diagnosis model is ensured and the accuracy of the 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. 3 is a flowchart illustrating an embodiment of the fault diagnosis method for the internet of things based on the feedforward neural network, which is performed by the fault diagnosis device for the internet of things based on the feedforward neural network. As shown in fig. 3, the method comprises the steps of:
s210: and inputting 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 by training through 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 representing fault features.
The input of the target internet of things fault diagnosis model is a 37-dimensional fault characteristic matrix, and the output is a 6-class fault category probability matrix. The fault diagnosis model of the internet of things is obtained through training by the training method of the fault diagnosis model of the internet of things based on the feedforward neural network, the training method is the same as that of the embodiment, and details are not repeated here.
S220: and carrying out fault diagnosis on the data of the Internet of things to be diagnosed through a target Internet of things fault diagnosis model, and outputting a target fault category probability matrix.
The target internet of things fault diagnosis model carries out fault diagnosis on the internet of things data to be diagnosed as follows: and calculating the 37-dimensional fault feature matrix according to the connection weight value of the target fault feature matrix to obtain a target fault category probability matrix corresponding to the data of the Internet of things to be diagnosed. In this embodiment, the target fault category probability matrix represents the probability of the corresponding 6 types of fault categories, and is represented in a form of a 6-dimensional matrix. If the output 6-dimensional matrix is [0.1, 0, 0.2, 0, 0.1, 0.6], it indicates that the probability that the failure type is a card failure is 0.1, the probability that the failure type is a terminal is 0, the probability that the failure type is a radio is 0.2, the probability that the failure type is a transmission is 0, the probability that the failure type is a core network is 0.1, and the probability that the failure type is a client side is 0.6.
S230: and obtaining the target fault category according to the target fault category probability matrix.
And in the target fault category probability matrix, one fault category with the highest probability is a target fault category. For example, when the 6-dimensional matrix of the above output is [0.1, 0, 0.2, 0, 0.1, 0.6], the probability of 0.6 on the client side is the maximum, and thus the failure type is determined to be a client-side failure.
The internet of things fault diagnosis method based on the feedforward neural network trains and establishes an internet of things fault pre-diagnosis model based on the feedforward neural network through deep learning by utilizing known full internet of things fault information, outputs an internet of things fault probability matrix, completes delimitation, and is more efficient and intelligent.
Furthermore, the embodiment of the invention is based on the feedforward neural network, and for the training of the model, the accuracy of the output of the fault pre-diagnosis model is ensured and the accuracy of the fault diagnosis is improved through complete closed-loop training processes such as cross entropy error judgment, small-batch gradient optimization algorithm, multi-class 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 internet of things fault diagnosis model based on the feedforward neural network. As shown in fig. 4, the apparatus 300 includes: a sample processing module 310, a model pre-training module 320, a prediction error module 330, an accuracy determination module 340, an optimization module 350, and a test modification module 360.
The sample processing module 310 is configured to collect historical internet of things fault feature sample data and corresponding fault category 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 testing sample set, where the sample set includes internet of things fault feature data and corresponding fault category labels.
And the model pre-training module 320 is configured to input the training sample set into a preset feed-forward neural network for training, so as to obtain a trained neural network.
A prediction error calculation module 330 for calculating a prediction error of the prediction error.
And the accuracy determining module 340 is configured to calculate a current accuracy of the trained feedforward neural network according to the prediction error.
The optimization 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 value until the optimized accuracy rate reaches the accuracy rate threshold value, to obtain an optimized feedforward neural network as an initial internet of things fault diagnosis model, and is further configured to 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 value;
and the test correction module 360 is used for 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.
The specific working process of each module is as follows:
the sample processing module 310 acquires historical internet of things fault feature sample data and corresponding fault category data, preprocesses the historical internet of things fault feature sample data to obtain a sample set, and divides the sample set into a training sample set and a testing sample set, wherein the sample set comprises the internet of things fault sample feature data and corresponding fault category labels.
The internet of things fault sample characteristic data comprises multidimensional fault representation data, and the fault category labels comprise card faults, terminal faults, wireless faults, transmission faults, core network faults and client side faults. And associating the fault category label with the historical internet of things fault sample characteristic data to form a multi-dimensional matrix type sample.
In this embodiment, the internet of things fault is divided into 6 fault categories, namely, card, terminal, wireless, transmission, core network and client side, and large-scale 37-dimensional fault characteristic data is collected. According to the correlation, the 37-dimensional fault data are associated with 6 fault categories, correlation values are respectively defined as 1 (correlation), 0.5 (unknown) and 0 (irrelevant), and a 37-dimensional fault feature matrix is formed and 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 the attribute 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 collected samples are preprocessed. 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 weak classification samples, the training data is transformed to enhance the data set, so that the sample set with stronger generalization capability is obtained. Specifically, when multi-dimensional fault feature data is classified, because the number of each sample in the training set is unbalanced, the generalization of model training on the test set is not good. Because the actual training samples come from actual complaints and failure handling, there are very many samples of one class or classes, and relatively few samples of other classes. In order to improve Accuracy (Accuracy), data layer processing is performed, distribution of each fault type is modified, data enhancement is performed on samples corresponding to each fault type in a sample set, and the samples of each fault type are kept in the same order of magnitude.
Performing data enhancement on samples corresponding to fault categories in the sample set so as to keep the number of the samples corresponding to each fault category at the same order of magnitude, wherein the specific process is as follows:
and if the number of the samples of the first fault category is larger than the average number of the samples, randomly deleting the number of the samples corresponding to the first fault category. 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.
And if the number of the samples of the second fault category is smaller than the average number of the samples, increasing the number of the samples of the second fault category by using a preset data transformation rule. In this embodiment, if the number of samples of the second failure category is less than 1 and half of the average number of samples, the number of samples of the second failure category is increased by 40% by using a preset data transformation rule.
The preset data transformation rule is as follows: keeping the sample data with strong correlation with the second fault category unchanged, randomly generating other numerical values according to the sample data with the second fault category correlation according to a preset probability, and completely randomly generating the sample data with weak correlation with the second fault category to form new sample data. In this embodiment, the predetermined probability is 50%.
After the sample set is formed, the sample set is divided into a training sample set and a testing sample set. In this embodiment, the sample set may be divided into 80% training sample set and 20% testing sample set.
The model pre-training module 320 inputs the training sample set into a preset feedforward neural network for training, so as to obtain a trained neural network.
In this embodiment, the preset feedforward neural network includes an input layer, 2 hidden layers, and an output layer, and each hidden layer includes 256 neurons.
And training the preset input layer, the preset layer hiding layer and the preset output layer of the neural network layer by layer through a supervised training method to obtain the trained neural network. Specifically, the connection weight of each fault category is updated by inputting samples one by one, initial weights (generally random) are set, sample data are input one by one, if the output sample category is the same as the label of the real fault category, the next sample is continuously input, if the output sample category is not the same as the label of the real fault category, the connection weight is updated, then the connection weight is checked one by one again until the output fault category of each sample data is the same as the label of the real fault category, and therefore the connection weight corresponding to each fault category is finally determined.
Here, the feedforward neural network outputs a 6-dimensional matrix, each dimension representing the probability of which fault class it belongs to. If a sample inputs a prediction error, the output 6-dimensional matrix is [0.1, 0, 0.2, 0, 0.1, 0.6], which indicates that the probability that the fault type is a card fault is 0.1, the probability that the fault type is a terminal is 0, the probability that the fault type is a wireless is 0.2, the probability that the fault type is a transmission is 0, the probability that the fault type is a core network is 0.1, and the probability that the fault type is a client side is 0.6. The probability of the client side is the maximum, so the fault type is judged to be 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 sample according to the connection weight of each class.
Specifically, for the jth fault category, a training sample corresponding to the jth fault category is obtained and input into the trained feedforward neural network, and the connection weight matrix of the jth fault category is wjAdopting a multi-classification softmax activation function to calculate a probability matrix sigma (Z) obtained after a training sample corresponding to the jth fault class is input into a trained feedforward neural networkjThe output is a set of fault data 6-dimensional probability matrix as shown in equation 1. w is ajIs a matrix of 0 in each case. Equation 2 is the weight value of the preceding layer of neurons corresponding to the jth class of failure.
Figure BDA0002450930680000151
Zj=xTwj (2)
Wherein, the number k of fault categories is 6, wjConnections trained for class j fault classes for trained feedforward neural networksReceiving a weight matrix; zjIs the weight value of the jth fault category of the neuron in the previous layer; sigma (Z)jAnd x is input 37-dimensional fault feature sample data, and is a probability matrix of the j-th fault category. Obtaining the probability t of the fault class j after the training sample of the j class is input into the trained feedforward neural network according to the formula 3j
tj=σ(Z)j (3)
Then, according to the probability t of the j-th classjAnd calculating the prediction error of the trained feedforward neural network for the j-th fault category. And as shown in formula 4, according to the cross entropy error loss function, the prediction error of the trained feedforward neural network for the j fault category and the prediction error of the actual fault category are obtained by using the distance of the probability distribution. The actual failure category is a failure category label.
E=-∑j∈DOj ln tj (4)
D is a set of 6 internet of things fault categories, and if the actual fault category is the same as the prediction result of the trained feedforward neural network on the jth category, O is carried outj1, otherwise Oj=0;tjThe predicted result of the fault category of j (t is more than or equal to 0)jLess than or equal to 1). Only if j is the actual barrier class, OjIs 1, so equation 4 can be simplified to equation 5, and t is greater than or equal to 0j1, so the abscissa 0 to 1 is the valid segment, and as can be seen from FIG. 2, the prediction error E is larger when the calculation probability of the actual class is smaller.
E=-ln tj (5)
And according to the formula, calculating the prediction error of each fault category in the trained feedforward neural network.
The accuracy determination module 340 determines the current accuracy of the trained feedforward neural network based on the prediction error. Specifically, after the prediction error of each fault category is calculated, the current accuracy of the trained feedforward neural network prediction is calculated according to all the prediction errors. And when the current accuracy is greater than a preset accuracy threshold, performing subsequent verification and correction steps by taking the trained feedforward neural network as an initial Internet of things fault diagnosis model. The accuracy threshold can be set according to a specific scene, and if the accuracy threshold is set to be 95%, when the current accuracy is greater than 95%, the subsequent verification and correction steps can be performed.
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 until the current accuracy rate reaches the accuracy rate threshold value to obtain an initial internet of things fault diagnosis model, and is also used for 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 verifies and corrects 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, the trained feedforward neural network is optimized by adopting a gradient descent method until the optimized accuracy rate reaches the accuracy rate threshold, so that the optimized feedforward neural network is obtained and used 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 conform to the fault pre-diagnosis model, re-entering the optimization stage, and re-performing optimization calculation by the error calculation module 330, the accuracy determination module 340 and the optimization module 350, and re-adjusting the connection weight of the neural network to finally obtain the target internet of things fault diagnosis model.
The training device of the internet of things fault diagnosis model based on the feedforward neural network trains the internet of things fault pre-diagnosis model based on the feedforward neural network through deep learning by utilizing the known full internet of things fault information, outputs the internet of things fault probability matrix, completes delimitation, and is more efficient and intelligent.
Furthermore, the embodiment of the invention is based on the feedforward neural network, and for the training of the model, the accuracy of the output of the fault pre-diagnosis model is ensured and the accuracy of the fault diagnosis is improved through complete closed-loop training processes such as cross entropy error judgment, small-batch gradient optimization algorithm, multi-class softmax activation function, test set verification and the like.
Fig. 5 shows a schematic structural diagram of an embodiment of the internet of things fault diagnosis device 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 into a target internet of things fault diagnosis model, where the target internet of things fault diagnosis model is obtained by training through the training method of the internet of things fault diagnosis model based on the feedforward neural network in the embodiment. Specifically, the fault data of the internet of things to be diagnosed is a 37-dimensional fault feature matrix representing fault features.
The input of the target internet of things fault diagnosis model is a 37-dimensional fault characteristic matrix, and the output is a 6-class fault category probability matrix. The fault diagnosis model of the internet of things is obtained through training by the training method of the fault diagnosis model of the internet of things based on the feedforward neural network, the training method is the same as that of the embodiment, and details are not repeated here.
And 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 category probability matrix.
The target internet of things fault diagnosis model carries out fault diagnosis on the internet of things data to be diagnosed as follows: and calculating the 37-dimensional fault feature matrix according to the connection weight value of the target fault feature matrix to obtain a target fault category probability matrix corresponding to the data of the Internet of things to be diagnosed. In this embodiment, the target fault category probability matrix represents the probability of the corresponding 6 types of fault categories, and is represented in a form of a 6-dimensional matrix. If the output 6-dimensional matrix is [0.1, 0, 0.2, 0, 0.1, 0.6], it indicates that the probability that the failure type is a card failure is 0.1, the probability that the failure type is a terminal is 0, the probability that the failure type is a radio is 0.2, the probability that the failure type is a transmission is 0, the probability that the failure type is a core network is 0.1, and the probability that the failure type is a client side is 0.6.
And the output module 430 is configured to obtain a target fault category according to the target fault category probability matrix.
And in the target fault category probability matrix, one fault category with the highest probability is a target fault category. For example, when the 6-dimensional matrix of the above output is [0.1, 0, 0.2, 0, 0.1, 0.6], the probability of 0.6 on the client side is the maximum, and thus the failure type is determined to be a client-side failure.
The internet of things fault diagnosis device based on the feedforward neural network trains and establishes an internet of things fault pre-diagnosis model based on the feedforward neural network through deep learning by utilizing known full internet of things fault information, outputs an internet of things fault probability matrix, completes delimitation, and is more efficient and intelligent.
Furthermore, the embodiment of the invention is based on the feedforward neural network, and for the training of the model, the accuracy of the output of the fault pre-diagnosis model is ensured and the accuracy of the fault diagnosis is improved through complete closed-loop training processes such as cross entropy error judgment, small-batch gradient optimization algorithm, multi-class softmax activation function, test set verification and the like.
Fig. 6 is a schematic structural diagram of an embodiment of the electronic device according to the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the electronic device.
As shown in fig. 6, the electronic device may include: a processor (processor)502, a Communications Interface 504, a memory 506, and a communication bus 508.
Wherein: the processor 502, communication interface 504, and memory 506 communicate with one another via a communication bus 508. A communication interface 504 for communicating with network elements of other devices, such as clients or other application servers. The processor 502 is configured to execute the program 510, and may specifically execute the above-described training method for the fault diagnosis model of the internet of things based on the feedforward neural network and/or related steps in the embodiment of the fault diagnosis method of the internet of things based on the feedforward neural network.
In particular, program 510 may include program code comprising computer-executable instructions.
The processor 502 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement an embodiment of the present invention. The one or more processors of the diagnosis device of the internet of things can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 506 for storing a program 510. The memory 506 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
Specifically, the program 510 may be invoked by the processor 502 to cause the electronic device to perform the following operations:
acquiring historical internet of things fault feature sample data and corresponding fault category data, preprocessing the sample set to obtain a sample set, and dividing the sample set into a training sample set and a testing sample set, wherein the sample set comprises the internet of things fault sample feature data and corresponding fault category labels;
inputting the training sample set into a preset feedforward neural network for pre-training to obtain a trained feedforward neural network;
calculating the 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 value, optimizing the trained feedforward neural network by adopting a gradient descent method until the optimized accuracy rate reaches the accuracy rate threshold value, and obtaining the optimized feedforward neural network as an initial Internet of things fault diagnosis model;
if the current accuracy reaches a preset accuracy threshold, taking the trained feedforward neural network as an initial Internet of things fault diagnosis model;
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; and/or
Inputting 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 by training through a 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 category probability matrix;
and obtaining the target fault category according to the target fault category probability matrix.
In an optional mode, historical internet of things fault feature sample data and corresponding fault category data are collected, a sample set is obtained through preprocessing, the sample set comprises internet of things fault sample feature data and corresponding fault category labels, and the method further comprises the following steps:
and performing data enhancement on samples corresponding to the fault categories in the sample set so as to keep the number of the samples corresponding to each fault category at the same order of magnitude:
if the number of samples of the first fault category is larger than the average number of samples, randomly deleting the number of samples corresponding to the first fault category;
if the number of samples of the second fault category is smaller than the average number of samples, increasing the number of samples of the second fault category by using a preset data transformation rule;
the preset data transformation rule is as follows: keeping the sample data with strong correlation with the second fault category unchanged, randomly generating other numerical values according to the sample data with the second fault category correlation according to a preset probability, and completely randomly generating the sample data with weak correlation with the second fault category to form new sample data.
In an optional manner, inputting the training sample set into a preset feedforward neural network for training, so as to obtain a prediction error, further including:
the preset feedforward neural network comprises an input layer, 2 hidden layers 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 the trained neural network.
In an alternative, calculating the prediction error of the trained feedforward neural network further includes:
acquiring a connection weight corresponding to each fault category in the trained feedforward neural network;
calculating a fault category probability matrix corresponding to each training sample by adopting a multi-classification softmax activation function in combination with the connection weight;
and calculating the prediction error of the predicted fault category and the actual fault category corresponding to each training sample according to a cross entropy error loss function by combining the fault category probability matrix.
In an alternative approach, the prediction error of the trained feedforward neural network is calculated by the following formula:
calculating the probability matrix sigma (Z) of the output after the training sample corresponding to the fault category is input into the trained feedforward neural networkjAnd j represents the fault category:
Figure BDA0002450930680000201
Zj=xTwj
according to the probability matrix sigma (Z)jGet probability of failure class jj
tj=σ(Z)j
Probability t according to fault class jjCalculating the prediction error E of the trained feedforward neural network to the fault class j:
E=-ln tj
wherein, the number k of fault categories is 6, wjTraining a connection weight matrix for the j-th fault category for the trained feedforward neural network; zjThe weighted value of the corresponding j-th fault category of the neuron in the previous layer; sigma (Z)jInputting training samples of j-th fault category into a probability matrix output after the trained feedforward neural network, wherein x is an input 37-dimensional fault characteristicSample data is verified; t is tjRepresenting the probability that the output fault category belongs to the jth category; and E represents a prediction error.
The electronic equipment of this embodiment trains through the deep learning that utilizes known total thing networking fault information and establishes the thing networking fault pre-diagnosis model based on feedforward neural network, outputs thing networking fault probability matrix, accomplishes the demarcation, and is more high-efficient, intelligent.
Furthermore, the embodiment of the invention is based on the feedforward neural network, and for the training of the model, the accuracy of the output of the fault pre-diagnosis model is ensured and the accuracy of the fault diagnosis is improved through complete closed-loop training processes such as cross entropy error judgment, small-batch gradient optimization algorithm, multi-class softmax activation function, test set verification and the like.
The embodiment of the invention provides a computer-readable storage medium, wherein at least one executable instruction is stored in the storage medium, and when the executable instruction runs on an internet of things diagnosis device/apparatus, the internet of things diagnosis device/apparatus executes a training method of an internet of things fault diagnosis model based on a feed-forward 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 perform the following operations:
acquiring historical internet of things fault feature sample data and corresponding fault category data, preprocessing the sample set to obtain a sample set, and dividing the sample set into a training sample set and a testing sample set, wherein the sample set comprises the internet of things fault sample feature data and corresponding fault category labels;
inputting the training sample set into a preset feedforward neural network for pre-training to obtain a trained feedforward neural network;
calculating the 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 value, optimizing the trained feedforward neural network by adopting a gradient descent method until the optimized accuracy rate reaches the accuracy rate threshold value, and obtaining the optimized feedforward neural network as an initial Internet of things fault diagnosis model;
if the current accuracy reaches a preset accuracy threshold, taking the trained feedforward neural network as an initial Internet of things fault diagnosis model;
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; and/or
Inputting 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 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 category probability matrix;
and obtaining the target fault category according to the target fault category probability matrix.
In an optional mode, historical internet of things fault feature sample data and corresponding fault category data are collected, a sample set is obtained through preprocessing, the sample set comprises internet of things fault sample feature data and corresponding fault category labels, and the method further comprises the following steps:
and performing data enhancement on samples corresponding to the fault categories in the sample set so as to keep the number of the samples corresponding to each fault category at the same order of magnitude:
if the number of samples of the first fault category is larger than the average number of samples, randomly deleting the number of samples corresponding to the first fault category;
if the number of samples of the second fault category is smaller than the average number of samples, increasing the number of samples of the second fault category by using a preset data transformation rule;
the preset data transformation rule is as follows: keeping the sample data with strong correlation with the second fault category unchanged, randomly generating other numerical values according to the sample data with the second fault category correlation according to a preset probability, and completely randomly generating the sample data with weak correlation with the second fault category to form new sample data.
In an optional manner, inputting the training sample set into a preset feedforward neural network for training, so as to obtain a prediction error, further including:
the preset feedforward neural network comprises an input layer, 2 hidden layers 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 the trained neural network.
In an alternative, calculating the prediction error of the trained feedforward neural network further includes:
acquiring a connection weight corresponding to each fault category in the trained feedforward neural network;
calculating a fault category probability matrix corresponding to each training sample by adopting a multi-classification softmax activation function in combination with the connection weight;
and calculating the prediction error of the predicted fault category and the actual fault category corresponding to each training sample according to a cross entropy error loss function by combining the fault category probability matrix.
In an alternative approach, the prediction error of the trained feedforward neural network is calculated by the following formula:
calculating the probability matrix sigma (Z) of the output after the training sample corresponding to the fault category is input into the trained feedforward neural networkjAnd j represents the fault category:
Figure BDA0002450930680000231
Zj=xTwj
according to the probability matrix sigma (Z)jObtaining the probability t of the fault category jj
tj=σ(Z)j
According to the probability t of the fault category jjCalculating the prediction error E of the trained feedforward neural network to the fault class j:
E=-ln tj
wherein, the number k of fault categories is 6, wjTraining a connection weight matrix for the j-th fault category for the trained feedforward neural network; zjThe weighted value of the corresponding j-th fault category of the neuron in the previous layer; sigma (Z)jInputting a training sample of the jth fault category into a trained probability matrix output after the feedforward neural network is trained, wherein x is input 37-dimensional fault feature sample data; t is tjRepresenting the probability that the output fault category belongs to the jth category; and E represents a prediction error.
According to the method, the internet of things fault pre-diagnosis model based on the feedforward neural network is trained and established through deep learning by utilizing known full internet of things fault information, 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 the feedforward neural network, and for the training of the model, the accuracy of the output of the fault pre-diagnosis model is ensured and the accuracy of the fault diagnosis is improved through complete closed-loop training processes such as cross entropy error judgment, small-batch gradient optimization algorithm, multi-class 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.
Embodiments of the present invention provide a computer program, which can be invoked by a processor to enable the electronic device to execute a training method of a fault diagnosis model of an internet of things based on a feedforward neural network and/or a fault diagnosis method of an internet of things based on a feedforward neural network in any method embodiment described above.
Embodiments of the present invention provide a computer program product, including a computer program stored on a computer-readable storage medium, where the computer program includes program instructions that, when executed on a computer, cause the computer to perform a method for training a fault diagnosis model of an internet of things based on a feedforward neural network and/or a method for fault diagnosis of an internet of things based on a feedforward neural network in any of the above-mentioned 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 constructing such a system will be apparent from the description above. In addition, embodiments of the present invention are not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, 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 foregoing 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 invention and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed 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 device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. 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. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements 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 included in other embodiments, rather than other features, 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 may 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 usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names. The steps in the above embodiments should not be construed as limiting the order of execution unless specified otherwise.

Claims (10)

1. A training method of an Internet of things fault diagnosis model based on a feedforward neural network is characterized by comprising the following steps:
acquiring historical internet of things fault feature sample data and corresponding fault category data, preprocessing the sample set to obtain a sample set, and dividing the sample set into a training sample set and a testing sample set, wherein the sample set comprises the internet of things fault sample feature data and corresponding fault category labels;
inputting the training sample set into a preset feedforward neural network for pre-training to obtain a trained feedforward neural network;
calculating the 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 value, optimizing the trained feedforward neural network by adopting a gradient descent method until the optimized accuracy rate reaches the accuracy rate threshold value, and obtaining the optimized feedforward neural network as an initial Internet of things fault diagnosis model;
if the current accuracy reaches a preset accuracy threshold, taking 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 historical internet of things fault feature sample data and corresponding fault category data are collected, and a sample set is obtained through preprocessing and comprises internet of things fault sample feature data and corresponding fault category labels, and further comprising:
and performing data enhancement on samples corresponding to the fault categories in the sample set so as to keep the number of the samples corresponding to each fault category at the same order of magnitude:
if the number of samples of the first fault category is larger than the average number of samples, randomly deleting the number of samples corresponding to the first fault category;
if the number of samples of the second fault category is smaller than the average number of samples, increasing the number of samples of the second fault category by using a preset data transformation rule;
the preset data transformation rule is as follows: keeping the sample data with strong correlation with the second fault category unchanged, randomly generating other numerical values according to the sample data with the second fault category correlation according to a preset probability, and completely randomly generating the sample data with weak correlation with the second fault category to form new sample data.
3. The method of claim 1, wherein the training sample set is input to a preset feedforward neural network for training, and the prediction error is obtained, further comprising:
the preset feedforward neural network comprises an input layer, 2 hidden layers 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 the trained neural network.
4. The method of claim 1, wherein calculating the prediction error of the trained feedforward neural network further comprises:
acquiring a connection weight corresponding to each fault category in the trained feedforward neural network;
calculating a fault category probability matrix corresponding to each training sample by adopting a multi-classification softmax activation function in combination with the connection weight;
and calculating the prediction error of the predicted fault category and the actual fault category corresponding to each training sample according to a cross entropy error loss function by combining the fault category probability matrix.
5. The method of claim 4, wherein the prediction error of the trained feedforward neural network is calculated by the following equation:
calculating the probability matrix sigma (Z) of the output after the training sample corresponding to the fault category is input into the trained feedforward neural networkjAnd j represents a fault category:
Figure FDA0002450930670000021
Zj=xTwj
according to the probability matrix sigma (Z)jGet the probability t of the fault class jj
tj=σ(Z)j
According to the probability t of the fault category jjCalculating the prediction error E of the trained feedforward neural network to the fault class j:
E=-ln tj
wherein, the number k of fault categories is 6, wjTraining a connection weight matrix for the j-th fault category for the trained feedforward neural network; zjThe weighted value of the corresponding j-th fault category of the neuron in the previous layer; sigma (Z)jInputting a training sample of the jth fault category into a trained probability matrix output after the feedforward neural network is trained, wherein x is input 37-dimensional fault feature sample data; t is tjRepresenting the probability that the output fault category belongs to the jth category; and E represents a prediction error.
6. A fault diagnosis method for the Internet of things based on a feedforward neural network is characterized by comprising the following steps:
inputting 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 by training through the training method of the internet of things fault diagnosis model based on the feedforward neural network according to any one of claims 1 to 5;
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 category probability matrix;
and obtaining the target fault category according to the target fault category probability matrix.
7. A training device of an Internet of things fault diagnosis model based on a feedforward neural network is characterized by comprising:
the system comprises a sample processing module, a fault classification module and a fault classification module, wherein the sample processing module is used for acquiring historical internet of things fault characteristic sample data and corresponding fault classification data, preprocessing the sample set to obtain a sample set, and dividing the sample set into a training sample set and a testing sample set, wherein the sample set comprises the internet of things fault characteristic sample data and a corresponding fault classification label;
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 for calculating a prediction error of the 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 if the current accuracy does not reach the accuracy threshold value, so as to obtain an optimized feedforward neural network as an initial internet of things fault diagnosis model, and is also used for taking the trained feedforward neural network as the initial internet of things fault diagnosis model if 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.
8. An internet of things fault diagnosis device based on a feedforward neural network, characterized in that the device comprises:
the input module is used for inputting 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 by training through the training method of the Internet of things fault diagnosis model based on the feedforward neural network according to any one of claims 1 to 5;
the fault diagnosis module is used for carrying out fault diagnosis on the data of the Internet of things to be diagnosed through the target Internet of things fault diagnosis model and outputting a target fault category probability matrix;
and the output module is used for obtaining the target fault category according to the target fault category probability matrix.
9. An electronic device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication 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 of claims 1-6.
10. A computer-readable storage medium, having stored thereon at least one executable instruction, which when executed by a processor, performs the steps of the method of any one of claims 1-6.
CN202010292445.7A 2020-04-14 2020-04-14 Internet of things fault diagnosis method, model training method and related devices Active CN113541985B (en)

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 true CN113541985A (en) 2021-10-22
CN113541985B 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116107796A (en) * 2023-04-17 2023-05-12 四川观想科技股份有限公司 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

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106769048A (en) * 2017-01-17 2017-05-31 苏州大学 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
CN109902741A (en) * 2019-02-28 2019-06-18 上海理工大学 A kind of breakdown of refrigeration system diagnostic method
CN109918752A (en) * 2019-02-26 2019-06-21 华南理工大学 Mechanical failure diagnostic method, equipment and medium based on migration convolutional neural networks
CN110081966A (en) * 2019-05-27 2019-08-02 苏州工业职业技术学院 The fault diagnosis system and method for fan vibration sensor

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106769048A (en) * 2017-01-17 2017-05-31 苏州大学 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
CN109918752A (en) * 2019-02-26 2019-06-21 华南理工大学 Mechanical failure diagnostic method, equipment and medium based on migration convolutional neural networks
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

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116107796A (en) * 2023-04-17 2023-05-12 四川观想科技股份有限公司 Internet of things data management system and method
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

Also Published As

Publication number Publication date
CN113541985B (en) 2023-07-14

Similar Documents

Publication Publication Date Title
CN110473083B (en) Tree risk account identification method, device, server and storage medium
CN113541985B (en) Internet of things fault diagnosis method, model training method and related devices
CN110135505B (en) Image classification method and device, computer equipment and computer readable storage medium
CN113228062B (en) Deep integration model training method based on feature diversity learning
US20230092453A1 (en) Parameter updating method and apparatus and storage medium
CN114048468A (en) Intrusion detection method, intrusion detection model training method, device and medium
CN115563610B (en) Training method, recognition method and device for intrusion detection model
CN113610747B (en) System and method for inspecting semiconductor samples
US20240135698A1 (en) Image classification method, model training method, device, storage medium, and computer program
CN112364974B (en) YOLOv3 algorithm based on activation function improvement
CN109101984B (en) Image identification method and device based on convolutional neural network
CN113011893B (en) Data processing method, device, computer equipment and storage medium
CN112203311B (en) Network element abnormity diagnosis method, device, equipment and computer 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
US12066910B2 (en) Reinforcement learning based group testing
CN115713669A (en) Image classification method and device based on inter-class relation, storage medium and terminal
CN115174421A (en) Network fault prediction method and device based on self-supervision unwrapping hypergraph attention
CN116975742A (en) Partial discharge pattern recognition method, apparatus, device, and storage medium
CN115410250A (en) Array type human face beauty prediction method, equipment and storage medium
CN114357219A (en) Mobile-end-oriented instance-level image retrieval method and device
CN109492046A (en) The failure judgment method and device and computer readable storage medium of integrated model
CN117745423B (en) Abnormal account identification method
US20240152805A1 (en) Systems, methods, and non-transitory computer-readable storage devices for training deep learning and neural network models using overfitting detection and prevention
CN112598118B (en) Method, device, storage medium and equipment for processing abnormal labeling in supervised learning

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