Deep learning model rapid iteration method based on incremental header parameter fusion

By freezing the parameters of the backbone network and initial head in the deep learning model, fine-tuning the incremental head, and fusing parameters through grid search, the problems of long model update time and poor performance in the existing technology are solved, and rapid iteration and Multi-domain compatible deep learning model updates.

CN118569341APending Publication Date: 2024-08-30FREESENSE IMAGE TECH

Patent Information

Application Number
CN202410712694.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

When updating deep learning models with existing technologies, it is usually necessary to train from scratch or only use new domain data, resulting in increased training time or reduced model performance, and cannot meet the needs for rapid iteration and multi-domain compatibility.

Method used

By building a basic model, freezing the parameters of the backbone network and initial head, fine-tuning the incremental head under new domain data, and fusing the parameters of the initial head and incremental head through grid search, a weighted combination of model structure and weights is achieved to quickly Update model.

Benefits of technology

It greatly shortens the model update time, maintains good recognition results, and flexibly controls the performance of new and old domains, making it suitable for a variety of deep learning tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118569341A
    Figure CN118569341A
Patent Text Reader

Abstract

The invention discloses a deep learning model rapid iteration method based on incremental header parameter fusion, and the method comprises the following steps: S1, constructing a basic model, and carrying out the initial training based on an initial data set to obtain a model weight; s2, reconstructing a model structure after increment by adding a task head on the basic model, loading an initial training model weight, freezing parameters of a backbone network and an initial head, and training a fine adjustment increment head under new domain data; and S3, a weighted parameter combination is searched through a grid search strategy, network parameters of the initial header and the incremental header are fused based on the weighted parameters, and the model structure is restored, the model updating time can be greatly shortened, and meanwhile a good recognition effect is kept. The method is suitable for a deep learning model of multiple tasks, such as image classification, target detection and semantic segmentation, and can flexibly control the expression ability of a new domain and an old domain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to fields related to deep learning model training, and specifically to a deep learning model rapid iteration method based on incremental head parameter fusion, which is mainly used in the fields of model optimization training and iterative update when deep learning technology is implemented in projects. Background Art

[0002] With the popularization of deep learning technology, many related technologies have been widely used in tasks in various fields and have shown good performance. When applying such methods, a large amount of data is usually collected and labeled in advance, and the model parameters are optimized through iterative training so that the trained model can achieve specific recognition functions. In actual use, there are often some situations where the model needs to be updated. For example, the shape or scene (referred to as "domain") of the recognition object changes, so that the weights of the trained model cannot always be applied. In order to ensure that the recognition equipment continues to work effectively, the model needs to be optimized again. The usual practice is to add the data of the new domain to the data of the old domain and start training from scratch. This will consume a lot of time and cannot meet the needs of timely launch.

[0003] When deep learning is applied, especially in the fields of industrial quality inspection, there are two common situations that force the model to be updated frequently: First, the form of defects on the product is often changeable and unknown. In the early stage, only image data of some known defect forms can be collected. With the emergence of new defect forms, the model must be updated in time; second, the replacement of detection equipment or the adjustment of shooting parameters (such as brightness, viewing angle, etc.) causes differences between images, resulting in the previously trained model not working well. In this case, the model also needs to be updated. When updating the model, because the equipment will be deployed in multiple stages or scenarios, the new domain cannot be uniquely determined, and it is usually hoped that the effects in the new domain and the old domain can be taken into account. Existing technologies usually use the following schemes to update models: ① Add new domain data to old domain data, retrain or fine-tune all data to ensure that the model is compatible with multiple scenarios. The disadvantage is that the training time increases due to the increase in data volume; ② Only fine-tune the new domain data based on the existing model. Due to the lack of guidance from the old domain model parameters and samples, the new model will suffer from catastrophic forgetting and will only be effective in the new domain. Therefore, the new and old models are usually predicted separately during prediction, and then the results are fused. The advantage of this method is that only using new domain data will greatly reduce training time, but the disadvantage is that it will consume a lot of time during inference; ③ Use cutting-edge incremental learning technology to update the model, optimize the model by modeling the feature association between new domain data and old domain data during training, so that the model can balance the performance on the two domains. Although this type of method takes a short time, it is too cumbersome to implement and the performance is not very stable. At the same time, it implicitly requires that the difference between the two domains should not be too large. When the difference is too large, the performance of most methods will be severely reduced, even lower than that of simple baseline models. It can be seen that while expanding the model capabilities, the current technology will consume a lot of time in training and prediction, or have shortcomings in model performance. Therefore, it is of great significance to study fast and effective iterative methods for deep models. Summary of the invention

[0004] In view of the shortcomings of the prior art, the present invention provides a method for fast iteration of deep learning models based on incremental head parameter fusion, which can greatly shorten the model update time while maintaining good recognition effect. The present invention is applicable to deep learning models for various tasks, such as image classification, target detection, semantic segmentation, etc., and can flexibly control the performance of new and old domains.

[0005] To achieve the above object, the present invention provides the following technical solutions: The deep learning model fast iteration method based on incremental head parameter fusion includes the following steps: Step S1: Build a basic model and obtain model weights by training from scratch based on the initial data set; Step S2: Reconstruct the incremental model structure by adding a task head to the base model, load the initial training model weights, freeze the parameters of the backbone network and the initial head, and train and fine-tune the incremental head under the new domain data; Step S3: Search for weighted parameter combinations through a grid search strategy, fuse the network parameters of the initial head and the incremental head based on the weighted parameters, and restore the model structure.

[0006] As a further solution of the present invention, in step S2, the backbone network and task head structure parts of the model are determined by dividing the entire model according to the structure, and the incremental model structure is reconstructed by adding the task head to the network structure of the basic model.

[0007] As a further solution of the present invention, in step S3, additional weighted parameters are added to the parameter parts of the initial header and the incremental header, and weighted parameter pairs are formed at the same position, part of the training data and the verification data are extracted to form the search data, and the parameters of the initial header and the incremental header are fused through a grid search strategy and the effect is evaluated on the search data, and the weighted parameter pair with the best result is selected and retained.

[0008] As a further solution of the present invention, in step S1, in the initial version model preparation stage, existing data is collected and labeled according to specific tasks, the training set and the verification set are divided, the model structure is constructed, the training hyperparameters are set, and the model parameters are optimized through iterative training and indicator verification so that it can have recognition capabilities on the current existing data. After the training is completed, the model is directly used for online deployment.

[0009] As a further solution of the present invention, a task head is added to the initial model through an incremental head fine-tuning module, and the incremental head is fine-tuned using a frozen parameter method to speed up the training.

[0010] As a further solution of the present invention, by fusing a weighted parameter search module, the model obtained after fine-tuning the incremental head includes two task heads with the same structure but different weight parameters.

[0011] As a further solution of the present invention, in step S3, the fusion weighted parameter search module obtains the optimal weighted coefficient by grid search to complete the search process. The specific steps are: extracting part of the data from the training set and the validation set to form a search data set, and for all sample data, using the backbone network to perform inference in turn and save the network output results; obtaining the network structure and weight parameters of the initial head and the incremental head, and assigning weighted coefficients to each parameter of the initial head and the incremental head; instantiating the fusion heads one by one from the weighted coefficient combination set, and using the output result of the backbone network as input to obtain the final output result of the model, and performing indicator evaluation, taking the weighted coefficient combination corresponding to the highest indicator as the final search result, and obtaining the corresponding fusion head parameters.

[0012] The present invention has the following beneficial effects: The present invention adopts a fast iteration method of deep learning model based on incremental head parameter fusion. An incremental head fine-tuning module and a parameter fusion weight search module are proposed. This method is applicable to the basic model of various tasks and provides some ideas for solutions of similar projects.

[0013] The present invention obtains the model weights by training from scratch based on a benchmark data set; then, a head is added to the basic model to reconstruct the model structure, and the parameters of the backbone network and the initial head are frozen, and the incremental head is trained and fine-tuned under new data; finally, the network structure is restored by fusing the parameters of the new initial head. At the same time, the present invention also proposes a fusion weighted parameter search module, which provides a way of thinking for parameter fusion of the same network structure based on a grid search method. Through this solution, the best combination of weighted coefficients can be effectively searched. This solution is suitable for a variety of tasks and a variety of structures, and has a certain degree of universality. It solves the problem that the previous method is time-consuming and ineffective when updating the model in time for changes in the data domain (such as adding new target forms or scenes) after the model is launched.

[0014] In order to more clearly illustrate the structural features and effects of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 This is an overall flow chart of an embodiment of the present invention.

[0016] Figure 2 It is a working principle diagram of the incremental head fine-tuning module mentioned in an embodiment of the present invention.

[0017] Figure 3 , Figure 4 It is a working principle diagram of the parameter fusion weight search module mentioned in an embodiment of the present invention. DETAILED DESCRIPTION

[0018] The present invention will be further explained below in conjunction with the accompanying drawings and related knowledge, and described clearly and completely. Obviously, the described application is only a part of the embodiments of the present invention, rather than all the embodiments.

[0019] The existing common deep learning models are mainly some basic visual tasks, such as image classification, semantic segmentation and target detection. The network structure of this type of model can be seen as consisting of a backbone network and a task head, where the backbone network is mainly used to extract image features, and the task head is used to implement specific tasks. The present invention proposes to significantly speed up the training speed by fixing the backbone network parameters, adding and only training the incremental head for learning new data, and then fusing the parameters of the new initial head through a strategy, so that the model can take into account the performance of the new and old domains, thereby achieving fast and effective iteration of the model in scenarios with domain changes after going online. The present invention develops a deep learning model fast iteration method based on incremental head parameter fusion, which greatly improves the efficiency of model updates in scenarios with domain changes, and the method is of great practical significance.

[0020] Reference Figure 1-Figure 4 As shown, the present invention provides a deep learning model fast iteration method based on incremental head parameter fusion, comprising the following steps: Step S1: Build a basic model and obtain model weights by training from scratch based on the initial data set; Step S2: Reconstruct the incremental model structure by adding a task head to the base model, load the initial training model weights, freeze the parameters of the backbone network and the initial head, train and fine-tune the incremental head under the new domain data, further, determine the backbone network and task head structure parts of the model respectively, reconstruct the incremental model structure by adding a task head to the base model (the incremental head and the initial head have the same structure), load the initial training model weights, freeze the parameters of the backbone network and the initial head, and train and fine-tune the incremental head under the new domain data; The present invention determines the backbone network and task head structure of the model by dividing the entire model according to the structure, reconstructs the incremental model structure by adding a task head (the incremental head has the same structure as the initial head) to the network structure of the basic model, freezes the parameters of the backbone network and the initial head, and trains and fine-tunes the incremental head under the new domain data, so that the model can have a good effect in the new domain.

[0021] Step S3: Search for weighted parameter combinations through a grid search strategy, fuse the network parameters of the initial head and the incremental head based on the weighted parameters, and restore the model structure; further, add additional weighted parameters to the parameter parts of the initial head and the incremental head, and form weighted parameter pairs at the same position, extract part of the training data and verification data to form search data, fuse the parameters of the initial head and the newly added head through a grid search strategy and evaluate the effect on the search data, select and retain the weighted parameter pair with the best result, and weightedly fuse the network parameters of the initial head and the incremental head through the weighted parameter pair, and restore the model structure. The method proposed by the present invention can achieve rapid iterative updates of the model when the domain changes after the model is online, and can have better results.

[0022] In the embodiment of the present invention, refer to Figure 1 As shown in the figure, a fast iteration method for deep learning models based on incremental head parameter fusion mainly includes an incremental head fine-tuning module and a parameter fusion weight search module; specifically, a basic model is constructed, and the model weights are obtained by training from scratch based on the initial data set; the backbone network and task head structures are determined according to the model structure, and the incremental model structure is reconstructed by adding a task head to the network structure of the basic model (the incremental head and the initial head have the same structure), freezing the parameters of the backbone network and the initial head, and training and fine-tuning the incremental head under the new domain data so that the model can have a good effect in the new domain; additional weighted parameters are added to the parameter part of the initial head and the incremental head, and weighted parameter pairs are formed at the same position, part of the training data and the verification data are extracted to form the search data, the parameters of the initial head and the newly added head are fused through the grid search strategy and the effect is evaluated on the search data, and the weighted parameter pair with the best result is selected and retained to complete the search process; the network parameters of the initial head and the incremental head are fused through the weighted parameter pair to restore the model structure.

[0023] In the present invention, in the initial version model preparation stage, existing data is collected and labeled according to specific tasks (classification, segmentation or detection), training sets and verification sets are divided, the model structure is constructed, training hyperparameters are set, and model parameters are optimized through iterative training and indicator verification so that it can have better recognition capabilities on the current existing data. After training is completed, the model can be directly used for online deployment.

[0024] In the present invention, reference is made to Figure 2 As shown in the figure, the purpose of the incremental head fine-tuning module is to quickly learn the characteristics of the data in the new domain. The speed is mainly reflected in two aspects: first, a new task head is added to the initial model, and the incremental head is fine-tuned by freezing parameters to speed up the training; second, it is different from training with all data, and only training pictures in the new domain can reduce the training time. Specifically: First, for common visual task (image classification, semantic segmentation, target detection) models, they are divided into backbone networks and task heads according to the structure. The structure of the task head should not be too shallow, and the task head should have an appropriate number of convolutional layers to ensure learning ability, otherwise it will increase the difficulty of fine-tuning on the new domain data; then, a task head branch with the same structure as the initial head is built on the initial model structure, and the initial model training weights are loaded during training, and the parameters of the backbone network and the initial head are frozen to keep their values ​​unchanged during iteration, and the incremental head is fine-tuned using the new domain data for training.

[0025] In the present invention, reference is made to Figure 3As shown in the figure, in the fusion weighted parameter search module, the model obtained after the incremental head fine-tuning training contains two task heads with the same structure but different weight parameters. Therefore, the parameters of the two task heads can be fused in a weighted manner. In order to ensure the performance of the model, it is necessary to search for the best weighted pair combination. First, additional weighted parameters are added to the parameter part of the initial head and the incremental head, and weighted parameter pairs are formed at the same position. A variety of weighted parameter pairs and corresponding fusion models are obtained by grid search. Then, the performance of different fusion models on the search data set is compared to obtain the best weighted parameter pair combination. After searching for the fusion weighted parameters, the initial head and the incremental head are weighted layer by layer to obtain the final model weight. The model network structure is the initial model structure, and the entire model rapid iteration process is completed.

[0026] In the present invention, the core idea of ​​the fusion weighted parameter search module is to complete the search process by obtaining the optimal weighted coefficient through grid search. The main process is: Extract part of the data from the training set and validation set to form the search data set. For all sample data, use the backbone network to perform inference in turn and save the network output results. Get the network structure and weight parameters of the initial head and incremental head. Now take the simple structure of commonly used operation stacking as an example: Conv--Pooling--Conv(BN)--ReLU--FC(BN)--FC--Softmax. In this structure, the operations containing weight parameters are Conv, Conv(BN), FC(BN), FC. The initial head and incremental head parameter sets can be expressed as and .

[0027] Assign a weighted coefficient to each parameter of the initial header and the incremental header, and the weighted coefficient set can be expressed as and , Then the fusion model weight parameter set is expressed as: The value range of is [1,4] indicating the parameter layer. The present invention can focus on strengthening the recognition performance of the new domain or the old domain by uniformly assigning higher weighted parameters to the original header or the newly added header, which reflects the flexible control characteristics of the method.

[0028] From the weighted coefficient combination set Instantiate the fusion heads one by one, and take the output of the backbone network in the above as input to obtain the final output of the model, and perform indicator evaluation. The weighted coefficient combination corresponding to the highest indicator is taken as the final search result, and the corresponding fusion head parameters are obtained.

[0029] The present invention proposes a method for fast iteration of deep learning models based on incremental head parameter fusion, which obtains model weights by training from scratch based on a benchmark data set; then, a head is added to the base model to reconstruct the model structure, and the parameters of the backbone network and the initial head are frozen, and the incremental head is trained and fine-tuned under new data; the network structure is restored by fusing the parameters of the new initial head. At the same time, the present invention also proposes a fusion weighted parameter search module, which provides ideas for parameter fusion of the same network structure based on a grid search method. This scheme can effectively search for the best combination of weighted coefficients. This scheme is suitable for a variety of tasks and structures, has a certain degree of universality, and solves the problem that the previous method is time-consuming and ineffective when updating the model in time for changes in the data domain (such as adding new target forms or scenes) after the model is launched.

[0030] The technical principle of the present invention is described above in combination with the specific embodiments, which are only preferred implementations of the present invention. The protection scope of the present invention is not limited to the above embodiments, and all technical solutions under the idea of ​​the present invention belong to the protection scope of the present invention. Those skilled in the art can think of other specific implementations of the present invention without creative work, and these methods will fall within the protection scope of the present invention.

Claims

1. A fast iteration method for deep learning models based on incremental head parameter fusion, It is characterized in that The following steps are involved: Step S1: Build a basic model and obtain model weights by training from scratch based on the initial data set; Step S2: Reconstruct the incremental model structure by adding a task head to the base model, load the initial training model weights, freeze the parameters of the backbone network and the initial head, and train and fine-tune the incremental head under the new domain data; Step S3: Search for weighted parameter combinations through a grid search strategy, fuse the network parameters of the initial head and the incremental head based on the weighted parameters, and restore the model structure.

2. The deep learning model fast iteration method based on incremental head parameter fusion as claimed in claim 1, It is characterized in that In step S2, the backbone network and task head structure of the model are determined by dividing the entire model according to the structure, and the incremental model structure is reconstructed by adding the task head to the network structure of the basic model.

3. The deep learning model fast iteration method based on incremental head parameter fusion as claimed in claim 2, It is characterized in that In step S3, additional weighted parameters are added to the parameter parts of the initial header and the incremental header, and weighted parameter pairs are formed at the same position. Part of the training data and verification data are extracted to form the search data. The parameters of the initial header and the incremental header are fused through the grid search strategy and the effect is evaluated on the search data. The weighted parameter pair with the best result is selected and retained.

4. The deep learning model fast iteration method based on incremental head parameter fusion as claimed in claim 3, It is characterized in that In step S1, during the initial model preparation phase, existing data is collected and annotated according to specific tasks, divided into training sets and validation sets, the model structure is constructed, training hyperparameters are set, and model parameters are optimized through iterative training and indicator verification so that it can have recognition capabilities on the current existing data. After training, the model is directly used for online deployment.

5. The deep learning model fast iteration method based on incremental head parameter fusion as claimed in claim 4, It is characterized in that A new task head is added to the initial model through the incremental head fine-tuning module, and the incremental head is fine-tuned using the frozen parameter method to speed up training.

6. The deep learning model fast iteration method based on incremental head parameter fusion as claimed in claim 5, It is characterized in that By fusing the weighted parameter search module, the model obtained after fine-tuning the incremental head contains two task heads with the same structure but different weight parameters.

7. The deep learning model fast iteration method based on incremental head parameter fusion as claimed in claim 6, It is characterized in that In step S3, the fusion weighted parameter search module obtains the optimal weighted coefficient by grid search to complete the search process. The specific steps are as follows: extract part of the data from the training set and the validation set to form a search data set, and for all sample data, use the backbone network to perform inference in turn and save the network output results; obtain the network structure and weight parameters of the initial head and the incremental head, and assign weighted coefficients to each parameter of the initial head and the incremental head; instantiate the fusion heads one by one from the weighted coefficient combination set, and use the output result of the backbone network as input to obtain the final output result of the model, and perform indicator evaluation, and use the weighted coefficient combination corresponding to the highest indicator as the final search result, and obtain the corresponding fusion head parameters.

Citation Information

Patent Citations

  • Model processing method and device, equipment and storage medium

    CN117807435A

  • Model processing method, data processing method and computing device

    CN117829103A

  • SAR (Synthetic Aperture Radar) target increment identification method based on feature fusion, increment classifier and representation learning

    CN118115800A

Cited By

  • Online domain adaptive learning method based on multi-head self-integration

    CN119494424A