Improved image segmentation method and system

By introducing a self-attention mechanism based on Euclidean distance in U-Net, the problem of U-Net being difficult to understand global features and segmentation boundary blur is solved, and higher segmentation accuracy and robustness are achieved.

CN119580261APending Publication Date: 2025-03-07JIANGHAN UNIVERSITY

Patent Information

Application Number
CN202411647515.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

The conventional U-Net algorithm has too small receptive field of the convolution kernel, making it difficult to understand the global characteristics of large-scale information, resulting in blurred segmentation boundaries and insufficient accuracy.

Method used

A self-attention mechanism based on Euclidean distance is introduced in U-Net. By paying attention to the degree of difference in information representation between different feature points, large-scale contextual information relationships are modeled, global features are extracted, and information differences are emphasized.

Benefits of technology

The model's learning ability of global features and discrimination ability of similar feature points is improved, segmentation accuracy and robustness are enhanced, and the ambiguity of segmentation boundaries is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119580261A_ABST
    Figure CN119580261A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of image segmentation, and discloses an improved image segmentation method and system. The invention designs a self-attention mechanism based on Euclidean distance, and puts forward a U-Net image segmentation algorithm based on the Euclidean distance self-attention mechanism by embedding the self-attention mechanism into U-Net. According to the self-attention mechanism based on the Euclidean distance, modeling is conducted on a large-range context information relation by paying attention to the difference degree of information representation between different feature points, then global features are extracted, and the information difference is emphasized. A self-attention mechanism based on the Euclidean distance is introduced into the U-Net, so that the large-range information relation of network modeling can be better guided, and the information difference between feature points is concerned and compared, thereby improving the learning ability of the model to global features and the discrimination ability to similar feature points, making up for the defect of fuzzy segmentation boundary, and further improving the segmentation precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image segmentation, and in particular relates to an improved image segmentation method and system. Background Art

[0002] Modern machine vision technology based on deep learning has made significant progress in the past decade. As an important research direction in the field of computer vision and image processing, image segmentation has attracted more and more attention and attention from researchers. Although the current image segmentation technology based on deep learning has pixel-level segmentation capabilities, more and more complex application scenarios still require more accurate and efficient segmentation technologies, such as medical diagnosis, autonomous driving, drones, and even virtual reality and augmented reality technologies. The development of more efficient and accurate image segmentation algorithms can also provide more design ideas and technical solutions for the development of deep learning theory, which has certain scientific research significance and practical value.

[0003] U-Net is one of the most commonly used deep learning models for image segmentation. It is widely used in various image segmentation tasks because of its simple structure, high performance and ability to complete end-to-end learning under the limitation of a small number of training samples. However, the conventional U-Net algorithm also has certain shortcomings and defects. For example, U-Net can only focus on local details because its convolution kernel receptive field is too small, and it is difficult to fully understand the global features of large-scale information, and it is impossible to accurately locate the boundaries and positions of objects. In addition, the features on the segmentation boundaries have high similarity, and U-Net only uses convolution for decoding and identification, which has poor ability and is prone to confusion, resulting in blurred segmentation boundaries.

[0004] Through the above analysis, the problems and defects of the prior art are as follows:

[0005] The conventional U-Net algorithm also has certain shortcomings and defects. For example, U-Net can only focus on local details because its convolution kernel receptive field is too small. It is difficult to fully understand the global characteristics of large-scale information, and it is impossible to accurately locate the boundaries and positions of objects. In addition, the features on the segmentation boundaries have high similarity. U-Net only uses convolution for decoding and identification, and its poor identification ability is prone to confusion, resulting in blurred segmentation boundaries. Summary of the invention

[0006] In view of the problems existing in the prior art, the present invention provides an improved image segmentation method.

[0007] The present invention is implemented in that an improved image segmentation method comprises:

[0008] Step 1, preparation of image data and network model;

[0009] Step 2: Parameter training of the network model;

[0010] Step 3: Performance evaluation test of the segmentation model.

[0011] Furthermore, the image data and the network model are prepared as follows:

[0012] First, you need to prepare a dataset for the segmentation task. Dataset preparation involves collecting and annotating relevant images or directly using public datasets. Image preprocessing can make dataset images more suitable for training and learning. Data preprocessing includes normalization, standardization, and data enhancement operations.

[0013] Secondly, the data needs to be reasonably divided into training set and test set;

[0014] Then build a deep learning segmentation model, namely the U-Net model based on the Euclidean distance self-attention mechanism, and start the training phase after setting the training parameters such as learning rate and batch size.

[0015] Further, the parameter training method of the network model:

[0016] First, initialize the network weights reasonably;

[0017] Then the prepared training data set is input into the network to generate the segmentation result. After that, the loss function is used to calculate the difference loss between the segmentation prediction map and the true label, and the network parameters are adjusted by back propagation. At the same time, the network score is tested by the evaluation index.

[0018] Finally, the network parameters are continuously optimized through iterative training until the loss of the segmentation result converges to an appropriate range, that is, the network model training is terminated. At this time, the saved network weight parameters with the highest evaluation score are read as the final segmentation model.

[0019] Further, the performance evaluation test method of the segmentation model is:

[0020] First, the test set images are input into the trained network model, and the performance of the segmentation network is evaluated by calculating multiple evaluation indicators of the segmentation results.

[0021] Then save the evaluation index data and the segmentation result map to prepare the data foundation for subsequent qualitative analysis;

[0022] Finally, by comparing the test set segmentation results with the training set segmentation results, determine whether overfitting occurs; if overfitting occurs, it is necessary to consider data, model and training strategy factors and retrain; if there is no problem, the trained model can be deployed to actual applications for use.

[0023] Another object of the present invention is to provide an improved image segmentation system comprising:

[0024] Data preparation module, used for preparation of image data and network models;

[0025] Training module, used for parameter training of network models;

[0026] The testing module is used for performance evaluation testing of the segmentation model.

[0027] Another object of the present invention is to provide a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the improved image segmentation method.

[0028] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the improved image segmentation method.

[0029] Another object of the present invention is to provide an information data processing terminal, wherein the information data processing terminal is used to implement the improved image segmentation system.

[0030] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:

[0031] First, in view of the problem that conventional U-Net has difficulty in understanding global features and blurred segmentation boundaries, the present invention designs a self-attention mechanism based on Euclidean distance, embeds it into U-Net, and proposes a U-Net image segmentation algorithm based on Euclidean distance self-attention mechanism. The self-attention mechanism based on Euclidean distance models a wide range of contextual information relationships by focusing on the degree of difference in information representation between different feature points, thereby extracting global features and emphasizing information differences. Introducing a self-attention mechanism based on Euclidean distance in U-Net can better guide the network to model a wide range of information relationships and focus on the information differences between contrasting feature points, thereby improving the model's ability to learn global features and identify similar feature points, so as to make up for the defect of blurred segmentation boundaries and improve segmentation accuracy.

[0032] Second, the technical solution of the present invention solves the following technical problems of the prior art:

[0033] 1. Insufficient image segmentation accuracy: Current image segmentation technology has certain limitations in segmentation accuracy and robustness in complex scenes (such as medical images or satellite images). In particular, when processing images with high noise, low contrast or complex backgrounds, existing methods often find it difficult to achieve high-accuracy segmentation.

[0034] 2. Training data preparation and processing issues: In existing technologies, the preprocessing and enhancement steps of image data are often not systematic enough, resulting in insufficient quality and diversity of training data sets, which in turn affects the training effect and generalization ability of the segmentation model.

[0035] 3. Low model optimization efficiency: Traditional model training methods often lack efficient optimization strategies for deep learning model parameters, resulting in a long training process and difficulty in achieving optimal performance. The model's overfitting problem is also relatively serious.

[0036] 4. Single performance evaluation standard: Existing performance evaluation methods rely on only a small number of indicators and cannot fully reflect the performance of segmentation models in practical applications. In particular, when comparing the performance of training sets and test sets, there is a lack of effective overfitting detection mechanisms.

[0037] The significant technical progress obtained by the present invention:

[0038] 1. Improve segmentation accuracy and robustness: The present invention adopts the U-Net model based on the Euclidean distance self-attention mechanism. Compared with the traditional segmentation model, the combination of the self-attention mechanism and the Euclidean distance can more accurately capture the detailed features in the image and improve the segmentation accuracy and robustness in complex scenes.

[0039] 2. Systematic data preparation and processing: The present invention proposes a systematic data preparation scheme, including data collection, labeling, preprocessing and enhancement steps, which effectively improves the quality and diversity of the training data set, thereby enhancing the training effect and generalization ability of the model.

[0040] 3. Optimize training efficiency: Through reasonable network initialization, loss function selection and back-propagation optimization strategy, the present invention significantly improves the efficiency of model training. Performance optimization during iterative training ensures that the model can reach a higher performance level in a shorter time while reducing the risk of overfitting.

[0041] 4. Comprehensive performance evaluation: The performance evaluation method of the present invention combines multiple evaluation indicators to provide a comprehensive evaluation of the comprehensive performance of the segmentation model. By comparing the segmentation results of the test set and the training set, the overfitting problem can be effectively detected and the model can be adjusted in a targeted manner to ensure the reliability and effectiveness of the model in practical applications.

[0042] In summary, the present invention has made significant progress in image segmentation accuracy, training efficiency, data processing, and performance evaluation, and provides a more efficient and reliable solution for image segmentation tasks in various practical applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a flow chart of an improved image segmentation method provided by an embodiment of the present invention.

[0044] Figure 2 It is a structural block diagram of an improved image segmentation system provided by an embodiment of the present invention.

[0045] Figure 3 It is a self-attention module diagram based on Euclidean distance provided in an embodiment of the present invention.

[0046] Figure 4 It is a U-Net model diagram based on the Euclidean distance self-attention mechanism provided in an embodiment of the present invention.

[0047] Figure 5 It is a flow chart of the algorithm for deep learning image segmentation provided by an embodiment of the present invention.

[0048] Figure 6 It is a segmentation result diagram of case experiment 1 provided in an embodiment of the present invention.

[0049] Figure 7 This is a segmentation result diagram of case experiment 2 provided in an embodiment of the present invention.

[0050] Figure 8 This is a segmentation result diagram of case experiment 3 provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0052] Example 1

[0053] In the field of medical image processing, accurate segmentation of tumor areas in CT images is crucial for subsequent diagnosis and treatment planning.

[0054] 1. Data preparation:

[0055] Data acquisition unit: collects CT image data containing the tumor area, and the data comes from the hospital's imaging database.

[0056] Labeling unit: Use professional medical image labeling tools to manually label the tumor area in the CT image and generate accurate label data.

[0057] Data preprocessing unit: normalize the image (such as adjusting the pixel value range to 0-1), standardize it (such as adjusting the mean and variance), and use data augmentation techniques (such as rotation, translation, and flipping) to expand the training data set.

[0058] Data division unit: divide the preprocessed image data into a training set (80%) and a test set (20%).

[0059] 2. Model construction:

[0060] Model building module: Build a U-Net model based on the Euclidean distance self-attention mechanism, set the learning rate to 0.001, the batch size to 16, and initialize the network weights.

[0061] 3. Training process:

[0062] Network initialization unit: Use Xavier initialization to initialize the network weights.

[0063] Segmentation training unit: Input the training data set into the U-Net model to generate segmentation results. Use the cross entropy loss function to calculate the difference between the predicted results and the true labels, perform back propagation and adjust the network parameters.

[0064] Optimization unit: Optimize network parameters through iterative training until the training loss converges.

[0065] Model saving unit: saves the network weight parameters with the highest evaluation score as the final model.

[0066] 4. Evaluation Test:

[0067] Evaluation test module: Input the test set images into the trained model and calculate the evaluation indicators of the segmentation results, such as accuracy, recall rate and F1 score.

[0068] Data preservation and analysis: Save the evaluation index data and segmentation result map to provide a data basis for subsequent analysis.

[0069] Overfitting detection: Compare the segmentation results of the training set and the test set to determine whether overfitting occurs and retrain the model if necessary.

[0070] Example 2

[0071] In the field of satellite image processing, accurate segmentation of urban road areas is very important for urban planning and traffic management.

[0072] 1. Data preparation:

[0073] Data collection unit: obtains high-resolution satellite images covering urban areas from satellite image providers.

[0074] Annotation unit: Use image annotation tools to annotate urban roads and generate label data for road areas.

[0075] Data preprocessing unit: standardize the image (such as adjusting the pixel value range to 0-255) and perform data augmentation (such as color jittering and random cropping) to increase the diversity of training data.

[0076] Data division unit: divides the processed image data into a training set (70%) and a test set (30%).

[0077] 2. Model construction:

[0078] Model building module: Build a U-Net model based on the Euclidean distance self-attention mechanism, set the learning rate to 0.01, the batch size to 8, and initialize the network weights.

[0079] 3. Training process:

[0080] Network initialization unit: Use He initialization to initialize the network weights.

[0081] Segmentation training unit: Input the training dataset into the U-Net model to generate road segmentation results. Use the Dice coefficient as the loss function to optimize model performance.

[0082] Optimization unit: Optimize network parameters through iterative training and monitor the performance on the validation set until the loss converges.

[0083] Model saving unit: saves the network weight parameters with the best performance as the final model.

[0084] 4. Evaluation Test:

[0085] Evaluation test module: Input the test set images into the trained model and calculate the evaluation indicators of the segmentation results, such as Dice coefficient and IoU (Intersection over Union).

[0086] Data preservation and analysis: Save the evaluation index data and segmentation result map to provide a data basis for subsequent analysis.

[0087] Overfitting detection: By comparing the segmentation results of the training set and the test set, check whether overfitting occurs and readjust the training strategy if necessary.

[0088] like Figure 1 As shown, an improved image segmentation method provided by an embodiment of the present invention comprises the following steps:

[0089] S101, preparation of image data and network model;

[0090] S102, parameter training of the network model;

[0091] S103, performance evaluation test of the segmentation model.

[0092] The method for preparing image data and network model provided by the embodiment of the present invention is as follows:

[0093] First, you need to prepare a dataset for the segmentation task. Dataset preparation involves collecting and annotating relevant images or directly using public datasets. Image preprocessing can make dataset images more suitable for training and learning. Data preprocessing includes normalization, standardization, and data enhancement operations.

[0094] Secondly, the data needs to be reasonably divided into training set and test set;

[0095] Then build a deep learning segmentation model, namely the U-Net model based on the Euclidean distance self-attention mechanism, and start the training phase after setting the training parameters such as learning rate and batch size.

[0096] The parameter training method of the network model provided by the embodiment of the present invention:

[0097] First, initialize the network weights reasonably;

[0098] Then the prepared training data set is input into the network to generate the segmentation result. After that, the loss function is used to calculate the difference loss between the segmentation prediction map and the true label, and the network parameters are adjusted by back propagation. At the same time, the network score is tested by the evaluation index.

[0099] Finally, the network parameters are continuously optimized through iterative training until the loss of the segmentation result converges to an appropriate range, that is, the network model training is terminated. At this time, the saved network weight parameters with the highest evaluation score are read as the final segmentation model.

[0100] The performance evaluation test method of the segmentation model provided by the embodiment of the present invention is as follows:

[0101] First, the test set images are input into the trained network model, and the performance of the segmentation network is evaluated by calculating multiple evaluation indicators of the segmentation results.

[0102] Then save the evaluation index data and the segmentation result map to prepare the data foundation for subsequent qualitative analysis;

[0103] Finally, by comparing the test set segmentation results with the training set segmentation results, determine whether overfitting occurs; if overfitting occurs, it is necessary to consider data, model and training strategy factors and retrain; if there is no problem, the trained model can be deployed to actual applications for use.

[0104] like Figure 2 As shown, an improved image segmentation system provided by an embodiment of the present invention includes:

[0105] Data preparation module, used for preparation of image data and network models;

[0106] Training module, used for parameter training of network models;

[0107] The testing module is used for performance evaluation testing of the segmentation model.

[0108] Another object of the present invention is to provide a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the improved image segmentation method.

[0109] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the improved image segmentation method.

[0110] Another object of the present invention is to provide an information data processing terminal, wherein the information data processing terminal is used to implement the improved image segmentation system.

[0111] The present invention is specifically implemented:

[0112] 1. Self-attention mechanism based on Euclidean distance

[0113] The attention mechanism selectively focuses on certain valid information in a large amount of input information, while ignoring unimportant information. It uses certain prior information to allow machine learning to assign certain weights to the extracted feature information, thereby suppressing useless information and focusing on key information. The self-attention mechanism tends to focus on the interaction between different parts of the data, and can achieve global modeling of a wide range of features, capturing the correlation between long-distance features, and effectively making up for the defect that convolution is insensitive to long-distance information relationships. In the self-attention mechanism, the feature point information at each position on the feature map will be represented as a vector, and the attention weight score is calculated by quantifying the correlation between these vectors.

[0114] Traditional self-attention mechanisms quantify vector correlations based on calculating the dot product and cosine similarity of vectors to reflect the degree of similarity and obtain attention weights.

[0115] Traditional self-attention mechanisms use matrix multiplication of feature vectors to calculate the cosine similarity between feature points, thereby quantifying the correlation of internal elements, modeling global information relationships, and then assigning attention weights. However, in addition to cosine similarity, the degree of similarity can also be evaluated by Euclidean distance. Euclidean distance is one of the methods for measuring vector correlation, which is usually used to calculate the spatial distance or degree of difference between two vectors. The Euclidean distance calculation formula is as follows:

[0116]

[0117] Where x and y represent two different vectors, n represents a vector with n elements in total, and x i ,y i Represents the i-th element of x and y vectors respectively.

[0118] The self-attention mechanism based on Euclidean distance designed by the present invention is to quantify the correlation modeling global information relationship through the Euclidean distance between different feature points to allocate attention weight scores. The calculation method of the self-attention mechanism based on Euclidean distance for the input feature signal is as follows:

[0119] Q=W Q X

[0120] V=W V X (2)

[0121] It first reshapes the input signal into two row vectors through linear mapping.

[0122] Then, the Euclidean distance between vector elements is calculated by broadcasting and subtracting the vectors and performing element-by-element square, summation, and square root operations to obtain a feature matrix A that reflects the correlation between feature points. The calculation formula of matrix A is as follows:

[0123]

[0124] The value of each element in the matrix A m It reflects the Euclidean distance between its feature points, and its A m The calculation formula is as follows:

[0125]

[0126] Where QT is the transpose of Q. At this time, Q-QT is subtracted by broadcasting operation so a matrix can be obtained. The sum function sums the last dimension of the tensor. m represents the mth element of matrix A, Q m and Q i Represents the mth and ith elements of Q.

[0127] Finally, the feature matrix A is normalized to obtain a reasonable weight score, and then weighted to the vector V to reshape the output. The calculation formula of the attention weight matrix is ​​as follows:

[0128]

[0129] The traditional self-attention mechanism is to model the relationship of large-scale context information by focusing on the similarity of information representation in different feature expression spaces, while the self-attention mechanism based on Euclidean distance tends to focus on the difference of information representation in the same feature expression space. Therefore, the self-attention mechanism based on Euclidean distance can further extract the information difference between different feature points in similar features, and then guide the network to better identify pixels with similar features but different categories. The implementation module of the self-attention mechanism based on Euclidean distance is as follows: Figure 3 shown.

[0130] Figure 3 The red and green squares in the middle represent two tensors with different feature expressions; the blue wireframe performs broadcast subtraction operations; the cyan wireframe represents the square function that squares each element; the flesh-colored wireframe represents the sum function that sums the last dimension of the tensor; the orange wireframe represents the sqrt function that takes the square root of each element; and the purple wireframe represents the softmax normalization operation.

[0131] The self-attention mechanism based on Euclidean distance can not only extract the correlation between different internal feature points, thereby realizing the modeling of large-scale information dependency relationships, but also can further focus on and compare the differences between feature points to optimize network parameters compared to the traditional self-attention mechanism, so that the network can better distinguish pixels with similar features but different categories, thereby improving segmentation accuracy.

[0132] 2. U-Net model based on Euclidean distance self-attention mechanism

[0133] Since the decoding and encoding process of conventional U-Net uses convolution kernels with small receptive fields for feature extraction, it is difficult to integrate large-scale global information relationships. The self-attention mechanism makes up for the defect of being unable to model long-distance information dependencies.

[0134] The U-Net segmentation network based on the Euclidean distance self-attention mechanism proposed in the present invention is based on the structure of U-Net, and the newly designed Euclidean distance self-attention mechanism is embedded into the last encoding layer at the bottom of the network. Its specific network structure is as follows.

[0135] Figure 4 In the figure, the left side of the network is the encoding stage, and the right side is the decoding stage. The DoubleConv layers in the encoding and decoding stages have undergone two convolutional layers, normalization layers, and activation layers. The gray downward arrows represent the maximum pooling layer to reduce the size of the feature map, and the gray upward arrows represent the upsampling to expand the size of the feature map. The blue dotted arrows represent the skip connection, which transmits the feature map output of each scale to the corresponding decoder layer. EDSA represents the self-attention module based on Euclidean distance.

[0136] Embedding the self-attention mechanism based on Euclidean distance in the U-Net model can help the network realize large-scale contextual information relationship modeling, thereby improving the model's ability to learn global features. In addition, the self-attention mechanism based on Euclidean distance can better guide the network to further focus on and compare the information differences between feature points, helping the network to identify feature points with similar features but different categories, thereby improving the model's identification ability, compensating for the defect of blurred segmentation boundaries and improving segmentation accuracy.

[0137] 3. Logic diagram of algorithm flow

[0138] The inventive method is an image segmentation method based on deep learning. Its specific implementation method is basically consistent with the algorithm flow of deep learning image segmentation. The schematic diagram of its algorithm flow is as follows Figure 5 shown.

[0139] exist Figure 5 In the figure, the left side is the preparation of image data and network model, the middle is the parameter training of the network model, and the right side is the performance evaluation test of the segmentation model.

[0140] First, it is necessary to prepare a data set corresponding to the segmentation task. Data set preparation involves collecting and annotating relevant images or directly using a public data set. Image preprocessing can make the data set images more suitable for training and learning. Data preprocessing includes normalization, standardization, data enhancement and other operations. Secondly, the data needs to be reasonably divided into training sets and test sets. Then build a deep learning segmentation model, that is, the U-Net model based on the Euclidean distance self-attention mechanism proposed in the present invention. After setting training parameters such as learning rate and batch size, the training phase can begin.

[0141] The training part of network parameters: First, the network weights are initialized reasonably, and then the prepared training data set is input into the network to generate the segmentation results. Then, the loss function is used to calculate the difference loss between the segmentation prediction map and the true label, so as to adjust the network parameters through back propagation, and the network score is tested through the evaluation index. Finally, the network parameters are continuously optimized through iterative training until the loss of the segmentation result converges to a suitable range, that is, the network model training is terminated, and then the saved network weight parameters with the highest evaluation score are read as the final segmentation model.

[0142] Network model testing part: First, input the test set images into the trained network model, and evaluate the performance of the segmentation network by calculating multiple evaluation indicators of the segmentation results. Then save the evaluation indicator data and the segmentation result graph to prepare the data foundation for subsequent qualitative analysis. Finally, by comparing the test set segmentation results with the training set segmentation results, determine whether overfitting occurs. If overfitting occurs, it is necessary to consider factors such as data, model, and training strategy and retrain. If there is no problem, the trained model can be deployed to actual applications for use.

[0143] The segmentation dataset used in case experiment 1 is a public dataset, which contains a total of 1,844 two-dimensional lung CT scan images and the corresponding segmentation annotations of pneumonia infection areas. The data format is NIFTI. The images in this dataset are from CT scans of 20 COVID-19 confirmed patients provided by the medical education research organizations Coronacases Initiative and Radiopaedia, and the segmentation annotations of their lung infection areas were made by several radiologists. This case experiment selected 250 valid images containing lung infection areas from the segmentation dataset for the segmentation task. The image size was unified into 480*480, and the training set and test set were randomly allocated in a 4:1 ratio. The training set was then augmented using 8 different methods such as rotation, scaling, and cutting.

[0144] In order to verify the effectiveness of the improved optimization of the U-Net algorithm and self-attention mechanism, this case experiment set up U-Net, U-Net embedded with a self-attention module (U-Net+SA), and U-Net embedded with a Euclidean distance-based self-attention module (EDSA-UNet) for segmentation testing.

[0145] Table 1 Evaluation scores of case experiment 1

[0146]

[0147] Figure 6The segmentation result diagram of case experiment 1. The results in Table 1 show that U-Net+SA has certain improvements in various evaluation indicators compared with U-Net, and the main evaluation indicator DSC has increased by 0.75%, which shows that after embedding the self-attention mechanism, U-Net can effectively improve the network's modeling ability of global information relationships, thereby improving the network segmentation accuracy. At the same time, it can be seen from Table 1 that EDSA-UNet has further improved in various evaluation indicators compared with U-Net and U-Net+SA. Its main evaluation indicator DSC has increased by 2.18% compared with U-Net and 1.43% compared with U-Net+SA. It proves that after introducing EDSA, U-Net can effectively improve the network's ability to model global information relationships and identify similar feature points, thereby further improving the network segmentation accuracy. At the same time, Figure 6 It can also be seen from the segmentation effect diagrams that EDSA-UNet has a better segmentation effect, and its segmentation result diagram is closer to the contour shape of the label.

[0148] The DRIVE (Digital Retinal Images for Vessel Extraction) dataset used in case experiment 2 has a total of 40 JPEG-format color fundus images and corresponding segmentation annotations of pneumonia-infected areas. The resolution of each image is 584*565 pixels. The images in this dataset come from a diabetic retinopathy screening program in the Netherlands, and each image is manually segmented by an ophthalmologist. This case experiment scales all the images to 512*512, and then randomly allocates a 1:1 training set and test set. Finally, in order to improve the generalization ability of model training, the ablation experiment in this chapter uses 8 different methods such as rotation, scaling, and cutting to augment the training set.

[0149] This case experiment sets up U-Net, U-Net embedded with self-attention module (U-Net+SA), and U-Net embedded with Euclidean distance-based self-attention module (EDSA-UNet) for segmentation testing.

[0150] Table 2 Evaluation scores of case experiment 2

[0151]

[0152] Figure 7The segmentation result diagram of case experiment 2. The results in Table 2 show that U-Net+SA has certain improvements in various evaluation indicators compared to U-Net, and the main evaluation indicator DSC has increased by 2.18%, indicating that after embedding the self-attention mechanism, U-Net can effectively improve the network's modeling ability of global information relationships, thereby improving the network segmentation accuracy. At the same time, it can be seen from Table 1 that EDSA-UNet has further improved in various evaluation indicators compared to U-Net and U-Net+SA. Its main evaluation indicator DSC has increased by 2.46% compared to U-Net and 0.28% compared to U-Net+SA. It proves that after introducing EDSA, U-Net can effectively improve the network's ability to model global information relationships and identify similar feature points, thereby further improving the network segmentation accuracy. At the same time, Figure 7 It can also be seen from the segmentation effect diagrams that EDSA-UNet has a better segmentation effect, and its segmentation result diagram is closer to the contour shape of the label.

[0153] Case study 3 selected a segmentation dataset of plant leaf pests and diseases. There are 588 images in total, all of which are images of leaves infected by pests and diseases, including several common leaf diseases and pests. The segmentation labels mark the leaf lesion infection area and the pest part. Before the experiment, all images were resized to 256*256, and the training set and test set were randomly allocated at a ratio of 5:1. Considering that the dataset has few images, the training set was augmented using four different methods: rotation, scaling, and cutting.

[0154] This case experiment sets up U-Net, U-Net embedded with self-attention module (U-Net+SA), and U-Net embedded with Euclidean distance-based self-attention module (EDSA-UNet) for segmentation testing.

[0155] Table 3 Evaluation scores of case experiment 3

[0156]

[0157] Figure 8The segmentation result diagram of case experiment 3. The results in Table 3 show that U-Net+SA has certain improvements in various evaluation indicators compared with U-Net, and the main evaluation indicator DSC has increased by 1.43%, which shows that after embedding the self-attention mechanism, U-Net can effectively improve the network's modeling ability of global information relationships, thereby improving the network segmentation accuracy. At the same time, it can be seen from Table 1 that EDSA-UNet has further improved in various evaluation indicators compared with U-Net and U-Net+SA. Its main evaluation indicator DSC has increased by 4.88% compared with U-Net and 3.45% compared with U-Net+SA. It proves that after introducing EDSA, U-Net can effectively improve the network's ability to model global information relationships and identify similar feature points, thereby further improving the network segmentation accuracy. At the same time, Figure 8 It can also be seen from the segmentation effect diagrams that EDSA-UNet has a better segmentation effect, and its segmentation result diagram is closer to the contour shape of the label.

[0158] An embodiment of the present invention provides an image segmentation system, including:

[0159] The data preparation module is used to prepare the data set corresponding to the segmentation task, including image collection and annotation, data preprocessing (such as normalization, standardization and data enhancement operations);

[0160] Data partitioning module, used to reasonably divide the prepared data set into training set and test set;

[0161] Model building module, used to build a U-Net model based on the Euclidean distance self-attention mechanism and set training parameters;

[0162] The training module is used to initialize the network weights, input the training data set into the network, generate segmentation results, calculate the difference between the segmentation prediction map and the true label through the loss function, perform back propagation to adjust the network parameters, and test the network score through the evaluation index;

[0163] The evaluation test module is used to input the test set images into the trained network model, calculate multiple evaluation indicators to evaluate the performance of the segmentation model, and save the evaluation indicator data and the segmentation result map for qualitative analysis.

[0164] The data preparation module also includes:

[0165] a data acquisition unit for collecting relevant image data from different sources;

[0166] An annotation unit, used to annotate the collected images;

[0167] A data preprocessing unit is used to normalize, standardize and perform data enhancement operations on image data to make the data suitable for training and learning;

[0168] The data partitioning unit is used to divide the preprocessed data set into a training set and a test set for model training and evaluation.

[0169] The training modules include:

[0170] The network initialization unit is used to reasonably initialize the network weights;

[0171] The segmentation training unit is used to input the training data set into the network to generate segmentation results, and use the loss function to calculate the loss between the predicted results and the true labels, and perform back propagation to adjust the network parameters;

[0172] The optimization unit is used to continuously optimize the network parameters through iterative training until the loss converges to a suitable range;

[0173] The model saving unit is used to save the network weight parameters with the highest evaluation score as the final segmentation model.

[0174] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.

[0175] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.

Claims

1. An improved image segmentation method, characterized in that: The following steps are involved: Step 1, preparation of image data and network model; Step 2: Parameter training of the network model; Step 3: Performance evaluation test of the segmentation model.

2. The improved image segmentation method according to claim 1, characterized in that: The image data and network model are prepared as follows: First, you need to prepare a dataset for the segmentation task. Dataset preparation involves collecting and annotating relevant images or directly using public datasets. Image preprocessing can make dataset images more suitable for training and learning. Data preprocessing includes normalization, standardization, and data enhancement operations. Secondly, the data needs to be reasonably divided into training set and test set; Then build a deep learning segmentation model, namely the U-Net model based on the Euclidean distance self-attention mechanism, and start the training phase after setting the training parameters such as learning rate and batch size.

3. The improved image segmentation method according to claim 1, characterized in that: Parameter training method of the network model: First, initialize the network weights reasonably; Then the prepared training data set is input into the network to generate the segmentation result. After that, the loss function is used to calculate the difference loss between the segmentation prediction map and the true label, and the network parameters are adjusted by back propagation. At the same time, the network score is tested by the evaluation index. Finally, the network parameters are continuously optimized through iterative training until the loss of the segmentation result converges to an appropriate range, that is, the network model training is terminated. At this time, the saved network weight parameters with the highest evaluation score are read as the final segmentation model.

4. The improved image segmentation method according to claim 1, characterized in that: Performance evaluation test method of the segmentation model: First, the test set images are input into the trained network model, and the performance of the segmentation network is evaluated by calculating multiple evaluation indicators of the segmentation results. Then save the evaluation index data and the segmentation result map to prepare the data foundation for subsequent qualitative analysis; Finally, by comparing the test set segmentation results with the training set segmentation results, determine whether overfitting occurs; if overfitting occurs, it is necessary to retrain considering data, model and training strategy factors; If there is no problem, the trained model can be deployed to actual applications for use.

5. An improved image segmentation system implementing the method according to any one of claims 1 to 4, characterized in that: The improved image segmentation system comprises: The data preparation module is used to prepare the data set corresponding to the segmentation task, including image collection and annotation, and data preprocessing; Data partitioning module, used to reasonably divide the prepared data set into training set and test set; Model building module, used to build a U-Net model based on the Euclidean distance self-attention mechanism and set training parameters; The training module is used to initialize the network weights, input the training data set into the network, generate segmentation results, calculate the difference between the segmentation prediction map and the true label through the loss function, perform back propagation to adjust the network parameters, and test the network score through the evaluation index; The evaluation test module is used to input the test set images into the trained network model, calculate multiple evaluation indicators to evaluate the performance of the segmentation model, and save the evaluation indicator data and the segmentation result map for qualitative analysis.

6. The image segmentation system according to claim 5, characterized in that: The data preparation module also includes: a data acquisition unit for collecting relevant image data from different sources; An annotation unit, used to annotate the collected images; A data preprocessing unit is used to normalize, standardize and perform data enhancement operations on image data to make the data suitable for training and learning; The data partitioning unit is used to divide the preprocessed data set into a training set and a test set for model training and evaluation.

7. The image segmentation system according to claim 5, characterized in that: The training module includes: The network initialization unit is used to reasonably initialize the network weights; The segmentation training unit is used to input the training data set into the network to generate segmentation results, and use the loss function to calculate the loss between the predicted results and the true labels, and perform back propagation to adjust the network parameters; The optimization unit is used to continuously optimize the network parameters through iterative training until the loss converges to a suitable range; The model saving unit is used to save the network weight parameters with the highest evaluation score as the final segmentation model.

8. A computer device, characterized in that: The computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the improved image segmentation method according to any one of claims 1 to 4.

9. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the improved image segmentation method according to any one of claims 1 to 4.

10. An information data processing terminal, characterized in that: The information data processing terminal is used to implement the improved image segmentation system as claimed in claim 5.

Citation Information

Patent Citations

  • Assembly change detection method and device based on attention mechanism and medium

    CN113269237A

  • CTA scanning image processing method and system

    CN116630386A

  • Medical image segmentation method based on improved U-Net model

    CN117710382A

  • Medical image segmentation model establishment method based on harmonic attention and medical image segmentation method

    CN118967714A

  • Medical image segmentation method based on u-net

    US20220309674A1

Cited By

  • Method and system for intelligently monitoring and evaluating growth state of polystichum crassifolium

    CN121982527A