An image classification method, device and equipment based on pruning quantization

By pruning and quantizing the residual classification network and optimizing the pruning threshold, the problem of deploying image classification models on resource-constrained devices is solved, achieving efficient and accurate image classification.

CN117934944BActive Publication Date: 2026-11-24GUANGDONG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410101278.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-24
Publication Date
2026-11-24
Estimated Expiration
2044-01-24

AI Technical Summary

Technical Problem

Existing technologies struggle to reduce the number of network parameters without affecting image classification performance, making it easier to deploy image classification models on resource-constrained mobile devices. Furthermore, it is difficult to balance the relationship between cropping error and representation error.

Method used

A quantization method based on pruning threshold is adopted to prune and quantize the residual classification network. The pruning threshold is optimized by the linear interpolation theorem to construct a pruned classification network. The network is then trained with preset learning variables to optimize the pruning threshold in order to balance pruning error and representation error.

Benefits of technology

It achieves high-speed and accurate image classification on resource-constrained devices, reduces storage space requirements, and improves the processing speed and accuracy of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117934944B_ABST
    Figure CN117934944B_ABST
Patent Text Reader

Abstract

The application discloses a kind of image classification method, device and equipment based on clipping quantization, method includes: the target image obtained is preprocessed, and the image to be classified is obtained;The image to be classified is input into preset residual classification network and classified prediction, and the target classification result is obtained;Pre-set residual classification network is based on clipping threshold and is clipped quantization, and clipping threshold is based on linear difference theorem optimization update.Just by updating clipping threshold, clipping error and representation error are balanced, while ensuring the accuracy and speed of classification network.Therefore, the application can solve the technical problem that the prior art is difficult to balance the relationship between clipping error and representation error, resulting in that the actual classification model is difficult to meet high accuracy and high processing speed simultaneously.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to an image classification method, apparatus and device based on cropping quantization. Background Technology

[0002] Image classification technology can be used for tasks such as image retrieval, image recognition, image classification, object detection, and image segmentation. It can effectively improve efficiency, reduce labor costs, and increase recognition accuracy, providing people with more intelligent and convenient services. However, image classification technology still faces some challenges in practical applications. One of these is the excessively large number of network parameters, making it difficult to deploy on resource-constrained mobile devices. Traditional image classification techniques typically require large amounts of labeled data and complex algorithm models to achieve accurate object recognition. These methods often require significant computational resources and time, and are inefficient when processing large-scale data. Therefore, how to accelerate the inference speed of image classification models and reduce storage space requirements without affecting image classification performance, enabling the widespread application of image classification in embedded systems, mobile applications, autonomous driving, and other fields, has become a current research hotspot. Quantization methods are considered a technique that can effectively compress and accelerate neural networks.

[0003] Existing neural network quantization suffers from two types of errors: pruning error (also known as quantization error) and representation error. Crucially, quantization error and representation error are inversely proportional. When quantization error decreases, the pruning value decreases, the pruned range expands, and data within the pruned range can be allocated to a more finely quantized interval, thus reducing the error. However, the representation error increases. Current techniques fail to effectively balance the relationship between pruning and representation errors, hindering practical classification models from achieving high-speed inference and quickly obtaining accurate classification results. Summary of the Invention

[0004] This application provides an image classification method, apparatus, and device based on crop quantization, which addresses the technical problem that existing technologies struggle to balance the relationship between cropping error and representation error, making it difficult for practical classification models to simultaneously achieve high accuracy and high processing speed.

[0005] In view of this, the first aspect of this application provides an image classification method based on cropping quantization, comprising:

[0006] The acquired target image is preprocessed to obtain the image to be classified;

[0007] The image to be classified is input into a preset residual classification network for classification prediction to obtain the target classification result;

[0008] The preset residual classification network is obtained by pruning and quantizing based on a pruning threshold, which is optimized and updated based on the linear difference theorem.

[0009] Preferably, the preprocessing operation on the acquired target image to obtain the image to be classified includes:

[0010] The acquired target image is scaled to obtain a scaled image of a preset size;

[0011] The pixel values ​​of the scaled image are normalized to obtain a normalized image;

[0012] The normalized image is converted into a data format to obtain the image to be classified.

[0013] Preferably, the step of normalizing the pixel values ​​of the scaled image to obtain a normalized image further includes:

[0014] The normalized image is enhanced using preset enhancement techniques to obtain an enhanced image. The preset enhancement techniques include random cropping, random flipping, and random rotation.

[0015] Preferably, the step of inputting the image to be classified into a preset residual classification network for classification prediction to obtain the target classification result further includes:

[0016] Construct an initial residual network based on the ResNet framework;

[0017] A pruning classification network is obtained by introducing a pruning threshold into the initial residual network and updating the pruning threshold based on the linear interpolation theorem.

[0018] The cropping classification network is quantized to obtain a quantized classification network;

[0019] Based on preset learning variables, the quantization classification network is trained according to a preset image training set to obtain a preset residual classification network.

[0020] Preferably, the step of training the quantization classification network based on a preset image training set using preset learning variables to obtain a preset residual classification network further includes:

[0021] The performance of the preset residual classification network is evaluated to obtain the evaluation results. The performance evaluation includes accuracy evaluation, compression ratio evaluation, and inference acceleration evaluation.

[0022] A second aspect of this application provides an image classification apparatus based on crop quantization, comprising:

[0023] The image processing unit is used to preprocess the acquired target image to obtain the image to be classified.

[0024] An image classification unit is used to input the image to be classified into a preset residual classification network for classification prediction to obtain the target classification result;

[0025] The preset residual classification network is obtained by pruning and quantizing based on a pruning threshold, which is optimized and updated based on the linear difference theorem.

[0026] Preferably, the image processing unit is specifically used for:

[0027] The acquired target image is scaled to obtain a scaled image of a preset size;

[0028] The pixel values ​​of the scaled image are normalized to obtain a normalized image;

[0029] The normalized image is converted into a data format to obtain the image to be classified.

[0030] Preferably, it further includes:

[0031] The image enhancement unit is used to perform image enhancement operations on the normalized image using preset enhancement techniques to obtain an enhanced image. The preset enhancement techniques include random cropping, random flipping, and random rotation.

[0032] Preferably, it further includes:

[0033] Network building blocks are used to build initial residual networks based on the ResNet framework.

[0034] A threshold configuration unit is used to introduce a pruning threshold into the initial residual network and update the pruning threshold based on the linear interpolation theorem to obtain a pruning classification network.

[0035] A quantization processing unit is used to quantize the cropping classification network to obtain a quantized classification network.

[0036] The network training unit is used to train the quantization classification network based on preset learning variables and a preset image training set to obtain a preset residual classification network.

[0037] A third aspect of this application provides an image classification device based on cropping quantization, the device including a processor and a memory;

[0038] The memory is used to store program code and transmit the program code to the processor;

[0039] The processor is used to execute the image classification method based on cropping quantization as described in the first aspect, according to the instructions in the program code.

[0040] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0041] This application provides an image classification method based on cropping quantization, comprising: preprocessing an acquired target image to obtain an image to be classified; inputting the image to be classified into a preset residual classification network for classification prediction to obtain a target classification result; wherein the preset residual classification network is obtained by cropping quantization based on a cropping threshold, and the cropping threshold is optimized and updated based on the linear interpolation theorem.

[0042] The image classification method based on cropping quantization provided in this application performs network cropping and quantization on the residual network used for image classification based on a cropping threshold. Since the cropping threshold can be continuously learned and optimized, the optimal cropping threshold can be updated while satisfying both image classification accuracy and the network's high-speed processing requirements, ensuring the reliability of the network's quantization and achieving high-speed and accurate image classification. Essentially, it balances cropping error and representation error by updating the cropping threshold, simultaneously ensuring the accuracy and speed of the classification network. Therefore, this application can solve the technical problem in existing technologies where it is difficult to balance the relationship between cropping error and representation error, leading to practical classification models that cannot simultaneously achieve high accuracy and high processing speed. Attached Figure Description

[0043] Figure 1 A flowchart illustrating an image classification method based on cropping quantization provided in this application embodiment;

[0044] Figure 2 This is a schematic diagram of the structure of an image classification device based on cropping quantization provided in an embodiment of this application;

[0045] Figure 3 This is a schematic diagram of the residual network structure provided in an embodiment of this application;

[0046] Figure 4 A schematic diagram showing that the weight parameter distribution provided in the embodiments of this application is approximately a Gaussian distribution with a mean of 0;

[0047] Figure 5 This is a schematic diagram of the discrete weight parameter distribution after quantization using a pruning threshold, provided in an embodiment of this application.

[0048] Figure 6 This is a schematic diagram of the structure of the convolutional layer of the quantization classification network provided in an embodiment of this application. Detailed Implementation

[0049] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0050] For easier understanding, please refer to Figure 1 This application provides an embodiment of an image classification method based on cropping quantization, comprising:

[0051] Step 101: Perform preprocessing operations on the acquired target image to obtain the image to be classified.

[0052] Further, step 101 includes:

[0053] The acquired target image is scaled to obtain a scaled image of a preset size;

[0054] The pixel values ​​of the scaled image are normalized to obtain a normalized image;

[0055] The normalized image is converted into a data format to obtain the image to be classified.

[0056] It should be noted that the target image can be a real-time captured image or a video frame extracted image, or it can be an infrared image or a binarized image obtained through basic processing or other means. The specific image properties and image sources are not limited, as long as they are images to be classified that have not undergone network classification processing. The settings can be made as needed.

[0057] Scaling the target image adjusts it to a specified size; the preset size is set according to the network model or actual needs. Normalization normalizes the pixel values ​​of the image to between 0 and 1 to facilitate model processing and analysis. Format conversion converts the image into a format acceptable to the network model, such as vectors or tensors. These image preprocessing operations not only adapt to the needs of the network model but also improve image quality to some extent, thereby enhancing classification accuracy. It is understood that, in addition to the above preprocessing operations, other image preprocessing operations can be added as needed; this is not limited here.

[0058] Furthermore, the pixel values ​​of the scaled image are normalized to obtain a normalized image, which then includes:

[0059] The normalized image is enhanced using preset enhancement techniques, which include random cropping, random flipping, and random rotation.

[0060] It should be noted that, to facilitate subsequent training of the classification network model, if the acquired target images constitute a large amount of data and are used for model training, such as the CIFAR-10 dataset, then in addition to the preprocessing operations mentioned above, image enhancement processing can also be performed on the target images. The purpose is to increase the richness and quantity of data, ensure the accuracy and reliability of model training, and improve the generalization ability of the network model. It is understood that the preset enhancement techniques can include, but are not limited to, the above-mentioned ones; they can be set reasonably according to the actual situation, and are not limited here.

[0061] Step 102: Input the image to be classified into the preset residual classification network for classification prediction to obtain the target classification result.

[0062] The preset residual classification network is obtained by pruning and quantizing based on a pruning threshold, which is optimized and updated based on the linear difference theorem.

[0063] It should be noted that you should refer to [link / reference]. Figure 3 The preset residual classification network is an image classification model built on the residual network framework. The residual structure can avoid the problems of gradient vanishing or gradient exploding in the network structure, and can improve the generalization performance of the model. Specifically, the residual network structure that can be selected is not limited to ResNet18, ResNet32 or ResNet34, etc., and is not limited here.

[0064] The pruning threshold in the preset residual classification network is obtained through learning and updating. This allows for pruning and quantization of the network, reducing its computational complexity while still meeting classification accuracy requirements. Overall, it reduces the model's storage space requirements, enabling the algorithm to be deployed on resource-constrained mobile devices, thus saving computational resources and time costs.

[0065] It should be noted that, for example, 8-bit integer data is used instead of 32-bit floating-point data in the inference process of the neural network. In traditional neural networks, weights and activation functions are usually stored in floating-point form, which occupies a large amount of memory space and computing resources. However, the quantization method in this embodiment can convert these parameters into lower-bit integers or fixed-point numbers, thereby compressing the network model. However, as the number of bits decreases, some information loss will occur in the data. The error caused by this process is called representation error. At the same time, since the range of data that low-bit data can represent is limited, the original data needs to be numerically pruned. Data exceeding the pruning range will be forcibly set to pruned values.

[0066] Furthermore, step 102, preceding the following, also includes:

[0067] Construct an initial residual network based on the ResNet framework;

[0068] A pruning classification network is obtained by introducing a pruning threshold into the initial residual network and updating the pruning threshold based on the linear interpolation theorem.

[0069] The cropping classification network is quantized to obtain a quantized classification network;

[0070] Based on preset learning variables, the quantization classification network is trained according to a preset image training set to obtain a preset residual classification network.

[0071] It should be noted that this embodiment uses ResNet18 and ResNet34 as examples. ResNet18 includes 8 residual blocks, and ResNet34 includes 16 residual blocks. Each residual block contains several convolutional layers and batch normalization layers. Based on the residual block structure framework, an initial residual network for image classification can be designed. However, a cropping threshold needs to be introduced to quantize the network. In addition, in order to find a suitable cropping threshold and balance cropping error and representation error, this embodiment sets learning variables and learning optimization ranges for the cropping threshold learning optimization.

[0072] This embodiment proposes a threshold quantifiable learning method based on linear interpolation to update the pruning threshold. To avoid the pruning threshold becoming extremely large or small during the optimization update process, upper and lower limits of the learning optimization range can be preset for the update. Since the pruning threshold has two parts, positive and negative, the range can be divided into two parts, with four values ​​defining the two ranges. The weight parameter distribution of the neural network involved in pruning approximates a Gaussian distribution with a mean of 0. Please refer to [link to relevant documentation]. Figure 4 Based on the variance σ of the weight parameters in a Gaussian distribution, data with weight parameters outside the mean 2σ account for only 4.3% of the total data. Therefore, the lower limit of the positive axis range can be set to twice the variance of the weight parameters, and the upper limit can be set to the maximum value of the weight parameters. The lower limit of the negative axis range can be set to the minimum value of the weight parameters, and the upper limit can be set to -2 times the variance of the weight parameters. Thus, the clipping thresholds for the positive and negative axes can be expressed as:

[0073]

[0074]

[0075] Among them, C P C N These are the clipping thresholds for the positive and negative axes, respectively, where σ is the variance of the weight parameters, and X... min X max These represent the minimum and maximum values ​​of the weight parameters, respectively, and 'a' is the preset learning variable. Changing the preset learning variable 'a' can alter the clipping threshold C on the positive and negative axes. P C NFurthermore, the preset learning variable 'a' can be initialized before model training; in this embodiment, the initial value is 3.

[0076] Based on the above, a quantization function can be constructed:

[0077]

[0078] Where clip(*) represents the clipping function, x r Let be the raw data to be quantized, and s be the parameter to be quantized. The quantized discrete weight parameters that need to be used in training are at the pruning threshold C. P C N The weight parameters within this range will be uniformly quantized into discrete values, while weight parameters outside this range will be directly based on the pruning threshold C. P C N To retrieve the value.

[0079] To facilitate the automatic updating of the preset learning variable 'a', the gradient of the preset learning variable 'a' can be calculated based on the quantization function:

[0080]

[0081] With the gradient of the pre-defined learning variable 'a', the neural network can backpropagate this gradient during training. In each training iteration, 'a' is updated. As various algorithms, such as gradient descent, optimize the training, 'a' gradually reaches the optimal solution, thus optimizing the pruning threshold. This balances pruning error and representation error, ultimately minimizing quantization error. (See also...) Figure 5 The weights after clipping and quantization using the method in this embodiment are discrete weights. The quantization method based on a clipping threshold is called LCT (learnable clipping threshold), while the method used in this embodiment to quantize network parameters based on a clipping threshold obtained through linear interpolation learning is called LCTQ. Please refer to the overall network structure diagram after quantization in this embodiment. Figure 6 The quantized convolutional layer can be denoted as QConv. By replacing the ordinary convolutional layer in the residual network structure with the quantized convolutional layer, the cropping analysis network required in this embodiment can be obtained. After classification training on a preset image training set, a preset residual classification network can be obtained for image classification.

[0082] It is understandable that introducing a pruning threshold means selecting some weight parameters in the network model that need to be pruned. To this end, a pruning threshold can be used to quantify the weights, retaining the weights that are within the pruning threshold, and pruning the weights that are outside the threshold to the threshold value.

[0083] It should be noted that the preset residual classification network in this embodiment uses the cross-entropy loss function, which measures the difference between the model's prediction and the true label. By minimizing the cross-entropy loss function, the model parameters are optimized, allowing the model to better fit the training data and improve classification accuracy. Furthermore, the SGD stochastic gradient descent algorithm can also be used for optimization. SGD is particularly suitable for large-scale data and high-dimensional features; it iteratively updates the model parameters, allowing the model to gradually converge to the optimal solution during training. By combining the cross-entropy loss function with the SGD stochastic gradient descent algorithm, the training efficiency and classification accuracy of the model can be effectively improved, making the patented technical solution more competitive and practical.

[0084] To further optimize model performance during training, the following strategies can be employed: 1) Reduce the learning rate: Decrease the learning rate to reduce the magnitude of model parameter updates, thereby reducing fluctuations during training. 2) Fine-tune the training process by retraining the learnable parameters of the weights and pruning threshold with extremely low variation: Based on the previous training round, fix the pruning threshold parameter while fine-tuning the learnable parameters of the weights. Training with extremely low variation effectively controls the magnitude of parameter adjustments, thereby improving model performance.

[0085] Furthermore, based on preset learning variables, a preset residual classification network is obtained by training the cropping analysis network with a preset image training set using a preset cropping threshold. This process then includes:

[0086] The performance of the preset residual classification network is evaluated, and the evaluation results are obtained. The performance evaluation includes accuracy evaluation, compression ratio evaluation, and inference acceleration evaluation.

[0087] To ensure that the preset residual classification network obtained through training is the optimal model, this embodiment can also perform performance evaluation on the model under different training iterations, and then perform model analysis and selection based on the evaluation results, thereby ensuring that the preset residual classification network obtained is the optimal classification model.

[0088] Performance evaluation includes, but is not limited to, accuracy evaluation, compression ratio evaluation, and inference acceleration evaluation; the corresponding evaluation metrics include, but are not limited to, accuracy, compression ratio, and inference acceleration speed; these evaluation factors can assess the model's performance in terms of accuracy, computational efficiency, and storage cost.

[0089] A model can be used to classify and predict data on the validation set, and the accuracy of the predictions can be calculated. This accuracy reflects the model's performance on new data and confirms whether the model can correctly identify the images in the validation set. To ensure the accuracy calculation, the following steps can be used: 1) Input the data from the validation set into the model to obtain the model's prediction results; 2) Compare the prediction results with the true labels in the validation set to calculate the number of correctly classified samples; 3) Divide the number of correctly classified samples by the total number of samples in the validation set to obtain the model's accuracy on the validation set.

[0090] In this embodiment, when the weights and activations are compressed to 8 bits, the neural network parameters are converted from the original 32-bit floating-point numbers to 8-bit integer data, achieving a 4-fold compression of the model. The compression ratio can be calculated using the following formula: Compression ratio = Original parameter size / Compressed parameter size = (32 bits × Number of parameters) / (8 bits × Number of parameters). Since only the number of parameters is changed, a 4-fold compression can be achieved. After the weight parameters are quantized and compressed, the bandwidth of the transmitted data can also be compressed by 4 times, which can effectively improve the inference speed and reduce the latency during data transmission.

[0091] The image classification method based on cropping quantization provided in this application performs network cropping and quantization on the residual network used for image classification based on a cropping threshold. Since the cropping threshold can be continuously learned and optimized, the optimal cropping threshold can be updated while satisfying both image classification accuracy and the network's high-speed processing requirements, ensuring the reliability of the network's quantization and achieving high-speed and accurate image classification. Essentially, it balances cropping error and representation error by updating the cropping threshold, simultaneously ensuring the accuracy and speed of the classification network. Therefore, this application's embodiments can solve the technical problem in existing technologies where it is difficult to balance the relationship between cropping error and representation error, leading to practical classification models that cannot simultaneously meet high accuracy and high processing speed requirements.

[0092] For easier understanding, please refer to Figure 2 This application provides an embodiment of an image classification device based on cropping quantization, comprising:

[0093] Image processing unit 201 is used to perform preprocessing operations on the acquired target image to obtain the image to be classified;

[0094] Image classification unit 202 is used to input the image to be classified into a preset residual classification network for classification prediction to obtain the target classification result;

[0095] The preset residual classification network is obtained by pruning and quantizing based on a pruning threshold, which is optimized and updated based on the linear difference theorem.

[0096] Furthermore, the image processing unit 201 is specifically used for:

[0097] The acquired target image is scaled to obtain a scaled image of a preset size;

[0098] The pixel values ​​of the scaled image are normalized to obtain a normalized image;

[0099] The normalized image is converted into a data format to obtain the image to be classified.

[0100] Furthermore, it also includes:

[0101] The image enhancement unit 203 is used to perform image enhancement operations on the normalized image using preset enhancement techniques to obtain an enhanced image. The preset enhancement techniques include random cropping, random flipping, and random rotation.

[0102] Furthermore, it also includes:

[0103] Network building unit 204 is used to build an initial residual network based on the ResNet framework;

[0104] Threshold configuration unit 205 is used to introduce a pruning threshold into the initial residual network and update the pruning threshold based on the linear interpolation theorem to obtain a pruning classification network;

[0105] The quantization processing unit 206 is used to quantize the cropping classification network to obtain a quantized classification network.

[0106] The network training unit 207 is used to train the quantization classification network based on preset learning variables and a preset image training set to obtain a preset residual classification network.

[0107] This application also provides an image classification device based on cropping quantization, the device including a processor and a memory;

[0108] The memory is used to store program code and transfer the program code to the processor;

[0109] The processor is used to execute the crop-quantization-based image classification method in the above method embodiments according to the instructions in the program code.

[0110] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0111] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0112] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0113] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for executing all or part of the steps of the methods described in the various embodiments of this application through a computer device (which may be a personal computer, server, or network device, etc.). The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.

[0114] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. An image classification method based on crop quantization, characterized in that, include: The acquired target image is preprocessed to obtain the image to be classified; Construct an initial residual network based on the ResNet framework; A pruning threshold is introduced into the initial residual network, and the pruning threshold is updated based on the linear interpolation theorem to obtain a pruning classification network. The pruning threshold for the positive and negative axes can be expressed as: in, , These are the clipping thresholds for the positive and negative axes, respectively. The variance of the weighting parameters, , These are the minimum and maximum values ​​of the weight parameters, respectively. Preset learning variables; The cropping classification network is quantized to obtain a quantized classification network. The quantization function used for the quantization process is expressed as follows: in, This represents the clipping function. The raw data to be quantified. For the parameters to be quantized, These are the quantized discrete weight parameters that need to be used in training. The preset learning variable is calculated based on the quantization function. gradient: Based on preset learning variables, the quantization classification network is trained according to a preset image training set to obtain a preset residual classification network; The image to be classified is input into the preset residual classification network for classification prediction to obtain the target classification result; The preset residual classification network is obtained by pruning and quantizing based on a pruning threshold, which is optimized and updated based on the linear interpolation theorem.

2. The image classification method based on cropping quantization according to claim 1, characterized in that, The preprocessing operation on the acquired target image to obtain the image to be classified includes: The acquired target image is scaled to obtain a scaled image of a preset size; The pixel values ​​of the scaled image are normalized to obtain a normalized image; The normalized image is converted into a data format to obtain the image to be classified.

3. The image classification method based on cropping quantization according to claim 2, characterized in that, The step of normalizing the pixel values ​​of the scaled image to obtain a normalized image further includes: The normalized image is enhanced using preset enhancement techniques to obtain an enhanced image. The preset enhancement techniques include random cropping, random flipping, and random rotation.

4. The image classification method based on cropping quantization according to claim 1, characterized in that, The process of training the quantization classification network based on preset learning variables and a preset image training set to obtain a preset residual classification network further includes: The performance of the preset residual classification network is evaluated to obtain the evaluation results. The performance evaluation includes accuracy evaluation, compression ratio evaluation, and inference acceleration evaluation.

5. An image classification device based on cropping quantization, characterized in that, include: The image processing unit is used to preprocess the acquired target image to obtain the image to be classified. Network building blocks are used to build initial residual networks based on the ResNet framework. A threshold configuration unit is used to introduce a pruning threshold into the initial residual network and update the pruning threshold based on the linear interpolation theorem to obtain a pruning classification network, wherein the pruning threshold for the positive and negative axes can be expressed as: in, , These are the clipping thresholds for the positive and negative axes, respectively. The variance of the weighting parameters, , These are the minimum and maximum values ​​of the weight parameters, respectively. Preset learning variables; The quantization processing unit is used to quantize the cropping classification network to obtain a quantized classification network. The quantization function based on the quantization processing is expressed as follows: in, This represents the clipping function. The raw data to be quantified. For the parameters to be quantized, These are the quantized discrete weight parameters that need to be used in training. The preset learning variable is calculated based on the quantization function. gradient: The network training unit is used to train the quantization classification network based on preset learning variables and a preset image training set to obtain a preset residual classification network. An image classification unit is used to input the image to be classified into the preset residual classification network for classification prediction to obtain the target classification result; The preset residual classification network is obtained by pruning and quantizing based on a pruning threshold, which is optimized and updated based on the linear interpolation theorem.

6. The image classification device based on cropping quantization according to claim 5, characterized in that, The image processing unit is specifically used for: The acquired target image is scaled to obtain a scaled image of a preset size; The pixel values ​​of the scaled image are normalized to obtain a normalized image; The normalized image is converted into a data format to obtain the image to be classified.

7. The image classification device based on cropping quantization according to claim 6, characterized in that, Also includes: The image enhancement unit is used to perform image enhancement operations on the normalized image using preset enhancement techniques to obtain an enhanced image. The preset enhancement techniques include random cropping, random flipping, and random rotation.

8. An image classification device based on cropping quantization, characterized in that, The device includes a processor and a memory; The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the image classification method based on cropping quantization as described in any one of claims 1-4 according to the instructions in the program code.