A mixed-precision quantization method for single-phase ground fault line selection

By using channel-level quantization sensitivity assessment and hybrid precision bit width allocation, combined with reinforcement learning optimization, the problem of high resource consumption and severe accuracy loss in single-phase grounding fault phase selection models in edge devices is solved, achieving lightweight and efficient fault phase selection, which is suitable for 10kV/35kV distribution network edge devices.

CN121144764BActive Publication Date: 2026-02-24NANJING YUEYUAN ELECTRIC POWER RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511684586.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-17
Publication Date
2026-02-24
Estimated Expiration
2045-11-17

AI Technical Summary

Technical Problem

Existing deep learning-based single-phase grounding fault phase selection models suffer from problems such as large model size, high resource consumption, coarse quantization strategy, severe accuracy loss, poor generalization ability, and insufficient deployment stability when deployed in edge devices, and cannot meet the requirements of real-time performance and accuracy.

Method used

We employ a channel-level quantization sensitivity assessment, hybrid precision bit width allocation, and reinforcement learning approach. By constructing a fault line selection dataset and combining channel masks with random vectors to assess quantization sensitivity, we optimize bit width allocation using Actor-Critic reinforcement learning and insert quantization-aware training nodes to ensure the accuracy and efficiency of the model running on edge devices.

Benefits of technology

It achieves a model compression ratio of ≥4 times, an accuracy decrease of ≤3%, and an inference time of ≤200ms, adapting to complex working conditions, improving the accuracy and stability of fault phase selection, and meeting the real-time and reliability requirements of edge devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121144764B_ABST
    Figure CN121144764B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of power system relay protection, and especially to a mixed precision quantization method for single-phase ground fault line selection, comprising the following steps: S1, fault line selection data set preparation and basic model training; S2, channel level sensitivity evaluation; S3, channel sensitivity grading and prior construction; S4, mixed precision bit width proportion sequential search; S5, actor-critic reinforcement learning based bit width allocation; and S6, quantization perception training and parameter updating. The mixed precision quantization method for single-phase ground fault line selection realizes the target of "precision loss ≤ 3%, compression ratio ≥ 4 times, and inference time ≤ 200 ms" of the fault phase selection model through the design of "unbalanced sample enhancement-channel level sensitivity evaluation-reinforcement learning bit width allocation-quantization perception training-deployment adaptation verification", meets the real-time deployment needs of the power distribution network edge device, and improves the accuracy and timeliness of single-phase ground fault phase selection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of power system relay protection, and particularly relates to a hybrid precision quantization method for single-phase grounding fault line selection. BACKGROUND

[0002] In the operation of medium and low voltage distribution networks, single-phase grounding faults account for more than 70% of all fault types. Accurate and rapid fault phase selection is a key prerequisite for isolating fault areas and restoring power supply in non-fault areas. With the application of AI technology in power systems, deep learning-based fault phase selection models have become mainstream due to their high accuracy (usually ≥95%). However, such models have the following core defects, which restrict their deployment on edge devices:

[0003] 1. Large model size and high resource occupation: Traditional AI models have many 32-bit floating-point numbers (FP32) as parameters, and the size of a single fault phase selection model often reaches tens of MB or even hundreds of MB. However, the memory of edge devices in distribution networks (such as on-site terminals) is generally ≤512MB, and the storage resources cannot be supported. At the same time, 32-bit operations require high CPU computing power for edge devices, with a reasoning time ≥500ms, which cannot meet the real-time requirement of fault phase selection ≤200ms.

[0004] 2. Rough quantization strategy and severe precision loss: Existing quantization methods mostly use fixed quantization bit numbers (such as 8-bit, 4-bit) for quantization, without considering the sensitivity differences of different channels to quantization — some layers or channels in the network are exceptionally sensitive to quantization operations, while others are relatively insensitive. With the reduction of quantization bit width, the quantization error of the model will significantly increase, leading to a significant decline in model performance, especially in deep networks.

[0005] 3. Sample imbalance leads to poor model generalization ability: In single-phase grounding faults of distribution networks, the number of abnormal samples and normal samples differs significantly, and the number of samples of different fault types such as metallic grounding, high-resistance grounding, and arc grounding differs significantly (e.g., high-resistance grounding samples are only 1 / 3 of metallic grounding samples). Directly training the model can easily lead to overfitting problems “biased towards the majority class”, and the generalization ability further decreases after quantization, with an accuracy rate of less than 80% in rare fault types.

[0006] 4. Bit width allocation relies on manual intervention, resulting in low efficiency and insufficient optimization: Existing mixed-precision quantization methods mostly determine the bit width ratio manually through trial and error (e.g., "2-bit accounts for 20%, 4-bit accounts for 30%, and 8-bit accounts for 50%), requiring repeated testing of 10 to 20 schemes, which can take several days; moreover, manual decision-making makes it difficult to balance "accuracy, resources, and real-time performance", which can easily lead to problems such as "accuracy meets the standard but resources are over budget" or "resources meet the standard but accuracy is insufficient".

[0007] 5. Lack of system verification before deployment and insufficient stability: Before the quantization model is directly deployed to the edge device, it is not adapted, optimized and batch tested for hardware platforms (such as CPU architectures of different manufacturers). In actual operation, due to computing power mismatch and inference code compatibility issues, the response time may fluctuate (such as from 150ms to 800ms) or crash occasionally, affecting the reliability of fault selection.

[0008] To address the above problems, this invention proposes a hybrid precision quantization method for single-phase grounding fault location. Summary of the Invention

[0009] The main objective of this invention is to provide a hybrid precision quantization method for single-phase grounding fault location, which can effectively solve the problems in the background art.

[0010] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0011] A hybrid precision quantization method for single-phase ground fault location includes the following steps:

[0012] Step S1: Preparation of fault selection dataset and training of basic model:

[0013] Collect and organize single-phase grounding fault data from the distribution network to construct a fault line selection dataset; for categories with insufficient samples, enhance the data by time shifting (offset along the time axis ±5%~10%) and superimposing 20dB Gaussian noise.

[0014] Based on the enhanced dataset, and combined with the pre-trained model using historical datasets of the power distribution network, a base model with better accuracy (accuracy on the model test set ≥ 95%) is obtained, which serves as the benchmark for mixed accuracy quantization.

[0015] Step S2, Channel-level Quantization Sensitivity Assessment:

[0016] By combining channel masks and random vectors, the quantization sensitivity analysis is refined to the model channel level: a binary mask vector is constructed for the j-th channel. The element in the j-th channel is 1, and the elements in the other channels are 0; the random vector Element-wise multiplication with mask, get mask random vector containing only the j-th channel information And based on this vector, estimate the Trace value of Hessian matrix using Hutchinson method to evaluate the quantization sensitivity of this channel;

[0017] For the target matrix (Hessian matrix of the model) H, use random vector to estimate Trace, respectively calculate the sensitivity of convolution channel and activation channel, the formula is as follows:

[0018] Convolution channel sensitivity:

[0019] ;

[0020] Activation channel sensitivity:

[0021] ;

[0022] Where, is the number of iterations, represents the input sample, and respectively represent the convolution channel and the activation channel Hessian matrix;

[0023] Step S3, channel sensitivity ranking and prior construction:

[0024] Sort all channels in descending order of Trace value;

[0025] According to the distribution of Trace value, divide the channels into several sensitivity groups, and generate the corresponding ranking list and grouped channel set as the prior basis for bit width allocation;

[0026] Step S4, mixed precision bit width proportional sequential search:

[0027] Determine the bit width candidate set (2-bit, 3-bit, 4-bit, 5-bit, 6-bit, 7-bit, 8-bit), and constrain the sum of bit width proportions of all channels to be 100%;

[0028] Sequential search from low to high sensitivity: prefer to search for 2-bit quantization channel proportion in low sensitivity channels, then search for 3-bit quantization proportion in the remaining channels, and so on. The remaining channels not covered by lower bit width are quantized to 8-bit;

[0029] Step S5, bit width allocation based on actor-critic reinforcement learning:

[0030] An Actor-Critic reinforcement learning model is constructed, and the state space is composed of a 5-dimensional feature vector: channel index, remaining parameter quantity, bit precision range start position, bit precision range end position, and last step actor network action.

[0031] The actor network selects the bit precision allocation strategy for the channel according to the current state, and the critic network evaluates the value of the strategy for model accuracy and resource consumption; through iterative training, the strategy is updated to achieve the optimal trade-off between accuracy and resources.

[0032] Step S6, quantization-aware training and parameter update:

[0033] According to the bit width allocation table obtained in step 5, a quantization-aware training model is constructed, and a fake-quant node is inserted into the computation graph of the model to simulate quantization and dequantization operations during forward propagation, thereby capturing the influence of quantization error during the training phase.

[0034] Using quantization-aware training, the model is trained based on the enhanced fault line selection dataset, and the parameters of the quantized model are updated to reduce quantization error.

[0035] Step S7, model performance evaluation and iteration judgment:

[0036] Calculate the key indicators of the quantized model: test set accuracy (precision), model compression ratio (original model size / quantized model size), and model storage size.

[0037] If the indicators meet the preset target (such as precision drop ≤ 3%, compression ratio ≥ 4 times, and model size ≤ target edge device memory limit), optimization is terminated; otherwise, return to step 5 to adjust the reinforcement learning strategy and continue iteration.

[0038] Step S8, quantized model verification and deployment adaptation:

[0039] Using the validation set of the fault line selection dataset, test the final quantized model's discrimination accuracy and response time on typical single-phase ground fault samples (such as high-resistance ground fault and arc light ground fault).

[0040] According to the computing power (CPU frequency ≥ 1GHz), memory (RAM ≥ 512MB), and real-time requirements (response time ≤ 100ms) of the target edge device (such as power distribution network edge gateway), generate hardware platform optimized inference code.

[0041] Step S9, offline inference test and deployment:

[0042] Batch offline inference test is performed on the optimized inference code to verify the stability of the model under different fault scenarios (no abnormality for 1000 consecutive inferences).

[0043] The quantitative model passing the test is deployed to the edge device to realize real-time line selection discrimination of single-phase ground fault.

[0044] Preferably, in step S1, the offset range of time shift is ±5% to 10%, and 20dB size of Gaussian white noise is superimposed on the noise to ensure that the enhanced data still conforms to the physical characteristics of the power distribution network fault data.

[0045] Preferably, in step S2, the dimension of the binary mask vector is consistent with the number of model channels, only the mask value corresponding to the jth channel is 1, and the rest is 0; the random vector obeys the standard normal distribution (mean 0, variance 1), and the number of iterations is 20 to 50, balancing the calculation accuracy and efficiency.

[0046] Preferably, in step S3, the preset threshold of sensitivity grouping can be adjusted according to the numerical distribution of the model channel sensitivity: in a convolutional neural network (CNN) model, if the channel sensitivity distribution is relatively uniform, the proportion of high-sensitivity channels can be set to 25% to 35%, the proportion of medium-sensitivity channels can be set to 40% to 50%, and the proportion of low-sensitivity channels can be set to 25% to 30%.

[0047] Preferably, in step S4, the initial step of bit width ratio search is set to 5% to 10%, for example, the first search range of 2-bit quantization ratio is 0% to 30% (step 5%), and the step is reduced to 2% to 5% according to the search result of the previous round to improve the search accuracy.

[0048] Preferably, in step S6, the batch size of quantization-aware training is set to 128, and the replay buffer is set to 600. During network learning, first, 50 episodes of exploration training are performed, and a constant noise of 0.5 is used for auxiliary learning, and then in the subsequent 600 episode rounds, an exponentially decaying noise is used to let the model learn the actual knowledge.

[0049] Preferably, in step S7, the acceptable range of accuracy reduction is adjusted according to the fault line selection scene: in the fault line selection of the main line of the power distribution network, the accuracy reduction is ≤2%; in the fault line selection of the branch line, the accuracy reduction is ≤3%; the target model compression ratio is 4 to 8 times, which is suitable for the storage limit of the edge device.

[0050] Preferably, in step S8, the typical single-phase ground fault samples cover: high-resistance grounding (grounding resistance 10 to 100Ω), arc grounding (arc time 0.1 to 0.5s), and metallic grounding (grounding resistance ≤1Ω), and the number of samples of each fault type is ≥500, ensuring the comprehensiveness of the verification.

[0051] Preferably, the sample size for the batch offline inference test in step S9 is 1000~2000 records, the test environment is consistent with the edge device (such as CPU model, operating system version), and the response time test is taken as the average of multiple inferences to ensure that the real-time requirements (≤100ms) are met.

[0052] Compared with the prior art, the present invention has the following beneficial effects:

[0053] 1. Low accuracy loss and high phase selection reliability: Through channel-level sensitivity assessment and quantitative perception training, the accuracy of the model decreases by ≤3% after quantization, and the phase selection accuracy of various fault types is ≥92%, avoiding misjudgment caused by quantization and ensuring the accuracy of fault isolation in the distribution network.

[0054] 2. The model is significantly lightweight and has low resource consumption: Hybrid precision quantization makes the model compression ratio ≥4 times (e.g., a 32MB base model is ≤8MB after quantization), which is suitable for edge devices with a memory limit of ≤512MB; the inference time is ≤200ms, which meets the real-time requirements of fault phase selection.

[0055] 3. Reduced manual intervention and high optimization efficiency: Based on the reinforcement learning-based bit width allocation strategy, the "sensitivity-bit width" mapping is automatically completed without manual trial and error, reducing optimization time from several days to several hours and improving quantization efficiency.

[0056] 4. Strong generalization ability and adaptability to complex operating conditions: Through time shifting and noise superposition sample enhancement, the accuracy of the model fluctuates by ≤5% under different fault types (high resistance, arc grounding) and different operating conditions (load rate, fault distance), adapting to the complex operating environment of the distribution network.

[0057] 5. High deployment stability and strong engineering practicality: Hardware adaptation and batch offline testing for edge devices ensure that the average response time after model deployment is stable at ≤200ms, and there are no anomalies after 1000 consecutive inferences, meeting the reliability requirements of engineering applications. Attached Figure Description

[0058] Fig. 1 This is a flowchart of the overall method of the hybrid precision quantization method for single-phase grounding fault location according to the present invention.

[0059] Fig. 2 This is a flowchart illustrating the sensitivity evaluation of a hybrid precision quantization method for single-phase grounding fault location according to the present invention.

[0060] Fig. 3 This is a flowchart illustrating the bit width allocation of a hybrid precision quantization method for single-phase grounding fault location according to the present invention. Detailed Implementation

[0061] To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0062] like Figs. 1-3 As shown, a hybrid precision quantization method for single-phase ground fault location specifically includes the following steps:

[0063] Step S1: Preparation of fault phase selection dataset and training of basic model

[0064] Dataset Construction and Augmentation:

[0065] 1. Collect single-phase grounding fault data of distribution network: Obtain voltage and current waveform data of different fault types (metallic grounding, high-resistance grounding 10~100Ω, arcing grounding 0.1~0.5s arcing) and different operating conditions (load rate 30%~100%, fault distance 0.5~10km) through distribution network SCADA system and fault recorder, with sampling frequency of 2kHz~5kHz and each sample duration of 0.2s~0.5s, to construct initial fault phase selection dataset;

[0066] 2. Imbalanced Sample Augmentation: For categories with a sample size less than 15% of the total sample (such as high-resistance grounding), two augmentation methods are used:

[0067] Time shift: The waveform data is shifted by ±5%~10% along the time axis (e.g., a 0.2s sample is shifted to 0.19s~0.21s) to simulate the small differences in the timing of the fault occurrence;

[0068] Noise superposition: Add 20dB of Gaussian noise to simulate electromagnetic interference in actual operation of the power distribution network and enhance the model's anti-interference capability;

[0069] 3. Dataset partitioning: The dataset is divided into training, validation, and test sets in a 7:2:1 ratio to ensure that the distribution of each fault type is consistent across the three sets (e.g., high-resistance grounding accounts for 12% in each of the training, validation, and test sets).

[0070] Basic model pre-training and optimization:

[0071] 1. Select an AI model architecture suitable for fault phase selection (such as a CNN-based fault feature extraction model).

[0072] 2. Pre-training was performed using a historical fault dataset of the power distribution network (containing 100,000+ normal and fault data points) to initialize model parameters and reduce training difficulty;

[0073] 3. Based on the enhanced fault phase selection training set, the Adam optimizer (learning rate 1e-4~5e-4) is used to train the model for 50~100 training rounds with batch size of 32~64 until the model achieves a phase selection accuracy of ≥95% on the validation set, thus obtaining a basic model with better accuracy, which serves as the benchmark for mixed accuracy quantization.

[0074] Step S2: Channel-level quantization sensitivity assessment

[0075] Channel masking and random vector processing:

[0076] 1. For each channel of the base model (including convolutional channels and activation channels), construct a binary mask vector: the dimension of the mask vector is consistent with the total number of channels in the model, only the mask value corresponding to the j-th channel to be evaluated is 1, and the mask value of the other channels is 0, to ensure that only a single channel participates in the sensitivity calculation;

[0077] Generate random vectors : Follows a standard normal distribution (mean 0, variance 1), and its dimension matches the parameter dimension of the j-th channel; The binary mask vector constructed in step 1 is used to... Perform a masking operation to obtain a masked random vector that retains only the information of the k-th channel.

[0078] Hessian matrix trace value estimation:

[0079] 1. Principle: The Trace value of the Hessian matrix reflects the degree of influence of the parameters on the model's loss function. The larger the Trace value, the more significant the influence of the parameters on the model's accuracy (i.e., the higher the quantization sensitivity), and a higher bit width needs to be allocated; conversely, the sensitivity is low, and a lower bit width can be allocated.

[0080] 2. Calculation Method: The Hutchinson random trace estimation method is used, iterating m times (m=20~50 times, balancing accuracy and efficiency) to calculate the trace values ​​of the convolutional and activation channels respectively, as shown in the following formula:

[0081] Convolutional channel sensitivity: ;

[0082] Activation channel sensitivity: ;

[0083] in, It is the number of iterations. and These represent the Hessian matrices of the convolutional and activation channels, respectively. Channel-based quantization allows for more precise adjustment of the parameters for each channel, avoiding coarse estimation of the entire layer.

[0084] Results storage: Record the Trace value of each channel to form a "channel index - Trace value" correspondence table.

[0085] Step S3: Channel sensitivity grading and prior channel sorting: Sort all channels in descending order of Trace value—the earlier the channel is sorted, the higher its quantization sensitivity and the greater its impact on accuracy; the later the channel is sorted, the lower its sensitivity, and lower bit width quantization can be tried first.

[0086] Sensitivity grouping: Based on the trace value distribution or a preset threshold, divide the channel into 3-4 sensitivity groups (taking 3 groups as an example) when the channel sensitivity distribution is relatively uniform:

[0087] 1. High-sensitivity group: The top 25%~35% of trace values ​​(e.g., the top 30% for CNN models). These channels have a significant impact on accuracy. Label these channels to indicate that they can be allocated ≥6-bit widths.

[0088] 2. Medium-sensitive group: The middle 40% to 50% of the Trace values ​​(e.g., the middle 40% for CNN models) are used to label this batch of channels, indicating that they can be allocated 4 to 6 bits of width;

[0089] 3. Low-sensitivity group: The last 25% to 30% of the trace values ​​(e.g., the last 30% for CNN models) have little impact on accuracy. Label these channels to indicate that they can be allocated 2 to 4 bits of width.

[0090] Prior generation: Generate a "channel sorting table" and a "sensitivity grouping table" to clarify the sensitivity level of each channel, which serves as prior knowledge for subsequent bit width ratio search and reinforcement learning decisions, avoiding unfounded random searches.

[0091] Step S4: Mixed precision bit width ratio sequential search (layered search by sensitivity, balancing precision and resources)

[0092] Bit width candidate set determination: Based on the computing power and accuracy requirements of the distribution network edge equipment, the bit width candidate set is determined to be {2-bit, 3-bit, 4-bit, 5-bit, 6-bit, 7-bit, 8-bit}, where 8-bit is the reference bit width (to ensure the minimum accuracy baseline).

[0093] Sequential search strategy (gradually locking in the proportion from low sensitivity to high sensitivity):

[0094] 1. Initial constraint: The total bit width ratio of all channels is 100% (e.g., 2-bit accounts for a%, 3-bit accounts for b%, ..., 8-bit accounts for g%, a+b+...+g=100);

[0095] 2. Low-sensitivity channel search: Prioritize searching for the proportion of 2-bit quantized channels in the low-sensitivity group (the bottom 30% of the trace value), with a search range of 0%~30% and a step size of 5%~10% (e.g., first test 2-bit channels accounting for 10%, 20%, and 30%), and evaluate the model accuracy and resource consumption (model size, inference time) under different proportions.

[0096] 3. Medium-sensitive channel search: After excluding the channels that have been allocated 2-bit, the medium-sensitive group (the middle 40%) is screened from the remaining channels. The quantization ratios of 3-bit and 4-bit are searched with a step size of 5%. The accuracy and resources are evaluated in the same way.

[0097] 4. High-sensitivity channel and reference bit width allocation: Among the remaining channels, the high-sensitivity group (first 30%) is preferentially allocated 6~7 bits, and the channels not covered by the lower bit width are uniformly quantized to 8 bits (reference bit width).

[0098] Intermediate results record: Record the bit width ratio, corresponding model accuracy (validation set accuracy), model size, and inference time for each round of search, forming a preliminary "ratio-performance" mapping table.

[0099] Step 5: Bit width allocation based on Actor-Critic reinforcement learning

[0100] Reinforcement learning model construction:

[0101] 1. State Space (5-dimensional feature vector): Defines the state at each decision time step, ensuring it contains key decision information:

[0102] Channel Index: The position of the channel currently being allocated bit width in the "Channel Sort Table" (e.g., the 10th channel);

[0103] Number of remaining parameters: The total number of model parameters that still need to be allocated bit width (unit: MB);

[0104] Bit precision range starting position: the lowest allocatable bit width index of the sensitivity group to which the channel belongs (e.g., if the starting bit width of the low sensitivity group is 2-bit, the index is 0).

[0105] End position of bit precision range: The index of the highest allocatable bit width corresponding to the sensitivity group of this channel (e.g., the end bit width of the low sensitivity group is 4-bit, and the index is 2).

[0106] Previous actor network motion: The bit width allocation result of the previous channel (e.g., 2-bit) to avoid excessive fluctuations in bit width between adjacent channels;

[0107] 2. Motion Space: The action of the actor network is "select bit width for the current channel". The selectable values ​​are the candidate bit widths corresponding to the sensitivity group of the channel (e.g., 2-bit, 3-bit, 4-bit can be selected for the low sensitivity group).

[0108] Model training and policy optimization:

[0109] 1. Initialization: Parameters for the actor network (using a 2-layer fully connected network) and the critic network (same structure as the actor network);

[0110] 2. Iterative training:

[0111] Actor Network: Selects a bit width allocation action based on the current state and generates a bit width allocation table;

[0112] Critics Network: Based on the current state and action, predict the reward value corresponding to the action (i.e., the value of accuracy-resource trade-off).

[0113] Loss Calculation: The commentator network loss is calculated using temporal difference (TD) error, and the actor network loss is calculated using the policy gradient method.

[0114] Parameter update: Update the parameters of the two networks through backpropagation, iterating 100-200 times until the reward value converges (the reward fluctuation in adjacent 10 iterations is ≤2%).

[0115] 3. Optimal Strategy Output: After training, the actor network can output the optimal bit width allocation based on the state of any channel, forming the final "channel-bit width" mapping table.

[0116] Step S6: Quantization-based perceptual training and parameter update

[0117] Quantization node insertion: Based on the “channel-bit width” mapping table obtained in step 5, a fake-quant node is inserted into the computation graph of the model to simulate quantization and dequantization operations during forward propagation, thereby capturing the impact of quantization error during the training phase;

[0118] Quantitative perception training:

[0119] 1. Training parameter settings: The network is trained using a batch size of 128 and a replay buffer of 600. During the network learning process, exploratory training is first performed for 50 episodes using constant noise of 0.5 to aid learning. Then, exponentially decaying noise is used in the subsequent 600 episodes to allow the model to learn actual knowledge.

[0120] 2. Parameter update: The parameters of the quantized model are updated through backpropagation, so that the model can adapt to the accuracy loss caused by quantization and improve the generalization ability of the quantized model.

[0121] Step S7: Model Performance Evaluation and Iteration Judgment

[0122] Key performance indicator calculation:

[0123] 1. Accuracy indicators: Phase selection accuracy of the test set (statistics by fault type, such as accuracy of metallic grounding and high-resistance grounding), accuracy degradation rate ((accuracy of basic model - accuracy of quantization model) / accuracy of basic model × 100%).

[0124] 2. Resource metrics: Model compression ratio (base model size / quantized model size), model storage size (unit: MB);

[0125] 3. Real-time performance metrics: Test inference time (the time taken for a single inference from input data to output phase selection result) on an edge device simulator (such as an ARM-based simulation environment).

[0126] Iterative judgment logic:

[0127] 1. If the metrics meet the preset targets (e.g., accuracy decrease ≤3%, compression ratio ≥4 times, model size ≤20MB, inference time ≤200ms), then terminate the optimization and save the final quantized model;

[0128] 2. If the objective is not met:

[0129] If resources are exceeded (compression ratio < 4x or inference time > 200ms): return to step 5, adjust the β coefficient of the reinforcement learning reward function (e.g., increase from 0.2 to 0.4), increase resource weights, and retrain the bit width allocation strategy;

[0130] 3. Iteration limit: A maximum of 5 iterations are allowed to avoid infinite loops. If the target is not met after 5 iterations, the basic model architecture needs to be re-evaluated (e.g., a lighter model should be used instead).

[0131] Step S8: Quantitative Model Validation and Deployment Adaptation

[0132] Multi-scenario verification:

[0133] 1. Fault type verification: Using typical fault samples from the test set (metallic grounding ≤1Ω, high-resistance grounding 10~100Ω, arcing grounding 0.1~0.5s), the phase selection accuracy of the quantitative model is tested, requiring an accuracy of ≥92% for each fault type;

[0134] 2. Robustness verification under operating conditions: Simulate different load rates (30%, 50%, 80%, 100%) and different fault distances (0.5km, 5km, 10km) of the distribution network, test the accuracy fluctuation of the model, and require the fluctuation range to be ≤5%.

[0135] Edge device adaptation:

[0136] 1. Hardware Information Acquisition: Collect hardware parameters of the target edge device (such as the distribution network terminal DTU): CPU architecture (ARM Cortex-A72, x86, etc.), computing power (DMIPS value), memory size (RAM), and storage medium (Flash);

[0137] 2. Inference code optimization: Based on hardware parameters, model conversion tools (such as TensorRT, ONNXRuntime) are used to convert the quantized model into a hardware-compatible inference format (such as TensorRT Engine, ONNX), and operator fusion (such as merging "convolution + activation" into a single operator) and memory reuse optimization are performed to reduce inference time;

[0138] 3. Batch offline testing: On the target edge device, use 1000~2000 fault samples to perform batch offline inference, record the response time and accuracy of each inference, and require an average response time ≤200ms, and no crashes or sudden drops in accuracy for 1000 consecutive inferences (single accuracy ≥90%).

[0139] Step S9: Quantitative Model Deployment and Operation Monitoring

[0140] Model Deployment: Deploy the optimized inference code and quantization model to edge devices, and configure data input interfaces (connecting to the real-time data stream of the SCADA system or fault recorder) and result output interfaces (connecting to the power distribution network dispatching system or local tripping device).

[0141] Operation monitoring:

[0142] 1. Real-time monitoring: Deploy a monitoring module on edge devices to collect real-time data on model inference time, phase selection accuracy, and resource utilization (CPU utilization, memory utilization). Trigger alarms when the following anomalies occur:

[0143] Inference time > 300ms (ultra-real-time threshold);

[0144] The accuracy rate of phase selection is less than 90% for 5 consecutive tests.

[0145] CPU utilization > 80% or memory utilization > 90%;

[0146] 2. Log recording: Save the model operation log (including the time of failure, the type of failure, the phase selection result, and the inference time) to facilitate subsequent failure analysis and model iteration optimization.

[0147] In summary, this invention provides a hybrid precision quantization method for single-phase grounding fault location. This method includes: constructing and enhancing a fault location dataset; training a base model; estimating the Hessian matrix trace values ​​of each channel using channel masks and the Hutchinson method, and quantizing sensitivity in stages; sequentially searching for bit width ratios and allocating bit widths using Actor-Critic reinforcement learning; inserting fake-quant nodes for quantization-aware training; evaluating performance and iteratively optimizing; and adapting to edge devices and deploying monitoring. This invention solves the problems of high precision loss and high resource consumption in traditional quantization methods, achieving a model compression ratio ≥4 times, precision decrease ≤3%, and inference time ≤200ms. It is applicable to edge devices in 10kV / 35kV distribution networks, improving the accuracy and real-time performance of single-phase grounding fault location.

[0148] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.

Claims

1. A hybrid precision quantization method for single-phase ground fault location, characterized in that, Includes the following steps: Step S1: Preparation of fault selection dataset and training of basic model: Collect and organize single-phase grounding fault data from the distribution network to construct a fault line selection dataset; for categories with insufficient samples, time shifting and noise superposition are used to enhance the data. Based on the enhanced dataset, and combined with the pre-trained model using historical datasets of power distribution networks, a model with optimal overall performance under the conditions of accuracy preservation and parameter size constraints is obtained, which serves as the benchmark for hybrid precision quantization. Step S2, Channel-level Quantization Sensitivity Assessment: By combining channel masks and random vectors, the quantization sensitivity analysis is refined to the model channel level: a binary mask vector is constructed for the j-th channel. The element in the j-th channel is 1, and the elements in the other channels are 0; the random vector Multiplying the mask element-wise yields a masked random vector containing only information from the j-th channel. The trace value of the Hessian matrix is ​​estimated using the Hutchinson method based on this vector to evaluate the quantization sensitivity of the channel. For the Hessian matrix of the model, trace estimation is performed using random vectors, and the sensitivity of the convolutional and activation channels is calculated separately, as shown in the following formula: Convolutional channel sensitivity: Activation channel sensitivity: in, It is the number of iterations. Indicates the input sample. and These represent the Hessian matrices of the convolutional and activation channels, respectively. Step S3, Channel Sensitivity Grading and Prior Construction: Sort all channels in descending order of Trace value; Based on the Trace value distribution, the channel is divided into several sensitivity groups, and a corresponding sorted list and grouped channel set are generated as a priori basis for bit width allocation. Step S4, Mixed Precision Bit Width Ratio Sequential Search: Determine the candidate set of bit widths, including 2-bit, 3-bit, 4-bit, 5-bit, 6-bit, 7-bit, and 8-bit, and constrain the total bit width ratio of all channels to be 100%; The search proceeds sequentially from low to high sensitivity: first, the channel ratio quantized to 2-bit is searched in the low-sensitivity channels, then the channel ratio quantized to 3-bit is searched in the remaining channels, and so on. The remaining channels not covered by the lower bit width are quantized to 8-bit. Step S5: Bit width allocation based on actor-critic reinforcement learning: Construct an Actor-Critic reinforcement learning model, whose state space consists of 5-dimensional feature vectors: channel index, number of remaining parameters, start position of bit precision range, end position of bit precision range, and actor network action in the previous step; The actor network selects a bit precision allocation strategy for the channel based on the current state, and the critic network evaluates the value of this strategy in terms of model accuracy and resource consumption. Through iterative training, the strategy is updated to achieve the optimal trade-off between accuracy and resources. Step S6: Quantitative Perception Training and Parameter Update: Based on the bit width allocation table obtained in step S5, a quantization-aware training model is constructed. A fake-quant node is inserted into the computation graph of this model to simulate quantization and dequantization operations during forward propagation, thereby capturing the impact of quantization error during the training phase. A quantization-aware training method is adopted, which trains the model based on the enhanced fault selection dataset, updates the parameters of the quantized model, and reduces quantization error. Step S7, Model Performance Evaluation and Iteration Judgment: Key metrics for computational quantization models include: test set accuracy, model compression ratio, and model storage size. If the target is met, the optimization is terminated; otherwise, return to step S5 to adjust the reinforcement learning strategy and continue iterating. Step S8: Quantitative Model Validation and Deployment Adaptation: The validation set of the fault line selection dataset was used to test the discrimination accuracy and response time of the final quantization model on typical single-phase ground fault samples. Based on the computing power, memory, and real-time requirements of the target edge device, generate hardware platform-optimized inference code; Step S9, Offline Inference Testing and Deployment: Batch offline inference tests were conducted on the optimized inference code to verify the stability of the model under different fault scenarios. The tested quantitative model is deployed to edge devices to enable real-time fault location and identification for single-phase grounding faults.

2. The hybrid precision quantization method for single-phase grounding fault location according to claim 1, characterized in that: In step S1, the time shift offset range is ±5%~10%, and the Gaussian noise superposition magnitude is 20dB, ensuring that the enhanced data still conforms to the physical characteristics of distribution network fault data.

3. The hybrid precision quantization method for single-phase grounding fault location according to claim 1, characterized in that: In step S2, the dimension of the binary mask vector is the same as the number of model channels, with only the mask value corresponding to the j-th channel being 1, and the rest being 0; random vector Follows a standard normal distribution, number of iterations The value can be taken from 20 to 50 times.

4. The hybrid precision quantization method for single-phase grounding fault location according to claim 1, characterized in that: The preset threshold for sensitivity grouping in step S3 can be adjusted according to the model type: In the convolutional neural network (CNN) model, the channels are divided into mutually exclusive high-sensitivity groups, medium-sensitivity groups, and low-sensitivity groups according to the Trace value. The three groups total 100%, with the first 30% being the high-sensitivity group, the middle 40% being the medium-sensitivity group, and the last 30% being the low-sensitivity group.

5. A hybrid precision quantization method for single-phase grounding fault location according to claim 1, characterized in that: In step S4, the initial step size for the bit width ratio search is set to 5%~10%.

6. A hybrid precision quantization method for single-phase grounding fault location according to claim 1, characterized in that: The network was trained using a batch size of 128 and a replay buffer of 600. During the network learning process, exploratory training was first performed for 50 episodes, with constant noise of 0.5 used to assist learning. Then, exponentially decaying noise was used in the subsequent 600 episodes to allow the model to learn the actual knowledge.

7. A hybrid precision quantization method for single-phase grounding fault location according to claim 1, characterized in that: The acceptable range of accuracy reduction in step S7 is adjusted according to the fault selection scenario: accuracy reduction ≤2% in fault selection of main distribution network lines; accuracy reduction ≤3% in fault selection of branch lines; the model compression ratio target is set to 4~8 times to adapt to the storage limitations of edge devices.

8. A hybrid precision quantization method for single-phase grounding fault location according to claim 1, characterized in that: The typical single-phase grounding fault samples in step S8 cover: high-resistance grounding, arcing grounding, and metallic grounding. The number of verification samples for each fault type is ≥500 to ensure the comprehensiveness of the verification.

9. A hybrid precision quantization method for single-phase grounding fault location according to claim 1, characterized in that: In step S9, the sample size for batch offline inference testing is 1000-2000 records. The testing environment is consistent with that of the edge device. The response time is measured as the average of multiple inference tests under the same hardware environment to ensure that the real-time requirements are met.

Citation Information

Patent Citations

  • Online positioning method for distribution network single-phase fault

    CN106569096A

  • Power distribution network single-phase earth fault line selection method and system

    CN112180210A