Decoupled optimization algorithm and system for visual large model

By adding category semantic features and hard mask compression to the large visual model, the problems of poor performance and high computational cost of SAM on specific tasks are solved, and efficient segmentation and fast inference on specific tasks are achieved.

CN117011525BActive Publication Date: 2026-02-06ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310880957.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-18
Publication Date
2026-02-06
Estimated Expiration
2043-07-18

AI Technical Summary

Technical Problem

Existing large-scale visual models (SAMs) perform poorly on specific tasks and have high computational and data training costs. They struggle to accurately identify and segment complex targets in complex scenes and are limited in performance on tasks with limited data.

Method used

By adding visual large model feature information based on specific category semantics, specific tasks are decoupled, and the model architecture is optimized and compressed using category semantic features and hard masking, thereby reducing computation and storage space.

Benefits of technology

Improve model performance for specific tasks, reduce computational and data training overhead, and achieve fast inference and high-precision segmentation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117011525B_ABST
    Figure CN117011525B_ABST
Patent Text Reader

Abstract

The application discloses a decoupling optimization algorithm and system for a visual large model, and the algorithm comprises the following steps: 1) extracting category semantic features; 2) optimizing the category semantic features; and 3) compressing model parameters according to the category semantic information.The application finds category semantic information related to a specific task, replaces prompt information of an interactive large model, completes decoupling of the specific task, and simultaneously completes reduction of a model architecture and optimization of overall network performance by increasing hard coding.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of model decoupling, and particularly relates to a decoupling optimization algorithm and system for a visual large model (Segment Anything). BACKGROUND

[0002] In recent years, the basic model has had a profound impact on the implementation of artificial intelligence (AI). This is due to the comprehensive pre-training of a wide range of downstream tasks and network scale datasets, resulting in their showing strong zero-shot generalization capabilities. In the field of computer vision (CV), the advent of Segment Anything (SAM) has triggered a research boom. SAM is a promptable model that uses a promptable segmentation task to train over a billion masks on tens of millions of images, thus achieving strong zero-shot generalization. Currently, the exploration based on SAM has been widely used in the fields of medical image analysis, image inpainting, video object tracking, 3D reconstruction, and adversarial attacks.

[0003] However, although SAM has achieved excellent performance in the field of segmentation, there are still some defects and challenges. For example, in some complex scenes and structurally complex tasks, the performance of the model may not be good, and it is difficult to accurately identify and segment some complex targets and details. In addition, SAM needs to be trained on a large amount of data, which requires higher requirements for model computing overhead and will bring huge time overhead. For tasks with less data, the performance of the model may be affected to a certain extent. Therefore, it is of great significance to improve the segmentation performance and reduce the architecture for specific tasks when researching SAM.

[0004] The technologies related to this patent involve deep feature attribution technology and model pruning optimization technology. However, there is still a blank stage for achieving performance improvement and architecture reduction for specific tasks on the visual large model SAM.

[0005] Image segmentation is a basic computer vision task that divides an original image into multiple parts by assigning each pixel to a class or object. Traditionally, segmentation includes three main tasks: semantic, instance, and panoptic. Semantic segmentation assigns each pixel to a predefined semantic class label. Instance segmentation further separates instances of the same class. Panoptic segmentation combines semantic segmentation and instance segmentation to more comprehensively understand the scene. Researchers have fully explored the above tasks in past research. Interactive segmentation, as a special way of segmentation, is a segmentation task that uses user interaction information to improve accuracy. The user provides initial input, and the algorithm continuously optimizes the segmentation according to the feedback, which is suitable for photo editing, medical images, data labeling, etc. Among them, SAM achieves better segmentation performance through interaction.

[0006] Existing deep feature attribution methods can be divided into three categories: perturbation-based methods, activation-based methods and backpropagation-based methods. The perturbation-based method directly measures the importance of the input feature by measuring the output difference when using the original feature and the perturbed feature as input. For the activation-based method, the importance of the feature to the model is visualized by constructing a class activation map to visualize the deep neural network. For the backpropagation-based method, the influence of the input on the output is calculated using the backpropagation algorithm to explain the decision-making process of the model, and the importance of the feature is inferred by calculating the gradient of the output with respect to the input.

[0007] Model pruning is a model optimization method for deep neural networks. By manually or automatically pruning some weights or neurons in the network, the computational load and storage space occupation of the model are reduced, and the running speed and accuracy of the model are improved. Common model pruning techniques include structured pruning (such as channel pruning, layer pruning, convolution kernel pruning, etc.), unstructured pruning, post-pruning fine-tuning, dynamic pruning, etc. Structured pruning prunes based on the structural relationship between neurons and weights, unstructured pruning directly prunes some neurons or weights, and dynamic pruning dynamically prunes unnecessary parts of the network during model execution, further reducing the computational load and storage space occupation of the model. Model pruning techniques are widely used in resource-constrained scenarios such as mobile terminals, embedded devices, and real-time response scenarios such as autonomous driving. SUMMARY

[0008] The present application overcomes the shortcomings of existing visual large model SAM in specific tasks and large data training, and provides a decoupling optimization algorithm and system for visual large model. The present application completes the decoupling of specific tasks by adding a visual large model feature information based on specific category semantics. At the same time, the category-independent path is removed based on the specific category semantics, so as to reduce the model architecture on the basis of optimizing the performance of specific tasks.

[0009] A decoupling optimization algorithm for visual large model, comprising the following steps:

[0010] 1) Image data construction;

[0011] Based on a specific image segmentation task, an image segmentation dataset is constructed, which includes image data and segmentation annotations corresponding to the image.

[0012] 2) Extracting category semantic features;

[0013] Based on the specific task we need to decouple, the pre-trained model is used to obtain the initialized category semantics for specific categories. The specific steps are as follows:

[0014] First, inference is performed on all training data using a pre-trained model, and then the prompt information after the first fusion of image features is used. Perform semantic information initialization, where The calculation method is as follows:

[0015] k,v=MLP1(x),MLP2(x), (1)

[0016] q=MLP(m), (2)

[0017]

[0018] Where x represents the image features after processing by the image encoder, and m represents the prompt information after feature encoding. Through fusion, information in the image features that is more similar to the prompt information is aggregated. middle, It contains semantic information from features specific to a particular category. Therefore, the initial semantic feature query for a specific category is defined as follows:

[0019]

[0020] Where J is the total number of samples in the training set, query is defined as a learnable parameter, and the obtained results are used to initialize the category semantic feature query.

[0021] 3) Optimization of category semantic features;

[0022] Replacing location-based hints with category-specific semantic information in the query achieves category decoupling and removes additional location interactions. The network is fixed, and the semantic information is fine-tuned to better fit the category features. During training, the query is optimized using cross-entropy loss and mean squared error loss.

[0023]

[0024] Where BCEloss is the binary cross-entropy loss, MSEloss is the mean squared error loss, predict is the model prediction result, GT is the ground truth label of the segmented image, iou_predict is the confidence score of the predicted image, and miou is the mean intersection-over-union ratio. It is used to adjust the ratio of cross-entropy loss and mean squared error loss functions so that the model finds the optimal category semantic information.

[0025] 4) Compress model parameters based on category information;

[0026] After obtaining the optimized semantics for a specific category, a hard mask is added to the Image Encoder to reduce the architecture. Before obtaining the hard mask, a soft mask S needs to be obtained first. (Input features...) The self-attention calculation stage is performed, and a soft mask S is added to participate in model calculation, and the calculation process is as follows:

[0027]

[0028]

[0029]

[0030] wherein the soft mask S is initialized as all 1 learnable parameters, is the result after self-attention operation. At the same time, in the full connection feature fusion stage, the calculation method is as formula (6) (7). In the fine-tuning of the soft mask S, the network parameters are fixed, and only the soft mask S is optimized. In order to ensure that the learned soft mask S is as sparse as possible, and at the same time ensure that the final segmentation result is as consistent as possible with the original result, in the fine-tuning stage, the following loss is introduced:

[0031] L BCE = BCEloss (predict, GT), (9)

[0032] L MSE = MSEloss (iou p redict, miou), (10)

[0033] L L1 = L1Loss (S), (11)

[0034] Loss = L BCE + aL MSE + bL L1 , (12)

[0035] Wherein under the constraint of L1Loss, the parameters in S are as many as possible 0, so as to achieve the effect of making the soft mask S as sparse as possible. Alpha, beta are used to weigh the proportion between different losses, so that the model can be optimized to a better result.

[0036] After obtaining the soft mask S, we select a threshold u to convert the soft mask into a hard mask, and through this way, the purpose of reducing the amount of calculation is achieved, and the calculation method is as follows:

[0037]

[0038] After obtaining the hard mask S hard , the compression operation of the model parameters is completed. When calculating the MLP in the network, the hard mask is multiplied by it, so as to achieve the purpose of reducing the amount of calculation.

[0039] The working principle of the application is: the application obtains an initial class semantic feature through a SAM pre-training model for specific task reasoning, thereby replacing interactive prompt information, and fine-tunes the semantic feature on a specific task to adapt to the current task. On the premise of completing specific class decoupling, a soft mask is added to the image encoder, the mask is sparsified through mean absolute error loss, the soft mask is converted into a binary mask according to a specific threshold, the model architecture is reduced, and good performance is maintained under specific loss constraints.

[0040] The application has the advantages that: compared with the prior art, the technical scheme of the application has the beneficial effects that: for a specific task, class semantic information is used to replace prompt information, the specific task is deconstructed, the effect of not needing additional information interaction during reasoning is achieved, and the reasoning process is simplified. On the premise of deconstructing the specific class, a hard mask is added to the image encoder to reduce the model architecture, thereby reducing the computational overhead and improving the model training and reasoning speed. BRIEF DESCRIPTION OF DRAWINGS

[0041] Figure 1 is a flowchart of the method of the application. DETAILED DESCRIPTION

[0042] The technical scheme of the application will be described below with reference to the accompanying drawings.

[0043] Example 1

[0044] The application provides a medical image segmentation method based on the decoupling optimization algorithm of a visual large model, and the technical scheme of the application will be further described below with reference to the accompanying drawings.

[0045] 1) Image acquisition and processing;

[0046] In the application scenario of medical image segmentation, taking liver cancer image segmentation as an example, the task of the visual large model is to segment the liver cancer lesion position in the image, thereby completing auxiliary diagnosis. For this task, liver cancer related medical images are collected and fine image labeling is performed. The labeled images are constructed into training and test data according to the proportion.

[0047] 2) Obtain a SAM pre-training model;

[0048] The medical images based on the specific task are divided into N picture blocks (patches) through a convolutional layer, and are converted into a feature vector The feature vector is input into an Image Encoder image encoder. At the same time, a certain number of interactive points are selected for the image foreground to obtain position prompt information, the interactive prompt information M is encoded into a feature vector through a Prompt Encoder feature encoder. Then the information is decoded by Mask Decoder. First, the encoded feature vector m is fused with the learnable feature of the final prediction result. In the information interaction stage, Self-interaction is performed between them:

[0049] q, k, v = MLP1(m), MLP2(m), MLP3(m), (1)

[0050]

[0051] where MLP represents a fully connected layer, is the result obtained after self-interaction, and the prompt information after self-interaction is interacted with the image feature x, and the image feature more relevant to the prompt information is aggregated into the prompt information:

[0052] k, v = MLP1(x), MLP2(x), (4)

[0053]

[0054]

[0055] where is the result obtained after the image information is aggregated into the prompt information. Then the information is fused by a fully connected layer:

[0056]

[0057] After that, the image feature is interacted in reverse, is fused into the image feature:

[0058]

[0059] q = MLP(x), (9)

[0060]

[0061] where, is the image information after fusing the prompt feature. The above steps (1)-(10) are repeated twice, and finally the mask and confidence prediction results for segmentation are obtained.

[0062] 3) Extracting class semantic features;

[0063] Based on the specific task we need to decouple, we use the pre-trained model obtained in step (1) to obtain the initialization class semantics for specific classes. The specific steps are as follows:

[0064] ​First, the pre-trained model is used to infer all data in the training set to obtain the prompt information after the first fusion image feature in step (1) The calculation is performed. Through fusion, the prompt information contains semantic information in the specific class feature. Therefore, the initialization semantic feature query of a specific class is defined as follows:

[0065]

[0066] where J is the total number of training set samples, and query is a learnable parameter. The obtained result is used to initialize the class semantic feature query.

[0067] 4) Optimization of class semantic features;

[0068] The class semantic information query obtained by step (2) replaces the prompt information M. At the same time, the network is fixed, and the class semantic information is fine-tuned to make the semantics more suitable for the class features. During training, the query is optimized by cross-entropy loss and mean square error loss:

[0069]

[0070] where BCEloss is the binary cross-entropy loss, MSEloss is the mean square error loss, predict is the model prediction result, GT is the true label of the image, iou_predict is the prediction image confidence, and miou is the average intersection over union, to adjust the proportion of cross-entropy loss and mean square error loss function, so that the model finds the optimal class semantic information.

[0071] 5) Compressing model parameters according to class information;

[0072] Through step (3), the optimized specific class semantic is obtained, and a hard mask is added to the architecture in the Image Encoder image encoder to reduce it. Before obtaining the hard mask, a soft mask S needs to be obtained first. In the input feature Self-attention calculation stage is added to the model calculation with soft mask S, and the calculation process is as follows:

[0073]

[0074]

[0075]

[0076] where the soft mask S is initialized as a full 1 learnable parameter, is the result after self-attention operation. At the same time, in the full connection feature fusion stage, the calculation method is as formula (13) and (14). In the fine-tuning of the soft mask S, the network parameters are fixed, and only the soft mask S is optimized. In order to ensure that the learned soft mask S is as sparse as possible, and at the same time ensure that the final segmentation result is as consistent as possible with the original result, in the fine-tuning stage, the following loss is introduced:

[0077] L BCE = BCEloss (predict, GT), (16)

[0078] L MSE = MSEloss (iou p redict, miou), (17)

[0079] L L1 = L1Loss (S), (18)

[0080] Loss = L BCE + aL MSE + bL L1 , (19)

[0081] Among them, under the constraint of L1Loss, the parameters in S are as much as possible to be 0, so as to achieve the effect of making the soft mask S as sparse as possible. a, b are used to balance the proportion between different losses, so that the model can be optimized to a better result.

[0082] After obtaining the soft mask S, we select the threshold u to convert the soft mask into the hard mask, and through this way, the purpose of reducing the calculation amount is achieved, and the calculation method is as follows:

[0083]

[0084] After obtaining the hard mask S hard , the compression operation of the model parameters is completed. When calculating the MLP in the network, the hard mask is multiplied by it to reduce the calculation amount.

[0085] 6) Model fine-tuning optimization;

[0086] After step (4), in order to obtain better model effect. Fixing the hard-coded S hard , the whole architecture of the model is fine-tuned to further improve the performance of the model. So as to achieve the architecture reduction on the specific task while optimizing and improving the performance.

[0087] 7) Input medical image to the model to realize the image segmentation task;

[0088] When the medical image of a specific task is input to the model, the automatic segmentation of the medical image is completed through model inference, the model is compressed while improving the segmentation accuracy of the medical image, and the fast inference of the medical image is realized.

[0089] The application designs a decoupling optimization algorithm and system based on a visual large model, uses category semantic information instead of prompt information for a specific task, achieves the purpose of decoupling the specific task, does not need additional information interaction during inference, and simplifies the inference process. At the same time, in order to reduce the model architecture and reduce the calculation overhead. Under the premise of deconstructing the specific category, a hard mask is added to the image encoder, the model performance is maintained, and the model overhead is reduced.

[0090] Embodiment 2

[0091] This embodiment relates to a decoupling optimization system for a visual large model, which is used to implement the method of embodiment 1, comprising:

[0092] An image data construction module constructs an image segmentation data set based on a specific image segmentation task, which includes image data and segmentation annotations corresponding to the image;

[0093] A category semantic feature extraction module uses a pre-trained model to obtain initialized category semantics for a specific category based on a specific task that needs to be decoupled. The specific steps are as follows:

[0094] First, use the pre-trained model to perform inference on all data in the training set, and use the prompt information after the first fusion of image features to initialize semantic information, wherein The calculation method is as follows:

[0095] k,v=MLP1(x),MLP2(x), (1)

[0096] q=MLP(m), (2)

[0097]

[0098] Where x is the image feature after processing by the image encoder, and m represents the prompt information after feature encoding. Through fusion, the information in the image feature that is more similar to the prompt information is converged into , which contains the semantic information in the specific category feature; therefore, the initialization semantic feature query of the specific category is defined as follows:

[0099]

[0100] Wherein J is the total number of training set samples, query is defined as a learnable parameter, and the obtained result is used to initialize the category semantic feature query;

[0101] The category semantic feature optimization module replaces the position prompt information with the category semantic information query to achieve the purpose of category decoupling and remove the additional position interaction. The network is fixed, and the semantic is made more suitable for the category feature by fine-tuning the category semantic information. During training, the query is optimized by cross-entropy loss and mean square error loss:

[0102]

[0103] Wherein, BCEloss is the binary cross-entropy loss, MSEloss is the mean square error loss, predict is the model prediction result, GT is the real label of the segmentation image, iou_predict is the confidence of the predicted image, and miou is the average intersection over union, The proportion of cross-entropy loss and mean square error loss function is adjusted to make the model find the optimal category semantic information.

[0104] The model parameter compression module increases the hard mask to the architecture for reduction in the Image Encoder image encoder after obtaining the optimized specific category semantic. Before obtaining the hard mask, a soft mask S needs to be obtained first. The input feature The soft mask S is added to the model calculation in the self-attention calculation stage, and the calculation process is as follows:

[0105]

[0106]

[0107]

[0108] Wherein, the soft mask S is initialized as a full 1 learnable parameter, is the result after self-attention operation; at the same time, in the full connection feature fusion stage, the calculation method is as formula (6) and formula (7); when fine-tuning the soft mask S, the network parameters are fixed, and only the soft mask S is optimized; in order to ensure that the learned soft mask S is as sparse as possible, and at the same time ensure that the final segmentation result is as consistent as possible with the original result, in the fine-tuning stage, the following loss is introduced:

[0109] L BCE =BCEloss(predict,GT), (9)

[0110] L MSE =MSEloss(iou p redict,miou), (10)

[0111] L L1 = L1Loss(S), (11)

[0112] Loss = L BCE + aL MSE + bL L1 , (12)

[0113] wherein under the constraint of L1Loss, as many parameters in S as possible are 0, so as to achieve the effect of making the soft mask S as sparse as possible; a and b are used to balance the proportion between different losses, so that the model can be optimized to a better result;

[0114] After obtaining the soft mask S, a threshold u is selected to convert the soft mask into a hard mask, and the purpose of reducing the amount of calculation is achieved through this way, and the calculation method is as follows:

[0115]

[0116] After obtaining the hard mask S hard , the compression operation of the model parameters is completed; when the MLP is calculated in the network, the hard mask is multiplied by the MLP.

[0117] The application finds the class semantic information related to a specific task to replace the prompt information of the interactive large model, completes the decoupling of the specific task, and simultaneously completes the reduction of the model architecture and the optimization of the overall network performance through the increase of the hard coding.

[0118] Embodiment 3

[0119] The embodiment provides a decoupling optimization device for a visual large model SAM, including a memory and one or more processors, the memory stores executable code, and the one or more processors execute the executable code to implement the method in embodiment 1.

[0120] Embodiment 4

[0121] The embodiment relates to a computer readable storage medium, which stores a program, and the program is executed by a processor to implement the method in embodiment 1.

[0122] The content described in the embodiments of the present specification is only a list of implementation forms of the inventive concept, and the protection scope of the present application should not be regarded as limited to the specific forms stated in the embodiments, and the protection scope of the present application also extends to equivalent technical means that can be thought of by those skilled in the art according to the inventive concept.

Claims

1. A decoupling optimization algorithm for a visual large model, comprising the following steps: 1) image data construction; constructing an image segmentation dataset based on a specific image segmentation task, which includes image data and segmentation labels corresponding to the images; 2) extracting class semantic features; based on a specific task that needs to be decoupled, using the obtained pre-trained model to obtain initialized class semantics for a specific class; the specific steps are as follows: First, the pre-training model is used to infer all data in the training set, and the prompt information after the first fusion of image features is used The semantic information is initialized, wherein The calculation method is as follows: k, v = MLP1(x), MLP2(x), (1) q = MLP(m), (2) where x is the image feature after image encoder processing, and m represents the prompt information after feature encoding; through fusion, the information in the image feature that is more similar to the prompt information is converged to , contains semantic information in a specific category feature; therefore, the initialization semantic feature query for a specific category is defined as follows: where J is the total number of training set samples, query is defined as a learnable parameter, and the obtained result is used to initialize the class semantic feature query; 3) class semantic feature optimization; replace the position prompt information with the class semantic information query to achieve the purpose of class decoupling and remove the additional position interaction; fix the network, and fine-tune the class semantic information to make the semantics more suitable for the class features; during training, optimize the query through cross-entropy loss and mean square error loss: Wherein, BCEloss is a binary cross-entropy loss, MSEloss is a mean square error loss, predict is a model prediction result, GT is a real label of a segmentation image, iou_predict is a confidence of a predicted image, and miou is a mean intersection over union. The proportion of the cross-entropy loss and the mean square error loss function is adjusted, so that the model finds the optimal class semantic information. 4) compressing model parameters according to class information; After obtaining the optimized specific class semantics, the architecture is reduced by adding a hard mask in the Image Encoder image encoder. Before obtaining the hard mask, a soft mask S needs to be obtained first. In the input feature The self-attention calculation stage is performed, and the soft mask S participates in the model calculation. The calculation process is as follows: wherein the soft mask S is initialized as all-1 learnable parameters, is the result after self-attention operation; meanwhile, in the full connection feature fusion stage, the calculation method is as formula (6) and formula (7); in the fine-tuning of the soft mask S, the network parameters are fixed, and only the soft mask S is optimized; in order to ensure that the learned soft mask S is as sparse as possible, and at the same time ensure that the final segmentation result is as consistent as possible with the original result, in the fine-tuning stage, the following loss is introduced: L BCE = BCEloss(predict, GT), (9) L MSE = MSEloss(iou p redict,miou), (10) L L1 = L1Loss(S), (11) Loss = L BCE + aL MSE + bL L1 , (12) wherein under the constraint of L1Loss, as many parameters as possible in S are 0, achieving the effect of making the soft mask S as sparse as possible; and a and β are used to balance the proportion between different losses, so that the model can be optimized to a better result; after obtaining the soft mask S, select a threshold u to convert the soft mask into a hard mask, thereby achieving the purpose of reducing the amount of calculation, and the calculation method is as follows: obtaining a hard mask S hard After the compression operation is completed on the model parameters; the hard mask is multiplied with the MLP when it is calculated in the network.

2. A decoupled optimization system for a visual large model (SAM), characterized in that: It comprises: an image data construction module, which constructs an image segmentation dataset based on a specific image segmentation task, which includes image data and segmentation labels corresponding to the images; a class semantic feature extraction module, which, based on a specific task that needs to be decoupled, uses the obtained pre-trained model to obtain initialized class semantics for a specific class; the specific steps are as follows: First, the pre-training model is used to infer all data in the training set, and the prompt information after the first fusion of image features is used The semantic information is initialized, wherein The calculation method is as follows: k, v = MLP1(x), MLP2(x), (1) q = MLP(m), (2) where x is the image feature after image encoder processing, and m represents the hint information after feature encoding; through fusion, the information in the image feature that is more similar to the hint information is converged to , contains semantic information in a specific category feature; therefore, the initialization semantic feature query for a specific category is defined as follows: where J is the total number of training set samples, query is defined as a learnable parameter, and the obtained result is used to initialize the class semantic feature query; a class semantic feature optimization module, which replaces the position prompt information with the class semantic information query to achieve the purpose of class decoupling and remove the additional position interaction; fix the network, and fine-tune the class semantic information to make the semantics more suitable for the class features; during training, optimize the query through cross-entropy loss and mean square error loss: Wherein, BCEloss is a binary cross-entropy loss, MSEloss is a mean square error loss, predict is a model prediction result, GT is a real label of a segmentation image, iou_predict is a confidence of a predicted image, and miou is a mean intersection over union. The proportion of the cross-entropy loss and the mean square error loss function is adjusted, so that the model finds the optimal class semantic information. The model parameter compression module, after obtaining the specific category semantics after optimization, increases the hard mask to the architecture in the Image Encoder image encoder for reduction; before obtaining the hard mask, a soft mask S needs to be obtained first; in the input feature The self-attention calculation stage is performed, and the soft mask S participates in the model calculation, and the calculation process is as follows: wherein the soft mask S is initialized as all-1 learnable parameters, is the result after the self-attention operation; meanwhile, in the full connection feature fusion stage, the calculation method is as formula (6) and formula (7); in the fine-tuning of the soft mask S, the network parameters are fixed, and only the soft mask S is optimized; in order to ensure that the learned soft mask S is as sparse as possible and the final segmentation result is as consistent as possible with the original result, in the fine-tuning stage, the following loss is introduced: L BCE = BCEloss(predict, GT), (9) L MSE = MSEloss(iou p redict,miou), (10) L L1 = L1Loss(S), (11) Loss = L BCE + aL MSE + bL L1 , (12) wherein under the constraint of L1Loss, as many parameters as possible in S are 0, achieving the effect of making the soft mask S as sparse as possible; and a and β are used to balance the proportion between different losses, so that the model can be optimized to a better result; after obtaining the soft mask S, select a threshold u to convert the soft mask into a hard mask, thereby achieving the purpose of reducing the amount of calculation, and the calculation method is as follows: obtaining a hard mask S hard After the compression operation is completed on the model parameters; the hard mask is multiplied with the MLP when it is calculated in the network.

3. A decoupled optimization apparatus for a visual large model SAM, characterized in that, It comprises a memory and one or more processors, the memory stores executable code, and the one or more processors execute the executable code to implement the decoupling optimization algorithm for the visual large model SAM of claim 1.

4. A computer-readable storage medium, characterized in that, A computer program product, which stores a program, and the program is executed by a processor to realize the decoupled optimization method for a visual large model SAM in claim 1.

5. A computing device comprising a memory and a processor, wherein, The memory stores executable code, and the processor executes the executable code to realize the decoupled optimization algorithm for a visual large model SAM in claim 1.

6. A computer program product, characterised in that, A computer program, which is executed by a processor to realize the decoupled optimization algorithm for a visual large model SAM in claim 1.

Citation Information

Patent Citations

  • A real-time scene image semantic segmentation method based on lightweight network

    CN109145983A

  • System and method for segment-aware semantic segmentation

    IL297653A