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 PDF

Info

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
output result
training
dbn
behavior
target
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
CN202110791524.7A
Other languages
Chinese (zh)
Other versions
CN113591613B (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.)
Guangdong Power Grid Co Ltd
Measurement Center of Guangdong Power Grid Co Ltd
Original Assignee
Guangdong Power Grid Co Ltd
Measurement Center of Guangdong Power Grid 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 Guangdong Power Grid Co Ltd, Measurement Center of Guangdong Power Grid Co Ltd filed Critical Guangdong Power Grid Co Ltd
Priority to CN202110791524.7A priority Critical patent/CN113591613B/en
Publication of CN113591613A publication Critical patent/CN113591613A/en
Application granted granted Critical
Publication of CN113591613B publication Critical patent/CN113591613B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • G06F18/2135Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods based on approximation criteria, e.g. principal component analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial 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]
    • 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
    • G06N3/088Non-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

本发明公开了一种窃电行为识别方法、系统、终端设备及存储介质,该方法包括:采集待测用户的历史用电数据,按第一预设比例将历史用电数据分为第一训练样本和测试样本;对第一训练样本进行降维处理,利用降维后的训练样本对DBN模型训练,得到目标DBN模型及第一输出结果;对第一输出结果进行加权,得到异常检测阈值;将测试样本输入至所述目标DBN模型,得到第二输出结果,利用该值确定待测用户用电行为的目标检测值;判断目标检测值是否大于异常检测阈值;若是,则当前待测用户用电行为正常,否则为异常。本发明能够提高用户窃电行为行为识别的准确率,进而增强供电系统的安全性和可靠性,具有成本低、精确度高及适用性强的优点。

Figure 202110791524

The invention discloses a method, system, terminal equipment and storage medium for recognizing electricity stealing behavior. The method comprises: collecting historical electricity consumption data of a user to be tested, and dividing the historical electricity consumption data into first training data according to a first preset ratio Samples and test samples; dimensionality reduction processing is performed on the first training sample, and the DBN model is trained by using the dimensionality-reduced training samples to obtain the target DBN model and the first output result; the first output result is weighted to obtain an abnormality detection threshold; Input the test sample into the target DBN model, obtain the second output result, and use this value to determine the target detection value of the electricity consumption behavior of the user to be tested; determine whether the target detection value is greater than the abnormal detection threshold; The electrical behavior is normal, otherwise it is abnormal. The invention can improve the accuracy rate of the behavior identification of the user's electricity stealing behavior, thereby enhancing the security and reliability of the power supply system, and has the advantages of low cost, high accuracy and strong applicability.

Figure 202110791524

Description

Electricity stealing behavior identification method, system, terminal equipment and storage medium
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),
Figure RE-GDA0003256586800000051
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):
Figure RE-GDA0003256586800000061
where v is a projection unit vector, vTIs the transposed vector of v, and N is the number of samples.
Order to
Figure RE-GDA0003256586800000062
Then there are:
σ2=vTCXv
1.2) modeling the optimization problem of PCA dimension reduction:
Figure RE-GDA0003256586800000063
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:
Figure RE-GDA0003256586800000064
therefore, max σ2=max vTCXv=max vTλv=maxλ
Computing projection data pairs XJContribution ratio of (a):
Figure RE-GDA0003256586800000071
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
Figure RE-GDA0003256586800000072
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:
Figure RE-GDA0003256586800000081
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,
Figure RE-GDA0003256586800000082
Δτmn(t) is the pheromone delta value,
Figure RE-GDA0003256586800000083
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 theta
Figure RE-GDA0003256586800000084
When 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:
Figure RE-GDA0003256586800000085
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;
Figure RE-GDA0003256586800000091
then, the error value E is used to match the weight value wijAnd (5) correcting:
Figure RE-GDA0003256586800000092
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 to
Figure RE-GDA0003256586800000097
To 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
Figure RE-GDA0003256586800000093
Figure RE-GDA0003256586800000094
To be provided with
Figure RE-GDA0003256586800000095
As 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:
Figure RE-GDA0003256586800000096
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
Figure RE-GDA0003256586800000101
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.
Bus 002 may include a path to transfer information between the aforementioned components. The bus 002 may be a PCI bus or an EISA bus, etc. The bus 002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 3, but this does not mean only one bus or one type of bus.
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.一种窃电行为识别方法,其特征在于,包括:1. a kind of electricity stealing behavior identification method, is characterized in that, comprises: 采集待测用户的历史用电数据,按第一预设比例将所述历史用电数据分为第一训练样本和测试样本;collecting historical power consumption data of the user to be tested, and dividing the historical power consumption data into a first training sample and a test sample according to a first preset ratio; 对所述第一训练样本进行降维处理,利用降维后的训练样本对DBN模型训练,得到目标DBN模型及第一输出结果;Perform dimensionality reduction processing on the first training sample, and train the DBN model by using the dimensionality-reduced training sample to obtain the target DBN model and the first output result; 对所述第一输出结果进行加权,得到异常检测阈值;Weighting the first output result to obtain an abnormality detection threshold; 将所述测试样本输入至所述目标DBN模型,得到第二输出结果,利用所述第二输出结果确定待测用户用电行为的目标检测值;Inputting the test sample into the target DBN model, obtaining a second output result, and using the second output result to determine the target detection value of the user's electricity consumption behavior to be tested; 判断所述目标检测值是否大于所述异常检测阈值;若是,则当前待测用户用电行为正常;若否,则当前待测用户用电行为异常。It is judged whether the target detection value is greater than the abnormality detection threshold; if so, the current electricity consumption behavior of the user to be measured is normal; if not, the electricity consumption behavior of the current user to be measured is abnormal. 2.根据权利要求1所述的窃电行为识别方法,其特征在于,所述利用降维后的训练样本对DBN模型训练,得到目标DBN模型,包括:2. electricity stealing behavior identification method according to claim 1, is characterized in that, described utilizing the training sample after dimensionality reduction to DBN model training, obtains target DBN model, comprises: 利用Sampling算法从降维后的训练样本抽取第二预设比例的样本,作为第二训练样本,将剩余降维后的训练样本作为第三训练样本;Using the Sampling algorithm to extract a second preset proportion of samples from the dimensionality-reduced training samples as the second training samples, and using the remaining dimensionally-reduced training samples as the third training samples; 将所述第二训练样本输入至多个第一DBN模型以进行无监督预训练,得到多个第二DBN模型及对应的网络参数;Inputting the second training samples into multiple first DBN models for unsupervised pre-training to obtain multiple second DBN models and corresponding network parameters; 根据所述多个第二DBN模型,将所述第三训练样本输入至任意一个第二DBN模型以进行微调,利用微调后的网络参数确定目标DBN模型。According to the plurality of second DBN models, the third training sample is input to any second DBN model for fine-tuning, and the fine-tuned network parameters are used to determine the target DBN model. 3.根据权利要求2所述的窃电行为识别方法,其特征在于,在将所述第二训练样本输入至多个第一DBN模型以进行无监督预训练之前,还包括:3. The method for identifying electricity stealing behavior according to claim 2, wherein before the second training samples are input to a plurality of first DBN models for unsupervised pre-training, the method further comprises: 利用AG算法对原始DBN模型的网络参数进行全局寻优,将寻优结果作为第一DBN模型的网络参数。The AG algorithm is used to optimize the network parameters of the original DBN model globally, and the optimization result is used as the network parameters of the first DBN model. 4.根据权利要求2所述的窃电行为识别方法,其特征在于,所述第一输出结果包括:将所述第二训练样本输入至多个第一DBN模型后的输出结果,及将所述第三训练样本输入至任意一个第二DBN模型后的输出结果。4. The method for recognizing electricity stealing behavior according to claim 2, wherein the first output result comprises: an output result after the second training sample is input into a plurality of first DBN models, and the first output result comprises: The output result after the third training sample is input to any second DBN model. 5.根据权利要求4所述的窃电行为识别方法,其特征在于,利用LASSO对所述第一输出结果进行稀疏化加权处理,得到异常检测阈值。5 . The method for identifying electricity stealing behavior according to claim 4 , wherein the first output result is subjected to sparse weighting processing by using LASSO to obtain an abnormality detection threshold. 6 . 6.根据权利要求1所述的窃电行为识别方法,其特征在于,利用PCA算法对所述第一训练样本进行降维处理。6 . The method for identifying electricity stealing behavior according to claim 1 , wherein a PCA algorithm is used to perform dimensionality reduction processing on the first training sample. 7 . 7.根据权利要求1-6任一项所述的窃电行为识别方法,其特征在于,所述利用所述第二输出结果确定待测用户用电行为的目标检测值,包括:7. The method for recognizing electricity stealing behavior according to any one of claims 1-6, wherein, determining the target detection value of the electricity consumption behavior of the user to be measured by using the second output result, comprising: 计算所述第二输出结果的检出率及误检率;calculating the detection rate and the false detection rate of the second output result; 以所述检出率为横坐标、所述误检率为纵坐标建立ROC曲线,将距离坐标(0,1)最近的点作为目标检测值。An ROC curve is established with the detection rate on the abscissa and the false detection rate on the ordinate, and the point closest to the coordinate (0,1) is used as the target detection value. 8.一种窃电行为识别系统,其特征在于,包括:8. An electricity stealing behavior identification system, characterized in that, comprising: 数据获取单元,用于采集待测用户的历史用电数据,按第一预设比例将所述历史用电数据分为第一训练样本和测试样本;a data acquisition unit, configured to collect historical power consumption data of the user to be tested, and divide the historical power consumption data into a first training sample and a test sample according to a first preset ratio; 预训练单元,用于对所述第一训练样本进行降维处理,利用降维后的训练样本对DBN模型训练,得到目标DBN模型及第一输出结果;a pre-training unit, configured to perform dimensionality reduction processing on the first training sample, and use the dimensionality-reduced training sample to train the DBN model to obtain the target DBN model and the first output result; 加权处理单元,用于对所述第一输出结果进行加权,得到异常检测阈值;a weighting processing unit, configured to weight the first output result to obtain an abnormality detection threshold; 目标检测值确定单元,用于将所述测试样本输入至所述目标DBN模型,得到第二输出结果,利用所述第二输出结果确定待测用户用电行为的目标检测值;a target detection value determination unit, configured to input the test sample into the target DBN model, obtain a second output result, and use the second output result to determine the target detection value of the user's electricity consumption behavior to be tested; 用电行为判断单元,用于判断所述目标检测值是否大于所述异常检测阈值;若是,则当前待测用户用电行为正常;若否,则当前待测用户用电行为异常。The electricity consumption behavior judgment unit is used for judging whether the target detection value is greater than the abnormality detection threshold; if so, the current electricity consumption behavior of the user to be measured is normal; if not, the electricity consumption behavior of the current user to be measured is abnormal. 9.一种终端设备,其特征在于,包括:处理器、存储器以及存储在所述存储器中且被配置为由所述处理器执行的计算机程序,所述处理器执行所述计算机程序时实现如权利要求1至7中任一项所述的窃电行为识别方法。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, wherein the processor implements the following when executing the computer program. The method for recognizing electricity stealing behavior according to any one of claims 1 to 7. 10.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行实现如权利要求1至7任一项所述的窃电行为识别方法。10 . A computer-readable storage medium on which a computer program is stored, wherein the computer program is executed by a processor to implement the method for identifying an electricity stealing behavior according to any one of claims 1 to 7 . 11 .
CN202110791524.7A 2021-07-13 2021-07-13 Electricity theft identification method, system, terminal device and storage medium Active CN113591613B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110791524.7A CN113591613B (en) 2021-07-13 2021-07-13 Electricity theft identification method, system, terminal device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110791524.7A CN113591613B (en) 2021-07-13 2021-07-13 Electricity theft identification method, system, terminal device and storage medium

Publications (2)

Publication Number Publication Date
CN113591613A true CN113591613A (en) 2021-11-02
CN113591613B CN113591613B (en) 2025-02-28

Family

ID=78247204

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110791524.7A Active CN113591613B (en) 2021-07-13 2021-07-13 Electricity theft identification method, system, terminal device and storage medium

Country Status (1)

Country Link
CN (1) CN113591613B (en)

Citations (3)

* Cited by examiner, † Cited by third party
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
CN111860638A (en) * 2020-07-17 2020-10-30 湖南大学 Parallel Intrusion Detection Method and System Based on Imbalanced Data Deep Belief Network
CN112836738A (en) * 2021-01-29 2021-05-25 华能国际电力股份有限公司 Electricity Stealing Behavior Detection Method Based on BP Neural Network

Patent Citations (3)

* Cited by examiner, † Cited by third party
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
CN111860638A (en) * 2020-07-17 2020-10-30 湖南大学 Parallel Intrusion Detection Method and System Based on Imbalanced Data Deep Belief Network
CN112836738A (en) * 2021-01-29 2021-05-25 华能国际电力股份有限公司 Electricity Stealing Behavior Detection Method Based on BP Neural Network

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
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 *

Also Published As

Publication number Publication date
CN113591613B (en) 2025-02-28

Similar Documents

Publication Publication Date Title
CN114416953B (en) Question-answering processing method, question-answering model training method and device
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
CN110472675A (en) Image classification method, image classification device, storage medium and electronic equipment
CN114116997A (en) Knowledge question answering method, knowledge question answering device, electronic equipment and storage medium
JP6172317B2 (en) Method and apparatus for mixed model selection
CN112749737A (en) Image classification method and device, electronic equipment and storage medium
CN113330462B (en) Neural Network Training Using Soft Nearest Neighbor Loss
CN118196567B (en) Data evaluation method, device, equipment and storage medium based on large language model
CN113392920B (en) Method, apparatus, device, medium, and program product for generating cheating prediction model
CN112463964A (en) Text classification and model training method, device, equipment and storage medium
CN113642727A (en) Training method of neural network model and processing method and device of multimedia information
CN116822651A (en) Large model parameter fine adjustment method, device, equipment and medium based on incremental learning
CN114186646A (en) Block chain abnormal transaction identification method and device, storage medium and electronic device
CN113657538A (en) Model training method, data classification method, device, equipment, storage medium and product
CN116304853A (en) Data classification method and system combining extreme learning machine and feature extraction
CN115759748A (en) Risk detection model generation method and device and risk individual identification method and device
CN117573985B (en) Information pushing method and system applied to intelligent online education system
CN118784887A (en) Illegal live broadcast room identification method, device, electronic device and readable storage medium
CN118395223A (en) Environment investigation data processing method for geological mineral exploration
CN104572820B (en) The generation method and device of model, importance acquisition methods and device
CN117474669A (en) Loan overdue prediction method, device, equipment and storage medium
CN113591613A (en) Electricity stealing behavior identification method, system, terminal equipment and storage medium
CN116680401A (en) Document processing method, document processing device, apparatus and storage medium

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