Non-intrusive charging facility type and state identification method and device based on improved yov7 algorithm
By improving the yolov7 algorithm and combining the optical flow method to deal with thermal refractive interference, the problems of low load recognition rate and slow speed of charging stations are solved, and more efficient and accurate load recognition and status monitoring of charging stations are achieved.
Patent Information
- Application Number
- CN202411803444.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-08
AI Technical Summary
The existing charging station load recognition methods have low recognition rate and slow speed, and the interference caused by the thermal refraction of the environment and the charging load itself on the recognition, so it is impossible to accurately perform online identification, status monitoring and fault diagnosis.
The improved yolov7 algorithm is adopted to introduce SE attention mechanism, QFL loss function and reparameterized convolution, and the real-time charging load image is reconstructed by combining the temperature field and refractive index field-assisted optical flow method to improve recognition accuracy and speed.
It improves the accuracy and speed of load identification of charging stations, reduces thermal refractive interference, and enhances the reliability of subsequent status monitoring and fault diagnosis of charging stations.
Smart Images

Figure CN119782900A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence and detection algorithm technology, and in particular, to a non-invasive charging facility type and state identification method and device based on an improved YOLOv7 algorithm. Background Art
[0002] With the research and development of my country's new energy system, the electric vehicle industry has been greatly promoted and improved. The stock and proportion of charging load are increasing day by day. my country's demand for the number of corresponding equipment charging facilities and related software and hardware optimization is growing simultaneously. How to build a scientific and complete charging facility monitoring and operation system, comprehensively improve the penetration rate of electric vehicles and charging facilities, and promote the realization of environmental protection goals through industrial and technological forces has become an urgent problem to be solved in related industries.
[0003] Among them, the identification of charging load and charging status are indispensable for the subsequent status monitoring and fault diagnosis technology of charging stations. Without unified standards, technical detection and identification of loads will not be able to accurately identify equipment online, monitor and evaluate status, etc. The existing charging station load identification methods have problems such as low recognition rate, slow speed, interference caused by the environment and the thermal refraction of the charging load itself, which does not meet the stable power supply requirements of the charging station load and is not conducive to the subsequent status monitoring and fault diagnosis of the charging station. Summary of the invention
[0004] On the one hand, the present application provides a method for identifying the type and status of charging facilities based on an improved YOLOv7 algorithm and a non-invasive method, so as to solve the problems of low load recognition rate and slow speed in existing charging stations, interference with recognition caused by thermal refraction of the environment and the charging load itself, and technical problems that do not meet the stable power supply requirements of the charging station load.
[0005] This application is implemented through the following scheme:
[0006] A method for identifying the type and state of charging facilities based on an improved yolov7 algorithm and a non-intrusive method, comprising the steps of:
[0007] S1. Improve the yolov7 algorithm, including: introducing the SE attention mechanism, adding the SE module after the SPPCSPC in the Head network and at the split point between the Backbone network and the Head network, i.e., the 54th and 66th layers; using the QFL function as the loss function of the yolov7 algorithm; improving the ELAN module and introducing the reparameterized convolution; then replacing the final Detect module of the Head network with the IDetect module, and adding the Implicit A containing the movie vector, which performs an addition operation with the input feature; and the Implicit M performs a multiplication operation;
[0008] S2. Use the improved yolov7 algorithm to train the model and obtain the optimal detection model. Use the optimal detection model to identify the real-time charging load images under normal conditions and thermal refraction collected at the charging station to complete the detection of the charging load information. For the real-time charging load image under thermal refraction, before identification, the temperature field and refractive index field are first established according to the temperature data to assist the optical flow method to reconstruct the distorted parts of the real-time charging load image.
[0009] S3, transmit the test results to the monitoring center and enter the charging load identification;
[0010] S4. Collect and process charging load data for load identification model training, collect real-time charging load data, and use the optimal model for real-time load identification;
[0011] S5. Analyze and compare the image and data to identify the charging load type, and provide feedback on the signal.
[0012] Furthermore, step S1 specifically includes the steps of:
[0013] S11. Based on the yolov7 algorithm, the SE attention mechanism is added after the SPPCSPC of the Head network and the 54th and 66th layers of the Backbone network and the Head network: the input feature map is transformed, and then the global average pooling operation is applied to each feature channel to obtain a global description feature vector, and then through two connection layers, a hearing attention distribution is obtained, which is applied to the input feature map to weight the features of each channel. It is divided into four steps: transformation, global average pooling, adaptive recalibration and reweighting, among which:
[0014] The transformation formula is:
[0015]
[0016] A and U represent the input feature map and output feature map respectively, N is a set of learned filter kernels, and N c is the cth filter parameter, N c s Represents a 2D spatial kernel, * is a convolution operation;
[0017] The global average pooling formula is:
[0018]
[0019] In the formula, F sq represents global average pooling, Z is the compressed feature vector, H is the feature map height, and W is the feature map width;
[0020] The adaptive recalibration formula is:
[0021] S=σ(W2δ(W1z))
[0022] In the formula, S represents the weight obtained by Sigmoid activation, σ represents the Sigmoid activation function, δ represents the ReLU activation function, W1 and W2 are the first and second layer fully connected weight matrices respectively;
[0023] The reweighting formula is:
[0024]
[0025] In the formula, S C represents the weight of the Cth channel;
[0026] The QFL function is used as the loss function of the yolov7 algorithm. Based on the principle of Focal Loss, a quality estimation factor is introduced to optimize the model's estimation of the target IoU score by adjusting the distance weight in the loss function. The calculation formula of the QFL function is:
[0027]
[0028] Where P c represents the prediction overview of category c, q represents the IoU score between the predicted box and the true box, and γ and α are the focus indexes for adjusting the loss function;
[0029] Improve the ELAN module and add re-parameterized convolution: prevent the accuracy reduction caused by directly using re-parameterized convolution at the constant connection and splicing, retain the fourth and sixth convolutions, replace the third and fifth convolutions in the ELAN module, and use the RepConv model to improve the model training effect without increasing the inference speed;
[0030] S12. Based on the above, the final Detect module in the Head area is replaced with the IDetect module, which uses multi-feature pyramid layers and multi-scale prediction. After the Idetect module receives the features of the three levels, it first passes through ImplicitA and then to the convolutional layer, and then passes through Implicit M. The subsequent structure is the same as the Detect module.
[0031] Furthermore, the step S2 specifically includes the steps of:
[0032] S21. Obtain various types of charging load images and analyze and process them to obtain an image data set, wherein the obtained charging load images include all existing types of charging loads, normal charging load graphics and charging load graphics under thermal refraction, and key features of the charging loads, including appearance, logo, and license plate;
[0033] S22. Label the data set and divide it into two categories, training set and test set, according to the set ratio. The labeling content includes charging load type, brand, and model. Numbers and letters are used to distinguish the labels.
[0034] S23, training and debugging the charging load recognition model of the improved yolov7 algorithm through the data set to obtain the optimal detection model;
[0035] S24. Perform multiple graphic detection and recognition at equal time periods on the real-time charging load images collected on-site at the charging station through the optimal model, and obtain the model and power data of the specific charging load by comparative analysis and discrimination. Specifically, for the real-time charging load images under thermal refraction, before recognition, the temperature field and refractive index field are established according to the temperature data, and the distorted parts of the real-time charging load images are reconstructed using the auxiliary optical flow method.
[0036] Furthermore, in step 24, for the real-time charging load image under thermal refraction, the temperature field and refractive index field are established according to the temperature data before recognition, and the distorted part of the real-time charging load image is reconstructed by auxiliary optical flow method, which specifically includes the following steps:
[0037] S241. Use a temperature acquisition device to fully utilize temperature data to assist the optical flow method in calculation and establish a temperature field:
[0038] T(x,y)=(x+Δx,y+Δy)
[0039] Among them, T is the temperature intensity of a specific frame, x, y are the image pixel coordinates, Δx, Δy represent the displacement;
[0040] The refractive index field can be obtained from the temperature field and the relationship between the refractive index and temperature:
[0041] n(x,y)=jP / T(x,y)+1
[0042] Where n is the refractive index and j is a constant of 7.9×10 -5 , P is the atmospheric pressure;
[0043] S242, optical flow calculation, where light intensity is defined as:
[0044] I(x,y,t)=(x+Δx,y+Δy,t+Δt)
[0045] I represents the corresponding frame light intensity, and t is a certain moment;
[0046] After Taylor expansion, ignoring the second-order and higher derivatives, the derivative of the above formula with respect to time can be obtained:
[0047]
[0048] Among them, u and v are the differentials of x and y with respect to t respectively;
[0049] S243. Since the number of formulas obtained is less than the unknown quantity, the Horn-Schunck algorithm is used to solve iteratively: considering that the optical flow of adjacent points in the image changes smoothly, the objective function is to minimize the optical flow error of the entire image:
[0050] min∑[(I x u+I y v+I t ) 2 ]
[0051] Among them, I x ,I y are the partial derivatives of light intensity with respect to x and y, respectively, I t is the derivative of light intensity with respect to time;
[0052] The light speed gradient change is added to the optical flow error to obtain the energy function E(u,v), and the optimization is achieved by solving the minimum value of the energy function:
[0053]
[0054] Among them, β is the term that controls the global smoothness, are the sum of the quadratic partial derivatives of u and v with respect to x and y respectively;
[0055] S244. In the optical flow calculation, the refractive index is introduced into the constraints of the optical flow method, the weight of the smoothness term of the optical flow field is dynamically adjusted, the correction effect is improved in the area with large refractive index gradient, and the smoothness term and the refractive index are associated with the formula:
[0056]
[0057] Among them, β o is the basic smoothness term, k is the refractive index gradient influence coefficient, is the refractive index gradient;
[0058] S245. The energy function E(u,v) is differentiated with respect to u and v respectively, and the two partial derivatives are set to zero to obtain the iterative equation:
[0059]
[0060] in, are the weighted averages of u and v approximating the neighborhood averages of the coordinates (x, y), are the optical flows solved in the current iteration respectively;
[0061] S246, assuming that the initial values of the optical flow fields u and v are both 0, solving the equation iteratively until convergence, and obtaining the u and v values for reconstructing the distorted part of the image;
[0062] S247, obtaining a distorted image of the real-time charging load under thermal refraction, the light intensity of which is I t+1 (x, y) is known, let its previous image be I t (x', y'), by solving the obtained u, v values, integrate them to obtain the original image intensity data:
[0063]
[0064] Realize the reconstruction of the distorted parts of the real-time charging load image.
[0065] Furthermore, the step S4 specifically includes the steps of:
[0066] S41. Collect daily load data of various types of charging load data, where the charging load data includes current, voltage, charging time, and charging mode;
[0067] S42, preprocessing the collected daily load data, including data cleaning, missing value processing, outlier detection and processing, and using edge detection algorithm for event detection to analyze the operating status of the charging load;
[0068] S43, extracting feature vectors that can characterize the load characteristics of the charging station, including power peak, power average, charging time, etc., and dividing the extracted feature vectors into a training set, a validation set, and a test set, which are responsible for model learning, parameter adjustment, and performance evaluation, respectively;
[0069] S44, using a machine learning algorithm to train the extracted feature vectors, construct a load identification model, optimize the model performance by adjusting model parameters and changing the model structure, and obtain the optimal model;
[0070] S45. Collect and upload relevant data to the control center through on-site charging equipment sensors, use the optimal model to process the processed data, identify the charging load state, and obtain a load identification result.
[0071] Furthermore, in step S42, an edge detection algorithm is used to perform event detection to analyze the operating status of the charging load, including: charging access, fast charging, slow charging, balanced charging, charging completion, and charging time in normal states; charging failures in abnormal and illegal states, unauthorized charging, and charging interruptions caused by human factors or failures.
[0072] Furthermore, in step S43, the characteristic vector is mainly based on transient characteristics and supplemented by steady-state characteristics, and load identification is performed in combination with transient characteristics and steady-state characteristics. The steady-state characteristics include: harmonic current and voltage amplitude, phase, frequency, VI trajectory diagram; the transient characteristics include: current pulse peak value, transient process duration.
[0073] Furthermore, in step S43, extracting a feature vector capable of characterizing the load characteristics of the charging station specifically includes the following steps:
[0074] S431, Harmonic feature extraction: collect data for fast Fourier transform to obtain harmonic components in the frequency domain:
[0075]
[0076] Where i(n) is the current signal at the nth moment, I(f) is the current signal in the frequency domain, and N is the number of sampling points;
[0077] S432, calculate the total harmonic distortion THD:
[0078]
[0079] Among them, I n is the current component of the nth harmonic, and I1 is the current component of the fundamental wave;
[0080] S433, extracting feature vector H:
[0081] H=[I2,I3,I4,...,I n ];
[0082] S434, current pulse peak extraction:
[0083] Find local maxima:
[0084] i peak =max(i filt (t)),
[0085] Among them, i filt is the current after standardization;
[0086] Calculate the crest factor:
[0087] c f =i peak / i rms
[0088]
[0089] Among them, C f is the peak factor, i rms is a valid value;
[0090] Construct the feature vector P:
[0091] P=[i peak1 ,c f1 ,i peak2 ,c f2 ...,ipeakn ,c fn ,].
[0092] Furthermore, the step S5 specifically includes the steps of:
[0093] S51. Compare the two charging load type detection results identified by the image and data in the monitoring center, and determine whether there is a contradiction. If an abnormal result occurs, upload the total data to the operation and maintenance management office and issue a warning.
[0094] On the other hand, the present application also provides a non-intrusive charging facility type and state identification device based on an improved YOLOv7 algorithm, including:
[0095] The algorithm improvement module is used to improve the yolov7 algorithm, including: introducing the SE attention mechanism, adding the SE module after the SPPCSPC in the Head network and at the split point between the Backbone network and the Head network, that is, the 54th and 66th layers; using the QFL function as the loss function of the yolov7 algorithm; improving the ELAN module and introducing the reparameterized convolution; then replacing the final Detect module of the Head network with the IDetect module, and adding the Implicit A containing the movie vector, which performs an addition operation with the input feature; the Implicit M performs a multiplication operation;
[0096] The charging load information detection module is used to use the improved yolov7 algorithm to perform model training, obtain the optimal detection model, and use the optimal detection model to identify the real-time charging load images under normal conditions and thermal refraction collected at the charging station to complete the detection of the charging load information. For the real-time charging load image under thermal refraction, before identification, the temperature field and refractive index field are established according to the temperature data to assist the optical flow method to reconstruct the distorted parts of the real-time charging load image;
[0097] Transmission module, used to transmit the test results to the monitoring center and enter the charging load identification;
[0098] The real-time load identification module is used to collect and process charging load data, train load identification models, collect real-time charging load data, and use the optimal model for real-time load identification;
[0099] The analysis and feedback module is used to analyze and compare the charging load type identified by the image and data, and provide feedback on the signal.
[0100] On the other hand, the present application also provides a storage medium, which includes a stored program, and when the program is running, controls the device where the storage medium is located to execute the steps of the charging facility type and status identification method based on the improved YOLOv7 algorithm and the non-invasive method.
[0101] On the other hand, the present application also provides a computer program product, including a computer program or computer executable instructions, which, when executed by a processor, implements the steps of the charging facility type and status identification method based on the improved YOLOv7 algorithm and the non-intrusive method.
[0102] Compared with the prior art, this application has the following beneficial effects:
[0103] 1. Make full use of charging load data, combine charging site graphics and charging signals to identify charging load information and status, image recognition weakens the signal interference of non-intrusive identification, strengthens the ability to distinguish between similar charging loads, and enhances the load recognition of charging stations;
[0104] 2. Improve the YOLOv7 algorithm, reduce misclassification, improve model training effect, eliminate image recognition interference caused by thermal refraction, facilitate the implementation of subsequent charging station data monitoring, status detection and other steps, and improve the accuracy and reliability of subsequent status monitoring and fault diagnosis of charging stations.
[0105] In addition to the above-described purposes, features and advantages, the present application also has other purposes, features and advantages. The present application will be further described in detail with reference to the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0106] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application.
[0107] Figure 1 It is a flow chart of a preferred embodiment of the present application based on an improved yolov7 algorithm and a non-invasive charging facility type and state identification method.
[0108] Figure 2 Schematic diagram of the network structure for improving the yolov7 algorithm for this application.
[0109] Figure 3 This is a schematic diagram of the ELAN module improvement for this application.
[0110] Figure 4 It is a schematic diagram of a module of a charging facility type and state identification device based on an improved yolov7 algorithm and a non-invasive method in a preferred embodiment of the present application.
[0111] Figure 5 It is a schematic block diagram of an electronic device entity of a preferred embodiment of the present application.
[0112] Figure 6 It is a diagram of the internal structure of a computer device of a preferred embodiment of the present application. DETAILED DESCRIPTION
[0113] The embodiments of the present application are described in detail below in conjunction with the accompanying drawings, but the present application can be implemented in a variety of different ways defined and covered below.
[0114] like Figure 1 As shown, the preferred embodiment of the present application provides a method for identifying the type and state of charging facilities based on an improved yolov7 algorithm and a non-intrusive method, comprising the steps of:
[0115] S1. Improve the yolov7 algorithm, including: introducing the SE attention mechanism, adding the SE module after the SPPCSPC in the Head network and at the split point between the Backbone network and the Head network, i.e., the 54th and 66th layers; using the QFL function as the loss function of the yolov7 algorithm; improving the ELAN module and introducing the reparameterized convolution; then replacing the final Detect module of the Head network with the IDetect module, and adding the Implicit A containing the movie vector, which performs an addition operation with the input feature; and the Implicit M performs a multiplication operation;
[0116] S2. Use the improved yolov7 algorithm to train the model and obtain the optimal detection model. Use the optimal detection model to identify the real-time charging load images under normal conditions and thermal refraction collected at the charging station to complete the detection of the charging load information. For the real-time charging load image under thermal refraction, before identification, the temperature field and refractive index field are first established according to the temperature data to assist the optical flow method to reconstruct the distorted parts of the real-time charging load image.
[0117] S3, transmit the test results to the monitoring center and enter the charging load identification;
[0118] S4. Collect and process charging load data for load identification model training, collect real-time charging load data, and use the optimal model for real-time load identification;
[0119] S5. Analyze and compare the image and data to identify the charging load type, and provide feedback on the signal.
[0120] Compared with the prior art, this embodiment has the following beneficial effects:
[0121] 1. Make full use of charging load data, combine charging site graphics and charging signals to identify charging load information and status, image recognition weakens the signal interference of non-intrusive identification, strengthens the ability to distinguish between similar charging loads, and enhances the load recognition of charging stations;
[0122] 2. Improve the YOLOv7 algorithm, reduce misclassification, improve model training effect, eliminate image recognition interference caused by thermal refraction, facilitate the implementation of subsequent charging station data monitoring, status detection and other steps, and improve the accuracy and reliability of subsequent status monitoring and fault diagnosis of charging stations.
[0123] Preferably, step S1 specifically includes the steps of:
[0124] S11. Based on the yolov7 algorithm, the SE attention mechanism is added after the SPPCSPC of the Head network and the 54th and 66th layers of the Backbone network and the Head network (such as Figure 2 As shown in Figure 1), the input feature map is transformed, and then the global average pooling operation is applied to each feature channel to obtain a global description feature vector. Then, through two connection layers, an attention distribution is obtained, which is applied to the input feature map to weight the features of each channel. It is divided into four steps: transformation, global average pooling, adaptive recalibration, and reweighting.
[0125] The transformation formula is:
[0126]
[0127] A and B represent the input feature map and output feature map respectively, N is a set of learned filter kernels, N c is the cth filter parameter, Represents a 2D spatial kernel, * is a convolution operation;
[0128] The global average pooling formula is:
[0129]
[0130] In the formula, F sq represents global average pooling, Z is the compressed feature vector, H is the feature map height, and W is the feature map width;
[0131] The adaptive recalibration formula is:
[0132] S=σ(W2δ(W1z))
[0133] In the formula, S represents the weight obtained by Sigmoid activation, σ represents the Sigmoid activation function, δ represents the ReLU activation function, W1 and W2 are the first and second layer fully connected weight matrices respectively;
[0134] The reweighting formula is:
[0135]
[0136] In the formula, S C represents the weight of the Cth channel;
[0137] The QFL function is used as the loss function of the yolov7 algorithm. Based on the principle of Focal Loss, a quality estimation factor is introduced to optimize the model's estimation of the target IoU score by adjusting the distance weight in the loss function. The calculation formula of the QFL function is:
[0138]
[0139] Where P c represents the prediction overview of category c, q represents the IoU score between the predicted box and the true box, and γ and α are the focus indexes for adjusting the loss function;
[0140] Improve the ELAN module and add re-parameterized convolution (see Figure 3 ): Prevent the accuracy reduction caused by directly using re-parameterized convolution at the identical connection and splicing, retain the fourth and sixth convolutions, replace the third and fifth convolutions in the ELAN module, and use the RepConv model to improve the model training effect without increasing the inference speed;
[0141] S12. Based on the above, the final Detect module in the Head area is replaced with the IDetect module, and multi-feature pyramid layers and multi-scale predictions are used. After the Idetect module receives the features of the three levels, it is first passed through ImplicitA and then to the convolution layer, and then through Implicit M. The subsequent structure is the same as the Detect module. This embodiment uses more feature pyramid layers and multi-scale predictions than the original version, thereby improving the detection accuracy.
[0142] This embodiment improves the yolov7 algorithm and has the following advantages:: introducing the SE attention mechanism to improve the representation ability of key features, using the QFL loss function to enhance the classification and positioning capabilities in target detection, and improving the ELAN module to increase the model training structure and effect without affecting the detection speed. Detect is replaced by the IDtect module to increase the target detection accuracy within a reasonable detection speed range.
[0143] Preferably, the step S2 specifically comprises the steps of:
[0144] S21. Obtain various types of charging load images and analyze and process them to obtain an image data set, wherein the obtained charging load images include all existing types of charging loads, normal charging load graphics and charging load graphics under thermal refraction, and key features of the charging loads, including appearance, logo, and license plate;
[0145] S22. Label the data set and divide it into two categories, training set and test set, according to the set ratio. The labeling content includes charging load type, brand, and model. Numbers and letters are used to distinguish the labels.
[0146] S23, training and debugging the charging load recognition model of the improved yolov7 algorithm through the data set to obtain the optimal detection model;
[0147] S24. Perform multiple graphic detection and recognition at equal time periods on the real-time charging load images collected on-site at the charging station through the optimal model, and obtain the model and power data of the specific charging load by comparative analysis and discrimination. Specifically, for the real-time charging load images under thermal refraction, before recognition, the temperature field and refractive index field are established according to the temperature data, and the distorted parts of the real-time charging load images are reconstructed using the auxiliary optical flow method.
[0148] Specifically, in step 24, for the real-time charging load image under thermal refraction, the temperature field and refractive index field are established according to the temperature data before recognition to reconstruct the distorted part of the real-time charging load image by auxiliary optical flow method, which specifically includes the steps of:
[0149] S241. Use a temperature acquisition device to fully utilize temperature data to assist the optical flow method in calculation and establish a temperature field:
[0150] T(x,y)=(x+Δx,y+Δy)
[0151] Among them, T is the temperature intensity of a specific frame, x, y are the image pixel coordinates, Δx, Δy represent the displacement;
[0152] The refractive index field can be obtained from the temperature field and the relationship between the refractive index and temperature:
[0153] n(x,y)=jP / T(x,y)+1
[0154] Where n is the refractive index and j is a constant 7.9×10 -5 , P is the atmospheric pressure;
[0155] S242, optical flow calculation, where light intensity is defined as:
[0156] I(x,y,t)=(x+Δx,y+Δy,t+Δt)
[0157] I represents the corresponding frame light intensity, and t is a certain moment;
[0158] After Taylor expansion, ignoring the second-order and higher derivatives, the derivative of the above formula with respect to time can be obtained:
[0159]
[0160] Among them, u and v are the differentials of x and y with respect to t respectively;
[0161] S243. Since the number of formulas obtained is less than the unknown quantity, the Horn-Schunck algorithm is used to solve iteratively: considering that the optical flow of adjacent points in the image changes smoothly, the objective function is to minimize the optical flow error of the entire image:
[0162] min∑[(I x u+I y v+I t ) 2 ]
[0163] Among them, I x ,I y are the partial derivatives of light intensity with respect to x and y, respectively, I t is the derivative of light intensity with respect to time;
[0164] The light speed gradient change is added to the optical flow error to obtain the energy function E(u,v), and the optimization is achieved by solving the minimum value of the energy function:
[0165]
[0166] Among them, β is the term that controls the global smoothness, are the sum of the quadratic partial derivatives of u and v with respect to x and y respectively;
[0167] S244. In the optical flow calculation, the refractive index is introduced into the constraints of the optical flow method, the weight of the smoothness term of the optical flow field is dynamically adjusted, the correction effect is improved in the area with large refractive index gradient, and the smoothness term and the refractive index are associated with the formula:
[0168]
[0169] Among them, β o is the basic smoothness term, k is the refractive index gradient influence coefficient, is the refractive index gradient;
[0170] S245. The energy function E(u,v) is differentiated with respect to u and v respectively, and the two partial derivatives are set to zero to obtain the iterative equation:
[0171]
[0172] in, are the weighted averages of u and v approximating the neighborhood averages of the coordinates (x, y), are the optical flows solved in the current iteration respectively;
[0173] S246, assuming that the initial values of the optical flow fields u and v are both 0, solving the equation iteratively until convergence, and obtaining the u and v values for reconstructing the distorted part of the image;
[0174] S247, obtaining a distorted image of the real-time charging load under thermal refraction, the light intensity of which is I t+1 (x, y) is known, let its previous image be I t (x', y'), by solving the obtained u, v values, integrate them to obtain the original image intensity data:
[0175]
[0176] Realize the reconstruction of the distorted parts of the real-time charging load image.
[0177] In this embodiment, for the real-time charging load image under thermal refraction, the temperature field and refractive index field are first established according to the temperature data before recognition, and the distorted parts of the real-time charging load image are reconstructed using the auxiliary optical flow method, which has the following advantages:
[0178] 1. Using the optical flow method as the image preprocessing solution eliminates the thermal refraction phenomenon caused by the environment or the target's own temperature in image detection, thereby improving the detection accuracy and recognition rate of the algorithm;
[0179] 2. Incorporate temperature into the extracted features to obtain change factors other than light, eliminate errors caused by lighting changes and target occlusion, and help improve the calculation accuracy of the optical flow method.
[0180] Preferably, the step S4 specifically comprises the steps of:
[0181] S41. Collect daily load data of various types of charging load data, where the charging load data includes current, voltage, charging time, and charging mode;
[0182] S42, preprocessing the collected daily load data, including data cleaning, missing value processing, outlier detection and processing, and using edge detection algorithm for event detection to analyze the operating status of the charging load;
[0183] S43, extracting feature vectors that can characterize the load characteristics of the charging station, including power peak, power average, charging time, etc., and dividing the extracted feature vectors into a training set, a validation set, and a test set, which are responsible for model learning, parameter adjustment, and performance evaluation, respectively;
[0184] S44, using a machine learning algorithm to train the extracted feature vectors, construct a load identification model, optimize the model performance by adjusting model parameters and changing the model structure, and obtain the optimal model;
[0185] S45. Collect and upload relevant data to the control center through on-site charging equipment sensors, use the optimal model to process the processed data, identify the charging load state, and obtain a load identification result.
[0186] Preferably, in step S42, an edge detection algorithm is used for event detection, and the operating status of the charging load is analyzed, including: charging access, fast charging, slow charging, balanced charging, charging completion, and charging time in normal states; charging failures, unauthorized charging, and charging interruptions caused by human factors or failures in abnormal and illegal states.
[0187] Preferably, in step S43, the characteristic vector is mainly based on transient characteristics and supplemented by steady-state characteristics, and load identification is performed in combination with transient characteristics and steady-state characteristics. The steady-state characteristics include: harmonic current and voltage amplitude, phase, frequency, VI trajectory diagram; the transient characteristics include: current pulse peak value, transient process duration.
[0188] Preferably, in step S43, extracting a feature vector capable of characterizing the load characteristics of the charging station specifically comprises the following steps:
[0189] S431, Harmonic feature extraction: collect data for fast Fourier transform to obtain harmonic components in the frequency domain:
[0190]
[0191] Where i(n) is the current signal at the nth moment, I(f) is the current signal in the frequency domain, and N is the number of sampling points;
[0192] S432, calculate the total harmonic distortion THD:
[0193]
[0194] Among them, I n is the current component of the nth harmonic, and I1 is the current component of the fundamental wave;
[0195] S433, extracting feature vector H:
[0196] H=[I2,I3,I4,...,I n ];
[0197] S434, current pulse peak extraction:
[0198] Find local maxima:
[0199] i peak =max(i filt (t)),
[0200] Among them, i filt is the current after standardization;
[0201] Calculate the crest factor:
[0202] cf =i peak / i rms
[0203]
[0204] Among them, C f is the peak factor, i rms is a valid value;
[0205] Construct the feature vector P:
[0206] P=[i peak1 ,c f1 ,i peak2 ,c f2 ...,i peakn ,c fn ,].
[0207] This embodiment has the following advantages: charging load data is incorporated into the target type and charging status identification, the information of the charging device is further confirmed, the misidentification of the same type of charging devices is reduced, and the load identification of the charging station is enhanced.
[0208] Preferably, the step S5 specifically comprises the steps of:
[0209] S51. Compare the two charging load type detection results identified by the image and data in the monitoring center, and determine whether there is a contradiction. If an abnormal result occurs, upload the total data to the operation and maintenance management office and issue a warning.
[0210] Preferably, if Figure 4 As shown, another preferred embodiment of the present application also provides a charging facility type and state identification device based on an improved YOLOv7 algorithm and a non-intrusive method, including:
[0211] The algorithm improvement module is used to improve the yolov7 algorithm, including: introducing the SE attention mechanism, adding the SE module after the SPPCSPC in the Head network and at the split point between the Backbone network and the Head network, that is, the 54th and 66th layers; using the QFL function as the loss function of the yolov7 algorithm; improving the ELAN module and introducing the reparameterized convolution; then replacing the final Detect module of the Head network with the IDetect module, and adding the Implicit A containing the movie vector, which performs an addition operation with the input feature; the Implicit M performs a multiplication operation;
[0212] The charging load information detection module is used to use the improved yolov7 algorithm to perform model training, obtain the optimal detection model, and use the optimal detection model to identify the real-time charging load images under normal conditions and thermal refraction collected at the charging station to complete the detection of the charging load information. For the real-time charging load image under thermal refraction, before identification, the temperature field and refractive index field are established according to the temperature data to assist the optical flow method to reconstruct the distorted parts of the real-time charging load image;
[0213] Transmission module, used to transmit the test results to the monitoring center and enter the charging load identification;
[0214] The real-time load identification module is used to collect and process charging load data, train load identification models, collect real-time charging load data, and use the optimal model for real-time load identification;
[0215] The analysis and feedback module is used to analyze and compare the charging load type identified by the image and data, and provide feedback on the signal.
[0216] like Figure 5 As shown, a preferred embodiment of the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned embodiment based on the improved YOLOv7 algorithm and the non-invasive charging facility type and status identification method when executing the computer program.
[0217] like Figure 6 As shown, the preferred embodiment of the present application also provides a computer device, which can be a terminal or a liveness detection server, and its internal structure diagram can be as shown in Figure 6 As shown. The computer device includes a processor, a memory and a network interface connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with other external computer devices through a network connection. When the computer program is executed by the processor, the steps of the above-mentioned charging facility type and state identification method based on the improved yolov7 algorithm and the non-invasive method are implemented.
[0218] Those skilled in the art will understand that Figure 6The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0219] A preferred embodiment of the present application also provides a storage medium, which includes a stored program, and when the program is running, controls the device where the storage medium is located to execute the steps of the above-mentioned embodiment based on the improved YOLOv7 algorithm and the non-invasive charging facility type and status identification method.
[0220] The preferred embodiment of the present application provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the above-mentioned charging facility type and state identification method based on the improved yolov7 algorithm and non-intrusiveness of the embodiment of the present application.
[0221] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0222] If the functions described in the method of this embodiment are implemented in the form of software functional units and sold or used as independent products, they can be stored in one or more computing devices readable storage media. Based on this understanding, the part of the embodiment of the present application that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a computing device (which can be a personal computer, server, mobile computing device or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0223] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code. The scheme in the embodiments of the present application can be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.
[0224] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0225] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0226] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0227] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0228] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for identifying the type and status of charging facilities based on an improved yolov7 algorithm and a non-intrusive method, characterized in that: Includes steps: S1. Improve the yolov7 algorithm, including: introducing the SE attention mechanism, adding the SE module after the SPPCSPC in the Head network and at the split point between the Backbone network and the Head network, i.e., the 54th and 66th layers; using the QFL function as the loss function of the yolov7 algorithm; improving the ELAN module and introducing the reparameterized convolution; then replacing the final Detect module of the Head network with the IDetect module, and adding the Implicit A containing the film and television vector, which performs an addition operation with the input feature; ImplicitM performs a multiplication operation; S2. Use the improved yolov7 algorithm to train the model and obtain the optimal detection model. Use the optimal detection model to identify the real-time charging load images under normal conditions and thermal refraction collected at the charging station to complete the detection of the charging load information. For the real-time charging load image under thermal refraction, before identification, the temperature field and refractive index field are first established according to the temperature data to assist the optical flow method to reconstruct the distorted parts of the real-time charging load image. S3, transmit the test results to the monitoring center and enter the charging load identification; S4. Collect and process charging load data for load identification model training, collect real-time charging load data, and use the optimal model for real-time load identification; S5. Analyze and compare the image and data to identify the charging load type, and provide feedback on the signal.
2. The method for identifying the type and status of charging facilities based on the improved yolov7 algorithm and non-intrusiveness according to claim 1 is characterized in that: Step S1 specifically includes the following steps: S11. Based on the yolov7 algorithm, the SE attention mechanism is added after the SPPCSPC of the Head network and the 54th and 66th layers of the Backbone network and the Head network: the input feature map is transformed, and then the global average pooling operation is applied to each feature channel to obtain a global description feature vector, and then through two connection layers, a hearing attention distribution is obtained, which is applied to the input feature map to weight the features of each channel. It is divided into four steps: transformation, global average pooling, adaptive recalibration and reweighting, among which: The transformation formula is: A and U represent the input feature map and output feature map respectively, N is a set of learned filter kernels, and N c is the cth filter parameter, Represents a 2D spatial kernel, * is a convolution operation; The global average pooling formula is: In the formula, F sq represents global average pooling, Z is the compressed feature vector, H is the feature map height, and W is the feature map width; The adaptive recalibration formula is: S=σ(W2δ(W1z)) In the formula, S represents the weight obtained by Sigmoid activation, σ represents the Sigmoid activation function, δ represents the ReLU activation function, W1 and W2 are the first and second layer fully connected weight matrices respectively; The reweighting formula is: In the formula, S C represents the weight of the Cth channel; The QFL function is used as the loss function of the yolov7 algorithm. Based on the principle of Focal Loss, a quality estimation factor is introduced to optimize the model's estimation of the target IoU score by adjusting the distance weight in the loss function. The calculation formula of the QFL function is: Where P c represents the prediction overview of category c, q represents the IoU score between the predicted box and the true box, and γ and α are the focus indexes for adjusting the loss function; Improve the ELAN module and add re-parameterized convolution: prevent the accuracy reduction caused by directly using re-parameterized convolution at the constant connection and splicing, retain the fourth and sixth convolutions, replace the third and fifth convolutions in the ELAN module, and use the RepConv model to improve the model training effect without increasing the inference speed; S12. Based on the above, the final Detect module in the Head area is replaced with the IDetect module, which uses multi-feature pyramid layers and multi-scale prediction. After the Idetect module receives the features of the three levels, it first passes through ImplicitA and then to the convolutional layer, and then passes through Implicit M. The subsequent structure is the same as the Detect module.
3. The method for identifying the type and status of charging facilities based on the improved yolov7 algorithm and non-intrusiveness according to claim 1 is characterized in that: The step S2 specifically includes the following steps: S21. Obtain various types of charging load images and analyze and process them to obtain an image data set, wherein the obtained charging load images include all existing types of charging loads, normal charging load graphics and charging load graphics under thermal refraction, and key features of the charging loads, including appearance, logo, and license plate; S22. Label the data set and divide it into two categories, training set and test set, according to the set ratio. The labeling content includes charging load type, brand, and model. Numbers and letters are used to distinguish the labels. S23, training and debugging the charging load recognition model of the improved yolov7 algorithm through the data set to obtain the optimal detection model; S24. Perform multiple graphic detection and recognition at equal time periods on the real-time charging load images collected on-site at the charging station through the optimal model, and obtain the model and power data of the specific charging load by comparative analysis and discrimination. Specifically, for the real-time charging load images under thermal refraction, before recognition, the temperature field and refractive index field are established according to the temperature data, and the distorted parts of the real-time charging load images are reconstructed using the auxiliary optical flow method.
4. The method for identifying the type and status of charging facilities based on the improved yolov7 algorithm and non-intrusiveness according to claim 3 is characterized in that: In step 24, for the real-time charging load image under thermal refraction, the temperature field and refractive index field are established according to the temperature data before recognition to reconstruct the distorted part of the real-time charging load image by auxiliary optical flow method, which specifically includes the following steps: S241. Use a temperature acquisition device to fully utilize temperature data to assist the optical flow method in calculation and establish a temperature field: T(x,y)=(x+Δx,y+Δy) Among them, T is the temperature intensity of a specific frame, x, y are the image pixel coordinates, Δx, Δy represent the displacement; The refractive index field can be obtained from the temperature field and the relationship between the refractive index and temperature: n(x,y)=jP / T(x,y)+1 Where n is the refractive index and j is a constant of 7.9×10 -5 , P is the atmospheric pressure; S242, optical flow calculation, where light intensity is defined as: I(x,y,t)=(x+Δx,y+Δy,t+Δt) I represents the corresponding frame light intensity, and t is a certain moment; After Taylor expansion, ignoring the second-order and higher derivatives, the derivative of the above formula with respect to time can be obtained: Among them, u and v are the differentials of x and y with respect to t respectively; S243. Since the number of formulas obtained is less than the unknown quantity, the Horn-Schunck algorithm is used to solve iteratively: considering that the optical flow of adjacent points in the image changes smoothly, the objective function is to minimize the optical flow error of the entire image: min∑[(I x u+I y v+I t ) 2 ] Among them, I x ,I y are the partial derivatives of light intensity with respect to x and y, respectively, I t is the derivative of light intensity with respect to time; The light speed gradient change is added to the optical flow error to obtain the energy function E(u,v), and the optimization is achieved by solving the minimum value of the energy function: Among them, β is the term that controls the global smoothness, ▽ 2 u、▽ 2 v is the sum of the quadratic partial derivatives of u and v with respect to x and y respectively; S244. In the optical flow calculation, the refractive index is introduced into the constraints of the optical flow method, the weight of the smoothness term of the optical flow field is dynamically adjusted, the correction effect is improved in the area with large refractive index gradient, and the smoothness term and the refractive index are associated with the formula: β(x,y)=β o +k|▽n(x,y)| Among them, β o is the basic smoothness term, k is the refractive index gradient influence coefficient, and ▽n(x,y) is the refractive index gradient; S245. The energy function E(u,v) is differentiated with respect to u and v respectively, and the two partial derivatives are set to zero to obtain the iterative equation: in, are the weighted averages of u and v approximating the neighborhood averages of the coordinates (x, y), are the optical flows solved in the current iteration respectively; S246, assuming that the initial values of the optical flow fields u and v are both 0, solving the equation iteratively until convergence, and obtaining the u and v values for reconstructing the distorted part of the image; S247, obtaining a distorted image of the real-time charging load under thermal refraction, the light intensity of which is I t+1 (x, y) is known, let its previous image be I t (x', y'), by solving the obtained u, v values, integrate them to obtain the original image intensity data: Realize the reconstruction of the distorted parts of the real-time charging load image.
5. The method for identifying the type and status of charging facilities based on the improved yolov7 algorithm and non-intrusiveness according to claim 1 is characterized in that: The step S4 specifically comprises the following steps: S41. Collect daily load data of various types of charging load data, where the charging load data includes current, voltage, charging time, and charging mode; S42, preprocessing the collected daily load data, including data cleaning, missing value processing, outlier detection and processing, and using edge detection algorithm for event detection to analyze the operating status of the charging load; S43, extracting feature vectors that can characterize the load characteristics of the charging station, including power peak, power average, charging time, etc., and dividing the extracted feature vectors into a training set, a validation set, and a test set, which are responsible for model learning, parameter adjustment, and performance evaluation, respectively; S44, using a machine learning algorithm to train the extracted feature vectors, construct a load identification model, optimize the model performance by adjusting model parameters and changing the model structure, and obtain the optimal model; S45. Collect and upload relevant data to the control center through on-site charging equipment sensors, use the optimal model to process the processed data, identify the charging load state, and obtain a load identification result.
6. The method for identifying the type and status of charging facilities based on the improved YOLOv7 algorithm and non-intrusiveness according to claim 5 is characterized in that: In step S42, an edge detection algorithm is used to perform event detection to analyze the operating status of the charging load, including: normal state access charging, fast charging state, slow charging state, balanced charging, charging completion, and charging time; abnormal and illegal state charging failures, unauthorized charging, and charging interruptions caused by human factors or failures.
7. The method for identifying the type and status of charging facilities based on the improved yolov7 algorithm and non-intrusiveness according to claim 5 is characterized in that: In step S43, the characteristic vector is mainly based on transient characteristics and supplemented by steady-state characteristics. The transient characteristics and steady-state characteristics are combined to perform load identification. The steady-state characteristics include: harmonic current and voltage amplitude, phase, frequency, VI trajectory diagram; the transient characteristics include: current pulse peak value, transient process duration.
8. The method for identifying the type and status of charging facilities based on the improved yolov7 algorithm and non-intrusiveness according to claim 7 is characterized in that: In step S43, extracting a feature vector capable of characterizing the load characteristics of the charging station specifically includes the following steps: S431, Harmonic feature extraction: collect data for fast Fourier transform to obtain harmonic components in the frequency domain: Where i(n) is the current signal at the nth moment, I(f) is the current signal in the frequency domain, and N is the number of sampling points; S432, calculate the total harmonic distortion THD: Among them, I n is the current component of the nth harmonic, and I1 is the current component of the fundamental wave; S433, extracting feature vector H: H=[I2,I3,I4,...,I n ]; S434, current pulse peak extraction: Find local maxima: i peak =max(i filt (t)), Among them, i filt is the current after standardization; Calculate the crest factor: c f =i peak / i rms Among them, C f is the peak factor, i rms is a valid value; Construct the feature vector P: P=[i peak1 ,c f1 ,i peak2 ,c f2 ...,i peakn ,c fn ,]。 9. The method for identifying the type and status of charging facilities based on the improved yolov7 algorithm and non-intrusiveness according to claim 1 is characterized in that: The step S5 specifically includes the following steps: S51. Compare the two charging load type detection results identified by the image and data in the monitoring center, and determine whether there is a contradiction. If an abnormal result occurs, upload the total data to the operation and maintenance management office and issue a warning.
10. A non-intrusive charging facility type and status identification device based on an improved yolov7 algorithm, characterized in that: include: The algorithm improvement module is used to improve the yolov7 algorithm, including: introducing the SE attention mechanism, adding the SE module after the SPPCSPC in the Head network and at the split point between the Backbone network and the Head network, that is, the 54th and 66th layers; using the QFL function as the loss function of the yolov7 algorithm; improving the ELAN module and introducing the reparameterized convolution; then replacing the final Detect module of the Head network with the IDetect module, and adding the Implicit A containing the movie vector, which performs an addition operation with the input feature; the Implicit M performs a multiplication operation; The charging load information detection module is used to use the improved yolov7 algorithm to perform model training, obtain the optimal detection model, and use the optimal detection model to identify the real-time charging load images under normal conditions and thermal refraction collected at the charging station to complete the detection of the charging load information. For the real-time charging load image under thermal refraction, before identification, the temperature field and refractive index field are established according to the temperature data to assist the optical flow method to reconstruct the distorted parts of the real-time charging load image; Transmission module, used to transmit the test results to the monitoring center and enter the charging load identification; The real-time load identification module is used to collect and process charging load data, train load identification models, collect real-time charging load data, and use the optimal model for real-time load identification; The analysis and feedback module is used to analyze and compare the charging load type identified by the image and data, and provide feedback on the signal.