Real-time interactive image segmentation method

By combining parallel preprocessing and dynamic ReLU activation functions with user click information, and using large-scale visual models and dynamic window multi-head self-attention modules, the problems of unstable segmentation results and low computational efficiency in interactive image segmentation are solved, achieving low-power performance Real-time high-quality segmentation on consumer devices improves inference speed and segmentation results.

CN118229700BActive Publication Date: 2024-10-22XIAMEN UNIV
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410645393.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2024-10-22
Estimated Expiration
2044-05-23

AI Technical Summary

Technical Problem

Existing click-based interactive image segmentation methods have problems in real-time high-quality segmentation, such as image preprocessing disabling dynamic refocusing model strategies and lightweight decoders that are difficult to fully integrate interactive information and preprocessing embedding, resulting in unstable and unstable segmentation results. Computational inefficiency.

Method used

Parallel preprocessing is used to extract image features using a large visual model, and combined with the click information input by the user, through a lightweight interactive segmentation module and a dynamic ReLU activation function, a dynamic window multi-head self-attention module and a FocusRefiner module are introduced to optimize image embedding and Interactive information fusion improves segmentation quality and computational efficiency.

Benefits of technology

Significantly improves the computational efficiency and segmentation quality of interactive image segmentation, achieves real-time high-quality segmentation on low-power devices, maintains the competitiveness of model segmentation performance, and improves reasoning through dynamic ReLU and multi-head self-attention modules Speed ​​and segmentation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118229700B_ABST
    Figure CN118229700B_ABST
Patent Text Reader

Abstract

The present invention discloses a real-time interactive image segmentation method, which relates to the field of computer vision technology, introduces an innovative process for processing interactive segmentation problems, and can improve the computational efficiency of interactive segmentation tasks, including: step 1, using a large visual model to perform parallel preprocessing on images to obtain image features; step 2, through a lightweight interactive segmentation module, real-time processing of image features and interactive information input by users, can accurately segment target areas from images, and continuously improve segmentation accuracy based on user feedback. The present invention combines image features preprocessed from a large visual model with interactive information input by users, and uses a single lightweight interactive segmentation module to perform interactive segmentation. This design not only maintains the competitiveness of model segmentation performance, but also optimizes the model reasoning process, significantly improves computational efficiency, and provides an effective solution for real-time interactive image segmentation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of computer vision, and in particular to a real-time interactive image segmentation method. Background Art

[0002] Driven by massive amounts of data, deep networks have achieved remarkable results in various computer vision tasks. The availability of accurately annotated data is crucial to the success of deep networks, but the manual annotation process takes up a lot of time and computing resources. Therefore, the gradually developed interactive image segmentation has become an indispensable tool for annotating large-scale image datasets. This technology aims to achieve high-quality pixel-level annotation through limited interaction, and the interaction methods include graffiti, bounding boxes, polygons, clicks, or some combination of the above methods. Among the many interactive image segmentation methods, click-based methods have attracted much attention due to their simplicity and efficiency. Therefore, the present invention focuses on click-based methods and attempts to solve their computational and efficiency problems in practical applications.

[0003] Recent research on interactive segmentation with clicks has focused on real-time, high-quality interactive segmentation representations, such as SAM (Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao,646Chloe Rolland, Laura Gustafson, Tete Xiao, Spencer White-647head, Alexander C.Berg, Wan-Yen Lo, Piotr Doll ́ar, and648Ross Girshick. Segment anything.arXiv:2304.02643, 2023.), InterFormer (You Huang, Hao Yang, Ke Sun, ShengchuanZhang, Liu- 624juan Cao, Guannan Jiang, and Rongrong Ji. Interformer:625Real-time interactive image segmentation. In Proceedings 626of the IEEE / CVF International Conference on Computer Vi- 627sion, pages 22301–22311,2023), etc. However, there are two limitations to real-time interactive processes:

[0004] (1) First, the image preprocessing of this pipeline disables the efficient implementation of the image-level magnification strategy that dynamically refocuses the model to the target object during the interaction;

[0005] (2) Secondly, due to the need for real-time response, SAM’s lightweight decoder finds it difficult to fully integrate the interactive information with the pre-processed image embedding, thereby weakening the positive impact of interactive feedback on segmentation quality.

[0006] Therefore, SAM often encounters the problem of unstable segmentation results when facing challenging scenes such as camouflaged objects that almost blend into the background. For example, adding a new click after a sufficient number of click prompts can still occasionally trigger a significant decrease in segmentation quality, such as IoU dropping from 88.59 to 12.78. This instability significantly limits the applicability of SAM in a wider range of image segmentation annotations. These two problems together lead to low computational efficiency. To improve the computational efficiency of interactive segmentation, these potential problems need to be addressed. Summary of the invention

[0007] The purpose of the present invention is to provide a real-time interactive image segmentation method to solve the problems existing in the prior art, improve the computational efficiency and segmentation quality of interactive segmentation, enable real-time high-quality interactive segmentation on low-power devices, solve the efficiency problem of the existing interactive image segmentation process, and provide a feasible path for the application of large models in the field of interactive segmentation.

[0008] In order to achieve the above object, the solution of the present invention is:

[0009] A real-time interactive image segmentation method comprises the following steps:

[0010] Step 1: Perform parallel preprocessing on the image and use the pre-trained large-scale visual model to encode the image features to obtain image features ;in is the real number space, and are the height and width of the image respectively;

[0011] Step 2: Use a lightweight interactive segmentation module to process image features in real time and interactive information input by the user, the interactive information input by the user includes click information and coding information;

[0012] Step 2-1: Use the encoder to convert the user input Click information is converted into click code , mask information is converted to mask encoding , get the click code and mask encoding The interaction code is updated every time the user interacts by clicking;

[0013] Step 2-2: Interaction encoding and learnable query encoding It is sent to the decoder of SAM and combined with the image features Combined, through the formula Transform interaction coding into query coding that integrates interaction information Upsampled image features with fused mutual information ;

[0014] Step 2-3, by formula , use dot multiplication to fuse the upsampled image features of the interactive information Query encoding with fusion of interactive information Further fusion to obtain the predicted mask ;in for The transpose of

[0015] Step 2-4: After the user predefines In each interaction, the large visual model is expressed as , based on image features , No. Query coding that integrates mutual information With The prediction mask As input, we get the optimized image features focused on the target object. , optimize image features Replace image features in subsequent segmentation processes for the same object ;

[0016] Step 2-5: Use the formula , two image windowing methods with different window structures are used alternately to input a batch of the MSA module Perform preprocessing and predefine the window size , get the transformed image features ,in ,in is the number of images, and from the transformed image features Select the window containing the object to obtain the image features to be processed , perform MSA calculation and ;in is the query code of the fused interactive information after MSA calculation. is the attention operator in Transformer, is the self-attention map containing the object;

[0017] Step 2-6: Introduce dynamic ReLU as the activation function to obtain the dynamic activation result fused with the interaction information , MSA module output and As the input of the next FocusRefiner module, that is ;

[0018] Step 2-7: Get the final image encoding through the FocusRefiner module and SAM decoder And the final Query encoding , and obtain the final prediction mask through point multiplication ; The Normalized Focal Loss and Point Loss calculated by the final predicted mask and label are used as the loss function of the neural network, that is, ,in is the loss function, Represents traversal Each element of

[0019] Step 2-8: In the training and standard test process, according to the final predicted mask and mask label, find the connected area with the largest error, select the central pixel of the connected area as the location of the next simulated click, and iterate the next model prediction; in the real test environment, iterative prediction is performed according to the user's interactive click feedback to gradually improve the segmentation quality.

[0020] In step 1, the large visual model is Vision Transformer.

[0021] In step 2-2, the decoder is fused through a cross attention mechanism and ,Right now .

[0022] After adopting the above technical solution, the present invention has the following technical effects:

[0023] ① The present invention combines image features preprocessed from a large visual model with interactive information (such as clicks) input by the user and uses a single lightweight interactive segmentation module to perform interactive segmentation. This design not only maintains the competitiveness of the model segmentation performance, but also optimizes the model reasoning process and significantly improves the computational efficiency, providing an effective solution for real-time interactive image segmentation.

[0024] ② The present invention proposes a dynamic window multi-head self-attention module, which divides the image embedding into windows and selectively performs attention calculation on a subset of the window embeddings according to the previously predicted mask; the present invention also applies a shift strategy to allow long-distance information exchange between embeddings without sacrificing efficiency. At the same time, a pixel-level dynamic ReLU is proposed for the purpose of enhancing image embeddings. The click-fusion query embedding of the SAM decoder is used to selectively enhance the image embeddings related to the object, and the embeddings not related to the object are suppressed in a pixel-level manner, thereby demonstrating faster inference speed and better segmentation results than recently proposed methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 A schematic diagram of the network structure of a neural network according to a specific embodiment of the present invention;

[0026] Figure 2 This is an experimental data table of a specific embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to further explain the technical solution of the present invention, the present invention is described in detail below through specific embodiments.

[0028] The present invention proposes a real-time interactive image segmentation method, aiming to improve the computational efficiency of interactive segmentation. Before the interactive process, the present invention uses a large visual model, such as the Vision Transformer (ViT) model (Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021) running on a high-performance device such as a computing cluster, to extract high-quality and reusable image features from the image to be annotated. The step of extracting image features is done offline, so real-time performance is not required. Next, the present invention uses a lightweight interactive segmentation module to perform interactive segmentation on low-power devices such as personal computers or mobile devices, which takes image features extracted by a large visual model and the annotator's clicks as input.

[0029] In addition, the present invention proposes a dynamic window multi-head self-attention module, which divides the image embedding into windows and selectively performs attention calculations on a subset of the window embeddings according to the previously predicted mask; the present invention also applies a shift strategy to allow long-distance information exchange between embeddings without sacrificing efficiency, and proposes pixel-level dynamic ReLU for the purpose of enhancing image embeddings, uses the click-fusion query embedding of the SAM decoder to selectively enhance the image embedding related to the object, and suppresses the embedding unrelated to the object in a pixel-level manner, thereby demonstrating faster reasoning speed and better segmentation results than the recently proposed methods. Overall, the present invention optimizes the model reasoning process and improves computational efficiency while maintaining the competitive performance of the model segmentation.

[0030] refer to Figure 1 As shown, the present invention discloses a real-time interactive image segmentation method, comprising the following steps:

[0031] Step 1: Perform parallel preprocessing on the image and use the pre-trained large-scale vision model Vision Transformer to encode the image features to obtain image features ;in is the real number space, and are the height and width of the image respectively;

[0032] Step 2: Use a lightweight interactive segmentation module to process image features in real time and the interactive information input by the user, the interactive information input by the user includes click information and coding information; in the predefined In the first interaction, the FocusRefiner module is introduced to combine image features with The segmentation results of the two interactions are fused and converted into an optimized feature map focusing on the target object; specifically, the following steps are included:

[0033] Step 2-1: Use the encoder to convert the user input Click information is converted into click code , mask information is converted to mask encoding , get the click code and mask encoding The interaction code is updated every time the user interacts by clicking;

[0034] Step 2-2: Interaction encoding and learnable query encoding It is sent to the decoder of SAM and combined with the image features Combined, through the formula Transform interaction coding into query coding that integrates interaction information Upsampled image features with fused mutual information ; Among them, the decoder is fused through the cross attention mechanism and ,Right now ;

[0035] Step 2-3, by formula , use dot multiplication to fuse the upsampled image features of the interactive information Query encoding with fusion of interactive information Further fusion to obtain the predicted mask ;in for The transpose of

[0036] Step 2-4: adopt the strategy of focusing on the target object and introduce the FocusRefiner module to improve the efficiency of the attention module. The FocusRefiner module is only called once in the segmentation process of each object, prompting the image features to focus on the target object in order to obtain sufficient context information;

[0037] Specifically, after the user predefines In each interaction, the large visual model is expressed as , based on image features , No. Query coding that integrates mutual information With The prediction mask As input, we get the optimized image features focused on the target object. , realizing the interaction between user input information and image features Further fusion of image features Replace image features in subsequent segmentation processes for the same object ;

[0038] Step 2-5: In order to further reduce the computational complexity of the attention module, a special window strategy is adopted in the FocusRefiner module - by formula , two image windowing methods with different window structures are used alternately to input a batch of the MSA module Perform preprocessing and predefine the window size (The window size is a structural parameter of the model and can be predefined) to obtain the transformed image features ,in , is the number of images, and from the transformed image features Select the window containing the object to obtain the image features to be processed , perform MSA calculation and ;in is the query code of the fused interactive information after MSA calculation. is the attention operator in Transformer, is the self-attention map containing the object;

[0039] Step 2-6: In order to further improve the positioning ability of the FocusRefiner module, the pixel-level dynamic ReLU is introduced as the activation function to obtain the dynamic activation result fused with the interaction information. , making the activation process dependent on the input parameters, and making full use of the similarity of object-related encoding; the final MSA module output and As the input of the next FocusRefiner module, that is ;

[0040] Step 2-7: Get the final image encoding through the FocusRefiner module and SAM decoder And the final Query encoding , and obtain the final prediction mask through point multiplication ; The Normalized Focal Loss and Point Loss calculated by the final predicted mask and label are used as the loss function of the neural network, that is, ,in is the loss function, Represents traversal Each element of

[0041] Step 2-8: In the training and standard test process, according to the final predicted mask and mask label, find the connected area with the largest error, select the central pixel of the connected area as the location of the next simulated click, and iterate the next model prediction; in the real test environment, iterative prediction is performed according to the user's interactive click feedback to gradually improve the segmentation quality.

[0042] Through the above scheme, the present invention has the following outstanding advantages:

[0043] The present invention combines image features preprocessed from a large visual model with interactive information input by the user (such as clicks) and uses a single lightweight interactive segmentation module to perform interactive segmentation. This design not only maintains the competitiveness of the model segmentation performance, but also optimizes the model inference process and significantly improves computational efficiency, providing an effective solution for real-time interactive image segmentation.

[0044] The following further illustrates the technical effects of the present invention through simulation experiments and experimental data.

[0045] 1) Simulation conditions

[0046] The present invention is developed on the Ubuntu platform, and the developed deep learning framework is based on Pytorch, and the main language used is Python.

[0047] 2) Simulation content

[0048] Take COCO2017 and LVIS datasets, train the network according to the above steps and use GrabCut, Berkley, SBD, DAVIS, MVTec and COD10K as test sets for testing. Figure 2 , which are the segmentation results of the present invention and other methods in six test data sets. After intuitive numerical comparison, it can be found that compared with other methods, the present invention has the best effect. Among them, the evaluation index NoC (Number of Clicks) represents the number of clicks required to reach a certain IoU threshold, and SPC (Seconds Per Click) represents the time spent on one click reasoning, which measures the efficiency of the model in pixel segmentation on potential large or small objects; through the comparison of NoC indicators, it can be seen that the present method achieves the effect of matching other most advanced methods in segmentation quality, and at the same time has a lower SPC than other methods, that is, it has a smaller computational burden and higher reasoning efficiency.

[0049] The above embodiments and drawings do not limit the product form and style of the present invention. Any appropriate changes or modifications made by ordinary technicians in the relevant technical field should be deemed to be within the patent scope of the present invention.

Claims

1. A real-time interactive image segmentation method, characterized in that The following steps are involved: Step 1: Perform parallel preprocessing on the image and use the pre-trained large-scale visual model to encode the image features to obtain image features ;in is the real number space, and are the height and width of the image respectively; Step 2: Use a lightweight interactive segmentation module to process image features in real time and interactive information input by the user, the interactive information input by the user includes click information and coding information; Step 2-1: Use the encoder to convert the user input Click information is converted into click code , mask information is converted to mask encoding , get the click code and mask encoding The interaction code is updated every time the user interacts by clicking; Step 2-2: Interaction encoding and learnable query encoding It is sent to the decoder of SAM and combined with the image features Combined, through the formula Transform interaction coding into query coding that integrates interaction information Upsampled image features with fused mutual information ; Step 2-3, by formula , use dot multiplication to fuse the upsampled image features of the interactive information Query encoding with fusion of interactive information Further fusion to obtain the predicted mask ;in for The transpose of Step 2-4: After the user predefines In each interaction, the large visual model is expressed as , based on image features , No. Query coding that integrates mutual information With The prediction mask As input, we get the optimized image features focused on the target object. , optimize image features Replace image features in subsequent segmentation processes for the same object ; Step 2-5: Use the formula , two image windowing methods with different window structures are used alternately to input a batch of the MSA module Perform preprocessing and predefine the window size , get the transformed image features ,in ,in is the number of images, and from the transformed image features Select the window containing the object to obtain the image features to be processed , perform MSA calculation and ;in is the query code of the fused interactive information after MSA calculation. is the attention operator in Transformer, is the self-attention map containing the object; Step 2-6: Introduce dynamic ReLU as the activation function to obtain the dynamic activation result fused with the interaction information , MSA module output and As the input of the next FocusRefiner module, that is ; Step 2-7: Get the final image encoding through the FocusRefiner module and SAM decoder And the final Query encoding , and obtain the final prediction mask through point multiplication ; The Normalized Focal Loss and Point Loss calculated by the final predicted mask and label are used as the loss function of the neural network, that is, ,in is the loss function, Represents traversal Each element of Step 2-8: In the training and standard test process, according to the final prediction mask and mask label, find the connected area with the largest error, select the central pixel of the connected area as the position of the next simulated click, and iterate the next model prediction; In a real test environment, iterative predictions are performed based on the user's interactive click feedback to gradually improve the segmentation quality.

2. The real-time interactive image segmentation method according to claim 1, characterized in that: In step 1, the large visual model is Vision Transformer.

3. The real-time interactive image segmentation method according to claim 1, characterized in that: In step 2-2, the decoder is fused through a cross attention mechanism and ,Right now .

Citation Information

Patent Citations

  • Catalytic dehydrohalogenation process

    EP0002021A1

  • Infrared image power equipment interactive segmentation method and system

    CN116862847A

  • Real-time interactive image segmentation method

    CN117173409A

  • Remote sensing image interactive segmentation method based on visual basis large model fine tuning

    CN117197461A

  • Transform-based interactive image segmentation method

    CN117372701A