Method for generating low migration gap visual self-supervised learning model

By determining the backbone network and neck network in visual self-supervised learning, using a multi-stage loss function and a teacher backbone network to generate intermediate reconstruction labels, the problem of transfer gap in the existing technology is solved, and obstacles to rapid training and high accuracy are achieved object identification.

CN118570576AInactive Publication Date: 2024-08-30SUZHOU DACHENGYUNHE INTELLIGENT TECH CO LTD

Patent Information

Application Number
CN202410550135.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-06
Publication Date
2024-08-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In existing visual self-supervision tasks, the backbone network parameter optimization is not suitable for multi-scale feature extraction, and the neck network parameter optimization in the fine-tuning stage starts with random initialization, resulting in migration gaps and affecting the recognition results.

Method used

By determining the backbone network and neck network, a multi-stage loss function is adopted, including mask image modeling and mask feature modeling loss, the teacher backbone network is used to generate intermediate reconstruction labels, and the neck network is combined for training to minimize the transfer gap. .

Benefits of technology

A fast training process and high-accuracy obstacle recognition are achieved, and the recognition accuracy is increased from 60% to 90%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570576A
    Figure CN118570576A
Patent Text Reader

Abstract

The invention discloses a method for generating a visual self-supervised learning model with a low migration gap. The method comprises the following steps: S1, determining a backbone network and a neck network; s2, simplifying the backbone network; s3, generating an intermediate reconstruction label xs; s4, determining a multi-stage loss function l; s5, constructing a model to be trained; s6, obtaining an upstream task data set and a downstream task data set; s7, training the to-be-trained model; and S8, performing fine adjustment on the pre-training model. According to the method, the neck network is used for reconstruction and recognition, so that the migration gap between pre-training and fine tuning is reduced to the maximum extent. In addition, the method designs a mask feature modeling (MFM) task to supplement mask image modeling (MIM) so as to better optimize the neck network. The visual identification model pre-trained by the method has high identification accuracy on obstacle identification in the unmanned logistics area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of visual self-supervision, and in particular to a method for generating a low migration gap visual self-supervision learning model. Background Art

[0002] Most current visual self-supervision tasks have two flaws: first, the optimization goal of the backbone network parameters is not to extract multi-scale features; second, in the fine-tuning stage, the optimization of the neck network parameters starts with random initialization, which slows down the training process and leads to unsatisfactory recognition results. This unsatisfactory recognition result is called the transfer gap. Summary of the invention

[0003] In order to solve the problems existing in the background technology, the present invention provides a method for generating a low migration gap visual self-supervised learning model with a fast training process and ideal recognition results.

[0004] To this end, the present invention adopts the following technical solutions:

[0005] A method for generating a visual self-supervised learning model with low transfer gap, comprising the following steps:

[0006] S1, determine the backbone network and the neck network, specifically including the following steps:

[0007] S11, determine the backbone network f(x;θ):

[0008] f(x;θ)=U 0 , U 1 , U 2 , ...U s ;

[0009] Among them, x is the input image; θ is the learnable parameter of the backbone network; U 0 Represents the result after slicing the input image x, U s It represents the backbone network feature map output at the s-th stage of the backbone network, where: 1≤s≤L; L is the number of stages of the backbone network;

[0010] S12, determine the neck network:

[0011] The mathematical description of the neck network is shown below:

[0012]

[0013] Among them, g s (·) represents the function of the sth layer of the neck network g(·;ф), which is used to adjust V s+1 Upsample it so that it is consistent with V s The resolution is consistent with V sis the characteristic map of the neck network at layer s; Ф is the learnable parameter ф of each layer in the neck network s A collection of;

[0014] S13, determine the backbone network type. If the backbone network is HiViT, proceed to step S2. Otherwise, the backbone network is used as the final backbone network and proceed to S3.

[0015] S2, simplify the backbone network to calculate the global attention of image x when s=1; use the simplified backbone network as the final backbone network and enter S3;

[0016] S3, generate intermediate reconstruction label x s :

[0017] Leveraging the Teacher Backbone Network To generate an intermediate reconstruction label x for the image x s , as shown below:

[0018]

[0019] in, is the weight value of the teacher backbone network; Directly inherited from the public CLIP pre-trained model;

[0020] S4, determine the multi-stage loss function l:

[0021] Construct a multi-stage loss function l, including mask image modeling loss and mask feature modeling loss, as shown in the following formula:

[0022]

[0023] Among them, ||xh pt,0 (V)||Model the loss for the mask image, h pt,0 (·) is the rebuild header function;

[0024] is the mask feature modeling loss, which is used to supplement the mask image modeling loss; γ is the mask feature modeling loss coefficient;

[0025] S5, build the model to be trained:

[0026] Construct a model to be trained using the final backbone network, the neck network in S1, and the multi-stage loss function l in S4;

[0027] S6, obtain the upstream task dataset and the downstream task dataset:

[0028] Select upstream task datasets from public datasets to pre-train the model to be trained; wherein N is the total number of samples in the upstream task data set, and n is the sample number in the upstream task data set;

[0029] Collect images of the application site as downstream task datasets Where M is the total number of samples in the downstream task dataset; m is the sample number of the downstream task dataset, yes Labels;

[0030] S7, train the model to be trained:

[0031] The model to be trained in S5 is Training is performed on After training is completed, a pre-trained model is obtained;

[0032] S8, fine-tune the pre-trained model:

[0033] Use the pre-trained model obtained by S7 in the downstream task dataset Fine-tune the training on the pre-trained model; when the pre-trained model is trained to When converged, the trained model is obtained and output;

[0034] Among them, h ft (﹒) is the detection head function.

[0035] Preferably, S2 specifically includes the following steps:

[0036] S21, uses channel multilayer perceptron to replace the displacement window attention;

[0037] S22, remove the stage with a receptive field of 7×7 and directly calculate the global attention in the stage of 14×14;

[0038] S23, let L = 3; each stage consists of 3, 3 and 24 Transformer modules respectively; the frequency of the feature map generated in each stage is 56×56, 28×28 and 14×14 respectively.

[0039] Preferably, the teacher backbone network in S3 directly inherits the model pre-trained by CLIP, downsamples all backbone network feature maps to the lowest spatial resolution (14×14), adds them together, and compares them with the sum of the last layer output of the CLIP model; in this way, the s mask feature modeling tasks are unified into one task.

[0040] Preferably, the h in S4 pt,0 (·) contains several Transformer modules for reconstructing the V.

[0041] Preferably, the public datasets described in S6 include Imagenet and COCO.

[0042] Preferably, the application site in S6 is an unmanned logistics area, and images of obstacles in the unmanned logistics area are collected. Composition of the dataset; the label For the images in the dataset Mark it.

[0043] Preferably, the images in the dataset width.

[0044] Preferably, the pytorch version used for training in S8 is 1.11.0, CUDA version 11.3, the optimizer is AdamW, and the initial learning rate is 1.5×10 -3 , the minimum learning rate is 10 -5 ,The learning rate adjustment strategy adopts the cosine annealing algorithm.

[0045] Preferably, the mask feature modeling loss coefficient in S4 is 0.3.

[0046] Compared with the prior art, the present invention has the following beneficial effects:

[0047] 1. The method of the present invention uses the neck network for reconstruction and recognition, minimizing the migration gap.

[0048] 2. The method of the present invention designs a mask feature modeling (MFM) task to supplement the mask image modeling (MIM), which can better optimize the neck network.

[0049] 3. The training process of the method of the present invention is fast, and the recognition accuracy of obstacles in actual scenes is improved from the current 60% to 90%. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0051] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0052] like Figure 1 As shown, the method of generating a low migration gap visual self-supervised learning model of the present invention specifically includes the following steps:

[0053] S1, determine the backbone network and neck network:

[0054] The backbone network is generally divided into two types: Vision Transformer with a hierarchical structure and a convolutional neural network. The method for determining the backbone network and the neck network includes the following steps:

[0055] S11, determine the backbone network f(x;θ):

[0056] In general, the backbone network f(x; θ) consists of L stages, each of which consists of several Transformer modules or convolutional modules. The backbone network continuously downsamples the input image to generate L+1 feature maps. The backbone network f(x; θ) is expressed as follows;

[0057] f(x;θ)=U 0 , U 1 , U 2 , …U s ;

[0058] Among them, x represents the input image; θ is the learnable parameter in the backbone network, that is, the weight in the backbone network; U 0 Represents the result of slicing the input image x; U s It represents the backbone network feature map output at the s-th stage of the backbone network, where: 1≤s≤L.

[0059] S12, determine the neck network:

[0060] The mathematical description of the neck network is as follows:

[0061]

[0062] Among them, g s (·) represents the function of the sth layer of the neck network g(·;ф), which is used to adjust V s+1 Upsample it so that it is consistent with V s The resolution of is consistent. Ф is the learnable parameter ф of each layer in the neck s A collection of .

[0063] S13, determine the type of the backbone network. When the backbone network is HiViT, proceed to step S2; otherwise, take the backbone network as the final backbone network and proceed to S3.

[0064] S2, simplifies the backbone network so that it can take a whole image as input during training and calculate the global attention of the image when s=1, including the following steps:

[0065] S21, using channel-wise MultiLayer Perceptron (C-MLP) to replace the displacement window attention;

[0066] In S22, the stage with a receptive field of 7×7 is eliminated, and the global attention is directly calculated in the stage of 14×14.

[0067] S23, set L=3; each stage is composed of 3, 3 and 24 Transformer modules respectively; the frequency of the feature map generated in each stage is 56×56, 28×28 and 14×14 respectively. Thus, a simplified backbone network is obtained, and the simplified backbone network is used as the final backbone network to enter S3.

[0068] S3, generate intermediate reconstruction labels x using the pre-trained CLIP model s :

[0069] Leveraging the Teacher Backbone Network To generate an intermediate reconstruction label for the input image x, as shown below:

[0070]

[0071] Among them, x s represents the intermediate reconstruction label (1≤s≤L), is the weight value in the teacher backbone network. The teacher backbone network directly inherits the model pre-trained by CLIP, and then downsamples all backbone network feature maps to the lowest spatial resolution (14×14), adds them together, and then compares them with the sum of the last layer output of the CLIP model. In this way, the s mask feature modeling tasks can be unified into one task.

[0072] S4, determine the multi-stage loss function l:

[0073] Construct a multi-stage loss function l, including mask image modeling loss and mask feature modeling loss, as shown in the following formula:

[0074]

[0075] Among them, ||xh pt,0 (V)||Model the loss for the mask image, h pt,0 (·) contains several Transformer modules to reconstruct V.

[0076] The loss for modeling mask features is used to supplement the loss for modeling mask images; the value of γ is set to 0.3.

[0077] S5, build the model to be trained:

[0078] The model to be trained is constructed using the final backbone network, the neck network, and the multi-stage loss function l in S4.

[0079] S6, obtain the upstream task dataset and the downstream task dataset.

[0080] Select upstream task datasets from the public Imagenet or COCO datasets Where N represents the total number of samples in the upstream task dataset, and n is the sample number of the upstream task dataset.

[0081] Collect data in the area where this model is to be applied (for example, collect images of common obstacles in unmanned logistics areas to form a data set, and the hardware equipment for collecting images is consistent with the on-board camera of the unmanned logistics vehicle). To ensure the effect of the final fine-tuning of the model, the number of images in the data set should be around 10,000. After the image is collected, each image should be labeled and used as a label for downstream fine-tuning training tasks. This will obtain the downstream task data set Where M represents the total number of samples in the downstream task dataset. m is the sample number of the downstream task dataset. yes .

[0082] S7, train the model:

[0083] The model is used in the upstream task dataset The training is performed on the backbone network, and the backbone network is represented as When the model is trained to the point where the multi-stage loss function l in S4 converges, the training ends. The pytorch version used for training is 1.11.0, the CUDA version is 11.3, the optimizer is AdamW, and the initial learning rate is 1.5×10 -3 , the minimum learning rate is 10 -5 ,The learning rate adjustment strategy adopts the cosine annealing algorithm.

[0084] S8, fine-tune the pre-trained model:

[0085] Use the pre-trained model obtained by S7 on downstream task datasets Fine-tune the training on . M represents the number of samples. The optimization goal of the pre-trained model in the downstream task is

[0086] h ft (﹒) indicates the detection head function.

[0087] When the pre-trained model is trained to When converged, a trained model is obtained, which can be used in actual recognition tasks.

Claims

1. A method for generating a visual self-supervised learning model with low transfer gap, characterized in that The following steps are involved: S1, determine the backbone network and the neck network, specifically including the following steps: S11, determine the backbone network f(x;θ): f(x;θ)=U 0 ,IN 1 ,IN 2 ,…IN s ; Among them, x is the input image; θ is the learnable parameter of the backbone network; U 0 Represents the result after slicing the input image x, U s It represents the backbone network feature map output at the s-th stage of the backbone network, where: 1≤s≤L; L is the number of stages of the backbone network; S12, determine the neck network: The mathematical description of the neck network is shown below: Among them, g s (·) represents the function of the sth layer of the neck network g(·;ф), which is used to adjust V s+1 Upsample it so that it is consistent with V s The resolution is consistent with V s is the characteristic map of the neck network at layer s; Ф is the learnable parameter ф of each layer in the neck network s A collection of; S13, determine the backbone network type. If the backbone network is HiViT, proceed to step S2. Otherwise, the backbone network is used as the final backbone network and proceed to S3. S2, simplify the backbone network to calculate the global attention of image x when s=1; use the simplified backbone network as the final backbone network and enter S3; S3, generate intermediate reconstruction label x s : Leveraging the Teacher Backbone Network To generate an intermediate reconstruction label x for the image x s , as shown below: in, is the weight value of the teacher backbone network; Directly inherited from the public CLIP pre-trained model; S4, determine the multi-stage loss function l: Construct a multi-stage loss function l, including mask image modeling loss and mask feature modeling loss, as shown in the following formula: Among them, ||xh pt,0 (V)||Model the loss for the mask image, h pt,0 (·) is the rebuild header function; is the mask feature modeling loss, which is used to supplement the mask image modeling loss; γ is the mask feature modeling loss coefficient; S5, build the model to be trained: Construct a model to be trained using the final backbone network, the neck network in S1, and the multi-stage loss function l in S4; S6, obtain the upstream task dataset and the downstream task dataset: Select upstream task datasets from public datasets to pre-train the model to be trained; wherein N is the total number of samples in the upstream task data set, and n is the sample number in the upstream task data set; Collect images of the application site as downstream task datasets Where M is the total number of samples in the downstream task dataset; m is the sample number of the downstream task dataset, yes Labels; S7, train the model to be trained: The model to be trained in S5 is Training is performed on After the training is completed, the pre-trained model is obtained; S8, fine-tune the pre-trained model: Use the pre-trained model obtained by S7 in the downstream task dataset Fine-tune the training on the pre-trained model; when the pre-trained model is trained to When converged, the trained model is obtained and output; Among them, h ft (﹒) is the detection head function.

2. The method for generating a visual self-supervised learning model with low migration gap according to claim 1, characterized in that: S2 specifically includes the following steps: S21, uses channel multilayer perceptron to replace the displacement window attention; S22, remove the stage with a receptive field of 7×7 and directly calculate the global attention in the stage of 14×14; S23, let L = 3; each stage consists of 3, 3 and 24 Transformer modules respectively; the frequency of the feature map generated in each stage is 56×56, 28×28 and 14×14 respectively.

3. The method for generating a visual self-supervised learning model with low migration gap according to claim 1, characterized in that: The teacher backbone network described in S3 directly inherits the model pre-trained by CLIP, downsamples all backbone network feature maps to the lowest spatial resolution (14×14), adds them together, and compares them with the sum of the last layer output of the CLIP model; in this way, the s mask feature modeling tasks are unified into one task.

4. The method for generating a visual self-supervised learning model with low transfer gap according to claim 1, characterized in that: As described in S4 pt , 0 (·) contains several Transformer modules for reconstructing the V.

5. The method for generating a visual self-supervised learning model with low transfer gap according to claim 1, characterized in that: The publicly available datasets described in S6 include Imagenet and COCO.

6. The method of generating a visual self-supervised learning model with low transfer gap according to claim 1, characterized in that: The application site described in S6 is an unmanned logistics area, and images of obstacles in the unmanned logistics area are collected. Composition of the dataset; the label For the images in the dataset Mark it.

7. The method for generating a visual self-supervised learning model with low transfer gap according to claim 6, characterized in that: Images in the dataset width.

8. The method of generating a visual self-supervised learning model with low transfer gap according to claim 1, characterized in that: The pytorch version used for training in S8 was 1.11.0, CUDA version 11.3, AdamW optimizer, and initial learning rate of 1.5×10 -3 , the minimum learning rate is 10 -5 ,The learning rate adjustment strategy adopts the cosine annealing algorithm.

9. The method of generating a visual self-supervised learning model with low transfer gap according to claim 1, characterized in that: The loss coefficient for mask feature modeling in S4 is 0.3.

Citation Information

Patent Citations

  • Self-supervised facial expression recognition method combining comparative learning with mask image modeling

    CN116386104A

Cited By

  • Self-supervised target counting fine tuning method and system based on domain self-adaption

    CN119785103A