CN113591613A - Electricity stealing behavior identification method, system, terminal equipment and storage medium - Google Patents
Electricity stealing behavior identification method, system, terminal equipment and storage medium Download PDFInfo
- Publication number
- CN113591613A CN113591613A CN202110791524.7A CN202110791524A CN113591613A CN 113591613 A CN113591613 A CN 113591613A CN 202110791524 A CN202110791524 A CN 202110791524A CN 113591613 A CN113591613 A CN 113591613A
- Authority
- CN
- China
- Prior art keywords
- training
- behavior
- output result
- dbn
- user
- 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.)
- Pending
Links
- 230000005611 electricity Effects 0.000 title claims abstract description 83
- 238000000034 method Methods 0.000 title claims abstract description 43
- 238000012549 training Methods 0.000 claims abstract description 96
- 238000001514 detection method Methods 0.000 claims abstract description 82
- 230000009467 reduction Effects 0.000 claims abstract description 30
- 230000002159 abnormal effect Effects 0.000 claims abstract description 28
- 238000012360 testing method Methods 0.000 claims abstract description 19
- 230000006399 behavior Effects 0.000 claims description 67
- 238000004422 calculation algorithm Methods 0.000 claims description 33
- 238000012545 processing Methods 0.000 claims description 12
- 238000005457 optimization Methods 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 8
- 238000005070 sampling Methods 0.000 claims description 4
- 239000003016 pheromone Substances 0.000 description 14
- 238000000513 principal component analysis Methods 0.000 description 12
- 210000002569 neuron Anatomy 0.000 description 8
- 238000004364 calculation method Methods 0.000 description 6
- 230000008859 change Effects 0.000 description 6
- 241000257303 Hymenoptera Species 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 235000019800 disodium phosphate Nutrition 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000010606 normalization Methods 0.000 description 2
- 230000002265 prevention Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 150000001875 compounds Chemical class 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 239000006185 dispersion Substances 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000019637 foraging behavior Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000000053 physical method Methods 0.000 description 1
- 230000003449 preventive effect Effects 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/213—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
- G06F18/2135—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods based on approximation criteria, e.g. principal component analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/004—Artificial life, i.e. computing arrangements simulating life
- G06N3/006—Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/088—Non-supervised learning, e.g. competitive learning
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a method, a system, a terminal device and a storage medium for identifying electricity stealing behavior, wherein the method comprises the following steps: collecting historical electricity utilization data of a user to be tested, and dividing the historical electricity utilization data into a first training sample and a test sample according to a first preset proportion; carrying out dimensionality reduction on the first training sample, and training the DBN model by using the training sample subjected to dimensionality reduction to obtain a target DBN model and a first output result; weighting the first output result to obtain an abnormal detection threshold value; inputting a test sample into the target DBN model to obtain a second output result, and determining a target detection value of the power consumption behavior of the user to be detected by using the value; judging whether the target detection value is larger than an abnormal detection threshold value; if so, the electricity utilization behavior of the current user to be tested is normal, otherwise, the electricity utilization behavior is abnormal. The method and the device can improve the accuracy of identifying the electricity stealing behavior of the user, further enhance the safety and reliability of the power supply system, and have the advantages of low cost, high accuracy and strong applicability.
Description
Technical Field
The invention relates to the technical field of electricity stealing behavior detection, in particular to an electricity stealing behavior identification method, an electricity stealing behavior identification system, terminal equipment and a storage medium.
Background
With the great increase of electricity consumption, various electricity stealing behaviors are increasingly serious, and an electricity stealing main body is also evolved into electricity stealing of enterprises and public institutions from the past private organizations to the present. Aiming at the identification of electricity stealing behaviors, the traditional methods comprise the following methods, one method is a physical method, the interference caused by high-frequency signals and strong magnetic signals is weakened by optimizing the structure of a metering box and changing the material of the metering box, but the method has limited effect on the aspect of improving the electricity loss, and the management level of electricity stealing prevention cannot be effectively improved. The other method is to monitor the electricity consumption behavior through an electricity stealing prevention device, but the method only has a preventive effect and cannot effectively analyze the electricity stealing behavior.
In order to further enhance the supervision of electricity stealing behaviors, the prior art introduces a new detection technology, namely a DBN-based network intrusion detection technology, which performs fitting detection of data through a single Deep Belief Network (DBN) algorithm. Although the DBN algorithm has a strong training capability, the data input processing does not consider whether the processing speed is limited and whether the parameters required for the training reach the optimal state, so that the reliability of the training result cannot be ensured. Therefore, the DBN algorithm is adopted singly, which cannot meet the supervision requirement of the actual electricity stealing behavior.
Disclosure of Invention
The invention aims to provide a method, a system, a terminal device and a storage medium for identifying electricity stealing behavior, so as to solve the technical problems of strong limitation and inaccurate identification result in the existing method for identifying electricity stealing behavior.
In order to overcome the defects in the prior art, the invention provides an electricity stealing behavior identification method, which comprises the following steps:
the method comprises the steps of collecting historical electricity utilization data of a user to be tested, and dividing the historical electricity utilization data into a first training sample and a test sample according to a first preset proportion;
performing dimensionality reduction on the first training sample, and training a DBN model by using the training sample subjected to dimensionality reduction to obtain a target DBN model and a first output result;
weighting the first output result to obtain an abnormal detection threshold value;
inputting the test sample into the target DBN model to obtain a second output result, and determining a target detection value of the electricity consumption behavior of the user to be detected by using the second output result;
judging whether the target detection value is larger than the abnormal detection threshold value; if so, the current electricity utilization behavior of the user to be tested is normal; and if not, the current electricity utilization behavior of the user to be tested is abnormal.
Further, the training the DBN model by using the training sample after the dimension reduction to obtain a target DBN model includes:
extracting a sample with a second preset proportion from the dimensionality reduced training sample by using a Sampling algorithm to serve as a second training sample, and taking the rest dimensionality reduced training samples as third training samples;
inputting the second training samples into a plurality of first DBN models for unsupervised pre-training to obtain a plurality of second DBN models and corresponding network parameters;
and inputting the third training sample to any one second DBN model for fine adjustment according to the plurality of second DBN models, and determining a target DBN model by using the fine-adjusted network parameters.
Further, before inputting the second training samples to a plurality of first DBN models for unsupervised pre-training, further comprising:
and carrying out global optimization on the network parameters of the original DBN model by using an AG algorithm, and taking an optimization result as the network parameters of the first DBN model.
Further, the first output result comprises: and outputting results after the second training sample is input into a plurality of first DBN models, and outputting results after the third training sample is input into any one second DBN model.
Further, the LASSO is used for conducting thinning weighting processing on the first output result, and an anomaly detection threshold value is obtained.
Further, the first training sample is subjected to dimensionality reduction processing by utilizing a PCA algorithm.
Further, the determining a target detection value of the power consumption behavior of the user to be detected by using the second output result includes:
calculating the detection rate and the false detection rate of the second output result;
and establishing an ROC curve by taking the detection rate as an abscissa and the false detection rate as an ordinate, and taking a point closest to the coordinates (0,1) as a target detection value.
The invention also provides a system for identifying electricity stealing behavior, which comprises:
the data acquisition unit is used for acquiring historical electricity utilization data of a user to be tested and dividing the historical electricity utilization data into a first training sample and a test sample according to a first preset proportion;
the pre-training unit is used for carrying out dimensionality reduction on the first training sample, and training the DBN model by using the training sample subjected to dimensionality reduction to obtain a target DBN model and a first output result;
the weighting processing unit is used for weighting the first output result to obtain an abnormal detection threshold value;
the target detection value determining unit is used for inputting the test sample to the target DBN model to obtain a second output result, and determining a target detection value of the power consumption behavior of the user to be detected by using the second output result;
the power utilization behavior judging unit is used for judging whether the target detection value is larger than the abnormal detection threshold value or not; if so, the current electricity utilization behavior of the user to be tested is normal; and if not, the current electricity utilization behavior of the user to be tested is abnormal.
The present invention also provides a terminal device, including: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the electricity stealing behavior identification method as in any one of the above when executing the computer program.
The present invention also provides a computer-readable storage medium having stored thereon a computer program for execution by a processor to implement the electricity stealing behavior identification method according to any one of the above.
Compared with the prior art, the invention has the beneficial effects that:
the method performs dimensionality reduction on a sample to be trained by utilizing a PCA algorithm, so as to reduce the calculation difficulty for subsequent training; unsupervised training is carried out on the data subjected to dimensionality reduction by using a DBN model, and meanwhile, an AG algorithm is used for providing optimal network parameters for a DBN, so that the training requirements of the DBN are met, and the optimal anomaly detection threshold value of a user to be detected is output; and finally, performing simulated dynamic detection on the sample to be detected to output an intuitive ROC curve, and judging whether the relation between the target detection value and the abnormal detection threshold value of the user to be detected accords with normal power utilization behaviors. The method and the device can improve the accuracy of identifying the electricity stealing behavior of the user, further enhance the safety and reliability of the power supply system, and have the advantages of low cost, high accuracy and strong applicability.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for identifying electricity stealing behavior according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a system for identifying electricity stealing behavior according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be understood that the step numbers used herein are for convenience of description only and are not used as limitations on the order in which the steps are performed.
It is to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
The terms "comprises" and "comprising" indicate the presence of the described features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
The term "and/or" refers to and includes any and all possible combinations of one or more of the associated listed items.
In a first aspect:
referring to fig. 1, an embodiment of the present invention provides a method for identifying electricity stealing behavior, including the following steps:
s10, collecting historical electricity utilization data of a user to be tested, and dividing the historical electricity utilization data into a first training sample and a test sample according to a first preset proportion.
In the step, firstly, collecting the hourly power consumption data of a user to be measured in a preset time range (last 1 year) as original reference data as historical power consumption data; it should be noted that, the data of the power consumption in the past 1 year is only a preferable mode of data acquisition in this embodiment, and in practical applications, data in other time ranges may be selected as needed, which is not limited herein.
Further, after the historical electricity utilization data are obtained, the historical electricity utilization data are divided into a first training sample and a test sample according to a first preset proportion, and the first preset proportion can be set to be 7:3 or 8: 2. Similarly, in practical applications, other ratios can be selected as the first preset ratio according to environmental requirements, and no limitation is made herein.
Specifically, the first training sample in this embodiment is set to XRThe test sample is set to XJ. Then, for the first training sample XRCarrying out scale division according to a certain rule to obtain a classified first training sample: for example, for the first training sample XRThe power consumption data of the users contained in the database are divided according to the time scale of continuous 30 days to obtain XJ=(x1,x2,…,x720),
S20, performing dimensionality reduction on the first training sample, and training the DBN model by using the dimensionality reduced training sample to obtain a target DBN model and a first output result;
in this step, based on the training sample X obtained in step S10JFor the training sample XJPerforming dimensionality reduction treatment toAnd obtaining a training sample with higher quality, and then training the DBN model by using the sample with higher quality. It should be noted that, the DBN model is a deep confidence network model, where the hidden layer of each layer represents an intermediate representation of the input pattern, each neuron represents a feature of the input data, the connection relationship between the neuron and the neuron represents the connection between the features, and the combination of the features and the connection relationship constitutes an abstract representation of the input data. The DBN model performs feature extraction and reconstruction layer by layer, the higher the layer number is, the fewer the number of neuron nodes in the hidden layer is, and the simpler the input mode is represented, so that a complex input mode can be simplified by adopting the method, and a simple output is finally obtained.
In one embodiment, the dimensionality reduction processing of the first training sample uses a principal component analysis algorithm, i.e., a PCA algorithm. It should be noted that the PCA algorithm is a commonly used data analysis method. PCA transforms raw data into a set of linearly independent representations of dimensions by linear transformation, which can be used to extract the principal feature components of data, which is often used for dimensionality reduction of high-dimensional data.
Specifically, the dimensionality reduction processing by using the PCA algorithm comprises the following steps:
1.1) computing the n-dimensional sample XJIs calculated from the projection data variance σ2Obtaining a sample XJDegree of dispersion of (c):
where v is a projection unit vector, vTIs the transposed vector of v, and N is the number of samples.
σ2=vTCXv
1.2) modeling the optimization problem of PCA dimension reduction:
1.3) solving an optimized value by utilizing a Lagrange equation to obtain:
f(v,λ)=vTCXv-λ(‖v‖-1)=vTCXv-λ(vTv-1)
in the formula, λ is a lagrange multiplier.
The differential solution is performed on f (v, λ) to obtain:
therefore, max σ2=max vTCXv=max vTλv=maxλ
Computing projection data pairs XJContribution ratio of (a):
when r tends to 1, it is shown that there are k (k ≦ n) sets of projection data that can fully characterize the original sample data, i.e., X by PCAJObtaining X after dimensionality reduction treatmentF=(xf1,xf2,…,xfk)。
Further, in this embodiment, the DBN model is trained by using the training samples after the dimension reduction, so as to obtain a target DBN model and a first output result.
In a certain embodiment, the training the DBN model by using the training samples after the dimension reduction to obtain the target DBN model includes:
and 2.1) extracting a sample with a second preset proportion from the training sample after dimensionality reduction by using a Sampling algorithm to serve as a second training sample, and taking the rest training sample after dimensionality reduction as a third training sample.
Wherein the Sampling algorithm is utilized to obtain the data from XRCyclically extracting a small amount of samples according to a second preset proportion to obtain
2.2) inputting the second training samples into a plurality of first DBN models for unsupervised pre-training to obtain a plurality of second DBN models and corresponding network parameters.
In one embodiment, before inputting the second training samples to the plurality of first DBN models for unsupervised pre-training, the method further comprises:
and carrying out global optimization on the network parameters of the original DBN model by using an AG algorithm, and taking an optimization result as the network parameters of the first DBN model.
It should be noted that the ant colony Algorithm (AG) is a simulation optimization algorithm for simulating foraging behavior of ants, and the basic principle thereof includes: a) ants release pheromone on the path; b) and randomly selecting a path to walk when the crossing which is not walked is touched. At the same time, the pheromone related to the path length is released; c) pheromone concentration is inversely proportional to the path length. When the following ants touch the intersection again, selecting a path with higher pheromone concentration; d) the concentration of pheromones on the optimal path is increased; e) and finally finding the optimal food searching path by the ant colony.
Specifically, the process of global optimization by the AG algorithm in this embodiment includes:
A) calculating the change probability of the network parameter theta of the original DBN model at a certain moment:
wherein n is equal to JS(m),JS(m) is a set formed by the trend of the variation of the network parameter theta, taumn(t) pheromone concentration in the trend, γmnAnd (t) is heuristic information, namely information of an original network parameter theta, alpha is an enlightenment factor of pheromone concentration, beta is an expected value of the enlightenment factor, m and n are respectively a change starting point and a change ending point, and s is each parameter value in the network parameter theta.
B) Updating the pheromone concentration, and calculating the updated change probability:
τmn(t+1)=(1-ρ)τmn(t)+Δτmn(t)
in the formula (I), the compound is shown in the specification,Δτmn(t) is the pheromone delta value,is the residual pheromone value, Q is the pheromone intensity value, Lsρ is the pheromone volatility factor for the length of the change path.
C) When updated, the change probability of the network parameter thetaWhen the concentration of the pheromone is less than or equal to the preset threshold value, taking the concentration of the pheromone at the moment as the optimal result A of the network parameter1. Wherein, wijAs a weight, representing the relationship between the input layer and the hidden layer in the DBN model, biIs a bias vector of the input layer, cjIs the bias vector of the hidden layer.
Further, step 2.2) is executed, that is, the second training samples are input to the plurality of first DBN models for unsupervised pre-training, so as to obtain a plurality of second DBN models and corresponding network parameters.
Specifically, in step 2.2), setting parameter values in the first DBN model, specifically: the number of neurons of the input layer is 40, the number of neurons of the first hidden layer is 50, the number of neurons of the second hidden layer is 20, the number of neurons of the output layer is 1, the learning rate is 0.3, the momentum term is 0.3, the batch processing amount is 10, the iteration number is 20, and the target error value is 0.0001.
Then, normalization processing is carried out on the initial training sample, the processed sample is input into a first DBN model to be trained, and an output result is obtained. Specifically, the normalization process is:
wherein X is a normalized value, XminIs the minimum value of sample data, xmaxIs the maximum value of the sample data, and x is the initial data.
Further, according to the output result, calculating the error of the output result of the trained first DBN model;
then, the error value E is used to match the weight value wijAnd (5) correcting:
where η is the learning rate.
Finally, the corrected w is utilizedijAdjustment bi、cjOutputting the trained network parameter A2. I.e. the network parameter of the second DBN model is a2。
2.3) inputting the third training sample into any one second DBN model for fine adjustment according to the plurality of second DBN models, and determining a target DBN model by using the fine-adjusted network parameters.
Specifically, the mth second DBN model is selected from the n second DBN models toTo train the sample, and the network parameter A in the mth second DBN model2Fine tuning to A3。
It should be noted that, in this embodiment, a first output result needs to be obtained, where the first output result is an output result obtained by inputting the second training sample to the plurality of first DBN models, and an output result obtained by inputting the third training sample to any one of the second DBN models. Namely the first DBN model and the second DBN model are used for training the sample XRIs transported byThe output value Y is (Y)ij)k×n。
And S30, weighting the first output result to obtain an abnormal detection threshold value.
In this step, the weak classifier is mainly thinned by using LASSO to obtain an external weight value β ═ β1,β2,…,βnWeighting the weak classifier to obtain the output of the model To be provided withAs the abnormal detection threshold of the model to the single time point of the ith user to be detected.
In one embodiment, step S30 further includes the following sub-steps:
3.1) thinning the weak classifier by using LASSO to obtain an external weight value;
wherein the calculation formula of the LASSO algorithm is as follows:
in the formula, betajIs the outer weight of the jth weak classifier, λ ∈ [0, + ∞) is the penalty factor, liIs labeled for the ith training sample.
And 3.2) weighting the output value of the weak classifier by using the external weight value.
Specifically, the external weight β ═ β of the weak classifier is obtained1,β2,…,βnWeighting the output of each weak classifier to obtain the output of the model
S40, inputting the test sample into the target DBN model to obtain a second output result, and determining a target detection value of the electricity consumption behavior of the user to be detected by using the second output result;
specifically, first, a test sample X is testedTFor simulating dynamic detection, using the second output result and the sample label LTDrawing an ROC curve of the model to a second output result; and secondly, acquiring an optimal critical point on the ROC curve, and taking the point as a target detection value for determining the electricity utilization behavior of the user to be detected.
Specifically, step S40 includes the following substeps:
4.1) calculating the detection rate and the false detection rate of the second output result;
it should be noted that if the target detection value is selected too low, it tends to determine that the false detection rate is increased due to abnormal power consumption data; if the target detection value is selected too high, the detection rate is prone to being reduced due to the fact that the electricity consumption data are normal. The selection of the target detection value will determine the quality of the detection of electricity stealing behavior.
Specifically, the calculation formula of the detection rate is as follows:
TPR=TP/(TP+FN)
in the formula, TPNumber of samples for which abnormal power consumption data has been detected as abnormal, FNThe abnormal power consumption data is the number of samples detected as normal.
The calculation formula for calculating the false detection rate is as follows:
FPR=FP/(FP+TN)
in the formula, FPNumber of samples, T, detected as abnormal for normal power usage dataNThe normal power consumption data is the number of samples detected to be normal.
And 4.2) establishing an ROC curve by taking the detection rate as an abscissa and the false detection rate as an ordinate, and taking a point closest to the coordinates (0,1) as a target detection value.
To test a sample XTThe detection rate of the detection result is an abscissa, and the test sample XTThe false detection rate of the detection result is that an ROC curve is established for the vertical coordinate, a point (0,1) is defined as a perfect detection point, and the distance point (0,1) on the ROC curve is selected to be the most distant pointNear point, and using the detection result corresponding to the point as the target detection value y0。
S50, judging whether the target detection value is larger than the abnormal detection threshold value; if so, the current electricity utilization behavior of the user to be tested is normal; and if not, the current electricity utilization behavior of the user to be tested is abnormal.
In this step, the target detection value y is judged0Whether the current time is greater than the abnormal detection threshold of the ith user to be detected; if so, judging that the electricity utilization behavior of the ith user to be tested is normal; if not, judging that the electricity utilization behavior of the ith user is abnormal.
According to the electricity stealing behavior identification method provided by the embodiment of the invention, the Principal Component Analysis (PCA) algorithm is utilized to perform dimensionality reduction on a sample to be trained, so that the calculation difficulty is reduced for subsequent training; providing optimal network parameters for the DBN by using an ant colony algorithm AG to output an optimal anomaly detection threshold value of a user to be detected; and finally, performing simulated dynamic detection on the sample to be detected to output an intuitive ROC curve, thereby accurately judging the power utilization behavior of the user. The embodiment of the invention can improve the accuracy of identifying the electricity stealing behavior of the user, enhance the safety and reliability of the power supply system, and has low cost and strong applicability.
In a second aspect:
referring to fig. 2, in an embodiment of the present invention, a system for identifying electricity stealing behavior is further provided, including:
the data acquisition unit 01 is used for acquiring historical electricity consumption data of a user to be tested, and dividing the historical electricity consumption data into a first training sample and a test sample according to a first preset proportion;
the pre-training unit 02 is used for performing dimensionality reduction on the first training sample, and training the DBN model by using the training sample subjected to dimensionality reduction to obtain a target DBN model and a first output result;
the weighting processing unit 03 is configured to weight the first output result to obtain an anomaly detection threshold;
the target detection value determining unit 04 is configured to input the test sample to the target DBN model to obtain a second output result, and determine a target detection value of the power consumption behavior of the user to be detected by using the second output result;
an electricity consumption behavior determination unit 05 configured to determine whether the target detection value is greater than the abnormality detection threshold value; if so, the current electricity utilization behavior of the user to be tested is normal; and if not, the current electricity utilization behavior of the user to be tested is abnormal.
The electric larceny behavior recognition system provided by the embodiment of the invention is used for executing the electric larceny behavior recognition method in the first aspect, the method performs dimensionality reduction on a to-be-trained sample by utilizing a Principal Component Analysis (PCA) algorithm, and the calculation difficulty is reduced for subsequent training; providing optimal network parameters for the DBN by using an ant colony algorithm AG to output an optimal anomaly detection threshold value of a user to be detected; and finally, performing simulated dynamic detection on the sample to be detected to output an intuitive ROC curve, thereby accurately judging the power utilization behavior of the user. The embodiment of the invention can improve the accuracy of identifying the electricity stealing behavior of the user, enhance the safety and reliability of the power supply system, and has low cost and strong applicability.
Third aspect of the invention
Referring to fig. 3, an embodiment of the present invention further provides a terminal device, where the terminal device includes:
a processor, a memory, and a bus;
the bus is used for connecting the processor and the memory;
the memory is used for storing operation instructions;
the processor is configured to call the operation instruction, and the executable instruction enables the processor to perform an operation corresponding to the electricity stealing behavior identification method according to the first aspect of the application.
In an alternative embodiment, there is provided a terminal device, as shown in fig. 3, the terminal device shown in fig. 3 includes: a processor 001 and a memory 003. Where processor 001 is coupled to memory 003, such as by bus 002. Optionally, the terminal device may also include a transceiver 004. It should be noted that the transceiver 004 is not limited to one in practical application, and the structure of the terminal device does not constitute a limitation to the embodiments of the present application.
The processor 001 may be a CPU, general purpose processor, DSP, ASIC, FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 001 may also be a combination that performs computing functions, including for example, one or more microprocessors, a combination of DSPs and microprocessors, and the like.
The memory 003 can be, but is not limited to, a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, an EEPROM, a CD-ROM or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 003 is used for storing application program codes for performing the present solution and is controlled in execution by the processor 001. Processor 001 is configured to execute application code stored in memory 003 to implement any of the method embodiments described above.
Wherein, the terminal device includes but is not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like.
Yet another embodiment of the present application provides a computer-readable storage medium having stored thereon a computer program, which, when run on a computer, causes the computer to perform the respective ones of the aforementioned method embodiments.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.
Claims (10)
1. A method for identifying electricity stealing behavior, comprising:
the method comprises the steps of collecting historical electricity utilization data of a user to be tested, and dividing the historical electricity utilization data into a first training sample and a test sample according to a first preset proportion;
performing dimensionality reduction on the first training sample, and training a DBN model by using the training sample subjected to dimensionality reduction to obtain a target DBN model and a first output result;
weighting the first output result to obtain an abnormal detection threshold value;
inputting the test sample into the target DBN model to obtain a second output result, and determining a target detection value of the electricity consumption behavior of the user to be detected by using the second output result;
judging whether the target detection value is larger than the abnormal detection threshold value; if so, the current electricity utilization behavior of the user to be tested is normal; and if not, the current electricity utilization behavior of the user to be tested is abnormal.
2. The method for identifying electricity stealing behavior according to claim 1, wherein the training the DBN model by using the training samples after dimension reduction to obtain a target DBN model comprises:
extracting a sample with a second preset proportion from the dimensionality reduced training sample by using a Sampling algorithm to serve as a second training sample, and taking the rest dimensionality reduced training samples as third training samples;
inputting the second training samples into a plurality of first DBN models for unsupervised pre-training to obtain a plurality of second DBN models and corresponding network parameters;
and inputting the third training sample to any one second DBN model for fine adjustment according to the plurality of second DBN models, and determining a target DBN model by using the fine-adjusted network parameters.
3. The electricity stealing behavior recognition method of claim 2, further comprising, prior to inputting the second training samples to a plurality of first DBN models for unsupervised pre-training:
and carrying out global optimization on the network parameters of the original DBN model by using an AG algorithm, and taking an optimization result as the network parameters of the first DBN model.
4. The electricity stealing behavior identification method according to claim 2, wherein the first output result comprises: and outputting results after the second training sample is input into a plurality of first DBN models, and outputting results after the third training sample is input into any one second DBN model.
5. The electricity stealing behavior identification method according to claim 4, wherein the first output result is subjected to thinning weighting processing by using LASSO to obtain an anomaly detection threshold.
6. The electricity stealing behavior recognition method of claim 1, wherein the first training samples are dimension-reduced using a PCA algorithm.
7. The electricity stealing behavior identification method according to any one of claims 1 to 6, wherein the determining a target detection value of the electricity consumption behavior of the user to be tested by using the second output result comprises:
calculating the detection rate and the false detection rate of the second output result;
and establishing an ROC curve by taking the detection rate as an abscissa and the false detection rate as an ordinate, and taking a point closest to the coordinates (0,1) as a target detection value.
8. An electricity stealing behavior identification system, comprising:
the data acquisition unit is used for acquiring historical electricity utilization data of a user to be tested and dividing the historical electricity utilization data into a first training sample and a test sample according to a first preset proportion;
the pre-training unit is used for carrying out dimensionality reduction on the first training sample, and training the DBN model by using the training sample subjected to dimensionality reduction to obtain a target DBN model and a first output result;
the weighting processing unit is used for weighting the first output result to obtain an abnormal detection threshold value;
the target detection value determining unit is used for inputting the test sample to the target DBN model to obtain a second output result, and determining a target detection value of the power consumption behavior of the user to be detected by using the second output result;
the power utilization behavior judging unit is used for judging whether the target detection value is larger than the abnormal detection threshold value or not; if so, the current electricity utilization behavior of the user to be tested is normal; and if not, the current electricity utilization behavior of the user to be tested is abnormal.
9. A terminal device, comprising: a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, when executing the computer program, implementing the electrical larceny behavior identification method according to any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, the computer program being executed by a processor to implement the electricity stealing behavior identification method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110791524.7A CN113591613A (en) | 2021-07-13 | 2021-07-13 | Electricity stealing behavior identification method, system, terminal equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110791524.7A CN113591613A (en) | 2021-07-13 | 2021-07-13 | Electricity stealing behavior identification method, system, terminal equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113591613A true CN113591613A (en) | 2021-11-02 |
Family
ID=78247204
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110791524.7A Pending CN113591613A (en) | 2021-07-13 | 2021-07-13 | Electricity stealing behavior identification method, system, terminal equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113591613A (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109146705A (en) * | 2018-07-02 | 2019-01-04 | 昆明理工大学 | A kind of method of electricity consumption characteristic index dimensionality reduction and the progress stealing detection of extreme learning machine algorithm |
CN112836738A (en) * | 2021-01-29 | 2021-05-25 | 华能国际电力股份有限公司 | Electricity stealing behavior detection method based on BP neural network |
-
2021
- 2021-07-13 CN CN202110791524.7A patent/CN113591613A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109146705A (en) * | 2018-07-02 | 2019-01-04 | 昆明理工大学 | A kind of method of electricity consumption characteristic index dimensionality reduction and the progress stealing detection of extreme learning machine algorithm |
CN112836738A (en) * | 2021-01-29 | 2021-05-25 | 华能国际电力股份有限公司 | Electricity stealing behavior detection method based on BP neural network |
Non-Patent Citations (2)
Title |
---|
李丹丹等: "DBN深度学习算法在反窃电系统中的应用", 《电信科学》, vol. 35, no. 2, 28 February 2019 (2019-02-28), pages 113 - 117 * |
胡仁兵 等: "基于蚁群优化的DBN转移网络结构学习算法", 《计算机工程》, vol. 35, no. 22, 30 November 2019 (2019-11-30), pages 191 - 193 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108846077B (en) | Semantic matching method, device, medium and electronic equipment for question and answer text | |
US11501161B2 (en) | Method to explain factors influencing AI predictions with deep neural networks | |
CN112231592B (en) | Graph-based network community discovery method, device, equipment and storage medium | |
CN114116997A (en) | Knowledge question answering method, knowledge question answering device, electronic equipment and storage medium | |
CN116822651A (en) | Large model parameter fine adjustment method, device, equipment and medium based on incremental learning | |
CN114239805A (en) | Cross-modal retrieval neural network, training method and device, electronic equipment and medium | |
CN112749737A (en) | Image classification method and device, electronic equipment and storage medium | |
CN112766402A (en) | Algorithm selection method and device and electronic equipment | |
CN113392920B (en) | Method, apparatus, device, medium, and program product for generating cheating prediction model | |
CN113642727B (en) | Training method of neural network model and processing method and device of multimedia information | |
CN117573985B (en) | Information pushing method and system applied to intelligent online education system | |
CN114118526A (en) | Enterprise risk prediction method, device, equipment and storage medium | |
CN104572820B (en) | The generation method and device of model, importance acquisition methods and device | |
CN113591613A (en) | Electricity stealing behavior identification method, system, terminal equipment and storage medium | |
CN116777646A (en) | Artificial intelligence-based risk identification method, apparatus, device and storage medium | |
CN116796729A (en) | Text recommendation method, device, equipment and storage medium based on feature enhancement | |
CN116680401A (en) | Document processing method, document processing device, apparatus and storage medium | |
CN116561338A (en) | Industrial knowledge graph generation method, device, equipment and storage medium | |
CN112463964B (en) | Text classification and model training method, device, equipment and storage medium | |
CN114357138A (en) | Question and answer identification method and device, electronic equipment and readable storage medium | |
CN113807391A (en) | Task model training method and device, electronic equipment and storage medium | |
CN113312552A (en) | Data processing method, device, electronic equipment and medium | |
CN113379049A (en) | Multi-technology fused electricity stealing behavior identification method and system | |
CN118196567B (en) | Data evaluation method, device, equipment and storage medium based on large language model | |
CN113886579B (en) | Construction method and system, identification method and system for positive and negative surface models of industry information |
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 |