Skin lesion image segmentation method and system based on adaptive attention

By constructing an image visual field and attention gating mechanism, combined with a two-way segmentation path and dynamically weighted features, the problem of insufficient segmentation accuracy in skin lesion images is solved, achieving higher segmentation accuracy and robustness.

CN121033082BActive Publication Date: 2026-01-23AFFILIATED HOSPITAL OF SHAANXI UNIV OF TRADITIONAL CHINESE MEDICINE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511554420.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-29
Publication Date
2026-01-23
Estimated Expiration
2045-10-29

AI Technical Summary

Technical Problem

Existing methods for segmenting skin lesion images lack accuracy in complex backgrounds or with blurred boundaries, making it difficult to effectively capture diverse features and boundary information.

Method used

By constructing an image visual field, combining attention gating and two-way segmentation paths, dynamically weighting features, and employing soft attention for initial segmentation and hard attention for binary estimation, accurate skin lesion image segmentation results are generated.

Benefits of technology

It improves the segmentation accuracy and robustness of skin lesion images in complex scenes, and reduces the probability of oversegmentation or undersegmentation, especially in areas with blurred boundaries or complex backgrounds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121033082B_ABST
    Figure CN121033082B_ABST
Patent Text Reader

Abstract

The application discloses a skin lesion image segmentation method and system based on adaptive attention, and relates to the technical field of image processing. The method comprises the following steps: uploading a target image to an image processing platform; after image preprocessing, generating an image visual field by superimposing a pixel distribution on a visual phase field; according to attention gate control, performing dynamic weighting of segmentation features based on the image visual field to determine image attention constraints; triggering an image segmenter with the image attention constraints and the image visual field to perform soft attention preliminary segmentation under a double-pass segmentation path and binary straight-through estimation of focusing on uncertain areas under hard attention, and fitting to generate an image segmentation result. The application solves the technical problem of how to reasonably introduce an adaptive attention mechanism to improve the segmentation accuracy of complex scene images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and more specifically to a method and system for skin lesion image segmentation based on adaptive attention. Background Technology

[0002] Currently, existing methods for segmenting skin lesion images mainly include thresholding, region growing, traditional edge detection, and semantic segmentation networks based on deep learning. Traditional methods often rely on the grayscale or color distribution of the image, which is poorly adapted to complex backgrounds or lesion regions with blurred boundaries, easily leading to oversegmentation or undersegmentation. In recent years, deep convolutional neural networks and encoder-decoder structures have made some progress in medical image segmentation, but some prominent problems still exist.

[0003] First, lesion images vary greatly in texture, color, and shape, resulting in insufficient expression of diverse features by the model. Second, lesion areas often have blurred boundaries and are adjacent to normal tissues, making it difficult for conventional segmentation models to capture boundary information precisely, and their generalization ability for segmentation of different background images is limited.

[0004] In summary, the key question is how to effectively and adaptively introduce attention mechanisms to address the technical challenge of limited accuracy in skin lesion image region segmentation. Summary of the Invention

[0005] This application provides a skin lesion image segmentation method and system based on adaptive attention, which solves the technical problem of how to reasonably introduce an adaptive attention mechanism to solve the limited accuracy of skin lesion image region segmentation in the prior art.

[0006] In view of the above problems, this application provides a method and system for skin lesion image segmentation based on adaptive attention.

[0007] In a first aspect, this application provides a skin lesion image segmentation method based on adaptive attention. The method includes: uploading a target image to an image processing platform; after image preprocessing, superimposing a visual phase field with pixel distribution to generate an image visual field; performing dynamic weighting of segmentation features based on the image visual field according to attention gating to determine image attention constraints; triggering an image segmenter with the image attention constraints and the image visual field, performing soft attention preliminary segmentation under a two-way segmentation path, and fitting the binary pass-through estimation of the uncertain region under hard attention to generate an image segmentation result, wherein the two-way segmentation path includes region segmentation and boundary segmentation.

[0008] Secondly, this application provides a skin lesion image segmentation system based on adaptive attention. The system includes: a visual field generation unit, used to upload a target image to an image processing platform, and after image preprocessing, superimpose a visual field with pixel distribution to generate an image visual field; an attention weighting unit, used to perform dynamic weighting of segmentation features based on the image visual field according to attention gating, and determine image attention constraints; and an image segmentation unit, used to trigger an image segmenter with the image attention constraints and the image visual field, perform soft attention preliminary segmentation under a two-way segmentation path, and perform binary pass-through estimation of the focusing uncertainty region under hard attention, and fit to generate an image segmentation result, wherein the two-way segmentation path includes region segmentation and boundary segmentation.

[0009] One or more technical solutions provided in this application have at least the following technical effects or advantages:

[0010] The skin lesion image segmentation method based on adaptive attention provided in this application uploads the target image to an image processing platform. After image preprocessing, a visual field is superimposed on the pixel distribution to generate an image visual field. According to attention gating, dynamic weighting of segmentation features based on the image visual field is performed to determine image attention constraints. The image attention constraints and the image visual field are used to trigger an image segmenter to perform soft attention preliminary segmentation under a two-way segmentation path and binary pass-through estimation of the uncertain focusing region under hard attention to fit and generate an image segmentation result. The two-way segmentation path includes region segmentation and boundary segmentation, which is used to solve the technical problem of how to reasonably introduce an adaptive attention mechanism to solve the limited accuracy of skin lesion image region segmentation in the prior art. It can effectively improve the segmentation accuracy in complex scene images. Attached Figure Description

[0011] Figure 1 This application provides a schematic flowchart of a skin lesion image segmentation method based on adaptive attention;

[0012] Figure 2 This application provides a schematic diagram of the structure of a skin lesion image segmentation system based on adaptive attention.

[0013] Figure labeling: Visual field generation unit 11, attention weighting unit 12, image segmentation unit 13. Detailed Implementation

[0014] This application provides a skin lesion image segmentation method and system based on adaptive attention, which addresses the technical problem in the prior art of how to reasonably and adaptively introduce an attention mechanism to solve the limited accuracy of skin lesion image region segmentation.

[0015] Example 1: As Figure 1 As shown, this application provides a skin lesion image segmentation method based on adaptive attention, the method comprising:

[0016] S1: Upload the target image to the image processing platform. After image preprocessing, overlay the visual phase field with pixel distribution to generate the image visual field.

[0017] In this embodiment, the target image is first uploaded to an image processing platform for subsequent processing and analysis. The target image is typically a high-resolution image of a skin lesion, containing rich texture, color, and morphological information.

[0018] Subsequently, in the image preprocessing stage, the image is first subjected to operations such as denoising, contrast adjustment, and color normalization to improve image quality and reduce background noise interference. This preprocessing ensures the accuracy of image information, thereby improving the precision of subsequent segmentation.

[0019] In this application, the pixel distribution refers to the information contained in each pixel of an image, such as color, brightness, and spatial location, which can effectively describe the basic features of the image. The visual phase field is an abstract feature space constructed by analyzing the features of each pixel in the image, usually based on information such as gradient, direction, and affinity between adjacent pixels.

[0020] Preferably, visual phase fields can capture local structures and global features in an image, especially changes in boundaries and textures.

[0021] Furthermore, an image visual field is constructed. Specifically, the image is first scanned pixel by pixel, identifying the value of each pixel and determining its spatial distribution to generate the first pixel distribution of the image. This ensures accurate acquisition of the target image's color and spatial layout information. Next, a second visual phase field based on a phase field vector is constructed for each pixel. The phase field vector includes, but is not limited to, three main parts: gradient information of the pixel in the image feature space, used to describe pixel intensity changes; orientation information, used to determine the relative positions between pixels; and semantic affinity, i.e., a measure of the relationship between pixels, reflecting the degree of semantic similarity between adjacent pixels.

[0022] Furthermore, after the phase field vector is constructed, a phase alignment and superposition operation is performed on the first pixel distribution and the second visual phase field. That is, the pixel distribution information of the target image is aligned with the feature information of the phase field vector to form a richer and more accurate image visual field.

[0023] In the phase alignment process, the phase difference between pixels is calculated to ensure that each region of the image can be accurately mapped to its corresponding phase field features. Ultimately, the superimposed image visual field provides a more comprehensive and detailed feature space for subsequent segmentation operations, helping the segmentation stage to better understand the differences between lesion areas and normal areas in the image.

[0024] In summary, the pixel information of the target image is not only preserved, but also further enhanced and abstracted, and the generated image visual field can provide higher quality feature support for subsequent image segmentation.

[0025] Furthermore, by superimposing the visual phase field with the pixel distribution to generate the image visual field, step S1 of this application includes:

[0026] The target image is pixel-scanned to identify pixel values ​​and determine a first pixel distribution. For each pixel, a second visual phase field is constructed based on a phase field vector, wherein the phase field vector is composed of the gradient, direction, and semantic affinity of the pixel with surrounding pixels in the image feature space. The first pixel distribution and the second visual phase field are superimposed based on phase alignment in the image feature space to generate the image visual field.

[0027] In this embodiment, the target image is scanned pixel by pixel to extract relevant information for each pixel. Specifically, each pixel of the target image is traversed, and its color value, brightness, and spatial coordinates are identified one by one to construct a first pixel distribution of the image. The first pixel distribution reflects the color, brightness, and positional distribution of each pixel in the image space.

[0028] Subsequently, for each pixel in the target image, a second visual phase field is constructed based on the image space distribution of the phase field vectors of each pixel. In this application, the phase field vector refers to a feature vector containing multi-dimensional information, used to describe the local and global features of each pixel in the image.

[0029] Specifically, the phase field vector comprises three main components: first, the gradient of a pixel in the image feature space, reflecting the brightness variation of that pixel and describing changes in image edges or textures; second, directional information, used to characterize the spatial relationship of a pixel relative to other areas of the image, such as the angular or directional relationship between the pixel and its neighboring pixels; and finally, semantic affinity, which measures the semantic similarity between the current pixel and its surrounding pixels, typically defined by color and texture similarity between pixels. By constructing phase field vectors, multidimensional features of pixels in an image can be captured, providing a rich source of information for subsequent image visual field generation.

[0030] Next, a phase alignment and overlay operation is performed to fuse the first pixel distribution with the second visual phase field to generate the image visual field.

[0031] Specifically, the original color and brightness distribution of pixels, i.e., the first pixel distribution, is precisely aligned with the local features extracted from the phase field vector, i.e., the second visual phase field. For example, by calculating the phase difference of each pixel in the feature space, it is ensured that the pixel features and structural features of the target image can be effectively combined at the same spatial scale to accurately reflect the overall structure and detail features of the target image.

[0032] In summary, the generated image visual field contains more comprehensive image information, preserving the color and brightness information of the original pixels while enhancing the representation of edge, texture, and semantic features in the image. This provides a richer and more detailed feature space for subsequent image segmentation and feature extraction, offering strong support for subsequent segmentation processing.

[0033] S2: Based on attention gating, perform dynamic weighting of segmentation features based on the visual field of the image to determine image attention constraints.

[0034] In this embodiment, dynamic weighting of segmentation features based on the image visual field is performed according to attention gating. The attention gating in this application is a functional unit used to dynamically adjust the importance of each feature in the image segmentation process.

[0035] Specifically, attention gating learns key features in an image and dynamically assigns weights to multiple features used for segmentation, improving segmentation accuracy, especially when dealing with complex backgrounds or lesion regions with blurred boundaries. This approach allows focusing on features crucial for segmenting the scene while minimizing the impact of irrelevant features, resulting in more accurate segmentation.

[0036] Specifically, when performing dynamic weighting of segmentation features, different features are first evaluated and selected based on the image visual field. The image visual field already contains global information and local details of the image, such as texture, color, shape, and boundary features. To determine the weight of each feature, the weights assigned to each feature are dynamically adjusted according to the overall structure and local characteristics of the target image.

[0037] For example, texture features may be given higher weights based on the texture complexity of the lesion area in the image, while background or irrelevant areas may be given lower weights.

[0038] In this application, the key to dynamic weighting lies in its ability to adjust the importance of features based on the actual situation in the target image. This process is dynamic and varies with different images. Through an attention gating mechanism, weights can be assigned not only based on the overall features of the image but also by incorporating specific information from local regions, flexibly adjusting the weights of each feature. This effectively addresses uncertain regions in the image, such as lesion areas with unclear boundaries, ensuring these regions receive sufficient attention and improving segmentation accuracy.

[0039] Ultimately, by dynamically weighting the image's visual field, a corresponding attention constraint can be generated for each pixel in the image. Its function is to limit the flow of information during segmentation, ensuring that the segmentation steps make more accurate decisions within specific regions. By performing this dynamic weighting and attention constraint calculation on the image's visual field, greater flexibility and accuracy can be achieved during segmentation, especially when processing complex medical images, effectively improving segmentation results.

[0040] Furthermore, the construction of the attention gating, in step S2 of this application, includes:

[0041] Dynamic weighting rules are mined by first dynamic weighting under the channel dimension and second dynamic weighting under the spatial dimension. The channel dimension includes at least texture and color, and the spatial dimension includes at least geometric shape and boundary features. Attention gating is constructed based on the dynamic weighting rules.

[0042] In this embodiment, dynamic weighting through an attention mechanism is a key step in improving segmentation accuracy during image segmentation. The dynamic weighting process for segmentation features in this application consists of two main dimensions: channel dimension and spatial dimension. This step involves first performing dynamic attention weighting in the channel dimension, followed by second dynamic attention weighting in the spatial dimension. The combination of these two steps forms a complete attention weighting mechanism, thereby providing precise feature selection and constraints for the image segmentation process.

[0043] The first attention-based dynamic weighting at the channel level focuses on weighting at the image channel level. Image channels represent different feature channels, such as color, texture, and depth information. During this process, the importance of different channels is dynamically adjusted based on features like texture and color in the image. Texture features primarily describe the structure or roughness of object surfaces in the image, while color features help distinguish different regions in the image. Through the attention mechanism, different weights can be assigned to each channel so that image segmentation focuses on the channel that best represents the features of the target region.

[0044] For example, when the texture information of the lesion area is more prominent, the weight of the texture-related channels is automatically increased, while the weight of unimportant channels is weakened, thereby improving the segmentation accuracy of the area.

[0045] The second dynamic attention weighting in the spatial dimension involves adjusting weights based on spatial location, primarily targeting geometric shapes and boundary features in the image. Geometric shapes include structural information such as the contours and shapes of objects or regions in the image, while boundary features refer to the dividing lines between objects and the background in the image; these regions typically contain crucial segmentation information. In this stage, different weights are dynamically assigned to different regions based on local and global features in the spatial dimension.

[0046] For example, for lesion areas in an image, especially those with blurred boundaries, assigning higher weights based on boundary clarity results in more accurate segmentation. Particularly when boundary details are indistinct, enhancing the weights of boundary features can significantly improve the accuracy of the segmentation results.

[0047] By dynamically assigning weights in these two dimensions, the weights of each feature channel and spatial region can be flexibly adjusted according to the differences in various features in the image. This allows for targeted strengthening of important features and suppression of irrelevant information during image segmentation, thereby optimizing the segmentation results.

[0048] Subsequently, a comprehensive attention gating mechanism is formed based on dynamic weighting rules in both the channel and spatial dimensions. Specifically, by learning and adjusting the weight distributions in both dimensions, the optimal feature attention weight distribution is automatically selected for segmentation.

[0049] Specifically, attention gating assigns different weights to each pixel based on different features and regions of the image, thereby focusing attention on key regions and features of the image during the segmentation process, such as lesion areas and boundary regions.

[0050] In summary, attention gating can significantly improve segmentation accuracy, especially when the image has a complex background or blurred boundaries, ensuring more detailed and accurate segmentation results and greatly improving the segmentation effect.

[0051] Furthermore, dynamic weighting of segmentation features based on the image visual field is performed to determine image attention constraints. Step S2 of this application includes:

[0052] For the image visual field, with the image scene as a constraint, a one-step weighting based on the attention gating is performed to determine the one-step weight distribution; with the feature comparison degree of the image pixels, a two-step weighting based on the attention gating is performed to determine the two-step weight distribution; the one-step weight distribution and the two-step weight distribution are fused to determine the image attention constraint based on the segmentation feature weights.

[0053] In this embodiment, during image segmentation, a first-step weighting based on attention gating is performed according to the characteristics of the image visual field and the information of the image scene. The image visual field includes global and local features of the image, such as color, texture, and boundaries. The image scene provides a global perspective, typically including the organizational structure, background information, and other semantic features in the image. Based on the above information, different weights are dynamically assigned to different regions in the image through the attention gating mechanism, determining a preliminary weight distribution that reflects which regions' pixels should be the focus of segmentation, such as lesion areas and important boundaries, and serves as the first weight distribution.

[0054] Next, a two-step weighting process is performed based on the feature comparison degree of image pixels. The feature comparison degree of image pixels is an indicator that measures the feature similarity between each pixel and its surrounding pixels, typically involving a comprehensive analysis of multiple features such as color, texture, and gradient direction. The core of the two-step weighting process is to determine the importance of each pixel and the importance of the features of interest for each pixel by comparing the feature similarity between each pixel and its neighboring pixels. Regions with high feature comparison degrees usually indicate that the pixels in the image have strong structural consistency or semantic similarity, and therefore should be given higher weights during segmentation. This two-step weighting process based on feature comparison degrees can further refine the attention mechanism and improve the ability to recognize local image features, especially when dealing with regions rich in detail or with blurred boundaries.

[0055] Finally, the one-step weight distribution and the two-step weight distribution are fused to obtain the final image attention constraint.

[0056] In one feasible implementation, the fusion process combines the results of one-step and two-step weighting using weighted averaging or other mathematical methods to form a comprehensive image attention constraint that considers not only global information but also subtle differences in local features. During image segmentation, this image attention constraint guides the image segmenter to improve the accuracy and robustness of the segmentation results. Especially when dealing with complex backgrounds and uncertain regions, it effectively avoids missegmentation and missed segmentation.

[0057] S3: Using the image attention constraint and the image visual field, trigger the image segmenter to perform soft attention preliminary segmentation under the two-way segmentation path, and binary pass-through estimation of the uncertain region under hard attention to fit and generate the image segmentation result. The two-way segmentation path includes region segmentation and boundary segmentation.

[0058] In this embodiment, the image segmenter performs segmentation tasks under the guidance of the aforementioned image attention constraints and image visual field. The image attention constraints control and guide the attention allocation during the segmentation process, ensuring that the image segmenter can adaptively adjust its focus across different regions of the image. The image visual field provides the image segmenter with rich image features and information, ensuring that key details such as complex boundaries and textures in the image are accurately captured.

[0059] Subsequently, the segmentation process unfolds according to a two-way segmentation path, that is, processing the region features and boundary features in the image through two different paths, thereby improving the accuracy and robustness of the segmentation. Specifically, the two-way segmentation path consists of region segmentation and boundary segmentation.

[0060] In this process, the region term serves as the segmentation criterion. The segmentation process first performs preliminary image segmentation using a soft attention mechanism. Under this mechanism, the image segmenter performs pixel-by-pixel weighted processing on each region of the image, focusing attention on salient regions such as lesion areas and important texture areas. The weights of different regions are determined through a smooth probability distribution. Furthermore, for uncertain regions, each pixel undergoes hard binarization to locate them for further segmentation. This two-step segmentation method, especially when processing images with complex backgrounds or blurred boundaries, avoids over-segmentation or under-segmentation.

[0061] At the same time, based on the boundary terms, the same one-step segmentation based on the soft attention mechanism and the two-step segmentation based on the hard attention mechanism are performed.

[0062] In summary, using region terms and boundary terms as segmentation criteria respectively, and combining soft attention preliminary segmentation with hard attention binary direct estimation as the segmentation steps, two-step segmentation is performed in parallel for each segmentation criterion to determine the segmentation results, and then mutual verification is performed to further ensure segmentation accuracy.

[0063] Finally, the image segmentation result is obtained. This is especially effective when dealing with images with complex textures, blurred boundaries, or inconsistent structures, significantly improving segmentation results. By fusing the advantages of soft and hard attention, the segmentation accuracy of global and local features can be balanced, ultimately resulting in a more accurate and reliable image segmentation outcome.

[0064] Furthermore, step S3 of this application includes: the image segmenter includes a first region item thread and a second boundary item thread;

[0065] The construction method of the first region item thread includes: using the region item as the segmentation basis, deploying the first segmentation node with the initial segmentation under soft attention; introducing a binary mask, deploying the second segmentation node with the uncertain region sparse focusing and direct estimation under hard attention; and cascading the first segmentation node and the second segmentation node to generate the first region item thread.

[0066] The region term represents the homogeneous regions tending to the same phase, based on the phase field vector; the boundary term represents the field tension term that causes drastic changes in field strength between the segmentation boundary and the visual field of the image.

[0067] In this embodiment, the image segmenter includes a first region item thread and a second boundary item thread, which perform image segmentation based on region items and boundary items, respectively. These two threads cooperate to ensure that the image segmentation process can accurately handle different features in the image, especially when dealing with complex backgrounds and blurred boundaries, effectively improving segmentation accuracy.

[0068] Specifically, in the construction method of the first region term thread, segmentation is first performed based on region terms. In the technical solution of this application, a region term represents a homogeneous region in the image, that is, a region with similar features. Usually, the pixels in these regions tend to be in the same phase in the image space and can be represented by phase field vectors, such as similarity in texture, color, and brightness. The goal of the region term is to group homogeneous regions together, thereby effectively segmenting the target region in the image.

[0069] In the specific segmentation process, a soft attention mechanism is used for initial segmentation, deploying the first segmentation node. The soft attention mechanism assigns different weights to different regions in the image, allowing the segmenter to adaptively focus on more important regions, especially lesion areas or other regions of interest. The introduction of soft attention ensures a smooth transition in the initial segmentation results, preventing oversegmentation due to inconsistent local features.

[0070] Next, a binary mask is introduced into the first region item thread, a mechanism that plays a crucial role in hard attention. Hard attention ensures effective processing and pass-through estimation of uncertain regions in the image by sparsely focusing on these regions. Uncertain regions refer to areas with blurred boundaries, small feature differences, or those prone to segmentation errors. The role of the binary mask is to perform more accurate segmentation in these regions, avoiding over-smoothing that leads to loss of detail. The second segmentation node is deployed based on this sparse focusing and pass-through estimation, further improving segmentation accuracy.

[0071] Subsequently, the first and second segmentation nodes are cascaded together to form a complete first region item thread. This cascaded structure enables accurate segmentation not only of homogeneous regions of the image but also allows for detailed processing of complex and ambiguous regions, ensuring the comprehensiveness and accuracy of the segmentation results.

[0072] On the other hand, boundary terms primarily focus on processing segmentation boundaries in the image. Segmentation boundaries are typically regions of dramatic field intensity changes in the visual field of an image, representing the dividing lines between different regions. Segmentation is performed by capturing important structures and contours in the image. Regions of dramatic field intensity changes usually correspond to the boundary between the target object and the background in the image. Strengthening these boundary terms helps improve sensitivity to boundary information, ensuring that the segmentation results effectively preserve the contours and boundary information of the object.

[0073] Similarly, a second boundary item thread is constructed, wherein the logical structure of the first region item thread and the second boundary item thread is consistent, with the only difference being the focus, namely the difference between region items and boundary items.

[0074] Subsequently, the first region term thread and the second boundary term thread are executed in parallel as the image segmenter. Preferably, based on the above logical architecture, a sample data-driven training method is further adopted to perform convergence training on the image segmenter.

[0075] In summary, through the collaborative work of the first region item thread and the second boundary item thread, the image segmenter performs two-step segmentation processing from different perspectives, namely the region item and the boundary item, respectively. This combines soft attention and hard attention mechanisms to achieve accurate image segmentation.

[0076] In summary, this segmentation method is suitable for processing images with complex backgrounds and blurred boundaries, such as medical images, and can effectively improve the robustness and accuracy of segmentation.

[0077] Furthermore, soft attention preliminary segmentation under a two-way segmentation path is performed, along with binary pass-through estimation of the uncertain focusing region under hard attention, to fit and generate the image segmentation result. Step S3 of this application includes:

[0078] The image segmenter is initialized according to the image attention constraint; the initialized image segmenter is used to perform segmentation processing on the image visual field according to the first region item thread to determine the first segmentation result; the image visual field is performed to perform segmentation processing according to the second boundary item thread to determine the second segmentation result; the first segmentation result and the second segmentation result are cross-validated to generate the image segmentation result.

[0079] In this embodiment, the image segmenter is first initialized based on the image attention constraints. During initialization, the image segmenter sets initial parameters and structure based on the global information and local features of the image, as well as the image attention constraints obtained through the attention mechanism. This guides the image segmenter to focus on specific regions and feature channels, ensuring that it can focus on important regions, such as lesion areas and areas with unclear boundaries, during image segmentation. The initialized image segmenter is adapted to the target image and performs effective segmentation processing in subsequent steps to ensure the adaptability of the image segmenter to the target image.

[0080] Next, the initialized image segmenter is used to segment the visual field of the image according to the first region item thread to generate the first segmentation result.

[0081] Specifically, the first region-specific thread focuses on processing regions within the image. Based on information such as texture, color, and shape contained in the image's visual field, it performs homogeneous aggregation segmentation within these regions. According to a soft attention mechanism, appropriate weights are assigned to each region, enabling accurate capture and segmentation of regions with similar features within the image. This ensures effective segmentation of homogeneous regions in the image's visual field, especially for the extraction of lesion and tissue regions, yielding relatively clear preliminary segmentation results.

[0082] Furthermore, for the one-step segmentation result based on the soft attention mechanism, uncertain regions, namely image regions with limited segmentation accuracy such as blurred boundaries, are further located. A hard attention mechanism is then used to focus on the uncertain regions. Through a pass-through estimation method, the pixels in these regions are subjected to segmentation-based binary processing to achieve further segmentation of the uncertain regions and determine the first segmentation result.

[0083] Similarly, based on the second boundary term thread, that is, by focusing on the boundary features in the image for segmentation, a one-step segmentation based on a soft attention mechanism and a two-step segmentation based on a hard attention mechanism are performed on the visual field of the image to determine the second segmentation result.

[0084] Subsequently, the first and second segmentation results are cross-validated, that is, the consistency between the two results is ensured through comparison and verification. If the two results are highly consistent, that is, the segmentation results are consistent from the perspective of region terms and boundary terms, it indicates that the segmentation accuracy meets the standard, and either the first or second segmentation result can be used as the final image segmentation result.

[0085] However, if the cross-validation results are inconsistent, further analysis and processing of the inconsistent regions are required. Specifically, inconsistencies typically occur at image boundaries or in complex regions, possibly due to insufficient detail capture during the initial segmentation process. Re-segmentation or correction is necessary to ensure accurate segmentation results are obtained for the inconsistent regions.

[0086] Finally, through a cross-validation process, the final image segmentation result was generated. This result not only considered the integrity of regional features but also paid close attention to the accuracy of boundary features, thus obtaining a more accurate and reliable segmentation result.

[0087] Furthermore, step S3 of this application includes:

[0088] Obtain the cross-validation result. If the cross-validation result is consistent, use the first segmentation result or the second segmentation result as the image segmentation result. If the cross-validation result is inconsistent, locate the inconsistent image region. Import the inconsistent image region into the second segmentation node in the image segmenter, perform re-segmentation processing, and determine the re-segmentation result. Replace the inconsistent image region with the re-segmentation result to generate the image segmentation result.

[0089] In this embodiment, the cross-verification result reflects the consistency or difference between the segmentation results obtained through two segmentation paths: region segmentation and boundary segmentation. First, if the cross-verification results are consistent, it means that the segmentation results generated through the two independent segmentation paths achieved the same segmentation effect when processing the image, indicating that the image segmenter has achieved relatively accurate segmentation in that region. Therefore, either the first segmentation result or the second segmentation result can be selected as the final image segmentation result.

[0090] However, if the cross-validation results are inconsistent, it indicates that there are segmentation conflicts or errors in certain regions of the image. This inconsistency usually occurs in complex image regions, especially in areas with blurred boundaries or small feature differences.

[0091] Therefore, the next step is to locate inconsistent image regions. Inconsistent image regions are typically parts with unclear boundaries, complex structures, or weak local features.

[0092] Furthermore, for inconsistent image regions, more detailed processing steps are required. In this application, inconsistent image regions are imported into the second segmentation node within the image segmenter, specifically the second segmentation node in the first region item thread and the second boundary item thread, for re-segmentation. This reprocesses and corrects the inconsistent regions to ensure that they can be correctly segmented.

[0093] Subsequently, the obtained complex segmentation results replace the original inconsistent image regions, ensuring that all inconsistent image regions have been re-segmented, and the final result reflects higher accuracy and consistency.

[0094] Ultimately, the generated image segmentation result is the optimal result after mutual verification, re-segmentation, and correction, ensuring that the image segmentation is not only accurate and effective in the global scope, but also refined in local details. It is especially suitable for tasks such as medical images and skin lesion images with complex backgrounds and blurred boundaries, and can significantly improve segmentation accuracy and robustness.

[0095] Furthermore, after generating the image segmentation result, the steps in this application also include:

[0096] Based on the image segmentation result of the image visual field, a spatial phase mapping with the target image is established as a two-layer segmented image; the two-layer segmented image is displayed in a pop-up window on the visualization port of the image processing platform.

[0097] In this embodiment of the application, the image segmentation result is a segmentation performed based on the image visual field, which is then further mapped onto the original target image.

[0098] Specifically, spatial phase mapping involves mapping the spatial relationship between the image segmentation result and the original image to ensure spatial consistency between them. In essence, the image visual field already contains rich image feature information, including boundaries, texture, and color. By mapping this information to the spatial location of the target image, the generated spatial phase mapping accurately reflects the spatial structure of the target image, ensuring consistency between the segmentation result and the original image in spatial structure, and generating a two-layer segmented image—an image segmentation result based on the target image and the image visual field.

[0099] The two images are superimposed through spatial phase mapping, which allows the structural and segmentation information of the target image to be presented simultaneously, enhancing the understanding and analysis of the image content.

[0100] Next, the generated double-layer segmented image is displayed in a pop-up window in the visualization port of the image processing platform. That is, the segmentation result and the original image are presented to the user in a visual way through the graphical interface, so that the user can see the segmentation effect intuitively and make it easier to evaluate the segmentation accuracy, precision and potential problems.

[0101] In summary, the dual-layer segmentation image display method not only provides an intuitive visual effect, but also helps users better understand the image segmentation process and results, especially in application scenarios such as medical image analysis, where it plays an important role in assisting decision-making.

[0102] The skin lesion image segmentation method based on adaptive attention provided in this application has the following technical effects:

[0103] 1. When constructing the visual field of an image, the pixel distribution and the visual phase field are fused, and the pixel features and spatial correlation information of the skin lesion image are fully preserved through phase alignment and superposition. This provides comprehensive data support for subsequent accurate segmentation and avoids feature loss caused by single pixel distribution representation.

[0104] 2. Attention gating dynamically assigns weights from both channel and spatial dimensions. It combines image scene constraints with pixel feature comparison to achieve two-step weighting fusion, which can specifically enhance the features of lesion areas, suppress background interference, and improve the effectiveness and relevance of segmentation features.

[0105] 3. The image segmenter employs a two-way segmentation path, consisting of a region term and a boundary term. The region term segments homogeneous regions based on the phase field vector, while the boundary term focuses on regions with drastic changes in field intensity to locate segmentation boundaries, reducing the bias of a single segmentation dimension. The segmentation process combines soft attention for initial segmentation with hard attention for focusing and estimating uncertain regions. First, soft attention quickly obtains the overall segmentation contour, and then hard attention accurately processes uncertain regions such as blurriness and edges, balancing segmentation efficiency and detail accuracy, and reducing the probability of missed or misclassified lesion edges. A cross-validation mechanism is implemented for the two-way segmentation results. Inconsistent regions are imported into a second segmentation node related to hard attention for re-segmentation. Through multiple rounds of verification and optimization, the segmentation results are further improved, further enhancing the accuracy of skin lesion segmentation, especially suitable for complex scenarios where lesion boundaries are blurred and closely resemble normal skin features.

[0106] Example 2: Based on the same inventive concept as the skin lesion image segmentation method based on adaptive attention in the previous examples, such as... Figure 2 As shown, this application provides a skin lesion image segmentation system based on adaptive attention, the system comprising:

[0107] The visual field generation unit 11 is used to upload the target image to the image processing platform and, after image preprocessing, superimpose the visual field with pixel distribution to generate the image visual field.

[0108] Attention weighting unit 12 is used to perform dynamic weighting based on the segmentation features of the image visual field according to attention gating, and to determine image attention constraints;

[0109] Image segmentation unit 13 is used to trigger an image segmenter with the image attention constraint and the image visual field, perform soft attention preliminary segmentation under a two-way segmentation path, and perform binary pass-through estimation of the focusing uncertainty region under hard attention, and fit to generate an image segmentation result, wherein the two-way segmentation path includes region segmentation and boundary segmentation.

[0110] Furthermore, the visual field generation unit 11 is used to perform the following steps: perform pixel scanning on the target image, identify pixel values ​​and determine a first pixel distribution; construct a second visual phase field based on a phase field vector for each pixel, wherein the phase field vector is composed of the gradient, direction and semantic affinity of the pixel with surrounding pixels in the image feature space; perform phase alignment superposition of the first pixel distribution and the second visual phase field based on the image feature space to generate the image visual field.

[0111] Furthermore, the attention weighting unit 12 is used to perform the following steps: to perform first dynamic attention weighting under the channel dimension and second dynamic attention weighting under the spatial dimension, to mine dynamic weighting rules, wherein the channel dimension includes at least texture and color, and the spatial dimension includes at least geometric shape and boundary features; and to construct attention gating according to the dynamic weighting rules.

[0112] Furthermore, the attention weighting unit 12 is used to perform the following steps: for the image visual field, with the image scene as a constraint, perform a one-step weighting based on the attention gating to determine a one-step weight distribution; with the feature comparison degree of the image pixels, perform a two-step weighting based on the attention gating to determine a two-step weight distribution; and fuse the one-step weight distribution and the two-step weight distribution to determine the image attention constraint based on the segmentation feature weights.

[0113] Furthermore, the image segmentation unit 13 is used to perform the following steps: the image segmenter includes a first region item thread and a second boundary item thread;

[0114] The construction method of the first region item thread includes: using the region item as the segmentation basis, deploying the first segmentation node with the initial segmentation under soft attention; introducing a binary mask, deploying the second segmentation node with the uncertain region sparse focusing and direct estimation under hard attention; and cascading the first segmentation node and the second segmentation node to generate the first region item thread.

[0115] Furthermore, the image segmentation unit 13 is used to perform the following steps: the region term represents that homogeneous regions tend to be in the same phase, based on the phase field vector; the boundary term represents the field tension term that causes drastic changes in field strength between the segmentation boundary and the visual field of the image.

[0116] Furthermore, the image segmentation unit 13 is used to perform the following steps: initializing the image segmenter according to the image attention constraint; using the initialized image segmenter, performing segmentation processing on the image visual field according to the first region item thread to determine a first segmentation result; performing segmentation processing on the image visual field according to the second boundary item thread to determine a second segmentation result; verifying the first segmentation result and the second segmentation result to generate the image segmentation result.

[0117] Furthermore, the image segmentation unit 13 is used to perform the following steps: obtain a cross-verification result; if the cross-verification result is consistent, use the first segmentation result or the second segmentation result as the image segmentation result; if the cross-verification result is inconsistent, locate the inconsistent image region; import the inconsistent image region into the second segmentation node in the image segmenter, perform re-segmentation processing, and determine the re-segmentation result; replace the inconsistent image region with the re-segmentation result to generate the image segmentation result.

[0118] Furthermore, the system is also used to perform the following steps: establishing a spatial phase mapping with the target image based on the image segmentation result based on the image visual field, as a two-layer segmented image; and displaying the two-layer segmented image in a pop-up window on the visualization port of the image processing platform.

[0119] Through the foregoing detailed description of the skin lesion image segmentation method based on adaptive attention, those skilled in the art can clearly understand the skin lesion image segmentation method and system based on adaptive attention in this embodiment. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and relevant parts can be referred to the description in the method section.

[0120] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A skin lesion image segmentation method based on adaptive attention, characterized in that, The method includes: Upload the target image to the image processing platform. After image preprocessing, overlay the visual phase field with pixel distribution to generate the image visual field. Based on attention gating, dynamic weighting of segmentation features based on the image visual field is performed to determine image attention constraints; The image segmenter is triggered by the image attention constraint and the image visual field, and performs soft attention preliminary segmentation under the two-way segmentation path, and binary pass-through estimation of the focusing uncertainty region under hard attention, and fits to generate the image segmentation result. The two-way segmentation path includes region segmentation and boundary segmentation. The region segmentation is as follows: based on the region segmentation, a preliminary image segmentation is performed using a soft attention mechanism; for uncertain regions, each pixel is subjected to hard binarization for localization; the boundary segmentation is as follows: based on the boundary segmentation, a preliminary image segmentation is performed using a soft attention mechanism; for uncertain regions, each pixel is subjected to hard binarization for localization. The process involves performing initial soft-attention segmentation under a two-way segmentation path, followed by binary pass-through estimation of uncertain regions under hard-attention, and then fitting the results to generate image segmentation. This includes: The image segmenter is initialized according to the image attention constraint; Using the initialized image segmenter, the image visual field is segmented according to the first region item thread to determine the first segmentation result; The image visual field is segmented according to the second boundary term thread to determine the second segmentation result; The first segmentation result and the second segmentation result are cross-validated to generate the image segmentation result.

2. The skin lesion image segmentation method based on adaptive attention as described in claim 1, characterized in that, The image visual field is generated by superimposing the visual phase field with the pixel distribution, including: Perform pixel scanning on the target image, identify pixel values, and determine the first pixel distribution; For each pixel, a second visual phase field based on the phase field vector is constructed, wherein the phase field vector is composed of the gradient, direction, and semantic affinity of the pixel with surrounding pixels in the image feature space; The first pixel distribution and the second visual phase field are superimposed based on the image feature space to generate the image visual field.

3. The skin lesion image segmentation method based on adaptive attention as described in claim 1, characterized in that, The construction of the attention gating includes: Dynamic weighting rules are mined by first dynamic attention weighting under the channel dimension and second dynamic attention weighting under the spatial dimension. The channel dimension includes at least texture and color, and the spatial dimension includes at least geometric shape and boundary features. An attention gating system is constructed based on the dynamic weighting rules.

4. The skin lesion image segmentation method based on adaptive attention as described in claim 3, characterized in that, Perform dynamic weighting of segmentation features based on the image visual field to determine image attention constraints, including: For the image visual field, with the image scene as a constraint, a one-step weighting based on the attention gating is performed to determine the one-step weight distribution; Based on the feature comparison degree of image pixels, perform a two-step weighting based on the attention gating to determine the two-step weight distribution; By integrating the one-step weight distribution and the two-step weight distribution, an image attention constraint based on segmentation feature weights is determined.

5. The skin lesion image segmentation method based on adaptive attention as described in claim 1, characterized in that, The image segmenter includes a first region item thread and a second boundary item thread; The construction method of the first region item thread includes: Based on the region item as the segmentation criterion and the initial segmentation under soft attention, the first segmentation node is deployed; A binary mask is introduced to deploy a second segmentation node using sparse focusing and pass-through estimation of uncertain regions under hard attention. The first segmentation node and the second segmentation node are cascaded to generate the first region item thread.

6. The skin lesion image segmentation method based on adaptive attention as described in claim 5, characterized in that, The region term represents that homogeneous regions tend to be in the same phase, based on the phase field vector; The boundary term characterizes the field tension term that causes drastic changes in field strength between the segmentation boundary and the visual field of the image.

7. The skin lesion image segmentation method based on adaptive attention as described in claim 1, characterized in that, Obtain the cross-validation result. If the cross-validation result is consistent, use the first segmentation result or the second segmentation result as the image segmentation result. If the cross-verification results are inconsistent, locate the inconsistent image region; The inconsistent image region is imported into the second segmentation node within the image segmenter, and a complex segmentation process is performed to determine the complex segmentation result. The inconsistent image regions are replaced with the complex segmentation results to generate the image segmentation result.

8. The skin lesion image segmentation method based on adaptive attention as described in claim 1, characterized in that, After generating the image segmentation results, the following are included: Based on the image segmentation result based on the image visual field, a spatial phase mapping with the target image is established as a two-layer segmented image; The dual-layer segmented image is displayed in a pop-up window on the visualization port of the image processing platform.

9. A skin lesion image segmentation system based on adaptive attention, characterized in that, The system is used to perform the skin lesion image segmentation method based on adaptive attention as described in any one of claims 1-8, the system comprising: The visual field generation unit is used to upload the target image to the image processing platform. After image preprocessing, the visual field is superimposed with the pixel distribution to generate the image visual field. The attention weighting unit is used to perform dynamic weighting based on the segmentation features of the image visual field according to the attention gating, and to determine the image attention constraints; The image segmentation unit is used to trigger the image segmenter with the image attention constraint and the image visual field, perform soft attention preliminary segmentation under a two-way segmentation path, and perform binary pass-through estimation of the focusing uncertainty region under hard attention to fit and generate the image segmentation result. The two-way segmentation path includes region segmentation and boundary segmentation.

Citation Information

Patent Citations

  • Magnetic resonance image segmentation system and segmentation method thereof

    CN112669327A

  • Pathological image segmentation method based on attention network

    CN120823225A