A method for image segmentation, related device, equipment and storage medium

By introducing adaptively generated spatial scaling factors into the visual Transformer, the problem of difficulty in determining the number of branches and linear transformation types is solved, and the configuration efficiency and feature representation capabilities of the image segmentation model are improved.

CN114549556BActive Publication Date: 2024-10-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210181434.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-25
Publication Date
2024-10-15
Estimated Expiration
2042-02-25

AI Technical Summary

Technical Problem

When existing visual Transformers enhance feature representation capabilities, it is difficult to determine the number of branches and linear transformation types in advance, resulting in cumbersome model configuration and reduced efficiency.

Method used

By introducing spatial scaling factors, adaptive generation based on input image features is used to correct image features and simplify the model configuration process.

Benefits of technology

It improves model configuration efficiency, enhances feature representation capabilities, and reduces configuration difficulty.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114549556B_ABST
    Figure CN114549556B_ABST
Patent Text Reader

Abstract

The present application discloses an image segmentation method involving artificial intelligence technology, including: obtaining original image features of an original image; obtaining a first image feature through an encoder in an image segmentation model, the local vision module includes a spatial enhancement module, the spatial enhancement module generates a spatial scaling factor based on the input image feature, and the spatial scaling factor can correct the spatial features of the input image feature; obtaining a second image feature through a decoder in the image segmentation model; splicing the second image feature and the third image feature output by the first local vision module in the encoder to obtain a target image feature; generating a target segmented image according to the target image feature. The present application also provides an apparatus, a device and a medium. The present application uses a spatial scaling factor to adjust the spatial features of an image feature, and the spatial scaling factor is adaptively generated based on the input image feature, thereby reducing the difficulty of model configuration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision technology, and in particular to an image segmentation method, related apparatus, device and storage medium. Background Art

[0002] With the continuous development of computer technology and artificial intelligence (AI), AI technology has achieved remarkable results in tasks such as image segmentation and image recognition. With the emergence of more and more efficient network structures, computer vision and natural language processing tend to converge. Using transformers to complete visual tasks has become a new research direction to reduce the complexity of the structure and explore scalability and training efficiency.

[0003] At present, a visual transformer that can solve computer vision problems is proposed. In order to enhance the feature representation ability of the visual transformer, in the existing scheme, additional branches can be added to the visual transformer. By introducing linear transformations on the branches to enhance feature diversity, the purpose of enhancing feature representation ability is achieved.

[0004] However, the inventors found that the existing solutions have at least the following problems: it is difficult to decide in advance how many branches to add to the visual transformer and which linear transformation to use, and it often takes multiple attempts to find the optimal configuration. As a result, the model configuration process is more complicated and reduces the efficiency of model configuration. Summary of the invention

[0005] The embodiments of the present application provide a method, a related device, an apparatus and a storage medium for image segmentation. The present application uses a spatial scaling factor to adjust the spatial features of image features to achieve the purpose of enhancing feature characterization capabilities. The spatial scaling factor is adaptively generated based on input image features, thereby reducing the difficulty of model configuration and improving model configuration efficiency.

[0006] In view of this, the present application provides, on one hand, a method for image segmentation, comprising:

[0007] Obtaining original image features corresponding to the original image;

[0008] Based on the original image feature, a first image feature is obtained through an encoder in the image segmentation model, wherein the encoder includes a plurality of local vision modules and a plurality of downsampling layers, the local vision module includes a spatial enhancement module, the spatial enhancement module is used to generate a spatial scaling factor based on the input image feature, and the spatial scaling factor is used to correct the spatial feature corresponding to the input image feature;

[0009] Based on the first image feature, obtaining a second image feature through a decoder in the image segmentation model, wherein the decoder includes a plurality of local vision modules and a plurality of upsampling layers;

[0010] The second image feature and the third image feature output by the first local visual module in the encoder are concatenated to obtain a target image feature, wherein the second image feature is an image feature output by the last local visual module in the decoder;

[0011] Generate a target segmentation image based on the target image features.

[0012] Another aspect of the present application provides a method for image segmentation, comprising:

[0013] Obtaining original image features corresponding to the original image;

[0014] Based on the original image feature, a first image feature is obtained through an encoder in the image segmentation model, wherein the encoder includes a plurality of local vision modules and a plurality of downsampling layers, the local vision module includes a channel enhancement module, the channel enhancement module is used to generate a channel scaling factor based on the input image feature, and the channel scaling factor is used to correct the channel feature corresponding to the input image feature;

[0015] Based on the first image feature, obtaining a second image feature through a decoder in the image segmentation model, wherein the decoder includes a plurality of local vision modules and a plurality of upsampling layers;

[0016] The second image feature and the third image feature output by the first local visual module in the encoder are concatenated to obtain a target image feature, wherein the second image feature is an image feature output by the last local visual module in the decoder;

[0017] Generate a target segmentation image based on the target image features.

[0018] Another aspect of the present application provides an image segmentation device, comprising:

[0019] An acquisition module, used for acquiring original image features corresponding to the original image;

[0020] The acquisition module is further used to acquire the first image feature through an encoder in the image segmentation model based on the original image feature, wherein the encoder includes a plurality of local vision modules and a plurality of downsampling layers, the local vision module includes a spatial enhancement module, the spatial enhancement module is used to generate a spatial scaling factor based on the input image feature, and the spatial scaling factor is used to correct the spatial feature corresponding to the input image feature;

[0021] The acquisition module is further used to acquire the second image feature through a decoder in the image segmentation model based on the first image feature, wherein the decoder includes a plurality of local vision modules and a plurality of upsampling layers;

[0022] A processing module, used for concatenating the second image feature and the third image feature output by the first local vision module in the encoder to obtain a target image feature, wherein the second image feature is the image feature output by the last local vision module in the decoder;

[0023] The segmentation module is used to generate a target segmentation image according to the target image features.

[0024] In one possible design, in another implementation of another aspect of the embodiment of the present application, the local vision module further includes a first normalization layer and an attention module;

[0025] The first normalization layer is used to normalize the first input feature to obtain a first normalized feature;

[0026] The attention module is used to extract features from the first normalized features to obtain spatial features of the first normalized features;

[0027] The spatial enhancement module is used to perform a maximum pooling operation and an average pooling operation on the first normalized feature to obtain a target merging result, wherein the target merging result includes a maximum pooling result and an average pooling result;

[0028] The spatial enhancement module is also used to perform a convolution operation on the target merging result to obtain a convolution result;

[0029] The spatial enhancement module is also used to calculate the convolution result using an activation function to obtain the target spatial scaling factor.

[0030] In one possible design, in another implementation of another aspect of the embodiment of the present application, the local vision module further includes a first normalization layer and an attention module;

[0031] The attention module is used to extract features from the first input feature to obtain a spatial feature of the first input feature;

[0032] The spatial enhancement module is used to perform a maximum pooling operation and an average pooling operation on the spatial feature of the first input feature to obtain a target merging result, wherein the target merging result includes a maximum pooling result and an average pooling result;

[0033] The spatial enhancement module is also used to perform a convolution operation on the target merging result to obtain a convolution result;

[0034] The spatial enhancement module is also used to calculate the convolution result using an activation function to obtain the target spatial scaling factor;

[0035] The first normalization layer is used to normalize the modified spatial features, wherein the modified spatial features are obtained by modifying the spatial features of the first input features by using the target spatial scaling factor.

[0036] In one possible design, in another implementation of another aspect of the embodiments of the present application, the local vision module also includes a channel enhancement module, which generates a channel scaling factor based on the input image features, and the channel scaling factor is used to correct the channel features corresponding to the input image features.

[0037] In one possible design, in another implementation of another aspect of the embodiment of the present application, the local vision module further includes a second normalization layer and a multi-layer perceptron;

[0038] The second normalization layer is used to normalize the second input feature to obtain a second normalized feature;

[0039] The multi-layer perceptron is used to extract the second normalized feature to obtain the channel feature of the second normalized feature;

[0040] The channel enhancement module is used to perform a maximum pooling operation on the channel feature of the second normalized feature to obtain a maximum pooling result, and to perform an average pooling operation on the channel feature of the second normalized feature to obtain an average pooling result;

[0041] The channel enhancement module is also used to perform a convolution operation on the maximum pooling result to obtain a first convolution result, and to perform a convolution operation on the average pooling result to obtain a second convolution result;

[0042] The channel enhancement module is also used to determine a target convolution result according to the first convolution result and the second convolution result;

[0043] The channel enhancement module is also used to calculate the target convolution result using an activation function to obtain a target channel scaling factor.

[0044] In one possible design, in another implementation of another aspect of the embodiment of the present application, the local vision module further includes a second normalization layer and a multi-layer perceptron;

[0045] The multilayer perceptron is used to extract the second input feature to obtain the channel feature of the second input feature;

[0046] The channel enhancement module is used to perform a maximum pooling operation on the channel feature of the second input feature to obtain a maximum pooling result, and to perform an average pooling operation on the channel feature of the second input feature to obtain an average pooling result;

[0047] The channel enhancement module is also used to perform a convolution operation on the maximum pooling result to obtain a first convolution result, and to perform a convolution operation on the average pooling result to obtain a second convolution result;

[0048] The channel enhancement module is also used to determine a target convolution result according to the first convolution result and the second convolution result;

[0049] The channel enhancement module is also used to calculate the target convolution result using an activation function to obtain the target channel scaling factor;

[0050] The second normalization layer is used to normalize the corrected channel features, wherein the corrected channel features are obtained by correcting the channel features of the second input features by using the target channel scaling factor.

[0051] In one possible design, in another implementation of another aspect of the embodiment of the present application, the encoder includes M local visual modules and N downsampling layers, the decoder includes (M-1) local visual modules and N upsampling layers, and the (M-1) local visual modules included in the decoder are jump-connected with the corresponding (M-1) local visual modules in the encoder, where M is an integer greater than 1, and N is an integer greater than or equal to 1;

[0052] The image features output by the first local vision module in the encoder are used as the image features input to the first downsampling layer in the encoder;

[0053] The image features output by the last downsampling layer in the encoder are used as the image features input to the last local vision module in the encoder;

[0054] The image features output by the last local vision module in the encoder are used as the image features input to the first upsampling layer in the decoder;

[0055] The image features output by the first upsampling layer in the decoder are used as the image features input by the first local vision module in the decoder;

[0056] The image features output by the last upsampling layer in the decoder are used as the image features input to the last local vision module in the encoder.

[0057] In a possible design, in another implementation of another aspect of the embodiment of the present application,

[0058] An acquisition module, specifically used to acquire the original image;

[0059] Perform a block operation on the original image to obtain K image blocks, where K is an integer greater than 1;

[0060] Perform convolution operation on each of the K image blocks to obtain K feature vectors;

[0061] Generate original image features based on K feature vectors.

[0062] In a possible design, in another implementation of another aspect of the embodiment of the present application,

[0063] An acquisition module, specifically configured to acquire first intermediate image features based on the original image features through a local vision module included in an encoder, wherein the encoder belongs to an image segmentation model;

[0064] Based on the first intermediate image feature, obtaining a second intermediate image feature through a downsampling layer included in the encoder;

[0065] Based on the second intermediate image feature, the first image feature is obtained through the residual module included in the encoder, wherein the residual module included in the encoder includes at least one local visual module, or the residual module included in the encoder includes at least one local visual module and at least one downsampling layer.

[0066] In a possible design, in another implementation of another aspect of the embodiment of the present application,

[0067] An acquisition module, specifically configured to acquire a third intermediate image feature based on the first image feature through an upsampling layer included in a decoder, wherein the decoder belongs to an image segmentation model;

[0068] Based on the third intermediate image feature, obtaining a fourth intermediate image feature through a local vision module included in the decoder;

[0069] Based on the fourth intermediate image feature, the second image feature is obtained through the residual module included in the decoder, wherein the residual module included in the decoder includes at least one local visual module, or the residual module included in the decoder includes at least one local visual module and at least one upsampling layer.

[0070] In a possible design, in another implementation of another aspect of the embodiment of the present application,

[0071] The segmentation module is specifically used to perform a convolution operation on the original image to obtain a first image feature to be processed;

[0072] Performing a convolution operation on the target image feature to obtain a second image feature to be processed;

[0073] Adding the first image feature to be processed and the second image feature to be processed to obtain a third image feature to be processed;

[0074] A convolution operation is performed on the third image feature to be processed to obtain a target segmented image.

[0075] In one possible design, in another implementation of another aspect of the embodiments of the present application, the image segmentation apparatus further includes a training module;

[0076] The acquisition module is further used to acquire sample image features corresponding to the sample image, wherein the sample image is an image with region annotation;

[0077] The acquisition module is further used to acquire the first sample image feature through the encoder in the image segmentation model based on the sample image feature;

[0078] The acquisition module is further used to acquire the second sample image feature through the decoder in the image segmentation model based on the first sample image feature;

[0079] The processing module is further used to concatenate the second sample image feature and the third sample image feature output by the first local vision module in the encoder to obtain the target sample image feature;

[0080] The segmentation module is further used to generate a target segmentation sample image according to features of the sample image and the target sample image;

[0081] The training module is used to update the model parameters of the image segmentation model according to the target segmentation sample image and the annotated area of ​​the sample image.

[0082] In a possible design, in another implementation of another aspect of the embodiment of the present application,

[0083] An acquisition module, specifically used to acquire original medical image features corresponding to the original medical image, wherein the original medical image is a two-dimensional image or a three-dimensional image;

[0084] The segmentation module is specifically used to generate and display a target segmented medical image according to the target image features.

[0085] Another aspect of the present application provides an image segmentation device, comprising:

[0086] An acquisition module, used for acquiring original image features corresponding to the original image;

[0087] The acquisition module is further used to acquire the first image feature through an encoder in the image segmentation model based on the original image feature, wherein the encoder includes a plurality of local vision modules and a plurality of downsampling layers, the local vision module includes a channel enhancement module, the channel enhancement module is used to generate a channel scaling factor based on the input image feature, and the channel scaling factor is used to correct the channel feature corresponding to the input image feature;

[0088] The acquisition module is further used to acquire the second image feature through a decoder in the image segmentation model based on the first image feature, wherein the decoder includes a plurality of local vision modules and a plurality of upsampling layers;

[0089] A processing module, used for concatenating the second image feature and the third image feature output by the first local vision module in the encoder to obtain a target image feature, wherein the second image feature is the image feature output by the last local vision module in the decoder;

[0090] The segmentation module is used to generate a target segmentation image according to the target image features.

[0091] In one possible design, in another implementation of another aspect of the embodiments of the present application, the local vision module also includes a spatial enhancement module, which generates a spatial scaling factor based on the input image features, and the spatial scaling factor is used to correct the spatial features corresponding to the input image features.

[0092] Another aspect of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned methods when executing the computer program.

[0093] Another aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the above-mentioned methods are implemented.

[0094] Another aspect of the present application provides a computer program product, including a computer program, which implements the above-mentioned methods when executed by a processor.

[0095] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0096] In an embodiment of the present application, a method for image segmentation is provided. First, the original image features corresponding to the original image are obtained, and then the original image features are used as inputs to an encoder in an image segmentation model to obtain a first image feature. The encoder includes a local visual module and an upsampling layer. The local visual module includes a spatial enhancement module. The spatial enhancement module is used to generate a spatial scaling factor based on the input image features. The spatial scaling factor is used to correct the spatial features corresponding to the input image features. Next, the first image feature is used as the input of a decoder in the image segmentation model to obtain a second image feature. Thus, the second image feature and the third image feature output by the first local visual module in the encoder are spliced ​​to obtain the target image feature. Finally, the target segmented image is generated by combining the original image and the target image features. In the above manner, a spatial enhancement module is introduced into the local visual module. The spatial enhancement module can generate a spatial scaling factor based on the input image features. The spatial scaling factor can be used to adjust the spatial features corresponding to the image features to achieve the purpose of enhancing the feature representation capability. It can be seen that the spatial scaling factor is adaptively generated based on the input image features, which reduces the configuration difficulty of the image segmentation model and improves the configuration efficiency of the image segmentation model. BRIEF DESCRIPTION OF THE DRAWINGS

[0097] Figure 1 A schematic diagram of the architecture of an image segmentation system in an embodiment of the present application;

[0098] Figure 2 A schematic diagram of an application scenario of an image segmentation task in an embodiment of the present application;

[0099] Figure 3 A schematic diagram of a flow chart of an image segmentation method in an embodiment of the present application;

[0100] Figure 4 A schematic diagram of the structure of a local vision module in an embodiment of the present application;

[0101] Figure 5 A schematic diagram of correcting spatial features based on a local vision module in an embodiment of the present application;

[0102] Figure 6 Another structural diagram of the local vision module in the embodiment of the present application;

[0103] Figure 7 Another schematic diagram of correcting spatial features based on a local vision module in an embodiment of the present application;

[0104] Figure 8 Another structural diagram of the local vision module in the embodiment of the present application;

[0105] Fig. 9A schematic diagram of correcting channel features based on a local vision module in an embodiment of the present application;

[0106] Fig.10 Another structural diagram of the local vision module in the embodiment of the present application;

[0107] Fig.11 This is another schematic diagram of correcting channel features based on a local vision module in an embodiment of the present application;

[0108] Fig.12 A structural diagram of an image segmentation model in an embodiment of the present application;

[0109] Fig.13 A comparative schematic diagram of the experimental results in the embodiments of the present application;

[0110] Fig.14 Another flowchart of the image segmentation method in the embodiment of the present application;

[0111] Fig.15 Another structural diagram of the local vision module in the embodiment of the present application;

[0112] Fig.16 A schematic diagram of an image segmentation device in an embodiment of the present application;

[0113] Fig.17 Another schematic diagram of the image segmentation device in the embodiment of the present application;

[0114] Fig.18 A schematic diagram of the structure of the server in the embodiment of the present application;

[0115] Fig.19 A schematic diagram of the structure of a terminal device in an embodiment of the present application. DETAILED DESCRIPTION

[0116] The embodiments of the present application provide a method, a related device, an apparatus and a storage medium for image segmentation. The present application uses a spatial scaling factor to adjust the spatial features of image features to achieve the purpose of enhancing feature characterization capabilities. The spatial scaling factor is adaptively generated based on input image features, thereby reducing the difficulty of model configuration and improving model configuration efficiency.

[0117] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "corresponding to" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0118] Computer vision (CV) technology based on artificial intelligence (AI) and deep learning has made significant progress. Many CV tasks require intelligent segmentation of images, dividing the pixels in the image into meaningful object categories that are semantically interpretable and correspond to real-world categories. In this way, the content in the image can be understood and the analysis of each part can be made easier. CV is a science that studies how to make machines "see". To put it more specifically, it refers to machine vision such as using cameras and computers to replace human eyes to identify and measure targets, and further perform graphics processing so that the computer processes the images into images that are more suitable for human eye observation or transmission to instruments for detection. As a scientific discipline, CV studies related theories and technologies, trying to establish AI systems that can obtain information from images or multidimensional data. CV technology generally includes image processing, image recognition, image semantic understanding, image retrieval, optical character recognition (OCR), video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and map construction, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.

[0119] AI is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, AI is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. AI is also about studying the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making. AI technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level technology and software-level technology. AI basic technologies generally include technologies such as sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. AI software technology mainly includes several major directions such as CV technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0120] The image segmentation method provided in this application is applicable to the following scenarios:

[0121] 1. Target identification;

[0122] Identify individuals from videos by comparing object features selected from the input image with objects in a database (e.g., license plates, faces, etc.).

[0123] 2. Autonomous driving;

[0124] Autonomous vehicles need to perceive and understand their surroundings in order to drive safely. Objects in the relevant categories include other vehicles, buildings, and pedestrians. Image segmentation enables autonomous vehicles to identify which areas in an image are safe to drive around.

[0125] 3. Medical imaging;

[0126] Extract clinically relevant information from medical images. For example, radiologists can use machine learning to enhance analysis by segmenting images into different organs, tissue types, or disease symptoms, thereby reducing the time required to run diagnostic tests.

[0127] 4. Retail image recognition;

[0128] It allows retailers to understand the layout of goods on the shelves. It processes product data in real time through image segmentation to detect whether there are goods on the shelves. If a product is out of stock, it can notify relevant personnel and recommend solutions for the supply chain.

[0129] In order to increase the accuracy of image segmentation in the above scenario and improve the efficiency of model configuration, this application proposes an image segmentation method, which is applied to Figure 1The image segmentation system shown, as shown in the figure, includes at least one of a server and a terminal device. The client is deployed on the terminal device, wherein the client can be run on the terminal device in the form of a browser, or can be run on the terminal device in the form of an independent application (application, APP), etc. The specific presentation form of the client is not limited here. The server involved in this application can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. The terminal device can be a smart phone, a tablet computer, a laptop, a PDA, a personal computer, a smart TV, a smart watch, a medical imaging device, a vehicle-mounted device, a wearable device, etc., but is not limited thereto. The terminal device and the server can be directly or indirectly connected by wired or wireless communication, and this application is not limited here. The number of servers and terminal devices is also not limited. The solution provided in this application can be completed independently by a terminal device, can be completed independently by a server, or can be completed by a terminal device and a server in cooperation. This application does not make any specific limitations on this.

[0130] Exemplarily, in one case, the image segmentation system includes a server and a terminal device. The terminal device sends the collected image to the server, and the server stores the trained image segmentation model locally. Based on this, the server calls the local image segmentation model to process the image, thereby obtaining an image segmentation result.

[0131] Exemplarily, in another case, the image segmentation system includes a server. The server locally stores images and trained image segmentation models. Based on this, the server calls the local image segmentation model to process the local image, thereby obtaining an image segmentation result.

[0132] Exemplarily, in another case, the image segmentation system includes a terminal device. The terminal device locally stores a trained image segmentation model. Based on this, the terminal device calls the local image segmentation model to process the collected image, thereby obtaining an image segmentation result.

[0133] For easier understanding, see Figure 2 , Figure 2This is a schematic diagram of an application scenario of the image segmentation task in the embodiment of the present application. As shown in the figure, the original image to be segmented is obtained, the original image is used as the input of the image segmentation model, and the target segmentation image is output through the image segmentation model. The target segmentation image includes a background part (i.e., an area composed of black pixels) and a foreground part, wherein the foreground part includes a human-shaped segmentation area (i.e., an area composed of white pixels) and a box-shaped segmentation area (i.e., an area composed of gray pixels).

[0134] Combined with the above introduction, the image segmentation method in this application will be introduced below. Figure 3 The image segmentation method in the embodiment of the present application may be executed by a computer device, which may be a terminal or a server, including:

[0135] 110. Obtaining original image features corresponding to the original image;

[0136] In one or more embodiments, an original image is obtained, wherein the original image may be a two-dimensional image or a three-dimensional image. A two-dimensional image may be represented as C×H×W, and a three-dimensional image may be represented as C×H×W×D, wherein C represents the number of channels, H represents the image height, W represents the image width, and D represents the image depth.

[0137] Specifically, the original image is used as the input of the feature extraction module in the image segmentation model, and the original image features are output through the feature extraction module. It can be understood that the feature extraction module can obtain the original image features by patch embedding based on a convolutional stem or a patchify stem.

[0138] 120. Based on the original image feature, obtain a first image feature through an encoder in the image segmentation model, wherein the encoder includes a plurality of local vision modules and a plurality of downsampling layers, the local vision module includes a spatial enhancement module, the spatial enhancement module is used to generate a spatial scaling factor based on the input image feature, and the spatial scaling factor is used to correct the spatial feature corresponding to the input image feature;

[0139] In one or more embodiments, the original image features are used as input to an encoder in an image segmentation model, and the first image features are output through the encoder. The encoder includes a number of local vision modules and a number of downsampling layers, each of which is used to reduce the image. Each local vision module includes two parts, one part is a basic local vision Transformer (Local Vision Transformer, Local Vision-TR) module, and the other part is an adaptive scaled enhanced shortcut (ASES). ASES includes at least a spatial enhancement module.

[0140] Specifically, the spatial enhancement module included in each local vision module can output a corresponding spatial scaling factor based on the input image features. Based on this, the spatial features of the input image features are corrected using the spatial scaling factor, thereby achieving the purpose of enhancing the spatial features.

[0141] It can be understood that the image segmentation model includes an encoder and a decoder. The original image features are first processed by the encoder and then by the decoder to finally achieve image segmentation. Among them, the encoder enables the image segmentation model to understand the content of the image. As the network layer deepens, the size of the original image features decreases, while the channels increase.

[0142] It should be noted that the Local Vision-TR module in the present application may adopt a window-type visual Transformer, for example, a Cross-Shaped Windows Transformer (CSWin-Transformer), or a Shuffle Transformer (Shuffle Transformer), or a Pyramid Vision Transformer (PVT) v1, or other forms of Transformer, which are not limited here.

[0143] 130. Based on the first image feature, obtain a second image feature through a decoder in the image segmentation model, wherein the decoder includes a plurality of local vision modules and a plurality of upsampling layers;

[0144] In one or more embodiments, the first image feature is used as an input to a decoder in an image segmentation model, and the second image feature is output by the decoder. The decoder includes a plurality of local vision modules and a plurality of upsampling layers, each of which is used to enlarge the image. Each local vision module includes a Local Vision-TR module and an ASES. ASES includes at least a spatial enhancement module.

[0145] It can be understood that the decoder combines the encoder's understanding of the image content to restore the image's position information. As the network layer deepens, the size of the first image feature increases, while the channels decrease.

[0146] 140. Concatenate the second image feature and the third image feature output by the first local visual module in the encoder to obtain a target image feature, wherein the second image feature is the image feature output by the last local visual module in the decoder;

[0147] In one or more embodiments, the decoder includes a plurality of local vision modules, and the image feature output by the last local vision module is the second image feature. Based on this, the second image feature can be concatenated with the third image feature output by the first local vision module in the encoder to obtain the target image feature. The concat operation is used to fuse the image features at corresponding positions during upsampling and downsampling, so that the decoder can obtain more high-resolution information when upsampling, thereby more perfectly restoring the detail information in the original image and improving the segmentation accuracy.

[0148] Specifically, the first local visual module in the encoder is skip-connected to the last local visual module in the decoder. The skip connection can introduce feature information at the corresponding scale into the upsampling or deconvolution process, providing multi-scale and multi-level information for subsequent image segmentation, thereby obtaining a more refined segmentation effect.

[0149] 150. Generate a target segmentation image according to the target image features.

[0150] In one or more embodiments, the target image features are mapped to obtain a target segmented image.

[0151] Specifically, in one implementation, mapping can be achieved by using transposed convolution, and in another implementation, mapping can be achieved by using interpolation and convolution. Taking the use of transposed convolution to achieve mapping as an example, if the original image is a two-dimensional image, a two-dimensional transposed convolution with a convolution kernel size of 2*2 and 1*1 can be used to map the target image features to the size of the original image. If the original image is a three-dimensional image, a three-dimensional transposed convolution with a kernel size of 2*2*2 and 1*1*1 can be used to map the target image features to the size of the original image.

[0152] In an embodiment of the present application, a method for image segmentation is provided. By the above method, a spatial enhancement module is introduced into the local vision module, and the spatial enhancement module can generate a spatial scaling factor based on the input image feature, and the spatial scaling factor can be used to adjust the spatial feature corresponding to the image feature to achieve the purpose of enhancing the feature representation capability. It can be seen that the spatial scaling factor is adaptively generated based on the input image feature, which reduces the configuration difficulty of the image segmentation model and improves the configuration efficiency of the image segmentation model.

[0153] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the local vision module further includes a first normalization layer and an attention module;

[0154] The first normalization layer is used to normalize the first input feature to obtain a first normalized feature;

[0155] The attention module is used to extract features from the first normalized features to obtain spatial features of the first normalized features;

[0156] The spatial enhancement module is used to perform a maximum pooling operation and an average pooling operation on the first normalized feature to obtain a target merging result, wherein the target merging result includes a maximum pooling result and an average pooling result;

[0157] The spatial enhancement module is also used to perform a convolution operation on the target merging result to obtain a convolution result;

[0158] The spatial enhancement module is also used to calculate the convolution result using an activation function to obtain the target spatial scaling factor.

[0159] In one or more embodiments, a connection method of a spatial enhancement module is introduced. From the above embodiments, it can be seen that the local vision module includes a Local Vision-TR module and an ASES, wherein the ASES includes a spatial enhancement module, and the Local Vision-TR module includes a first normalization layer, an attention module, a second normalization layer, and a multilayer perceptron (MLP).

[0160] Specifically, for ease of understanding, see Figure 4 , Figure 4 This is a structural diagram of a local vision module in an embodiment of the present application. As shown in the figure, the attention module can adopt window-based multi-head self-attention (W-MSA), and the first normalization layer and the second normalization layer both adopt batch normalization (Batch Normalization, BN). The first normalization layer and the attention module can mine the intrinsic connection between the input data, and the second normalization layer and MLP can mine the intrinsic connection between different features of the input data. Residual connections are used for the attention module and MLP respectively to maintain consistent mapping. The spatial enhancement module is used for the attention module, and the adaptive scaling value (i.e., the target space scaling factor) is learned from the input features, and multiplied by the output of the attention module, and then added to the first input feature. That is, it conforms to the form of scaling first and then adding bias.

[0161] Based on this, combined Figure 4 For the structure shown, see Figure 5 , Figure 5 This is a schematic diagram of correcting spatial features based on a local visual module in an embodiment of the present application. As shown in the figure, assuming that the attention module adopts W-MSA and the first normalization layer adopts a BN layer, the overall process of the adaptive scaling spatial enhancement shortcut can be expressed as:

[0162]

[0163]

[0164] Among them, Z l Represents the first input feature. Represents the first normalized feature. BN() represents the normalization of the input feature. Indicates the use of E for the first normalized feature s The spatial enhancement shortcut learns a spatially adaptive scaling factor (ie, a target spatial scaling factor). represents the spatial feature of the first normalized feature learned by W-MSA. Thus, the target space scaling factor Spatial features with the first normalized features Multiply, perform scaling correction, and then add it to the first input feature Z l Add together and finally get the corrected first input feature.

[0165] The target space scaling factor is calculated as follows:

[0166]

[0167] Among them, σ() represents the activation function. Represents the maximum pooling result obtained by mapping the first normalized feature using the maximum pooling operation. Indicates the average pooling result obtained by mapping the first normalized feature using the average pooling operation. After merging the maximum pooling result and the average pooling result, the target merged result is obtained. Use 2D convolution with kernel size of 3*3 on the target merge result to get the convolution result Finally, the activation function is used to calculate the convolution result to obtain the target space scaling factor

[0168] It should be noted that the first normalization layer and the second normalization layer in the present application can adopt BN, or layer normalization (LN), or group normalization (LN), or other normalization forms, which are not limited here.

[0169] It should be noted that the activation function used in this application can be a Sigmoid function, a Rectified Linear Unit (ReLU) function, a hyperbolic tangent (tanh) function, an Exponential Linear Unit (Elu) function, or other activation function forms, which are not limited here.

[0170] It should be noted that this application uses convolution and pooling as the main calculations in ASES. In addition, it is possible to use other components to replace convolution and pooling to implement the enhancement path, such as convolution, or pooling, or fully connected layer, or non-linear activation function, or normalization, or SoftMax, etc., which are not limited here.

[0171] Secondly, in an embodiment of the present application, a connection method for a spatial enhancement module is provided. Through the above method, a spatial enhancement module is added to the backbone network of the Local Vision-TR module, and the decoupled spatial features are adaptively corrected and enhanced to achieve adaptive scaling of the spatial representation. Therefore, without introducing additional complex calculations, the effect is significantly improved compared to the original Local Vision-TR, and good results are achieved. At the same time, due to the streamlined module structure, the overfitting and degradation problems of the Transformer model are avoided.

[0172] Optionally, in the above Figure 3On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the local vision module further includes a first normalization layer and an attention module;

[0173] The attention module is used to extract features from the first input feature to obtain a spatial feature of the first input feature;

[0174] The spatial enhancement module is used to perform a maximum pooling operation and an average pooling operation on the spatial feature of the first input feature to obtain a target merging result, wherein the target merging result includes a maximum pooling result and an average pooling result;

[0175] The spatial enhancement module is also used to perform a convolution operation on the target merging result to obtain a convolution result;

[0176] The spatial enhancement module is also used to calculate the convolution result using an activation function to obtain the target spatial scaling factor;

[0177] The first normalization layer is used to normalize the modified spatial features, wherein the modified spatial features are obtained by modifying the spatial features of the first input features by using the target spatial scaling factor.

[0178] In one or more embodiments, another connection method of the spatial enhancement module is introduced. From the above embodiments, it can be seen that the local vision module includes a Local Vision-TR module and an ASES, wherein the ASES includes a spatial enhancement module, and the Local Vision-TR module includes a first normalization layer, an attention module, a second normalization layer, and an MLP.

[0179] Specifically, for ease of understanding, see Figure 6 , Figure 6 This is another structural diagram of the local vision module in the embodiment of the present application. As shown in the figure, the attention module can use W-MSA, and the first normalization layer and the second normalization layer both use BN. Residual connections are used for the attention module and MLP to maintain consistent mapping. The spatial enhancement module is used for the attention module, and the adaptive scaling value (i.e., the target space scaling factor) is learned from the input features, and multiplied with the output of the attention module, and then normalized, and finally the normalized features are added to the residual connection of the attention module.

[0180] Based on this, combined Figure 6 For the structure shown, see Figure 7 , Figure 7This is another schematic diagram of correcting spatial features based on a local visual module in an embodiment of the present application. As shown in the figure, it is assumed that the attention module adopts W-MSA and the first normalization layer adopts a BN layer. Feature extraction is performed on the first input feature to obtain the spatial features of the first input feature. Then the spatial features of the first input feature are subjected to a maximum pooling operation to obtain a maximum pooling result, and the spatial features of the first input feature are subjected to an average pooling operation to obtain an average pooling result. Thus, after merging the maximum pooling result and the average pooling result, a target merged result is obtained. Thus, a 2D convolution with a kernel size of 3*3 can be used on the target merged result to obtain a convolution result. Finally, the convolution result is calculated using an activation function to obtain a target spatial scaling factor.

[0181] The target spatial scaling factor is multiplied by the spatial feature of the first input feature output by the attention module to obtain the modified spatial feature. The modified spatial feature is then normalized and finally added to the first input feature.

[0182] It should be noted that the first normalization layer and the second normalization layer in the present application can adopt BN, or LN, or LN, or other normalization forms, which are not limited here.

[0183] It should be noted that the activation function used in this application can be a Sigmoid function, or a ReLU function, or a tanh function, or an Elu function, or other activation function forms, which are not limited here.

[0184] It should be noted that this application uses convolution and pooling as the main calculations in ASES. In addition, it is possible to use other components to replace convolution and pooling to implement the enhancement path, which is not limited here.

[0185] Secondly, in an embodiment of the present application, another connection method of the spatial enhancement module is provided. Through the above method, a spatial enhancement module is added to the backbone network of the Local Vision-TR module, and the decoupled spatial features are adaptively corrected and enhanced to achieve adaptive scaling of the spatial representation. Therefore, without introducing additional complex calculations, the effect is significantly improved compared to the original Local Vision-TR, and good results are achieved. At the same time, due to the streamlined module structure, the overfitting and degradation problems of the Transformer model are avoided.

[0186] Optionally, in the above Figure 3On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiments of the present application, the local vision module also includes a channel enhancement module, which generates a channel scaling factor based on the input image features, and the channel scaling factor is used to correct the channel features corresponding to the input image features.

[0187] In one or more embodiments, a method of adding channel enhancement is introduced. As can be seen from the above embodiments, each local vision module includes a Local Vision-TR module and an ASES. Among them, ASES includes not only a spatial enhancement module, but also a channel enhancement module.

[0188] Specifically, the channel enhancement module included in each local vision module can output a corresponding channel scaling factor based on the input image features. Based on this, the channel scaling factor is used to correct the channel features corresponding to the input image features. Thus, the purpose of enhancing the channel features is achieved.

[0189] Secondly, in the embodiment of the present application, a method of adding channel enhancement is provided. Through the above method, spatial enhancement shortcuts and channel enhancement shortcuts are added to the Local Vision-TR backbone network at the same time, thereby improving the performance of Local Vision-TR and facilitating better image segmentation effects.

[0190] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the local vision module further includes a second normalization layer and a multi-layer perceptron;

[0191] The second normalization layer is used to normalize the second input feature to obtain a second normalized feature;

[0192] The multi-layer perceptron is used to extract the second normalized feature to obtain the channel feature of the second normalized feature;

[0193] The channel enhancement module is used to perform a maximum pooling operation on the channel feature of the second normalized feature to obtain a maximum pooling result, and to perform an average pooling operation on the channel feature of the second normalized feature to obtain an average pooling result;

[0194] The channel enhancement module is also used to perform a convolution operation on the maximum pooling result to obtain a first convolution result, and to perform a convolution operation on the average pooling result to obtain a second convolution result;

[0195] The channel enhancement module is also used to determine a target convolution result according to the first convolution result and the second convolution result;

[0196] The channel enhancement module is also used to calculate the target convolution result using an activation function to obtain a target channel scaling factor.

[0197] In one or more embodiments, a connection method of a channel enhancement module is introduced. From the above embodiments, it can be seen that the local vision module includes a Local Vision-TR module and an ASES, wherein the ASES includes a spatial enhancement module and a channel enhancement module, and the Local Vision-TR module includes a first normalization layer, an attention module, a second normalization layer, and an MLP.

[0198] Specifically, for ease of understanding, see Figure 8 , Figure 8 This is another structural diagram of the local vision module in the embodiment of the present application. As shown in the figure, the attention module can adopt W-MSA, and the first normalization layer and the second normalization layer both adopt BN. The first normalization layer and the attention module can mine the intrinsic connection between the input data, and the second normalization layer and MLP can mine the intrinsic connection between different features of the input data. Residual connections are used for the attention module and MLP respectively to maintain consistency mapping. The spatial enhancement module is used for the attention module, and the adaptive scaling value (i.e., the target spatial scaling factor) is learned from the input features, and multiplied with the output of the attention module, and then added with the residual connection of the attention module. The channel enhancement module is used for the MLP, and the adaptive scaling value (i.e., the target channel scaling factor) is learned from the input features, and multiplied with the output of the MLP, and then added with the second input feature. That is, it conforms to the form of scaling first and then adding bias.

[0199] Based on this, combined Figure 8 For the structure shown, see Fig. 9 , Fig. 9 This is a schematic diagram of correcting channel features based on a local visual module in an embodiment of the present application. As shown in the figure, it is assumed that the second normalization layer adopts a BN layer. Therefore, the overall process of the adaptive scaling channel enhancement shortcut can be expressed as:

[0200] Y l n =BN(Y l );

[0201]

[0202] Among them, Y l Represents the second input feature. l n Represents the second normalized feature. BN() represents the normalization of the input feature. c (Y l n ) indicates that E is used for the second normalized feature cThe channel enhancement shortcut learns a channel adaptive scaling factor (i.e., the target channel scaling factor). MLP(Y l n ) represents the channel feature of the second normalized feature learned by MLP. Thus, the target channel is scaled by factor E c (Y l n ) and the channel feature MLP of the second normalized feature (Y l n ) to perform scaling correction and then multiply it with the second input feature Y l Add together and finally get the modified second input feature.

[0203] The target channel scaling factor is calculated as follows:

[0204]

[0205] Among them, σ() represents the activation function. MaxPool(Y l n ) represents the maximum pooling result obtained by mapping the second normalized feature using the maximum pooling operation. AvgPool(Y l n ) represents the average pooling result obtained by mapping the second normalized feature using the average pooling operation. PWConv2D(MaxPool(Y l n )) represents the first convolution result obtained after applying a 2D point-wise convolution (PWConv2D) with a kernel size of 1 to the maximum pooling result. PWConv2D(AvgPool(Y l n )) represents the second convolution result obtained after applying PWConv2D with kernel size 1 to the average pooling result. The target convolution result can be obtained by directly adding the first convolution result and the second convolution result, that is, PWConv2D(AvgPool(Y l n ))+(PWConv 2D(MaxPool(Y l n ))). Finally, the activation function is used to calculate the target convolution result to obtain the target channel scaling factor

[0206] It should be noted that the first normalization layer and the second normalization layer in the present application can adopt BN, or LN, or LN, or other normalization forms, which are not limited here.

[0207] It should be noted that the activation function used in this application can be a Sigmoid function, or a ReLU function, or a tanh function, or an Elu function, or other activation function forms, which are not limited here.

[0208] It should be noted that this application uses convolution and pooling as the main calculations in ASES. In addition, it is possible to use other components to replace convolution and pooling to implement the enhancement path, which is not limited here.

[0209] Again, in an embodiment of the present application, a connection method for a channel enhancement module is provided. Through the above method, a channel enhancement module is added to the backbone network of the Local Vision-TR module, and the decoupled channel features are adaptively corrected and enhanced to achieve adaptive scaling of the channel representation. Therefore, without introducing additional complex calculations, the effect is significantly improved compared to the original Local Vision-TR, and good results are achieved. At the same time, due to the streamlined module structure, the overfitting and degradation problems of the Transformer model are avoided.

[0210] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the local vision module further includes a second normalization layer and a multi-layer perceptron;

[0211] The multilayer perceptron is used to extract the second input feature to obtain the channel feature of the second input feature;

[0212] The channel enhancement module is used to perform a maximum pooling operation on the channel feature of the second input feature to obtain a maximum pooling result, and to perform an average pooling operation on the channel feature of the second input feature to obtain an average pooling result;

[0213] The channel enhancement module is also used to perform a convolution operation on the maximum pooling result to obtain a first convolution result, and to perform a convolution operation on the average pooling result to obtain a second convolution result;

[0214] The channel enhancement module is also used to determine a target convolution result according to the first convolution result and the second convolution result;

[0215] The channel enhancement module is also used to calculate the target convolution result using an activation function to obtain the target channel scaling factor;

[0216] The second normalization layer is used to normalize the corrected channel features, wherein the corrected channel features are obtained by correcting the channel features of the second input features by using the target channel scaling factor.

[0217] In one or more embodiments, another connection method of the channel enhancement module is introduced. From the above embodiments, it can be seen that the local vision module includes a Local Vision-TR module and an ASES, wherein the ASES includes a spatial enhancement module and a channel enhancement module, and the Local Vision-TR module includes a first normalization layer, an attention module, a second normalization layer, and an MLP.

[0218] Specifically, for ease of understanding, see Fig.10 , Fig.10 It is another structural diagram of the local vision module in the embodiment of the present application. As shown in the figure, the attention module can adopt W-MSA, and the first normalization layer and the second normalization layer both adopt BN. Residual connections are used for the attention module and MLP to maintain consistency mapping. The spatial enhancement module is used for the attention module, and the adaptive scaling value (i.e., the target spatial scaling factor) is learned from the input features, and multiplied with the output of the attention module, and then normalized, and finally the normalized features are added to the residual connection of the attention module. The channel enhancement module is used for the attention module, and the adaptive scaling value (i.e., the target channel scaling factor) is learned from the input features, and multiplied with the output of the attention module, and then normalized, and finally the normalized features are added to the second input features.

[0219] Based on this, combined Fig.10 For the structure shown, see Fig.11 , Fig.11 This is another schematic diagram of correcting channel features based on a local visual module in an embodiment of the present application. As shown in the figure, it is assumed that the second normalization layer adopts a BN layer. Feature extraction is performed on the second input feature to obtain the channel feature of the second input feature. Then the channel feature of the second input feature is subjected to a maximum pooling operation to obtain a maximum pooling result, and the channel feature of the second input feature is subjected to an average pooling operation to obtain an average pooling result. Thus, a convolution operation is performed on the maximum pooling result using PWConv2D to obtain a first convolution result, and a convolution operation is performed on the average pooling result using PWConv2D to obtain a second convolution result. Then the first convolution result and the second convolution result are directly added to obtain a target convolution result. Finally, the target convolution result is calculated using an activation function to obtain a target channel scaling factor.

[0220] The target channel scaling factor is multiplied by the channel feature of the second input feature output by the MLP to obtain the corrected channel feature. The corrected channel feature is then normalized and finally added to the residual connection of the MLP.

[0221] It should be noted that the first normalization layer and the second normalization layer in the present application can adopt BN, or LN, or LN, or other normalization forms, which are not limited here.

[0222] It should be noted that the activation function used in this application can be a Sigmoid function, or a ReLU function, or a tanh function, or an Elu function, or other activation function forms, which are not limited here.

[0223] It should be noted that this application uses convolution and pooling as the main calculations in ASES. In addition, it is possible to use other components to replace convolution and pooling to implement the enhancement path, which is not limited here.

[0224] Again, in an embodiment of the present application, another connection method of the channel enhancement module is provided. Through the above method, a channel enhancement module is added to the backbone network of the Local Vision-TR module, and the decoupled channel features are adaptively corrected and enhanced to achieve adaptive scaling of the channel characterization. Therefore, without introducing additional complex calculations, the effect is significantly improved compared to the original Local Vision-TR, and good results are achieved. At the same time, due to the streamlined module structure, the overfitting and degradation problems of the Transformer model are avoided.

[0225] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the encoder includes M local visual modules and N downsampling layers, the decoder includes (M-1) local visual modules and N upsampling layers, and the (M-1) local visual modules included in the decoder are jump-connected with the corresponding (M-1) local visual modules in the encoder, wherein M is an integer greater than 1, and N is an integer greater than or equal to 1;

[0226] The image features output by the first local vision module in the encoder are used as the image features input to the first downsampling layer in the encoder;

[0227] The image features output by the last downsampling layer in the encoder are used as the image features input to the last local vision module in the encoder;

[0228] The image features output by the last local vision module in the encoder are used as the image features input to the first upsampling layer in the decoder;

[0229] The image features output by the first upsampling layer in the decoder are used as the image features input by the first local vision module in the decoder;

[0230] The image features output by the last upsampling layer in the decoder are used as the image features input to the last local vision module in the encoder.

[0231] In one or more embodiments, an overall structure of an image segmentation model is introduced. As can be seen from the foregoing embodiments, the image segmentation model includes an encoder and a decoder, wherein the encoder includes a plurality of local vision modules and a plurality of downsampling layers, and the decoder includes a plurality of local vision modules and a plurality of upsampling layers. Each local vision module includes a Local Vision-TR module and an ASES.

[0232] Specifically, for ease of understanding, see Fig.12 , Fig.12 This is a structural diagram of the image segmentation model in an embodiment of the present application. As shown in the figure, it is assumed that the encoder includes 14 local vision modules and 3 downsampling layers, the decoder includes 13 local vision modules and 3 upsampling layers, and the 13 local vision modules included in the decoder are jump-connected with the corresponding local vision modules in the encoder.

[0233] Based on this, the original image of size Ci×H×W×D is input, and the features are preliminarily embedded using patch embedding, and then Local Vision-TR is learned. Each stage includes a Local Vision-TR and an ASES. The image features output by the first local vision module in the encoder are used as the image features input by the first downsampling layer in the encoder (i.e., the third image features), and the image features output by the last downsampling layer in the encoder are used as the image features input by the last local vision module in the encoder. At the same time, the third image features output by the first local vision module in the encoder are concatenated with the second image features output by the last local vision module in the decoder to obtain the target image features. In target mapping (target projection), a three-dimensional transposed convolution (stride=2) with a kernel size of 2*2*2 and 1*1*1 is used to map the target image features to the original size, i.e., to obtain the image features of C'o×H×W×D.

[0234] It can be understood that a three-dimensional transposed convolution with a kernel size of 2*2*2 can be used in upsampling, and the jump connection uses the jump connection mode in the U-Net.

[0235] It should be noted that Fig.12 The model structure shown is only a schematic diagram. In practical applications, the structure and parameters can be adjusted according to specific circumstances and are not limited here.

[0236] Secondly, in the embodiment of the present application, an overall structure of an image segmentation model is provided. In the above manner, the image segmentation model with a pyramid structure is used for image segmentation, which can not only enhance the learning ability and feature expression ability of the visual Transformer, but also prevent the problem of visual Transformer model degradation.

[0237] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, obtaining the original image features corresponding to the original image may specifically include:

[0238] Get the original image;

[0239] Perform a block operation on the original image to obtain K image blocks, where K is an integer greater than 1;

[0240] Perform convolution operation on each of the K image blocks to obtain K feature vectors;

[0241] Generate original image features based on K feature vectors.

[0242] In one or more embodiments, a method for generating original image features based on convolutional stem is introduced. As can be seen from the above embodiments, convolutional stem can output original image features through patch embedding. Among them, the original image features can be represented as a feature matrix, and the feature matrix includes K feature vectors, each feature vector corresponds to an image block.

[0243] Specifically, the original image can be divided into K (for example, p×p) image blocks, and then each image block is mapped and converted into a d-dimensional feature vector. K d-dimensional feature vectors are combined to obtain K×d-dimensional original image features. Assuming that the size of the original image is 224×224 and the size of each image block is 16, the number of patches is 196 (i.e., 14×14), and the image block mapping is equivalent to a 16×16 kernel size, with a step size of 16 convolution kernel.

[0244] It can be understood that the convolutional stem is downsampled to 14×14 by 3×3 convolution. Exemplarily, four 3×3 convolutions with a stride of 2 and one 1×1 convolution with a stride of 1 can be set.

[0245] Secondly, in the embodiment of the present application, a method for generating original image features based on convolutional stem is provided. Through the above method, since convolutional stem has a faster convergence speed and has better stability in learning rate and weight decay, the model has better robustness.

[0246] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, based on the original image feature, obtaining the first image feature through the encoder in the image segmentation model may specifically include:

[0247] Based on the original image feature, a first intermediate image feature is obtained through a local vision module included in an encoder, wherein the encoder belongs to an image segmentation model;

[0248] Based on the first intermediate image feature, obtaining a second intermediate image feature through a downsampling layer included in the encoder;

[0249] Based on the second intermediate image feature, the first image feature is obtained through the residual module included in the encoder, wherein the residual module included in the encoder includes at least one local visual module, or the residual module included in the encoder includes at least one local visual module and at least one downsampling layer.

[0250] In one or more embodiments, a method for extracting a first image feature based on an encoder is introduced. From the foregoing embodiments, it can be seen that the image segmentation model includes an encoder and a decoder, wherein the encoder includes a plurality of local vision modules and a plurality of downsampling layers, and each local vision module includes a Local Vision-TR module and an ASES.

[0251] Specifically, for ease of understanding, please refer again to Fig.12 As shown in the figure, after obtaining the original image features after patch embedding, they are input into a local visual module in the encoder, and the local visual module outputs the first intermediate image features, where the original image features and the first intermediate image features are both represented as C×H / 4×W / 4×D / 4. Based on this, the first intermediate image features are input into a downsampling layer in the encoder, and the downsampling layer outputs the second intermediate image features, where the second intermediate image features are represented as 2C×H / 8×W / 8×D / 8.

[0252] It is understandable that the remaining modules (eg, at least one local vision module, or at least one local vision module and at least one downsampling layer) may be used to process the second intermediate image features until the first image features are obtained.

[0253] Secondly, in the embodiment of the present application, a method for extracting the first image feature based on the encoder is provided. Through the above method, a specific implementation method is provided for the workflow of the image segmentation model, thereby improving the feasibility and operability of the solution.

[0254] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, based on the first image feature, obtaining the second image feature through a decoder in the image segmentation model may specifically include:

[0255] Based on the first image feature, obtaining a third intermediate image feature through an upsampling layer included in a decoder, wherein the decoder belongs to an image segmentation model;

[0256] Based on the third intermediate image feature, obtaining a fourth intermediate image feature through a local vision module included in the decoder;

[0257] Based on the fourth intermediate image feature, the second image feature is obtained through the residual module included in the decoder, wherein the residual module included in the decoder includes at least one local visual module, or the residual module included in the decoder includes at least one local visual module and at least one upsampling layer.

[0258] In one or more embodiments, a method for extracting a second image feature based on a decoder is introduced. From the foregoing embodiments, it can be seen that the image segmentation model includes an encoder and a decoder, wherein the decoder includes a plurality of local vision modules and a plurality of upsampling layers, and each local vision module includes a Local Vision-TR module and an ASES.

[0259] Specifically, for ease of understanding, please refer again to Fig.12 As shown in the figure, after obtaining the encoded first image feature, it is input into an upsampling layer in the decoder, and the upsampling layer outputs the third intermediate image feature, where the third intermediate image feature is expressed as 4C×H / 16×W / 16×D / 16. Based on this, the third intermediate image feature is input into a local visual module in the decoder, and the local visual module outputs the fourth intermediate image feature, where the fourth intermediate image feature is expressed as 4C×H / 16×W / 16×D / 16.

[0260] It is understandable that the remaining modules (eg, at least one local vision module, or at least one local vision module and at least one upsampling layer) may be used to process the fourth intermediate image feature until the second image feature is obtained.

[0261] Secondly, in the embodiment of the present application, a method for extracting the second image feature based on the decoder is provided. Through the above method, a specific implementation method is provided for the workflow of the image segmentation model, thereby improving the feasibility and operability of the solution.

[0262] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, generating a target segmented image according to the target image features may specifically include:

[0263] Performing a convolution operation on the original image to obtain a first image feature to be processed;

[0264] Performing a convolution operation on the target image feature to obtain a second image feature to be processed;

[0265] Adding the first image feature to be processed and the second image feature to be processed to obtain a third image feature to be processed;

[0266] A convolution operation is performed on the third image feature to be processed to obtain a target segmented image.

[0267] In one or more embodiments, a method for generating a target segmented image based on a residual connection is introduced. As can be seen from the above embodiments, the image segmentation model can also adopt a residual connection structure to obtain the target segmented image.

[0268] Specifically, for ease of understanding, please refer again to Fig.12 As shown in the figure, the original image is a three-dimensional image as an example, and the original image is represented as Ci×H×W×D. One or more cascaded convolutional layers are used to perform a convolution operation on the original image to obtain the first image feature to be processed, and the first image feature to be processed is represented as C'i×H×W×D. After the target image feature is mapped, the second image feature to be processed is obtained, and the second image feature to be processed is represented as C'o×H×W×D. Based on this, the first image feature to be processed and the second image feature to be processed are added to obtain the third image feature to be processed, and the third image feature to be processed is represented as (C'i+C'o)×H×W×D. Finally, after one or more convolutional layers, the target segmented image is obtained.

[0269] Secondly, in the embodiment of the present application, a method for generating a target segmented image based on residual connection is provided. Through the above method, the residual connection is used for calculation, which can solve the problem of gradient diffusion on the one hand, and the problem of network degradation on the other hand. Thus, it is beneficial to improve the performance of the model.

[0270] Optionally, in the above Figure 3On the basis of the corresponding embodiments, another optional embodiment provided by the embodiment of the present application may further include:

[0271] Obtaining a sample image feature corresponding to the sample image, wherein the sample image is an image with region annotation;

[0272] Based on the sample image feature, obtaining a first sample image feature through an encoder in the image segmentation model;

[0273] Based on the first sample image feature, obtaining a second sample image feature through a decoder in the image segmentation model;

[0274] splicing the second sample image feature and the third sample image feature output by the first local vision module in the encoder to obtain the target sample image feature;

[0275] Generate a target segmentation sample image according to the features of the sample image and the target sample image;

[0276] The model parameters of the image segmentation model are updated according to the target segmentation sample image and the annotated area of ​​the sample image.

[0277] In one or more embodiments, a method for training an image segmentation model is introduced. As can be seen from the above embodiments, in the model training stage, similarly, the sample image is used as the input of the feature extraction module in the image segmentation model, and the sample image features are output through the feature extraction module. It can be understood that the sample image is an image with region annotation, that is, each pixel in the sample image has a corresponding annotation category.

[0278] Specifically, the sample image feature is used as the input of the encoder in the image segmentation model, and the encoder outputs the first sample image feature. The first sample image feature is then used as the input of the decoder in the image segmentation model, and the decoder outputs the second sample image feature. Therefore, the first sample image feature can be concat with the third sample image feature output by the first local vision module in the encoder to obtain the target sample image feature. Finally, the target sample image feature can be mapped to obtain the target segmented sample image. Based on this, according to the target segmented sample image and the annotated area of ​​the sample image, the loss function is used to calculate the loss value between the predicted result and the true result, and the loss value is used to update the model parameters of the image segmentation model. When the model training conditions are met, the trained image segmentation model is obtained.

[0279] It can be understood that the loss function used in this application can be a cross-entropy loss function, or an intersection-over-Union (IoU) loss function, or a focal loss function, or other loss functions, which are not limited here.

[0280] It should be noted that, in one case, the exhaustion criterion can be used as the basis for determining whether the model training conditions are met, for example, a threshold of the number of iterations is set, and when the number of iterations reaches the threshold of the number of iterations, it means that the model training conditions have been met. In another case, the observation criterion can be used as the basis for determining whether the model training conditions are met, for example, when the loss result has converged, it means that the model training conditions have been met.

[0281] Secondly, in the embodiment of the present application, a method for training an image segmentation model is provided. Through the above method, the model parameters of the image segmentation model can be trained to achieve the effect of end-to-end training, and the model parameters can be learned in combination with specific tasks, thereby improving the robustness of the model.

[0282] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, obtaining the original image features corresponding to the original image may specifically include:

[0283] Acquire an original medical image feature corresponding to the original medical image, wherein the original medical image is a two-dimensional image or a three-dimensional image;

[0284] According to the target image features, a target segmentation image is generated, which may specifically include:

[0285] According to the target image features, the target segmented medical image is generated and displayed.

[0286] In one or more embodiments, a method for segmenting a medical image is introduced. As can be seen from the aforementioned embodiments, the original image can be a three-dimensional image, and the "original image" is taken as an example of "original medical image" for explanation. Original medical images are usually three-dimensional images, and the imaging mechanism is different from that of natural images. They are often computed tomography (CT) or magnetic resonance imaging (MRI). These have lower resolutions and lower contrast than natural images, which makes it difficult to determine the boundaries of the segmentation task. The method provided in this application can achieve better results in such segmentation tasks.

[0287] Specifically, after the target segmented medical image corresponding to the original medical image is obtained, it can also be displayed on the front end for the user to view.

[0288] In this regard, the present application uses the synapse public dataset, which consists of 30 CT scans corresponding to 13 organs annotated on the abdomen of the subject, each CT scan contains 80 to 225 slices with a thickness between 1 mm and 6 mm. Each CT three-dimensional image is preprocessed by normalizing the intensity value of [-1000,1000] to [0,1]. All images are resampled into three-dimensional images with an equal direction spacing of 1.0 mm, and the input of the model scales the CT image to 128×128×128. Since it is a 13-category multi-organ segmentation task, the output category is 14 categories (including background). For 30 three-dimensional CT images, the synapse dataset can be divided into 24 cases as a training set and 6 cases as a test set according to a certain division method. During training, the batch size (batchsize) can be set to 2, the learning rate can be set to 1e-4, the optimizer can use adaptive moment estimation weight decay (adaptive moment estimation weight, AdamW), and the weight decay can be set to 1e-5.

[0289] Based on this, take the synapse abdominal multi-organ CT segmentation task as an example. For the sake of explanation, please refer to Fig.13 , Fig.13 This is a comparative schematic diagram of the experimental results in the embodiments of the present application. As shown in the figure, the annotation group (ground truth, GT) is used as the reference group. Among them, the first group uses ASES in this application as an enhancement of Local Vision-TR. After image segmentation processing, Average Dice = 0.8170 is obtained. The second group is the effect of using U-type Transformer (UNETR) for image segmentation processing, and Average Dice = 0.7919 is obtained. The third group is the effect of using the swing U-type network (Swin-Unet) for image segmentation processing, and Average Dice = 0.7565 is obtained. The fourth group is the effect of using 3D CSWin-Transformer for image segmentation processing, and Average Dice = 0.7687 is obtained. The fifth group is the effect of using the segmentation network (TransUnet) for image segmentation processing, and Average Dice = 0.7479 is obtained. The sixth group is the effect of using 3D U-type network (3D U-Net) for image segmentation processing, and Average Dice = 0.7519 is obtained.

[0290] The most advanced model (state-of-the-art model, SOTA) in 3D general vision tasks is used, that is, CSWin-Transformer, with Average Dice = 0.7681. Based on the synapse dataset, UNETR's Average Dice = 0.7838. Using the enhanced shortcut provided by this application on Local Vision-TR has a significant improvement, and the model further exceeds the existing SOTA effect.

[0291] Secondly, in the embodiment of the present application, a method for segmenting medical images is provided. Through the above method, high accuracy is achieved in medical segmentation visual tasks, and the additional computational effort is small. It has potential application value in medical prediction tasks using Local Vision-TR as the backbone network, and can be integrated into medical image analysis software. In addition, it can also be applied to visual transformers used in general visual tasks.

[0292] Combined with the above introduction, the image segmentation method in this application will be introduced below. Fig.14 The image segmentation method in the embodiment of the present application may be executed by a computer device, which may be a terminal or a server, including:

[0293] 210. Obtaining original image features corresponding to the original image;

[0294] In one or more embodiments, an original image is obtained, wherein the original image may be a two-dimensional image or a three-dimensional image. A two-dimensional image may be represented as C×H×W, and a three-dimensional image may be represented as C×H×W×D, wherein C represents the number of channels, H represents the image height, W represents the image width, and D represents the image depth.

[0295] Specifically, the original image is used as the input of the feature extraction module in the image segmentation model, and the original image features are output by the feature extraction module. It can be understood that the feature extraction module can obtain the original image features by patch embedding based on convolutional stem or patchify stem.

[0296] 220. Based on the original image feature, obtain a first image feature through an encoder in the image segmentation model, wherein the encoder includes a plurality of local vision modules and a plurality of downsampling layers, the local vision module includes a channel enhancement module, the channel enhancement module is used to generate a channel scaling factor based on the input image feature, and the channel scaling factor is used to correct the channel feature corresponding to the input image feature;

[0297] In one or more embodiments, the original image features are used as inputs of an encoder in an image segmentation model, and the encoder outputs the first image features. The encoder includes a plurality of local vision modules and a plurality of downsampling layers, each of which is used to reduce the image. Each local vision module includes two parts, one of which is a LocalVision-TR module and the other is an ASES. Among them, the ASES includes at least a channel enhancement module.

[0298] Specifically, the channel enhancement module included in each local vision module can output a corresponding channel scaling factor based on the input image features. Based on this, the channel scaling factor is used to correct the channel features corresponding to the input image features. Thus, the purpose of enhancing the channel features is achieved.

[0299] It can be understood that the image segmentation model includes an encoder and a decoder. The original image features are first processed by the encoder and then by the decoder to finally achieve image segmentation. Among them, the encoder enables the image segmentation model to understand the content of the image. As the network layer deepens, the size of the original image features decreases, while the channels increase.

[0300] It should be noted that the Local Vision-TR module in the present application may adopt a window-type visual Transformer, such as CSWin-Transformer, or Shuffle Transformer, or PVTv1, or other forms of Transformer, which are not limited here.

[0301] 230. Based on the first image feature, obtain a second image feature through a decoder in the image segmentation model, wherein the decoder includes a plurality of local vision modules and a plurality of upsampling layers;

[0302] In one or more embodiments, the first image feature is used as an input to a decoder in an image segmentation model, and the second image feature is output by the decoder. The decoder includes a plurality of local vision modules and a plurality of upsampling layers, each of which is used to enlarge the image. Each local vision module includes a Local Vision-TR module and an ASES. ASES includes at least a spatial enhancement module.

[0303] It can be understood that the decoder combines the encoder's understanding of the image content to restore the image's position information. As the network layer deepens, the size of the first image feature increases, while the channels decrease.

[0304] 240. Concatenate the second image feature and the third image feature output by the first local visual module in the encoder to obtain a target image feature, wherein the second image feature is the image feature output by the last local visual module in the decoder;

[0305] In one or more embodiments, the decoder includes a plurality of local vision modules, and the image feature output by the last local vision module is the second image feature. Based on this, the second image feature can be concat with the third image feature output by the first local vision module in the encoder to obtain the target image feature. The concat operation is used to fuse the image features at corresponding positions during upsampling and downsampling, so that the decoder can obtain more high-resolution information when upsampling, thereby more perfectly restoring the detail information in the original image and improving the segmentation accuracy.

[0306] Specifically, the first local visual module in the encoder is jump-connected to the last local visual module in the decoder. The jump connection can introduce feature information at the corresponding scale into the upsampling or deconvolution process, providing multi-scale and multi-level information for subsequent image segmentation, thereby obtaining a more refined segmentation effect.

[0307] 250. Generate a target segmentation image according to the target image features.

[0308] In one or more embodiments, the target image features are mapped to obtain a target segmented image. Exemplarily, in one implementation, mapping can be achieved by transposed convolution, and in another implementation, mapping can be achieved by interpolation and convolution. Taking the use of transposed convolution to achieve mapping as an example, if the original image is a two-dimensional image, a two-dimensional transposed convolution with a kernel size of 2*2 and 1*1 can be used to map the target image features to the size of the original image. If the original image is a three-dimensional image, a three-dimensional transposed convolution with a kernel size of 2*2*2 and 1*1*1 can be used to map the target image features to the size of the original image.

[0309] Specifically, for ease of understanding, see Fig.15 , Fig.15This is another structural diagram of the local vision module in the embodiment of the present application. As shown in the figure, ASES includes a channel enhancement module, and the Local Vision-TR module includes a first normalization layer, an attention module, a second normalization layer and an MLP. Among them, the attention module can adopt W-MSA, and the first normalization layer and the second normalization layer both adopt BN. Residual connections are used for the attention module and MLP respectively to maintain consistent mapping. The channel enhancement module is used for MLP, and the adaptive scaling value is learned from the input features, multiplied with the output of the MLP, and then added to the residual connection of the MLP. That is, it conforms to the form of scaling first and then adding bias.

[0310] In an embodiment of the present application, a method for image segmentation is provided. Through the above method, a channel enhancement module is introduced into the local vision module, and the channel enhancement module can generate a channel scaling factor based on the input image feature. The channel scaling factor can be used to adjust the channel feature corresponding to the image feature, so as to achieve the purpose of enhancing the feature characterization capability. It can be seen that the channel scaling factor is adaptively generated based on the input image feature, which reduces the configuration difficulty of the image segmentation model and improves the configuration efficiency of the image segmentation model.

[0311] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiments of the present application, the local vision module also includes a spatial enhancement module, which generates a spatial scaling factor based on the input image features, and the spatial scaling factor is used to correct the spatial features corresponding to the input image features.

[0312] In one or more embodiments, a method of adding spatial enhancement is introduced. As can be seen from the above embodiments, each local vision module includes a Local Vision-TR module and an ASES. Among them, ASES includes not only a channel enhancement module, but also a spatial enhancement module.

[0313] Specifically, the spatial enhancement module included in each local vision module can output a corresponding spatial scaling factor based on the input image features. Based on this, the spatial features corresponding to the input image features are corrected using the spatial scaling factor, thereby achieving the purpose of enhancing the spatial features.

[0314] Secondly, in the embodiment of the present application, a method of adding spatial enhancement is provided. Through the above method, spatial enhancement shortcuts and spatial enhancement shortcuts are added to the Local Vision-TR backbone network at the same time, thereby improving the performance of Local Vision-TR and facilitating better image segmentation effects.

[0315] The image segmentation device in this application is described in detail below. Fig.16 , Fig.16 This is a schematic diagram of an embodiment of an image segmentation device in an embodiment of the present application. The image segmentation device 30 includes:

[0316] An acquisition module 310 is used to acquire original image features corresponding to the original image;

[0317] The acquisition module 310 is further used to acquire the first image feature through an encoder in the image segmentation model based on the original image feature, wherein the encoder includes a plurality of local vision modules and a plurality of downsampling layers, the local vision module includes a spatial enhancement module, the spatial enhancement module is used to generate a spatial scaling factor based on the input image feature, and the spatial scaling factor is used to correct the spatial feature corresponding to the input image feature;

[0318] The acquisition module 310 is further used to acquire the second image feature through a decoder in the image segmentation model based on the first image feature, wherein the decoder includes a plurality of local vision modules and a plurality of upsampling layers;

[0319] A processing module 320 is used to concatenate the second image feature and the third image feature output by the first local visual module in the encoder to obtain a target image feature, wherein the second image feature is the image feature output by the last local visual module in the decoder;

[0320] The segmentation module 330 is used to generate a target segmentation image according to the target image features.

[0321] Optionally, in the above Fig.16 On the basis of the corresponding embodiment, in another embodiment of the image segmentation device 30 provided in the embodiment of the present application,

[0322] The acquisition module 310 is specifically used to acquire the original image;

[0323] Perform a block operation on the original image to obtain K image blocks, where K is an integer greater than 1;

[0324] Perform convolution operation on each of the K image blocks to obtain K feature vectors;

[0325] Generate original image features based on K feature vectors.

[0326] Optionally, in the above Fig.16 On the basis of the corresponding embodiment, in another embodiment of the image segmentation device 30 provided in the embodiment of the present application,

[0327] An acquisition module 310 is specifically configured to acquire first intermediate image features based on the original image features through a local vision module included in an encoder, wherein the encoder belongs to an image segmentation model;

[0328] Based on the first intermediate image feature, obtaining a second intermediate image feature through a downsampling layer included in the encoder;

[0329] Based on the second intermediate image feature, the first image feature is obtained through the residual module included in the encoder, wherein the residual module included in the encoder includes at least one local visual module, or the residual module included in the encoder includes at least one local visual module and at least one downsampling layer.

[0330] Optionally, in the above Fig.16 On the basis of the corresponding embodiment, in another embodiment of the image segmentation device 30 provided in the embodiment of the present application,

[0331] An acquisition module 310 is specifically configured to acquire a third intermediate image feature based on the first image feature through an upsampling layer included in a decoder, wherein the decoder belongs to an image segmentation model;

[0332] Based on the third intermediate image feature, obtaining a fourth intermediate image feature through a local vision module included in the decoder;

[0333] Based on the fourth intermediate image feature, the second image feature is obtained through the residual module included in the decoder, wherein the residual module included in the decoder includes at least one local visual module, or the residual module included in the decoder includes at least one local visual module and at least one upsampling layer.

[0334] Optionally, in the above Fig.16 On the basis of the corresponding embodiment, in another embodiment of the image segmentation device 30 provided in the embodiment of the present application,

[0335] The segmentation module 330 is specifically used to perform a convolution operation on the original image to obtain a first image feature to be processed;

[0336] Performing a convolution operation on the target image feature to obtain a second image feature to be processed;

[0337] Adding the first image feature to be processed and the second image feature to be processed to obtain a third image feature to be processed;

[0338] A convolution operation is performed on the third image feature to be processed to obtain a target segmented image.

[0339] Optionally, in the above Fig.16 On the basis of the corresponding embodiment, in another embodiment of the image segmentation device 30 provided in the embodiment of the present application, the image segmentation device 30 further includes a training module 340;

[0340] The acquisition module 310 is further used to acquire sample image features corresponding to the sample image, wherein the sample image is an image with region annotation;

[0341] The acquisition module 310 is further used to acquire the first sample image feature through the encoder in the image segmentation model based on the sample image feature;

[0342] The acquisition module 310 is further configured to acquire a second sample image feature through a decoder in the image segmentation model based on the first sample image feature;

[0343] The processing module 320 is further used to concatenate the second sample image feature and the third sample image feature output by the first local vision module in the encoder to obtain the target sample image feature;

[0344] The segmentation module 330 is further used to generate a target segmented sample image according to the sample image and the target sample image features;

[0345] The training module 340 is used to update the model parameters of the image segmentation model according to the target segmentation sample image and the annotated area of ​​the sample image.

[0346] Optionally, in the above Fig.16 On the basis of the corresponding embodiment, in another embodiment of the image segmentation device 30 provided in the embodiment of the present application,

[0347] The acquisition module 310 is specifically used to acquire the original medical image features corresponding to the original medical image, wherein the original medical image is a two-dimensional image or a three-dimensional image;

[0348] The segmentation module 330 is specifically configured to generate and display a target segmented medical image according to the target image features.

[0349] The image segmentation device in this application is described in detail below. Fig.17 , Fig.17 This is a schematic diagram of an embodiment of an image segmentation device in an embodiment of the present application. The image segmentation device 40 includes:

[0350] An acquisition module 410 is used to acquire original image features corresponding to the original image;

[0351] The acquisition module 410 is further used to acquire the first image feature through an encoder in the image segmentation model based on the original image feature, wherein the encoder includes a plurality of local vision modules and a plurality of downsampling layers, the local vision module includes a channel enhancement module, the channel enhancement module is used to generate a channel scaling factor based on the input image feature, and the channel scaling factor is used to correct the channel feature corresponding to the input image feature;

[0352] The acquisition module 410 is further used to acquire the second image feature through a decoder in the image segmentation model based on the first image feature, wherein the decoder includes a plurality of local vision modules and a plurality of upsampling layers;

[0353] A processing module 420 is used to concatenate the second image feature and the third image feature output by the first local visual module in the encoder to obtain a target image feature, wherein the second image feature is the image feature output by the last local visual module in the decoder;

[0354] The segmentation module 430 is used to generate a target segmentation image according to the target image features.

[0355] Fig.18 : is a schematic diagram of a server structure provided in an embodiment of the present application. The server 500 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 522 (for example, one or more processors) and a memory 532, and one or more storage media 530 (for example, one or more mass storage devices) storing application programs 542 or data 544. Among them, the memory 532 and the storage medium 530 can be short-term storage or permanent storage. The program stored in the storage medium 530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 522 can be configured to communicate with the storage medium 530 to execute a series of instruction operations in the storage medium 530 on the server 500.

[0356] The server 500 may also include one or more power supplies 526, one or more wired or wireless network interfaces 550, one or more input and output interfaces 558, and / or one or more operating systems 541, such as Windows Server 2003, ... TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD M etc.

[0357] The steps performed by the server in the above embodiment can be based on the Fig.18 The server structure shown.

[0358] Fig.19 is a schematic diagram of a terminal device structure provided in an embodiment of the present application, such as Fig.19For the sake of convenience, only the parts related to the embodiments of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiments of the present application. In the embodiments of the present application, the terminal device is a smart phone as an example for explanation:

[0359] Fig.19 The block diagram shows a partial structure of a smart phone related to the terminal device provided in the embodiment of the present application. Fig.19 The smart phone includes: a radio frequency (RF) circuit 610, a memory 620, an input unit 630, a display unit 640, a sensor 650, an audio circuit 660, a wireless fidelity (WiFi) module 670, a processor 680, and a power supply 690. Those skilled in the art will appreciate that Fig.19 The structure of the smartphone shown in the figure does not constitute a limitation of the smartphone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0360] Combine the following Fig.19 A detailed introduction to the various components of a smartphone:

[0361] The RF circuit 610 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 680 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit 610 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF circuit 610 can also communicate with the network and other devices through wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to the global system of mobile communication (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), long term evolution (LTE), email, short messaging service (SMS), etc.

[0362] The memory 620 can be used to store software programs and modules. The processor 680 executes various functional applications and data processing of the smartphone by running the software programs and modules stored in the memory 620. The memory 620 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the smartphone (such as audio data, a phone book, etc.), etc. In addition, the memory 620 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0363] The input unit 630 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the smart phone. Specifically, the input unit 630 may include a touch panel 631 and other input devices 632. The touch panel 631, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 631 or near the touch panel 631 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 631 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 680, and can receive and execute commands sent by the processor 680. In addition, the touch panel 631 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 631, the input unit 630 may further include other input devices 632. Specifically, the other input devices 632 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a mouse, a joystick, etc.

[0364] The display unit 640 can be used to display information input by the user or information provided to the user and various menus of the smartphone. The display unit 640 may include a display panel 641. Optionally, the display panel 641 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like. Further, the touch panel 631 may cover the display panel 641. When the touch panel 631 detects a touch operation on or near it, it is transmitted to the processor 680 to determine the type of touch event. Subsequently, the processor 680 provides a corresponding visual output on the display panel 641 according to the type of touch event. Although in Fig.19 In the embodiment, the touch panel 631 and the display panel 641 are used as two independent components to implement the input and output functions of the smartphone, but in some embodiments, the touch panel 631 and the display panel 641 can be integrated to implement the input and output functions of the smartphone.

[0365] The smartphone may also include at least one sensor 650, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 641 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 641 and / or the backlight when the smartphone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the smartphone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in smartphones, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.

[0366] The audio circuit 660, the speaker 661, and the microphone 662 can provide an audio interface between the user and the smartphone. The audio circuit 660 can transmit the received audio data to the speaker 661 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 662 converts the collected sound signal into an electrical signal, which is received by the audio circuit 660 and converted into audio data, and then the audio data is processed by the output processor 680, and then sent to another smartphone through the RF circuit 610, or the audio data is output to the memory 620 for further processing.

[0367] WiFi is a short-range wireless transmission technology. Smartphones can help users send and receive emails, browse web pages, and access streaming media through WiFi module 670. It provides users with wireless broadband Internet access. Fig.19 A WiFi module 670 is shown, but it is understandable that it is not an essential component of the smartphone and can be omitted as needed without changing the essence of the invention.

[0368] The processor 680 is the control center of the smartphone, which uses various interfaces and lines to connect various parts of the entire smartphone, and executes various functions of the smartphone and processes data by running or executing software programs and / or modules stored in the memory 620, and calling data stored in the memory 620. Optionally, the processor 680 may include one or more processing units; optionally, the processor 680 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 680.

[0369] The smart phone also includes a power supply 690 (such as a battery) for supplying power to various components. Optionally, the power supply can be logically connected to the processor 680 through a power management system, so that the power management system can manage charging, discharging, power consumption and other functions.

[0370] Although not shown, the smartphone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.

[0371] The steps performed by the terminal device in the above embodiment can be based on the Fig.19 The terminal device structure shown.

[0372] A computer device is also provided in an embodiment of the present application, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the methods described in the above embodiments are implemented.

[0373] A computer-readable storage medium is also provided in an embodiment of the present application, on which a computer program is stored. When the computer program is executed by a processor, the steps of the methods described in the above embodiments are implemented.

[0374] A computer program product is also provided in an embodiment of the present application, including a computer program, which, when executed by a processor, implements the steps of the methods described in the above embodiments.

[0375] It is understandable that in the specific implementation of the present application, related data such as original medical images are involved. When the above embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0376] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0377] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0378] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0379] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0380] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0381] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for image segmentation, characterized in that: include: Obtaining original image features corresponding to the original image; Based on the original image feature, a first image feature is obtained through an encoder in an image segmentation model, wherein the encoder includes a plurality of local vision modules and a plurality of downsampling layers, the local vision module includes a LocalVision-TR module and an ASES, the Local Vision-TR module is a basic local vision module, and the ASES is an enhanced shortcut for adaptive scaling, wherein the Local Vision-TR module includes a first normalization layer, an attention module, a second normalization layer and a multi-layer perceptron; the ASES includes a spatial enhancement module, the spatial enhancement module is used to generate a spatial scaling factor based on the input image feature, and the spatial scaling factor is used to correct the spatial feature corresponding to the input image feature; Based on the first image feature, obtaining a second image feature through a decoder in the image segmentation model, wherein the decoder includes a plurality of the local vision modules and a plurality of upsampling layers; The second image feature and the third image feature output by the first local visual module in the encoder are concatenated to obtain a target image feature, wherein the second image feature is the image feature output by the last local visual module in the decoder; Generating a target segmentation image according to the target image features; in, The first normalization layer is used to perform normalization processing on the first input feature to obtain a first normalized feature; The attention module is used to perform feature extraction on the first normalized feature to obtain a spatial feature of the first normalized feature; The spatial enhancement module is used to perform a maximum pooling operation and an average pooling operation on the first normalized feature to obtain a target merging result, wherein the target merging result includes a maximum pooling result and an average pooling result; The spatial enhancement module is also used to perform a convolution operation on the target merging result to obtain a convolution result; The spatial enhancement module is further used to calculate the convolution result using an activation function to obtain a target spatial scaling factor, and to correct the spatial feature of the first normalized feature using the target spatial scaling factor to obtain a corrected spatial feature; or, The attention module is used to perform feature extraction on the first input feature to obtain the spatial feature of the first input feature; The spatial enhancement module is used to perform a maximum pooling operation and an average pooling operation on the spatial features of the first input features to obtain a target merging result, wherein the target merging result includes a maximum pooling result and an average pooling result; The spatial enhancement module is also used to perform a convolution operation on the target merging result to obtain a convolution result; The spatial enhancement module is also used to calculate the convolution result using an activation function to obtain a target spatial scaling factor; The first normalization layer is used to perform normalization processing on the modified spatial features, wherein the modified spatial features are obtained by modifying the spatial features of the first input features by using the target spatial scaling factor.

2. The method according to claim 1, characterized in that The local vision module also includes a channel enhancement module, which generates a channel scaling factor based on the input image feature, and the channel scaling factor is used to correct the channel feature corresponding to the input image feature.

3. The method according to claim 2, characterized in that The second normalization layer is used to normalize the second input feature to obtain a second normalized feature; The multilayer perceptron is used to perform feature extraction on the second normalized feature to obtain a channel feature of the second normalized feature; The channel enhancement module is used to perform a maximum pooling operation on the channel features of the second normalized features to obtain a maximum pooling result, and perform an average pooling operation on the channel features of the second normalized features to obtain an average pooling result; The channel enhancement module is also used to perform a convolution operation on the maximum pooling result to obtain a first convolution result, and to perform a convolution operation on the average pooling result to obtain a second convolution result; The channel enhancement module is further used to determine a target convolution result according to the first convolution result and the second convolution result; The channel enhancement module is also used to calculate the target convolution result using an activation function to obtain a target channel scaling factor, and use the target channel scaling factor to correct the channel feature of the second normalized feature to obtain a corrected channel feature.

4. The method according to claim 2, characterized in that: The multilayer perceptron is used to perform feature extraction on the second input feature to obtain a channel feature of the second input feature; The channel enhancement module is used to perform a maximum pooling operation on the channel feature of the second input feature to obtain a maximum pooling result, and perform an average pooling operation on the channel feature of the second input feature to obtain an average pooling result; The channel enhancement module is also used to perform a convolution operation on the maximum pooling result to obtain a first convolution result, and to perform a convolution operation on the average pooling result to obtain a second convolution result; The channel enhancement module is further used to determine a target convolution result according to the first convolution result and the second convolution result; The channel enhancement module is also used to calculate the target convolution result using an activation function to obtain a target channel scaling factor; The second normalization layer is used to perform normalization processing on the corrected channel features, wherein the corrected channel features are obtained by correcting the channel features of the second input features by using the target channel scaling factor.

5. The method according to any one of claims 1 to 4, characterized in that The encoder includes M local visual modules and N downsampling layers, the decoder includes M-1 local visual modules and N upsampling layers, the M-1 local visual modules included in the decoder are jump-connected with the corresponding M-1 local visual modules in the encoder, wherein M is an integer greater than 1, and N is an integer greater than or equal to 1; The image features output by the first local vision module in the encoder are used as the image features input by the first downsampling layer in the encoder; The image features output by the last downsampling layer in the encoder are used as the image features input by the last local vision module in the encoder; The image features output by the last local vision module in the encoder are used as the image features input by the first upsampling layer in the decoder; The image features output by the first upsampling layer in the decoder are used as the image features input by the first local vision module in the decoder; The image features output by the last upsampling layer in the decoder are used as the image features input by the last local vision module in the decoder.

6. The method according to claim 1, characterized in that The obtaining of the original image features corresponding to the original image includes: Acquire the original image; Performing a block operation on the original image to obtain K image blocks, wherein K is an integer greater than 1; Performing a convolution operation on each of the K image blocks to obtain K feature vectors; The original image features are generated according to the K feature vectors.

7. The method according to claim 1, characterized in that The step of obtaining the first image feature based on the original image feature by using an encoder in the image segmentation model includes: Based on the original image feature, obtaining a first intermediate image feature through the local vision module included in the encoder, wherein the encoder belongs to the image segmentation model; Based on the first intermediate image feature, obtaining a second intermediate image feature through the downsampling layer included in the encoder; Based on the second intermediate image feature, the first image feature is obtained through the residual module included in the encoder, wherein the residual module included in the encoder includes at least one of the local vision modules, or the residual module included in the encoder includes at least one of the local vision modules and at least one of the downsampling layers.

8. The method according to claim 1, characterized in that The acquiring, based on the first image feature, a second image feature through a decoder in the image segmentation model comprises: Based on the first image feature, obtaining a third intermediate image feature through the upsampling layer included in the decoder, wherein the decoder belongs to the image segmentation model; Based on the third intermediate image feature, obtaining a fourth intermediate image feature through the local vision module included in the decoder; Based on the fourth intermediate image feature, the second image feature is obtained through the residual module included in the decoder, wherein the residual module included in the decoder includes at least one of the local visual modules, or the residual module included in the decoder includes at least one of the local visual modules and at least one of the upsampling layers.

9. The method according to claim 1, characterized in that: The step of generating a target segmented image according to the target image features comprises: Performing a convolution operation on the original image to obtain a first image feature to be processed; Performing a convolution operation on the target image feature to obtain a second image feature to be processed; Adding the first to-be-processed image feature and the second to-be-processed image feature to obtain a third to-be-processed image feature; A convolution operation is performed on the third image feature to be processed to obtain the target segmented image.

10. The method according to claim 1, characterized in that The method further comprises: Acquire a sample image feature corresponding to a sample image, wherein the sample image is an image with region annotation; Based on the sample image feature, obtaining a first sample image feature through an encoder in the image segmentation model; Based on the first sample image feature, obtaining a second sample image feature through a decoder in the image segmentation model; splicing the second sample image feature and the third sample image feature output by the first local vision module in the encoder to obtain a target sample image feature; Generate a target segmented sample image according to the sample image and the target sample image features; The model parameters of the image segmentation model are updated according to the target segmentation sample image and the annotated area of ​​the sample image.

11. The method according to claim 1, characterized in that: The obtaining of the original image features corresponding to the original image includes: Acquire an original medical image feature corresponding to the original medical image, wherein the original medical image is a two-dimensional image or a three-dimensional image; The step of generating a target segmented image according to the target image features comprises: According to the target image features, a target segmented medical image is generated and displayed.

12. A method for image segmentation, characterized in that: include: Obtaining original image features corresponding to the original image; Based on the original image feature, a first image feature is obtained through an encoder in an image segmentation model, wherein the encoder includes a plurality of local vision modules and a plurality of downsampling layers, the local vision module includes a LocalVision-TR module and an ASES, the Local Vision-TR module is a basic local vision module, and the ASES is an enhanced shortcut for adaptive scaling, wherein the Local Vision-TR module includes a first normalization layer, an attention module, a second normalization layer and a multi-layer perceptron; the ASES includes a channel enhancement module, the channel enhancement module is used to generate a channel scaling factor based on the input image feature, and the channel scaling factor is used to correct the channel feature corresponding to the input image feature; Based on the first image feature, obtaining a second image feature through a decoder in the image segmentation model, wherein the decoder includes a plurality of the local vision modules and a plurality of upsampling layers; The second image feature and the third image feature output by the first local visual module in the encoder are concatenated to obtain a target image feature, wherein the second image feature is the image feature output by the last local visual module in the decoder; Generating a target segmentation image according to the target image features; in, The second normalization layer is used to normalize the second input feature to obtain a second normalized feature; The multilayer perceptron is used to perform feature extraction on the second normalized feature to obtain a channel feature of the second normalized feature; The channel enhancement module is used to perform a maximum pooling operation on the channel features of the second normalized features to obtain a maximum pooling result, and perform an average pooling operation on the channel features of the second normalized features to obtain an average pooling result; The channel enhancement module is also used to perform a convolution operation on the maximum pooling result to obtain a first convolution result, and to perform a convolution operation on the average pooling result to obtain a second convolution result; The channel enhancement module is further used to determine a target convolution result according to the first convolution result and the second convolution result; The channel enhancement module is also used to calculate the target convolution result using an activation function to obtain a target channel scaling factor, and to correct the channel feature of the second normalized feature using the target channel scaling factor to obtain a corrected channel feature; or, The multilayer perceptron is used to perform feature extraction on the second input feature to obtain a channel feature of the second input feature; The channel enhancement module is used to perform a maximum pooling operation on the channel feature of the second input feature to obtain a maximum pooling result, and perform an average pooling operation on the channel feature of the second input feature to obtain an average pooling result; The channel enhancement module is also used to perform a convolution operation on the maximum pooling result to obtain a first convolution result, and to perform a convolution operation on the average pooling result to obtain a second convolution result; The channel enhancement module is further used to determine a target convolution result according to the first convolution result and the second convolution result; The channel enhancement module is also used to calculate the target convolution result using an activation function to obtain a target channel scaling factor; The second normalization layer is used to perform normalization processing on the corrected channel features, wherein the corrected channel features are obtained by correcting the channel features of the second input features by using the target channel scaling factor.

13. The method according to claim 12, characterized in that The local vision module also includes a spatial enhancement module, which generates a spatial scaling factor based on the input image feature, and the spatial scaling factor is used to correct the spatial feature corresponding to the input image feature.

14. An image segmentation device, characterized in that: include: An acquisition module, used for acquiring original image features corresponding to the original image; The acquisition module is further used to acquire the first image feature through the encoder in the image segmentation model based on the original image feature, wherein the encoder includes a plurality of local vision modules and a plurality of downsampling layers, the local vision module includes a Local Vision-TR module and an ASES, the Local Vision-TR module is a basic local vision module, and the ASES is an enhanced shortcut for adaptive scaling, wherein the Local Vision-TR module includes a first normalization layer, an attention module, a second normalization layer and a multi-layer perceptron; the ASES includes a spatial enhancement module, the spatial enhancement module is used to generate a spatial scaling factor based on the input image feature, and the spatial scaling factor is used to correct the spatial feature corresponding to the input image feature; The acquisition module is further used to acquire a second image feature through a decoder in the image segmentation model based on the first image feature, wherein the decoder includes a plurality of the local vision modules and a plurality of upsampling layers; a processing module, configured to concatenate the second image feature with a third image feature output by the first local visual module in the encoder to obtain a target image feature, wherein the second image feature is an image feature output by the last local visual module in the decoder; A segmentation module, used for generating a target segmentation image according to the target image features; in, The first normalization layer is used to perform normalization processing on the first input feature to obtain a first normalized feature; The attention module is used to perform feature extraction on the first normalized feature to obtain a spatial feature of the first normalized feature; The spatial enhancement module is used to perform a maximum pooling operation and an average pooling operation on the first normalized feature to obtain a target merging result, wherein the target merging result includes a maximum pooling result and an average pooling result; The spatial enhancement module is also used to perform a convolution operation on the target merging result to obtain a convolution result; The spatial enhancement module is further used to calculate the convolution result using an activation function to obtain a target spatial scaling factor, and to correct the spatial feature of the first normalized feature using the target spatial scaling factor to obtain a corrected spatial feature; or, The attention module is used to perform feature extraction on the first input feature to obtain the spatial feature of the first input feature; The spatial enhancement module is used to perform a maximum pooling operation and an average pooling operation on the spatial features of the first input features to obtain a target merging result, wherein the target merging result includes a maximum pooling result and an average pooling result; The spatial enhancement module is also used to perform a convolution operation on the target merging result to obtain a convolution result; The spatial enhancement module is also used to calculate the convolution result using an activation function to obtain a target spatial scaling factor; The first normalization layer is used to perform normalization processing on the modified spatial features, wherein the modified spatial features are obtained by modifying the spatial features of the first input features by using the target spatial scaling factor.

15. An image segmentation device, characterized in that: include: An acquisition module, used for acquiring original image features corresponding to the original image; The acquisition module is further used to acquire the first image feature through the encoder in the image segmentation model based on the original image feature, wherein the encoder includes a plurality of local vision modules and a plurality of downsampling layers, the local vision module includes a Local Vision-TR module and an ASES, the Local Vision-TR module is a basic local vision module, and the ASES is an enhanced shortcut for adaptive scaling, wherein the Local Vision-TR module includes a first normalization layer, an attention module, a second normalization layer and a multi-layer perceptron; the ASES includes a channel enhancement module, the channel enhancement module is used to generate a channel scaling factor based on the input image feature, and the channel scaling factor is used to correct the channel feature corresponding to the input image feature; The acquisition module is further used to acquire a second image feature through a decoder in the image segmentation model based on the first image feature, wherein the decoder includes a plurality of the local vision modules and a plurality of upsampling layers; a processing module, configured to concatenate the second image feature with a third image feature output by the first local visual module in the encoder to obtain a target image feature, wherein the second image feature is an image feature output by the last local visual module in the decoder; A segmentation module, used for generating a target segmentation image according to the target image features; in, The second normalization layer is used to normalize the second input feature to obtain a second normalized feature; The multilayer perceptron is used to perform feature extraction on the second normalized feature to obtain a channel feature of the second normalized feature; The channel enhancement module is used to perform a maximum pooling operation on the channel features of the second normalized features to obtain a maximum pooling result, and perform an average pooling operation on the channel features of the second normalized features to obtain an average pooling result; The channel enhancement module is also used to perform a convolution operation on the maximum pooling result to obtain a first convolution result, and to perform a convolution operation on the average pooling result to obtain a second convolution result; The channel enhancement module is further used to determine a target convolution result according to the first convolution result and the second convolution result; The channel enhancement module is also used to calculate the target convolution result using an activation function to obtain a target channel scaling factor, and to correct the channel feature of the second normalized feature using the target channel scaling factor to obtain a corrected channel feature; or, The multilayer perceptron is used to perform feature extraction on the second input feature to obtain a channel feature of the second input feature; The channel enhancement module is used to perform a maximum pooling operation on the channel feature of the second input feature to obtain a maximum pooling result, and perform an average pooling operation on the channel feature of the second input feature to obtain an average pooling result; The channel enhancement module is also used to perform a convolution operation on the maximum pooling result to obtain a first convolution result, and to perform a convolution operation on the average pooling result to obtain a second convolution result; The channel enhancement module is further used to determine a target convolution result according to the first convolution result and the second convolution result; The channel enhancement module is also used to calculate the target convolution result using an activation function to obtain a target channel scaling factor; The second normalization layer is used to perform normalization processing on the corrected channel features, wherein the corrected channel features are obtained by correcting the channel features of the second input features by using the target channel scaling factor.

16. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the processor implements the steps of the method according to any one of claims 1 to 11, or implements the steps of the method according to any one of claims 12 to 13.

17. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 11, or the computer program implements the steps of the method according to any one of claims 12 to 13.

18. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 11, or implements the steps of the method according to any one of claims 12 to 13.

Citation Information

Patent Citations

  • Micro-hemorrhage focus segmentation method based on convolutional neural network

    CN112927243A

  • Text recognition and model training method and device, equipment and storage medium

    CN113221879A

  • Three-dimensional CBCT tooth image segmentation method based on feature transformation

    CN113744275A

  • Pulmonary nodule image detection method and system based on CT image

    CN113888466A