Battery adaptive neural network dynamic pruning method and system, and electronic device
By using a sensitivity field-guided adaptive differential evolution algorithm and real-time resource monitoring, the neural network pruning threshold and quantization bit width are dynamically adjusted, solving the problem of efficient compression and adaptive deployment of neural networks on edge devices, and achieving efficient resource utilization and low-latency model updates.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-14
- Publication Date
- 2026-07-10
AI Technical Summary
Existing neural network pruning methods are difficult to achieve efficient compression and adaptive deployment on edge devices, resulting in high latency and high energy consumption. They cannot adapt to dynamic resource constraints and environmental uncertainties, and the pruning decisions lack adaptability, affecting model accuracy and real-time performance.
A sensitivity field-guided adaptive differential evolution algorithm is used for multi-objective optimization. Combined with real-time resource monitoring and reinforcement learning, the pruning threshold and quantization bit width are dynamically adjusted to form a cross-device distributed collaborative pruning and online update, thereby achieving efficient model compression and adaptive deployment.
While maintaining a model accuracy loss of less than 1%, it achieves an additional 15% to 20% improvement in compression ratio and reduces inference latency variance by more than 30% under load fluctuation scenarios, making it suitable for various embedded devices.
Smart Images

Figure CN122366564A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network optimization technology, and in particular to a method, system, and electronic device for dynamic pruning of battery adaptive neural networks based on sensitive field guidance. Background Technology
[0002] With the widespread application of artificial intelligence technology in edge computing scenarios, the lightweight deployment of neural network models has become a key bottleneck restricting system performance. Traditional neural network compression techniques (such as weight pruning, quantization, and knowledge distillation) are mostly designed for cloud or high-performance devices, and their static, offline processing mode is difficult to adapt to the dynamic resource constraints and environmental uncertainties of edge devices. Especially in battery management systems, large neural network models used for battery state estimation (such as SOC, SOH) and safety warnings (i.e., large battery models) have a large number of parameters and are computationally complex. Directly deploying them on embedded BMS with limited computing power will lead to high latency and high energy consumption, seriously affecting real-time performance and security.
[0003] Existing pruning methods generally include static threshold pruning and methods based on a single energy budget or pre-set pruning thresholds using offline data. Static threshold pruning uses the L2 norm or other fixed metrics to evaluate neuron importance, reducing model parameters after pruning. However, it lacks real-time feedback on the actual resource status of edge devices, often failing to achieve optimal results in heterogeneous and dynamically changing environments. While methods using pre-set pruning thresholds based on offline data can partially reduce memory and computational consumption, the pruning decisions lack adaptability, leading to significant loss of model accuracy and difficulty in handling scene changes.
[0004] Therefore, the above-mentioned pruning methods are too simplistic, lack sufficient coordination between quantification and pruning, and have poor robustness. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention proposes a battery adaptive neural network dynamic pruning method to solve the problems of simplistic pruning methods, insufficient coordination between quantization and pruning, and poor robustness. Through the above steps, this invention achieves efficient compression and adaptive deployment of large battery models at the edge, enabling complex battery state analysis models to run in real time on low-power, low-computing-power BMS chips.
[0006] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0007] In a first aspect, embodiments of the present invention provide a battery adaptive neural network dynamic pruning method, the method being implemented based on sensitivity field guidance, and the method comprising the following steps: Step S1: Perform offline pre-training and sensitivity assessment on the original neural network to generate a preliminary pruning candidate list; Step S2: Perform real-time resource monitoring and multi-objective optimization on the preliminary pruning candidate list to dynamically obtain the pruning thresholds for each layer of the preliminary pruning candidate list; wherein, the multi-objective optimization is performed using a sensitivity field-guided adaptive differential evolution algorithm, which includes: Define the pruning threshold for each layer of the neural network as the individual vector. The mutation operator is guided by the sensitivity to generate a mutation vector. It satisfies the following relationship: ; in, The optimal threshold for the current generation, For the first l The variation damping coefficient of the layer, and the sensitivity evaluation matrix Negative correlation; For Gaussian noise; F is the scaling factor for the differential evolution algorithm; r1 and r2 are random individual indices, and two different individuals are selected from the current generation to generate the difference vector; based on real-time load. The crossover probability CR is dynamically adjusted to satisfy the following relationship: ; Finally, the optimal pruning threshold is selected through Pareto non-dominated sorting. Specifically, the Pareto non-dominated sorting uses model accuracy preservation rate and resource consumption (computational load, memory usage, energy consumption) as multiple optimization objectives. It performs hierarchical sorting on the candidate pruning threshold solution set generated by each generation of evolution, selects the Pareto front solution set that is not dominated by any other solution, and selects the solution with the best overall performance as the final pruning threshold of that layer.
[0008] in, CR base The basic crossover probability; η is the crossover probability adjustment coefficient; tanh( ) is the hyperbolic tangent function; L max t represents the maximum computing load that the edge device can handle; t is the time index.
[0009] Step S3: Establish corresponding pruning decision models based on the pruning thresholds of each layer, strengthen the pruning decision models, generate a comprehensive reward function, and calculate the comprehensive reward value by using the comprehensive reward function to calculate the pruning thresholds of each layer. Step S4: Determine whether the comprehensive reward value is greater than or equal to the preset reward threshold; if yes, proceed to step S5; if no, return to step S3. Step S5: Dynamically prune neurons corresponding to the decision results of the reinforcement learning of the pruning decision model to form a pruning model; use online incremental training to minimize the error function through gradient descent to achieve local adjustment of the parameters of the pruning model; Step S6: Considering the change in model weight distribution after pruning, the quantization bit width of the pruned model is adaptively adjusted based on a dynamic fixed-point quantization algorithm to obtain a quantized compressed model. This step forms a sequential linkage with the aforementioned pruning step: pruning changes the model structure, while quantization further compresses it. Together, they achieve a step-by-step reduction in model volume. Furthermore, the selection of the quantization bit width is based on the actual data distribution of the model after pruning, rather than the original distribution before pruning. Step S7: Integrate the quantization compression model into an edge computing platform for large battery models to perform cross-device distributed collaborative pruning and online updates; wherein, the cross-device distributed collaborative pruning includes sharing pruning strategies and model parameters among multiple battery management systems (BMS) or battery monitoring units to adapt to differences in computing power and changes in data distribution among different devices.
[0010] Preferably, step S1 specifically includes the following sub-steps: The original neural network was trained offline using a large-scale dataset to obtain a benchmark model; By combining global gradient information with an attention mechanism, a sensitivity evaluation matrix for neurons in each layer of the baseline model is established to form the preliminary pruning candidate list.
[0011] Preferably, step S2 specifically includes the following sub-steps: A resource monitoring module is embedded in the edge device to collect the status data of the edge device in real time; wherein, the status data includes computing load, memory usage, power consumption and network latency; Using the sensitivity field-guided adaptive differential evolution algorithm, the sensitivity evaluation matrix of each layer of neurons obtained in step S1 is used as the damping factor for evolutionary mutation. Combined with the real-time collected state data and the current error of the baseline model, the pruning threshold of each layer is dynamically iteratively searched to obtain the pruning threshold of each layer.
[0012] Preferably, in step S3, the indicators of the comprehensive reward function include model accuracy, pruning ratio, and resource consumption indicators, and the resource consumption indicators include at least one or more combinations of computing load, memory usage, energy consumption, and network latency.
[0013] Preferably, the comprehensive reward function satisfies the following relationship: R = λ1·Accuracy – λ2·PR – λ3·(C + M + E + L); Where R represents the comprehensive reward value; PR represents the pruning ratio; λ1, λ2, and λ3 are adjustment coefficients; and Accuracy represents the proportion of tasks executed correctly.
[0014] Preferably, the adjustment coefficients λ1, λ2, and λ3 in the comprehensive reward function adopt a dynamic adaptive adjustment method: when the rate of decline in model accuracy exceeds a preset threshold, λ1 increases by a preset step size; when the equipment resource margin is lower than the safety line, λ3 increases by a preset step size; and λ2 is dynamically adjusted according to the deviation between the current value and the target value of the pruning ratio.
[0015] Secondly, embodiments of the present invention also provide a battery adaptive neural network dynamic pruning system, the system comprising: The generation module is used to perform offline pre-training and sensitivity evaluation of the original neural network and generate a preliminary list of pruning candidates. The monitoring module is used to perform real-time resource monitoring and multi-objective optimization on the preliminary pruning candidate list, and dynamically obtain the pruning thresholds of each layer of the preliminary pruning candidate list. The multi-objective optimization is performed using an adaptive differential evolution algorithm guided by a sensitivity field. This algorithm includes: Define the pruning threshold for each layer of the neural network as the individual vector. The mutation operator is guided by the sensitivity to generate a mutation vector. The mutation vector is obtained by weighted summation of the current generation's optimal threshold and a difference vector, followed by selective superposition of Gaussian noise terms based on the mutation damping coefficient. The weighting coefficients of the difference vector are positively correlated with the mutation damping coefficient, and the weighting coefficients of the Gaussian noise terms are negatively correlated with the mutation damping coefficient. Specifically, the following relationships are satisfied: ; in, The optimal threshold for the current generation, For the first l The variation damping coefficient of the layer, and the sensitivity evaluation matrix Negative correlation; For Gaussian noise; F is the scaling factor for the differential evolution algorithm; r1 and r2 are random individual indices, and two different individuals are selected from the current generation to generate the difference vector; based on real-time load. The crossover probability CR is dynamically adjusted to satisfy the following relationship: ; Finally, the optimal pruning threshold was selected by Pareto nondominated sorting; in, CR base The basic crossover probability; η is the crossover probability adjustment coefficient; tanh( ) is the hyperbolic tangent function; L max The maximum computing load that the edge device can withstand; t is the time index; The reinforcement module is used to establish a corresponding pruning decision model based on the pruning threshold of each layer, and to reinforce the pruning decision model to generate a comprehensive reward function. The comprehensive reward value is obtained by calculating the pruning threshold of each layer through the comprehensive reward function. The judgment module is used to determine whether the comprehensive reward value is greater than or equal to a preset reward threshold. The preset reward threshold is preset according to the target model accuracy and target resource consumption constraints. If yes, the training and adjustment module is executed. If no, the module returns to the monitoring module to perform real-time resource monitoring and multi-objective optimization to adjust the pruning thresholds of each layer. The training and adjustment module is used to dynamically prune neurons corresponding to the decision results of the reinforcement learning of the pruning decision model to form a pruning model; and to achieve local adjustment of the parameters of the pruning model by minimizing the error function through online incremental training and gradient descent. The compression module is used to adaptively readjust the quantization bit width of the pruned model based on a dynamic fixed-point quantization algorithm, taking into account the change in the weight distribution of the model after pruning, to obtain a quantized compressed model; wherein, the dynamic adjustment of the quantization bit width includes: collecting the data distribution of the weights of each layer of the model after pruning, and selecting a target quantization bit width independently for each layer weight with the goal of minimizing a preset quantization error metric; The deployment module is used to integrate the quantization compression model into an edge computing platform for large battery models to perform cross-device distributed collaborative pruning and online updates; wherein, the cross-device distributed collaborative pruning includes sharing pruning strategies and model parameters among multiple battery management systems (BMS) or battery monitoring units to adapt to differences in computing power and changes in data distribution among different devices.
[0016] Thirdly, embodiments of the present invention also provide an electronic device, the electronic device including a processor and a memory, the memory storing a computer program executable by the processor, and the processor executing steps in the battery adaptive neural network dynamic pruning method as described in any of the preceding claims when reading the computer program in the memory.
[0017] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of any of the above-described battery adaptive neural network dynamic pruning methods.
[0018] Compared with related technologies, in the embodiments of the present invention, through the above steps S1-S7, multiple technical means such as real-time state monitoring, multi-objective optimization, reinforcement learning-driven decision-making, online incremental training, and dynamic fixed-point quantization are employed to achieve efficient pruning and adaptive online updating of the neural network model. Thus, through real-time state monitoring and multi-objective optimization, the pruning strategy is dynamically adjusted to achieve efficient resource utilization of edge devices. The reinforcement learning-driven pruning decision module enables the system to continuously self-optimize based on actual environmental feedback, improving model stability. Online incremental training and local fine-tuning mechanisms effectively compensate for the accuracy loss caused by pruning, ensuring long-term performance. Dynamic fixed-point quantization further compresses the model, significantly reducing storage and computational overhead, making it suitable for various embedded devices. The system integration and distributed deployment scheme enable this method to work collaboratively in various heterogeneous edge devices, broadening its application scope.
[0019] Meanwhile, the present invention has the following significant differences: First, the sensitivity-field-guided adaptive differential evolution algorithm deeply couples sensitivity to the mutation operator, constructing a mutation damping mechanism. The high-sensitivity layer uses a high damping coefficient to suppress pruning threshold perturbations, protecting model accuracy; the low-sensitivity layer uses a low damping coefficient and introduces Gaussian noise to enhance compression exploration capabilities. This asymmetric optimization structure balances accuracy preservation and compression ratio improvement, overcoming the shortcomings of traditional pruning methods' "one-size-fits-all" approach.
[0020] Second, the load-adaptive crossover mechanism dynamically adjusts the crossover probability based on the real-time load calculation of edge devices. When the load surges, the crossover probability increases, generating a more aggressive pruning strategy to free up resources; when the load is light, the crossover probability decreases, prioritizing accuracy. This mechanism achieves real-time coupling between the pruning strategy and the environmental state, forming a dual adaptive closed loop of internal sensitivity constraints and external load response.
[0021] The two mechanisms described above are synergistically coupled through the same differential evolution framework. The mutation damping mechanism constrains the search space of the pruning threshold from within the model, while the load adaptive crossover mechanism determines the balance between exploration and utilization from outside the environment. Together, they constitute a two-way regulatory structure of "internal constraint and external drive," enabling the optimization process to respond simultaneously to model priors and environmental changes. Experiments show that, compared to static pruning methods and dynamic pruning methods that only use a single optimization objective, this scheme achieves an additional compression ratio improvement of approximately 15% to 20% while maintaining the same accuracy loss (<1%), and reduces inference latency variance by more than 30% under load fluctuation scenarios.
[0022] The experiments were conducted using ResNet-50 and MobileNetV2 datasets, with ImageNet and Cityscapes datasets, and NVIDIA Jetson Nano and Raspberry Pi 4 as edge devices. Comparison methods included static L2 norm pruning, differential evolution only (without sensitivity guidance and load adaptation), and differential evolution variants using either sensitivity guidance or load adaptation alone. Ablation experiments showed that using only sensitivity guidance mutation damping (without load adaptation crossover) resulted in approximately 8% lower compression ratio compared to the complete scheme, and only a 12% reduction in latency variance under load fluctuation scenarios. Using only load adaptation crossover (without sensitivity guidance) resulted in a model accuracy loss exceeding 1.5%, and highly sensitive layers were prone to over-pruning. Only when both mechanisms were present simultaneously could an additional 15%–20% improvement in compression ratio be achieved while maintaining the same accuracy loss (<1%), and an inference latency variance reduction of over 30% under load fluctuation scenarios be achieved. This indicates that the two core mechanisms of this invention form a synergistic effect of "internal constraint and external drive," neither of which can be omitted. Attached Figure Description
[0023] The present invention will now be described in detail with reference to the accompanying drawings. The above and other aspects of the present invention will become clearer and more readily understood through the detailed description following the accompanying drawings. In the drawings: Figure 1 This is a flowchart of the battery adaptive neural network dynamic pruning method provided in Embodiment 1 of the present invention; Figure 2 This is a block diagram of the battery adaptive neural network dynamic pruning system provided in Embodiment 2 of the present invention; Figure 3 This is a module diagram of an electronic device provided in Embodiment 3 of the present invention. Detailed Implementation
[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.
[0025] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] Example 1 Please see Figure 1 As shown, this embodiment of the invention provides a battery adaptive neural network dynamic pruning method, which includes the following steps: Step S1: Perform offline pre-training and sensitivity assessment on the original neural network to generate a preliminary pruning candidate list.
[0028] Step S2: Perform real-time resource monitoring and multi-objective optimization on the preliminary pruning candidate list to dynamically obtain the pruning thresholds for each layer of the preliminary pruning candidate list. Specifically, a multi-objective optimization algorithm is used to dynamically calculate the pruning thresholds for each layer based on real-time monitoring data and the current model error, ensuring that pruning reduces resource consumption while maintaining high accuracy.
[0029] The multi-objective optimization is performed using an adaptive differential evolution algorithm guided by a sensitivity field. This algorithm includes: Define the pruning threshold for each layer of the neural network as the individual vector. The mutation operator is guided by the sensitivity to generate a mutation vector. The mutation vector is obtained by weighted summation of the current generation's optimal threshold and a difference vector, followed by selective superposition of Gaussian noise terms based on the mutation damping coefficient. The weighting coefficients of the difference vector are positively correlated with the mutation damping coefficient, and the weighting coefficients of the Gaussian noise terms are negatively correlated with the mutation damping coefficient. Specifically, the following relationships are satisfied: ; in, The optimal threshold for the current generation, For the first l The variation damping coefficient of the layer, and the sensitivity evaluation matrix Negative correlation; For Gaussian noise; F is the scaling factor for the differential evolution algorithm; r1 and r2 are random individual indices, and two different individuals are selected from the current generation to generate the difference vector; based on real-time load. The crossover probability CR is dynamically adjusted to satisfy the following relationship: ; Finally, the optimal pruning threshold was selected by Pareto nondominated sorting; in, CR base The basic crossover probability; η is the crossover probability adjustment coefficient; tanh( ) is the hyperbolic tangent function; L max t represents the maximum computing load that the edge device can handle; t is the time index.
[0030] In this embodiment, step S2 employs a sensitivity field-guided adaptive differential evolution algorithm (SF-AMODE), and the specific implementation logic is as follows: Constructing the sensitivity damping field: Based on the sensitivity evaluation matrix obtained in step S1 Calculate the variation damping coefficient of each layer. : ; in, For the first The sensitivity value of the layer This represents the average sensitivity across the entire layer. When neurons in a certain layer are extremely sensitive to precision ( big), The threshold value approaches 0, thereby suppressing drastic disturbances in the pruning threshold of this layer and protecting the model accuracy. The sensitivity assessment matrix of neurons in the large l-th layer, as a variation damping factor, is negatively correlated with λl. x The individual vector of the pruning threshold for each layer of the neural network, i.e. the candidate solution of the pruning threshold, participates in the differential evolution iteration.
[0031] Execution sensitivity-guided mutation: Unlike traditional differential evolution, this method introduces a damping coefficient during the mutation stage. The sensitivity field-guided adaptive differential evolution algorithm includes the following steps: defining the pruning threshold for each layer of the neural network as the individual vector. The mutation operator is guided by the sensitivity to generate a mutation vector. It satisfies the following relationship: ; in, The optimal threshold for the current generation, For the first lThe variation damping coefficient of the layer, and the sensitivity evaluation matrix A negative correlation exists (the higher the sensitivity, the more conserved the variation). For Gaussian noise; F is the scaling factor of the differential evolution algorithm, controlling the scaling magnitude of the difference vector; r1, r2 are random individual indices, selecting two different individuals from the current generation to generate the difference vector; for insensitive layers ( Approximately 1), introducing Gaussian noise. Enhance exploration capabilities and attempt higher compression ratios; for sensitive layers, primarily retain the features of the optimal solution, making only minor adjustments. Specifically, is the mutation vector (candidate mutation value of pruning threshold) of the i-th individual in the l-th layer, G+1-th generation. is the optimal pruning threshold vector for the l-th layer and the G-th generation (the optimal pruning threshold obtained from the current generation's evolution). The pruning threshold vectors are two randomly selected individuals from the l-th layer and the G-th generation, which are used to generate the difference vector. The Gaussian noise term follows a Gaussian distribution with a mean of 0 and a variance of σ², and is used to increase the randomness of variation and avoid local optima. l G is the neural network layer index, identifying different network layers. G is the differential evolution generation index, identifying the evolutionary iteration round. i For individual indexes, identify different pruning threshold candidates within the same generation and layer.
[0032] Load-adaptive crossover: Adjusts the crossover probability in real time based on the dynamic characteristics of edge devices. Based on real-time load The crossover probability CR is dynamically adjusted to satisfy the following relationship: ; Finally, the optimal pruning threshold is selected through Pareto non-dominated sorting. Specifically, the Pareto non-dominated sorting uses model accuracy preservation and resource consumption (computational load, memory usage, and energy consumption) as multiple optimization objectives. It performs hierarchical sorting on the candidate pruning threshold solution set generated by each generation of evolution, selects the Pareto front solution set that is not dominated by any other solution, and selects the solution with the best overall performance from it as the final pruning threshold of that layer.
[0033] in, For real-time data acquisition of computational load or latency, CR base η is the basic crossover probability; η is the crossover probability adjustment coefficient, used to control the intensity of the impact of load changes on the crossover probability; tanh( ) is the hyperbolic tangent function, used to map the load ratio to [ The interval [1,1] is used to achieve smooth, saturated adjustment; Lmax This represents the maximum computing load that edge devices can withstand, and is based on real-time status data collected from the resource monitoring module; 't' is a time index used to identify the dynamic change of the crossover probability over time / iteration. Specifically, The crossover probability at time t (or generation t) controls the crossover probability between the mutation vector and the original individual, determining how new individuals are generated.
[0034] When a surge in device load is detected The function approaches 1. Increased size prompts the algorithm to generate more aggressive pruning strategies to quickly free up computing resources.
[0035] Step S3: Establish corresponding pruning decision models based on the pruning thresholds of each layer, strengthen the pruning decision models, generate a comprehensive reward function, and calculate the comprehensive reward value by using the comprehensive reward function to calculate the pruning thresholds of each layer.
[0036] Step S4: Determine whether the comprehensive reward value is greater than or equal to the preset reward threshold; the preset reward threshold is preset according to the target model accuracy and target resource consumption constraints; if yes, proceed to step S5; if no, return to step S2, and re-perform real-time resource monitoring and multi-objective optimization to adjust the pruning thresholds of each layer.
[0037] Step S5: Dynamically prune neurons corresponding to the decision results of the reinforcement learning of the pruning decision model to form a pruned model; utilize online incremental training and minimize the error function using gradient descent to achieve local fine-tuning of the pruned model parameters. Specifically, the pruned model is trained online incrementally on edge devices, using newly acquired data for local adjustments to quickly restore or improve model accuracy; a lightweight online update framework is constructed to support automatic iterative updates of the model without service interruption, adapting to environmental and task changes. Specifically, based on the reinforcement learning decision results, unimportant neurons are dynamically pruned to form a pruned model. Utilizing online incremental training and minimizing the error function using gradient descent, local fine-tuning of model parameters is achieved to quickly restore or improve model accuracy. The reinforcement learning agent can be extended to multi-agent collaborative decision-making, realizing cross-device joint pruning and global resource scheduling.
[0038] Step S6: Addressing the change in model weight distribution after pruning, the quantization bit width of the pruned model is adaptively readjusted based on a dynamic fixed-point quantization algorithm to obtain a quantized compressed model. This dynamic adjustment of the quantization bit width includes: collecting the data distribution of weights at each layer of the pruned model, and independently selecting a target quantization bit width for each layer weight with the goal of minimizing a preset quantization error metric. This step forms a sequential linkage with the aforementioned pruning step: pruning changes the model structure, while quantization further compresses it. Together, they achieve a step-by-step reduction in model size. Furthermore, the selection of the quantization bit width is based on the actual data distribution of the pruned model, not the original distribution before pruning. While ensuring that the model accuracy loss is controlled within a preset range, the model is further compressed, reducing storage and computing resource consumption and meeting the deployment requirements of edge devices.
[0039] Step S7: Integrate the quantized compression model into an edge computing platform for large-scale battery models to perform cross-device distributed collaborative pruning and online updates. The cross-device distributed collaborative pruning includes sharing pruning strategies and model parameters among multiple battery management systems (BMS) or battery monitoring units to adapt to differences in computing power and data distribution among different devices. Specifically, integrating the above modules into an edge computing architecture enables cross-device distributed collaborative pruning and online updates. For device heterogeneity, a layered pruning and scheduling strategy is designed to ensure optimal performance in different hardware environments. A hybrid architecture of edge and cloud collaborative training is provided to further improve the overall robustness and scalability of the system. In particular, the quantized compression model is integrated into an edge computing platform for large-scale battery models (e.g., an in-vehicle BMS or a cloud-edge collaborative battery monitoring system). In a distributed scenario, different BMS devices can synchronize the basic model from the cloud according to their own load and battery status, and perform differentiated local incremental pruning updates, achieving an efficient deployment mode of "one-stop update, multiple-location collaboration".
[0040] Specifically, this method employs multiple techniques, including real-time status monitoring, multi-objective optimization, reinforcement learning-driven decision-making, online incremental training, and dynamic fixed-point quantization, to achieve efficient pruning and adaptive online updates of neural network models. Real-time status monitoring and multi-objective optimization dynamically adjust the pruning strategy, enabling efficient resource utilization of edge devices. The reinforcement learning-driven pruning decision module allows the system to continuously self-optimize based on actual environmental feedback, improving model stability. Online incremental training and local fine-tuning mechanisms effectively compensate for accuracy loss caused by pruning, ensuring long-term performance. Dynamic fixed-point quantization further compresses the model, significantly reducing storage and computational overhead, making it suitable for various embedded devices. System integration and distributed deployment schemes enable this method to work collaboratively across multiple heterogeneous edge devices, broadening its application scope.
[0041] Among them, the sensitivity field-guided adaptive differential evolution strategy aims to deeply mine and reuse the prior knowledge of neuron sensitivity acquired in the offline pre-training stage, transforming it from a simple static selection criterion into a dynamic constraint variable in the online optimization process. Specifically, by constructing a mutation damping mechanism that maps the entire network, the sensitivity evaluation matrix is deeply coupled to the mutation operator of the differential evolution algorithm: for high-sensitivity feature layers, a high damping coefficient is used to suppress the perturbation variance of the pruning threshold, thereby imposing implicit regularization constraints in the random search of the solution space to ensure the stability of the model's core accuracy; while for low-sensitivity redundant layers, damping is reduced and random noise is introduced to enhance the algorithm's global optimization capability and compress the exploration depth. In addition, this invention further establishes a dynamic crossover mechanism based on environmental load awareness, nonlinearly mapping the real-time computing load of edge devices to the crossover probability of population evolution, thereby constructing a dual adaptive closed-loop optimization system that can simultaneously respond to changes in the model's internal microstructural features and the external macroscopic computing environment.
[0042] In this embodiment, step S1 specifically includes the following sub-steps: The original neural network was trained offline using a large-scale dataset to obtain a benchmark model.
[0043] By combining global gradient information with an attention mechanism, a sensitivity evaluation matrix for neurons in each layer of the baseline model is established to form the preliminary pruning candidate list.
[0044] The process involves generating a pruning candidate list through offline pre-training and sensitivity evaluation. Specifically, pre-training utilizes a large-scale dataset to train the neural network offline, obtaining a baseline model. Sensitivity evaluation calculates the gradient information g of each neuron in each layer. i With attention weight a i The sensitivity matrix S is constructed as follows: S i = α·|g i | + β·a i Wherein: S i G represents the sensitivity value of the i-th neuron; i This represents the gradient magnitude of the neuron during training; a i This represents the attention weight of the corresponding neuron in the attention mechanism; α and β are adjustment coefficients used to balance the contribution ratio of gradient information and attention information in sensitivity assessment.
[0045] In this embodiment, the adjustment coefficients α and β are adaptively determined based on the gradient statistics of the neural network during the training phase, and their calculation method is as follows: α = σ_g / (σ_g + σ_a) β = σ_a / (σ_g + σ_a) Where: σ_g represents the standard deviation of the gradient magnitude of the current network layer; σ_a represents the standard deviation of the attention weight distribution.
[0046] The neuron sensitivity vector is obtained through the above calculations, and a neuron sensitivity evaluation matrix S is further constructed for subsequent screening and optimization of pruning candidate neurons. This matrix is used to quantify the importance of each neuron, thereby selecting neurons with lower importance as pruning candidates.
[0047] Specifically, the original neural network is trained offline using a large-scale dataset to obtain a baseline model; global gradient information combined with an attention mechanism is used to establish a sensitivity evaluation matrix for neurons in each layer, and a preliminary pruning candidate list is constructed to provide a basis for subsequent online adaptive adjustment.
[0048] In this embodiment, step S2 specifically includes the following sub-steps: A resource monitoring module is embedded in the edge device to collect the status data of the edge device in real time; wherein, the status data includes computing load, memory usage, power consumption and network latency; An adaptive differential evolution algorithm guided by a sensitivity field is used. The sensitivity evaluation matrix of each layer of neurons obtained in step S1 is used as a damping factor for evolutionary mutation. Combined with the real-time acquired state data and the current error of the baseline model, the pruning threshold of each layer is dynamically and iteratively searched to obtain the pruning threshold. This ensures that pruning reduces resource consumption while maintaining high accuracy.
[0049] In this embodiment, in step S3, the comprehensive reward function includes indicators such as model accuracy, pruning ratio, and resource consumption indicators. The resource consumption indicators include at least one of computational load, memory usage, energy consumption, and network latency. An intelligent agent is used to automatically adjust the pruning strategy by sampling data online and monitoring edge device status. This achieves a closed-loop feedback loop of "edge status acquisition—pruning decision—model update," thereby continuously optimizing the pruning effect. Here, an intelligent agent refers to a software or hardware system capable of autonomously perceiving, making decisions, and executing tasks in a specific environment to achieve a specific goal.
[0050] In this embodiment, the comprehensive reward function satisfies the following relationship: R = λ1·Accuracy – λ2·PR – λ3·(C + M + E + L); Where R represents the overall reward value of the reinforcement learning intelligent agent; PR represents the pruning ratio; λ1, λ2, and λ3 are adjustment coefficients; and Accuracy represents the proportion of tasks executed correctly. In this embodiment, the adjustment coefficients λ1, λ2, and λ3 are dynamically and adaptively adjusted. Specifically, in each iteration of the pruning decision, they are updated according to the following rules: (1) When the rate of decrease in model accuracy exceeds the preset threshold, λ1 increases by a preset step size to prioritize the protection of model accuracy; (2) When the equipment resource margin (such as memory, computing load) is lower than the safety line, λ3 increases by a preset step size to strengthen the constraint on resource consumption; (3) λ2 is dynamically adjusted according to the deviation between the current value and the target value of the pruning ratio to avoid over-pruning or under-pruning.
[0051] The above adjustments are achieved through normalization, ensuring that all coefficients work synergistically on a unified scale. Through this adaptive coefficient mechanism, the comprehensive reward function can dynamically shift its optimization focus as the optimization process and environmental conditions change, overcoming the limitation of traditional fixed-coefficient reward functions in balancing multiple objectives in dynamic scenarios.
[0052] Specifically, R (Reward) represents the overall reward value of the reinforcement learning intelligent agent, used to evaluate the merits of the current pruning strategy. A higher reward value indicates that the strategy has achieved a better balance between model accuracy, resource consumption, and pruning ratio.
[0053] PR (Pruning Rate) represents the pruning ratio, which is the proportion of neural network parameters that are removed out of the total parameters. This parameter quantifies the strength of the pruning operation in the reward function through the weight coefficient λ2, avoiding over-pruning that could degrade model performance.
[0054] In this embodiment, the adjustment coefficients λ1, λ2, and λ3 in the comprehensive reward function adopt a dynamic adaptive adjustment method: when the model accuracy decline rate exceeds the preset threshold, λ1 increases by a preset step size; when the equipment resource margin is lower than the safety line, λ3 increases by a preset step size; and λ2 is dynamically adjusted according to the deviation between the current value and the target value of the pruning ratio.
[0055] In this embodiment, step S4 specifically includes the following sub-steps: Based on the calculated reward R, determine whether the preset threshold R_th has been reached: if R≥R_th, then perform pruning and online training; otherwise, return to readjust the multi-objective optimization and calculate the pruning threshold.
[0056] As a preferred embodiment, the specific value of the preset reward threshold R_th can be determined in the following way: First, set the lower limit of model accuracy Acc_min and the upper limit of resource consumption Res_max (such as maximum allowable inference latency, energy consumption budget, etc.) according to the target application scenario. Then, on the offline validation set, multiple candidate pruning strategies are evaluated, and the comprehensive reward value of each strategy is calculated as R = λ1·Accuracy–λ2·PR–λ3·(C+M+E+L). Finally, the median or lower quartile of the R value is selected from the strategies that satisfy Accuracy ≥ Acc_min and (C+M+E+L) ≤ Res_max as the preset reward threshold R_th, in order to achieve a balance between accuracy and resources.
[0057] Those skilled in the art can also dynamically determine this threshold through cross-validation or Pareto front analysis methods according to actual needs, and the specific method does not affect the implementation of the present invention.
[0058] In this embodiment, step S6 specifically includes the following sub-steps: The weights W of each layer of the pruned model (i) Dynamic fixed-point quantization (Q) is employed. (i) The following relationship must be satisfied: Q (i) = Quantize(W (i) , b (i) ); Among them, b (i) The quantization bit width of the i-th layer is dynamically adjusted based on the data distribution, thereby reducing the storage and computing resource requirements while ensuring that the model accuracy loss is within a controllable range.
[0059] In a preferred embodiment, the quantization bit width b (i) The dynamic adjustment can be achieved as follows: Collect a calibration dataset with a distribution similar to the target application scenario, input it into the pruning model, and statistically analyze the numerical distribution range of the weights at each layer; traverse candidate quantization bit widths (e.g., 4 to 16 bits), using KL divergence or mean squared error as quantization error metrics, and select the minimum bit width that meets the preset error tolerance threshold as the final quantization bit width for that layer. Then, use linear uniform quantization to quantize the weights. Through this method, the optimal quantization bit width is adaptively selected based on the weight data distribution of each layer, compressing the model while keeping the accuracy loss within an acceptable range.
[0060] In this embodiment, step S7 specifically includes the following sub-steps: The pruned and quantized compressed model is integrated into the edge computing platform, enabling distributed deployment across devices. This allows the entire system to operate efficiently, with low power consumption and real-time updates, meeting the application needs of edge computing environments.
[0061] The system integration and distributed deployment scheme enables this method to work collaboratively across a variety of heterogeneous edge devices, thus broadening its application scope.
[0062] Example 2 Please see Figure 2 As shown, this embodiment of the invention also provides a battery adaptive neural network dynamic pruning system 200, the system comprising: The generation module 21 is used to perform offline pre-training and sensitivity evaluation on the original neural network and generate a preliminary list of pruning candidates.
[0063] The monitoring module 22 is used to perform real-time resource monitoring and multi-objective optimization on the preliminary pruning candidate list, and dynamically obtain the pruning thresholds of each layer of the preliminary pruning candidate list.
[0064] The multi-objective optimization is performed using an adaptive differential evolution algorithm guided by a sensitivity field. This algorithm includes: Define the pruning threshold for each layer of the neural network as the individual vector. The mutation operator is guided by the sensitivity to generate a mutation vector. The mutation vector is obtained by weighted summation of the current generation's optimal threshold and a difference vector, followed by selective superposition of Gaussian noise terms based on the mutation damping coefficient. The weighting coefficients of the difference vector are positively correlated with the mutation damping coefficient, and the weighting coefficients of the Gaussian noise terms are negatively correlated with the mutation damping coefficient. Specifically, the following relationships are satisfied: ; in, The optimal threshold for the current generation, For the first l The variation damping coefficient of the layer, and the sensitivity evaluation matrix Negative correlation; For Gaussian noise; F is the scaling factor for the differential evolution algorithm; r1 and r2 are random individual indices, and two different individuals are selected from the current generation to generate the difference vector; based on real-time load. The crossover probability CR is dynamically adjusted to satisfy the following relationship: ; Finally, the optimal pruning threshold was selected by Pareto nondominated sorting; in, CR base The basic crossover probability; η is the crossover probability adjustment coefficient; tanh( ) is the hyperbolic tangent function; L max t represents the maximum computing load that the edge device can handle; t is the time index.
[0065] The reinforcement module 23 is used to establish a corresponding pruning decision model based on the pruning threshold of each layer, strengthen the pruning decision model, generate a comprehensive reward function, and calculate the comprehensive reward value of each layer by using the comprehensive reward function.
[0066] The judgment module 24 is used to determine whether the comprehensive reward value is greater than or equal to the preset reward threshold. The preset reward threshold is preset according to the target model accuracy and target resource consumption constraints. If yes, the training and adjustment module 25 is executed. If no, the process returns to the monitoring module 22 to perform real-time resource monitoring and multi-objective optimization to adjust the pruning thresholds of each layer.
[0067] The training and tuning module 25 is used to dynamically prune neurons corresponding to the decision results of the reinforcement learning of the pruning decision model, forming a pruning model. It utilizes online incremental training to minimize the error function using gradient descent, achieving local adjustment of the pruning model parameters. Specifically, based on the reinforcement learning decision results, unimportant neurons are dynamically pruned to form a pruning model. Online incremental training is used to minimize the error function using gradient descent, achieving local fine-tuning of the model parameters to quickly restore or improve model accuracy. The reinforcement learning agent can be extended to multi-agent collaborative decision-making, enabling cross-device joint pruning and global resource scheduling.
[0068] Compression module 26 is used to adaptively adjust the quantization bit width of the pruned model based on the dynamic fixed-point quantization algorithm to obtain a quantized compressed model, taking into account the change in the weight distribution of the model after pruning. The dynamic adjustment of the quantization bit width includes: collecting the data distribution of the weights of each layer of the model after pruning, and selecting a target quantization bit width independently for each layer weight with the goal of minimizing the preset quantization error metric.
[0069] Deployment module 27 is used to integrate the quantization compression model into an edge computing platform for large battery models to perform cross-device distributed collaborative pruning and online updates; wherein, the cross-device distributed collaborative pruning includes sharing pruning strategies and model parameters among multiple battery management systems (BMS) or battery monitoring units to adapt to differences in computing power and changes in data distribution among different devices.
[0070] Specifically, this method employs multiple techniques, including real-time status monitoring, multi-objective optimization, reinforcement learning-driven decision-making, online incremental training, and dynamic fixed-point quantization, to achieve efficient pruning and adaptive online updates of neural network models. Real-time status monitoring and multi-objective optimization dynamically adjust the pruning strategy, enabling efficient resource utilization of edge devices. The reinforcement learning-driven pruning decision module allows the system to continuously optimize itself based on actual environmental feedback, improving model stability. Online incremental training and local fine-tuning mechanisms effectively compensate for the accuracy loss caused by pruning, ensuring long-term performance. Dynamic fixed-point quantization further compresses the model, significantly reducing storage and computational overhead, making it suitable for various embedded devices. System integration and distributed deployment schemes enable this method to work collaboratively across multiple heterogeneous edge devices, broadening its application scope.
[0071] The battery adaptive neural network dynamic pruning system 200 in this second embodiment has the same technical effect as that in the first embodiment, and will not be described again here.
[0072] In this embodiment, the generation module 21 is further configured to offline train the original neural network using a large-scale dataset to obtain a baseline model. Using global gradient information combined with an attention mechanism, a sensitivity evaluation matrix for each layer of neurons is established based on the baseline model to construct a preliminary pruning candidate list.
[0073] The process involves generating a pruning candidate list through offline pre-training and sensitivity evaluation. Specifically, pre-training utilizes a large-scale dataset to train the neural network offline, obtaining a baseline model. Sensitivity evaluation calculates the gradient information g of each neuron in each layer. i With attention weight a i The sensitivity matrix S is constructed as follows: S i =α·|g i |+β·a i Wherein: S i G represents the sensitivity value of the i-th neuron; i This represents the gradient magnitude of the neuron during training; a i This represents the attention weight of the corresponding neuron in the attention mechanism; α and β are adjustment coefficients used to balance the contribution ratio of gradient information and attention information in sensitivity assessment.
[0074] In this embodiment, the adjustment coefficients α and β are adaptively determined based on the gradient statistics of the neural network during the training phase, and their calculation method is as follows: α = σ_g / (σ_g + σ_a); β = σ_a / (σ_g + σ_a); Where: σ_g represents the standard deviation of the gradient magnitude of the current network layer; σ_a represents the standard deviation of the attention weight distribution.
[0075] The neuron sensitivity vector is obtained through the above calculations, and a neuron sensitivity evaluation matrix S is further constructed for subsequent screening and optimization of pruning candidate neurons.
[0076] This matrix is used to quantify the importance of each neuron, thereby filtering out neurons with lower importance as pruning candidates.
[0077] Specifically, the original neural network is trained offline using a large-scale dataset to obtain a baseline model; global gradient information combined with an attention mechanism is used to establish a sensitivity evaluation matrix for neurons in each layer, and a preliminary pruning candidate list is constructed to provide a basis for subsequent online adaptive adjustment.
[0078] In this embodiment, the monitoring module 22 is further configured to embed a resource monitoring module in the edge device for real-time collection of the edge device's status data; wherein the status data includes computing load, memory usage, energy consumption, and network latency; using a multi-objective optimization algorithm, the pruning thresholds for each layer are dynamically calculated based on the error between the real-time collected status data and the current baseline model. This ensures that pruning reduces resource consumption while maintaining high accuracy.
[0079] In this embodiment, the enhancement module 23 is further configured to include model accuracy, pruning ratio, and energy consumption as indicators of the comprehensive reward function. The intelligent agent automatically adjusts the pruning strategy based on online sampling data and edge device status. This achieves a closed-loop feedback loop of "edge status acquisition—pruning decision—model update," thereby continuously optimizing the pruning effect. Here, the intelligent agent refers to a software or hardware system capable of autonomously sensing, making decisions, and executing tasks in a specific environment to achieve a specific goal. The intelligent agent automatically adjusts the pruning strategy based on online sampling data and edge device status. This achieves a closed-loop feedback loop of "edge status acquisition—pruning decision—model update," thereby continuously optimizing the pruning effect.
[0080] In this embodiment, the comprehensive reward function satisfies the following relationship: R = λ1·Accuracy – λ2·PR – λ3·(C + M + E + L); Where R represents the overall reward value of the reinforcement learning intelligent agent; PR represents the pruning ratio; λ1, λ2, and λ3 are adjustment coefficients; and Accuracy represents the proportion of tasks executed correctly. Specifically, R (Reward) represents the overall reward value of the reinforcement learning intelligent agent, used to evaluate the merits of the current pruning strategy. A higher reward value indicates a better balance between model accuracy, resource consumption, and pruning ratio.
[0081] PR (Pruning Rate) represents the pruning ratio, which is the proportion of neural network parameters that are removed out of the total parameters. This parameter quantifies the strength of the pruning operation in the reward function through the weight coefficient λ2, avoiding over-pruning that could degrade model performance.
[0082] In this embodiment, the judgment module 24 is further configured to determine whether the preset threshold R_th has been reached based on the calculated reward R: if R ≥ R_th, then pruning and online training are performed; otherwise, the multi-objective optimization calculation pruning threshold is readjusted.
[0083] In this embodiment, the compression module 26 is further used to compress the weights W of each layer of the pruned model. (i) Dynamic fixed-point quantization (Q) is employed. (i) The following relationship must be satisfied: Q (i) = Quantize(W (i) , b (i) ); Among them, b (i) The quantization bit width of the i-th layer is dynamically adjusted based on the data distribution, thereby reducing the storage and computing resource requirements while ensuring that the model accuracy loss is within a controllable range.
[0084] In a preferred embodiment, the quantization bit width b (i) The dynamic adjustment can be achieved as follows: Collect a calibration dataset with a distribution similar to the target application scenario, input it into the pruning model, and statistically analyze the numerical distribution range of the weights at each layer; traverse candidate quantization bit widths (e.g., 4 to 16 bits), using KL divergence or mean squared error as quantization error metrics, and select the minimum bit width that meets the preset error tolerance threshold as the final quantization bit width for that layer. Then, use linear uniform quantization to quantize the weights. Through this method, the optimal quantization bit width is adaptively selected based on the weight data distribution of each layer, compressing the model while keeping the accuracy loss within an acceptable range.
[0085] In this embodiment, the deployment module is also used to integrate the pruned and quantized compressed model into the edge computing platform, achieving distributed deployment across devices. This allows the entire system to operate with high efficiency, low power consumption, and real-time updates, meeting the application requirements of edge computing environments. The system integration and distributed deployment scheme enables this method to work collaboratively across various heterogeneous edge devices, broadening its application scope.
[0086] Example 3 Please see Figure 3 As shown, this embodiment of the invention also provides an electronic device 300, which includes a processor 301 and a memory 302. The memory 302 stores a computer program that can be executed by the processor 301. When the processor 301 reads the computer program in the memory 302, it executes the steps in the battery adaptive neural network dynamic pruning method described in any of the above embodiments.
[0087] Step S1: Perform offline pre-training and sensitivity assessment on the original neural network to generate a preliminary pruning candidate list; Step S2: Perform real-time resource monitoring and multi-objective optimization on the preliminary pruning candidate list to dynamically obtain the pruning thresholds at each level of the preliminary pruning candidate list; Step S3: Establish corresponding pruning decision models based on the pruning thresholds of each layer, strengthen the pruning decision models, generate a comprehensive reward function, and calculate the comprehensive reward value by using the comprehensive reward function to calculate the pruning thresholds of each layer. Step S4: Determine whether the comprehensive reward value is greater than or equal to the preset reward threshold; if yes, proceed to step S5; if no, return to step S3. Step S5: Dynamically prune neurons corresponding to the decision results of the reinforcement learning of the pruning decision model to form a pruning model; use online incremental training to minimize the error function through gradient descent to achieve local adjustment of the parameters of the pruning model; Step S6: Adaptively adjust the quantization bit width of the pruning model based on the dynamic fixed-point quantization algorithm to obtain the quantization compression model; Step S7: Integrate the quantization compression model into the edge computing platform for cross-device distributed collaborative pruning and online updates.
[0088] Example 4 This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the above-described battery adaptive neural network dynamic pruning methods.
[0089] Those skilled in the art will understand that all or part of the processes in the methods for implementing the electronic devices of the embodiments can be implemented by instructing related hardware through a computer program. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0090] It should be noted that the various embodiments described above with reference to the accompanying drawings are merely illustrative of the present invention and not intended to limit its scope. Those skilled in the art should understand that any modifications or equivalent substitutions made to the present invention without departing from its spirit and scope should be included within the scope of the present invention. Furthermore, unless the context otherwise requires, words appearing in the singular include those in the plural, and vice versa. Additionally, unless specifically stated otherwise, all or part of any embodiment may be used in conjunction with all or part of any other embodiment.
Claims
1. A battery adaptive neural network dynamic pruning method, the method being implemented based on sensitivity field guidance, characterized in that, The method includes the following steps: Step S1: Perform offline pre-training and sensitivity assessment on the original neural network to generate a preliminary pruning candidate list; Step S2: Perform real-time resource monitoring and multi-objective optimization on the preliminary pruning candidate list to dynamically obtain the pruning thresholds for each layer of the preliminary pruning candidate list; wherein, the multi-objective optimization is performed using a sensitivity field-guided adaptive differential evolution algorithm, which includes: Define the pruning threshold for each layer of the neural network as the individual vector. The mutation operator is guided by the sensitivity to generate a mutation vector. The mutation vector is obtained by weighted summation of the current generation's optimal threshold and a difference vector, followed by selective superposition of Gaussian noise terms based on the mutation damping coefficient. The weighting coefficients of the difference vector are positively correlated with the mutation damping coefficient, and the weighting coefficients of the Gaussian noise terms are negatively correlated with the mutation damping coefficient. Specifically, the following relationships are satisfied: ; in, The optimal threshold for the current generation, For the first l The variation damping coefficient of the layer, and the sensitivity evaluation matrix Negative correlation; For Gaussian noise; F is the scaling factor for the differential evolution algorithm; r1 and r2 are random individual indices, and two different individuals are selected from the current generation to generate the difference vector; based on real-time load. The crossover probability CR is dynamically adjusted to satisfy the following relationship: ; Finally, the optimal pruning threshold was selected by Pareto nondominated sorting; in, CR base The basic crossover probability; η is the crossover probability adjustment coefficient; tanh( ) is the hyperbolic tangent function; L max The maximum computing load that the edge device can withstand; t is the time index; Step S3: Establish corresponding pruning decision models based on the pruning thresholds of each layer, strengthen the pruning decision models, generate a comprehensive reward function, and calculate the comprehensive reward value by using the comprehensive reward function to calculate the pruning thresholds of each layer. Step S4: Determine whether the comprehensive reward value is greater than or equal to the preset reward threshold; the preset reward threshold is preset according to the target model accuracy and target resource consumption constraints; if yes, proceed to step S5; if no, return to step S2, and re-perform real-time resource monitoring and multi-objective optimization to adjust the pruning thresholds of each layer. Step S5: Dynamically prune neurons corresponding to the decision results of the reinforcement learning of the pruning decision model to form a pruning model; use online incremental training to minimize the error function through gradient descent to achieve local adjustment of the parameters of the pruning model; Step S6: In view of the change in the weight distribution of the model after pruning, the quantization bit width of the pruned model is adaptively readjusted based on the dynamic fixed-point quantization algorithm to obtain the quantization compression model; wherein, the dynamic adjustment of the quantization bit width includes: collecting the data distribution of the weights of each layer of the model after pruning, and selecting a target quantization bit width independently for each layer weight with the goal of minimizing the preset quantization error metric. Step S7: Integrate the quantization compression model into an edge computing platform for large battery models to perform cross-device distributed collaborative pruning and online updates; wherein, the cross-device distributed collaborative pruning includes sharing pruning strategies and model parameters among multiple battery management systems (BMS) or battery monitoring units to adapt to differences in computing power and changes in data distribution among different devices.
2. The battery adaptive neural network dynamic pruning method according to claim 1, characterized in that, Step S1 specifically includes the following sub-steps: The original neural network was trained offline using a large-scale dataset to obtain a benchmark model; By combining global gradient information with an attention mechanism, a sensitivity evaluation matrix for neurons in each layer of the baseline model is established to form the preliminary pruning candidate list.
3. The battery adaptive neural network dynamic pruning method according to claim 1, characterized in that, Step S2 specifically includes the following sub-steps: A resource monitoring module is embedded in the edge device to collect the status data of the edge device in real time; wherein, the status data includes computing load, memory usage, power consumption and network latency; Using the sensitivity field-guided adaptive differential evolution algorithm, the sensitivity evaluation matrix of each layer of neurons obtained in step S1 is used as the damping factor for evolutionary mutation. Combined with the real-time collected state data and the current error of the baseline model, the pruning threshold of each layer is dynamically iteratively searched to obtain the pruning threshold of each layer.
4. The battery adaptive neural network dynamic pruning method according to claim 3, characterized in that, In step S3, the indicators of the comprehensive reward function include model accuracy, pruning ratio and resource consumption indicators. The resource consumption indicators include at least one or more of the following: computational load, memory usage, energy consumption and network latency.
5. The battery adaptive neural network dynamic pruning method according to claim 4, characterized in that, The comprehensive reward function satisfies the following relationship: R = λ1·Accuracy – λ2·PR – λ3·(C + M + E + L); Where R represents the comprehensive reward value; PR represents the pruning ratio; λ1, λ2, and λ3 are adjustment coefficients; and Accuracy represents the proportion of tasks executed correctly.
6. The battery adaptive neural network dynamic pruning method according to claim 4, characterized in that, The adjustment coefficients λ1, λ2, and λ3 in the comprehensive reward function adopt a dynamic adaptive adjustment method: when the rate of decline in model accuracy exceeds a preset threshold, λ1 increases by a preset step size; when the equipment resource margin is lower than the safety line, λ3 increases by a preset step size. λ2 is dynamically adjusted based on the deviation between the current value and the target value of the pruning ratio.
7. A battery adaptive neural network dynamic pruning system, characterized in that, The system includes: The generation module is used to perform offline pre-training and sensitivity evaluation of the original neural network and generate a preliminary list of pruning candidates. The monitoring module is used to perform real-time resource monitoring and multi-objective optimization on the preliminary pruning candidate list, and dynamically obtain the pruning thresholds of each layer of the preliminary pruning candidate list. The multi-objective optimization is performed using an adaptive differential evolution algorithm guided by a sensitivity field. This algorithm includes: Define the pruning threshold for each layer of the neural network as the individual vector. The mutation operator is guided by the sensitivity to generate a mutation vector. The mutation vector is obtained by weighted summation of the current generation's optimal threshold and a difference vector, followed by selective superposition of Gaussian noise terms based on the mutation damping coefficient. The weighting coefficients of the difference vector are positively correlated with the mutation damping coefficient, and the weighting coefficients of the Gaussian noise terms are negatively correlated with the mutation damping coefficient. Specifically, the following relationships are satisfied: ; in, The optimal threshold for the current generation, For the first l The variation damping coefficient of the layer, and the sensitivity evaluation matrix Negative correlation; For Gaussian noise; F is the scaling factor for the differential evolution algorithm; r1 and r2 are random individual indices, and two different individuals are selected from the current generation to generate the difference vector; based on real-time load. The crossover probability CR is dynamically adjusted to satisfy the following relationship: ; Finally, the optimal pruning threshold was selected by Pareto nondominated sorting; in, CR base The basic crossover probability; η is the crossover probability adjustment coefficient; tanh( ) is the hyperbolic tangent function; L max The maximum computing load that the edge device can withstand; t is the time index; The reinforcement module is used to establish a corresponding pruning decision model based on the pruning threshold of each layer, and to reinforce the pruning decision model to generate a comprehensive reward function. The comprehensive reward value is obtained by calculating the pruning threshold of each layer through the comprehensive reward function. The judgment module is used to determine whether the comprehensive reward value is greater than or equal to a preset reward threshold. The preset reward threshold is preset according to the target model accuracy and target resource consumption constraints. If yes, the training and adjustment module is executed. If no, the module returns to the monitoring module to perform real-time resource monitoring and multi-objective optimization to adjust the pruning thresholds of each layer. The training and adjustment module is used to dynamically prune neurons corresponding to the decision results of the reinforcement learning of the pruning decision model to form a pruning model; and to achieve local adjustment of the parameters of the pruning model by minimizing the error function through online incremental training and gradient descent. The compression module is used to adaptively readjust the quantization bit width of the pruned model based on a dynamic fixed-point quantization algorithm, taking into account the change in the weight distribution of the model after pruning, to obtain a quantized compressed model; wherein, the dynamic adjustment of the quantization bit width includes: collecting the data distribution of the weights of each layer of the model after pruning, and selecting a target quantization bit width independently for each layer weight with the goal of minimizing a preset quantization error metric; The deployment module is used to integrate the quantization compression model into an edge computing platform for large battery models to perform cross-device distributed collaborative pruning and online updates; wherein, the cross-device distributed collaborative pruning includes sharing pruning strategies and model parameters among multiple battery management systems (BMS) or battery monitoring units to adapt to differences in computing power and changes in data distribution among different devices.
8. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing a computer program executable by the processor, and the processor performing the steps of the battery adaptive neural network dynamic pruning method as described in any one of claims 1 to 6 when reading the computer program in the memory.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the battery adaptive neural network dynamic pruning method as described in any one of claims 1-6.