A retraining-free quantization domain adaptation method for edge devices
By adopting multi-quantization bitwidth search and domain discriminator combined with pseudo-labeling, convergence speed evaluation and group training methods on edge devices, the deployment difficulties and domain drift problems of deep learning models on edge devices are solved, efficient quantization model adaptation is achieved, and the classification accuracy and inference efficiency of the model are improved.
Patent Information
- Application Number
- CN202411944312.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2044-12-27
AI Technical Summary
Existing deep learning models are difficult to deploy on edge devices, especially due to limited computing resources and domain drift problems, which lead to weak model performance. Existing quantitative technologies have failed to effectively solve the problems of computational redundancy and inconsistent training times of subnets.
Multi-quantization bitwidth search and domain discriminator are adopted to generate labels of target domain data through pseudo-labeling method. Combined with convergence speed evaluation and group training strategy, knowledge distillation technology is used for differentiated training to optimize the training process of quantization subnet.
It achieves quantitative model adaptation on edge devices without retraining, improves the model's generalization ability and classification accuracy, reduces computing resource consumption and storage requirements, and improves inference efficiency.
Smart Images

Figure CN119849585B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to deep learning and edge computing, and in particular to a quantization domain adaptation method for edge devices without retraining. Background Art
[0002] Existing deep learning has made tremendous progress in computer vision tasks. However, in practical applications, these models are difficult to deploy directly on edge devices due to their limited and dynamically changing computing resources. Furthermore, due to the problem of domain drift in actual use, these models have limited performance.
[0003] Unsupervised domain adaptation (UDA) aims to improve model generalization by aligning the shared representation spaces of the source and target domains, reducing the domain shift between training data and the edge device environment. To further improve target domain performance, researchers have attempted to incorporate neural architecture search (NAS) techniques. SlimDA enhances cross-domain generalization by integrating a weight sharing module into SymNet and utilizing the Sandwich rule to sample subnetworks from a model library, making it suitable for ensemble learning tasks. Recently, AnyDA proposed a subnetwork architecture that supports three configurable dimensions: depth, width, and resolution, enabling subnetwork customization based on different edge device requirements. Furthermore, AnyDA introduces a bootstrapped recursive distillation method that combines self-supervised learning with knowledge distillation to maximize the information content of the target data as a regularization tool. However, these methods rely on full-precision networks and ignore the issue of numerical precision redundancy, which increases computational and memory requirements and is unsuitable for resource-constrained edge devices. The application of existing quantization techniques, such as LSQ and LSQ+, to the diverse range of unsupervised domain adaptation subnetworks remains an open research question.
[0004] The main shortcomings of existing technologies are as follows: 1. In full-precision unsupervised domain adaptation, some methods configure multiple dimensions of the subnet to obtain different subnets with different computational budgets, eliminating the need for retraining; some methods use ensemble learning to improve the classification accuracy of all subnets; however, these methods do not consider the network's weight precision redundancy and the different effects of different quantization bit widths on different subnets. 2. In quantized unsupervised domain adaptation, existing methods use multiple quantization bit widths for quantization of all subnets and use self-boosting distillation to improve the classification accuracy of quantized subnets. However, this method only uses pseudo-labeling technology to solve the problem of unlabeled target domains and does not consider the different training times required for different quantized subnets.
[0005] It should be noted that the information disclosed in the above background technology section is only used to understand the background of this application, and therefore may include information that does not constitute prior art known to ordinary technicians in this field. Summary of the Invention
[0006] The main purpose of the present invention is to overcome the defects existing in the above-mentioned background technology and provide a quantization domain adaptation method for edge devices without retraining.
[0007] To achieve the above object, the present invention adopts the following technical solutions:
[0008] A method for domain adaptation of quantization without retraining for edge devices, characterized by comprising the following steps:
[0009] Step 1: Quantization Network Construction: Perform a multi-quantization bit width search to adapt to edge devices with different computing resources and determine the optimal quantization bit width for each quantization subnet in the unsupervised domain adaptation network. Build a domain discriminator for the quantization network to distinguish the features of the source and target domains. Feedback from the domain discriminator guides the training of the feature extraction quantization network, making the feature distributions of the source and target domains closer. Use a pseudo-labeling method to generate pseudo labels for the unlabeled target domain data through classification prediction of the subnet with the most parameters and the largest quantization bit width.
[0010] Step 2: Pre-training: Perform preliminary training on the quantized network to evaluate the convergence speed and training difficulty of each quantized subnet. Use the test dataset to evaluate the quantized subnet and obtain the classification accuracy of each quantized subnet. Based on the classification accuracy, determine the convergence speed and training difficulty of the quantized subnet.
[0011] Step 3. Subnet training: The quantized subnets are grouped according to the convergence speed and training difficulty obtained in the pre-training phase to implement differentiated training strategies. A sampling training method that is inversely proportional to the subnet convergence speed is used to allocate more training resources to subnets with slower convergence. Knowledge distillation is implemented, using the subnet group with a fast convergence speed as the teacher model to transfer knowledge to the subnet group with a slow convergence speed as the student model, accelerating the latter's learning process.
[0012] Furthermore, the domain discriminator uses a multi-layer perceptron (MLP) network to distinguish the features of the source domain and the target domain to achieve a binary classification task.
[0013] Furthermore, the output of the feature layer of each quantization subnetwork is input into the domain discriminator to discriminate whether the input feature comes from the source domain or the target domain; the discrimination loss is calculated for the result of the domain discriminator and fed back; gradient descent is used for the domain classification layer, and gradient reversal descent is used for the feature extraction layer.
[0014] Furthermore, the pseudo-labeling method includes:
[0015] Use the subnet with the most parameters and the largest quantization bit width among all pre-trained quantized networks to perform classification prediction on the target domain data;
[0016] Select predictions whose classification probability exceeds a preset threshold as pseudo labels;
[0017] The pseudo labels are used to perform supervised training on unlabeled data of the target domain.
[0018] Furthermore, during subnet training, the calculation and optimization process of classification loss includes:
[0019] The features extracted by the quantization subnet are input into the classification layer to predict the classification category of the data;
[0020] For labeled source domain data, the cross entropy loss of the classification layer is directly calculated based on its true label;
[0021] For unlabeled target domain data, the classification prediction of the subnetwork with the most parameters and the largest quantization bit width among all quantized networks is used as pseudo-label for supervision to calculate the loss of the classification layer;
[0022] The classification losses of the source domain and the target domain are weighted and summed to optimize the parameters of the quantization network; preferably, the weight of the source domain loss is 0.5 and the weight of the target domain loss is 1.0.
[0023] Furthermore, for the unlabeled target domain data, perform the following steps:
[0024] Use the subnet with the most parameters and the largest quantization bit width among all quantized networks to classify and predict the target domain data and obtain the classification probability distribution;
[0025] Determine the maximum classification probability of each target domain data sample as a candidate pseudo label;
[0026] If the maximum probability of the candidate pseudo-label reaches or exceeds the preset confidence threshold, the predicted category is used as the pseudo-label;
[0027] The pseudo labels are used as supervisory signals to train the unlabeled data of the target domain.
[0028] Furthermore, during subnet training, a convergence-speed-based group training and knowledge distillation mechanism is adopted, specifically including:
[0029] Pre-train the quantized subnetwork to evaluate its classification accuracy and thus determine the convergence speed of each subnetwork;
[0030] The quantized subnetworks are grouped according to the classification accuracy to achieve clustering of the subnetwork convergence speed;
[0031] Apply a sampling strategy that is inversely proportional to the subnet convergence speed for training to increase the training intensity of the subnet with slow convergence speed;
[0032] Implement group knowledge distillation and use subnets with fast convergence speed to transfer knowledge to subnets with slow convergence speed to promote the improvement of overall network performance.
[0033] Furthermore, in step 1, the appropriate subnetwork dimensions, including the network's input resolution, width, and quantization bit width, are determined through preliminary experiments to optimize the subnetwork configuration.
[0034] Furthermore, in step three, quantization-aware training (LSQ) is applied to enable the network to learn the appropriate quantization step size during training to reduce the error in the quantization process.
[0035] A computer program product includes a computer program, which, when executed by a processor, implements the retraining-free quantization domain adaptation method for edge devices.
[0036] The present invention has the following beneficial effects:
[0037] The present invention proposes a quantization training method for unsupervised domain adaptation suitable for edge devices, which can achieve effective migration of quantization subnets between source domains and target domains without retraining. By introducing a domain discriminator, the present invention can effectively solve the domain offset problem that may occur between different domains of the quantization subnet, thereby enhancing the generalization ability of the model in the target domain. In addition, by using the pseudo-labels generated by the subnet with the most parameters and the largest quantization bit width among all quantization networks, the present invention solves the problem of lack of labels in the target domain in unsupervised domain adaptation, so that the quantization network can be effectively trained on unlabeled data. By evaluating and classifying the convergence speed of the subnet, the present invention realizes differentiated training of subnets with fast convergence speeds and subnets with slow convergence speeds. Through the knowledge distillation technology, the fast-converging subnet can guide the learning of the slow-converging subnet, thereby improving the overall training efficiency and balancing the classification accuracy and inference efficiency. This method not only improves the inference speed of the model and reduces the overhead of model inference, but also improves the classification accuracy of the model while reducing the computing resource consumption of edge devices, reduces the requirements for downloading and storage, and achieves classification capability guarantee at low bit width, providing an efficient and practical solution for the deployment of deep learning models on edge devices.
[0038] Compared with conventional technologies, the embodiments of the present invention have the following significant advantages:
[0039] 1. The present invention provides a training method for unsupervised domain adaptation of edge devices without retraining quantization. It uses a domain discriminator to solve the domain offset problem between the source domain and the target domain of the quantization subnet, and extends the unsupervised domain adaptation to the quantization subnet that does not require retraining, thereby improving the model's inference speed and reducing the model inference overhead.
[0040] 2. By evaluating and classifying the convergence speed of subnets, we can use subnets with fast convergence speeds to distill knowledge from those with slow convergence speeds. Furthermore, we can increase the training frequency of slow-converging subnets with a probability inversely proportional to their convergence speed, ensuring that all quantized subnets receive a reasonable number of training cycles. This ensures that all subnets achieve a balance between classification accuracy and inference efficiency.
[0041] 3. The method of the present invention can perform inference with fewer edge device computing resources, use a method that does not require retraining, reduce related download and storage overhead, and improve the classification accuracy of the model while reducing the amount of calculation.
[0042] Other beneficial effects of the embodiments of the present invention will be further described below. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 Flowchart of a quantization method for unsupervised domain adaptation tasks without retraining according to an embodiment of the present invention;
[0044] Figure 2 This is an algorithm framework diagram of an embodiment of the present invention. DETAILED DESCRIPTION
[0045] The following is a detailed description of the embodiments of the present invention. It should be emphasized that the following description is only exemplary and is not intended to limit the scope of the present invention and its application.
[0046] In practical applications, due to the limited and dynamically changing computing resources of edge devices, it is difficult to deploy deep learning models directly to edge devices. In addition, due to the problem of domain drift in actual use, the actual performance of the model is relatively weak. In order to solve these problems, the present invention further quantizes the unsupervised domain adaptation network. In this process, the present invention encounters the following technical problems: 1. Due to the multiple quantization bit widths, the number of subnets increases exponentially. How to train these subnets efficiently. 2. For the quantized subnets, how to make them have the same classification accuracy as the full-precision network.
[0047] Application 1: Different edge devices, under different operating conditions, require networks with varying computational loads. To improve inference efficiency, networks often need to be quantized. This invention addresses this problem through quantization technology that eliminates the need for retraining. However, deploying quantized networks in edge devices can lead to domain shift. By adding a domain discrimination network to the quantized network, this invention achieves excellent domain adaptability.
[0048] Application 2: When faced with numerous quantized subnets composed of shared parameters, efficient training is a challenge. This method uses preliminary experiments to determine the convergence difficulty of each subnet and trains each subnet using a sampling frequency inversely proportional to the difficulty. Furthermore, this method clusters the convergence speeds and uses subnets with faster convergence to perform knowledge distillation on slower convergence subnets. This allows for efficient training of numerous subnets and achieves a balance between classification accuracy and efficiency.
[0049] In order to reduce precision redundancy, the present invention proposes to apply quantization to unsupervised domain adaptation, and use domain discriminators, group distillation and inverse sampling training methods on the network, ultimately ensuring the classification ability of all networks at low bit width.
[0050] See Figure 1 and Figure 2 , an embodiment of the present invention provides a quantization domain adaptation method for edge devices without retraining, comprising the following steps:
[0051] Step 1: Quantization Network Construction: Perform a multi-quantization bit width search to adapt to edge devices with different computing resources and determine the optimal quantization bit width for each quantization subnet in the unsupervised domain adaptation network. Build a domain discriminator for the quantization network to distinguish between the features of the source and target domains. Feedback from the domain discriminator guides the training of the feature extraction quantization network, bringing the feature distributions of the source and target domains closer. Use a pseudo-labeling method to generate reliable pseudo-labels for the unlabeled target domain data through classification predictions from the quantization subnet with the most parameters and the largest quantization bit width, addressing the issue of missing labels for target domain data during quantization network training. In this step, preliminary experiments can be used to determine the appropriate subnet dimensions, including the network's input resolution, width, and quantization bit width, to optimize the subnet configuration.
[0052] Step 2: Pre-training: Perform preliminary training on the quantized network to evaluate the convergence speed and training difficulty of each quantized subnet; use the test data set to evaluate the quantized subnet and obtain the classification accuracy of each quantized subnet. Based on the classification accuracy, the convergence speed and training difficulty of the quantized subnet are determined to provide data support for the formulation of subsequent training strategies.
[0053] Step 3: Quantized Subnet Training: Quantized subnets are grouped based on their convergence speed and training difficulty obtained during the pre-training phase to implement differentiated training strategies. A sampling training method inversely proportional to the subnet's convergence speed is used to allocate more training resources to slower-converging subnets to optimize overall training efficiency. Knowledge distillation is implemented, using the fast-converging subnet group as the teacher model to transfer knowledge to the slower-converging subnet group as the student model, accelerating the latter's learning process and achieving information sharing and performance improvement among the subnets. Quantization-aware training (LSQ) can be applied in this step to ensure that the network learns the appropriate quantization step size during training, thereby reducing errors in the quantization process.
[0054] The proposed domain adaptation method for edge devices, which requires no retraining and is quantized, can effectively address the challenge of deploying high-precision deep learning models on edge devices under resource-constrained conditions. It also overcomes the problem of domain drift and enables effective model adaptation to new domains without retraining the entire network. By combining quantization techniques with domain adaptation strategies, the present invention provides a deep learning model deployment solution that can run efficiently on edge devices and has good generalization capabilities.
[0055] In some embodiments, the domain discriminator uses a multi-layer perceptron (MLP) network to distinguish features of the source domain and the target domain to achieve a binary classification task.
[0056] The output of the feature layer of each quantization subnetwork is input into the domain discriminator to determine whether the input feature comes from the source domain or the target domain; the discrimination loss is calculated for the result of the domain discriminator and fed back; gradient descent is used for the domain classification layer, and gradient reversal descent is used for the feature extraction layer.
[0057] In some embodiments, the pseudo-labeling method includes: using the subnet with the most parameters and the largest quantization bit width among all quantization networks to classify and predict the target domain data; selecting predictions whose classification probabilities exceed a preset threshold as pseudo-labels; and using the pseudo-labels to perform supervised training on unlabeled data in the target domain.
[0058] During subnet training, the calculation and optimization process of classification loss includes: inputting the features extracted by the quantization subnet into the classification layer to predict the classification category of the data; for labeled source domain data, directly calculating the cross entropy loss of the classification layer based on its true label; for unlabeled target domain data, using the classification prediction of the subnet with the most parameters and the largest quantization bit width among all quantization networks as pseudo-labels for supervision, and calculating the loss of the classification layer; performing a weighted summation of the classification losses of the source domain and the target domain to optimize the parameters of the quantization network; preferably, the weight of the source domain loss is 0.5, and the weight of the target domain loss is 1.0.
[0059] For unlabeled target domain data, the following steps are performed: the subnetwork with the most parameters and the largest quantization bit width among all quantization networks is used to perform classification prediction on the target domain data to obtain a classification probability distribution; the maximum classification probability of each target domain data sample is determined as a candidate pseudo label; if the maximum probability of the candidate pseudo label reaches or exceeds a preset confidence threshold, the predicted category is used as the pseudo label; and the unlabeled data of the target domain is trained using the pseudo label as a supervisory signal.
[0060] In some embodiments, when training subnets, a convergence speed-based group training and knowledge distillation mechanism is adopted, specifically including: pre-training quantized subnets to evaluate their classification accuracy, thereby determining the convergence speed of each subnet; grouping the quantized subnets according to the classification accuracy to achieve clustering of the subnet convergence speed; applying a sampling strategy that is inversely proportional to the subnet convergence speed for training to enhance the training intensity of subnets with slow convergence speeds; implementing group knowledge distillation, using subnets with fast convergence speeds to transfer knowledge to subnets with slow convergence speeds, to promote the improvement of overall network performance.
[0061] Specific embodiments of the present invention are further described below.
[0062] Figure 1 Flowchart of a quantization method for unsupervised domain adaptation tasks without retraining according to an embodiment of the present invention. Figure 1 As shown, a quantization domain adaptation method for edge devices without retraining is provided, comprising:
[0063] Unsupervised domain adaptation of quantized networks: Use multiple quantization bit widths to simultaneously search for quantization bit widths for unsupervised domain adaptation networks that do not require retraining. Use domain discriminators and pseudo-labeling techniques to perform unsupervised domain adaptation on different quantized subnetworks. This strategy can obtain different computing quantum networks with different quantization bit widths, and can simultaneously solve the label-free problem and domain adaptation problem of unsupervised domain adaptation.
[0064] Subnet training method: First, perform some pre-training to determine the convergence speed and training difficulty of each quantized subnet. Based on this, use a training sampling method that is inversely proportional to the convergence speed for different subnets. Subnets are grouped according to their convergence difficulty, and knowledge distillation is performed on subnets with faster convergence speed from slower convergence speed, thereby accelerating the overall convergence speed.
[0065] In the unsupervised domain adaptation of the quantized network, the present invention uses domain discriminators and pseudo-labeling techniques to solve the domain drift and unlabeled problems of the target domain. The following steps are performed once in each training:
[0066] S1. Select the appropriate dimension to configure the subnet; use a 3-layer MLP to build a domain discriminator for binary classification; input the output of the feature layer of each quantized subnet into the domain discriminator to determine whether the input features come from the source domain or the target domain; calculate the discrimination loss for the results of the domain discriminator and return it; use gradient descent for the domain classification layer and gradient reversal descent for the feature extraction layer.
[0067] S2. Use the subnetwork features obtained in step S1 to pass through the classification layer to obtain the classification category; for the labeled source domain, directly use the classification loss; for the unlabeled target domain, use the classification category of the subnetwork with the most parameters and the largest quantization bit width among all quantized networks as the pseudo-label for supervision; obtain the classification loss and perform gradient backpropagation;
[0068] S3. For the losses obtained in step S1 and step S2, preferably weight coefficients of 0.5 and 1.0 are used for weighted summation.
[0069] Step S1 specifically includes:
[0070] Through preliminary experiments, we determined the appropriate subnetwork dimensions, and ultimately selected the network's input resolution, width, and quantization bit width to configure the subnetwork. In networks that do not require retraining, we used the quantization-aware training method, LSQ, to learn the appropriate quantization step size for different subnetworks, thereby reducing quantization error.
[0071] A domain discriminator is constructed using a multi-layer perceptron. The output of the shared network feature layer is used as the input of the domain discriminator to distinguish whether the feature comes from the source domain or the target domain. This is used for binary classification. Gradient descent is used in the domain classification layer, and reverse gradient descent is used in the feature extraction layer to address the problem of domain feature drift.
[0072] Step S2 and step S3 specifically include:
[0073] The output of the subnetwork feature layer in step S1 is used as the input of the category classification layer to obtain the classification category; for the labeled source domain data, the classification cross entropy loss is directly calculated; for the unlabeled target domain, the maximum classification probability obtained by the maximum network is used as the candidate value. If the maximum probability reaches the set threshold, the prediction is used as the pseudo label as the supervision signal of the target domain data, thereby training the unlabeled data of the target domain; for the two types of losses obtained in step S2, they are weighted and summed with coefficients of 0.5 and 1.0.
[0074] In the subnet training method, a sampling training method that is inversely proportional to the subnet convergence speed and a group distillation method derived therefrom are used. The specific steps are as follows:
[0075] T1: Pre-train for 10 rounds and use the test data to obtain the classification accuracy of each quantized subnet;
[0076] T2: Arrange the classification accuracy from high to low, and divide the arrangement into several groups continuously;
[0077] T3: Use classification accuracy to represent the subnet convergence speed, and use a sampling method inversely proportional to it for training;
[0078] T4: For the different groups obtained in T2, use the subnet group with fast convergence speed to perform knowledge distillation on the subnet group with slow convergence speed. Steps T1 and T2 are to cluster the many subnets according to the convergence speed of training, so that corresponding knowledge distillation can be performed according to the difference in convergence speed.
[0079] In step T3, in order to further strengthen the training of the subnet with slow convergence speed, the training probability of the subnet with slow convergence speed is increased, so that each subnet can achieve a balance between classification accuracy and computational complexity.
[0080] Step T4 uses clustering to perform knowledge distillation. By implementing targeted knowledge transfer to subnets in different groups, it optimizes the performance of the entire quantization network and ensures that all subnets can effectively learn and adapt to the data in the target domain.
[0081] Figure 2 The algorithm framework of the embodiment of the present invention is shown.
[0082] In one example, the pseudocode for the training algorithm is as follows:
[0083]
[0084] In general, the present invention provides a training method for unsupervised domain adaptation of edge devices that does not require retraining and quantization. The method first performs pre-training to understand the convergence speed and training difficulty of different quantized subnets. On this basis, a training sampling strategy based on the inverse of the convergence speed is designed for different subnets. That is, for subnets that converge more slowly, more training resources are allocated, while for subnets that converge faster, the number of training times is reduced. This can effectively utilize training resources and improve overall training efficiency. In addition, based on the convergence difficulty of the subnets, the quantized subnets are divided into different groups. Through knowledge distillation, the subnet group with faster convergence is used to transfer knowledge to the subnet group with slower convergence, so that the subnet with slower convergence can accelerate learning. This intra-group distillation not only speeds up the overall convergence speed, but also realizes information sharing and improvement between subnets. Ultimately, the strategy obtains a quantized network model that does not require retraining. The model can be effectively applied to unsupervised domain adaptation tasks and solves the challenges of domain adaptation under unlabeled data. Through this method, the model not only achieves efficient convergence, but also has strong domain adaptability, providing a flexible and efficient quantitative solution for practical applications.
[0085] The important features of the present invention are:
[0086] 1. From the perspective of model quantization, this paper transforms the unsupervised domain adaptation network into a quantized network that does not require retraining. By using domain discriminators for different quantized subnetworks, the domain adaptation capability of the quantized model is improved.
[0087] 2. From the perspective of efficient training, this paper proposes how to efficiently train all subnets within a large number of them. By pre-training the model to determine the convergence speed of each subnet, and then sampling inversely proportional to the speed, networks with slow convergence speeds receive more training, ultimately achieving a balance between accuracy and efficiency for all subnets.
[0088] 3. Starting from how to comprehensively improve the classification accuracy of subnets, the present invention proposes grouping all subnets according to their classification accuracy, and then performing knowledge distillation on the groups with low classification accuracy from the groups with high classification accuracy, so that all subnets can be gradually trained.
[0089] The main technical advantages of the present invention are as follows:
[0090] 1. This invention addresses the domain drift of quantized subnets between different domains without requiring retraining. It uses a domain discriminator on the quantized subnet, thereby resolving the domain feature drift caused by different sources. To address the problem of the target domain being unlabeled in unsupervised domain adaptation, this invention uses the reliable classification predictions obtained from the subnet with the most parameters and the largest quantization bit width among all quantized networks as pseudo-labels to perform progress on the target domain, thereby completing the unsupervised domain adaptation task of the quantized network.
[0091] 2. The present invention classifies subnets according to the convergence speed of different subnets, uses subnets with fast convergence speed to perform knowledge distillation on subnets with slow convergence speed, and at the same time performs sampling training on subnets according to the inverse ratio of the convergence speed, so that subnets with slow convergence speed get more training opportunities, so that each subnet can achieve a balance between classification accuracy and inference efficiency.
[0092] An embodiment of the present invention further provides a storage medium for storing a computer program, which at least performs the above method when executed.
[0093] An embodiment of the present invention further provides a control device, comprising a processor and a storage medium for storing a computer program; wherein the processor is configured to execute at least the method described above when executing the computer program.
[0094] An embodiment of the present invention further provides a processor, which executes a computer program and at least performs the method described above.
[0095] The storage medium can be implemented by any type of non-volatile storage device, or a combination thereof. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a magnetic disk memory or a magnetic tape memory. The storage medium described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.
[0096] In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0097] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0098] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0099] Those skilled in the art will understand that all or part of the steps of the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc. Various media that can store program codes.
[0100] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0101] The methods disclosed in the several method embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments.
[0102] The features disclosed in several product embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new product embodiments.
[0103] The features disclosed in several method or device embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0104] The above is a further detailed description of the present invention in conjunction with specific preferred embodiments, and the specific implementation of the present invention should not be considered to be limited to these descriptions. Those skilled in the art will recognize that, without departing from the scope of the present invention, several equivalent substitutions or obvious variations can be made, and the performance or use of the same should be considered to fall within the scope of protection of the present invention.
Claims
1. A quantization domain adaptation method for edge devices without retraining, characterized in that: The following steps are involved: Step 1: Quantization Network Construction: Perform a multi-quantization bit width search to adapt to edge devices with different computing resources and determine the optimal quantization bit width for each quantization subnetwork in the unsupervised domain adaptation network. Build a domain discriminator for the quantization network to distinguish the features of the source and target domains. Feedback from the domain discriminator guides the training of the feature extraction quantization network, making the feature distributions of the source and target domains closer. Using a pseudo-labeling method, pseudo-labels are generated for unlabeled target domain data through classification prediction of the subnet with the most parameters and the largest quantization bit width among all quantized networks. The output of the feature layer of each quantized subnet is input into the domain discriminator to discriminate whether the input features come from the source domain or the target domain. The discriminant loss is calculated for the results of the domain discriminator and fed back. Gradient descent is used for the domain classification layer, and gradient reversal descent is used for the feature extraction layer. Step 2: Pre-training: Perform preliminary training on the quantized network to evaluate the convergence speed and training difficulty of each quantized subnet. Use the test dataset to evaluate the quantized subnet and obtain the classification accuracy of each quantized subnet. Based on the classification accuracy, determine the convergence speed and training difficulty of the quantized subnet. Step 3. Subnet training: The quantized subnets are grouped according to the convergence speed and training difficulty obtained in the pre-training phase to implement differentiated training strategies. A sampling training method that is inversely proportional to the subnet convergence speed is used to allocate more training resources to subnets with slower convergence. Knowledge distillation is implemented, using the subnet group with a fast convergence speed as the teacher model to transfer knowledge to the subnet group with a slow convergence speed as the student model, accelerating the latter's learning process.
2. The method for quantization domain adaptation without retraining for edge devices according to claim 1, wherein: The domain discriminator uses a multi-layer perceptron (MLP) network to distinguish the features of the source domain and the target domain to achieve a binary classification task.
3. The method for quantization domain adaptation without retraining for edge devices according to any one of claims 1 to 2, characterized in that: The pseudo-labeling method comprises: The subnet with the most parameters and the largest quantization bit width among all quantized networks is used to perform classification prediction on the target domain data; Select predictions whose classification probability exceeds a preset threshold as pseudo labels; The pseudo labels are used to perform supervised training on unlabeled data of the target domain.
4. The method for quantization domain adaptation for edge devices without retraining according to any one of claims 1 to 2, characterized in that: When training a subnet, the calculation and optimization process of the classification loss includes: The features extracted by the quantization subnet are input into the classification layer to predict the classification category of the data; For labeled source domain data, the cross entropy loss of the classification layer is directly calculated based on its true label; For unlabeled target domain data, the classification prediction of the subnetwork with the most parameters and the largest quantization bit width among all quantized networks is used as pseudo-label for supervision to calculate the loss of the classification layer; The classification losses of the source domain and the target domain are weighted summed to optimize the parameters of the quantization network.
5. The method for quantization domain adaptation without retraining for edge devices according to claim 4, wherein: The source domain loss has a weight of 0.5, and the target domain loss has a weight of 1.
0.
6. The method for quantization domain adaptation without retraining for edge devices according to claim 4, wherein: For unlabeled target domain data, perform the following steps: Use the subnet with the most parameters and the largest quantization bit width among all quantized networks to classify and predict the target domain data and obtain the classification probability distribution; Determine the maximum classification probability of each target domain data sample as a candidate pseudo label; If the maximum probability of the candidate pseudo-label reaches or exceeds the preset confidence threshold, the predicted category is used as the pseudo-label; The pseudo labels are used as supervisory signals to train the unlabeled data of the target domain.
7. The method for quantization domain adaptation without retraining for edge devices according to any one of claims 1 to 2, characterized in that: When training the subnet, we use a convergence-speed-based group training and knowledge distillation mechanism, specifically including: Pre-train the quantized subnetwork to evaluate its classification accuracy and thus determine the convergence speed of each subnetwork; The quantized subnetworks are grouped according to the classification accuracy to achieve clustering of the subnetwork convergence speed; Apply a sampling strategy that is inversely proportional to the subnet convergence speed for training to increase the training intensity of the subnet with slow convergence speed; Implement group knowledge distillation and use subnets with fast convergence speed to transfer knowledge to subnets with slow convergence speed to promote the improvement of overall network performance.
8. The method for quantization domain adaptation for edge devices without retraining according to any one of claims 1 to 2, characterized in that: In step 1, preliminary experiments are performed to determine the appropriate subnetwork dimensions, including the network's input resolution, width, and quantization bit width, to optimize the subnetwork configuration.
9. The method for quantization domain adaptation without retraining for edge devices according to any one of claims 1 to 2, characterized in that: In step three, the quantization-aware training method LSQ is applied to enable the network to learn the appropriate quantization step size during training to reduce the error in the quantization process.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for quantization domain adaptation without retraining for an edge device according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Voice noise reduction method, electronic equipment and medium
CN117133303A
Method for efficient machine learning
EP4266220A1