Specific dermatitis image segmentation method based on SAM model
Through the specific dermatitis image segmentation method based on SAM model, the multi-scale feature fusion, attention mechanism and customized loss function are used to solve the problem of dependence and overfitting of labeled data in the existing technology, achieving high precision and high quality Efficient specific dermatitis image segmentation enhances the generalization ability and interpretability of the model.
Patent Information
- Application Number
- CN202411131279.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-17
- Publication Date
- 2024-11-29
AI Technical Summary
The prior art relies on a large amount of labeled data in specific dermatitis image segmentation, and deep learning models may encounter overfitting problems when generalizing to new data sets, making it difficult to adapt to the diversity and complexity of the lesions.
Using the specific dermatitis image segmentation method based on SAM model, through data preparation and preprocessing, SAM model fine-tuning and training, including multi-scale feature fusion, attention mechanism and customized loss function, reduce dependence on the annotated data and improve segmentation accuracy and efficiency.
It realizes high-precision and high-efficiency specific dermatitis image segmentation without large amounts of labeled data, reduces dependence on labeled data, improves the generalization ability of the model and the recognition ability of small targets, and enhances the interpretability of the model and Trust in clinical applications.
Smart Images

Figure CN119048526A_ABST
Abstract
Description
[Technical field]
[0001] The invention relates to the technical field of computer vision, and in particular to an atopic dermatitis image segmentation method based on a SAM model. [Background technology]
[0002] With the rapid development of computer vision and deep learning technologies, image processing technology is increasingly used in the field of medical diagnosis. In particular, image segmentation technology plays a vital role in the identification and analysis of skin lesions.
[0003] Atopic dermatitis (AD) is a common chronic, recurrent, inflammatory skin disease. Its pathological features include skin barrier dysfunction, abnormal immune response, and imbalance of skin microbiota. Clinically, AD manifests as polymorphic skin lesions such as dry skin, erythema, papules, blisters, exudation, crusting, and lichenification. Due to the fluctuating course of AD, the lesions have diverse morphologies and blurred boundaries, which poses certain challenges to clinical AD image segmentation.
[0004] In the diagnosis of skin lesions, image segmentation technology is a key step in identifying and quantifying lesion areas. However, traditional image segmentation methods, such as threshold-based segmentation, edge detection, and region growing, often rely on manually designed features and rules, which are difficult to adapt to the diversity and complexity of lesions. In addition, these methods perform poorly when dealing with fuzzy boundaries and background noise, affecting the accuracy of segmentation.
[0005] In recent years, deep learning techniques, especially convolutional neural networks (CNNs), have made remarkable progress in the field of image segmentation. Deep learning methods can automatically learn the hierarchical features of images, improving the accuracy and robustness of segmentation. However, existing deep learning models usually require a large amount of labeled data for training, which is a huge challenge in the field of medical imaging because obtaining high-quality labeled data is time-consuming and expensive. In addition, deep learning models may encounter overfitting problems when generalizing to new datasets. Segment Anything Model (SAM) is an advanced zero-shot segmentation model. The SAM model is designed to be a basic model in the field of image segmentation, with strong generalization ability and flexibility, and can handle various image segmentation tasks.
[0006] The present invention aims at the technical problem that existing neural network models need to rely on a large amount of labeled data to segment images, and makes technical improvements to the atopic dermatitis image segmentation method. [Summary of the invention]
[0007] The purpose of the present invention is to provide a method for high-precision and high-efficiency segmentation of atopic dermatitis images of different types and severity without relying on a large amount of labeled data.
[0008] To achieve the above object, the technical solution adopted by the present invention is a method for segmenting atopic dermatitis images based on the SAM model, comprising the following steps:
[0009] S1. Data preparation and preprocessing to achieve high-precision dermatitis image segmentation. Specifically,
[0010] S11. Collect a diverse dataset of dermatitis images to ensure the wide adaptability of the SAM model.
[0011] S12, finely annotate the dermatitis image dataset for use in training and validating the SAM model;
[0012] S13, preprocessing dermatitis image data to improve the usability and segmentation effect of dermatitis images;
[0013] S2. Fine-tune the SAM model to adapt to the characteristics of atopic dermatitis image segmentation. Specifically,
[0014] S21. Considering the specific characteristics of dermatitis lesions, select the SAM model variant suitable for dermatitis image segmentation;
[0015] S22. Fine-tune the SAM model using the labeled dermatitis image dataset to improve the performance of the SAM model in the dermatitis image segmentation task;
[0016] S23. Adjust the hyperparameters and structure of the SAM model to make the SAM model better adapt to the characteristics of dermatitis lesions;
[0017] S3. Use the trained SAM model to segment dermatitis lesions on dermatitis image data. Specifically,
[0018] S31, inputting the preprocessed dermatitis image into the fine-tuned SAM model;
[0019] S32, SAM model automatically extracts global and local features from the input dermatitis image;
[0020] S33, using global and local feature information to predict the boundary of the dermatitis lesion area and generate a preliminary segmentation mask;
[0021] S34, post-processing the preliminary segmentation mask to optimize the quality of the preliminary segmentation mask to clearly depict the dermatitis lesion area and complete the dermatitis image segmentation.
[0022] Preferably, the atopic dermatitis image segmentation method based on the SAM model further comprises the following steps:
[0023] S4. Evaluate and optimize the dermatitis image segmentation results. Specifically,
[0024] S41, quantitative evaluation of dermatitis image segmentation results;
[0025] S42, qualitative evaluation of dermatitis image segmentation results;
[0026] S43. Iteratively optimize the SAM model based on the quantitative and qualitative evaluation results.
[0027] Preferably, step S21 selects the following types of SAM model variants: a SAM variant with multi-scale feature fusion, or a SAM variant introducing an attention mechanism, or a lightweight SAM model variant.
[0028] Preferably, the SAM model variant includes, in sequence, a feature extraction layer for extracting multi-scale features based on a pre-trained convolutional neural network, an attention mechanism module for enhancing the recognition of key features in the dermatitis lesion area, a graph convolutional network for further improving the complex boundary prediction capability on the feature map after the attention mechanism, a multi-scale feature fusion module for fusing features from different levels to improve the multi-scale lesion recognition capability, and a segmentation head module for generating a preliminary segmentation mask to mark the lesion boundary.
[0029] Preferably, the fine-tuning process in step S22 includes the following key sub-steps:
[0030] S221. Selection of pre-trained SAM model: Pre-train the SAM model on a large-scale general image dataset to obtain basic feature representation;
[0031] S222. Implementation of fine-tuning strategy: Perform gradual fine-tuning on the dermatitis image dataset. First, the pre-trained SAM model is trained on the dermatitis image dataset to adapt to the characteristics of dermatitis lesions, and then the training parameters are gradually adjusted to optimize the SAM model's ability to recognize dermatitis lesions.
[0032] S223. Customization of loss function: Design a loss function suitable for the dermatitis image segmentation task and optimize the SAM model's ability to identify lesion areas;
[0033] S224, data augmentation and cross-validation: During the fine-tuning process, data augmentation technology is used to increase the diversity of dermatitis image data to enhance the generalization ability of the SAM model. At the same time, the performance of the SAM model is evaluated through cross-validation to ensure that the SAM model can perform well and stably on different data sets.
[0034] Preferably, the loss function customized in step S223 is a combined loss function:
[0035] L=α·L WCE+β·L Dice
[0036] Among them, α is the weight coefficient of the weighted cross entropy loss function, and β is the weight coefficient of the Dice loss function;
[0037] Weighted cross entropy loss function:
[0038]
[0039] Where N is the number of pixels in the image, C is the number of categories, and w c is the weight of category c, which is used to balance the number of samples in different categories, y i,c is the true label of pixel i, p i,c is the probability that pixel i is predicted to be of category c;
[0040] Dice loss function:
[0041]
[0042] Among them, p i is the predicted probability of the i-th pixel, y i is the true label of the i-th pixel.
[0043] Preferably, step S23 includes the following adjustment methods: adjusting the learning rate, optimizing the convolution kernel size and the number of layers, introducing regularization technology, parameter sharing and feature fusion.
[0044] Preferably, step S41: quantitatively evaluate the dermatitis image segmentation result using precision, recall, F1 score, intersection over union ratio and Dice coefficient.
[0045] Preferably, step S42: qualitatively evaluating the dermatitis image segmentation result using the accuracy of the segmentation boundary, mis-segmentation and missed segmentation, and expert feedback.
[0046] Preferably, step S43: iteratively optimize the SAM model by adjusting the network structure, modifying the loss function, optimizing the data enhancement strategy, and re-fine-tuning the SAM model.
[0047] The beneficial effects of the specific dermatitis image segmentation method based on the SAM model of the present invention are as follows: 1. Zero-sample learning: the model can process unseen categories and reduce the dependence on labeled data; 2. Attention mechanism: the model can focus on key areas and improve segmentation accuracy; 3. Multi-scale feature fusion: the model can capture features of different scales and improve the recognition ability of small targets; 4. Customized loss function: by designing a specific loss function, the performance of the model for specific tasks is optimized; 5. Interpretable design: the decision-making process of the model is visualized, which improves the user's trust in the model.
Brief Description of the Drawings
[0048] Figure 1 This is a flow chart of a method for segmenting atopic dermatitis images based on the SAM model. [Specific implementation method]
[0049] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. In the detailed description below, many specific details are proposed to provide a comprehensive understanding of the present invention. But it is obvious to those skilled in the art that the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present invention by illustrating examples of the present invention. The present invention is by no means limited to any specific configuration and algorithm proposed below, but covers any modification, replacement and improvement of elements, parts and algorithms without departing from the concept of the present invention. In the accompanying drawings and the following description, known structures and technologies are not shown to avoid unnecessary ambiguity to the present invention.
[0050] Example
[0051] This embodiment implements a method for segmenting atopic dermatitis images based on the SAM model.
[0052] Zero-Shot Learning (ZSL) is a method for classification or segmentation with little or no labeled data. It improves the generalization ability of the model by leveraging the semantic relationship and attribute information between categories. Segment Anything Model (SAM) is an advanced zero-shot segmentation model that achieves segmentation of any image by learning the global and local features of the image without relying on a large amount of labeled data. This feature of the SAM model makes it have great application potential in the field of atopic dermatitis image segmentation.
[0053] Applying the SAM model to atopic dermatitis image segmentation is expected to address the limitations of traditional methods and existing deep learning methods. The zero-shot learning capability of the SAM model enables it to quickly adapt to new lesion types and severity without a large amount of labeled data. In addition, the segmentation accuracy and efficiency of the SAM model are also expected to meet the needs of atopic dermatitis image segmentation applications. Through further model optimization and verification, the SAM model atopic dermatitis image segmentation is expected to become an important auxiliary tool in the diagnosis and treatment of atopic dermatitis.
[0054] Figure 1 This is a flow chart of atopic dermatitis image segmentation method based on the SAM model. Figure 1 As shown, the method of this embodiment includes the following steps:
[0055] Step 1: Data preparation and preprocessing
[0056] The data preparation and preprocessing of the method in this embodiment are the basis for achieving high-precision image segmentation.
[0057] 11. Collect a diverse dataset of dermatitis images:
[0058] In order to develop an efficient dermatitis lesion segmentation model, it is first necessary to collect diverse dermatitis image datasets. These datasets should cover various types of dermatitis (such as eczema, contact dermatitis, atopic dermatitis, etc.), as well as patients with different skin colors, ages, genders, races, and lesion stages. In addition, the images should include different shooting conditions (such as lighting, resolution, angles, etc.) and lesion locations (such as face, arms, legs, etc.) to ensure the wide adaptability of the model. These images can be collected from a variety of channels such as dermatology databases, hospital collaborations, or public datasets.
[0059] Dermatitis images and ordinary images have the following differences and characteristics in segmentation tasks:
[0060] 1. Complex lesion areas: The lesion areas in dermatitis images often have complex boundaries and may have irregular shapes, blurred edges, and color changes. This makes the segmentation task more challenging and requires the model to accurately identify these complex features.
[0061] 2. Diversity and variability: There are many types of dermatitis, and different types of dermatitis may show different textures, colors, and shapes. In addition, the same type of dermatitis may show different characteristics in different patients or different parts of the same patient, which requires the dataset to cover a wide range of variability in order to train a model with good generalization ability.
[0062] 3. High contrast requirement: Since the contrast between dermatitis lesions and healthy skin may be low, especially in poor lighting conditions or darker skin color, the segmentation model needs to perform pre-processing such as contrast enhancement on the image to help the model accurately distinguish between lesions and normal skin.
[0063] 4. Multiple shooting conditions: Dermatitis images may be taken under different lighting, resolution, angle and other conditions. This diversity makes the visual features of the images complex and changeable. The model needs to adapt to these changes to ensure that the lesion area can still be accurately segmented under different shooting conditions.
[0064] 5. Difficulty of annotation: The annotation of dermatitis images usually requires the participation of professional dermatologists, because the identification and annotation of lesion areas are more complicated than those of ordinary images. The morphology and boundary identification of lesions require professional knowledge, which increases the difficulty and importance of annotation work.
[0065] 12. Make detailed annotations:
[0066] The collected dermatitis images need to be finely annotated in order to be used for training and validating the model. Fine annotation involves accurately marking the boundaries and areas of the dermatitis lesions in each image. Usually, this requires dermatologists or professionally trained personnel to use image annotation tools (such as LabelImg, etc.) to annotate one by one. The annotation process should be as accurate as possible to capture features such as the morphology, size, and boundary fuzziness of the lesions. In addition, multiple annotations and cross-validation methods can be used to improve the reliability and consistency of the annotations.
[0067] 13. Image preprocessing:
[0068] In the data preprocessing stage, the following steps are taken to improve the image usability and segmentation effect:
[0069] 1. Image denoising: Apply advanced filtering algorithms to remove random noise in the image and improve image clarity, making the lesion area more obvious.
[0070] 2. Contrast enhancement: By adjusting the contrast of the image, the boundary between the dermatitis lesion area and the normal skin is made clearer, improving the model's ability to recognize boundaries.
[0071] 3. Size normalization: resize all images to a uniform size to fit the model’s input requirements and ensure that the model can process images from different sources.
[0072] 4. Color correction: Unify the color information of images taken under different devices and shooting conditions to ensure that images taken under different conditions have consistent color performance, thereby reducing the impact of color differences on the model.
[0073] 5. Data enhancement: By rotating, flipping, scaling, and other operations on images, the diversity of data is increased, thereby improving the generalization ability of the model and enabling it to better adapt to unseen images.
[0074] Most of these image preprocessing steps are general and applicable to various types of image processing tasks, including general and medical images. However, in the processing of dermatitis images, these steps may be adjusted and optimized according to the unique needs of dermatitis images. The following are the specific applications and characteristics of these steps in dermatitis images:
[0075] Image Denoising:
[0076] Versatility: Denoising is a common step in image processing and is applicable to many types of images to improve image clarity and quality.
[0077] Characteristics of dermatitis images: Denoising is particularly important for dermatitis images because the details of the lesion area are crucial for segmentation. The denoising process needs to keep the texture and subtle features of the lesion from being over-smoothed to avoid losing key information.
[0078] Contrast Enhancement:
[0079] Versatility: Contrast enhancement is a commonly used image processing technique that aims to improve the distinguishability of different areas in an image.
[0080] Characteristics of dermatitis images: In dermatitis images, the main purpose of contrast enhancement is to highlight the difference between the lesion and normal skin. Since the color difference between the lesion area and the normal skin is sometimes small, proper contrast enhancement can help the model better identify the boundary.
[0081] Dimension standardization:
[0082] Universality: Size normalization is to adapt to model input requirements and is usually used to adjust images from different sources to a consistent resolution or size.
[0083] Characteristics of dermatitis images: In dermatitis image processing, uniform size normalization helps the model maintain consistent processing effects across different lesion sizes and shapes.
[0084] Color Correction:
[0085] Versatility: Color correction is applicable to any type of image processing, especially when the images originate from different devices or are taken under different conditions.
[0086] Characteristics of dermatitis images: Color correction of dermatitis images is particularly important because slight differences in skin color may affect the identification of lesions. Unified color representation can reduce the model's misjudgment caused by color differences.
[0087] Data Augmentation:
[0088] Generality: Data augmentation is a commonly used method that improves the generalization ability of the model by increasing the diversity of image data and is applicable to various image processing tasks.
[0089] Characteristics of dermatitis images: In dermatitis images, data augmentation can simulate different shooting conditions, lesion locations and directions, making the model more robust in dealing with diverse lesion characteristics.
[0090] In summary, although these preprocessing steps are general image processing techniques, in dermatitis image processing, they need to be optimized according to the unique needs of dermatitis images to better support the lesion segmentation task.
[0091] Step 2: SAM model fine-tuning
[0092] During the SAM model fine-tuning stage, the method of this embodiment adopts the following strategies to adapt to the characteristics of atopic dermatitis image segmentation. Model selection: Based on the basic principles of the SAM model, select a network structure suitable for skin lesion segmentation. Loss function design: Customize the loss function to optimize the model's ability to recognize lesion areas. Fine-tuning strategy: Use a step-by-step fine-tuning method to first pre-train the model on a large-scale general dataset, and then fine-tune it on the atopic dermatitis dataset. Generalization ability evaluation: Evaluate the generalization ability of the model through methods such as cross-validation to ensure that the model performs well on different datasets. Segmentation accuracy optimization: Optimize segmentation accuracy by adjusting model parameters and structure to reduce mis-segmentation and missed segmentation.
[0093] 21. Select the SAM model variant suitable for dermatitis image segmentation:
[0094] When selecting a SAM model variant suitable for dermatitis image segmentation, it is necessary to consider the specific characteristics of dermatitis lesions, such as complex boundaries, different texture patterns, and color changes. Based on the basic principles of the SAM model, its different variants have their own advantages when processing specific types of images or tasks. Specifically, the following types of SAM model variants can be selected:
[0095] 1. SAM variant with multi-scale feature fusion: This variant can combine semantic information at different scales, which helps capture subtle features and complex boundaries in dermatitis lesions. This feature is particularly important in skin lesion segmentation because dermatitis lesions may contain both large damaged areas and fine edge features.
[0096] 2. SAM variant with attention mechanism: The attention mechanism enables the model to pay more attention to key areas in the image, such as the boundaries and internal textures of dermatitis lesions. This variant is particularly suitable for processing images with complex backgrounds or low contrast between lesions and surrounding normal skin.
[0097] 3. Lightweight SAM model variants: If computing resources are limited or you need to deploy on mobile devices, you can choose lightweight SAM variants. This type of model optimizes computing efficiency while ensuring segmentation accuracy, allowing the model to work efficiently under limited resources.
[0098] In the dermatitis image segmentation task, a specialized SAM model variant can be designed to combine multi-scale feature fusion and attention mechanism to better adapt to the complex characteristics of dermatitis lesions.
[0099] Multi-scale feature fusion: The characteristics of dermatitis lesions may include large damaged areas and small edge features. By introducing a multi-scale feature fusion module into the model, the model can extract semantic information at different scales and capture the subtle differences and complex boundaries in dermatitis lesions.
[0100] Attention mechanism: The introduction of the attention mechanism allows the model to pay more attention to the key areas of dermatitis lesions, such as boundaries and internal textures, especially when the background is complex or the contrast between the lesions and the surrounding normal skin is low. The attention mechanism can enhance the model's ability to focus on key features and improve segmentation accuracy.
[0101] A variant combining both mechanisms can be designed in the following way:
[0102] Modular design: Multi-scale feature fusion and attention mechanism are applied simultaneously at different levels of the model, so that the model can efficiently capture the global and local features of the lesion at each scale.
[0103] Adaptive weights: Design an adaptive mechanism to dynamically adjust the weights of multi-scale feature fusion and attention mechanism according to the complexity of dermatitis lesions, thereby optimizing the segmentation effect of the model.
[0104] This combined variant will be particularly suitable for dermatitis image segmentation and can better handle the complexity and diversity of dermatitis lesions.
[0105] 22. Fine-tune using labeled datasets:
[0106] In order to improve the performance of the SAM model in the dermatitis image segmentation task, it is an essential step to fine-tune the model using a well-labeled dataset. The fine-tuning process usually includes the following key steps:
[0107] 1. Selection of pre-trained models: First, the SAM model is pre-trained on a large-scale general image dataset to obtain basic feature representations. This pre-training helps the model learn basic image features, such as edges, textures, and shapes, laying the foundation for subsequent fine-tuning on the dermatitis image dataset.
[0108] 2. Implementation of fine-tuning strategy: When fine-tuning on the atopic dermatitis dataset, a step-by-step fine-tuning approach can be used. First, the pre-trained model is trained on the dermatitis dataset to adapt to the characteristics of dermatitis lesions. Then, the training parameters such as learning rate, batch size, etc. are gradually adjusted to optimize the model's ability to recognize dermatitis lesions.
[0109] 3. Customization of loss function: Design a loss function suitable for the dermatitis image segmentation task to optimize the model's ability to identify lesion areas. You can consider using a weighted cross entropy loss function or a Dice loss function to improve the segmentation accuracy of the model on small lesion areas.
[0110] When designing a loss function suitable for the dermatitis image segmentation task, the goal is to optimize the model's recognition and segmentation accuracy of the lesion area. The following loss function formula is preferred:
[0111] Weighted cross entropy loss function:
[0112]
[0113] Where N is the number of pixels in the image. C is the number of categories. c is the weight of category c, which is used to balance the number of samples in different categories. i,c is the true label of pixel i. i,c is the probability that pixel i is predicted to be of category c.
[0114] Dice loss function:
[0115]
[0116] Among them, p i is the predicted probability of the i-th pixel, y i is the true label of the i-th pixel.
[0117] Combined loss function:
[0118] L=α·L WCE +β·L Dice
[0119] Among them, α and β are the weight coefficients of the two loss functions (weighted cross entropy loss function and Dice loss function).
[0120] The role of loss function in image segmentation:
[0121] Weighted cross entropy loss function:
[0122] Function: Weighted cross entropy can handle the problem of class imbalance. In dermatitis images, the lesion area is usually small and belongs to the minority category. By giving a larger weight to the minority category, the model can pay more attention to these important areas and improve the segmentation effect of small lesions.
[0123] Dice loss function:
[0124] Function: Dice loss is particularly suitable for segmentation tasks and can directly optimize the overlap of segmented regions (i.e., the similarity between the model-predicted region and the true region). It performs well when dealing with unbalanced samples, ensuring that the model focuses not only on the accuracy of the lesion region, but also on the overall performance of the entire segmented region.
[0125] Combined loss function:
[0126] Effect: By combining weighted cross entropy and Dice loss, the model can simultaneously optimize the class imbalance and region overlap problems. This combination method is particularly effective in the dermatitis lesion segmentation task because it balances the focus on small lesion areas and the overall segmentation effect, improving the accuracy and robustness of the model.
[0127] 4. Data enhancement and cross-validation: During the fine-tuning process, data enhancement techniques are used to increase the diversity of data, such as rotation, scaling, color transformation, etc., to enhance the generalization ability of the model. At the same time, the performance of the model is evaluated through cross-validation to ensure that the model can perform well and stably on different data sets.
[0128] 23. Adjust model parameters to suit the characteristics of dermatitis lesions:
[0129] In order to make the SAM model better adapt to the characteristics of dermatitis lesions, the hyperparameters and structure of the model need to be adjusted. The following are some common adjustment methods:
[0130] 1. Adjust the learning rate: The learning rate is an important parameter that affects the model training speed and convergence performance. In the dermatitis image segmentation task, the learning rate can be gradually adjusted through experiments so that the model can better capture the complex features of dermatitis lesions during training without overfitting. In dermatitis images, the boundaries of the lesions may be very blurred, so a smaller learning rate can be used to allow the model to gradually learn these complex details. The strategy of gradually reducing the learning rate helps the model better capture the subtle features of dermatitis lesions in later training and avoid skipping important details.
[0131] 2. Optimize the size and number of convolution kernels: The segmentation of dermatitis lesions requires capturing features of multiple scales. By adjusting the size of the convolution kernel and increasing the number of convolution layers, the model's ability to capture features of different scales can be improved, thereby optimizing the segmentation accuracy. The features of dermatitis lesions may exist at multiple scales, especially for some small lesions or areas with blurred boundaries. Therefore, it is recommended to use multi-scale convolution kernels (such as a combination of smaller 3x3 and larger 7x7 convolution kernels) and increase the depth of the model to capture features of dermatitis lesions at different scales. This helps the model to more finely process the details and complex textures of the lesion area.
[0132] 3. Introduce regularization technology: In order to prevent the model from overfitting, L2 regularization or Dropout and other technologies can be introduced. These technologies can effectively reduce the impact of noise during training, so that the model can better generalize to unseen dermatitis images. In view of the noise and complexity in dermatitis images, image region-based regularization methods such as Spatial Dropout can be used instead of conventional global Dropout. This can better preserve the local features of the lesion area and reduce the impact of background noise.
[0133] 4. Parameter sharing and feature fusion: In view of the specificity of the dermatitis lesion segmentation task, a parameter sharing mechanism can be introduced into the model to reduce redundant calculations. At the same time, semantic information at different levels can be combined through the feature fusion layer to improve the segmentation ability of the model. Since the boundaries of dermatitis lesions are fuzzy and the features are complex, a shared convolution layer can be introduced into the model to extract global features. At the same time, a multi-layer feature fusion mechanism can be introduced into the deep network to combine the edge features captured in the early layers with the deep semantic information. This fusion can better handle the diverse lesion manifestations in dermatitis images and improve the accuracy of segmentation.
[0134] Step 3: Dermatitis lesion segmentation
[0135] The dermatitis lesion segmentation step refers to the application of the trained SAM model for image segmentation, rather than the process of training the model. In this step, the preprocessed dermatitis image is input into the fine-tuned and trained SAM model, and the model automatically extracts features, predicts lesion boundaries, and generates segmentation masks. These operations utilize the features and parameters learned in the previous training process and are the inference process of the model.
[0136] The steps of lesion segmentation in this embodiment method are as follows:
[0137] 31. Input the dermatitis image to be segmented: Input the preprocessed image into the fine-tuned SAM model.
[0138] In the process of lesion segmentation, the preprocessed dermatitis images are first input into the fine-tuned SAM model. Users can input multiple sets of clinical trial data, including but not limited to skin images, symptom descriptions, basic patient information, etc. The preprocessed images have been de-noised, contrast enhanced, and color corrected to ensure that the model can effectively identify the lesion area. By inputting these high-quality images into the model, the consistency and reliability of the input data are ensured, allowing the model to extract lesion features more accurately.
[0139] 32. Automatic feature extraction: The model automatically extracts global and local features from the image, including color, texture, shape and other information.
[0140] After the image is input, the SAM model automatically starts to extract global and local features from the image. Global features include the overall color distribution and brightness contrast of the image, while local features include detailed information such as texture, shape, and edges of the lesion area. The model can accurately capture these features, especially the subtle differences in the lesion area, through its built-in convolutional neural network (CNN) and attention mechanism.
[0141] 33. Predict lesion boundaries: Use feature information to predict the boundaries of the lesion area and generate a preliminary segmentation mask.
[0142] After feature extraction is completed, the SAM model uses this feature information to predict the boundaries of the lesion. The model focuses on the key areas of the image through the attention mechanism and uses the graph convolutional network (GCN) to enhance the recognition of boundaries. This process generates a preliminary segmentation mask that identifies possible lesion boundaries.
[0143] The final model architecture can add attention mechanism modules and graph convolutional networks. The introduction of these modules helps to enhance the model's ability to identify lesion boundaries.
[0144] Model architecture overview:
[0145] Feature extraction layer: Extract multi-scale features based on pre-trained convolutional neural network.
[0146] Attention mechanism module: The attention mechanism is applied on the feature map to make the model focus on the dermatitis lesion area and enhance the recognition of key features.
[0147] Graph Convolutional Network (GCN): Apply graph convolutional network on the feature map after the attention mechanism to further improve the model's prediction ability for complex boundaries.
[0148] Segmentation Head: Combine the feature maps processed above to generate a preliminary segmentation mask to identify possible lesion boundaries.
[0149] Multi-scale feature fusion: Before the segmentation head, features from different levels are fused to improve the model's ability to recognize multi-scale lesions.
[0150] This architecture aims to improve the accuracy of dermatitis lesion segmentation, especially when dealing with complex boundaries and subtle lesions.
[0151] 34. Post-processing: Post-process the preliminary segmentation results, including denoising, morphological operations, etc., to optimize the quality of the segmentation mask. Segmentation mask generation: Finally, a clear and accurate segmentation mask is generated to provide an intuitive reference for clinical diagnosis.
[0152] After the initial segmentation results are generated, post-processing steps are performed to optimize the quality of the segmentation mask. Post-processing includes denoising, morphological operations (such as dilation and erosion) to remove small noise points or connect broken boundaries. The final segmentation mask is a binary image in which white areas represent lesions and black areas represent healthy skin. This segmentation mask clearly depicts the lesion area and provides an intuitive reference for clinical diagnosis.
[0153] Step 4: Result evaluation and optimization
[0154] The method of this embodiment adopts the following method to evaluate and optimize the segmentation results:
[0155] 41. Quantitatively evaluate segmentation results: Use indicators such as precision, recall, and F1 score to quantitatively evaluate segmentation results.
[0156] 1. Precision:
[0157] Measures the proportion of the lesion area predicted by the model that is actually a lesion. High accuracy means that the model can effectively reduce the occurrence of mis-segmentation and avoid misidentifying healthy skin as a lesion area.
[0158] 2. Recall:
[0159] Measures the proportion of all actual lesion areas that are correctly predicted. A high recall rate indicates that the model can capture more actual lesion areas and reduce missed segmentations.
[0160] 3.F1 Score:
[0161] The harmonic mean of precision and recall is used to balance the precision and recall of the model. It is suitable for balancing the need for mis-segmentation and missed segmentation in medical image segmentation.
[0162] 4. Intersection over Union (IoU) and Dice coefficient:
[0163] Measures the degree of overlap between the predicted segmented area and the actual lesion area. It directly reflects the segmentation accuracy of the model and is of great significance to the generalization ability of the model.
[0164] 42. Qualitative evaluation of segmentation results: Qualitatively evaluate the accuracy and usability of segmentation results through clinician feedback and visual inspection. Confusion matrix analysis: Use confusion matrix to analyze different types of errors and identify model weaknesses. Performance monitoring: Establish a performance monitoring mechanism to track the segmentation effect of the model in real time.
[0165] 1. Accuracy of segmentation boundaries:
[0166] The segmentation results generated by the model are evaluated by observing whether the segmentation boundary coincides with the actual lesion boundary.
[0167] 2. Mis-segmentation and missed segmentation:
[0168] Check whether the model has obvious mis-segmentation (segmenting healthy skin as lesions) or missed segmentation (failing to identify actual lesions).
[0169] 3. Expert feedback:
[0170] Clinicians provide feedback based on their professional knowledge to guide the improvement of the model and ensure the clinical usability of the segmentation results.
[0171] 43. Iteratively optimize the SAM model based on the evaluation results: Based on the evaluation results, continuously iterate and optimize the model, including adjusting the network structure, loss function and training strategy.
[0172] 1. Adjust the network structure:
[0173] Based on the evaluation results, modify the model's hierarchy or introduce new network components, such as adding convolutional layers or attention mechanisms, to improve segmentation performance.
[0174] 2. Modify the loss function:
[0175] Customize the loss function to better guide the model to learn the characteristics of the lesion area and enhance the boundary accuracy.
[0176] 3. Optimization of data enhancement strategy:
[0177] Enrich data augmentation strategies, such as adding specific colors or geometric transformations, to improve the model's ability to adapt to images under different conditions.
[0178] 4. Re-fine-tune the model:
[0179] Targeted fine-tuning is performed on the atopic dermatitis dataset, such as gradually reducing the learning rate or adjusting the sample weight distribution, so that the model can better adapt to the lesion characteristics.
[0180] 5. Re-evaluation:
[0181] After each optimization, quantitative and qualitative evaluations are performed to verify the model improvement effect and ensure its accuracy and reliability in practical applications.
[0182] Detailed description of clinical application scenarios of the method in this embodiment:
[0183] 1. Website development and functions:
[0184] To develop a user-friendly and intuitive website for calculating atopic dermatitis characteristics.
[0185] The site will integrate advanced computational models that have been professionally trained to accurately analyze clinical data.
[0186] 2. Data input and processing:
[0187] Users can input multiple sets of clinical trial data, including but not limited to skin images, symptom descriptions, basic patient information, etc.
[0188] The website will automatically analyze the input data and use deep learning algorithms to quickly calculate key skin feature parameters.
[0189] 3. Calculation results and report generation:
[0190] The website will provide a detailed analysis report, including key indicators such as the affected area of skin lesions, EASI (Eczema Area and Severity Index), and SCORDAD score.
[0191] The report will also include data on the three primary colors, chromaticity values, Lab color space, ITA* (melanin index), skin color uniformity, etc., providing doctors with comprehensive reference information.
[0192] 4. Visual display:
[0193] The website provides powerful visualization tools to intuitively display complex data in the form of charts, images, etc.
[0194] Users can clearly see the changing trend of skin lesions and compare the effects of different treatment measures.
[0195] Multi-patient analysis and comparison:
[0196] Supports analysis of data from multiple patients, making it easier for doctors to conduct group studies or clinical trials.
[0197] Users can upload multiple sets of patient data, and the website will automatically perform data comparison and analysis to help doctors discover the differences and commonalities between different patients.
[0198] 5. Single patient display:
[0199] For long-term follow-up of a single patient, the website provides personalized data display and analysis.
[0200] Doctors and patients can intuitively understand the development of the disease and evaluate the effectiveness of treatment.
[0201] 6. User interaction and feedback:
[0202] The website is designed with an interactive user interface, and users can adjust the analysis parameters according to their needs.
[0203] Provide a feedback mechanism where users can make suggestions or report issues in order to continuously optimize website functionality.
[0204] 7. Security and privacy protection:
[0205] The website strictly abides by medical data protection regulations to ensure the security and privacy of user data.
[0206] Encryption technology is used to protect the data uploaded by users and prevent unauthorized access.
[0207] 8. Education, training and support:
[0208] The website provides educational resources to help physicians and patients better understand the characteristics and treatment of atopic dermatitis.
[0209] Regularly updated with medical research progress, providing the latest treatment guidelines and recommendations.
[0210] 9. Technical maintenance and update:
[0211] There is a professional technical team behind the website to maintain and upgrade it to ensure the accuracy and foresight of the calculation model.
[0212] As medical research deepens, the website will continue to introduce new analysis tools and algorithms to improve service quality.
[0213] In summary, the main technical effects of the method of this embodiment are reflected in the following aspects:
[0214] 1. High-precision implementation
[0215] The SAM model of the method of this embodiment has significant advantages in achieving high precision. First, the model uses advanced deep learning technology, especially convolutional neural network (CNN), which can automatically extract multi-level features in the image, including color, texture, shape, etc., which are essential for identifying dermatitis lesions. Secondly, the SAM model can focus on the key areas in the image through the attention mechanism, so as to more accurately identify the lesion boundaries. In addition, the method of this embodiment uses a variety of image enhancement techniques such as denoising, contrast enhancement and size standardization in the data preprocessing stage, which further improves the image quality and provides a clearer input for the model. In the model fine-tuning stage, the method of this embodiment uses transfer learning and customized loss functions to ensure the segmentation accuracy of the model on the specific dermatitis image. The website uses the deep learning technology of the SAM model to automatically extract multi-level features in the image, such as color, texture and shape, to ensure accurate identification of dermatitis lesions. Through the attention mechanism, the model can focus on the key areas in the image and improve the recognition accuracy of the lesion boundary.
[0216] 2. High-efficiency application value
[0217] High efficiency is another major advantage of the method of this embodiment. The SAM model does not need to rely on a large amount of labeled data, which greatly reduces the workload and time cost of data preparation. In clinical applications, time is often a very valuable resource, and the method of this embodiment can quickly segment images, providing doctors with immediate auxiliary diagnosis information. In addition, the SAM model has high computational efficiency and can complete the image segmentation task in a relatively short period of time. This is particularly important for clinical environments that require rapid response. Highly efficient application is also reflected in the ease of use of the model. Even non-professionals can quickly get started and perform image segmentation operations. The website can quickly process the clinical experimental data entered by the user, and instantly generate auxiliary diagnosis information to meet the needs for rapid response in the clinical environment.
[0218] 3. Strong interpretability
[0219] The SAM model of the method in this embodiment not only provides accurate segmentation results, but also has good interpretability. The decision-making process of the model can be presented to the doctor in a visual way, including feature maps, attention weights, etc. This information helps the doctor understand how the model identifies and segments lesions. Interpretability is crucial to improving doctors' trust in the model. In clinical diagnosis, doctors need to have a full understanding of the decision-making process of auxiliary diagnostic tools before they can safely adopt their suggestions. The interpretability of the SAM model provides doctors with this transparency, making the output of the model easier for doctors to accept and understand. The website provides a visual display of the model's decision-making process, such as feature maps and attention weights, to help doctors understand the model's recognition and segmentation process and improve doctors' trust in the model.
[0220] 4. Strong generalization ability
[0221] Generalization ability is one of the important indicators to measure model performance. The SAM model of the method in this embodiment performs well in generalization ability and can adapt to atopic dermatitis images of different types and severity. This advantage is due to the zero-sample learning ability of the model, which enables the model to quickly adapt to new lesion types without a large amount of labeled data. In addition, the method in this embodiment adopts a variety of data enhancement techniques during the model training process to improve the adaptability of the model to different image conditions. In the model fine-tuning stage, the method in this embodiment adopts methods such as cross-validation to ensure that the model can maintain stable performance on different data sets.
[0222] Those skilled in the art will appreciate that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, wherein the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0223] The above is only a preferred embodiment of the present invention. It should be pointed out that ordinary technicians in this technical field can make several improvements and supplements without departing from the principle of the present invention. These improvements and supplements should also be regarded as the scope of protection of the present invention.
Claims
1. A method for segmenting atopic dermatitis images based on the SAM model, characterized in that The following steps are involved: S1. Data preparation and preprocessing to achieve high-precision dermatitis image segmentation. Specifically, S11. Collect a diverse dataset of dermatitis images to ensure the wide adaptability of the SAM model. S12, finely annotate the dermatitis image dataset for use in training and validating the SAM model; S13, preprocessing dermatitis image data to improve the usability and segmentation effect of dermatitis images; S2. Fine-tune the SAM model to adapt to the characteristics of atopic dermatitis image segmentation. Specifically, S21. Considering the specific characteristics of dermatitis lesions, select the SAM model variant suitable for dermatitis image segmentation; S22. Fine-tune the SAM model using the labeled dermatitis image dataset to improve the performance of the SAM model in the dermatitis image segmentation task; S23. Adjust the hyperparameters and structure of the SAM model to make the SAM model better adapt to the characteristics of dermatitis lesions; S3. Use the trained SAM model to segment dermatitis lesions on dermatitis image data. Specifically, S31, inputting the preprocessed dermatitis image into the fine-tuned SAM model; S32, SAM model automatically extracts global and local features from the input dermatitis image; S33, using global and local feature information to predict the boundary of the dermatitis lesion area and generate a preliminary segmentation mask; S34, post-processing the preliminary segmentation mask to optimize the quality of the preliminary segmentation mask to clearly depict the dermatitis lesion area and complete the dermatitis image segmentation.
2. The method for segmenting atopic dermatitis images based on the SAM model according to claim 1, characterized in that The following steps are also included: S4. Evaluate and optimize the dermatitis image segmentation results. Specifically, S41, quantitative evaluation of dermatitis image segmentation results; S42, qualitative evaluation of dermatitis image segmentation results; S43. Iteratively optimize the SAM model based on the quantitative and qualitative evaluation results.
3. The method for segmenting atopic dermatitis images based on the SAM model according to claim 2, characterized in that Step S21 selects the following types of SAM model variants: a SAM variant with multi-scale feature fusion, a SAM variant introducing an attention mechanism, or a lightweight SAM model variant.
4. The method for segmenting atopic dermatitis images based on the SAM model according to claim 3, characterized in that: The SAM model variant includes, in sequence, a feature extraction layer for extracting multi-scale features based on a pre-trained convolutional neural network, an attention mechanism module for enhancing the recognition of key features in the dermatitis lesion area, a graph convolutional network for further improving the complex boundary prediction capability on the feature map after the attention mechanism, a multi-scale feature fusion module for fusing features from different levels to improve the multi-scale lesion recognition capability, and a segmentation head module for generating a preliminary segmentation mask to mark the lesion boundary.
5. The method for segmenting atopic dermatitis images based on the SAM model according to claim 4, characterized in that The fine-tuning process in step S22 includes the following key sub-steps: S221. Selection of pre-trained SAM model: Pre-train the SAM model on a large-scale general image dataset to obtain basic feature representation; S222. Implementation of fine-tuning strategy: Perform gradual fine-tuning on the dermatitis image dataset. First, the pre-trained SAM model is trained on the dermatitis image dataset to adapt to the characteristics of dermatitis lesions, and then the training parameters are gradually adjusted to optimize the SAM model's ability to recognize dermatitis lesions. S223. Customization of loss function: Design a loss function suitable for the dermatitis image segmentation task and optimize the SAM model's ability to identify lesion areas; S224, data augmentation and cross-validation: During the fine-tuning process, data augmentation technology is used to increase the diversity of dermatitis image data to enhance the generalization ability of the SAM model. At the same time, the performance of the SAM model is evaluated through cross-validation to ensure that the SAM model can perform well and stably on different data sets.
6. The method for segmenting atopic dermatitis images based on the SAM model according to claim 4, characterized in that The loss function customized in step S223 is a combined loss function: L=α·L WCE +β·L Dice Among them, α is the weight coefficient of the weighted cross entropy loss function, and β is the weight coefficient of the Dice loss function; Weighted cross entropy loss function: Where N is the number of pixels in the image, C is the number of categories, and w c is the weight of category c, which is used to balance the number of samples in different categories, y i,c is the true label of pixel i, p i,c is the probability that pixel i is predicted to be of category c; Dice loss function: Among them, p i is the predicted probability of the i-th pixel, y i is the true label of the i-th pixel.
7. The method for segmenting atopic dermatitis images based on the SAM model according to claim 6, characterized in that Step S23 includes the following adjustment methods: adjusting the learning rate, optimizing the convolution kernel size and the number of layers, introducing regularization technology, parameter sharing and feature fusion.
8. The method for segmenting atopic dermatitis images based on the SAM model according to claim 7, characterized in that Step S41: Use precision, recall, F1 score, intersection-over-union ratio and Dice coefficient to quantitatively evaluate the dermatitis image segmentation results.
9. The method for segmenting atopic dermatitis images based on the SAM model according to claim 8, characterized in that Step S42: qualitatively evaluate the dermatitis image segmentation result using the accuracy of the segmentation boundary, mis-segmentation and missed segmentation, and expert feedback.
10. The method for segmenting atopic dermatitis images based on the SAM model according to claim 9, characterized in that Step S43: Iteratively optimize the SAM model by adjusting the network structure, modifying the loss function, optimizing the data enhancement strategy, and re-fine-tuning the SAM model.
Citation Information
Patent Citations
Nail disease image intelligent diagnosis method based on deep learning
CN117456283A
Automatic SAM segmentation method, device and equipment for biomedical image
CN117911683A
Medical diagnosis method and system based on multi-modal AIGC model
CN118098570A
SAM large model-based goiter ultrasonic image identification method and system
CN118230077A
Cited By
Polyp image segmentation method and system based on combination of SAM model and graph neural network
CN120070886A
Children atopic dermatitis severity intelligent evaluation system and computer equipment
CN120089376A
