Search

CN-115311219-B - Image processing method, device, terminal equipment and storage medium

CN115311219BCN 115311219 BCN115311219 BCN 115311219BCN-115311219-B

Abstract

The invention discloses an image processing method, an image processing device, terminal equipment and a storage medium, wherein an image to be processed is obtained; processing the image to be processed based on a pre-trained multi-head attention mechanism model to obtain an image block segmentation result, learning the image block segmentation result based on a pre-trained deep bi-directional learning model to obtain a primary segmentation image, and processing the primary segmentation image through a post-processing algorithm to obtain a target segmentation image. The image to be processed is processed through the multi-head attention mechanism model to obtain an image block segmentation result, then the image block segmentation result is learned by adopting the deep bidirectional learning model to obtain a primary segmentation image, so that the adjacent image blocks can be linked, the rationality and the integrity of the whole segmentation result are improved, the primary segmentation image is processed by adopting a post-processing algorithm to obtain a target segmentation image, and the accuracy of image segmentation is improved.

Inventors

  • LIU ZHENDONG
  • MA JUN
  • ZHENG LINGXIAO
  • LAN HONGZHI

Assignees

  • 深圳睿心智能医疗科技有限公司
  • 深圳睿心智能医疗科技有限公司

Dates

Publication Date
20260421
Application Date
20220726
Priority Date
20220726

Claims (7)

  1. 1. An image processing method, characterized in that the image processing method comprises the steps of: Acquiring an image to be processed; processing the image to be processed based on a pre-trained multi-head attention mechanism model to obtain an image block segmentation result, wherein the multi-head attention mechanism model comprises an encoder and a decoder, jump connection and attention mechanism are adopted between the encoder and the decoder for carrying out feature fusion, the encoder is a transducer, and the decoder is a CNN; The steps of processing the image to be processed based on the pre-trained multi-head attention mechanism model to obtain the image block segmentation result comprise the following steps: The method comprises the steps of obtaining a sample image and a corresponding real label, inputting the sample image into an encoder to extract abstract features to obtain fused abstract features, passing the fused abstract features through the decoder layer by layer to obtain a corresponding probability map, calculating the loss of the probability map output by each layer in the decoder on the corresponding real label to obtain total loss, and carrying out parameter iteration in a circulation mode until the total loss converges to obtain the multi-head attention mechanism model; Learning the image block segmentation result based on a pre-trained deep bi-directional learning model to obtain an initial segmentation image; Processing the primary segmented image through a post-processing algorithm to obtain a target segmented image, wherein the processing comprises the steps of performing volume post-processing on the primary segmented image through a connected domain volume post-processing algorithm to obtain a volume post-processing image; The step of performing distance post-processing on the volume post-processing image by the connected domain distance post-processing algorithm to obtain the target segmentation image comprises the following steps: acquiring each connected domain of the volume post-processing image, and calculating the volume of each connected domain in the volume post-processing image; Selecting an initial connected domain from all connected domains in the volume post-processing image based on a preset rule, wherein the connected domain with the largest volume is used as the initial connected domain; Calculating representative coordinates of the initial connected domain, and sequentially calculating distance values from each connected domain to the initial connected domain in the volume post-processing image according to the representative coordinates of the initial connected domain; And clearing the connected domain with the distance value larger than a preset distance threshold value in each connected domain in the volume post-processing image to obtain the target segmentation image.
  2. 2. The image processing method according to claim 1, wherein the step of acquiring the image to be processed includes: acquiring an original image; normalizing the original image to obtain a normalized image; and carrying out gray level clipping on the standardized image to obtain the image to be processed.
  3. 3. The image processing method according to claim 1, wherein the deep bi-directional learning model includes a sequence learning layer, a convolution layer and a logistic regression layer, and the step of learning the image block segmentation result based on the pre-trained deep bi-directional learning model to obtain the initial segmentation image further includes: acquiring the sample image and a corresponding real label; sequentially inputting the feature sequences in the sample images into a sequence learning layer to be spliced and fused to obtain first learning information; Obtaining a segmentation probability map according to the first learning information through the convolution layer and the logistic regression layer; Calculating the loss of the segmentation probability map about the corresponding real label to obtain a predicted loss; And carrying out parameter iteration by using the loop until the prediction loss converges, and obtaining the deep bidirectional learning model.
  4. 4. The image processing method according to claim 1, wherein the step of performing volume post-processing on the initially segmented image by the connected domain volume post-processing algorithm to obtain a volume post-processed image includes: acquiring each connected domain in the primary segmentation image, and calculating the volume of each connected domain in the primary segmentation image; Calculating a first volume of the connected domain according to the volume of each connected domain in the primary segmentation image; calculating rejection rate of each connected domain in the initial segmentation image according to the volume of each connected domain in the initial segmentation image and the first volume of the connected domain, wherein the volume of each connected domain is v i , and the first volume of the connected domain is The rejection rate is r reject =v i /v t ; and clearing the connected domain with the rejection rate smaller than a preset rejection rate threshold value in each connected domain in the initial segmentation image to obtain the volume post-processing image.
  5. 5. An image processing apparatus, characterized in that the image processing apparatus comprises: the acquisition module is used for acquiring the image to be processed; The image block segmentation module is used for processing the image to be processed based on a pre-trained multi-head attention mechanism model to obtain an image block segmentation result, wherein the multi-head attention mechanism model comprises an encoder and a decoder, the encoder and the decoder adopt jump connection and an attention mechanism to perform feature fusion, the encoder is a transducer, and the decoder is a CNN; The steps of processing the image to be processed based on the pre-trained multi-head attention mechanism model to obtain the image block segmentation result comprise the following steps: obtaining a sample image and a corresponding real label, inputting the sample image into the encoder to extract abstract features to obtain fused abstract features, passing the fused abstract features layer by layer through the decoder to obtain a corresponding probability map, calculating the loss of the probability map output by each layer in the decoder with respect to the corresponding real label to obtain a total loss, and performing parameter iteration in a loop until the total loss converges to obtain the multi-head attention mechanism model The sequence learning module is used for learning the image block segmentation result based on a pre-trained deep bidirectional learning model to obtain a primary segmentation image; The post-processing module is used for processing the primary segmented image through a post-processing algorithm to obtain a target segmented image, and comprises the steps of performing volume post-processing on the primary segmented image through a connected domain volume post-processing algorithm to obtain a volume post-processing image; The post-processing model is further used for obtaining all connected domains of the volume post-processing image, calculating the volume of all the connected domains in the volume post-processing image, selecting an initial connected domain from all the connected domains in the volume post-processing image based on a preset rule, wherein the connected domain with the largest volume is used as the initial connected domain, calculating representative coordinates of the initial connected domain, sequentially calculating distance values from all the connected domains in the volume post-processing image to the initial connected domain according to the representative coordinates of the initial connected domain, and clearing the connected domain with the distance value of the connected domain being larger than a preset distance threshold value in the volume post-processing image to obtain the target segmented image.
  6. 6. A terminal device, characterized in that it comprises a memory, a processor and an image processing program stored on the memory and executable on the processor, which image processing program, when executed by the processor, realizes the steps of the image processing method according to any of claims 1-4.
  7. 7. A computer-readable storage medium, on which an image processing program is stored, which, when executed by a processor, implements the steps of the image processing method according to any one of claims 1-4.

Description

Image processing method, device, terminal equipment and storage medium Technical Field The present invention relates to the field of data processing technologies, and in particular, to an image processing method, an image processing device, a terminal device, and a storage medium. Background With the rapid development of medical imaging equipment, doctors can image blood vessels of various parts of the whole body of a patient by using CTA and MRA. However, manually analyzing vascular lesions in a large amount of image data is obviously a time-consuming and labor-consuming task for the imaging physician. In recent years, with the development of deep learning, a Convolutional Neural Network (CNN) -based blood vessel automatic segmentation method achieves remarkable effects in analyzing blood vessel images. However, due to the locality of convolution operations, CNN-based methods have difficulty learning global context information and long-range spatial dependencies. Furthermore, since the direct processing of 3D medical data is very computationally intensive, it is often handled and integrated separately for each image block into the final segmentation result. However, this approach does not take into account the interdependencies between adjacent image blocks, and thus does not accurately segment the complete vessel. Therefore, there is a need to propose a solution that improves the accuracy of image segmentation. The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present invention and is not intended to represent an admission that the foregoing is prior art. Disclosure of Invention The invention mainly aims to provide an image processing method, an image processing device, terminal equipment and a storage medium, aiming at improving the accuracy of image segmentation. In order to achieve the above object, the present invention provides an image processing method including: Acquiring an image to be processed; Processing the image to be processed based on a multi-head attention mechanism model trained in advance to obtain an image block segmentation result; Learning the image block segmentation result based on a pre-trained deep bi-directional learning model to obtain an initial segmentation image; And processing the primary segmentation image through a post-processing algorithm to obtain a target segmentation image. Optionally, the step of acquiring the image to be processed includes: acquiring an original image; normalizing the original image to obtain a normalized image; and carrying out gray level clipping on the standardized image to obtain the image to be processed. Optionally, the multi-head attention mechanism model includes an encoder and a decoder, feature fusion is performed between the encoder and the decoder by using jump connection and an attention mechanism, the step of processing the image to be processed based on the multi-head attention mechanism model trained in advance to obtain an image block segmentation result further includes: Acquiring a sample image and a corresponding real label; inputting the sample image into the encoder for abstract feature extraction to obtain fused abstract features; the fused abstract features are passed through the decoder layer by layer to obtain a corresponding probability map; Calculating the loss of the probability map output by each layer in the decoder on the corresponding real label to obtain the total loss; and carrying out parameter iteration by using the loop until the total loss converges to obtain the multi-head attention mechanism model. Optionally, the deep bi-directional learning model includes a sequence learning layer, a convolution layer and a logistic regression layer, and the step of learning the image block segmentation result based on the pre-trained deep bi-directional learning model to obtain the primary segmented image further includes: acquiring the sample image and a corresponding real label; sequentially inputting the feature sequences in the sample images into a sequence learning layer to be spliced and fused to obtain first learning information; Obtaining a segmentation probability map according to the first learning information through the convolution layer and the logistic regression layer; Calculating the loss of the segmentation probability map about the corresponding real label to obtain a predicted loss; And carrying out parameter iteration by using the loop until the prediction loss converges, and obtaining the deep bidirectional learning model. Optionally, the post-processing algorithm includes a connected domain volume post-processing algorithm and/or a connected domain distance post-processing algorithm, and the step of processing the primary segmented image by the post-processing algorithm to obtain a target segmented image includes: performing volume post-processing on the primary segmented image through the connected domain volume post-processing algorithm