Lithium battery state of health analysis neural network pruning method, system and storage medium
Patent Information
- Application Number
- CN202611083010.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-21
- Publication Date
- 2026-08-18
AI Technical Summary
[0011]本发明提供一种锂电池健康状态分析神经网络剪枝方法、系统及存储介质,旨在解决现有剪枝方法剪枝后模型性能偏移大、结果随机性强的问题
第一,通过将验证环节的违约样本反向转化为连续优化环节的拉格朗日激活集约束,使剪枝过程的每一次迭代均以上一轮最坏样本处的违约梯度作为强制边界条件,在数学上保证了结构压缩始终不偏离基准模型的行为包络,实现了在极限压缩比下约束违约率恒为零的非线性效果;
Smart Images

Figure CN122596149A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, system, and storage medium for pruning a neural network for analyzing the health status of lithium batteries. Background Technology
[0002] The State of Health (SOH) of a lithium battery is a core indicator for measuring the degree of battery performance degradation and remaining usable capacity. The accuracy of SOH estimation directly affects the effectiveness of the control logic of the Battery Management System (BMS), including charge and discharge regulation, power limiting, safety protection, and lifespan prediction. As the application scenarios of lithium batteries continue to expand, the actual operating conditions of batteries exhibit strong nonlinearity, strong temporal coupling, and frequent shifts in operating conditions. Traditional SOH estimation methods relying on equivalent circuit parameters and empirical degradation models have weak noise resistance and large fluctuations in prediction accuracy under varying operating conditions. Under the functional safety requirements of BMS, incorrect SOH estimation may lead to consequences such as thermal runaway caused by overcharging and power limiting failure.
[0003] Currently, the industry generally adopts neural network modeling solutions, utilizing time-series data on voltage, current, temperature, and state of charge (SOC) to mine nonlinear mapping relationships between multidimensional parameters and build dedicated neural networks for lithium battery health state analysis to estimate SOH. These neural networks offer excellent prediction accuracy after offline training, but their actual deployment is often limited to resource-constrained BMS embedded chips. Due to limitations in hardware computing power, storage capacity, and real-time computing conditions, the original large-scale networks cannot be directly implemented. Among various model compression techniques, pruning can directly reduce redundant computational units and network connections, lowering inference computing power and memory overhead at the architectural level. Compared to compression methods such as quantization and weight sharing, the hardware benefits are clear, making it an important compression method for the engineering implementation of lithium battery SOH neural networks.
[0004] Currently, mainstream neural network pruning methods use statistical features of parameters such as weight magnitude and parameter gradient sensitivity as criteria for judging the importance of network units. Low-importance weights, convolutional channels, modules and other structural units are removed according to a manually preset ratio. The pruning effect is verified after the fact by verifying the overall accuracy of the validation set. The pruning decision is based on empirical indicators.
[0005] Some optimization schemes introduce knowledge distillation and output alignment loss constraints to maintain consistency in model output before and after pruning. However, these constraints apply globally uniform weights to all input samples without distinguishing sample operating conditions. Overall, existing pruning techniques all perform empirical structural pruning based on network internal parameters and structural attributes, limiting pruning to a pure structural optimization problem and relying on offline experimental data and manual thresholds to determine whether the pruning results meet the standards. When existing classic pruning schemes are applied to the compression of neural networks for lithium battery SOH analysis, they suffer from three structural defects due to industry characteristics such as battery operating condition differences, boundary samples, and abnormal data fluctuations, severely limiting their engineering implementation effectiveness.
[0006] Lack of model behavior constraints: Existing pruning uses the average accuracy of the dataset as the sole optimization metric, focusing only on simplifying the network structure without establishing constraints on the consistency of model output results and key intermediate layer features. It cannot capture local prediction shifts under specific extreme conditions, and after pruning, the SOH results of local conditions are prone to fluctuate drastically.
[0007] The constraint mechanism is static and rigid: the existing consistency constraints have no ability to manage sample differences. The constraint conditions are applied uniformly to all data samples and cannot automatically focus on key samples that play a decisive role in the SOH determination, such as boundary conditions, aging mutations, and abnormal fluctuations. This results in redundant constraints on regular samples, wasting computing power, and insufficient constraints on high-risk key samples.
[0008] Pruning verification relies on experience: the pass / fail of pruning is judged based on the overall statistical error, lacking quantifiable and calculable verification indicators based on worst-case conditions, and thus cannot achieve deterministic and reproducible verification. In actual use, this manifests as decreased consistency of SOH analysis across operating conditions and strong randomness of results from different pruning rounds, making it difficult to meet the deterministic verification requirements for BMS functional safety and reducing the reliability of lightweight models on embedded platforms.
[0009] A comprehensive analysis of the existing solutions reveals common underlying mindsets and design flaws: the pruning decision layer and the verification layer are independent of each other. The verification process is only used to accept or reject pruning results afterward, and the resulting bias information does not participate in the re-optimization of the compression decision. This is a typical open-loop decoupled design. This path dependence causes existing solutions to iterate within a linear trial-and-error framework of compression, verification, and re-compression, making it difficult to overcome the inherent contradiction between hard constraints and high compression.
[0010] Therefore, it is necessary to propose a new pruning scheme to solve the above-mentioned technical problems. Summary of the Invention
[0011] This invention provides a neural network pruning method, system, and storage medium for lithium battery health status analysis, aiming to solve the problems of large model performance deviation and strong randomness in results after pruning in existing pruning methods.
[0012] To address the aforementioned technical problems, in a first aspect, the present invention provides a method for pruning a neural network for analyzing the health status of lithium batteries, comprising the following steps: S101. Obtain the trained lithium battery health status analysis neural network as a benchmark model; extract the output results and key intermediate layer features of the benchmark model, and construct a behavior consistency measurement function to characterize the behavior deviation between the benchmark model and the staged pruning model; set a preset maximum behavior deviation range as an error budget, and select lithium battery operating data to generate a constraint sample set; S102. Configure structural control variables for each pruning structural unit in the baseline model, and optimize joint parameters based on the behavioral constraints corresponding to the current constraint sample set, with the goal of minimizing network structure overhead. Discretize the optimized structural control variables according to the phased compression target, preset pruning threshold and preset retention threshold, and perform physical pruning according to the discretization result to obtain the phased pruning model. If the phased pruning model meets the preset behavioral constraint gating condition, proceed to step S103; otherwise, adjust the pruning parameters of physical pruning based on the pruning result of the phased pruning model and re-execute step S102. S103. Fix the network topology of the staged pruning model, introduce a compensation parameter set composed of a linear combination of preset basis functions, optimize the compensation parameter set under the behavioral constraints to correct the deviation of the output of the staged pruning model; based on a preset verification dataset, calculate the global maximum deviation index of the output of the corrected staged pruning model relative to the error budget, and determine the relationship between the global maximum deviation index and the preset behavioral gating threshold, wherein: If the global maximum deviation index is greater than or equal to the preset behavior gating threshold, then calculate the degree of breach of the current stage pruning model relative to the baseline model on the behavior consistency metric function, add breached samples to the current constraint sample set according to the degree of breach and remove redundant samples, update to obtain a new constraint sample set, and return to the execution step S102. If the global maximum deviation index is less than the preset behavior gating threshold, proceed to step S104; S104. Output the staged pruning model as the finished pruning model.
[0013] Furthermore, in step S101, the behavioral consistency measurement function is defined as follows: , The input sample represents the behavioral consistency metric function. The following relationship must be satisfied: ; in, This represents the output result of the output layer of the baseline model. This represents the output result of the output layer of the staged pruning model. This indicates that the benchmark model is in the first... Intermediate feature representation of a key intermediate feature layer This represents the intermediate feature representation of the staged pruning model at the corresponding key intermediate feature layer. For the key intermediate feature layer index set, and The adaptive coefficients used to adjust the relative weights of output layer constraints and intermediate layer constraints satisfy the following relationship: ; ; in, To constrain the average L2 bias of the output layer under the sample set, To constrain the average L2 bias of all key intermediate layers in the sample set, For the first The inherent importance coefficients of each intermediate feature layer This represents the total number of key intermediate feature layers. This is the smoothing adjustment coefficient.
[0014] Furthermore, in step S102, the network structure overhead is represented by a structural complexity cost function, which is defined as follows: It satisfies the following relationship: ; in, This refers to the number of customizable structural units in the baseline model. For the first Resource cost weights for each of the customizable structural units. For regularization parameters, For the first The structural control variables of the said customizable structural unit; The behavioral constraints are as follows: ; in, For the constrained sample set, For the error budget; The optimization objective is to minimize the structural complexity cost function. And at the same time, the aforementioned behavioral constraints are satisfied; The compression target is: ; in, Indicates the first The structural complexity of the stage reduces the target proportion.
[0015] Furthermore, step S102 specifically includes: In the The stage is based on the structural control variables output from the previous stage. Initialize the current optimization; Solving the optimization objective yields the first... The structural control variables of the stage ; When the structure control variable When the value is less than or equal to the pruning threshold, it is determined that the corresponding pruningable structural unit can be removed or disabled, and a physical pruning operation is performed. When the structure control variable When the value is greater than or equal to the retention threshold, the corresponding cuttable structural unit is determined to be retained and locked through a locking mechanism. After the physical pruning operation is completed, the staged pruning model is obtained; Calculate the first Constraint consistency index of the phased pruning model in the phased stage ,and: ; in For the consistency assessment dataset, This indicates the positive part operation. The behavior consistency measurement function after compensation satisfies the following relationship: ; ; The preset behavioral constraint gating condition is: , This indicates the preset cropping threshold, which is applied only when... At that time, accept the pruning results of the current stage, and let If so, proceed to step S103; otherwise, tighten the error budget. Or lower the stage target Repeat step S102, where , This is the preset adjustment coefficient.
[0016] Furthermore, in step S103, a compensation parameter set consisting of a linear combination of preset basis functions is introduced. The compensation parameter set is then optimized under the behavioral constraints to correct the deviation in the output of the staged pruning model. Specifically, this step involves: The compensation parameter set is defined as follows: The compensation parameter group With a predefined fixed basis function The linear combination form is modified, and it satisfies the following relationship: , .
[0017] Furthermore, in step S103, the step of calculating the degree of breach of the current staged pruning model relative to the baseline model on the behavioral consistency metric function, supplementing the current constraint sample set with breached samples and removing redundant samples based on the degree of breach, and updating to obtain a new constraint sample set, specifically includes: Random sampling or selection of an initial constraint sample set based on lithium battery operating data. ; Based on the initial constraint sample set For each sample, calculate the degree of breach of the current staged pruning model relative to the baseline model on the behavioral consistency metric function. The degree of breach The following relationship must be satisfied: ; Filter out Default sample , and select The largest value Sample Or choose to satisfy samples Add it to the current set of constraints. Among them This is the proportionality coefficient; Remove the current constrained sample set The middle has been satisfied Redundant samples, among which As a redundancy margin, a new set of constraint samples is obtained.
[0018] Furthermore, in step S101, the lithium battery health status analysis neural network includes: Input layer, configured to receive voltage sequences Current sequence Temperature sequence and state of charge timing data; The main body of the network is configured to include at least one layer of a Long Short-Term Memory (LSTM) network or a Temporal Convolutional Network (TCN) for extracting temporal dependency features. The output layer is configured to output the estimated state of battery health (SOH). The key intermediate feature layer includes the hidden state layer of the LSTM or the convolutional feature layer of the TCN.
[0019] Secondly, the present invention also provides a neural network pruning system for lithium battery health status analysis, comprising: An initialization module is used to acquire the trained lithium battery health status analysis neural network as a benchmark model; extract the output results and key intermediate layer features of the benchmark model, and construct a behavior consistency measurement function to characterize the behavior deviation between the benchmark model and the staged pruning model; set a preset maximum behavior deviation range as an error budget, and select lithium battery operating data to generate a constraint sample set; The physical pruning module is used to configure structural control variables for each pruning structural unit in the baseline model, and to optimize the joint parameters based on the behavioral constraints corresponding to the current constraint sample set, with the goal of minimizing network structure overhead. Based on the phased compression target, preset pruning threshold, and preset retention threshold, the optimized structural control variables are discretized and judged. Physical pruning is then implemented according to the discretization judgment result to obtain the phased pruning model. If the phased pruning model satisfies the preset behavioral constraint gating condition, the iterative compensation module is entered; otherwise, the pruning parameters of the physical pruning are adjusted based on the pruning result of the phased pruning model, and the physical pruning module is re-executed. An iterative compensation module is used to fix the network topology of the staged pruning model, introduce a compensation parameter set composed of a linear combination of preset basis functions, optimize the compensation parameter set under the behavioral constraints, and correct the deviation of the output of the staged pruning model. Based on a preset verification dataset, it calculates the global maximum deviation index of the output of the corrected staged pruning model relative to the error budget, and judges the relationship between the global maximum deviation index and a preset behavioral gating threshold, wherein: If the global maximum deviation index is greater than or equal to the preset behavior gating threshold, then calculate the degree of breach of the current stage pruning model relative to the baseline model on the behavior consistency metric function, add breached samples to the current constraint sample set and remove redundant samples according to the degree of breach, update to obtain a new constraint sample set, and return to execute the physical pruning module. If the global maximum deviation index is less than the preset behavior gating threshold, then proceed to the output module; The output module is used to output the staged pruning model as a finished pruning model.
[0020] Thirdly, the present invention also provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the lithium battery health status analysis neural network pruning method as described in any of the above embodiments.
[0021] Fourthly, the present invention also provides a storage medium storing a computer program, which, when executed by a processor, implements the steps in the lithium battery health status analysis neural network pruning method as described in any of the above embodiments.
[0022] The beneficial effects achieved by this invention include: First, by inverting the default samples in the verification stage into the Lagrange activation set constraints in the continuous optimization stage, each iteration of the pruning process uses the default gradient at the worst sample in the previous round as a forced boundary condition, which mathematically guarantees that the structural compression never deviates from the behavioral envelope of the benchmark model, and achieves the nonlinear effect of constraining the default rate to be always zero under the limit compression ratio. Second, dynamic constraints and low-rank repair form an interlocked compensation mechanism through the interweaving of feasible regions, which automatically eliminates constraint redundancy at regular samples and adaptively focuses computing resources on boundary conditions and aging mutation points, significantly improving the engineering reliability in embedded deployments.
[0023] The above effect stems from the closed-loop feedback of data flow between multiple stages and the tight coupling design of optimization variables, which cannot be reproduced by independently improving any existing stage or by simply combining them in sequence.
[0024] In summary, the neural network pruning method for lithium battery health status analysis proposed in this invention establishes a new pruning mechanism based on the stability of model analysis behavior and provable judgment. Under the premise of ensuring the consistency, stability and safety of lithium battery health status analysis results, it effectively compresses the complexity of neural network structure and significantly improves the engineering reliability and long-term availability of the pruning method in battery management systems and related embedded application environments. Attached Figure Description
[0025] 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 steps of the neural network pruning method for lithium battery health status analysis provided in this embodiment of the invention; Figure 2 This is a logical structure diagram of the neural network pruning method for lithium battery health status analysis provided in this embodiment of the invention; Figure 3 This is a curve comparison of the root mean square error (SOH) of the lithium battery health status analysis neural network pruning method provided in this embodiment of the invention with existing methods at various compression ratios. Figure 4 This is a comparison chart of the comprehensive performance of the neural network pruning method for lithium battery health status analysis provided in this embodiment of the invention and existing methods under different compression ratios in terms of inference latency and default rate. Figure 5 This is a schematic diagram of the structure of the neural network pruning system for lithium battery health status analysis provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0026] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0027] The specific embodiments / examples described herein are specific implementations of the present invention, used to illustrate the concept of the invention, and are illustrative and exemplary, and should not be construed as limiting the implementation methods or scope of the present invention. In addition to the embodiments described herein, those skilled in the art can employ other obvious technical solutions based on the content disclosed in the claims and specification of this application. These technical solutions include those that make any obvious substitutions and modifications to the embodiments described herein, all of which are within the protection scope of the present invention.
[0028] Example 1 Regarding the problems mentioned in the background art, the specific technical challenges to be solved by the embodiments of the present invention include: Technical Challenge 1: How to construct a computable and verifiable behavioral constraint mechanism to replace empirical thresholds and post-hoc verification. This requires transforming behavioral consistency from an evaluation indicator into an optimization constraint, and establishing deterministic pruning feasibility verification rules. This transforms the pruning process from experience-driven structural trimming and post-performance verification into a continuously controlled, verifiable, and reproducible optimization process.
[0029] Technical Challenge Two: How to achieve adaptive allocation of constraint resources under complex operating conditions. Lithium battery operating data exhibits significant heterogeneity in operating conditions, differences in aging stages, and abnormal fluctuations. Uniform constraints cannot simultaneously ensure computational efficiency and coverage of key samples. It is necessary to establish an adaptive focusing mechanism for constraint conditions on key operating conditions, boundary states, and abnormal change segments, concentrating computational resources on the most challenging subset of samples.
[0030] Technical Challenge 3: How to achieve efficient structure compression under strict behavioral constraints. There is an inherent tension between hard-constraint optimization and structural sparsity: soft penalty terms cannot guarantee strict constraint satisfaction, discrete search is non-differentiable and prone to combinatorial explosion, and fixed-ratio asymptotic pruning lacks adaptive adjustment capabilities. A pruning execution mechanism that balances constraint strictness and optimization smoothness needs to be designed to achieve a technical chain of "smooth optimization—stable discretization—precise repair".
[0031] Technical Challenge 4: How to provide theoretical guarantees rather than statistical estimates for pruning results. Safety-critical applications require consistent behavior even in the worst-case scenario, but the statistical acceptability of existing technologies has probabilistic uncertainty. It is necessary to establish a calculable criterion for worst-case constraint satisfaction, achieving a paradigm shift from probabilistic acceptability to deterministic provability, and meeting the deterministic verification requirements of battery management system functional safety standards.
[0032] For this, please refer to Figure 1 , Figure 1 This is a flowchart illustrating the steps of the lithium battery health status analysis neural network pruning method provided in this embodiment of the invention. The lithium battery health status analysis neural network pruning method includes the following steps: S101. Obtain the trained lithium battery health status analysis neural network as the benchmark model; extract the output results and key intermediate layer features of the benchmark model, and construct a behavior consistency measurement function to characterize the behavior deviation between the benchmark model and the staged pruning model; set a preset maximum behavior deviation range as the error budget, and select lithium battery operating data to generate a constraint sample set.
[0033] In step S101, the behavioral consistency measurement function is defined as follows: , The input sample represents the behavioral consistency metric function. It includes the output layer output deviation term and the key intermediate feature layer deviation term, and satisfies the following relationship: ; in, This represents the output result of the output layer of the baseline model. This represents the output result of the output layer of the staged pruning model. This indicates that the benchmark model is in the first... Intermediate feature representation of a key intermediate feature layer This represents the intermediate feature representation of the staged pruning model at the corresponding key intermediate feature layer. For the key intermediate feature layer index set, and The adaptive coefficients used to adjust the relative weights of output layer constraints and intermediate layer constraints satisfy the following relationship: ; ; in, To constrain the average L2 bias of the output layer under the sample set, To constrain the average L2 bias of all key intermediate layers in the sample set, For the first The inherent importance coefficients of each intermediate feature layer This represents the total number of key intermediate feature layers. This is the smoothing adjustment coefficient.
[0034] Behavioral consistency measurement function The weights are dynamically allocated by comprehensively considering three dimensions: model bias, network layer importance, and operational stability. First, basic weight allocation is performed based on the bias ratio of the output layer and intermediate feature layers, giving stronger constraints to modules with larger biases and specifically correcting feature and output offsets caused by pruning. Second, the comprehensive importance coefficient of each key intermediate layer is incorporated to differentiate the different contributions of different feature layers to battery SOH estimation, ensuring that the weight allocation aligns with the network's structural characteristics. Finally, a fixed smoothing coefficient is added to effectively avoid problems such as sudden changes in battery operating conditions and drastic weight jumps during pruning iterations, ensuring continuous and stable weight values to meet the stable operation requirements of battery management embedded systems.
[0035] S102. Configure structural control variables for each pruning structural unit in the baseline model, and optimize joint parameters based on the behavioral constraints corresponding to the current constraint sample set, with the optimization objective of minimizing network structure overhead. Discretize the optimized structural control variables according to the phased compression objective, preset pruning threshold and preset retention threshold, and perform physical pruning according to the discretization judgment result to obtain the phased pruning model. If the phased pruning model satisfies the preset behavioral constraint gating condition, proceed to step S103; otherwise, adjust the pruning parameters of physical pruning based on the pruning result of the phased pruning model and re-execute step S102.
[0036] In step S102, the network structure overhead is represented by a structure complexity cost function, which is defined as follows: It satisfies the following relationship: ; in, This refers to the number of customizable structural units in the baseline model. For the first Resource cost weights for each of the customizable structural units. For regularization parameters, For the first The structural control variables of the said customizable structural unit; The behavioral constraints are as follows: ; in, For the constrained sample set, For the error budget; The optimization objective is to minimize the structural complexity cost function. And at the same time, the aforementioned behavioral constraints are satisfied; The compression target is: ; in, Indicates the first The structural complexity of the stage reduces the target proportion.
[0037] Furthermore, step S102 specifically includes: In the The stage is based on the structural control variables output from the previous stage. Initialize the current optimization; Solving the optimization objective yields the first... The structural control variables of the stage ; Due to the aforementioned behavioral constraints In this embodiment of the invention, which involves non-differentiable maximum value operations, the augmented Lagrangian method is used to transform it into a dual problem. The activation set of this constraint is composed of the constraint sample set. China satisfies The sample index is composed of.
[0038] Subsequently, when the structure control variable When the value is less than or equal to the pruning threshold, it is determined that the corresponding pruningable structural unit can be removed or disabled, and a physical pruning operation is performed. When the structure control variable When the value is greater than or equal to the retention threshold, the corresponding cuttable structural unit is determined to be retained and locked through a locking mechanism. After the physical pruning operation is completed, the staged pruning model is obtained; Calculate the first Constraint consistency index of the phased pruning model in the phased stage ,and: ; in For the consistency assessment dataset, This indicates the positive part operation. The behavior consistency measurement function after compensation satisfies the following relationship: ; ; The preset behavioral constraint gating condition is: , This indicates the preset cropping threshold, which is applied only when... At that time, accept the pruning results of the current stage, and let If so, proceed to step S103; otherwise, tighten the error budget. Or lower the stage target Repeat step S102, where , This is the preset adjustment coefficient.
[0039] S103. Fix the network topology of the staged pruning model, introduce a compensation parameter set composed of a linear combination of preset basis functions, optimize the compensation parameter set under the behavioral constraints to correct the deviation of the output of the staged pruning model; based on a preset verification dataset, calculate the global maximum deviation index of the output of the corrected staged pruning model relative to the error budget, and determine the relationship between the global maximum deviation index and the preset behavioral gating threshold, wherein: If the global maximum deviation index is greater than or equal to the preset behavior gating threshold, then calculate the degree of breach of the current stage pruning model relative to the baseline model on the behavior consistency metric function, add breached samples to the current constraint sample set according to the degree of breach and remove redundant samples, update to obtain a new constraint sample set, and return to the execution step S102. During implementation, the preset judgment threshold is related to the functional safety level requirements of the BMS embedded chip, and the global maximum deviation index can be used as input to provide deterministic verification basis to the BMS functional safety monitoring module.
[0040] If the global maximum deviation index is less than the preset behavior gating threshold, then proceed to step S104.
[0041] Step S103, which involves introducing a set of compensation parameters composed of a linear combination of preset basis functions, and optimizing the set of compensation parameters under the behavioral constraints to correct the deviation of the output of the staged pruning model, specifically includes: The compensation parameter set is defined as follows: The compensation parameter group With a predefined fixed basis function The linear combination form is modified, and it satisfies the following relationship: , .
[0042] Step S103, specifically, involves calculating the degree of breach of the current staged pruning model relative to the baseline model on the behavioral consistency metric function, supplementing the current constraint sample set with breached samples and removing redundant samples based on the degree of breach, and updating to obtain a new constraint sample set. Random sampling or selection of an initial constraint sample set based on lithium battery operating data. ; Based on the initial constraint sample set For each sample, calculate the degree of breach of the current staged pruning model relative to the baseline model on the behavioral consistency metric function. The degree of breach The following relationship must be satisfied: ; Filter out Default sample , and select The largest value Sample Or choose to satisfy samples Add it to the current set of constraints. Among them This is the proportionality coefficient; Remove the current constrained sample set The middle has been satisfied Redundant samples, among which As a redundancy margin, a new set of constraint samples is obtained.
[0043] When feeding back default samples in step S103, it actually involves adding constraint sample sets to step S102. China satisfies The activation set composed of sample indices is supplemented with new sample indices, such that when step S102 is re-executed in the next round, the Lagrange multipliers must satisfy the KKT (Karush-Kuhn-Tucker) constraint compactness condition at these newly added default samples, that is, force the behavior deviation at the sample to approach the error budget boundary.
[0044] Specifically, the Lagrange function middle, That is, the activation set. The sample corresponds to the dual variable This constitutes an inherent, mandatory linkage between steps S102 and S103 at the optimization mathematical level. In this process, the sample indices in the activation set directly participate in the structural complexity cost function. The update of the Lagrange dual variable makes the structural control variable The sparsification direction is explicitly driven by default samples.
[0045] S104. Output the staged pruning model as the finished pruning model.
[0046] It should be noted that the aforementioned algorithmic operations, such as dynamic constraint sample supplementation and low-rank repair of the compensation parameter set, are not independent mathematical processing steps. Rather, they are closely related to the hardware constraints of the lithium battery BMS embedded system (including limited storage space, real-time inference latency requirements, and functional safety deterministic verification requirements) in terms of mutual support and interaction. First, the dynamic constraint sample supplementation mechanism adaptively focuses behavioral constraints on boundary conditions and aging mutation samples, avoiding the storage space waste caused by uniform constraints. This directly corresponds to the hardware constraint of the limited storage capacity of the BMS embedded chip. Second, the low-rank repair of the compensation parameter set corrects deviations through a linear combination of basis functions with finite degrees of freedom, avoiding the need for complete gradient calculations in traditional fine-tuning and reducing the requirements for embedded computing power. Finally, the indicators provided by the deterministic verification loop can be quantified and calculated, meeting the technical requirements of the BMS functional safety standard for deterministic verification. This upgrades the pruning results from statistically acceptable to deterministically provable, which is the essential technical feature that distinguishes it from general pruning methods.
[0047] In summary, based on the technical solutions described in the above embodiments, this invention proposes a neural network pruning method with four-ring deep collaboration: dynamic constraints, continuous optimization, low-rank repair, and deterministic verification. For the corresponding details, please refer to... Figure 2 As shown in the logical architecture diagram, in steps S102 and S103 of this embodiment of the invention, the four stages of dynamic constraint, continuous optimization, low-rank repair and deterministic verification together form a pruning feedback closed loop.
[0048] The dynamic constraint process is based on the degree of default. Driving constraint sample set Dynamic updates enable behavioral constraints to adaptively focus on key operating condition samples; continuous optimization processes control structural variables within the constraint boundaries. Perform smooth structural sparsity reduction and staged gating. To prevent cumulative defaults due to constraints; the low-rank repair process uses a compensation parameter set. A linear combination of basis functions is used to perform low-cost correction of discretization behavior bias; the deterministic verification process uses constraint consistency indices. The calculations provide a worst-case theoretical guarantee for the pruning results.
[0049] The four stages form the main process through solid arrows and the feedback loop through dashed arcs, constituting a mutually supportive pruning system, including: Synergy between dynamic constraints and continuous optimization. The dynamic constraint mechanism continuously updates the constraint sample set by ranking the degree of default. This ensures that the continuous optimization process always satisfies constraints on the most challenging subset of samples. This adaptive constraint configuration avoids the problem of over-constraining simple samples and under-constraining difficult samples caused by uniform constraints, concentrating optimization resources on key regions and significantly improving the efficiency and robustness of constraint satisfaction. Simultaneously, the structural control variables output by continuous optimization... It provides differentiable optimization feedback for dynamic constraints, enabling constraint updates to evolve synchronously with structural sparsification.
[0050] The synergy between continuous optimization and stage gating. Continuous structure control variables provide differentiable optimization paths, but ultimately need to be discretized into a physically pruned structure. Stage gating mechanisms perform hard constraint verification at the end of each stage. This prevents constraint relaxation during continuous optimization from accumulating into constraint violations in discrete structures. This alternating strategy of continuous optimization, discrete decision-stage reset balances the smoothness of optimization with the strictness of constraints, enabling the pruning process to maintain a dynamic balance between compression efficiency and behavioral stability.
[0051] The synergy between low-rank repair and deterministic verification. The low-rank repair stage restores constraint satisfaction through compensation parameters with finite degrees of freedom, but its repair effect needs to be confirmed by the deterministic verification stage. The Γ index calculated in the verification stage is not only used for the final judgment, but its default sample information is also fed back to the dynamic constraint stage, driving the update of the constraint sample set. This closed loop of repair-verification-feedback ensures the continuous convergence and final provability of the pruning process, making each structural pruning under the control of deterministic behavioral boundaries. This update is not simply adding samples to the constraint sample set, but rather acting on the next round of continuous optimization by reconstructing the activation set of the behavioral constraints in step S102, so that the newly added default samples act as the forced activation boundary of the Lagrange multipliers in the optimization solution.
[0052] In summary, the four stages—dynamic constraints, continuous optimization, low-rank repair, and deterministic verification—constructed in steps S102 and S103 are not sequential steps, but rather form a tightly coupled relationship of mutual constraints on the feasible domain of the optimization variables: the update strategy of the constraint sample set K directly determines the feasible domain of the compensation parameter φ in low-rank repair, while the upper bound of the degrees of freedom of φ in turn constrains the calculation accuracy of the default degree s(x); simultaneously, if the global maximum deviation Γ output by the deterministic verification stage does not satisfy the gating, the Lagrange multipliers of the continuous optimization stage are adjusted in reverse by updating the activation set in K. This intertwined constraint of the feasible domain of the optimization variables means that an independent change in any stage will destroy the solution feasibility of the other stages, which is different from the conventional approach of existing linear trial-and-error frameworks.
[0053] In step S101, the lithium battery health status analysis neural network includes: Input layer, configured to receive voltage sequences Current sequence Temperature sequence and state of charge timing data; The main body of the network is configured to include at least one layer of a Long Short-Term Memory (LSTM) network or a Temporal Convolutional Network (TCN) for extracting temporally dependent features; The output layer is configured to output the estimated state of battery health (SOH). The key intermediate feature layer includes the hidden state layer of the LSTM or the convolutional feature layer of the TCN.
[0054] To verify the effective design of the method proposed in this invention for strict behavioral consistency and worst-case guarantee under high compression ratios, this invention constructs a complete experimental sample system based on compliant public datasets and data collected from enterprises in real-world scenarios. It also provides multi-dimensional comparative experimental data to comprehensively examine the overall performance of the pruning algorithm under different battery systems, operating conditions, and aging stages. The lithium battery operating data used in the neural network training data and constraint sample sets in this study all have legitimate traceability channels and are mainly divided into two categories: one is internationally recognized open-source lithium battery datasets, including the NASA battery aging dataset, the University of Maryland CALCE dataset, and the Oxford University battery dataset. These public datasets are widely accepted in the global field of lithium battery SOH estimation and model compression. Secondly, the data consists of real-vehicle and laboratory test data legally and compliantly collected from cooperating battery companies and new energy vehicle manufacturers. This data is derived from long-term operating records of commercial lithium battery modules and extreme condition test results under conditions such as high and low temperatures and variable rate. It strictly adheres to data usage agreements and is used solely for this algorithm experiment. It specifically supplements special scenarios that are difficult to cover in open-source data, such as boundary conditions, abnormal fluctuations, and sudden changes in battery aging. This allows for the construction of a constraint sample set that closely matches the actual implementation environment of a battery management system (BMS), ensuring that the experimental conclusions have engineering reference value. The following specific experimental data are provided in this embodiment of the invention: The experiment compared the performance of the MP / L1P / KDP baseline method and the proposed method (BCPP) in this embodiment of the invention at a compression ratio of 80% FLOPs on data from two battery systems, LFP / NCM, UDDS / HPPC / constant current conditions, and different aging stages.
[0055] Evaluation indicators include: Structural metrics: FLOPs compression ratio, parameter compression ratio; Average performance metrics: Mean absolute error (MAE) and root mean square error (RMSE) of SOH estimation; Key metrics: Max Error, Boundary Consistency, Constraint Violation Rate, and Theoretical Guarantee.
[0056] The comparison results are shown in Table 1 below.
[0057] Table 1 Comparative Experimental Data
[0058] As shown in Table 1, under the aggressive condition of 80% FLOPs compression, the method proposed in this embodiment not only outperforms existing methods in terms of average error, but also achieves a worst-case error lower than the original model (6.8% vs 8.5%), significantly improving boundary condition consistency. This more stable behavior after compression demonstrates that the dynamic constraint mechanism effectively covers and protects critical samples. Furthermore, the successful verification of Γ < τ provides a calculable consistency criterion for the pruning results, indicating that the method proposed in this embodiment meets the deterministic verification requirements of safety-critical applications.
[0059] The comparison curves of the root mean square error of SOH at various compression ratios between the method proposed in this embodiment and the existing method are shown below. Figure 3 As shown, by Figure 3 Data shows that as the model compression ratio increases, the root mean square error (RMSE) of the traditional L1P method exhibits a non-linear and dramatic upward trend; especially at the 90% compression limit, the RMSE of the traditional method surges to 8.42%, rendering it unusable for practical engineering applications. In contrast, the method proposed in this invention, through the synergistic effect of dynamic constraints and low-rank repair, maintains high feature consistency even with a significantly simplified structure. Even at a 90% compression ratio, the RMSE of the method proposed in this invention is only 3.05%, a reduction of 63.7% compared to the traditional method, demonstrating strong resistance to degradation.
[0060] The proposed method in this invention is compared with existing methods in terms of the comprehensive performance of inference latency and default rate under different compression ratios. Figure 4 As shown in the figure. It can be seen that the method proposed in this embodiment of the invention brings significant hardware execution benefits while achieving model lightweighting. Taking BCPP-70% as an example, its memory usage drops sharply from the original 850KB to 272KB, and the inference latency is shortened from 45.2ms to 16.0ms, fully meeting the high-frequency computing requirements of BMS real-time scheduling; more importantly, as Figure 4 As shown on the right-hand coordinate axis (broken line portion), the constraint default rate of the method proposed in this embodiment of the invention remains at 0% under all compression gradients. This fully demonstrates the effectiveness of the deterministic verification mechanism in the method proposed in this embodiment of the invention: as long as the model passes... The decision boundary is such that, regardless of the pruning ratio, the system will not exhibit uncontrollable behavioral deviations under extreme operating conditions in the test set. This characteristic of maintaining a low default rate and safety baseline even under extreme compression is difficult to achieve with existing methods.
[0061] The beneficial effects achieved by this invention include: First, by inverting the default samples in the verification stage into the Lagrange activation set constraints in the continuous optimization stage, each iteration of the pruning process uses the default gradient at the worst sample in the previous round as a forced boundary condition, which mathematically guarantees that the structural compression never deviates from the behavioral envelope of the benchmark model, and achieves the nonlinear effect of constraining the default rate to be always zero under the limit compression ratio. Second, dynamic constraints and low-rank repair form an interlocked compensation mechanism through the interweaving of feasible regions, which automatically eliminates constraint redundancy at regular samples and adaptively focuses computing resources on boundary conditions and aging mutation points, significantly improving the engineering reliability in embedded deployments.
[0062] The aforementioned effects stem from the closed-loop feedback of data flow between multiple stages and the tightly coupled design of optimization variables, which cannot be reproduced by independently improving any existing stage or by simply combining them sequentially. In summary, the neural network pruning method for lithium battery health state analysis proposed in this invention establishes a novel pruning mechanism based on the stability of model analysis behavior and provable judgment. This effectively compresses the complexity of the neural network structure while ensuring the consistency, stability, and safety of lithium battery health state analysis results, significantly improving the engineering reliability and long-term availability of the pruning method in battery management systems and related embedded application environments.
[0063] Example 2 This invention also provides a neural network pruning system 200 for lithium battery health status analysis. Please refer to [link / reference]. Figure 5 , Figure 5 This is a schematic diagram of the structure of the neural network pruning system for lithium battery health status analysis provided in an embodiment of the present invention, which includes: Initialization module 201 is used to acquire the trained lithium battery health status analysis neural network as a benchmark model; extract the output results and key intermediate layer features of the benchmark model, and construct a behavior consistency measurement function to characterize the behavior deviation between the benchmark model and the staged pruning model; set a preset maximum behavior deviation range as an error budget, and select lithium battery operating data to generate a constraint sample set; The physical pruning module 202 is used to configure structural control variables for each pruning structural unit in the baseline model, and to optimize the joint parameters based on the behavioral constraints corresponding to the current constraint sample set, with the goal of minimizing network structure overhead. Based on the phased compression target, preset pruning threshold, and preset retention threshold, the optimized structural control variables are discretized and judged. Physical pruning is then implemented according to the discretization judgment result to obtain the phased pruning model. If the phased pruning model satisfies the preset behavioral constraint gating condition, the iterative compensation module is entered; otherwise, the pruning parameters of the physical pruning are adjusted based on the pruning result of the phased pruning model, and the physical pruning module is re-executed. The iterative compensation module 203 is used to fix the network topology of the staged pruning model, introduce a compensation parameter set composed of a linear combination of preset basis functions, optimize the compensation parameter set under the behavioral constraints, and correct the deviation of the output of the staged pruning model. Based on a preset verification dataset, it calculates the global maximum deviation index of the corrected output of the staged pruning model relative to the error budget, and judges the relationship between the global maximum deviation index and a preset behavioral gating threshold, wherein: If the global maximum deviation index is greater than or equal to the preset behavior gating threshold, then calculate the degree of breach of the current stage pruning model relative to the baseline model on the behavior consistency metric function, add breached samples to the current constraint sample set and remove redundant samples according to the degree of breach, update to obtain a new constraint sample set, and return to execute the physical pruning module. If the global maximum deviation index is less than the preset behavior gating threshold, then proceed to the output module; The output module 204 is used to output the staged pruning model as a finished pruning model.
[0064] The lithium battery health status analysis neural network pruning system 200 can implement the steps in the lithium battery health status analysis neural network pruning method in the above embodiments and achieve the same technical effect. Referring to the description in the above embodiments, it will not be repeated here.
[0065] Example 3 This invention also provides a computer device, please refer to... Figure 6 , Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. The computer device 300 includes: a memory 302, a processor 301, and a computer program stored in the memory 302 and executable on the processor 301.
[0066] The processor 301 calls the computer program stored in the memory 302 to execute the steps in the lithium battery health status analysis neural network pruning method provided in this embodiment of the invention. Please refer to... Figure 1 Specifically, it includes the following steps: S101. Obtain the trained lithium battery health status analysis neural network as the benchmark model; extract the output results and key intermediate layer features of the benchmark model, and construct a behavior consistency measurement function to characterize the behavior deviation between the benchmark model and the staged pruning model; set a preset maximum behavior deviation range as the error budget, and select lithium battery operating data to generate a constraint sample set.
[0067] In step S101, the behavioral consistency measurement function is defined as follows: , The input sample represents the behavioral consistency metric function. The following relationship must be satisfied: ; in, This represents the output result of the output layer of the baseline model. This represents the output result of the output layer of the staged pruning model. This indicates that the benchmark model is in the first... Intermediate feature representation of a key intermediate feature layer This represents the intermediate feature representation of the staged pruning model at the corresponding key intermediate feature layer. For the key intermediate feature layer index set, and The adaptive coefficients used to adjust the relative weights of output layer constraints and intermediate layer constraints satisfy the following relationship: ; ; in, To constrain the average L2 bias of the output layer under the sample set, To constrain the average L2 bias of all key intermediate layers in the sample set, For the first The inherent importance coefficients of each intermediate feature layer This represents the total number of key intermediate feature layers. This is the smoothing adjustment coefficient.
[0068] S102. Configure structural control variables for each pruning structural unit in the baseline model, and optimize joint parameters based on the behavioral constraints corresponding to the current constraint sample set, with the optimization objective of minimizing network structure overhead. Discretize the optimized structural control variables according to the phased compression objective, preset pruning threshold and preset retention threshold, and perform physical pruning according to the discretization judgment result to obtain the phased pruning model. If the phased pruning model satisfies the preset behavioral constraint gating condition, proceed to step S103; otherwise, adjust the pruning parameters of physical pruning based on the pruning result of the phased pruning model and re-execute step S102.
[0069] In step S102, the network structure overhead is represented by a structure complexity cost function, which is defined as follows: It satisfies the following relationship: ; in, This refers to the number of customizable structural units in the baseline model. For the first Resource cost weights for each of the customizable structural units. For regularization parameters, For the first The structural control variables of the said customizable structural unit; The behavioral constraints are as follows: ;
[0070] in, For the constrained sample set, For the error budget; The optimization objective is to minimize the structural complexity cost function. And at the same time, the aforementioned behavioral constraints are satisfied; The compression target is: ; in, Indicates the first The structural complexity of the stage reduces the target proportion.
[0071] Furthermore, step S102 specifically includes: In the The stage is based on the structural control variables output from the previous stage. Initialize the current optimization; Solving the optimization objective yields the first... The structural control variables of the stage ; When the structure control variable When the value is less than or equal to the pruning threshold, it is determined that the corresponding pruningable structural unit can be removed or disabled, and a physical pruning operation is performed. When the structure control variable When the value is greater than or equal to the retention threshold, the corresponding cuttable structural unit is determined to be retained and locked through a locking mechanism. After the physical pruning operation is completed, the staged pruning model is obtained; Calculate the first Constraint consistency index of the phased pruning model in the phased stage ,and: ; in For the consistency assessment dataset, This indicates the positive part operation. The behavior consistency measurement function after compensation satisfies the following relationship: ; ; The preset behavioral constraint gating condition is: , This indicates the preset cropping threshold, which is applied only when... At that time, accept the pruning results of the current stage, and let If so, proceed to step S103; otherwise, tighten the error budget. Or lower the stage target Repeat step S102, where , This is the preset adjustment coefficient.
[0072] S103. Fix the network topology of the staged pruning model, introduce a compensation parameter set composed of a linear combination of preset basis functions, optimize the compensation parameter set under the behavioral constraints to correct the deviation of the output of the staged pruning model; based on a preset verification dataset, calculate the global maximum deviation index of the output of the corrected staged pruning model relative to the error budget, and determine the relationship between the global maximum deviation index and the preset behavioral gating threshold, wherein: If the global maximum deviation index is greater than or equal to the preset behavior gating threshold, then calculate the degree of breach of the current stage pruning model relative to the baseline model on the behavior consistency metric function, add breached samples to the current constraint sample set according to the degree of breach and remove redundant samples, update to obtain a new constraint sample set, and return to the execution step S102. If the global maximum deviation index is less than the preset behavior gating threshold, then proceed to step S104.
[0073] Step S103, which involves introducing a set of compensation parameters composed of a linear combination of preset basis functions, and optimizing the set of compensation parameters under the behavioral constraints to correct the deviation of the output of the staged pruning model, specifically includes: The compensation parameter set is defined as follows: The compensation parameter group With a predefined fixed basis function The linear combination form is modified, and it satisfies the following relationship: , .
[0074] Step S103, specifically, involves calculating the degree of breach of the current staged pruning model relative to the baseline model on the behavioral consistency metric function, supplementing the current constraint sample set with breached samples and removing redundant samples based on the degree of breach, and updating to obtain a new constraint sample set. Random sampling or selection of an initial constraint sample set based on lithium battery operating data. ; Based on the initial constraint sample set For each sample, calculate the degree of breach of the current staged pruning model relative to the baseline model on the behavioral consistency metric function. The degree of breach The following relationship must be satisfied: ; Filter out Default sample , and select The largest value Sample Or choose to satisfy samples Add it to the current set of constraints. Among them This is the proportionality coefficient; Remove the current constrained sample set The middle has been satisfied Redundant samples, among which As a redundancy margin, a new set of constraint samples is obtained.
[0075] S104. Output the staged pruning model as the finished pruning model.
[0076] In step S101, the lithium battery health status analysis neural network includes: Input layer, configured to receive voltage sequences Current sequence Temperature sequence and state of charge timing data; The main body of the network is configured to include at least one layer of a Long Short-Term Memory (LSTM) network or a Temporal Convolutional Network (TCN) for extracting temporal dependency features. The output layer is configured to output the estimated state of battery health (SOH). The key intermediate feature layer includes the hidden state layer of the LSTM or the convolutional feature layer of the TCN.
[0077] The computer device 300 provided in this embodiment of the invention can implement the steps in the lithium battery health status analysis neural network pruning method as described in the above embodiments, and can achieve the same technical effect. Referring to the description in the above embodiments, it will not be repeated here.
[0078] Example 4 This invention also provides a storage medium storing a computer program. When executed by a processor, the computer program implements the various processes and steps in the lithium battery health status analysis neural network pruning method provided in this invention, and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0079] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by hardware related to computer programs or instructions. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0080] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0081] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0082] The embodiments of the present invention have been described above with reference to the accompanying drawings. The disclosed embodiments are merely preferred embodiments of the present invention. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many equivalent changes in form under the guidance of the present invention without departing from the spirit and scope of the claims. All such changes are within the protection scope of the present invention.
Claims
1. A neural network pruning method for lithium battery health status analysis, characterized in that, Includes the following steps: S101. Obtain the trained lithium battery health status analysis neural network as a benchmark model; extract the output results and key intermediate layer features of the benchmark model, and construct a behavior consistency measurement function to characterize the behavior deviation between the benchmark model and the staged pruning model. A preset maximum behavior deviation range is set as the error budget, and a constraint sample set is generated by selecting lithium battery operating data; S102. Configure structural control variables for each pruning structural unit in the baseline model, and optimize joint parameters based on the behavioral constraints corresponding to the current constraint sample set, with the goal of minimizing network structure overhead. Discretize the optimized structural control variables according to the phased compression target, preset pruning threshold and preset retention threshold, and perform physical pruning according to the discretization result to obtain the phased pruning model. If the phased pruning model meets the preset behavioral constraint gating condition, proceed to step S103; otherwise, adjust the pruning parameters of physical pruning based on the pruning result of the phased pruning model and re-execute step S102. S103. Fix the network topology of the staged pruning model, introduce a compensation parameter set composed of a linear combination of preset basis functions, optimize the compensation parameter set under the behavioral constraints to correct the deviation of the output of the staged pruning model; based on a preset verification dataset, calculate the global maximum deviation index of the output of the corrected staged pruning model relative to the error budget, and determine the relationship between the global maximum deviation index and the preset behavioral gating threshold, wherein: If the global maximum deviation index is greater than or equal to the preset behavior gating threshold, then calculate the degree of breach of the current stage pruning model relative to the baseline model on the behavior consistency metric function, add breached samples to the current constraint sample set according to the degree of breach and remove redundant samples, update to obtain a new constraint sample set, and return to the execution step S102. If the global maximum deviation index is less than the preset behavior gating threshold, proceed to step S104; S104. Output the staged pruning model as the finished pruning model.
2. The neural network pruning method for lithium battery health status analysis according to claim 1, characterized in that, In step S101, the behavioral consistency measurement function is defined as follows: , The input sample represents the behavioral consistency metric function. It includes the output layer output deviation term and the key intermediate feature layer deviation term, and satisfies the following relationship: ; in, This represents the output result of the output layer of the baseline model. This represents the output result of the output layer of the staged pruning model. This indicates that the benchmark model is in the first... Intermediate feature representation of a key intermediate feature layer This represents the intermediate feature representation of the staged pruning model at the corresponding key intermediate feature layer. For the key intermediate feature layer index set, and The adaptive coefficients used to adjust the relative weights of output layer constraints and intermediate layer constraints satisfy the following relationship: ; ; in, To constrain the average L2 bias of the output layer under the sample set, To constrain the average L2 bias of all key intermediate layers in the sample set, For the first The inherent importance coefficients of each intermediate feature layer This represents the total number of key intermediate feature layers. This is the smoothing adjustment coefficient.
3. The lithium battery health status analysis neural network pruning method according to claim 2, characterized in that, In step S102, the network structure overhead is represented by a structure complexity cost function, which is defined as follows: It satisfies the following relationship: ; in, This refers to the number of customizable structural units in the baseline model. For the first Resource cost weights for each of the customizable structural units. For regularization parameters, For the first The structural control variables of the said customizable structural unit; The behavioral constraints are as follows: ; in, For the constrained sample set, For the error budget; The optimization objective is to minimize the structural complexity cost function. And at the same time, the aforementioned behavioral constraints are satisfied; The compression target is: ; in, Indicates the first The structural complexity of the stage reduces the target proportion.
4. The neural network pruning method for lithium battery health status analysis according to claim 3, characterized in that, Step S102 is as follows: In the The stage is based on the structural control variables output from the previous stage. Initialize the current optimization; Solving the optimization objective yields the first... The structural control variables of the stage ; When the structure control variable When the value is less than or equal to the pruning threshold, it is determined that the corresponding pruningable structural unit can be removed or disabled, and a physical pruning operation is performed. When the structure control variable When the value is greater than or equal to the retention threshold, the corresponding cuttable structural unit is determined to be retained and locked through a locking mechanism. After the physical pruning operation is completed, the staged pruning model is obtained; Calculate the first Constraint consistency index of the phased pruning model in the phased stage ,and: ; in For the consistency assessment dataset, This indicates the positive part operation. The behavior consistency measurement function after compensation satisfies the following relationship: ; ; The preset behavioral constraint gating condition is: , This indicates the preset cropping threshold, which is applied only when... At that time, accept the pruning results of the current stage, and let If so, proceed to step S103; otherwise, tighten the error budget. Or lower the stage target Repeat step S102, where , This is the preset adjustment coefficient.
5. The lithium battery health status analysis neural network pruning method according to claim 4, characterized in that, Step S103, which involves introducing a set of compensation parameters composed of a linear combination of preset basis functions, and optimizing the set of compensation parameters under the behavioral constraints to correct the deviation of the output of the staged pruning model, specifically includes: The compensation parameter set is defined as follows: The compensation parameter group With a predefined fixed basis function The linear combination form is modified, and it satisfies the following relationship: , 。 6. The lithium battery health status analysis neural network pruning method according to claim 5, characterized in that, Step S103, specifically, involves calculating the degree of breach of the current staged pruning model relative to the baseline model on the behavioral consistency metric function, supplementing the current constraint sample set with breached samples and removing redundant samples based on the degree of breach, and updating to obtain a new constraint sample set. Random sampling or selection of an initial constraint sample set based on lithium battery operating data. ; Based on the initial constraint sample set For each sample, calculate the degree of breach of the current staged pruning model relative to the baseline model on the behavioral consistency metric function. The degree of breach The following relationship must be satisfied: ; Filter out Default sample , and select The largest value Sample Or choose to satisfy samples Add it to the current set of constraints. Among them This is the proportionality coefficient; Remove the current constrained sample set The middle has been satisfied Redundant samples, among which As a redundancy margin, a new set of constraint samples is obtained.
7. The neural network pruning method for lithium battery health status analysis according to claim 2, characterized in that, In step S101, the lithium battery health status analysis neural network includes: Input layer, configured to receive voltage sequences Current sequence Temperature sequence and state of charge timing data; The main body of the network is configured to include at least one layer of a Long Short-Term Memory (LSTM) network or a Temporal Convolutional Network (TCN) for extracting temporally dependent features; The output layer is configured to output the estimated state of battery health (SOH). The key intermediate feature layer includes the hidden state layer of the LSTM or the convolutional feature layer of the TCN.
8. A neural network pruning system for analyzing the health status of lithium batteries, characterized in that, include: An initialization module is used to obtain the trained lithium battery health status analysis neural network as a benchmark model; extract the output results and key intermediate layer features of the benchmark model, and construct a behavior consistency measurement function to characterize the behavior deviation between the benchmark model and the staged pruning model. A preset maximum behavior deviation range is set as the error budget, and a constraint sample set is generated by selecting lithium battery operating data; The physical pruning module is used to configure structural control variables for each pruning structural unit in the baseline model, and to optimize the joint parameters based on the behavioral constraints corresponding to the current constraint sample set, with the goal of minimizing network structure overhead. Based on the phased compression target, preset pruning threshold, and preset retention threshold, the optimized structural control variables are discretized and judged. Physical pruning is then implemented according to the discretization judgment result to obtain the phased pruning model. If the phased pruning model satisfies the preset behavioral constraint gating condition, the iterative compensation module is entered; otherwise, the pruning parameters of the physical pruning are adjusted based on the pruning result of the phased pruning model, and the physical pruning module is re-executed. An iterative compensation module is used to fix the network topology of the staged pruning model, introduce a compensation parameter set composed of a linear combination of preset basis functions, optimize the compensation parameter set under the behavioral constraints, and correct the deviation of the output of the staged pruning model. Based on a preset verification dataset, it calculates the global maximum deviation index of the output of the corrected staged pruning model relative to the error budget, and judges the relationship between the global maximum deviation index and a preset behavioral gating threshold, wherein: If the global maximum deviation index is greater than or equal to the preset behavior gating threshold, then calculate the degree of breach of the current stage pruning model relative to the baseline model on the behavior consistency metric function, add breached samples to the current constraint sample set and remove redundant samples according to the degree of breach, update to obtain a new constraint sample set, and return to execute the physical pruning module. If the global maximum deviation index is less than the preset behavior gating threshold, then proceed to the output module; The output module is used to output the staged pruning model as a finished pruning model.
9. A computer device, characterized in that, include: The system includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the neural network pruning method for lithium battery health status analysis as described in any one of claims 1-7.
10. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps in the neural network pruning method for lithium battery health status analysis as described in any one of claims 1-7.