Focus area segmentation method and device, electronic equipment and storage medium
Through deep learning technology, combined with feature encoder, skip connection module and decoder, it solves the problem of difficulty in segmenting ground glass opacity lesion areas with existing technology, achieves accurate segmentation of fungal pneumonia lesion areas, and improves diagnostic efficiency and accuracy. .
Patent Information
- Application Number
- CN202410600145.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-14
- Publication Date
- 2024-08-30
AI Technical Summary
Existing medical image segmentation methods are difficult to accurately segment lesion areas with discontinuities and ground-glass shadows, resulting in low clinical diagnosis efficiency and high misdiagnosis rates. Especially in the diagnosis of fungal pneumonia, existing methods are difficult to capture the focus areas. Scattered spots and edges of ground-glass opacity cannot provide an accurate basis for diagnosis.
The lesion area segmentation method based on deep learning is used to perform image preprocessing, feature encoding, cross-layer feature fusion and decoding through the combination of feature encoder, skip connection module and feature decoder to improve the contrast and segmentation accuracy of the lesion area. , using adaptive soft pooling and multi-scale Transformer modules to enhance long-range relationship modeling to achieve accurate segmentation of pneumonia focus areas.
It improves the segmentation accuracy of fungal pneumonia lesion areas, reduces false negative detection, enhances the efficiency and accuracy of clinical diagnosis, provides a better basis for medical diagnosis, and is suitable for segmentation tasks of a variety of lesion areas.
Smart Images

Figure CN118570465A
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method, device, electronic device and storage medium for segmenting a lesion area. Background Art
[0002] Lesion segmentation is the process of separating abnormal regions from normal tissues in medical images. These abnormal regions can be tumors, vascular lesions, organ lesions, or other forms of disease markers. Lesion segmentation not only improves the accuracy of medical diagnosis and treatment, but also brings better treatment effects and quality of life to patients.
[0003] Artificial Intelligence (AI) technology is currently widely used to segment lesion areas in computed tomography (CT) images. However, for lesion areas that are discontinuous and have ground-glass shadows (low contrast and blurry) at the regional boundaries, which are difficult to distinguish from normal tissues, existing medical image segmentation methods have difficulty capturing scattered points around the lesion area, and cannot achieve accurate segmentation of the lesion area, and thus cannot provide accurate and effective medical diagnosis basis for clinical diagnosis. Summary of the invention
[0004] The present invention provides a lesion area segmentation method, device, electronic equipment and storage medium, which can achieve accurate segmentation of the lesion area and provide accurate and effective medical diagnosis basis for clinical diagnosis.
[0005] In a first aspect, a method for segmenting a lesion region is provided, comprising: Performing image preprocessing on the image to be segmented to obtain a target segmented image, wherein the target segmented image contains at least one lesion area, and the image preprocessing at least includes: foreground clipping processing and CT value normalization processing; Inputting the target segmented image into the trained lesion region segmentation model to obtain an image segmentation result of the lesion region, wherein the lesion region segmentation model includes a feature encoder, a skip connection module, and a feature decoder; The target segmented image is input into the trained lesion area segmentation model to obtain the image segmentation result of the lesion area, including: Input the target segmentation image into the feature encoder to obtain the encoded feature image output by each of the multiple network layers of the feature encoder, wherein the number of channels configured corresponding to each network layer is different; Input multiple encoded feature images corresponding to multiple network layers into the skip connection module for cross-layer feature fusion processing to obtain multi-scale non-local feature images; The feature decoder is used to perform feature decoding and fusion processing on the encoded feature image and the multi-scale non-local feature image to obtain the image segmentation result of the lesion area.
[0006] In a second aspect, a lesion region segmentation device is provided, comprising: A processing module is used to perform image preprocessing on the image to be segmented to obtain a target segmented image, wherein the target segmented image contains at least one lesion area, and the image preprocessing at least includes: foreground clipping processing and CT value normalization processing; A segmentation module is used to input the target segmentation image into the trained lesion area segmentation model to obtain an image segmentation result of the lesion area, wherein the lesion area segmentation model includes a feature encoder, a skip connection module and a feature decoder; The segmentation module is specifically used for: Input the target segmentation image into the feature encoder to obtain the encoded feature image output by each of the multiple network layers of the feature encoder, wherein the number of channels configured corresponding to each network layer is different; Input multiple encoded feature images corresponding to multiple network layers into the skip connection module for cross-layer feature fusion processing to obtain multi-scale non-local feature images; The feature decoder is used to perform feature decoding and fusion processing on the encoded feature image and the multi-scale non-local feature image to obtain the image segmentation result of the lesion area.
[0007] According to a third aspect, an electronic device is provided, comprising: a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method in the first aspect or its various implementations.
[0008] According to a fourth aspect, a computer-readable storage medium is provided for storing a computer program, wherein the computer program enables a computer to execute the method according to the first aspect or its various implementations.
[0009] According to the technical solution provided by the present invention, after obtaining the image to be segmented including the lesion area, the foreground cropping and CT value normalization processing can be performed on the image to be segmented first; after obtaining the target segmented image, the target segmented image is input into the lesion area segmentation model including the feature encoder, the jump connection module and the feature decoder, and the target segmented image is specifically input into the feature encoder to obtain the coded feature image output by each network layer in the multiple network layers of the feature encoder; the multiple coded feature images corresponding to the multiple network layers are input into the jump connection module for cross-layer feature fusion processing to obtain a multi-scale non-local feature image; the feature decoder is used to perform feature decoding and fusion processing on the coded feature image and the multi-scale non-local feature image to obtain the image segmentation result of the lesion area. The technical solution in the present invention can improve the regional contrast of the lesion area by performing image preprocessing on the image to be segmented, and avoid the interference of non-related image features on the segmentation of the lesion area. When the lesion area segmentation model is used to segment the lesion area, the cross-layer feature fusion is performed through the jump connection module, and the features of different resolutions of multiple network layers can be used to improve the ability to capture remote relationships, improve the accuracy of the ground-glass shadow segmentation of the edge area of pneumonia, and thus achieve accurate segmentation of the pneumonia lesion area.
[0010] It should be understood that the above general description and the following detailed description are only exemplary and explanatory and cannot limit the present invention. Other features and advantages of the present invention will be described in detail in the following specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0012] Figure 1 A network structure diagram of a lesion region segmentation model provided in an embodiment of the present application; Figure 2 An application scenario diagram provided for an embodiment of the present application; Figure 3 A schematic diagram of a flow chart of a lesion region segmentation method provided in an embodiment of the present application; Figure 4 A schematic diagram of the principle flow of lesion area segmentation provided in an embodiment of the present application; Figure 5 A schematic flow chart of a lesion region segmentation method provided by another embodiment of the present invention; Figure 6 A schematic diagram of the structure of a jump connection module provided in an embodiment of the present application; Figure 7 A schematic structural diagram of a lesion region segmentation device provided by an embodiment of the present invention; Figure 8 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0013] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0014] It should be noted that the terms "first", "second", etc. 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. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0015] Lesion segmentation is the process of separating abnormal regions from normal tissues in medical images. These abnormal regions can be tumors, vascular lesions, organ lesions, or other forms of disease markers. Lesion segmentation not only improves the accuracy of medical diagnosis and treatment, but also brings better treatment effects and quality of life to patients.
[0016] Artificial Intelligence (AI) technology is currently widely used to segment lesion areas in computed tomography (CT) images. However, for lesion areas that are discontinuous and have ground-glass shadows (low contrast and blurry) at the regional boundaries, which are difficult to distinguish from normal tissues, existing medical image segmentation methods are difficult to capture scattered points around the lesion area, and cannot achieve accurate segmentation of the lesion area, and thus cannot provide accurate and effective medical diagnosis basis for clinical diagnosis.
[0017] It should be noted that the present invention is applicable to the segmentation of lesion regions under any lesions of different sizes and unfixed positions. In the following embodiment steps in the present disclosure, the disease type is fungal pneumonia type as an example to illustrate the technical solution in the present disclosure, but it does not constitute a specific limitation. Accurate segmentation of early fungal pneumonia is an important starting point to improve the efficiency of clinical medical diagnosis, especially the segmentation of the boundaries of its infected area, which plays an important role in exploring the pathogenesis of related diseases and improving treatment plans. At present, the clinical diagnosis of fungal pneumonia is mainly based on manual diagnosis and pathological diagnosis, which has high time cost and high misdiagnosis rate, limiting the efficiency of clinical diagnosis and causing patients to miss the best treatment time to a certain extent. The variable size, morphology and texture of the fungal pneumonia lesion area can easily lead to false negative detection; and due to the ground-glass shadow and blurred boundaries of the lesion, manual annotation is subjective and erroneous. Therefore, there is an urgent need for high-precision automatic segmentation methods to be applied in the field of medical image segmentation.
[0018] Ground-glass shadows often surround lung nodules in areas infected with fungal pneumonia. This situation is called the "halo sign", which causes blurred edges and low contrast of the lesions, making it difficult to accurately segment them. In order to overcome the following difficulties: 1. The size, shape, and texture of pneumonia lesions are variable, which can easily lead to false negative detections; 2. The boundaries of pneumonia lesions have ground-glass shadows (low contrast and blurry), which are difficult to distinguish from normal tissues. 3. Existing medical image segmentation methods are difficult to capture accurate information and cannot be used for pneumonia lesion segmentation. 4. Existing pooling operations are prone to information loss in the encoder feature extraction stage, and cannot accurately segment the pneumonia lesion area.
[0019] In order to solve the above technical problems, the inventive concept of the present invention is: in order to better capture the discrete areas around early fungal pneumonia and improve the accuracy of fungal pneumonia segmentation, the present invention aims to provide a fungal pneumonia segmentation method based on remote relationship modeling based on deep learning, and its key technology can be used for clinical auxiliary diagnosis of fungal pneumonia and the pathology and imaging research of related fungal pneumonia. A new framework of an automatic segmentation method for fungal pneumonia based on remote relationship modeling is specifically proposed. The process of the method has three steps, CT sequence processing, training part and testing part. Among them, the CT sequence processing is mainly adjusted according to the CT value range to improve the contrast of the lesion. At the same time, the data augmentation method is used to expand the data set to improve the robustness of the method. Training stage: its purpose is to find the causal relationship and correlation relationship between the data, or to fit the distribution between the data, that is, to learn the features between the data and save the learned network weights. Testing stage: use the trained network framework to infer the pneumonia CT sequence that needs to be segmented to obtain the segmentation result map of the pneumonia lesions. As shown Figure 1As shown, the overall network framework consists of three parts: encoder, jump connection and decoder. The encoder part is mainly for feature extraction. The present invention proposes an adaptive soft pooling method based on information preservation in this part, which can retain as much information as possible and avoid the loss of detail features. The encoder part is the basis for extracting and constructing continuous feature description. Its key technology can amplify larger activation features and weaken smaller activation features, providing a balance between retaining information details and local image structure, reducing the loss of important detail information and shielding redundant information to a certain extent. Jump connection part: In order to better establish effective remote relationships, a strong semantic remote relationship modeling method is proposed, which is a necessary method for constructing continuous feature description. This method takes the output of different feature extraction stages as input, incorporates position information into the calculation of remote interaction weights, and strengthens non-local relationship modeling through strong semantic features. Features of multiple layers with different resolutions can be used to improve the ability to capture remote relationships, thereby improving the accuracy of ground-glass shadow segmentation in the edge area of fungal pneumonia. The main function of the decoder part is to restore the image to the same resolution as the input, achieve an end-to-end effect, and do not need to add other work, thereby improving the efficiency of fungal pneumonia segmentation.
[0020] It should be noted that the key technology based on the lesion region segmentation method proposed in the present invention can be used for clinical auxiliary diagnosis of fungal pneumonia and research on the pathology and imaging of related fungal pneumonia. It can also be combined with imaging data of other lesions for research in the fields of medical imaging and clinical auxiliary diagnosis of other diseases.
[0021] It should be understood that the technical solution of the present invention can be applied to the following scenarios, but is not limited to: In some possible implementations, Figure 2 An application scenario diagram provided by an embodiment of the present invention, such as Figure 2 As shown, the application scenario may include an electronic device 110 and a network device 120. The electronic device 110 may establish a connection with the network device 120 via a wired network or a wireless network.
[0022] Exemplarily, the electronic device 110 may be a desktop computer, a laptop computer, a tablet computer, etc., but is not limited thereto. The network device 120 may be a terminal device or a server, but is not limited thereto. In one embodiment of the present invention, the electronic device 110 may send a request message to the network device 120, and the request message may be used to request to obtain the image segmentation result of the lesion area. Further, the electronic device 110 may receive a response message sent by the network device 120, and the response message includes the image segmentation result of the lesion area.
[0023] also, Figure 2An electronic device 110 and a network device 120 are provided as an example, but other numbers of electronic devices and network devices may be included in practice, and the present invention is not limited thereto.
[0024] In some other possible implementations, the technical solution of the present invention may also be executed by the above-mentioned electronic device 110, or the technical solution of the present invention may also be executed by the above-mentioned network device 120, and the present invention does not limit this.
[0025] After introducing the application scenarios of the embodiments of the present invention, the technical solutions of the present invention will be described in detail below: Figure 3 A flowchart of a lesion region segmentation method provided by an embodiment of the present invention, the method can be as follows Figure 2 The electronic device 110 shown in the figure performs, but is not limited to this. Figure 3 As shown, the method may include the following steps: Step 310: perform image preprocessing on the image to be segmented to obtain a target segmented image, wherein the target segmented image contains at least one lesion region.
[0026] The image preprocessing at least includes: foreground clipping processing and CT value normalization processing.
[0027] In a specific application scenario, the image to be segmented may be a set of CT image sequences. When the present invention is applicable to lesion identification of fungal pneumonia, the image to be segmented may correspond to multiple CT scan images of the lungs. When the lung CT image is preprocessed, the region of interest of the CT image may be cropped according to the marked target area, i.e., foreground cropping. Through the foreground cropping process, the locking of the feature range, the positioning of specific features, and the extraction of information can be accelerated, thereby improving the segmentation efficiency. Since different types of lung lesions correspond to different display contrasts on CT images, the lung window range can be adjusted first according to the type of lung lesions corresponding to the lung CT image, and then the CT value normalization process can be performed based on the lung window range. For the disclosed embodiments, through image preprocessing, the high availability of data can be guaranteed and the generalization ability and robustness of the method can be improved.
[0028] The purpose of normalizing the CT value of the lung CT image is to normalize the CT value of each pixel in the lung CT image to be distributed between 0 and 1, so as to improve the contrast of the pneumonia area of the lung, that is, to make the lung lesion area more obvious than other areas, so as to facilitate the subsequent extraction of image features. Specifically, a lung window range of CT value can be set first, and the lung window range can be set differently according to the different lung lesions to be segmented. For example, when the lung lesion to be segmented is fungal pneumonia, the lung window range can be set to -1000~400Hu according to the empirical coefficient, that is, the minimum CT value of the lung window range is: , the maximum CT value of the lung window range is: Afterwards, the CT value of each pixel in the lung CT image can be normalized according to the lung window range. is the value before normalization, when When Corresponding to the normalized CT value for:
[0029] when ,but ;when ,but .
[0030] Step 320: Input the target segmented image into the trained lesion region segmentation model to obtain an image segmentation result of the lesion region.
[0031] Among them, the lesion area segmentation model includes a feature encoder, a jump connection module and a feature decoder. The lesion area segmentation model can be any deep learning network model trained for the lesion area segmentation task, for example, it can be a bidirectional long short-term memory network (Bi-directional Long Short-Term Memory, BiLSTM) model with an attention mechanism, an Att-BiLstm (Attention-Based Bidirectional Long Short-Term Memory) model and a U-Net model, or it can also be a network model based on the above-mentioned network models with some network layer modifications, which is not specifically limited here. In the following embodiments of the present disclosure, the technical solution in the present disclosure is explained by taking the example of obtaining a lesion area segmentation model by training a U-Net model, but it does not constitute a specific limitation.
[0032] The U-Net model is a convolutional neural network used for medical image segmentation. In recent years, it has also been widely used in lesion area segmentation. When the U-Net model is trained for lesion area segmentation, the input features of the model can be lung CT images, and the output features of the model can be segmented images of the corresponding lesion areas in the lung CT images.
[0033] When pre-training the lesion region segmentation model, the sample images with the lesion region labeled can be used to iteratively train the lesion region segmentation model until the lesion region segmentation model reaches a convergence state, that is, the corresponding loss function is less than a preset threshold, and the pre-training of the lesion region segmentation model is determined to be completed. Figure 4As shown in the figure, when the lesion region segmentation model is iteratively trained using sample images (i.e., training data), 20% of the sample images can be randomly divided into a validation set and 80% can be divided into a training set. The lesion region segmentation model is continuously optimized and trained using the training set, and the training accuracy of the lesion region segmentation model during the training process is verified using the validation set until the lesion region segmentation model training is completed. When training the lesion region segmentation model, the Mse Loss loss function can be used to supervise the model training to improve the accuracy of the model. After the lesion region segmentation model training is completed, the network weights obtained by the lesion region segmentation model training can be used to perform image segmentation of the lesion region on the test data (i.e., the target segmented image).
[0034] Correspondingly, when the lesion area segmentation model is pre-trained, the embodiment steps may include: obtaining multiple sample images, performing image preprocessing on the multiple sample images of the lesion area segmentation model, obtaining multiple target sample images configured with lesion area labels, and the lesion area segmentation model data preprocessing at least includes: foreground cropping processing, CT value normalization processing and random cropping processing; using the target sample image as an input feature, using the lesion area label as a training label, iteratively training the lesion area segmentation model, until the loss function of the lesion area segmentation model is less than a preset threshold, and judging that the lesion area segmentation model training is completed. Wherein, the preset threshold is a value between 0 and 1, and the closer the value of the preset threshold is to 1, the higher the model training accuracy of the lesion area segmentation model. The specific value can be set according to the actual application scenario, and is not specifically limited here. The foreground cropping processing and the CT value normalization processing are the same as the implementation process in the embodiment step 310, and will not be repeated here. The random cropping process is used to amplify the sample image to ensure the data volume of the training sample. For random cropping, on the one hand, my country's medical imaging is still in the stage of transition from traditional film to electronic data, a large amount of imaging data has not yet been digitized, and the degree of data sharing and intercommunication between hospitals is low, so it is difficult to obtain large-scale data; on the other hand, the training set needs to be annotated in advance. Since most annotations rely on manual recognition, data annotation will consume a large amount of manpower and time, and obtaining highly reliable annotated data in the field of medical imaging has also become one of the challenges. Therefore, in order to expand the amount of data and enable the model to learn more extensive information, a random cropping method is adopted to randomly crop images with a resolution of 150*150 from each sample data. Then, these data are input into the lesion area segmentation model to train the lesion area segmentation model. In the present invention, 5 samples can be randomly cropped for each sample image to increase the amount of training data. It is specially noted that the random cropping sampling operation only processes the training data, and the data used for testing and reasoning are not operated.
[0035] For the embodiment of the present disclosure, inputting the target segmented image into the trained lesion region segmentation model in step 320 to obtain the image segmentation result of the lesion region may include the following steps: Step 320-1: Input the target segmented image into the feature encoder to obtain the encoded feature image output by each of the multiple network layers of the feature encoder.
[0036] Among them, the feature encoder includes multiple network layers, and different numbers of channels can be configured for each of the multiple network layers, and the number of channels increases layer by layer in the multiple network layers. Each network layer can gradually integrate deeper features and search for effective areas in the target segmented image to obtain a coded feature image. Specifically, the more channels the network layer is configured with, the smaller the actual image size is, the higher the feature depth of the initial coded features is, and it is easy to extract more hidden features (such as grayscale features, position features, etc.).
[0037] For the disclosed embodiment, the target segmentation image can be input into the feature encoder, and the network layers with increasing number of channels in the feature encoder can be used to perform encoding feature recognition in sequence. For the first network layer, the target segmentation image can be used as the input feature to obtain the encoding feature image at the feature resolution of this layer; for each network layer after the first network layer, the encoding feature image output by the previous network layer can be downsampled, and the feature image after the downsampling process can be used as the input feature to further obtain the encoding feature image at the larger feature resolution of this layer. Repeat the above process until the last network layer outputs the encoding feature image.
[0038] Step 320-2: Input multiple encoded feature images corresponding to multiple network layers into the skip connection module for cross-layer feature fusion processing to obtain multi-scale non-local feature images.
[0039] In specific application scenarios, such as Figure 1 As shown in the figure, the output of each network layer in the feature encoder can be input into the corresponding decoder layer, and the output of each network layer is input into the jump connection module. The jump connection module proposes a new strong semantic remote feature extraction module (SSNL-FE) based on multi-scale Transformer. This module is embedded between the encoder path and the decoder path of the lesion area segmentation model to capture multi-scale non-local features with remote dependencies from different network layers of the feature encoder. Specifically, multiple encoded feature images corresponding to multiple network layers can be used as the input of SSNL-FE, and SSNL-FE is used to construct a non-local relationship description based on deep semantic information to obtain a multi-scale non-local feature image, which helps to accurately capture the detailed features of pneumonia.
[0040] Step 320 - 3 , using a feature decoder to perform feature decoding and fusion processing on the coded feature image and the multi-scale non-local feature image to obtain an image segmentation result of the lesion area.
[0041] Among them, the feature decoder may also include multiple network layers, and the number of network layers is the same as the number of network layers in the feature encoder. Different numbers of channels can be configured for the multiple network layers in the feature decoder, and the number of channels decreases layer by layer in the multiple network layers.
[0042] For the disclosed embodiments, the feature decoder can fuse the encoded feature image and the multi-scale non-local feature image, and restore them layer by layer to the same resolution as the input image, thereby achieving an end-to-end effect, reducing unnecessary workload, increasing the speed of fungal pneumonia segmentation, and improving the efficiency of clinical auxiliary diagnosis.
[0043] In summary, according to the lesion area segmentation method provided by the present invention, after obtaining the image to be segmented containing the lesion area, the foreground cropping process and CT value normalization process can be first performed on the image to be segmented; after obtaining the target segmented image, the target segmented image is input into the lesion area segmentation model including the feature encoder, the jump connection module and the feature decoder, and specifically the target segmented image is input into the feature encoder to obtain the coded feature image output by each network layer in the multiple network layers of the feature encoder; the multiple coded feature images corresponding to the multiple network layers are input into the jump connection module for cross-layer feature fusion process to obtain a multi-scale non-local feature image; the feature decoder is used to perform feature decoding and fusion process on the coded feature image and the multi-scale non-local feature image to obtain the image segmentation result of the lesion area. The technical solution in the present invention can improve the regional contrast of the lesion area by performing image preprocessing on the image to be segmented, and avoid the interference of non-correlated image features on the lesion area segmentation. When using the lesion region segmentation model to segment the lesion region, cross-layer feature fusion is performed through the skip connection module. The features of different resolutions of multiple network layers can be used to improve the ability to capture long-range relationships and improve the accuracy of ground-glass shadow segmentation in the edge area of pneumonia, thereby achieving accurate segmentation of the pneumonia lesion area.
[0044] based on Figure 3 The embodiment shown is a refinement and extension of the above embodiment. In order to fully illustrate the specific implementation process of the method of this embodiment, this embodiment provides the following Figure 5 The specific method shown. Figure 5 based on Figure 3 The embodiment shown further defines the embodiment steps. As shown in 5, the method includes the following steps: Step 510: perform image preprocessing on the image to be segmented to obtain a target segmented image, wherein the target segmented image contains at least one lesion region.
[0045] For the embodiment of the present disclosure, the specific implementation process can refer to the relevant description in step 310 of the embodiment, which will not be repeated here.
[0046] Step 520: Input the target segmented image into the feature encoder to obtain the encoded feature image output by each of the multiple network layers of the feature encoder.
[0047] Among them, the feature encoder includes N first network layers, each first network layer has a different number of channels configured, and the number of channels increases layer by layer in the N first network layers, and the layers of the N first network layers are downsampled using an adaptive soft pooling method, and each of the N first network layers includes a convolution module. In the following embodiment steps in the present disclosure, the technical solution in the present disclosure is described by taking N as 4 as an example, but it does not constitute a specific limitation.
[0048] For example, the image resolution of the feature encoder can be unified as 512*512. Figure 1 As shown in the figure, when N is 4, the feature encoder includes 4 first network layers (i.e., convolutional layer 1, convolutional layer 2, convolutional layer 3, and convolutional layer 4), and the number of feature map channels output by convolutional layer 1, convolutional layer 2, convolutional layer 3, and convolutional layer 4 are 32, 64, 128, and 256, respectively. Each first network layer adopts a convolution operation, and the layers are down-sampled by the adaptive soft pooling method (ASP) based on information preservation proposed by the present invention, which can provide a balance between retaining information details and local image structure, reducing the loss of information while shielding redundant information as much as possible.
[0049] Correspondingly, for the embodiments of the present disclosure, the embodiment steps may include: for any one of the N first network layers, using the convolution module configured therein, performing convolution processing on the first input feature to obtain a coded feature image under the number of configured channels corresponding to the current first network layer; wherein, when the current first network layer is the first first network layer, the first input feature image is the target segmentation image; when the current first network layer is any one of the N first network layers except the first first network layer, the first input feature image is the target coded feature image, and the target coded feature image is a feature image obtained by downsampling the coded feature image output by the current first network layer corresponding to the previous first network layer using an adaptive soft pooling method.
[0050] For example, when the value of N is 4, the target segmented image can be input into the feature encoder to obtain the encoded feature image output by each of the four first network layers; wherein, for any one of the four first network layers, the first input feature is convolved using the convolution module configured therein to obtain the encoded feature image under the number of channels configured corresponding to the current first network layer. Specifically, when the current first network layer is the first first network layer (convolutional layer 1), the first input feature is the target segmentation image; when the current first network layer is the second first network layer (convolutional layer 2), the corresponding first input feature is the target coding feature image obtained by downsampling the coding feature image output by the first first network layer (convolutional layer 1) using an adaptive soft pooling method; when the current first network layer is the third first network layer (convolutional layer 3), the corresponding first input feature is the target coding feature image obtained by downsampling the coding feature image output by the second first network layer (convolutional layer 2) using an adaptive soft pooling method; when the current first network layer is the fourth first network layer (convolutional layer 4), the corresponding first input feature is the target coding feature image obtained by downsampling the coding feature image output by the third first network layer (convolutional layer 3) using an adaptive soft pooling method.
[0051] In specific application scenarios, for the downsampling process, this application proposes an average-based Dice-Sørensen coefficient exponential pooling operation, namely, smooth average pooling (Average based Dice-Sørensen Coefficient Exponential Pooling, DSCAPool) and a maximum-based Dice-Sørensen coefficient exponential pooling operation, namely, smooth maximum pooling (Max based Dice-Sørensen Coefficient Exponential Pooling, DSCMPool), as well as their fusion pool: adaptive soft pooling (ASP). ASP does not average high-frequency patterns like average pooling, nor does it pay too much attention to the maximum pooling pattern. The following describes smooth average pooling, smooth maximum pooling, and adaptive soft pooling one by one: Smoothed Average Pooling: The smoothed average pooling proposed in the present invention improves the direct average pooling by weighting the kernel value exponentially based on the similarity between the kernel value and its regional average value. In addition, the similarity between the activation vector and the average activation is calculated based on the exponential. During the back propagation, the gradient can be calculated for each position, reducing the possibility of the gradient vanishing problem. By calculating the encoding feature image output by the previous first network layer, each activation vector (i.e., pixel point) The average activation (i.e., average pixel value) within the kernel region R (i.e., the preset domain range of the pixel point) The similarity of , the Dice-Sørensen coefficient is extended to the exponential kernel weighting used for pooling, the first pooling result The calculation formula is:
[0052]
[0053] Smooth max pooling: Smoothed max pooling is a supplement to smoothed average pooling in the kernel region. It ensures that larger activations have a greater impact on the output, while also ensuring that the smallest weights are assigned to the lowest activations. It is motivated by cortical neural simulations that downsample manually encoded features. The weights in smoothed max pooling are based on nonlinear changes in the similarity between the corresponding activation values and the maximum activation values, which can better make activations of different values have different strengths of influence on the results. High-value activations dominate, and low-value activations have less impact on the final output. Most pooling operations are performed in high-dimensional feature spaces, so highlighting activations with greater effects can better describe the structural information of feature maps than selecting the maximum activation alone, which is more advantageous for segmenting pneumonia with fuzzy edge detail features. In addition, it also solves the problem that the loss of most activation information in the direct maximum pooling process seriously affects the accuracy of the results. The output of the smoothed max pooling is a sum of all activation vectors (i.e., pixels) in the kernel region R. With maximum activation (i.e., the maximum pixel value within the preset domain) is generated by the smoothed similarity weighted sum. Correspondingly, the second pooling result The calculation formula is:
[0054]
[0055] The output of smoothed max pooling is similar to the output of smoothed average pooling in that both are normalized results based on probability distributions. The probability distribution of the output of smoothed max pooling is the same as that of each activation vector. Relative to the adjacent maximum activation in the core region R The smooth average pooling uses the activation vector and the average activation within the pooling core region R The similarity between them is calculated by each activation vector For the neighborhood average activation The difference between the two methods is used to describe the feature map, which focuses more on static information; the smoothed maximum pooling can express the influence of each activation on the output result, which focuses more on the change. Therefore, for the task of segmenting pneumonia lesions with large and small scales, variable positions and more edge details, both operations are indispensable. The present invention uses learnable weight parameters To construct a combination of smooth average pooling and smooth maximum pooling. Among them, Used to learn the usage ratio of the two pooling methods in each kernel region R. Introduced during the network training process This helps to create a general pooling strategy based on the union of DSCAPool and DSCMPool, namely Adaptive Soft Pooling (ASP). This method is represented as the first pooling result And the second pooling result The final pooling result is obtained by learning group , the formula is as follows:
[0056] in, The specific value can be set according to the actual application scenario, such as 0.7.
[0057] Correspondingly, when an adaptive soft pooling method is used to downsample the coded feature image output by the previous first network layer corresponding to the current first network layer, the implementation steps may also include: when the current first network layer is any first network layer except the first first network layer among N first network layers, an adaptive soft pooling method is used to downsample the coded feature image output by the previous first network layer to obtain a first input feature image corresponding to the current first network layer.
[0058] Correspondingly, when the adaptive soft pooling method is used to downsample the coding feature image output by the previous first network layer to obtain the first input feature image corresponding to the current first network layer, the embodiment steps may include: for each pixel point in the coding feature image output by the previous first network layer, the adaptive soft pooling method is used to perform a pooling operation until all pixels complete the pooling operation to obtain the first input feature image corresponding to the current first network layer; wherein, for each pixel point in the coding feature image output by the previous first network layer, the adaptive soft pooling method is used to perform a pooling operation, including: for each pixel point in the coding feature image output by the previous first network layer, a smoothed average pool and a smoothed maximum pool are used to perform a pooling operation to obtain a first pooling result and a second pooling result, and the first pooling result and the second pooling result are fused to obtain a final pooling result corresponding to the pixel point.
[0059] Step 530: Input the multiple encoded feature images corresponding to the multiple network layers into the skip connection module for cross-layer feature fusion processing to obtain a multi-scale non-local feature image.
[0060] Accordingly, for the disclosed embodiment, in step 530, the multiple encoded feature images corresponding to the multiple network layers are input into the skip connection module for cross-layer feature fusion processing to obtain a multi-scale non-local feature image, which may include the following steps: Step 530-1, respectively input the encoded feature images output by the first N-1 first networks in the N first network layers into the adaptive soft pooling module for feature image downsampling, and after convolution operation, obtain a downsampled feature image with the same number of channels as the Nth first network in the N first network layers.
[0061] For example, when the value of N is 4, the encoded feature images output by the first three first networks can be respectively input into the adaptive soft pooling module (ASP) for feature map downsampling, and then a 3×3 convolution operation is performed to obtain a downsampled feature image that matches the size and number of channels of the Nth first network.
[0062] Step 530-2: Fuse the N-1 downsampled feature images corresponding to the first N-1 first networks to obtain a first feature image.
[0063] For example, when the value of N is 4, the downsampled feature images of the first three first networks can be fused by element-wise addition, and then a squeeze-and-excitation (SE) operation is performed to strengthen attention, thereby obtaining a first feature image FA with multi-scale information.
[0064] Step 530-3: Perform position encoding processing in the vertical and horizontal directions on the encoded feature image output by the Nth first network in the N first network layers to obtain a position encoded image.
[0065] Among them, the purpose of position encoding is to make the strong semantic non-local feature extraction module sensitive to the position of the feature. Therefore, by using position encoding, the model network can be more focused on the long-term dependence on the position, avoiding interference of other tissues in abnormal positions around the pneumonia lesion area to the network, resulting in background false positives. Specifically, the encoded feature image FT output by the Nth first network is encoded in the vertical and horizontal directions using learnable parameters to obtain the position encoded image PE.
[0066]
[0067] in, and Represent the learnable vectors encoded by the vertical position branch and the horizontal position branch, respectively.
[0068] Step 530-4: Input the encoded feature image, position encoded image and first feature image output by the Nth first network in the N first network layers into the multi-head self-attention module to perform multi-scale remote interaction weight calculation to obtain a feature attention image.
[0069] The multi-head self-attention module includes a Q branch, a K branch, and a V branch. Figure 6 As shown, for the disclosed embodiment, the encoded feature image FT output by the Nth first network can be used as the input of the K branch and the V branch, and the first feature image FA can be used as the input of the Q branch. In addition, the position encoded image PE can be used as the third input of the multi-head self-attention module. That is, a 1×1 convolution kernel is used for convolution operation as the weight of the branch Q, K and V values, and the first feature image FA is encoded to the Q branch and the encoded feature image FT output by the Nth first network is encoded to the K branch and the V branch respectively. In addition, the channels of the Q branch and the K branch are also compressed to 1 / 8C to compress the channel features and improve the efficiency of the network.
[0070]
[0071]
[0072]
[0073] Among them, Q represents the second feature image obtained by inputting the first feature image into the Q branch for encoding processing; K represents the third feature image under the K branch obtained by inputting the encoded feature image output by the Nth first network into the K branch for encoding processing; V represents the fifth feature image under the V branch obtained by inputting the encoded feature image output by the Nth first network into the V branch for encoding processing; B, C, H and W represent the batch size, the number of channels, the height and width of the feature map respectively.
[0074] After the second feature image Q and the third feature image K are calculated, in order to calculate the attention weight of the multi-scale remote interaction feature map, the similarity measurement matrix E between the second feature image Q and the third feature image K can also be calculated. In addition, the position correlation of the vertical and horizontal branches of the features in the second feature image Q can be encoded by matrix multiplication between the position encoding image PE and the second feature image Q to obtain the fourth feature image QE; then the feature attention image A can be obtained by adding the similarity measurement matrix E and the fourth feature image QE.
[0075] The corresponding formula feature description is:
[0076]
[0077]
[0078]
[0079]
[0080] in, yes The transposed matrix of , MUL is matrix multiplication, and Add is matrix addition.
[0081] Correspondingly, for the embodiments disclosed herein, the embodiments may include: inputting the first feature image into the Q branch for encoding processing to obtain a second feature image; inputting the encoded feature image output by the Nth first network into the K branch for encoding processing to obtain a third feature image under the K branch; using the position encoding image to perform position correlation encoding of the vertical and horizontal branches of the second feature image to obtain a fourth feature image; calculating the similarity measure matrix of the multi-scale non-local space corresponding to the second feature image and the third feature image; and generating a feature attention image based on the fourth feature image and the similarity measure matrix.
[0082] Step 530-5: perform semantic fusion and feature map correction processing on the feature attention image to obtain a multi-scale non-local feature image.
[0083] For the embodiment of the present disclosure, when performing semantic fusion, the feature attention image A and the corresponding fifth feature image V with strong semantics can be weighted and summed to fuse the strong semantics to obtain a multi-scale non-local spatial response image with strong global semantics. .
[0084]
[0085] Furthermore, the image can be responded to in a multi-scale non-local space Based on this, the feature map is dynamically corrected. Specifically, the multi-scale non-local spatial response image can be corrected by learning parameters. The weighted image is added to the encoded feature image FT output by the Nth first network at the element level to dynamically correct the attention map and obtain a multi-scale non-local feature map with long-range dependencies. .
[0086]
[0087] In the formula, is a learnable parameter initialized to 0 and adjusted in a learning manner during the training process to give Assign weights. It is a weighted sum of multi-scale non-local information descriptors and strong global semantic descriptors, ensuring the establishment of more accurate non-local long-range relations.
[0088] Correspondingly, the steps of the embodiment may include: inputting the encoded feature image output by the Nth first network into the V branch for encoding processing to obtain the fifth feature image under the V branch; performing a weighted sum operation on the feature attention image and the fifth feature image to obtain a multi-scale non-local spatial response image after strong semantic fusion; performing an element-level addition operation on the multi-scale non-local spatial response image and the encoded feature image output by the Nth first network in the N first network layers to obtain a multi-scale non-local feature image.
[0089] Step 540: Use a feature decoder to perform feature decoding and fusion processing on the coded feature image and the multi-scale non-local feature image to obtain an image segmentation result of the lesion area.
[0090] The feature decoder includes N second network layers, each second network layer has a different number of channels configured, and the number of channels decreases layer by layer in the N second network layers. Figure 1 As shown in , when N is 4, the feature decoder includes 4 second network layers (i.e., decoder layer 4, decoder layer 3, decoder layer 2, and decoder layer 1). Corresponding to the first network layer, the number of feature map channels output by decoder layer 4, decoder layer 3, decoder layer 2, and decoder layer 1 are 256, 128, 64, and 32, respectively. The four second network layers are upsampled. Figure 1 As shown in the figure, the input of each second network layer corresponds to the output of the first network layer and the output of the previous second network layer. In the second network layer, they will perform channel splicing and further fuse the connections between features through convolution operations. Then, the same operation is used to fuse layer by layer to finally obtain the output segmentation result map.
[0091] The function of the feature decoder in the present invention is to fuse the features extracted by the jump connection and the encoder, and restore it layer by layer to the same resolution of 512*512 as the input image, so as to achieve an end-to-end effect, reduce unnecessary workload, increase the speed of fungal pneumonia segmentation, and improve the efficiency of clinical auxiliary diagnosis.
[0092] Correspondingly, for the embodiments of the present disclosure, the embodiment steps may include: for any one of the N second network layers, locating the lesion area for the second input feature, and obtaining a lesion area feature image under the number of channels configured corresponding to the current second network layer; determining the lesion area feature image output by the Nth second network layer as the image segmentation result of the lesion area; wherein, when the current second network layer is the first second network layer, the second input feature includes a multi-scale non-local feature image, and a coded feature image output by the first network layer corresponding to the number of channels configured with the current second network layer; when the current second network layer is any one of the N second network layers except the first second network layer, the second input feature includes a lesion area feature image output by the previous second network layer corresponding to the current second network layer, and a coded feature image output by the first network layer corresponding to the number of channels configured with the current second network layer.
[0093] For example, when the value of N is 4, for any second network layer among the four second network layers, the second input feature can be processed by image segmentation to obtain the image segmentation result under the number of channels configured corresponding to the current second network layer, wherein, when the current second network layer is the first second network layer (decoding layer 4), the second input feature includes a multi-scale non-local feature image, and an encoded feature image output by the first network layer (convolutional layer 4) with the same number of channels configured corresponding to the current second network layer; when the current second network layer is the second second network layer (decoding layer 3), the second input feature includes a lesion area feature image output by the previous second network layer (decoding layer 4) corresponding to the current second network layer, and an encoded feature image output by the first network layer (convolutional layer 4) with the same number of channels configured corresponding to the current second network layer (decoding layer 3). The second input feature comprises the coded feature image output by the first network layer (convolutional layer 3) with the same number of channels as the current second network layer (decoding layer 2); when the current second network layer is the third second network layer (decoding layer 2), the second input feature comprises the lesion area feature image output by the previous second network layer (decoding layer 3) corresponding to the current second network layer, and the coded feature image output by the first network layer (convolutional layer 2) with the same number of channels as the current second network layer (decoding layer 2); when the current second network layer is the fourth second network layer (decoding layer 1), the second input feature comprises the lesion area feature image output by the previous second network layer (decoding layer 2) corresponding to the current second network layer, and the coded feature image output by the first network layer (convolutional layer 1) with the same number of channels as the current second network layer (decoding layer 1).
[0094] In summary, the technical solution in the present application, after obtaining the image to be segmented containing the lesion area, can first perform foreground cropping and CT value normalization on the image to be segmented; after obtaining the target segmented image, the target segmented image is input into the lesion area segmentation model including a feature encoder, a jump connection module and a feature decoder, specifically the target segmented image is input into the feature encoder to obtain the coded feature image output by each network layer in the multiple network layers of the feature encoder; the multiple coded feature images corresponding to the multiple network layers are input into the jump connection module for cross-layer feature fusion processing to obtain a multi-scale non-local feature image; the feature decoder is used to perform feature decoding and fusion processing on the coded feature image and the multi-scale non-local feature image to obtain the image segmentation result of the lesion area. The technical solution in the present invention can improve the regional contrast of the lesion area by performing image preprocessing on the image to be segmented, and avoid the interference of non-correlated image features on the segmentation of the lesion area. When using the lesion region segmentation model to segment the lesion region, cross-layer feature fusion is performed through the skip connection module. The features of different resolutions of multiple network layers can be used to improve the ability to capture long-range relationships and improve the accuracy of ground-glass shadow segmentation in the edge area of pneumonia, thereby achieving accurate segmentation of the pneumonia lesion area.
[0095] Based on the above Figure 3 , Figure 5 A detailed description of the lesion region segmentation method is provided, such as Figure 7 As shown, Figure 7 FIG. 1 is a block diagram of a lesion region segmentation device according to an exemplary embodiment. Figure 7 As shown, the device comprises: The processing module 71 may be used to perform image preprocessing on the image to be segmented to obtain a target segmented image, wherein the target segmented image contains at least one lesion region, and the image preprocessing at least includes: foreground clipping processing and CT value normalization processing; The segmentation module 72 may be used to input the target segmented image into the trained lesion region segmentation model to obtain an image segmentation result of the lesion region, wherein the lesion region segmentation model includes a feature encoder, a skip connection module and a feature decoder; The segmentation module 72 may be specifically configured to: Input the target segmentation image into the feature encoder to obtain the encoded feature image output by each of the multiple network layers of the feature encoder, wherein the number of channels configured corresponding to each network layer is different; Input multiple encoded feature images corresponding to multiple network layers into the skip connection module for cross-layer feature fusion processing to obtain multi-scale non-local feature images; The feature decoder is used to perform feature decoding and fusion processing on the encoded feature image and the multi-scale non-local feature image to obtain the image segmentation result of the lesion area.
[0096] In some embodiments of the present application, the feature encoder includes N first network layers, each first network layer has a different number of channels configured, and the number of channels increases layer by layer in the N first network layers, and the layers of the N first network layers are downsampled using an adaptive soft pooling method, and each of the N first network layers includes a convolution module; When the target segmented image is input into the feature encoder to obtain the encoded feature image output by each network layer in the multiple network layers of the feature encoder, the segmentation module 72 can be specifically used to: For any one of the N first network layers, using the convolution module configured therein, convolution processing is performed on the first input feature to obtain a coded feature image under the number of configured channels corresponding to the current first network layer; Among them, when the current first network layer is the first first network layer, the first input feature image is the target segmentation image; when the current first network layer is any first network layer except the first first network layer among N first network layers, the first input feature image is the target coding feature image, and the target coding feature image is a feature image obtained by downsampling the coding feature image output by the current first network layer corresponding to the previous first network layer using an adaptive soft pooling method.
[0097] In some embodiments of the present application, the segmentation module 72 may be further used to: When the current first network layer is any first network layer except the first first network layer among the N first network layers, an adaptive soft pooling method is used to downsample the coded feature image output by the previous first network layer to obtain a first input feature image corresponding to the current first network layer; The encoding feature image output by the previous first network layer is downsampled by an adaptive soft pooling method to obtain a first input feature image corresponding to the current first network layer, including: For each pixel point in the encoded feature image output by the previous first network layer, an adaptive soft pooling method is used to perform a pooling operation until all pixels have completed the pooling operation, thereby obtaining a first input feature image corresponding to the current first network layer; Among them, for each pixel in the encoded feature image output by the previous first network layer, an adaptive soft pooling method is used to perform a pooling operation, including: For each pixel in the encoded feature image output by the previous first network layer, pooling operations are performed using smoothed average pooling and smoothed maximum pooling, respectively, to obtain the first pooling result and the second pooling result, and the final pooling result corresponding to the pixel is obtained by fusing the first pooling result and the second pooling result.
[0098] In some embodiments of the present application, when a plurality of encoded feature images corresponding to a plurality of network layers are input into a skip connection module for cross-layer feature fusion processing to obtain a multi-scale non-local feature image, the segmentation module 72 may be specifically used to: Input the encoded feature images output by the first N-1 first networks in the N first network layers into the adaptive soft pooling module for feature image downsampling, and after convolution operation, obtain a downsampled feature image with the same number of channels as the Nth first network in the N first network layers; Fusing the N-1 downsampled feature images corresponding to the first N-1 first networks to obtain a first feature image; Performing position encoding processing in vertical and horizontal directions on the encoded feature image output by the Nth first network in the N first network layers to obtain a position encoded image; Input the encoded feature image, the position encoded image, and the first feature image output by the Nth first network in the N first network layers into the multi-head self-attention module to perform multi-scale long-range interaction weight calculation to obtain a feature attention image; The feature attention image is semantically fused and the feature map is corrected to obtain a multi-scale non-local feature image.
[0099] In some embodiments of the present application, the multi-head self-attention module includes a Q branch, a K branch, and a V branch; When the coded feature image, the position coded image and the first feature image output by the Nth first network in the N first network layers are input into the multi-head self-attention module to perform multi-scale long-range interaction weight calculation to obtain the feature attention image, the segmentation module 72 can be specifically used to: Inputting the first feature image into the Q branch for encoding processing to obtain a second feature image; Input the encoded feature image output by the Nth first network into the K branch for encoding processing to obtain a third feature image under the K branch; Using the position coding image, performing position correlation coding of vertical and horizontal branches on the second feature image to obtain a fourth feature image; Calculating a similarity measure matrix of a multi-scale non-local space corresponding to the second feature image and the third feature image; Based on the fourth feature image and the similarity measure matrix, a feature attention image is generated.
[0100] In some embodiments of the present application, when semantic fusion and feature map correction processing are performed on the feature attention image to obtain a multi-scale non-local feature image, the segmentation module 72 can be specifically used to: Input the encoded feature image output by the Nth first network into the V branch for encoding processing to obtain the fifth feature image under the V branch; Perform a weighted sum operation on the feature attention image and the fifth feature image to obtain a multi-scale non-local spatial response image after strong semantic fusion; An element-wise addition operation is performed on the multi-scale non-local spatial response image and the encoded feature image output by the Nth first network in the N first network layers to obtain a multi-scale non-local feature image.
[0101] In some embodiments of the present application, the feature decoder includes N second network layers, each second network layer has a different number of channels configured accordingly, and the number of channels decreases layer by layer in the N second network layers; When the feature decoder is used to perform feature decoding and fusion processing on the coded feature image and the multi-scale non-local feature image to obtain the image segmentation result of the lesion area, the segmentation module 72 can be specifically used to: For any second network layer among the N second network layers, locating the lesion area on the second input feature, and obtaining a lesion area feature image under the number of configured channels corresponding to the current second network layer; The feature image of the lesion area output by the Nth second network layer is determined as the image segmentation result of the lesion area; Among them, when the current second network layer is the first second network layer, the second input features include a multi-scale non-local feature image, and a coded feature image output by the first network layer corresponding to the current second network layer and configured with the same number of channels; when the current second network layer is any second network layer except the first second network layer among N second network layers, the second input features include a lesion area feature image output by the previous second network layer corresponding to the current second network layer, and a coded feature image output by the first network layer corresponding to the current second network layer and configured with the same number of channels.
[0102] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0103] In the embodiments of the present application, by performing image preprocessing on the image to be segmented, the regional contrast of the lesion area can be improved, and the interference of non-related image features on the lesion area segmentation can be avoided. When the lesion area segmentation model is used to segment the lesion area, the cross-layer feature fusion is performed through the jump connection module, and the features of different resolutions of multiple network layers can be used to improve the ability to capture long-range relationships, improve the accuracy of the ground-glass shadow segmentation of the pneumonia edge area, and thus achieve accurate segmentation of the pneumonia lesion area.
[0104] The above text describes the lesion area segmentation device of the embodiment of the present invention from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can also be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the lesion area segmentation method embodiment in the embodiment of the present invention can be completed by the integrated logic circuit of the hardware in the processor and / or the instructions in software form, and the steps of the lesion area segmentation method applied in conjunction with the embodiment of the present invention can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor are combined to perform. Optionally, the software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above-mentioned lesion area segmentation method embodiment in conjunction with its hardware.
[0105] Figure 8 is a schematic block diagram of an electronic device 800 according to an embodiment of the present invention.
[0106] like Figure 8 As shown, the electronic device 800 may include: The memory 810 and the processor 820, the memory 810 is used to store the computer program and transmit the program code to the processor 820. In other words, the processor 820 can call and run the computer program from the memory 810 to implement the method in the embodiment of the present invention.
[0107] For example, the processor 820 may be configured to execute the above method embodiments according to instructions in the computer program.
[0108] In some embodiments of the present invention, the processor 820 may include but is not limited to: General-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0109] In some embodiments of the present invention, the memory 810 includes but is not limited to: Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct memory bus random access memory (Direct Rambus RAM, DR RAM).
[0110] In some embodiments of the present invention, the computer program may be divided into one or more modules, which are stored in the memory 810 and executed by the processor 820 to complete the method provided by the present invention. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the controller.
[0111] like Figure 8 As shown, the electronic device 800 may further include: The transceiver 830 may be connected to the processor 820 or the memory 810 .
[0112] The processor 820 may control the transceiver 830 to communicate with other devices, specifically, to send data to other devices or receive data sent by other devices. The transceiver 830 may include a transmitter and a receiver. The transceiver 830 may further include an antenna, and the number of antennas may be one or more.
[0113] It should be understood that the various components in the electronic device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.
[0114] The present invention also provides a computer storage medium having a computer program stored thereon, which, when executed by a computer, enables the computer to perform the method of the above method embodiment. In other words, an embodiment of the present invention also provides a computer program product containing instructions, which, when executed by a computer, enables the computer to perform the method of the above method embodiment.
[0115] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (Digital Video Disc, DVD)), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0116] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments applied herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0117] In the several embodiments provided by the present invention, 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 module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules 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 through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0118] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0119] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in this application, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A lesion region segmentation method, characterized in that: include: Performing image preprocessing on the image to be segmented to obtain a target segmented image, wherein the target segmented image contains at least one lesion area, and the image preprocessing at least includes: foreground clipping processing and CT value normalization processing; Inputting the target segmented image into a trained lesion region segmentation model to obtain an image segmentation result of the lesion region, wherein the lesion region segmentation model includes a feature encoder, a skip connection module, and a feature decoder; The step of inputting the target segmented image into a trained lesion region segmentation model to obtain an image segmentation result of the lesion region comprises: Inputting the target segmented image into the feature encoder to obtain a coded feature image output by each of the multiple network layers of the feature encoder, wherein the number of channels configured corresponding to each of the network layers is different; Inputting the multiple encoded feature images corresponding to the multiple network layers into the skip connection module for cross-layer feature fusion processing to obtain a multi-scale non-local feature image; A feature decoder is used to perform feature decoding and fusion processing on the coded feature image and the multi-scale non-local feature image to obtain an image segmentation result of the lesion area.
2. The method according to claim 1, characterized in that The feature encoder includes N first network layers, each of which has a different number of channels configured corresponding to it, and the number of channels increases layer by layer in the N first network layers, and an adaptive soft pooling method is used between the layers of the N first network layers for downsampling, and each of the N first network layers includes a convolution module; The step of inputting the target segmented image into the feature encoder to obtain a coded feature image output by each network layer in a plurality of network layers of the feature encoder comprises: For any one of the N first network layers, using the convolution module configured therein, perform convolution processing on the first input feature to obtain a coded feature image under the number of configured channels corresponding to the current first network layer; Among them, when the current first network layer is the first first network layer, the first input feature image is the target segmentation image; when the current first network layer is any first network layer among the N first network layers except the first first network layer, the first input feature image is the target coding feature image, and the target coding feature image is a feature image obtained by downsampling the coding feature image output by the current first network layer corresponding to the previous first network layer using an adaptive soft pooling method.
3. The method according to claim 2, characterized in that The method further comprises: When the current first network layer is any first network layer except the first first network layer among the N first network layers, an adaptive soft pooling method is used to downsample the encoded feature image output by the previous first network layer to obtain a first input feature image corresponding to the current first network layer; The method of downsampling the coded feature image output by the previous first network layer by using the adaptive soft pooling method to obtain the first input feature image corresponding to the current first network layer includes: For each pixel point in the encoded feature image output by the previous first network layer, an adaptive soft pooling method is used to perform a pooling operation until all pixels complete the pooling operation, thereby obtaining a first input feature image corresponding to the current first network layer; Wherein, for each pixel point in the encoded feature image output by the previous first network layer, an adaptive soft pooling method is used to perform a pooling operation, including: For each pixel point in the encoded feature image output by the previous first network layer, pooling operations are performed using smoothed average pooling and smoothed maximum pooling, respectively, to obtain a first pooling result and a second pooling result, and a final pooling result corresponding to the pixel point is obtained by fusing the first pooling result and the second pooling result.
4. The method according to claim 2, characterized in that: The step of inputting the plurality of encoded feature images corresponding to the plurality of network layers into the skip connection module for cross-layer feature fusion processing to obtain a multi-scale non-local feature image comprises: Inputting the encoded feature images output by the first N-1 first networks in the N first network layers into the adaptive soft pooling module for feature image downsampling, and performing convolution operation to obtain a downsampled feature image with the same number of channels as the Nth first network in the N first network layers; Fusing the N-1 downsampled feature images corresponding to the first N-1 first networks to obtain a first feature image; Performing position coding processing in vertical and horizontal directions on the coded feature image output by the Nth first network in the N first network layers to obtain a position coded image; Inputting the encoded feature image output by the Nth first network in the N first network layers, the position encoded image, and the first feature image into a multi-head self-attention module to perform multi-scale long-range interaction weight calculation to obtain a feature attention image; The feature attention image is semantically fused and feature map corrected to obtain a multi-scale non-local feature image.
5. The method according to claim 4, characterized in that The multi-head self-attention module includes a Q branch, a K branch and a V branch; The step of inputting the encoded feature image output by the Nth first network in the N first network layers, the position encoded image, and the first feature image into a multi-head self-attention module to perform multi-scale long-range interaction weight calculation to obtain a feature attention image includes: Inputting the first feature image into the Q branch for encoding processing to obtain a second feature image; Inputting the encoded feature image output by the Nth first network into the K branch for encoding processing to obtain a third feature image under the K branch; Using the position-coded image, performing position correlation coding of vertical and horizontal branches on the second feature image to obtain a fourth feature image; Calculating a similarity measurement matrix of a multi-scale non-local space corresponding to the second feature image and the third feature image; Based on the fourth feature image and the similarity measure matrix, a feature attention image is generated.
6. The method according to claim 5, characterized in that The semantic fusion and feature map correction processing of the feature attention image to obtain a multi-scale non-local feature image includes: Inputting the encoded feature image output by the Nth first network into the V branch for encoding processing to obtain a fifth feature image under the V branch; Performing a weighted sum operation on the feature attention image and the fifth feature image to obtain a multi-scale non-local spatial response image after strong semantic fusion; An element-wise addition operation is performed on the multi-scale non-local spatial response image and the encoded feature image output by the Nth first network in the N first network layers to obtain a multi-scale non-local feature image.
7. The method according to claim 1, characterized in that The feature decoder includes N second network layers, each of the second network layers is configured with a different number of channels, and the number of channels decreases layer by layer in the N second network layers; The step of performing feature decoding and fusion processing on the coded feature image and the multi-scale non-local feature image using a feature decoder to obtain an image segmentation result of the lesion area includes: For any one of the N second network layers, locating the lesion area on the second input feature to obtain a lesion area feature image under the number of configured channels corresponding to the current second network layer; Determine the lesion area feature image output by the Nth second network layer as the image segmentation result of the lesion area; Among them, when the current second network layer is the first second network layer, the second input features include the multi-scale non-local feature image, and the encoded feature image output by the first network layer configured with the same number of channels as the current second network layer; when the current second network layer is any second network layer among the N second network layers except the first second network layer, the second input features include the lesion area feature image output by the previous second network layer corresponding to the current second network layer, and the encoded feature image output by the first network layer configured with the same number of channels as the current second network layer.
8. A method for segmenting a lesion region, characterized in that: include: A processing module, used for performing image preprocessing on the image to be segmented to obtain a target segmented image, wherein the target segmented image contains at least one lesion area, and the image preprocessing at least includes: foreground clipping processing and CT value normalization processing; A segmentation module, used for inputting the target segmented image into a trained lesion region segmentation model to obtain an image segmentation result of the lesion region, wherein the lesion region segmentation model includes a feature encoder, a skip connection module and a feature decoder; The segmentation module is specifically used for: Inputting the target segmented image into the feature encoder to obtain a coded feature image output by each of the multiple network layers of the feature encoder, wherein the number of channels configured corresponding to each of the network layers is different; Inputting the multiple encoded feature images corresponding to the multiple network layers into the skip connection module for cross-layer feature fusion processing to obtain a multi-scale non-local feature image; A feature decoder is used to perform feature decoding and fusion processing on the coded feature image and the multi-scale non-local feature image to obtain an image segmentation result of the lesion area.
9. An electronic device, characterized in that: include: A processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein the computer program causes a computer to execute the method according to any one of claims 1 to 7.
Citation Information
Cited By
Three-dimensional focus segmentation method and device, electronic equipment and storage medium
CN118918135A
