Disclosure of Invention
In view of this, the embodiment of the present invention provides an electric device detection, which enables a process of determining the electric device detection to be visible, and the extracted detection process of the present invention can explain and further improve the characterization learning capability, thereby overcoming the technical defects that the characterization learning cannot be explained and the accuracy is poor only by using a neural network in the electric device detection in the prior art.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of electric device detection, including:
acquiring a training set and a test set comprising electric equipment performance indexes;
carrying out bias mapping polarization activation on the training set to obtain first data; performing sparse ternary processing on the first data to obtain second data; carrying out polarization second classification on the second data to obtain third data; determining a training model according to the second data and the third data;
and determining high-fault-rate electric equipment and low-fault-rate electric equipment in the test set according to the training model and the test set.
Optionally, performing bias mapping polarization activation on the training set to obtain first data, including:
converting the training set into a plurality of channel data;
mapping each characteristic data in each channel data by adopting a bias parameter;
and activating the mapped feature data according to the activation function, so that the activated feature data are mapped into a preset interval, and determining first data.
Optionally, the activation function includes: a sigmiod function or a tanh function.
Optionally, activating the mapped feature data according to an activation function, so that the activated feature data is mapped into a preset interval, and after determining the first data, the method further includes:
and carrying out polarization processing on the first data.
Optionally, the polarization processing method includes:
Wherein x is characteristic data to be polarized; the values of the parameters k1, k2 and n are all [1,1000 ].
Optionally, the determining manner of the parameters k1, k2, n includes:
the parameters k1, k2, n are determined by adaptation;
and/or when the polarization processing mode is sigmoid (k1 x), setting the value of k1 as 1, and gradually increasing the value of k1 by step length of 1 until the polarization target is reached; when the polarization treatment is carried out in a manner of
When, atSetting the values of k2 and n as 1, and gradually increasing the value of k2 by the step length of 1 until the polarization target is approached; then the value of n is gradually increased by a step size of 1 until the polarization target is reached.
Optionally, performing sparse ternary processing on the first data to obtain second data, including:
performing sparse processing on the first data according to a preset sparsity; carrying out recovery training on the sample subjected to sparse processing;
carrying out ternary processing on the weight of the preset sparsity;
and gradually adjusting the value of the sparsity, and circularly performing sparse processing and ternary processing until a preset sparse target is reached to obtain second data.
Optionally, the value range of the sparsity is [0,1 ].
Optionally, the thinning processing comprises: biaxial sparsity or uniaxial sparsity.
Optionally, the ternary processing is performed on the weight of the preset sparsity, and includes:
when the weight is 0, keeping the weight to be zero;
when the weight is greater than 0, setting the weight to be 1;
and when the weight is less than 0, setting the weight to be-1.
Optionally, the second data is polarization-binary classified, including:
determining a median value of a preset interval;
when the second data is less than the median, setting the activated sample to 0;
when the second data is greater than the median, setting the activated sample to 1.
Optionally, determining a high failure rate electric device and a low failure rate electric device in the test set according to the training model and the test set, including:
converting first data in the training model into node forks in a decision tree;
converting a combination of each output node of second data in the training model and the node bifurcation into a decision path of a decision tree;
combining the node bifurcation and the decision path to generate a forest model;
and determining high-failure-rate electric equipment and low-failure-rate electric equipment in the test set according to the forest model and the test set.
Optionally, before determining the high-fault-rate electric device and the low-fault-rate electric device in the test set, the method further includes: preprocessing the test set;
the pre-treatment comprises at least one of: and carrying out training set test set division on the test set in a missing value filling, normalization and random division mode.
According to another aspect of the embodiments of the present invention, there is provided an apparatus for detection of an electromotive device, including:
the training set and test set acquisition module is used for acquiring a training set and a test set comprising performance indexes of the electric equipment;
the model training module is used for carrying out bias mapping polarization activation on the training set to obtain first data; performing sparse ternary processing on the first data to obtain second data; carrying out polarization second classification on the second data to obtain third data; determining a training model according to the second data and the third data;
and the electric equipment detection module is used for determining high-failure-rate electric equipment and low-failure-rate electric equipment in the test set according to the training model and the test set.
According to another aspect of an embodiment of the present invention, there is provided an electronic device for detection of an electromotive device, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for detecting an electrically powered device provided by the present invention.
According to still another aspect of an embodiment of the present invention, there is provided a computer-readable medium on which a computer program is stored, the program, when executed by a processor, implementing an electric device detection method provided by the present invention.
One embodiment of the above invention has the following advantages or benefits:
through the technical means of combining the trained neural network model with the decision tree, the process of extracting the features is visual, the extracted features can be explained, the characterization learning capacity is further improved, and the technical defects that the characterization learning cannot be explained and the accuracy is poor when the electric equipment is detected by only using the neural network in the prior art are overcome.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with specific embodiments.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a method for detecting an electric device according to an embodiment of the present invention, as shown in fig. 1, including:
s101, acquiring a training set and a test set comprising performance indexes of the electric equipment;
s102, carrying out bias mapping polarization activation on the training set to obtain first data; performing sparse ternary processing on the first data to obtain second data; performing polarization second classification on the second data to obtain third data; determining a training model according to the second data and the third data;
and S103, determining high-failure-rate electric equipment and low-failure-rate electric equipment in the test set according to the training model and the test set.
The invention determines the training model by carrying out bias mapping polarization activation, sparse ternary processing and polarization binary classification on the training set, and further determines the size of the failure probability of the electric equipment by utilizing the training model, thereby overcoming the technical defects that the electric equipment cannot be explained and the accuracy is poor when the failure frequency of the electric equipment is predicted by carrying out characterization learning on the electric equipment only by using a neural network in the prior art, and achieving the technical effects that the detection process is visible, the detection result can be explained, and the characterization learning capability is further improved.
By the technical means of combining the trained model and the decision tree, the fault rate of the electric equipment can be detected in the process of realizing the operation of pruning the decision tree, and the technical effects of determining the performance indexes related to the fault frequency of the electric equipment and eliminating the performance indexes unrelated to the fault frequency are further achieved.
Specifically, the characteristics of the electric device for determining the fault frequency may include multiple items of characteristic data such as historical peak current, load current or load voltage in the last day/month, rotation speed of the electric device per minute, and time for turning on the electric device, and a training model corresponding to a training set of the characteristics may be determined through step S102. The training model may include some features irrelevant to whether the device is in fault, and it is assumed that performance indexes such as "time to start the electric device", "whether start and stop operations have been performed", and the like are irrelevant to whether the electric device is in fault. The node of the training model that is the node of the branch related to the performance index can be cut.
And then, testing by using the test set and the training model to determine the electric equipment with high failure rate.
The network result of the training model can be universally used for feature extraction in various scenes, wherein the network result comprises the combination of a neural network and social fields such as medicine, finance, national defense scientific research and the like, so that the defects that the electric equipment can only be detected through a black box in the technical field in the prior art, the failure rate of the electric equipment is predicted, and the failure rate cannot be explained are overcome, and the technical effect of higher reliability of the extracted features is achieved.
FIG. 2 is a schematic diagram of a two-layer neural network simulation tree model for a method of electrical device detection, in accordance with an embodiment of the present invention. Alternatively, the model used for training may consist of two layers of neural networks: the first layer implements biased one-to-one mapping and activates after splicing; the second layer is implemented as sparse and tri-valued to weights of the neural network.
The step of training the model consists of three successive training steps.
Bias mapping polarization activation is carried out on the training set, and occurs in a first layer neural network; sparse and ternary processing is carried out on the sample after bias mapping polarization activation, and the sample is generated in a second layer of neural network; polarization classification of the polarization-activated sample of the bias mapping occurs in the first layer neural network.
Through the three steps, the training model can be obtained.
Optionally, performing bias mapping polarization activation on the training set to obtain first data, including:
converting the training set into a plurality of channel data;
mapping each characteristic data in each channel data by adopting a bias parameter;
and activating the mapped feature data according to the activation function, so that the activated feature data are mapped into a preset interval, and determining first data.
By converting the training samples into a plurality of channel data, the technical effect that the same training sample corresponds to a plurality of different offset parameters, namely different segmentation points, can be realized, and the technical effect of obtaining different characteristic data aiming at the same sample can be further achieved.
Specifically, sample data x in the training set
iConversion into multi-channel data
Wherein i is less than or equal to m, m is the number of features, c is less than or equal to A, and A is the number of channels. Each feature in each channel requires learning a bias parameter
I.e. a one-to-one mapping is performed.
Making the same x by taking multi-channel data
iLearning a plurality of different bias terms
And further, the aim of achieving a plurality of segmentation points of the feature data when the training model is converted into the decision tree model is achieved.
Optionally, the activation function includes, but is not limited to: a sigmiod function or a tanh function.
In particular, when the activation function sigmoid (x) common to neural networks is selected for bias mapping activation,
mapping to (0, 1) interval, wherein
To bias the mapped multi-channel data.
Optionally, activating the mapped feature data according to an activation function, so that the activated feature data is mapped into a preset interval, and after determining the first data, the method further includes:
and carrying out polarization processing on the first data.
Because the final result needs to be determined by combining the decision tree, the weight between each node in the decision tree can be conveniently determined through polarization processing, the influence of each characteristic on each node can be further conveniently determined, and the decision tree is further assisted to make a decision.
Specifically, the operation result of the sigmoid (x) function is smoothly distributed between 0 and 1. The result approaches 0 or 1 through polarization processing, thereby approaching the deterministic decision condition of the decision tree.
Optionally, the polarization processing method includes:
polarization mode 1: sigmoid (k1 × x). Wherein x represents the characteristic data to be polarized.
The polarization mode 1 can make the sample data be scaled by using the parameter k1 as a scaling factor, when k1 is larger, the product value in brackets exceeds the activation sensitive area, so that a better approximation of 0 or 1 can be obtained, and the value range of k is [1,1000 ]. During the model training, the value of k1 can be set to 1, and the value of k1 is gradually increased by 1 step until the polarization target is reached.
wherein x is characteristic data to be polarized; the values of the parameters k2 and n are both [1,1000 ].
The polarization mode 2 solves the technical defect that the minimum value close to 0 in the polarization mode 1 cannot be effectively close to 0 or 1 by a scaling mode. In the model training process, the values of k2 and n are set to be 1, and the value of k2 is gradually increased by taking the step length as 1 until the polarization target is approached; then the value of n is gradually increased by a step size of 1 until the polarization target is reached.
The polarization target may be a preset target or an optimal polarization target determined by debugging. The above-described manner of determining the parameters k1, k2, n in polarization mode 1 or 2 may also be determined adaptively.
The technical means of determining the parameters of the training model in a self-adaptive manner or continuously testing and determining the parameters overcome the technical defects that differential operation cannot be carried out and the neural network is lost through return gradient iterative optimization in the prior art, and further achieve the technical effect of more accurate training of the model.
Optionally, performing sparse ternary processing on the first data to obtain second data, including:
performing sparse processing on the first data according to a preset sparsity; carrying out recovery training on the sample subjected to sparse processing;
carrying out ternary processing on the weight of the preset sparsity;
specific step length can be set, the value of the sparsity is adjusted step by step, and sparse processing and ternary processing are carried out in a circulating mode until a preset sparse target is reached, so that second data are obtained.
Optionally, the value range of the sparsity is [0,1 ].
Specifically, fig. 3 shows the result of polarization of a sample by offset mapping for input nodes of the sparse processing according to the embodiment of the present invention, as shown in fig. 3, assuming that the number of input nodes is m and the number of output nodes is n, the minimum weight is set to 0 by the sparse processing, then the sample after the sparse processing is subjected to recovery training, and then the step length of the sparsity is set, and the iteration operation is performed until the preset sparse matrix is reached, and finally, the weight matrix is changed from a dense matrix of n × m dimension to a sparse matrix of n '× m' dimension.
Optionally, the thinning processing comprises: biaxial sparsity or uniaxial sparsity.
In the embodiment, the sparse ternary stage adopts double-axis sparse, and the weight matrix is optimized in a cyclic iteration mode, so that the purpose of pruning the decision tree is achieved. Specifically, as shown in fig. 4, the decision nodes in the decision tree include historical peak current, load current or load voltage in the last day/month, rotational speed of the electric device per minute, whether or not to perform post-stop operation, and ambient temperature. After the nodes are thinned and thresholded, and whether the nodes are stopped after being thinned or not are equivalent to pruning the decision tree.
Optionally, the ternary processing is performed on the weight of the preset sparsity, and includes:
when the weight is 0, keeping the weight to be zero;
when the weight is greater than 0, setting the weight to be 1;
and when the weight is less than 0, setting the weight to be-1.
When the tri-valued process is completed, recovery training can also be performed until performance is restored.
Optionally, the second data is polarization-binary classified, including:
determining a median value of a preset interval;
when the second data is less than the median, setting the activated sample to 0;
when the second data is greater than the median, setting the activated sample to 1.
Since the result after polarization activation is a value in 0-1, rather than 0 or 1, the output of the sigmoid function can be converted into a binary output (binary output, i.e., output of 0 or 1) by binary classification. Alternatively, performance may be fully restored after several rounds of restorative training.
Optionally, determining a high failure rate electric device and a low failure rate electric device in the test set according to the training model and the test set, including:
converting first data in the training model into node forks in a decision tree;
converting a combination of each output node of second data in the training model and the node bifurcation into a decision path of a decision tree;
combining the node bifurcation and the decision path to generate a forest model;
and determining high-failure-rate electric equipment and low-failure-rate electric equipment in the test set according to the forest model and the test set.
By combining the output of the neural network with the decision tree, the technical defects that the existing technology cannot carry out end-to-end learning of the neural network and has poor representation learning capability are overcome, so that the neural network can learn more accurately and can achieve the end-to-end technical effect.
FIG. 4 is a schematic diagram of an electrical device detection process according to an embodiment of the present invention.
Specifically, as shown in fig. 4, the collected data mainly includes several characteristic data of historical peak current, load current or load voltage in the last day/month, rotation speed of the electric device per minute, whether to perform stop-and-go operation, and ambient temperature. The fault rate of the electric equipment is a target variable.
The weight represents the relationship between the node and the derived feature, and the solid black line represents the weight 1, indicating positive correlation; the black dashed line represents weight-1, indicating a negative correlation; the gray dotted line represents a weight of 0, indicating no relationship. The node1 node in fig. 4(a) corresponds to the case where the failure rate of the electric equipment is low, and corresponds to the decision tree path in fig. (b); (a) the node of the middle node2 corresponds to the case where the failure rate of the electric equipment is high, and corresponds to the decision tree path in the graph (c).
Optionally, before determining the high-fault-rate electric device and the low-fault-rate electric device in the test set, the method further includes: preprocessing the test set;
the pre-treatment comprises at least one of: and carrying out training set test set division on the test set in a missing value filling, normalization and random division mode.
By preprocessing or cleaning the characteristic data in the test set, the data determination model analyzed by the neural network is more accurate.
Fig. 5 is a schematic diagram of the main modules of an apparatus for electrical device detection according to an embodiment of the present invention. As shown in figure 5 of the drawings,
according to another aspect of the embodiment of the present invention, there is provided an apparatus 500 for detecting an electromotive device, including:
the module 501 is a training set and test set acquisition module, and is used for acquiring a training set and a test set comprising performance indexes of the electric equipment;
the module 502 and the model training module are used for performing bias mapping polarization activation on the training set to obtain first data; performing sparse ternary processing on the first data to obtain second data; carrying out polarization second classification on the second data to obtain third data; determining a training model according to the second data and the third data;
the module 503 and the electric device detection module are configured to determine a high failure rate electric device and a low failure rate electric device in the test set according to the training model and the test set.
Fig. 6 illustrates an exemplary system architecture 600 to which the electrical device detection method or electrical device detection apparatus of embodiments of the present invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 601, 602, 603 to interact with the server 605 via the network 604 to receive or send messages or the like. The terminal devices 601, 602, 603 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 601, 602, 603. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the electric device detection method provided by the embodiment of the present invention is generally executed by the server 605, and accordingly, the electric device detection apparatus is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 7, the computer system 700 includes a central processing module (CPU)701, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
To the I/O interface 705, AN input section 706 including a keyboard, a mouse, and the like, AN output section 707 including a keyboard such as a Cathode Ray Tube (CRT), a liquid crystal display (L CD), and the like, a speaker, and the like, a storage section 708 including a hard disk and the like, and a communication section 709 including a network interface card such as a L AN card, a modem, and the like, the communication section 709 performs communication processing via a network such as AN internet, a drive 710 is also connected to the I/O interface 705 as necessary, a removable medium 711 such as a magnetic disk, AN optical disk, a magneto-optical disk, a semiconductor memory, and the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program performs the above-described functions defined in the system of the present invention when executed by the central processing module (CPU) 701.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a sending module, an obtaining module, a determining module, and a first processing module. The names of these modules do not form a limitation on the modules themselves in some cases, and for example, the sending module may also be described as a "module sending a picture acquisition request to a connected server".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise:
acquiring a training set and a test set comprising electric equipment performance indexes;
carrying out bias mapping polarization activation on the training set to obtain first data; performing sparse ternary processing on the first data to obtain second data; carrying out polarization second classification on the second data to obtain third data; determining a training model according to the second data and the third data;
and determining the detection of the high-fault-rate electric equipment and the low-fault-rate electric equipment in the test set according to the training model and the test set.
According to the technical scheme of the embodiment of the invention, the following technical effects can be achieved:
the method makes the process of extracting the characteristics visible through a technical means of combining the trained neural network model and the decision tree, and the extracted characteristics can be explained, thereby further improving the characteristic learning capability and overcoming the technical defects that the prior art cannot be explained and has poor accuracy when the electric equipment is detected by only using the neural network for the characteristic learning.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations, and substitutions may occur depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.