A non-ideal characteristic perception structured pruning method for a memristor storage-computing integrated architecture

CN122965600APending Publication Date: 2026-10-23HARBIN INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611272645.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-21
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0008]有鉴于此,本发明旨在提出一种面向忆阻器存算一体架构的非理想特性感知结构化剪枝方法,以解决现有结构化剪枝方案无法同时适配忆阻器存算一体架构的容量约束与非理想特性约束的问题

Benefits of technology

现有结构化剪枝方案的决策逻辑普遍围绕权重幅值或全局压缩目标展开,未关联忆阻器件的物理非理想特性与卷积神经网络的特征传播规律,导致剪枝结果与硬件部署需求存在本质错位。本发明首先针对每个卷积层单独构建电导漂移的乘性噪声模型,通过向单层注入噪声后统计模型精度的平均下降量,量化该层的噪声敏感度。该量化方式直接反映噪声经该层传播后对最终推理结果的实际影响,相较于仅参考权重幅值或梯度的评估方式,更贴合忆阻器阵列的实际工作状态。现有方案未识别浅层特征的跨层复用特性与深层特征的冗余特性,无法建立层间敏感度与剪枝率的关联逻辑,本发明基于量化得到的层间敏感度差异,按照反相关关系分配各层剪枝率:对噪声敏感度更高的层分配更低的剪枝率,对敏感度更低的层分配更高的剪枝率。该分配逻辑契合卷积神经网络的层级特征规律:浅层卷积层提取的边缘、纹理等底层特征会被后续所有网络层反复复用,噪声注入浅层后会随前向传播逐层累积放大,因此需保留更多通道以降低噪声干扰概率;深层卷积层编码的高级语义特征冗余度高,少量通道即可承载核心信息,因此可承受更高的剪枝率。该分配方式从全局层面避免了噪声敏感层的过度裁剪,从根源上抑制了剪枝与噪声耦合带来的精度衰减。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122965600A_ABST
    Figure CN122965600A_ABST
Patent Text Reader

Abstract

The application discloses a non-ideal characteristic perception structured pruning method for a memristor storage-computing integrated architecture, and belongs to the cross technical field of artificial intelligence hardware acceleration and model compression. The method solves the problem that an existing structured pruning scheme cannot simultaneously adapt to the capacity constraint and non-ideal characteristic constraint of the memristor storage-computing integrated architecture. The method comprises the following steps: obtaining a pre-trained convolutional neural network and a target global pruning rate; for each convolutional layer of the convolutional neural network, constructing a conductance drift noise model; quantifying the noise sensitivity of each convolutional layer with respect to the conductance drift; determining the actual pruning rate of each convolutional layer according to the target global pruning rate and the normalized noise sensitivity of each convolutional layer; based on the second-order Taylor expansion of a loss function, constructing a signal-to-noise ratio importance score of each channel in each convolutional layer; and performing channel pruning on each convolutional layer according to the order from low to high of the signal-to-noise ratio importance scores of the channels in the layer according to the actual pruning rate of each convolutional layer. The method is mainly used in the field of memristor design.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the interdisciplinary technical field of artificial intelligence hardware acceleration and model compression, and in particular relates to a non-ideal characteristic-aware structured pruning method for memristor in-memory computing architecture. Background Technology

[0002] Memristors, as an emerging non-volatile memory device, possess characteristics of high density, low power consumption, and nanosecond-level read / write speeds. Their inherent in-memory computing capability can overcome the memory wall limitations of the von Neumann architecture, demonstrating significant application potential in the field of convolutional neural network inference acceleration. In the memristor in-memory computing architecture, network weights are directly programmed as the conductance values ​​of memristor cells. Kirchhoff's current law is used to perform multiplication and addition operations in parallel in the analog domain, completely eliminating the frequent weight data transfer overhead in traditional architectures. This achieves orders-of-magnitude improvements in energy efficiency and throughput, making it a key research direction for current edge-side intelligent computing chips.

[0003] The practical deployment of this type of architecture faces two inherent constraints that are difficult to reconcile. Firstly, there is the rigid limitation of hardware resources. The integrated capacity of existing single memristor-based in-memory computing chips is far lower than the parameter scale of modern convolutional neural networks. The number of parameters in general-purpose convolutional neural networks often reaches tens of millions, far exceeding the capacity of current mass-produced chips. Therefore, lightweight processing of the network using model compression techniques such as pruning is necessary to achieve complete mapping on a single chip. Secondly, there is the interference from the non-ideal characteristics of the device. Affected by the thermodynamic relaxation mechanism of the conductive filament, the conductivity value of the memristor unit after programming will drift with operating time, ambient temperature, and read / write disturbances. During the inference phase, this manifests as multiplicative noise acting on the weights. This noise directly interferes with the multiply-accumulate operation results, causing an irreversible decrease in model inference accuracy and severely impacting deployment reliability.

[0004] Existing pruning schemes for neural networks mainly fall into two categories: unstructured pruning and structured pruning. Unstructured pruning achieves high compression rates by removing individual connections with small amplitudes from the weight matrix, but the resulting sparse weight distribution is extremely irregular, failing to match the dense and regular mapping requirements of memristor cross-connect arrays. This results in poor hardware compatibility and makes it difficult to implement in in-memory computing architectures. Structured pruning, on the other hand, uses convolutional channels as the smallest pruning unit. The pruned network structure is regular and can directly correspond to the word line and bit line mapping relationship of memristor cross-connect arrays. It requires no additional hardware circuitry and is the mainstream compression scheme adapted to in-memory computing architectures.

[0005] Existing structured pruning schemes fail to consider the non-ideal characteristics of memristor devices in their scoring criteria and pruning rate allocation logic. They generally adopt amplitude ranking criteria based on the L1 norm of weights or apply a globally uniform pruning rate to all convolutional layers of the network, which has two fundamental flaws. First, different convolutional layers have significantly different sensitivities to conductance drift noise. Shallow convolutional layers are responsible for extracting low-level features such as edges and textures, which are repeatedly reused by all subsequent network layers. Noise injected into shallow layers accumulates and amplifies layer by layer as it propagates forward, resulting in a much greater accuracy attenuation than deep convolutional layers at the same noise intensity. Deep convolutional layers, on the other hand, encode high-level semantic features and have high inter-channel redundancy, which can form a natural buffer against noise disturbances. Existing schemes do not quantify the differences in sensitivity between layers, and assigning excessively high pruning rates to noise-sensitive shallow layers will directly destroy the feature extraction foundation of the model. Secondly, there is a strong coupling effect between pruning operations and conductivity drift noise. After pruning, the remaining channels need to independently undertake all feature representation tasks. The relative interference intensity of noise on each retained weight increases superlinearly with the pruning rate. Existing solutions neither explicitly model this coupling effect nor introduce noise-resistant optimization objectives in pruning decisions, resulting in a superlinear deterioration of model accuracy with the increase of pruning rate. The accuracy declines rapidly in the high compression rate range where the pruning rate exceeds 60%, and drops sharply above 80%, which cannot meet the needs of practical applications.

[0006] A few pruning schemes optimized for memristor-based in-memory computing architectures, while attempting to introduce noise-aware logic, remain at the level of globally uniform pruning rate adjustment or gradient-weighted amplitude scoring. These schemes neither establish a correlation mechanism between inter-layer sensitivity differences and pruning rate allocation, nor integrate channel functional importance and noise vulnerability into a unified evaluation criterion. Therefore, they cannot fundamentally suppress the coupling effect of pruning and noise, resulting in inference accuracy in the high compression ratio range remaining far below the usable threshold. Furthermore, these schemes often require additional hardware circuitry to implement noise calibration or dynamic pruning, violating the low-overhead design intent of in-memory computing chips.

[0007] In summary, existing structured pruning schemes cannot simultaneously adapt to the capacity constraints and non-ideal characteristic constraints of memristor in-memory computing architectures. The accuracy collapse problem under high compression ratios has not been effectively solved. There is an urgent need for a structured pruning scheme that is purely software-based, requires no additional hardware support, and can fundamentally balance compression efficiency and noise robustness to meet the actual deployment needs of memristor in-memory computing chips. Summary of the Invention

[0008] In view of this, the present invention aims to propose a non-ideal characteristic-aware structured pruning method for memristor in-memory computing architecture, in order to solve the problem that existing structured pruning schemes cannot simultaneously adapt to the capacity constraints and non-ideal characteristic constraints of memristor in-memory computing architecture.

[0009] To achieve the above objectives, the present invention adopts the following technical solution: a non-ideal characteristic-aware structured pruning method for memristor-based in-memory computing architectures, the method comprising: Obtain the pre-trained convolutional neural network and the target global pruning rate; For each convolutional layer of the convolutional neural network, a conductance drift noise model is constructed. The conductance drift noise model is a zero-mean layer-by-layer multiplicative Gaussian noise model applied to the weights of that layer. Based on the conductance drift noise model, the noise sensitivity of each convolutional layer relative to conductance drift is quantified. The noise sensitivity is defined as the Monte Carlo average decrease in model accuracy after applying the multiplicative Gaussian noise only to that layer. The actual pruning rate of each convolutional layer is determined based on the target global pruning rate and the normalized noise sensitivity of each convolutional layer, so that the convolutional layer with higher normalized noise sensitivity is assigned a lower actual pruning rate. Based on the second-order Taylor expansion of the loss function, the signal-to-noise ratio importance score of each channel in each convolutional layer is constructed. The numerator of the signal-to-noise ratio importance score is the square of the channel functional importance, and the denominator is the noise-induced variance. Based on the actual pruning rate of each convolutional layer, channel pruning is performed in order of increasing signal-to-noise ratio importance score for each channel within that layer.

[0010] Furthermore, a preferred embodiment is proposed, wherein quantizing the noise sensitivity of each convolutional layer relative to conductance drift includes: For the i A convolutional layer is formed, and the multiplicative Gaussian noise is applied only to the weights of that layer to obtain a noisy model; Run the test set on the noisy model and calculate the current test accuracy; Repeat the steps described above for applying noise and running the test set. K Next, calculate K The average decrease in accuracy relative to the clean model across all tests is taken as the average decrease in accuracy across all tests. i Noise sensitivity of each convolutional layer ; The multiplicative Gaussian noise is expressed as:

[0011] in, For noisy weights, For the original weights, For noise variables, This represents the noise standard deviation of the convolutional layer.

[0012] Furthermore, a preferred method is proposed, wherein the step of determining the actual pruning rate of each convolutional layer according to the target global pruning rate and the normalized noise sensitivity of each convolutional layer based on the inverse correlation is achieved by the following formula:

[0013] in, For the first i The actual pruning rate of the layer, For the global pruning rate, For adaptive intensity factor, This is the lower limit of the pruning rate. This is the upper limit of the pruning rate. This represents the normalized noise sensitivity.

[0014] Furthermore, a preferred method is proposed, wherein the normalized noise sensitivity It can be obtained through the following formula:

[0015] in, This represents the minimum sensitivity of all convolutional layers. This represents the maximum sensitivity of all convolutional layers. To prevent small constants from being divided by zero.

[0016] Furthermore, a preferred method is proposed, wherein the construction of the signal-to-noise ratio importance score for each channel in each convolutional layer includes: Perform on the calibration dataset N The second backpropagation, the N The sum of the gradient of the loss function with respect to the weights and the product of the weights, and the sum of their squares, is calculated. Calculate the importance of channel functionality based on the cumulative results. and noise-induced variance : , , in, For loss pairs of weights gradient, Indicates the channel index. Expressing expectations; According to the above I(c) and V(c) Calculate the importance score of signal-to-noise ratio :

[0017] in, To prevent small constants from being divided by zero.

[0018] Furthermore, a preferred method is proposed, wherein the standard deviation of the multiplicative Gaussian noise is a value set independently for each convolutional layer or uniformly globally, ranging from 0.05 to 0.30, where 0.05 corresponds to low conductivity drift condition and 0.30 corresponds to high conductivity drift condition, and the intermediate value is adapted between the two according to the drift amplitude to cover the conductivity drift amplitude of the memristor under different drift conditions.

[0019] Furthermore, a preferred method is proposed, which involves the number of Monte Carlo samplings. K It is an integer between 10 and 30.

[0020] Furthermore, a preferred approach is proposed, which includes a step of fine-tuning the pruned network after channel pruning, wherein the fine-tuning process does not introduce the conductivity drift noise model.

[0021] Based on the same inventive concept, the present invention also proposes a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes a non-ideal characteristic-aware structured pruning method for memristor in-memory computing architecture as described in any of the preceding claims.

[0022] Based on the same inventive concept, the present invention also proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of a non-ideal characteristic-aware structured pruning method for memristor in-memory computing architecture as described in any one of the above-mentioned methods.

[0023] Compared with the prior art, the beneficial effects of the present invention are: Existing structured pruning schemes generally revolve around weight magnitudes or global compression targets, failing to consider the physical non-ideal characteristics of memristor devices and the feature propagation patterns of convolutional neural networks. This leads to a fundamental misalignment between pruning results and hardware deployment requirements. This invention first constructs a multiplicative noise model of conductance drift for each convolutional layer. By statistically analyzing the average decrease in model accuracy after injecting noise into a single layer, the noise sensitivity of that layer is quantified. This quantification method directly reflects the actual impact of noise propagation through that layer on the final inference result, and compared to evaluation methods that only consider weight magnitudes or gradients, it better reflects the actual operating state of memristor arrays. Existing schemes fail to identify the cross-layer reuse characteristics of shallow features and the redundancy characteristics of deep features, making it impossible to establish a correlation between inter-layer sensitivity and pruning rate. This invention, based on the quantified differences in inter-layer sensitivity, allocates the pruning rate of each layer according to an inverse correlation: layers with higher noise sensitivity are assigned lower pruning rates, and layers with lower sensitivity are assigned higher pruning rates. This allocation logic aligns with the hierarchical characteristics of convolutional neural networks: low-level features such as edges and textures extracted by shallow convolutional layers are repeatedly reused by all subsequent network layers; noise injected into shallow layers accumulates and amplifies layer by layer during forward propagation, thus requiring more channels to reduce the probability of noise interference; high-level semantic features encoded by deep convolutional layers have high redundancy, and a small number of channels can carry core information, thus allowing for higher pruning rates. This allocation method avoids over-pruning of noise-sensitive layers at the global level, fundamentally suppressing the accuracy degradation caused by the coupling between pruning and noise.

[0024] In the intra-layer channel selection stage, this invention derives the signal-to-noise ratio (SNR) importance score based on a second-order approximation of the loss function under noise-free conditions, integrating the channel's functional contribution and noise vulnerability into a unified evaluation criterion. The channel's functional importance is characterized by the absolute value of the expected change in the loss function after removing the channel, reflecting the channel's core role in the inference result. The noise-induced variance is characterized by the loss fluctuation power corresponding to the channel under noise, reflecting the channel's fluctuation degree affected by conductance drift. The SNR importance score is determined by the ratio of the square of the functional importance to the noise-induced variance; a higher score indicates a higher proportion of functional contribution and less fluctuation affected by noise. This scoring criterion overcomes the limitation of existing schemes that rely solely on weight amplitudes, distinguishing channels with similar weight amplitudes but differences in functional importance or noise resistance. It solves the technical problem of existing schemes being unable to simultaneously consider functional importance and noise resistance, ensuring that only core channels with both functional value and noise resistance are retained after pruning.

[0025] The aforementioned two-layer design achieves a synergistic optimization effect, offering several advantages over existing pruning schemes. In high compression scenarios, the accuracy advantage of this method is particularly significant: under a 90% pruning rate on the CIFAR-10 dataset, the inference accuracy of the model obtained by this method is 13.8 percentage points higher than the L1 norm-based structured pruning scheme and 15.5 percentage points higher than the conventional channel pruning scheme; under the same pruning rate on the CIFAR-100 dataset, the accuracy of this method is 9.4 and 11.2 percentage points higher than the two comparative schemes mentioned above, respectively. Regarding noise robustness, the accuracy degradation of this method at all pruning rates is significantly lower than that of the comparative schemes. At a 90% pruning rate on the CIFAR-10 dataset, the accuracy degradation is more than 14 percentage points lower than the comparative schemes, effectively suppressing the accuracy degradation caused by conductance drift. This method is completed offline in the software domain without any modifications to the hardware circuitry of the memristor in-memory computing architecture. The network structure obtained after pruning can be directly mapped to the memristor cross array without introducing additional area or energy consumption overhead. Meanwhile, the method demonstrates consistent performance advantages on two datasets with significantly different complexities, exhibits good cross-dataset generalization ability, and can adapt to the memristor in-memory computing deployment requirements in different scenarios. Attached Figure Description

[0026] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is an overall flowchart of a non-ideal characteristic-aware structured pruning method for memristor-based in-memory computing architecture as described in this invention. Figure 2 This is a flowchart of the interlayer noise sensitivity quantification and adaptive pruning rate allocation described in this invention; Figure 3 This is a schematic diagram comparing the channel pruning of the signal-to-noise ratio importance criterion and the amplitude criterion described in this invention; Figure 4 This is a comparison chart of the accuracy of the three pruning methods described in this invention on the ResNet-18 model and the CIFAR-10 dataset. Detailed Implementation

[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of the present invention can be combined with each other, and the described embodiments are only some embodiments of the present invention, not all embodiments.

[0028] Implementation Method 1: This implementation method proposes a non-ideal characteristic-aware structured pruning method for memristor-based in-memory computing architectures. The method includes: Obtain the pre-trained convolutional neural network and the target global pruning rate; For each convolutional layer of the convolutional neural network, a conductance drift noise model is constructed. The conductance drift noise model is a zero-mean layer-by-layer multiplicative Gaussian noise model applied to the weights of that layer. Based on the conductance drift noise model, the noise sensitivity of each convolutional layer relative to conductance drift is quantified. The noise sensitivity is defined as the Monte Carlo average decrease in model accuracy after applying the multiplicative Gaussian noise only to that layer. The actual pruning rate of each convolutional layer is determined based on the target global pruning rate and the normalized noise sensitivity of each convolutional layer, so that the convolutional layer with higher normalized noise sensitivity is assigned a lower actual pruning rate. Based on the second-order Taylor expansion of the loss function, the signal-to-noise ratio importance score of each channel in each convolutional layer is constructed. The numerator of the signal-to-noise ratio importance score is the square of the channel functional importance, and the denominator is the noise-induced variance. Based on the actual pruning rate of each convolutional layer, channel pruning is performed in order of increasing signal-to-noise ratio importance score for each channel within that layer.

[0029] In this embodiment, quantizing the noise sensitivity of each convolutional layer relative to conductance drift includes: For the i A convolutional layer is formed, and the multiplicative Gaussian noise is applied only to the weights of that layer to obtain a noisy model; Run the test set on the noisy model and calculate the current test accuracy; Repeat the steps described above for applying noise and running the test set. K Next, calculate K The average decrease in accuracy relative to the clean model across all tests is taken as the average decrease in accuracy across all tests. i Noise sensitivity of each convolutional layer ; The multiplicative Gaussian noise is expressed as:

[0030] in, For noisy weights, For the original weights, For noise variables, This represents the noise standard deviation of the convolutional layer.

[0031] Furthermore, the step of determining the actual pruning rate of each convolutional layer based on the target global pruning rate and the normalized noise sensitivity of each convolutional layer according to the inverse correlation is achieved by the following formula:

[0032] in, For the first i The actual pruning rate of the layer, For the global pruning rate, For adaptive intensity factor, This is the lower limit of the pruning rate. This is the upper limit of the pruning rate. This represents the normalized noise sensitivity.

[0033] In this embodiment =0.05、 =0.95; Lower limit of pruning rate =0.05 ensures that the layer with the highest noise sensitivity still performs at least 5% basic pruning, making the global pruning rate target ρ achievable between layers; upper limit of pruning rate. =0.95 constraint ensures that at least 5% of the output channels are retained in any layer, so as to ensure that the pruned layer structure is effective and can be properly mapped to the memristor cross array.

[0034] Furthermore, the normalized noise sensitivity It can be obtained through the following formula:

[0035] in, This represents the minimum sensitivity of all convolutional layers. This represents the maximum sensitivity of all convolutional layers. To prevent small constants from being divided by zero.

[0036] In this embodiment, constructing the signal-to-noise ratio importance score for each channel in each convolutional layer includes: Perform N backpropagations on the calibration dataset, and cumulatively calculate the sum of the gradient of the loss function with respect to the weights and the product of the weights, as well as the sum of their squares; where N is an integer between 10 and 100. Calculate the importance of channel functionality based on the cumulative results. and noise-induced variance : , , in, For loss pairs of weights gradient, Indicates the channel index. Expressing expectations; According to the above I(c) and V(c) Calculate the importance score of signal-to-noise ratio :

[0037] in, To prevent small constants from being divided by zero.

[0038] In this embodiment, the standard deviation of the multiplicative Gaussian noise is a value that is set independently for each convolutional layer or uniformly globally, ranging from 0.05 to 0.30. 0.05 corresponds to low conductivity drift conditions, and 0.30 corresponds to high conductivity drift conditions. The intermediate value is adapted between the two based on the drift amplitude to cover the conductivity drift amplitude of the memristor under different drift conditions.

[0039] In this embodiment, the number of Monte Carlo samplings K is an integer between 10 and 30, in order to achieve a trade-off between the sensitivity estimation accuracy and the sampling computation, and 20 is selected by comprehensively considering accuracy and cost.

[0040] In this embodiment, the number of backpropagation iterations N on the calibration dataset is 50, in order to strike a trade-off between the estimation stability of the gradient-weight statistics and the computational cost of calibration.

[0041] In this embodiment, after performing channel pruning, a step of fine-tuning the pruned network is also included, wherein the fine-tuning process does not introduce the conductivity drift noise model.

[0042] Implementation Method 2, see below Figures 1 to 4 This embodiment describes a complete implementation of the non-ideal characteristic-aware structured pruning method for memristor-based in-memory computing architecture described in Embodiment 1, including: This embodiment provides a non-ideal characteristic-aware structured pruning method for memristor in-memory computing architectures. This method takes a pre-trained convolutional neural network, a target global pruning rate ρ, and RRAM conductance drift noise parameters σ as inputs. It mainly includes three steps: conductance drift noise modeling, inter-layer noise sensitivity quantification and adaptive pruning rate allocation, and signal-to-noise ratio importance scoring and robust channel selection. All of these steps are completed in the software domain without relying on any additional hardware circuitry. The overall method flow is as follows: Figure 1 As shown below, each step will be explained in detail.

[0043] Step 1: Construct a conductivity drift noise model The perturbation of stored weights caused by RRAM conductance drift during the inference phase is modeled as zero-mean, layer-by-layer multiplicative noise. For the programmed weights in the convolutional layers... : (1) In the formula, This represents the noise standard deviation of the convolutional layer. Multiplicative (rather than additive) noise is used because the change in conductance due to drift is proportional to the programmed conductance value. σ The value range is 0.05~0.30: lower limit 0.05 (baseline value, based on...) The measured drift statistics correspond to low conductivity drift conditions, with an upper limit of 0.30 corresponding to high conductivity drift conditions. Intermediate values ​​are selected based on the actual drift amplitude to cover the conductivity drift amplitude of the memristor under different operating conditions. This noise model is the common basis for subsequent interlayer sensitivity quantification and signal-to-noise ratio scoring.

[0044] Step 2: Quantification of interlayer noise sensitivity and adaptive pruning rate allocation Different network layers exhibit significantly different sensitivities to noise: shallow features (such as edges and textures) are repeatedly reused in subsequent layers, leading to an accumulation of noise across layers; deeper features have higher redundancy and are relatively noise-resistant within a single layer. Therefore, applying a uniform pruning rate to all layers is suboptimal; more channels should be retained in noise-sensitive layers. Given a pre-trained model, define the... Convolutional layers noise sensitivity The Monte Carlo average of the decrease in accuracy of the test set after applying noise of Equation (1) only to this layer: (2) In the formula, For the model's accuracy on the test set, For only The model after adding noise, K The number of Monte Carlo samples, taken as an integer between 10 and 30, is used to strike a trade-off between the accuracy of sensitivity estimation and the computational cost of sampling. K If the value is too small, the variance of the sensitivity estimate will be too large. K (If the value is too large, the sampling computation cost will be too high). In this embodiment, we take... K =20. The larger the value, the more susceptible the layer is to noise. Normalizing it to... : (3) In the formula, , These represent the minimum and maximum sensitivities of all convolutional layers, respectively. To prevent small constants from being divided by zero, the actual pruning rate for each layer is obtained through adaptive scaling. (4) In the formula, For the global pruning rate, For adaptive intensity factor, , These represent the lower and upper limits of the pruning rate. The design implications are: It degenerates into uniform pruning; High sensitivity to noise ( Larger layers are assigned lower pruning rates to retain more channels; The larger the layer, the more significant the difference in interlayer pruning rate. In this embodiment... =0.05、 =0.95: Lower limit =0.05 ensures that the layer with the highest noise sensitivity still performs at least 5% basic pruning, making the global pruning rate target ρ achievable between layers; upper limit A constraint of 0.95 is applied to ensure that at least 5% of the output channels in any layer are retained to guarantee that the pruned layer structure is effective and can be properly mapped to the memristor crossover array. In this embodiment... Under this value, inter-layer adaptive allocation is stable and effective. The implementation process of this step is as follows: Figure 2 As shown.

[0045] Furthermore, the difference in interlayer noise sensitivity mentioned above is essentially due to the difference between shallow and deep layers. Shallow convolutional kernels extract low-level features such as edges and textures, which are repeatedly reused by subsequent layers to form the basis of the feature flow of the entire network. When conductance drift noise is injected into the shallow layer weights, the disturbance is propagated layer by layer with forward propagation and further amplified in each layer, forming a cumulative amplification effect. Therefore, under the same noise standard deviation, the shallow layer causes a greater decrease in accuracy and higher sensitivity at the output end. Deep convolutional kernels encode high-level semantic features, with high semantic redundancy between channels. A large number of functionally similar channels in a single layer can average and absorb the noise disturbance. Therefore, the deep layer has a limited decrease in accuracy and lower sensitivity when noise is injected only into the current layer. The Monte Carlo sensitivity quantification in Equation (2) objectively captures this trend of high sensitivity in shallow layers and low sensitivity in deep layers. Based on this, Equation (4) assigns a lower pruning rate to shallow layers (high sensitivity) to retain more channels and a higher pruning rate to deep layers, thus providing a clear physical basis for interlayer adaptive allocation.

[0046] Step 3: Signal-to-noise ratio importance scoring and robust channel selection Tradition Norm scores only measure the magnitude of weights; higher magnitudes do not necessarily impede RRAM noise. Under the standard assumption that classification accuracy is a monotonic function of negative cross-entropy loss, the single-sample loss... exist Perform a second-order Taylor expansion and then... Taking the expectation, the first-order term gives the importance of the channel function. The second-order term gives the noise-induced variance. The expected accuracy under noise is approximately: (5) In the formula, For quantification of channel removal The resulting loss of first-order accuracy; To measure noise via channel The resulting power loss fluctuation; The loss is the gradient with respect to the weights. Maximizing the expected accuracy is equivalent to preferential pruning. Low, High-frequency channels. Based on this, a signal-to-noise ratio importance score is constructed: (6) In the formula, To prevent division by zero by small constants. This score has a clear physical meaning of signal-to-noise ratio: molecule The denominator is the "signal power" that the channel has relatively correctly predicted. This refers to the "noise power" of the channel affected by noise. Channels with high SNI (Sound Intensity Index) are both important and noise-resistant and should be retained, while those with low SNI can be safely removed. The difference between this and the traditional amplitude criterion for channel selection is as follows: Figure 3 As shown. In specific implementation, the network is adjusted based on the calibration data. Second backpropagation (in this embodiment, it is taken as...) =50), channel-by-channel accumulation and And obtain the expected result and Then, the SNI score of each channel is obtained by equation (6); then, according to the pruning rate of each layer obtained in step 2, the channels in this layer are pruned from low to high according to the SNI score. One channel, among which This represents the total number of output channels for this convolutional layer. The actual pruning rate of this layer is determined by equation (4) in step 2.

[0047] Step 4: Performance evaluation of pruning methods To verify the effectiveness of the proposed non-ideal characteristic-aware structured pruning method (RASP) in this embodiment, CIFAR-10 and CIFAR-100 datasets were used as test datasets on a ResNet-18 convolutional neural network. The method was compared with two representative comparative methods: an L1-norm-based structured pruning method (L1) and a conventional channel structured pruning method (CSP). All three methods performed structured pruning at the same global pruning rate, and their inference accuracy was evaluated under the condition of taking into account the non-ideal characteristics of memristor conductance drift. Figure 4The comparison curves of the accuracy of the three methods with the pruning rate on the ResNet-18 model and the CIFAR-10 dataset are presented. Table 1 shows the comparison results of the inference accuracy and accuracy reduction of the three methods on the CIFAR-10 and CIFAR-100 datasets under different pruning rates.

[0048] Depend on Figure 4 It can be seen that the accuracy of all three methods decreases with increasing pruning rate, but the magnitude of the decrease varies significantly. Under ideal computational conditions, the RASP of this method maintains accuracy comparable to or higher than the comparative methods at all pruning rates. When the non-ideal characteristic of memristor conductance drift (RRAM) is introduced, the accuracy curves of the L1 and CSP methods drop sharply, while the RRAM curve corresponding to the RASP of this method still closely follows its ideal curve, with the smallest accuracy loss. This indicates that this method adaptively allocates the pruning rate of each layer by quantifying the inter-layer noise sensitivity and prioritizes the retention of noise-resistant channels based on the importance score of the signal-to-noise ratio, thereby fundamentally suppressing the inference accuracy degradation introduced by non-ideal characteristics. This advantage is particularly prominent in the high compression ratio section where the pruning rate exceeds 0.6.

[0049] Table 1. Comparison of accuracy and precision degradation of the three pruning methods on the VGG16 model with CIFAR-10 and CIFAR-100 datasets at different pruning rates.

[0050] As shown in Table 1, at low to medium pruning rates (not exceeding 50%), the accuracy of the three methods is similar, with each method showing varying degrees of performance. The RASP of this method is generally comparable to the comparison methods. However, when the pruning rate increases to the high compression range of 70%–90%, the advantage of this method rapidly expands. Taking the CIFAR-10 dataset as an example, at a 90% pruning rate, the RASP accuracy of this method is 60.55%, which is approximately 13.8 and 15.5 percentage points higher than the L1 method's 46.79% and the CSP method's 45.02%, respectively. At a 90% pruning rate on the CIFAR-100 dataset, the accuracy of this method is 22.38%, which is approximately 9.4 and 11.2 percentage points higher than the L1 method's 12.99% and the CSP method's 11.18%, respectively. Meanwhile, the "Accuracy Degradation" column in the table shows the accuracy degradation caused by the non-ideal characteristics of RRAM conductance drift for each method, i.e., the difference between the accuracy in the clean environment and the accuracy in the RRAM environment. The smaller the value, the more robust the model is to non-ideal characteristics. It can be seen that the accuracy degradation of our method at all pruning rates is significantly smaller than that of the comparison methods (for example, at a 90% pruning rate on the CIFAR-10 dataset, the accuracy degradation of RASP is 21.04, while L1 and CSP are as high as 35.58 and 35.42, respectively), indicating that our method effectively suppresses the accuracy degradation introduced by the non-ideal characteristics of RRAM and has stronger adaptability to memristor in-memory computing architecture. In addition, our method maintains a consistent advantage on the CIFAR-10 and CIFAR-100 datasets, which have significant differences in difficulty, verifying its good cross-dataset generalization ability.

[0051] In summary, the experimental results show that, compared with L1 pruning based solely on weight magnitude and conventional CSP pruning, the method proposed in this embodiment significantly improves robustness and inference stability under high compression ratio pruning while maintaining accuracy, fully demonstrating the performance advantages of the non-ideal characteristic-aware structured pruning method for memristor in-memory computing architecture.

[0052] Implementation Method 3: This implementation method proposes a computer device, including a memory and a processor. The memory stores a computer program. When the processor runs the computer program stored in the memory, the processor executes a non-ideal characteristic-aware structured pruning method for memristor in-memory computing architecture as described in any one of Implementation Methods 1 to 2.

[0053] Implementation Method 4: This implementation method proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of a non-ideal characteristic-aware structured pruning method for memristor in-memory computing architecture as described in any one of Implementation Methods 1 to 2.

[0054] The specific embodiments of the present invention disclosed above are merely illustrative of the invention. These embodiments do not exhaustively describe all details, nor do they limit the invention to the specific embodiments described. Many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention.

Claims

1. A non-ideal characteristic-aware structured pruning method for memristor-based in-memory computing architectures, characterized in that, The method includes: Obtain the pre-trained convolutional neural network and the target global pruning rate; For each convolutional layer of the convolutional neural network, a conductance drift noise model is constructed. The conductance drift noise model is a zero-mean layer-by-layer multiplicative Gaussian noise model applied to the weights of that layer. Based on the conductance drift noise model, the noise sensitivity of each convolutional layer relative to conductance drift is quantified. The noise sensitivity is defined as the Monte Carlo average decrease in model accuracy after applying the multiplicative Gaussian noise only to that layer. The actual pruning rate of each convolutional layer is determined based on the target global pruning rate and the normalized noise sensitivity of each convolutional layer, so that the convolutional layer with higher normalized noise sensitivity is assigned a lower actual pruning rate. Based on the second-order Taylor expansion of the loss function, the signal-to-noise ratio importance score of each channel in each convolutional layer is constructed. The numerator of the signal-to-noise ratio importance score is the square of the channel functional importance, and the denominator is the noise-induced variance. Based on the actual pruning rate of each convolutional layer, channel pruning is performed in order of increasing signal-to-noise ratio importance score for each channel within that layer.

2. The non-ideal characteristic-aware structured pruning method for memristor-based in-memory computing architecture according to claim 1, characterized in that, The quantization of the noise sensitivity of each convolutional layer relative to conductance drift includes: For the i A convolutional layer is formed, and the multiplicative Gaussian noise is applied only to the weights of that layer to obtain a noisy model; Run the test set on the noisy model and calculate the current test accuracy; Repeat the steps described above for applying noise and running the test set. K Next, calculate K The average decrease in accuracy relative to the clean model across all tests is taken as the average decrease in accuracy across all tests. i Noise sensitivity of each convolutional layer ; The multiplicative Gaussian noise is expressed as: in, For noisy weights, For the original weights, For noise variables, This represents the noise standard deviation of the convolutional layer.

3. The non-ideal characteristic-aware structured pruning method for memristor-based in-memory computing architecture according to claim 2, characterized in that, The step of determining the actual pruning rate of each convolutional layer based on the target global pruning rate and the normalized noise sensitivity of each convolutional layer according to the inverse correlation is achieved by the following formula: in, For the first i The actual pruning rate of the layer, For the global pruning rate, For adaptive intensity factor, This is the lower limit of the pruning rate. This is the upper limit of the pruning rate. This represents the normalized noise sensitivity.

4. The non-ideal characteristic-aware structured pruning method for memristor-based in-memory computing architecture according to claim 3, characterized in that, The normalized noise sensitivity It can be obtained through the following formula: in, This represents the minimum sensitivity of all convolutional layers. This represents the maximum sensitivity of all convolutional layers. To prevent small constants from being divided by zero.

5. The non-ideal characteristic-aware structured pruning method for memristor-based in-memory computing architecture according to claim 1, characterized in that, The construction of the signal-to-noise ratio importance score for each channel in each convolutional layer includes: Perform on the calibration dataset N The second backpropagation, the N The sum of the gradient of the loss function with respect to the weights and the product of the weights, and the sum of their squares, is calculated. Calculate the importance of channel functionality based on the cumulative results. and noise-induced variance : , , in, For loss pairs of weights gradient, Indicates the channel index. Expressing expectations; According to the above I(c) and V(c) Calculate the importance score of signal-to-noise ratio : in, To prevent small constants from being divided by zero.

6. The non-ideal characteristic-aware structured pruning method for memristor-based in-memory computing architecture according to claim 1, characterized in that, The standard deviation of the multiplicative Gaussian noise is a value that is set independently for each convolutional layer or uniformly globally, ranging from 0.05 to 0.

30. 0.05 corresponds to low conductivity drift conditions, and 0.30 corresponds to high conductivity drift conditions. The intermediate value is adapted between the two based on the drift amplitude to cover the conductivity drift amplitude of the memristor under different drift conditions.

7. The non-ideal characteristic-aware structured pruning method for memristor-based in-memory computing architecture according to claim 2, characterized in that, The number of Monte Carlo samples K It is an integer between 10 and 30.

8. The non-ideal characteristic-aware structured pruning method for memristor-based in-memory computing architecture according to claim 1, characterized in that, After performing channel pruning, the process also includes a step of fine-tuning the pruned network, wherein the fine-tuning process does not introduce the conductivity drift noise model.

9. A computer device, characterized in that: The system includes a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes a non-ideal characteristic-aware structured pruning method for memristor in-memory computing architecture as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of a non-ideal characteristic-aware structured pruning method for memristor in-memory computing architecture as described in any one of claims 1-8.