Image segmentation model training method, segmentation method and device based on artificial intelligence

Combining multi-scale feature extraction in medical image segmentation through a locally guided global attention mechanism network solves the problems of high computational cost and difficulty in local information extraction, and improves the efficiency and accuracy of medical image segmentation.

CN118397281BActive Publication Date: 2024-09-17湖南工商大学
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410814007.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-09-17
Estimated Expiration
2044-06-24

AI Technical Summary

Technical Problem

Existing technologies in medical image segmentation have problems such as high computational cost, the need for pre-training parameter initialization, and the inability to effectively extract local information, resulting in low efficiency and low accuracy.

Method used

Using an artificial intelligence-based image segmentation model training method, the local guided global attention mechanism network (LGG module) is combined with the multi-scale local feature extraction module and the global feature extraction module to generate global and local feature modulation weights for feature weighting and reweighting. , connect the channel dimensions, and train the medical image segmentation model.

Benefits of technology

It improves the efficiency and recognition accuracy of medical image segmentation, avoids the problem of requiring a large amount of data pre-training caused by the Transformer's lack of inductive bias, and enhances the ability to extract local detail information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118397281B
    Figure CN118397281B
Patent Text Reader

Abstract

The present invention discloses an image segmentation model training method based on artificial intelligence, a segmentation method and a device, comprising: obtaining training sample data, the training sample data being historical medical images; inputting the training sample data into an initial medical image segmentation model, the initial medical image segmentation model being a local guidance global attention mechanism network, the local guidance global attention mechanism network being composed of LGG modules, the LGG modules comprising a multi-scale local feature extraction module; using the multi-scale local feature extraction module to extract features from an input feature map to obtain multi-scale local features; based on the multi-scale local features, guiding the generation of weights of a global attention mechanism network, using the generated weights to weight feature values, and extracting global features; using the training sample data to train the local guidance global attention mechanism network to obtain a trained medical image segmentation model. The present invention improves the efficiency and recognition accuracy of medical image segmentation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing, and in particular to an image segmentation model training method, a segmentation method and a device based on artificial intelligence. Background Art

[0002] Automatic segmentation of medical images is an important component of computer-aided diagnosis systems and smart healthcare. With the introduction of deep learning, especially convolutional neural networks, the accuracy of various medical image analysis tasks has been greatly improved compared to traditional methods. Convolutional neural networks have inductive bias characteristics and can effectively extract local information of images with lower parameters through weight sharing. However, convolutional neural networks cannot extract long-distance dependencies between image pixels. Directly using larger convolution kernels will introduce a large amount of computation and parameters, while stacking smaller convolution kernels to expand the receptive field may lead to the problem of gradient vanishing due to the deepening of the network. Although some studies are committed to modeling long-distance dependencies by decomposing larger convolution kernels, they cannot compare with the global dependency modeling capabilities of Transformer in terms of efficiency.

[0003] Transformer has excellent long-distance dependency modeling capabilities in the field of natural language processing. It can be used in the field of computer vision to extract global dependencies between image pixels. Due to its powerful global dependency modeling capabilities, Transformer has been widely used in computer vision tasks such as image classification, object detection, and semantic segmentation. However, in the field of computer vision, Transformer also has obvious defects. First, the computational complexity of the model is quadratically related to the number of pixels in the input feature map. Especially for images with larger resolutions, model training is extremely time-consuming and consumes more video memory. Although some methods for reducing the computational complexity of the model, such as axial attention and reducing sequence length through convolution or pooling, have been proposed, they will lose some of the representation capabilities of global dependencies compared to the original multi-head self-attention. Secondly, due to the lack of inductive bias characteristics, models built on Transformer require more training data to have better generalization capabilities. In natural images, models are often initialized using parameters pre-trained on datasets such as ImageNet. Although this method can achieve certain performance improvements, it cannot achieve end-to-end training. The model training process is relatively complicated. In addition, there is a large gap between medical images and natural images due to the different imaging methods. Currently, there are few medical image datasets with large data volumes. There are also large differences between images of different body parts or different modalities. Pre-training The training initialization method is prone to performance bottlenecks, resulting in insufficient accuracy in medical image segmentation using this method; in addition, Transformer cannot effectively extract local detail information. Since it was proposed, Transformer has been widely used in natural image processing tasks. Since the target area of ​​natural images is generally large in size, with clear boundaries and distinct contrast, Transformer has good advantages for image classification, target detection and image segmentation tasks. However, for medical image analysis, CT and MRI images have blurred boundaries, low contrast and are difficult to distinguish, and the target area itself is small. At this time, local detail information is crucial. However, Transformer does not have effective local information extraction capabilities. Therefore, it does not have an advantage over convolutional neural networks for more complex CT and MRI images. In addition, there are studies that use the FFN module in the Transformer structure to model local dependencies, but these practices cannot obtain good performance without using pre-trained parameters to initialize the Transformer layer.

[0004] In the process of realizing the present invention, the inventors realized that the prior art has at least the following technical problems: when performing medical image segmentation based on the existing method, there are difficulties such as high computational cost, the need for pre-trained parameter initialization, and the inability to effectively extract local information, which makes the efficiency of medical image segmentation low and its accuracy does not meet the requirements. Summary of the invention

[0005] Embodiments of the present invention provide an artificial intelligence-based image segmentation model training method, an artificial intelligence-based image segmentation method, an apparatus, a computer device, and a storage medium to improve the accuracy of medical image segmentation.

[0006] In order to solve the above technical problems, the embodiment of the present application provides an image segmentation model training method based on artificial intelligence, including:

[0007] Acquire training sample data, wherein the training sample data is historical medical images;

[0008] Inputting the training sample data into an initial medical image segmentation model to obtain an input feature map, wherein the initial medical image segmentation model is a local guided global attention mechanism network, and the local guided global attention mechanism network is composed of an LGG module, including a multi-scale local feature extraction module, a global feature extraction module, and a local-global feature interactive fusion module;

[0009] The multi-scale local feature extraction module is used to extract features from the input feature map to obtain multi-scale local features; based on the multi-scale local features, the self-attention weight generation in the global feature extraction layer is guided; the input feature value of the global feature extraction layer is weighted by the attention weight to obtain the global feature;

[0010] Generate a global feature modulation weight based on the multi-scale local feature, generate a local feature modulation weight based on the global feature, re-weight the global feature in spatial position using the global feature modulation weight, and re-weight the multi-scale local feature in spatial position using the local feature modulation weight;

[0011] The weighted multi-scale local features and global features are connected in the channel dimension, and the local guided global attention mechanism network is trained using the training sample data to obtain a trained medical image segmentation model.

[0012] Optionally, the using the multi-scale local feature extraction module to extract features from the input feature map to obtain the multi-scale local features includes:

[0013] In the encoder, semantic information of different levels is extracted through several LGG feature extraction layers and downsampling operations, and the feature map resolution is restored through several multi-scale LGG feature extraction layers and upsampling operations in the decoder. Among them, multi-scale local-global feature extraction layers of the same resolution are used to store and transfer multi-head self-attention values ​​through contextual attention state perception variables.

[0014] Optionally, the multi-scale LGG feature extraction layer is constructed as a whole through a modulation structure and adopts a residual connection, the local modulation weight is generated by the extracted global feature, the global modulation weight is generated by the extracted multi-scale local feature, the multi-scale local feature and the global feature are modulated and connected in the channel dimension, and after the channel connection operation, a Convolution performs adaptive selection of feature map channels.

[0015] Optionally, the LGG module adopts a parallel local to global progressive multi-scale interaction strategy to extract information of different scales; wherein adopting a parallel local to global progressive multi-scale interaction strategy to extract information of different scales includes:

[0016] The input feature map is divided into 2 groups in the channel dimension, namely:

[0017] ;

[0018] in represents the input feature map, , Represents the two sets of features after segmentation, It means segmentation in the channel dimension. The two groups of features after the input feature map segmentation use the receptive field as , , The scale of the multi-scale local features is extracted and the global receptive field is used to extract the global features;

[0019] For groups with non-global receptive fields, use stacking The multi-scale local features are extracted by convolution, which is expressed as follows:

[0020] ;

[0021] ;

[0022] ;

[0023] .

[0024] in , , Respectively represent the extracted , , Scale local features, Represents the fused multi-scale local features. The extracted multi-scale local features are then used as part of the Q value in the Transformer self-attention structure. The second group then calculates the global dependency and uses it based on the multi-scale local features. Convolution generates global feature modulation weights, based on global features using Convolution generates local feature modulation weights, uses global feature modulation weights to reweight the global features in spatial position, uses local feature modulation weights to reweight the multi-scale local features in spatial position, and then connects the obtained multi-scale local features and global information in the channel dimension:

[0025] ;

[0026] ;

[0027] ;

[0028] ;

[0029] ;

[0030] ;

[0031] .

[0032] in, represents the extracted global features, represents an efficient attention module for global feature extraction, , They represent the generated local modulation weights and global modulation weights respectively.

[0033] Optionally, the LGET efficient attention module first downsamples the Q value by a kernel size The convolution with a stride of 2 halves the resolution without changing the number of channels, thereby reducing the computational cost of the self-attention mechanism. Convolution maps the input feature map to obtain K and V respectively. , , Perform shape transformation, where Depend on Transform to , K and V are given by Transform to , where B, C, H, and W represent the batch size, number of channels, width, and height of the feature map, respectively. and , Represents the number of attention heads.

[0034] In order to solve the above technical problems, the embodiment of the present application provides an image segmentation method based on artificial intelligence, including:

[0035] Acquire a medical image to be segmented;

[0036] The medical image is preprocessed to obtain a standard image, and the standard image is input into a trained medical image segmentation model to obtain an image segmentation result, wherein the trained medical image segmentation model is trained according to the above-mentioned artificial intelligence-based image segmentation model training method.

[0037] In order to solve the above technical problems, the embodiment of the present application further provides an image segmentation model training device based on artificial intelligence, comprising:

[0038] A sample acquisition module, used to acquire training sample data, wherein the training sample data is historical medical images;

[0039] A sample input module is used to input the training sample data into an initial medical image segmentation model to obtain an input feature map. The initial medical image segmentation model is a local guided global attention mechanism network. The local guided global attention mechanism network is composed of LGG modules, including a multi-scale local feature extraction module, a global feature extraction module, and a local-global feature interaction fusion module;

[0040] A feature extraction module, used to extract features from the training sample data using the LGG feature extraction layer to obtain local-global fusion features;

[0041] The model training module is used to use the training sample data to train the local-guided-global attention mechanism network to obtain a trained medical image segmentation model.

[0042] In order to solve the above technical problems, the embodiment of the present application further provides an image segmentation device based on artificial intelligence, comprising:

[0043] An image acquisition module, used for acquiring a medical image to be segmented;

[0044] The image segmentation module is used to preprocess the medical image to obtain a standard image, and input the standard image into a trained medical image segmentation model to obtain an image segmentation result.

[0045] In order to solve the above technical problems, an embodiment of the present application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the above-mentioned artificial intelligence-based image segmentation model training method are implemented, or when the processor executes the computer program, the steps of the above-mentioned artificial intelligence-based image segmentation method are implemented.

[0046] In order to solve the above technical problems, an embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of the above-mentioned artificial intelligence-based image segmentation model training method, or when the computer program is executed by a processor, it implements the steps of the above-mentioned artificial intelligence-based image segmentation method.

[0047] The artificial intelligence-based image segmentation model training method, artificial intelligence-based image segmentation method, device, computer equipment and storage medium provided in the embodiments of the present invention obtain training sample data, the training sample data is a historical medical image; the training sample data is input into the initial medical image segmentation model to obtain an input feature map, the initial medical image segmentation model is a local guided global attention mechanism network, the local guided global attention mechanism network is composed of LGG modules, the LGG module is used for feature extraction, including a multi-scale local feature extraction module, a global feature extraction module, and a local-global feature interactive fusion module; the multi-scale local feature extraction module is used to extract features from the input feature map to obtain to multi-scale local features; based on the multi-scale local features, guide the generation of global attention mechanism network weights, use the generated weights to weight the feature values, and extract global features; generate global feature modulation weights based on the multi-scale local features, generate local feature modulation weights based on the global features, use the global feature modulation weights to re-weight the global features in spatial position, and use the local feature modulation weights to re-weight the multi-scale local features in spatial position; connect the weighted multi-scale local features and global features in the channel dimension, and use the training sample data to train the local guidance global attention mechanism network to obtain a trained medical image segmentation model. The multi-scale local features extracted by the convolutional neural network guide the generation of self-attention weights of the Transformer, thereby avoiding the defect that the Transformer lacks inductive bias and requires a large amount of data pre-training, and improving the efficiency and recognition accuracy of the image segmentation model. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0049] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0050] Figure 2 It is a flowchart of an embodiment of the artificial intelligence-based image segmentation model training method of the present application;

[0051] Figure 3 : is a schematic diagram of the network structure of the local guidance global attention mechanism in one embodiment of the artificial intelligence-based image segmentation model training method of the present application, wherein: Figure 3 (a) is a schematic diagram of the overall structure. Figure 3 (b) is a schematic diagram of the convolutional stem module structure. Figure 3 (c) is a schematic diagram of the overlappable position encoding module. Figure 3 (d) is a schematic diagram of the Patch combination module structure. Figure 3 (e) is a schematic diagram of the Patch decomposition module structure. Figure 3 (f) is a schematic diagram of the segmentation head module structure;

[0052] Figure 4 It is a schematic diagram of the structure of the Local Guided Global module of this application;

[0053] Figure 5 is a flow chart of an embodiment of the artificial intelligence-based image segmentation method of the present application;

[0054] Figure 6 It is a structural schematic diagram of an embodiment of an image segmentation model training device based on artificial intelligence according to the present application;

[0055] Figure 7 is a structural schematic diagram of an embodiment of an artificial intelligence-based image segmentation device according to the present application;

[0056] Figure 8 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0058] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0059] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0060] See also Figure 1 ,like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0061] Users can use terminal devices 101 , 102 , 103 to interact with server 105 via network 104 to receive or send messages, etc.

[0062] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV), laptop computers, desktop computers, etc.

[0063] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .

[0064] It should be noted that the artificial intelligence-based image segmentation method provided in the embodiment of the present application is executed by a server, and accordingly, the artificial intelligence-based image segmentation device is arranged in the server.

[0065] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. The terminal devices 101, 102, 103 in the embodiment of the present application may specifically correspond to application systems in actual production.

[0066] See also Figure 2 , Figure 2 An artificial intelligence-based image segmentation model training method provided by an embodiment of the present invention is shown. Figure 1 The server in is used as an example to illustrate the details as follows:

[0067] S201: Acquire training sample data, where the training sample data is historical medical images.

[0068] Specifically, after acquiring the historical medical images, this embodiment preprocesses the medical images to obtain standard images, and then uses the standard images as training sample data, specifically including:

[0069] Step 1: Data division: Get the target image and divide it into training set, validation set and test set according to appropriate proportions.

[0070] Step 2: Slice extraction. CT and MRI are common medical image modalities, both of which are in 3D form. Directly using 3D images for training and reasoning will result in high computational overhead. A common practice is to extract 2D slices for training and reasoning, and connect the slices in sequence when obtaining the reasoning results to form a 3D image. Therefore, in order to facilitate model training and reasoning, all 3D medical images and their corresponding labels need to be converted into 2D slices.

[0071] Step 3: Label conversion. During model training and testing, a label map in the form of digital categories is required. Therefore, for datasets whose label maps are pixel values ​​and not set according to the number of categories, their labels need to be converted into digital categories.

[0072] Step 4: Image scaling. Higher resolution will lead to higher computational cost during model training, so in this embodiment, all training images are uniformly scaled to resolution, reducing the computational complexity of the training process.

[0073] Step 5: Data enhancement. Medical image datasets generally have a small number of samples. An effective data enhancement strategy can significantly improve the generalization ability of the model. This embodiment uses a combination of multiple image enhancement strategies, including random rotation, vertical flip, upside down flip, random brightness, and random contrast.

[0074] Step 6: Standardization: Standardize the training images, validation images, and test images.

[0075] S202: Input the training sample data into the initial medical image segmentation model to obtain an input feature map. The initial medical image segmentation model is a local guided global attention mechanism network. The local guided global attention mechanism network is composed of LGG modules, including a multi-scale local feature extraction module, a global feature extraction module, and a local-global feature interactive fusion module.

[0076] In this embodiment, the overall structure of the model is as follows: Figure 3 As shown in the figure, the model follows the encoder-decoder structure. The encoder extracts semantic information at different levels, and the decoder gradually restores the feature map resolution. The low-level semantic information on the encoder side and the high-level semantic information on the decoder side are fused through jump connections. Initially, a three- The convolutional stem module composed of convolutions extracts the global structural information of the image, where the middle one Convolution also reduces the resolution of the feature map and reduces the computational complexity of subsequent modules of the model. , stride 2, and padding 1 convolution operations divide the feature map into multiple overlapping patch blocks, while further reducing the resolution of the feature map. This embodiment further adopts the LGG (Local Guided Global) module to extract multi-scale local and global information. In the encoder, semantic information of different levels is extracted through a series of LGG modules and downsampling operations, and the feature map resolution is gradually restored through a series of LGG modules and upsampling operations in the decoder, where the downsampling and upsampling operations are implemented by the PatchCombining combination function and the PatchDecomposing decomposition function, respectively. A contextual attention state perception variable is used to store and transfer multi-head self-attention values ​​between LGG modules of the same resolution.

[0077] S203: Using the multi-scale local feature extraction module to extract features from the input feature map to obtain multi-scale local features.

[0078] Specifically, the multi-scale local feature extraction module is used to extract features from the input feature map to obtain multi-scale local features including:

[0079] In the encoder, semantic information of different levels is extracted through several LGG feature extraction layers and downsampling operations, and the feature map resolution is restored through several multi-scale LGG feature extraction layers and upsampling operations in the decoder. Among them, multi-scale local-global feature extraction layers of the same resolution are used to store and transfer multi-head self-attention values ​​through contextual attention state perception variables.

[0080] Preferably, the multi-scale LGG feature extraction layer is constructed by a modulation structure as a whole, and a residual connection is adopted, the local modulation weight is generated by the extracted global feature, the global modulation weight is generated by the extracted multi-scale local feature, the multi-scale local feature and the global feature are modulated and connected in the channel dimension, and after the channel connection operation, a Convolution performs adaptive selection of feature map channels.

[0081] Preferably, the LGG module adopts a parallel local to global progressive multi-scale interaction strategy to extract information of different scales; wherein, adopting a parallel local to global progressive multi-scale interaction strategy to extract information of different scales includes:

[0082] The input feature map is divided into 2 groups in the channel dimension, namely:

[0083] ;

[0084] in, represents the input feature map, , Represents the two sets of features after segmentation, It means segmentation in the channel dimension. The two groups of features after the input feature map segmentation use the receptive field as , , The scale of the multi-scale local features is extracted and the global receptive field is used to extract the global features;

[0085] For groups with non-global receptive fields, use stacking The multi-scale local features are extracted by convolution, which is expressed as follows:

[0086] ;

[0087] ;

[0088] ;

[0089] ;

[0090] in , , Respectively represent the extracted , , Scale local features, Represents the fused multi-scale local features. The extracted multi-scale local features are then used as part of the Q value in the Transformer self-attention structure. The second group then calculates the global dependency and uses it based on the multi-scale local features. Convolution generates global feature modulation weights, based on global features using Convolution generates local feature modulation weights, uses global feature modulation weights to reweight the global features in spatial position, uses local feature modulation weights to reweight the multi-scale local features in spatial position, and then connects the obtained multi-scale local features and global information in the channel dimension:

[0091] ;

[0092] ;

[0093] ;

[0094] ;

[0095] ;

[0096] ;

[0097] ;

[0098] in, represents the extracted global features, represents an efficient attention module for global feature extraction, , They represent the generated local modulation weights and global modulation weights respectively.

[0099] Preferably, the LGET efficient attention module first downsamples the Q value by a kernel size The convolution with a stride of 2 halves the resolution without changing the number of channels, thereby reducing the computational cost of the self-attention mechanism. Convolution maps the input feature map to obtain K and V respectively. , , Perform shape transformation, where Depend on Transform to , K and V are given by Transform to , where B, C, H, and W represent the batch size, number of channels, width, and height of the feature map, respectively. and , Represents the number of attention heads.

[0100] In a specific embodiment, Figure 4 As shown in the figure, the LGG module is constructed through a modulation structure as a whole, and the gradient vanishing problem is avoided through residual connection. The global modulation weight and local modulation weight are generated through multi-scale local features and global information respectively. The modulation weights are used to re-weight the global features and local features in the spatial dimension respectively. After the modulation operation, the multi-scale local and global features are connected in the channel dimension. Compared with the convolutional network that can only extract local information and the Transformer structure that can only model long-distance dependencies, the LGG module integrates multi-scale local features and the Transformer's long-distance dependency modeling capabilities in the feature extraction module, and then uses a Convolution performs adaptive channel selection.

[0101] The LGG (Local Guided Global) module adopts a parallel local-to-global progressive multi-scale interaction strategy to extract information at different scales. Figure 4 As shown, the input feature map is first divided into 2 groups in the channel dimension, namely:

[0102] ;

[0103] Then the first group used a serial multi-scale feature extraction strategy to extract local information of different scales, and the second group used Transformer’s self-attention to extract global-scale semantic information. Finally, the extracted multi-scale local semantic information was connected with the global semantic information in the channel dimension.

[0104] In the specific implementation, the two groups of features after the input feature map segmentation use the receptive field as , , Extract multi-scale local features and use the global receptive field to extract global features. For groups with non-global receptive fields, we use stacking The convolution method achieves a larger receptive field.

[0105] ;

[0106] ;

[0107] ;

[0108] ;

[0109] like Figure 4 As shown, the extracted multi-scale local features are then used as part of the Q value in the Transformer self-attention structure, and the global dependencies are then calculated by group 2.

[0110] ;

[0111] ;

[0112] The above-mentioned scale-by-scale feature enhancement method can force the model to extract richer semantic information.

[0113] S204: Based on the use of multi-scale local features Convolution generates global feature modulation weights, based on global features using Convolution generates local feature modulation weights, global feature modulation weights are used to re-weight the global features in spatial position, and local feature modulation weights are used to re-weight the multi-scale local features in spatial position.

[0114] ;

[0115] ;

[0116] ;

[0117] .

[0118] S205: Connect the obtained multi-scale local features and global information in the channel dimension, and use the training sample data to train the local-guided-global attention mechanism network to obtain a trained medical image segmentation model.

[0119] Specifically, this application uses cross entropy loss as the loss function during model training. The cross entropy loss function is used to measure the difference between the probability distribution of the model prediction output and the true distribution, and its calculation method is as follows:

[0120] ;

[0121] in represents the total number of categories, represents the actual distribution, Represents the predicted probability distribution, so the total loss function calculation expression is as follows:

[0122] .

[0123] Furthermore, the optimizer of this application adopts the AdamW optimizer. The AdamW optimizer adds weight decay regularization to achieve decoupling and better performance, in order to solve the problem that the L2 regularization of the Adam optimizer encounters unsatisfactory effects after the adaptive learning rate. The initial learning rate of the optimizer is set to 0.0006, and the weight decay parameter is set to 0.01. During the training process of the model, the learning rate gradually decreases to 0. During the training phase, the initial 1500 selections are used as the Warm Up phase, and the initial learning rate of the Warm Up phase is set to 1e-6.

[0124] In this embodiment, training sample data is obtained, and the training sample data is a historical medical image; the training sample data is input into an initial medical image segmentation model to obtain an input feature map, and the initial medical image segmentation model is a local guided global attention mechanism network, and the local guided global attention mechanism network is composed of an LGG module, and the LGG module is used for feature extraction, including a multi-scale local feature extraction module, a global feature extraction module, and a local-global feature interactive fusion module; the multi-scale local feature extraction module is used to extract features from the input feature map to obtain multi-scale local features; based on the multi-scale local features, the global attention mechanism network weight generation is guided, and the feature values ​​are weighted using the generated weights to extract global features; global feature modulation weights are generated based on the multi-scale local features, local feature modulation weights are generated based on the global features, the global feature modulation weights are used to re-weight the global features in spatial positions, and the local feature modulation weights are used to re-weight the multi-scale local features in spatial positions; the weighted multi-scale local features and global features are connected in the channel dimension, and the local guided global attention mechanism network is trained using the training sample data to obtain a trained medical image segmentation model. The multi-scale local features extracted by the convolutional neural network are used to guide the generation of Transformer's self-attention weights, thereby avoiding the defect that Transformer lacks inductive bias and requires a large amount of data pre-training, and improving the efficiency and recognition accuracy of the image segmentation model.

[0125] See also Figure 5 , Figure 5 An artificial intelligence-based image segmentation method provided by an embodiment of the present invention is shown. Figure 1 The server in is used as an example to illustrate the details as follows:

[0126] Acquire a medical image to be segmented;

[0127] The medical image is preprocessed to obtain a standard image, and the standard image is input into a trained medical image segmentation model to obtain an image segmentation result.

[0128] In this embodiment, preprocessing the medical image to obtain a standard image includes the following steps:

[0129] Step 1: Data division: Get the target image and divide it into training set, validation set and test set according to appropriate proportions.

[0130] Step 2: Slice extraction. CT and MRI are common medical image modalities, both of which are in 3D form. Directly using 3D images for training and reasoning will result in high computational overhead. A common practice is to extract 2D slices for training and reasoning, and connect the slices in sequence when obtaining the reasoning results to form a 3D image. Therefore, in order to facilitate model training and reasoning, all 3D medical images and their corresponding labels need to be converted into 2D slices.

[0131] Step 3: Label conversion. During model training and testing, labels in the form of digital categories are required. Therefore, for datasets whose labels are pixel values ​​and not set according to the number of categories, their labels need to be converted into digital categories.

[0132] Step 4: Image scaling. Higher resolution will lead to higher computational cost during model training, so this paper uniformly scales all training images to resolution, reducing the computational complexity of the training process.

[0133] Step 5: Standardization: Standardize the training images, validation images, and test images.

[0134] The above image preprocessing is helpful to improve the accuracy of image recognition.

[0135] In this embodiment, a medical image to be segmented is obtained; the medical image is preprocessed to obtain a standard image, and the standard image is input into a trained medical image segmentation model to obtain an image segmentation result, thereby achieving rapid segmentation of the medical image and improving the efficiency of medical image segmentation.

[0136] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0137] Figure 6 The principle block diagram of the image segmentation model training device based on artificial intelligence is shown in one-to-one correspondence with the image segmentation model training method based on artificial intelligence in the above embodiment. Figure 6 As shown, the artificial intelligence-based image segmentation model training device includes a sample acquisition module 31, a sample input module 32, a feature extraction module 33, and a model training module 34. The functional modules are described in detail as follows:

[0138] The sample acquisition module 31 is used to acquire training sample data, where the training sample data is historical medical images;

[0139] A sample input module 32 is used to input the training sample data into the initial medical image segmentation model to obtain an input feature map. The initial medical image segmentation model is a local guided global attention mechanism network. The local guided global attention mechanism network is composed of LGG modules, including a multi-scale local feature extraction module, a global feature extraction module, and a local-global feature interaction fusion module.

[0140] A feature extraction module 33, configured to extract features from the input feature map using the multi-scale local feature extraction module to obtain multi-scale local features;

[0141] The model training module 34 is used to train the local-guided-global attention mechanism network using training sample data to obtain a trained medical image segmentation model.

[0142] Figure 7 The principle block diagram of the image segmentation device based on artificial intelligence corresponding to the image segmentation method based on artificial intelligence in the above embodiment is shown. Figure 7 As shown, the artificial intelligence-based image segmentation device includes an image acquisition module 36 and an image segmentation module 37. Each functional module is described in detail as follows:

[0143] An image acquisition module 35, used for acquiring a medical image to be segmented;

[0144] The image segmentation module 36 is used to pre-process the medical image to obtain a standard image, and input the standard image into a trained medical image segmentation model to obtain an image segmentation result.

[0145] For the specific definition of the image segmentation model training device based on artificial intelligence / the image segmentation device based on artificial intelligence, please refer to the definition of the image segmentation model training method based on artificial intelligence / the image segmentation method based on artificial intelligence in the above text, which will not be repeated here. Each module in the above-mentioned image segmentation model training device based on artificial intelligence / the image segmentation device based on artificial intelligence can be implemented in whole or in part through software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0146] To solve the above technical problems, the present application also provides a computer device. Figure 8 , Figure 8 This is a basic structural block diagram of the computer device in this embodiment.

[0147] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components connected to the memory 41, the processor 42, and the network interface 43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0148] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0149] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or D interface display memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 4. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as the program code of the image segmentation method based on artificial intelligence, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.

[0150] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run the program code stored in the memory 41 or process data, such as running the program code of the image segmentation method based on artificial intelligence.

[0151] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.

[0152] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores an interface display program, and the interface display program can be executed by at least one processor so that the at least one processor performs the steps of the above-mentioned artificial intelligence-based image segmentation method.

[0153] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0154] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to replace some of the technical features therein with equivalents. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. An image segmentation model training method based on artificial intelligence, characterized in that: include: Acquire training sample data, wherein the training sample data is historical medical images; Input the training sample data into the initial medical image segmentation model to obtain an input feature map, wherein the initial medical image segmentation model is a local guided global attention mechanism network, wherein the local guided global attention mechanism network is composed of an LGG module, including a multi-scale local feature extraction module, a global feature extraction module, and a local-global feature interactive fusion module, wherein the LGG module is a local guided global module for extracting multi-scale local and global information; Using the multi-scale local feature extraction module to extract features from the input feature map to obtain multi-scale local features; Based on the multi-scale local features, the self-attention weight generation in the global feature extraction layer is guided, and the input feature value of the global feature extraction layer is weighted by the obtained attention weight to obtain the global feature; the global feature modulation weight is generated based on the multi-scale local features, the local feature modulation weight is generated based on the global features, the global feature modulation weight is used to re-weight the global feature in the spatial position, and the local feature modulation weight is used to re-weight the multi-scale local feature in the spatial position, and the global feature extraction layer is the feature extraction layer in the global feature extraction module; The weighted multi-scale local features and the weighted global features are connected in the channel dimension, and the local guided global attention mechanism network is trained using the training sample data to obtain a trained medical image segmentation model.

2. The artificial intelligence-based image segmentation model training method according to claim 1, characterized in that: The multi-scale local feature extraction module is used to extract features from the input feature map to obtain multi-scale local features, which includes: In the encoder, semantic information of different levels is extracted through several multi-scale LGG feature extraction layers and downsampling operations, and the feature map resolution is restored through several multi-scale LGG feature extraction layers and upsampling operations in the decoder, wherein multi-head self-attention values ​​are stored and transmitted between LGG feature extraction layers of the same resolution through contextual attention state perception variables, and the LGG module includes several LGG feature extraction layers with different resolutions.

3. The artificial intelligence-based image segmentation model training method according to claim 2, characterized in that: The multi-scale LGG feature extraction layer is constructed by a modulation structure as a whole and adopts residual connection. The local modulation weights are generated by the extracted global features, and the global modulation weights are generated by the extracted multi-scale local features. The multi-scale local features and the global features are modulated and connected in the channel dimension respectively. After the channel connection operation, the feature map channel is adaptively selected through a 1×1 convolution.

4. The artificial intelligence-based image segmentation model training method according to claim 3, characterized in that: The LGG module adopts a parallel local to global progressive multi-scale interaction strategy to extract information of different scales; wherein, the parallel local to global progressive multi-scale interaction strategy is adopted to extract information of different scales, including: The input feature map is divided into 2 groups in the channel dimension, expressed as follows: x1,x2=x.split(2,dim=1) Where x represents the input feature map, x1 and x2 represent the two sets of features after segmentation, dim=1 represents segmentation in the channel dimension, and the two sets of features after the input feature map segmentation use receptive fields of 3×3, 5×5, and 7×7 to extract multi-scale local features and global receptive fields to extract global features; For the first group, multi-scale local features are extracted by stacking 3×3 convolutions, which are expressed as follows: xl1=Conv 3×3 (x1), xl2=Conv 3×3 (xl1) xl3=Conv 3×3 (xl2) xl=xl1+xl2+xl3 Among them, xl1, xl2, and xl3 represent the extracted 3×3, 5×5, and 7×7 scale local features respectively, and xl represents the fused multi-scale local features; The extracted multi-scale local features are used as part of the Q value in the Transformer self-attention structure, and then the global dependencies are calculated by the second group, and the global feature modulation weights are generated based on the multi-scale local features using 1×1 convolution, and the local feature modulation weights are generated based on the global features. The global features are re-weighted in spatial position using the global feature modulation weights, and the multi-scale local features are re-weighted in spatial position using the local feature modulation weights, and then the obtained multi-scale local features and global information are connected in the channel dimension: Q = xl xg=LGET(x2,Q) mod xl =Conv 1×1 (xl) mod xg =Conv 1×1 (xg) xl=xl⊙mod xl xg=xg⊙mod xg y=concat([xl,xg],dim=1) Among them, xg represents the extracted global features, LGET represents the efficient attention module for global feature extraction, and mod xl 、mod xg They represent the generated local modulation weights and global modulation weights respectively.

5. The artificial intelligence-based image segmentation model training method according to claim 4, characterized in that: The method further comprises the following steps performed by the LGET efficient attention module: The Q value is downsampled, and the resolution is halved without changing the number of channels through a convolution with a kernel size of 3×3 and a stride of 2; The input feature map is mapped to obtain K and V respectively through two 1×1 convolutions; Transform Q, K, and V, where Q is transformed by R B×C×H / 2×W / 2 Transform to R B×h×N / 4×d , K and V are determined by R B×C×H×W Transform to R B ×h×N×d , where B, C, H, and W represent the batch size, number of channels, width, and height of the feature map, respectively. N = H × W and h × d = C, and h represents the number of attention heads.

6. An image segmentation method based on artificial intelligence, characterized in that: include: Acquire a medical image to be segmented; The medical image is preprocessed to obtain a standard image, and the standard image is input into a trained medical image segmentation model to obtain an image segmentation result, wherein the trained medical image segmentation model is trained according to the artificial intelligence-based image segmentation model training method according to any one of claims 1 to 5.

7. An image segmentation model training device based on artificial intelligence, characterized in that: include: A sample acquisition module, used to acquire training sample data, wherein the training sample data is historical medical images; A sample input module, used to input the training sample data into an initial medical image segmentation model to obtain an input feature map, wherein the initial medical image segmentation model is a local guided global attention mechanism network, wherein the local guided global attention mechanism network is composed of an LGG module, including a multi-scale local feature extraction module, a global feature extraction module, and a local-global feature interactive fusion module, wherein the LGG module is a local guided global module, used to extract multi-scale local and global information; A feature extraction module, configured to use the LGG module and the multi-scale local feature extraction module to perform feature extraction on the input feature map to obtain multi-scale local features; based on the multi-scale local features, guide the generation of self-attention weights in the global feature extraction layer, and use the obtained attention weights to weight the input feature values ​​of the global feature extraction layer to obtain global features; generate global feature modulation weights based on the multi-scale local features, generate local feature modulation weights based on the global features, use the global feature modulation weights to re-weight the global features in spatial positions, and use the local feature modulation weights to re-weight the multi-scale local features in spatial positions. The global feature extraction layer is the feature extraction layer in the global feature extraction module; The model training module is used to connect the weighted multi-scale local features and the weighted global features in the channel dimension, and use the training sample data to train the local guided global attention mechanism network to obtain a trained medical image segmentation model.

8. An image segmentation device based on artificial intelligence, characterized in that: An image acquisition module, used for acquiring a medical image to be segmented; An image segmentation module is used to preprocess the medical image to obtain a standard image, and input the standard image into a trained medical image segmentation model to obtain an image segmentation result, wherein the trained medical image segmentation model is trained according to the artificial intelligence-based image segmentation model training method according to any one of claims 1 to 5.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the image segmentation model training method based on artificial intelligence as described in any one of claims 1 to 5 is implemented, or, when the processor executes the computer program, the image segmentation method based on artificial intelligence as described in claim 6 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by the processor, it implements the artificial intelligence-based image segmentation model training method as described in any one of claims 1 to 5, or, when the computer program is executed by the processor, it implements the artificial intelligence-based image segmentation method as described in claim 6.