Training method and system for dermatoscope image segmentation model
By performing image color correction, blur removal and sample enhancement in the training system of the dermatoscope image segmentation model, and combining convolutional neural network and attention mechanism, the problem of insufficient segmentation accuracy and generalization ability of dermatoscope image in the prior art is solved, and more efficient and accurate segmentation of skin lesions is achieved.
Patent Information
- Application Number
- CN202510541618.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-04-28
AI Technical Summary
The prior art does not perform well in dermatoscope image segmentation, especially when dealing with complex backgrounds, different lighting conditions and skin types, resulting in a decrease in segmentation accuracy and insufficient generalization ability.
A training system for dermatoscope image segmentation model is proposed, including image color calibration and noise removal module, image sample enhancement balance module, segmentation model construction module and segmentation model training optimization module. The system constructs and optimizes the dermatoscope image segmentation model through color offset correction, dispersed loss blur removal, standardized processing, image sample enhancement and proportional balance, combined with convolutional neural networks, multi-scale feature fusion and attention mechanisms of multi-source dermatoscope images.
Through the above methods, the segmentation accuracy and generalization ability of the dermatoscope image segmentation model are significantly improved, ensuring the accurate identification and segmentation of skin lesion areas under different conditions.
Smart Images

Figure CN120070899A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly to a training method and system for a dermoscopic image segmentation model. Background Art
[0002] Dermoscopic examination can provide detailed information on skin lesion areas through high magnification and optical imaging technology. With the continuous development of dermoscopic technology, its application in the early detection of skin cancer (especially melanoma) is becoming more and more extensive. In dermoscopic image analysis, image segmentation is one of the key steps, and its goal is to separate the lesion area of interest from the dermoscopic image for subsequent feature extraction and classification. In recent years, the rapid development of deep learning technology has enabled convolutional neural networks (CNNs) to achieve outstanding results in image segmentation tasks. However, although many methods for medical image segmentation have been proposed, there are still some problems when specifically applied to dermoscopic images. For example, existing models often perform poorly when dealing with complex backgrounds, different lighting conditions, and skin types, resulting in a decrease in segmentation accuracy, which further affects the generalization ability and application effect of the model. Summary of the Invention
[0003] Based on this, it is necessary for the present invention to provide a training method and system for a dermoscopic image segmentation model to solve at least one of the above technical problems.
[0004] To achieve the above object, a training system for a dermoscopic image segmentation model includes the following modules: An image color correction and noise removal module, configured to obtain multi-source dermoscopic images; obtain dermoscopic spectral images corresponding to the multi-source dermoscopic images in the R, G, and B color channels, and perform color offset correction processing on the multi-source dermoscopic images based on the dermoscopic spectral images corresponding to the R, G, and B color channels to generate a dermoscopic color offset corrected image; perform scatter damage blur removal and normalization processing on the dermoscopic color offset corrected image to generate a dermoscopic normalized image; An image sample enhancement and balancing module, configured to perform image sample enhancement on the dermoscopic normalized image to obtain dermoscopic enhanced image samples; perform over- and under-sampling balancing processing on the dermoscopic enhanced image samples to generate dermoscopic proportion-balanced image samples; A segmentation model construction module, configured to construct a lesion area segmentation network based on a convolutional neural network in combination with a multi-scale feature fusion module and an attention mechanism to generate a dermoscopic image segmentation model; The segmentation model training optimization module is used to optimize the segmentation model training of the dermoscopic image segmentation model based on the dermoscopic proportion-balanced image samples and in combination with the adaptive learning rate adjustment strategy, so as to generate an optimized dermoscopic image segmentation model, and output the corresponding dermoscopic image lesion area segmentation result at the last layer within the lesion area segmentation network.
[0005] Further, the image color calibration and noise removal module includes the following functions: Obtain multi-source dermoscopic images; Obtain the corresponding dermoscopic spectral images in the R, G, and B color channels through the multi-source dermoscopic images, and perform color shift correction processing on the multi-source dermoscopic images based on the corresponding dermoscopic spectral images in the R, G, and B color channels to generate dermoscopic color shift corrected images; Enhance the contrast of the dermoscopic color shift corrected images using histogram equalization to obtain dermoscopic contrast enhanced images; Perform pixel blurriness analysis on the dermoscopic contrast enhanced images to obtain the pixel blurriness of the dermoscopic images; Based on the pixel blurriness of the dermoscopic images, perform scatter loss blurring removal and pixel normalization processing on each pixel block in the dermoscopic contrast enhanced images to generate dermoscopic normalized images.
[0006] Further, the obtaining the corresponding dermoscopic spectral images in the R, G, and B color channels through the multi-source dermoscopic images, and performing color shift correction processing on the multi-source dermoscopic images based on the corresponding dermoscopic spectral images in the R, G, and B color channels includes: Perform RGB color channel decomposition on the multi-source dermoscopic images at different color channel wavelengths to generate the corresponding dermoscopic spectral images in the R, G, and B color channels; Perform local area brightness analysis on the corresponding dermoscopic spectral images in the R, G, and B color channels to obtain the local area brightness characteristics in the R, G, and B color channels, including the local area brightness distribution mean and the local area brightness distribution variance; Perform image color shift calculation on the corresponding dermoscopic spectral images based on the local area brightness characteristics in the R, G, and B color channels to obtain the dermoscopic image color shift amounts in the R, G, and B color channels; Perform channel color adjustment analysis on the corresponding dermoscopic spectral images based on the dermoscopic image color shift amounts in the R, G, and B color channels to obtain the dermoscopic image color adjustment amplitudes and adjustment directions in the R, G, and B color channels; Color offset correction processing is performed on the dermoscopic spectral image corresponding to the corresponding color channel based on the color adjustment amplitude and adjustment direction of the dermoscopic image corresponding to the R, G, and B color channels, so as to correct the color value corresponding to each pixel block in the dermoscopic spectral image according to the corresponding color adjustment amplitude and adjustment direction of the dermoscopic image, and generate a dermoscopic color offset correction image.
[0007] Further, the color offset correction processing of the dermoscopic spectral image corresponding to the corresponding color channel based on the color adjustment amplitude and adjustment direction of the dermoscopic image corresponding to the R, G, and B color channels includes: Channel adjustment evaluation calculations are performed according to the color adjustment amplitude and adjustment direction of the dermoscopic image corresponding to the R, G, and B color channels to obtain the dermoscopic color channel adjustment coefficients corresponding to the R, G, and B color channels; The spectral characteristics of the dermoscopic image corresponding to the corresponding color channel are obtained through the dermoscopic spectral image corresponding to the R, G, and B color channels, and color offset simulation is performed on the corresponding color channel based on the spectral characteristics of the dermoscopic image corresponding to the corresponding color channel and in combination with the dermoscopic color channel adjustment coefficients corresponding to the R, G, and B color channels, so as to generate the dermoscopic image color offset mechanism corresponding to the R, G, and B color channels; Based on the dermoscopic image color offset mechanism corresponding to the R, G, and B color channels and according to the corresponding dermoscopic color channel adjustment coefficients, color value offset correction is performed on the color value corresponding to each pixel block in the dermoscopic spectral image corresponding to the corresponding color channel, so as to generate a local color offset correction matrix corresponding to the R, G, and B color channels, including the color offset value corresponding to each pixel block in the corresponding color channel; Based on the local color offset correction matrix corresponding to the R, G, and B color channels, pixel-by-pixel color correction and reconstruction processing are performed on each pixel block in the dermoscopic spectral image corresponding to the corresponding color channel to generate a dermoscopic color offset correction image.
[0008] Further, the process of removing scattered blur and pixel normalization for each pixel block in the dermoscopic contrast-enhanced image based on the pixel blur degree of the dermoscopic image includes: Pixel blur division is performed on each pixel block in the dermoscopic contrast-enhanced image based on the pixel blur degree of the dermoscopic image, so as to compare and judge the pixel blur degree corresponding to each pixel block according to a preset pixel blur threshold. If it is greater than the preset pixel blur threshold, the corresponding pixel block is determined as a scattered blur pixel block; if it is equal to the preset pixel blur threshold, the corresponding pixel block is determined as a noise blur pixel block; if it is less than the preset pixel blur threshold, the corresponding pixel block is determined as a clear pixel block; Perform blurring block noise removal on the corresponding scattering blurred pixel blocks and noise blurred pixel blocks in the dermoscopic contrast-enhanced image. For the scattering blurred pixel blocks, calculate the light scattering degree to compensate for the corresponding light scattering loss of the pixel blocks. For the noise blurred pixel blocks, enclose them into corresponding noise blurred regions and use median filtering to remove noise interference from the noise blurred regions to generate a dermoscopic blurred denoised image; Perform pixel mean and variance analysis on the dermoscopic blurred denoised image to obtain the dermoscopic image pixel mean and the dermoscopic image pixel variance; Perform pixel normalization processing on the dermoscopic blurred denoised image based on the dermoscopic image pixel mean and the dermoscopic image pixel variance to generate a dermoscopic normalized image.
[0009] Further, the calculating the light scattering degree for the scattering blurred pixel blocks to compensate for the corresponding light scattering loss includes: Perform spectral scattering analysis on the scattering blurred pixel blocks to statistically analyze the corresponding scattering wavelength and scattering blurring distortion degree of the pixel blocks, and form a feature vector from them to generate a spectral scattering blurred feature vector; Obtain the corresponding environmental factors, object surface materials, and light source angles of the pixel block through the scattering blurred pixel block, and perform scattering intensity prediction calculation based on the corresponding environmental factors, object surface materials, and light source angles of the pixel block and in combination with the spectral scattering blurred feature vector to obtain the light scattering degree corresponding to the pixel block; Obtain the corresponding theoretical light scattering intensity of the pixel block through the scattering blurred pixel block, and perform scattering loss compensation calculation based on the light scattering degree corresponding to the pixel block and the corresponding theoretical light scattering intensity to obtain a scattering loss compensation factor; Compensate for the corresponding light scattering loss of the pixel block based on the scattering loss compensation factor.
[0010] Further, the image sample enhancement and balancing module includes the following functions: Perform image sample enhancement on the dermoscopic normalized image to enhance and simulate dermoscopic image samples corresponding to different conditions through operations such as random rotation, flipping, scaling, cropping, brightness adjustment, and contrast adjustment to obtain dermoscopic enhanced image samples; Perform lesion area ratio analysis on the dermoscopic enhanced image samples to quantitatively calculate the ratio value between the lesion samples and the normal samples in the dermoscopic image samples to obtain the dermoscopic image sample lesion ratio; Oversampling and undersampling balancing processing is performed on dermoscopic enhanced image samples based on the lesion ratio of dermoscopic image samples. Specifically, in the oversampling and undersampling balancing processing, if the lesion ratio of the dermoscopic image samples shows that the number of lesion samples is much less than that of normal samples, oversampling operation is performed on the corresponding lesion samples in the dermoscopic enhanced image samples to increase the number of samples corresponding to the minority class by using a generative adversarial network to replicate the samples corresponding to the minority class, while undersampling operation is performed on the corresponding normal samples in the dermoscopic enhanced image samples to reduce the number of samples corresponding to the majority class, so as to generate dermoscopic ratio-balanced image samples.
[0011] Furthermore, the segmentation model construction module includes the following functions: Design 3 layers of 5x5 convolutional layers, 3x3 convolutional layers, and 1x1 pooling layers through a convolutional neural network, and connect each layer through a connection channel layer to construct a corresponding dermoscopic image segmentation network architecture; Design and combine corresponding multi-scale feature fusion modules in different convolutional layers within the dermoscopic image segmentation network architecture, so as to fuse the high-resolution lesion features corresponding to the 3x3 shallow layer and the semantic lesion features corresponding to the 5x5 deep layer through the multi-scale feature fusion module by introducing skip connections and feature fusion operations. Then, adjust the feature maps of different scales to the same size through upsampling and downsampling operations in the pooling layer for splicing and fusion, and introduce an attention mechanism within the connection channel layer between each layer to improve the segmentation ability of different-scale lesion regions, thereby constructing a lesion region segmentation network. The attention mechanism consists of a channel attention module and a spatial attention module. The channel attention module is set within the connection channel layer between the convolutional layer and the pooling layer in each layer to automatically learn the importance between each connection channel layer; while the spatial attention module is set within each connection channel layer between the three-layer network architectures to focus on the corresponding lesion regions in the dermoscopic image samples to enhance the network's expression of the segmentation task corresponding to the lesion regions, so as to generate a dermoscopic image segmentation model.
[0012] Furthermore, the segmentation model training and optimization module includes the following functions: Divide the dermoscopic ratio-balanced image samples into training image samples, validation image samples, and test image samples according to the division ratio of 7:2:1; Input the training image samples into the dermoscopic image segmentation model for segmentation model training, and input the validation image samples into the trained dermoscopic image segmentation model for training loss analysis, so as to calculate the cross-entropy loss for the lesion classification task and the Dice loss for the lesion segmentation task through training, and perform weighted summation according to the cross-entropy loss and the Dice loss to obtain the dermoscopic image segmentation training loss; Adjust the learning rate of the dermoscopic image segmentation model after training based on the training loss of dermoscopic image segmentation and in combination with an adaptive learning rate adjustment strategy. When it is determined according to the adaptive learning rate adjustment strategy that the training loss of dermoscopic image segmentation does not decrease significantly within 10 iteration cycles, reduce the learning rate corresponding to the dermoscopic image segmentation model to 0.1 times the original, and use test image samples to verify the learning rate convergence of the dermoscopic image segmentation model after the learning rate adjustment. At the same time, adopt the L2 regularization method for model training optimization to generate an optimized dermoscopic image segmentation model, and output the corresponding dermoscopic image lesion area segmentation result at the last layer within the lesion area segmentation network.
[0013] Furthermore, the present invention also provides a training method for a dermoscopic image segmentation model. The method is implemented based on the training system for a dermoscopic image segmentation model as described above. The training method for a dermoscopic image segmentation model includes: Obtain multi-source dermoscopic images; obtain the corresponding dermoscopic spectral images in the R, G, and B color channels through the multi-source dermoscopic images, and perform color offset correction processing on the multi-source dermoscopic images based on the corresponding dermoscopic spectral images in the R, G, and B color channels to generate dermoscopic color offset correction images; perform lossy blur removal and normalization processing on the dermoscopic color offset correction images to generate dermoscopic normalized images; Perform image sample enhancement on the dermoscopic normalized images to obtain dermoscopic enhanced image samples; perform over- and under-sampling balance processing on the dermoscopic enhanced image samples to generate dermoscopic ratio-balanced image samples; Construct a lesion area segmentation network based on a convolutional neural network in combination with a multi-scale feature fusion module and an attention mechanism to generate a dermoscopic image segmentation model; Based on the dermoscopic ratio-balanced image samples and in combination with an adaptive learning rate adjustment strategy, perform segmentation model training optimization on the dermoscopic image segmentation model to generate an optimized dermoscopic image segmentation model, and output the corresponding dermoscopic image lesion area segmentation result at the last layer within the lesion area segmentation network.
[0014] Advantages of the present invention: The training system for the dermoscopic image segmentation model proposed by the present invention is generally composed of an image color calibration and noise removal module, an image sample enhancement and balancing module, a segmentation model construction module, and a segmentation model training and optimization module. Compared with the prior art, the beneficial effect of this application is that by obtaining multi-source dermoscopic images and using the spectral information of these images in the three color channels of R (red), G (green), and B (blue), the color components of the dermoscopic images can be obtained more accurately. The key to this step is to convert the color channel information into the spectral image of the dermoscope, providing important color and spectral data support for subsequent image processing and lesion analysis. Different dermoscopic images are often affected by different acquisition environments, device settings, and light source conditions. Therefore, it is necessary to perform color offset correction on these images. Color offset correction processing can effectively eliminate color differences caused by factors such as light source color temperature and illumination conditions, so that the color distributions of dermoscopic images from different sources are more consistent, ensuring the accuracy and consistency during image analysis. After color offset correction, the color distortion of the image is corrected, and better results can be obtained for subsequent image processing such as segmentation and feature extraction. In addition, in order to further improve the quality of the image, it is necessary to perform scatter damage blur removal and normalization processing on the corrected image. Scatter damage blur removal can eliminate the blur in the image caused by acquisition equipment or environmental factors, making the dermoscopic image clearer and facilitating subsequent detailed analysis. And normalization processing can unify features such as the size and brightness of the image, reducing the influence caused by differences in size or illumination between different images, thereby ensuring the stability and accuracy of subsequent model training and inference. Secondly, by performing various data enhancement processes (such as rotation, flipping, scaling, noise addition, etc.) on the dermoscopic images, the training dataset can be effectively expanded, enabling the model to encounter richer features during the learning process and improving the generalization ability of its model training. In addition, through over- and under-sampling balance processing, the problem of model bias caused by too many or too few samples of a certain type during training can be avoided. For example, if a certain type of lesion image is significantly more than other types, the model will tend to only recognize the more numerous lesion types. By balancing the sample ratio and making the weights of each category equal, the recognition ability of the model for different lesion types can be improved. This enhancement and ratio balance processing is crucial for high-precision lesion area segmentation. Then, by constructing a lesion area segmentation network based on a convolutional neural network (CNN) to utilize the powerful features of deep learning, the lesion area can be more accurately identified and segmented. Combining a multi-scale feature fusion module enables the network to extract features from different scales (from small to large, from local to global), improving the recognition accuracy for complex lesion structures.In addition, the attention mechanism can effectively enhance the network's focus on important features and suppress the interference of irrelevant information. This way of adaptively adjusting feature weights enables the network to more effectively focus on the regions that have a greater impact on the segmentation result, thereby significantly improving both the segmentation accuracy and efficiency. The finally generated dermoscopic image segmentation model can not only improve the efficiency during the model training process but also enhance the segmentation accuracy of the lesion area in dermoscopic images. Finally, by using proportionally balanced image samples to train and optimize the segmentation model to generate the final segmentation optimization model, during the training process, an adaptive learning rate adjustment strategy is adopted, which can dynamically adjust the learning rate according to the training progress and model performance. This can avoid problems such as instability caused by too large a learning rate or slow convergence speed caused by too small a learning rate, thereby improving the efficiency and effect of training. After this optimization, the model can better capture key features and data distributions, thus enhancing the segmentation accuracy of the lesion area. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Other features, objects, and advantages of the present invention will become more apparent by reading the detailed description of the non-limiting embodiments with reference to the following drawings: Figure 1 It is a schematic diagram of the modules of the training system for the dermoscopic image segmentation model of the present invention; Figure 2 is Figure 1 a schematic diagram of the functional flow of the image color calibration and noise removal module in Figure 3 is Figure 1 a schematic diagram of the functional flow of the image sample enhancement and balance module in DETAILED DESCRIPTION OF THE EMBODIMENTS
[0016] The technical method of the present invention will be clearly and completely described below with reference to the drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.
[0017] In addition, the drawings are only schematic diagrams of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. The functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor methods and / or microcontroller methods.
[0018] It should be understood that although terms such as "first", "second", etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are only used to distinguish one unit from another. For example, without departing from the scope of the exemplary embodiments, the first unit may be referred to as the second unit, and similarly the second unit may be referred to as the first unit. The term "and / or" used herein includes any and all combinations of one or more of the listed associated items.
[0019] To achieve the above object, please refer to Figures 1 to 3 , the present invention provides a training system for a dermoscopic image segmentation model, and the system includes the following modules: An image color calibration and noise removal module, configured to obtain multi-source dermoscopic images; obtain corresponding dermoscopic spectral images in the R, G, and B color channels through the multi-source dermoscopic images, and perform color offset correction processing on the multi-source dermoscopic images based on the corresponding dermoscopic spectral images in the R, G, and B color channels to generate a dermoscopic color offset correction image; perform scatter damage blurring removal and normalization processing on the dermoscopic color offset correction image to generate a dermoscopic normalized image; An image sample enhancement and balance module, configured to perform image sample enhancement on the dermoscopic normalized image to obtain a dermoscopic enhanced image sample; perform over- and under-sampling balance processing on the dermoscopic enhanced image sample to generate a dermoscopic proportionally balanced image sample; A segmentation model construction module, configured to construct a lesion area segmentation network based on a convolutional neural network in combination with a multi-scale feature fusion module and an attention mechanism to generate a dermoscopic image segmentation model; A segmentation model training and optimization module, configured to perform segmentation model training and optimization on the dermoscopic image segmentation model based on the dermoscopic proportionally balanced image sample in combination with an adaptive learning rate adjustment strategy to generate a dermoscopic image segmentation optimized model, and output corresponding dermoscopic image lesion area segmentation results at the last layer within the lesion area segmentation network.
[0020] In an embodiment of the present invention, please refer to Figure 1 shown, which is a schematic diagram of the modules of the training system for the dermoscopic image segmentation model of the present invention. In this example, the training system for the dermoscopic image segmentation model includes the following modules: S1: Image color calibration and noise removal module, which is used to obtain multi-source dermoscopic images; obtain dermoscopic spectral images corresponding to the multi-source dermoscopic images in the R, G, and B color channels, and perform color offset correction processing on the multi-source dermoscopic images based on the dermoscopic spectral images corresponding to the R, G, and B color channels to generate dermoscopic color offset corrected images; perform scatter damage blur removal and normalization processing on the dermoscopic color offset corrected images to generate dermoscopic normalized images; In the embodiments of the present invention, dermoscopic images are collected from multiple channels such as professional dermatology hospitals, research institutions, and medical device suppliers. These images are decomposed into RGB color channels to generate spectral images in the R, G, and B color channels. Local area brightness analysis is performed on the spectral images of each channel, the mean and variance are calculated, the color offset amount is obtained by comparing with the reference value, the adjustment amplitude and direction are determined for color offset correction, then histogram equalization is used to enhance the contrast, and the Laplacian operator is used to analyze the pixel blurriness. Pixel blocks are divided according to the blur threshold, and the scattered blur and noise blur pixel blocks are processed separately. Finally, the pixel mean and variance of the processed image are calculated to standardize each pixel, and finally the dermoscopic normalized image is generated.
[0021] S2: Image sample enhancement and balancing module, which is used to perform image sample enhancement on the dermoscopic normalized images to obtain dermoscopic enhanced image samples; perform over-sampling and under-sampling balancing processing on the dermoscopic enhanced image samples to generate dermoscopic proportion-balanced image samples; In the embodiments of the present invention, by performing operations such as random rotation (-90 degrees to 90 degrees), flipping (horizontal and vertical), scaling (0.8 to 1.2 times), cropping, brightness adjustment (-0.2 to 0.2), and contrast adjustment (-0.2 to 0.2) on the dermoscopic normalized images, images under different conditions are simulated to obtain dermoscopic enhanced image samples. The enhanced image samples are classified pixel by pixel using a binary classification model, the total number of pixels in the diseased and normal regions is counted, and the diseased proportion is calculated. When the diseased proportion is less than 0.3, the diseased samples are over-sampled using a generative adversarial network, and 50% of the normal samples are randomly deleted for under-sampling. Finally, the dermoscopic proportion-balanced image samples are generated.
[0022] S3: Segmentation model construction module, which is used to construct a lesion area segmentation network based on a convolutional neural network in combination with a multi-scale feature fusion module and an attention mechanism to generate a dermoscopic image segmentation model; In the embodiment of the present invention, according to the principle of convolutional neural network, a 3-layer basic network architecture is constructed by designing a 5x5 convolutional layer, a 3x3 convolutional layer and a 1x1 pooling layer, and each layer is connected through a connection channel layer. A multi-scale feature fusion module is designed in different convolutional layers. The high-resolution features of the shallow 3x3 layer and the semantic features of the deep 5x5 layer are fused by skip connections, and the feature map sizes are adjusted by upsampling and downsampling and then spliced. An attention mechanism is introduced in the connection channel layer. The channel attention module is set between the convolutional layer and the pooling layer, and the channel importance is learned through global average pooling and fully connected layers; the spatial attention module is set in the connection channel layer between the spaces of the 3-layer network architecture to focus on the lesion area. Finally, a lesion area segmentation network is constructed to generate a dermoscopic image segmentation model.
[0023] S4: A segmentation model training and optimization module, which is used to balance the dermoscopic image samples based on the dermoscopic ratio and combine an adaptive learning rate adjustment strategy to train and optimize the dermoscopic image segmentation model to generate an optimized dermoscopic image segmentation model, and output the corresponding dermoscopic image lesion area segmentation result at the last layer within the lesion area segmentation network.
[0024] In the embodiment of the present invention, the dermoscopic ratio-balanced image samples are divided into training, validation and test image samples according to 7:2:1. The training image samples are input into the dermoscopic image segmentation model for training. The validation image samples are used for training loss analysis. The cross-entropy loss of lesion classification and the Dice loss of lesion segmentation are calculated, and the weighted sum is used to obtain the training loss. During the training process, if the decrease amplitude of the training loss is less than 0.001 for 10 consecutive iteration cycles, the learning rate is reduced to 0.1 times the original value, and the learning rate adjustment effect is verified by using the test image samples. The model is optimized by L2 regularization. Finally, an optimized dermoscopic image segmentation model is generated, and the lesion area segmentation result is output at the last layer of the lesion area segmentation network.
[0025] Furthermore, the image color calibration and noise removal module includes the following functions: Step S11: Obtain multi-source dermoscopic images; Step S12: Obtain the dermoscopic spectral images corresponding to the multi-source dermoscopic images in the R, G, and B color channels, and perform color offset correction processing on the multi-source dermoscopic images based on the dermoscopic spectral images corresponding to the R, G, and B color channels to generate a dermoscopic color offset correction image; Step S13: Use histogram equalization to enhance the contrast of the dermoscopic color offset correction image to obtain a dermoscopic contrast-enhanced image; Step S14: Perform pixel blurriness analysis on the dermoscopic contrast-enhanced image to obtain the pixel blurriness of the dermoscopic image; Step S15: Perform lossy blur removal and pixel normalization processing on each pixel block in the dermoscopic contrast-enhanced image based on the pixel blurriness of the dermoscopic image to generate a dermoscopic standardized image.
[0026] As an embodiment of the present invention, referring to Figure 2 shown, it is Figure 1 a schematic functional flowchart of the image color calibration and noise removal module in S11: Obtain multi-source dermoscopic images; In the embodiment of the present invention, dermoscopic image data is collected from multiple channels, including professional dermatology hospitals, research institutions, and medical device suppliers. Cooperate with the dermatology department of the hospital, and through its dermoscopic examination equipment, at a fixed image acquisition frequency, such as collecting 100 images per day, obtain the dermoscopic images of patients. Obtain the image data they have accumulated during the process of dermatological research from research institutions. These data include dermoscopic images of different types of skin diseases. Obtain the images collected during the device testing and verification phase from medical device suppliers. Uniformly store these dermoscopic images from different channels in a data storage center to prepare for subsequent processing.
[0027] S12: Obtain the corresponding dermoscopic spectral images in the R, G, and B color channels through the multi-source dermoscopic images, and perform color offset correction processing on the multi-source dermoscopic images based on the corresponding dermoscopic spectral images in the R, G, and B color channels to generate a dermoscopic color offset correction image; In the embodiment of the present invention, by decomposing the multi-source dermoscopic image into RGB color channels, generate dermoscopic spectral images in the R, G, and B color channels. Perform local area brightness analysis on the spectral images of each channel. Divide the image into local areas of 32×32 pixels. Calculate the mean and variance of the brightness distribution of each area. Set the standard mean and variance of the brightness distribution as a reference. Compare the mean and variance of each local area with the reference value. Obtain the color offset amount of each color channel through weighted summation. Determine the color adjustment amplitude and direction according to the offset amount. If the offset amount is positive and the adjustment direction is to reduce the brightness, subtract the adjustment amplitude from the color value of each pixel block in this channel, and limit the adjusted color value between 0-255. Finally, recombine the corrected three-channel images to finally generate a dermoscopic color offset correction image.
[0028] S13: Use histogram equalization to enhance the contrast of the dermoscopic color offset correction image to obtain a dermoscopic contrast-enhanced image; In an embodiment of the present invention, by regarding the pixel values of the dermoscope color offset corrected image as a set of grayscale values, the frequency of each grayscale value appearing in the image is statistically analyzed, a grayscale histogram is constructed, the cumulative distribution function of the grayscale values is calculated, and the cumulative distribution function is normalized so that its value range is between 0 and 255. According to the normalized cumulative distribution function, each pixel value in the image is mapped, and the original pixel value is replaced with the new pixel value after mapping. For example, if the original pixel value is 100 and the new pixel value obtained through mapping by the cumulative distribution function is 150, then the grayscale value of this pixel is updated to 150. After the mapping process for all pixels in the image, the contrast of the image is enhanced, and finally, a dermoscope contrast enhanced image is obtained.
[0029] S14: Analyze the pixel blurriness of the dermoscope contrast enhanced image to obtain the pixel blurriness of the dermoscope image; In an embodiment of the present invention, by processing the dermoscope contrast enhanced image using the Laplace operator, the Laplace operator template (such as [0, 1, 0], [1, -4, 1], [0, 1, 0]) is slid and convolved on the image to calculate the second-order derivative of each pixel point. The second-order derivative reflects the change rate of the pixel value. The larger the change rate, the greater the difference in pixel values around this pixel, and the clearer the image; the smaller the change rate, the blurrier the image. The results obtained after the convolution operation are statistically analyzed, and the average value of the second-order derivatives of all pixel points is calculated. This average value is the pixel blurriness of the dermoscope image.
[0030] S15: Based on the pixel blurriness of the dermoscope image, perform scatter blur removal and pixel normalization processing on each pixel block in the dermoscope contrast enhanced image to generate a dermoscope normalized image.
[0031] In an embodiment of the present invention, by dividing the dermoscope contrast enhanced image into pixel blocks of 5×5 pixels, a pixel blur threshold is set, such as 0.5. The pixel blurriness of each pixel block is compared with the threshold. If it is greater than the threshold, it is determined as a scattered blur pixel block, and the light scattering degree is calculated by analyzing the pixel value distribution, and linear interpolation is used to compensate for the light scattering loss; if it is equal to the threshold, it is determined as a noise blur pixel block, and adjacent such pixel blocks are surrounded to form a noise blur area, and median filtering is used to remove the noise. The pixel mean and variance of the processed image are calculated. For each pixel value, the formula is used for normalization processing, where is the pixel mean, is the square root value corresponding to the pixel variance, that is, the pixel standard deviation, and finally generates a dermoscopy standardized image. By performing blurring removal processing on the pixel blocks, the blurring of the dermoscopy image caused by various factors (such as device imaging quality, uneven skin surface, etc.) can be effectively reduced, making the details in the image clearer and more distinguishable, and more accurately observing the characteristics of skin lesions, such as boundaries, colors, textures, etc. Moreover, when performing pixel standardization processing, the gray range of the image can be adjusted to make the differences between different pixel values more obvious, thereby enhancing the contrast of the image. This helps to highlight the differences between the skin lesion area and the surrounding normal tissues and improve the detection and diagnosis accuracy of the lesions.
[0032] Further, the obtaining of the multi-source dermoscopy images to obtain the dermoscopy spectral images corresponding to the R, G, and B color channels, and the color shift correction processing of the multi-source dermoscopy images based on the dermoscopy spectral images corresponding to the R, G, and B color channels includes: Performing RGB color channel decomposition on the multi-source dermoscopy images at different color channel wavelengths to generate the dermoscopy spectral images corresponding to the R, G, and B color channels; In the embodiment of the present invention, by regarding the multi-source dermoscopy images as a three-dimensional matrix composed of three color channels of red (R), green (G), and blue (B), using the image channel separation algorithm, according to the wavelength characteristics of the color channels, each pixel of the image is separated on the three channels. Specifically, for each pixel point in the image, the value in the R channel is extracted to form a two-dimensional matrix containing only the R channel information, that is, the dermoscopy spectral image under the R color channel; similarly, the values of the G and B channels are extracted respectively to generate the dermoscopy spectral images corresponding to the G and B color channels. For example, if the image resolution is 512×512 pixels, the spectral images of each channel after separation are also two-dimensional matrices of 512×512, respectively representing the dermoscopy image information under different color channels.
[0033] Preferably, perform local area brightness analysis on the dermoscopy spectral images corresponding to the R, G, and B color channels to obtain the local area brightness characteristics corresponding to the R, G, and B color channels, including the local area brightness distribution mean and the local area brightness distribution variance; In an embodiment of the present invention, by dividing the dermoscopic spectral images in the R, G, and B color channels into a plurality of non-overlapping local regions respectively, for example, the size of each local region is 32×32 pixels. For each local region, calculate the sum of its brightness values. Taking the R channel as an example, add up the R channel values of all pixels in this local region, and then divide by the total number of pixels in this region to obtain the average value of the brightness distribution of this local region. Then, calculate the square of the difference between the R channel value of each pixel and this average value, sum up these squared values and divide by the total number of pixels to obtain the variance of the local region brightness distribution. In the same way, process the spectral images of the G and B channels to obtain the average value and variance of the local region brightness distribution corresponding to the R, G, and B color channels respectively. These values constitute the local region brightness characteristics.
[0034] Preferably, perform image color offset calculation on the corresponding dermoscopic spectral images based on the local region brightness characteristics corresponding to the R, G, and B color channels to obtain the dermoscopic image color offset amounts corresponding to the R, G, and B color channels. In an embodiment of the present invention, by setting a standard average value and variance of brightness distribution as reference values, these reference values represent the brightness characteristics of the dermoscopic images in each color channel under ideal conditions. For the dermoscopic spectral image in the R color channel, compare the average value and variance of the brightness distribution of each of its local regions with the reference values, calculate the difference between the average value of the local region brightness distribution and the reference average value, and the difference between the variance of the local region brightness distribution and the reference variance. Weightedly sum these two differences according to a certain weight (such as the weight of the average value difference is 0.6, and the weight of the variance difference is 0.4) to obtain the color offset amount of this local region. Perform the same calculation for all local regions of the R channel, and take the average value as the dermoscopic image color offset amount in the R color channel. In the same way, calculate the dermoscopic image color offset amounts in the G and B color channels respectively.
[0035] Preferably, perform channel color adjustment analysis on the corresponding dermoscopic spectral images based on the dermoscopic image color offset amounts corresponding to the R, G, and B color channels to obtain the dermoscopic image color adjustment amplitudes and adjustment directions corresponding to the R, G, and B color channels. In an embodiment of the present invention, for the color offset amount of the dermoscopic image in the R color channel, if the offset amount is positive, it indicates that the overall brightness of this channel is relatively high, and the adjustment direction is to reduce the brightness; if the offset amount is negative, it indicates that the overall brightness is relatively low, and the adjustment direction is to increase the brightness. The adjustment amplitude is determined according to the absolute value of the offset amount. For example, a proportionality coefficient k (such as k = 0.1) is set, and the absolute value of the offset amount is multiplied by k to obtain the preliminary adjustment amplitude. At the same time, considering the overall contrast and color balance of the image, the preliminary adjustment amplitude is further corrected. For example, when the offset amount is large, the adjustment amplitude is appropriately reduced to avoid over-adjustment. In the same way, the color offset amounts of the dermoscopic images in the G and B color channels are analyzed respectively to determine the corresponding color adjustment amplitudes and adjustment directions, and finally, the color adjustment amplitudes and adjustment directions corresponding to the dermoscopic images in the R, G, and B color channels are obtained.
[0036] Preferably, based on the color adjustment amplitudes and adjustment directions corresponding to the dermoscopic images in the R, G, and B color channels, color offset correction processing is performed on the corresponding dermoscopic spectral images in the respective color channels, so as to correct the color values corresponding to each pixel block in the dermoscopic spectral image according to the corresponding color adjustment amplitudes and adjustment directions of the dermoscopic images, and generate a dermoscopic color offset correction image.
[0037] In an embodiment of the present invention, for the dermoscopic spectral image in the R color channel, if the adjustment direction is to increase the brightness, the R-channel color value of each pixel block is added with the adjustment amplitude; if the adjustment direction is to reduce the brightness, it is subtracted by the adjustment amplitude. When making the adjustment, the adjusted color value is restricted within the range of 0 - 255. For example, if the R-channel value of a certain pixel block is 200, the adjustment amplitude is 10, and the adjustment direction is to increase the brightness, then the adjusted R-channel value is min(200 + 10, 255) = 210. In the same way, color offset correction processing is performed on the dermoscopic spectral images in the G and B color channels. Finally, the corrected spectral images of the R, G, and B channels are recombined into a complete image, and finally a dermoscopic color offset correction image is generated.
[0038] Furthermore, the performing color offset correction processing on the corresponding dermoscopic spectral images in the respective color channels based on the color adjustment amplitudes and adjustment directions corresponding to the dermoscopic images in the R, G, and B color channels includes: Performing channel adjustment evaluation calculations according to the color adjustment amplitudes and adjustment directions corresponding to the dermoscopic images in the R, G, and B color channels to obtain the dermoscopic color channel adjustment coefficients corresponding to the R, G, and B color channels; In the embodiments of the present invention, by using the OpenCV library of Python and related mathematical calculation libraries (such as numpy), the channel adjustment evaluation calculation is carried out according to the color adjustment amplitude and adjustment direction corresponding to the dermoscopic image under the R, G, and B color channels. Data is read from a file storing adjustment records, and this file records the adjustment operations on multi-source dermoscopic images in each color channel. For example, for the R channel of a certain image, the record shows that the color adjustment amplitude is increased by 10% and the direction is positive (i.e., the color is more biased towards red). For each color channel, taking the R channel as an example, if the adjustment amplitude is (assumed to be 0.1), the direction is represented by the sign function (if it is positive, ; if it is negative, then ). For example, then the dermoscopic color channel adjustment coefficient can be calculated through the formula . Assuming that in a certain adjustment, the adjustment amplitude of the R channel is increased by 15% (i.e., ), and the direction is positive ( ), then . The same method is used to calculate the G and B channels, and finally the dermoscopic color channel adjustment coefficients corresponding to the R, G, and B color channels are obtained.
[0039] Preferably, the spectral characteristics of the dermoscopic image corresponding to the corresponding color channel are obtained through the dermoscopic spectral image corresponding to the R, G, and B color channels, and color offset simulation is carried out on the corresponding color channel based on the spectral characteristics of the dermoscopic image corresponding to the corresponding color channel and in combination with the dermoscopic color channel adjustment coefficients corresponding to the R, G, and B color channels, so as to generate the color offset mechanism of the dermoscopic image corresponding to the R, G, and B color channels; In the embodiments of the present invention, by using the OpenCV library of Python and the spectral analysis related libraries (such as the modules related to spectral analysis in the scipy library), the dermoscopic spectral images corresponding to the R, G, and B color channels are read. Taking the R channel as an example, the spectral image of the R channel is analyzed to obtain its spectral characteristics, such as the spectral peak position, spectral bandwidth, etc. Assuming that through analysis, the spectral peak of the R channel spectral image is located at the wavelength , the bandwidth is , and the dermoscopic color channel adjustment coefficients corresponding to the R, G, and B color channels obtained previously are obtained. Taking the R channel adjustment coefficient (assumed to be 1.2) as an example, a mathematical model is established to simulate color offset. For example, assuming that there is a linear relationship between the spectral peak position and color offset, the offset spectral peak position (where is a proportionality constant determined according to a large number of experiments, assuming ), similar simulations are also performed on the G and B channels, and the color shift mechanisms of the dermoscopic images corresponding to the R, G, and B color channels are generated, where the simulation processes and related parameters of the color shifts in each channel are elaborated in detail, and finally, the color shift mechanisms of the dermoscopic images corresponding to the R, G, and B color channels are generated.
[0040] Preferably, based on the color shift mechanisms of the dermoscopic images corresponding to the R, G, and B color channels and according to the corresponding dermoscopic color channel adjustment coefficients, color value offset correction is performed on the color values corresponding to each pixel block in the dermoscopic spectral images corresponding to the respective color channels, so as to generate local color offset correction matrices corresponding to the R, G, and B color channels, including the color offset values corresponding to each pixel block in the respective color channels; In the embodiments of the present invention, by using the OpenCV library and the numpy library of Python, based on the color shift mechanisms of the dermoscopic images corresponding to the R, G, and B color channels and the corresponding dermoscopic color channel adjustment coefficients, color value offset correction is performed on the color values corresponding to each pixel block in the dermoscopic spectral images corresponding to the respective color channels, so as to read the dermoscopic spectral images, divide the images into multiple pixel blocks, assuming that the size of each pixel block is 8×8 pixels. Taking the R channel as an example, for each pixel in each pixel block, its original color value is , according to the color shift mechanism and the adjustment coefficient, assuming the adjustment coefficient , through the formula (where is the scaling factor determined according to the color shift mechanism, assuming ), the offset color value is calculated, the difference between the offset color values of all pixels in each pixel block and the original color values is calculated to obtain the color offset value, these color offset values are organized in matrix form to generate the local color offset correction matrix corresponding to the R channel, and the same operations are performed on the G and B channels (so as to store the matrix data in the npy format of numpy), and finally, local color offset correction matrices corresponding to the R, G, and B color channels are generated.
[0041] Preferably, based on the local color offset correction matrices corresponding to the R, G, and B color channels, pixel-by-pixel color correction and reconstruction processing are performed on each pixel block in the dermoscopic spectral images corresponding to the respective color channels, so as to generate a dermoscopic color offset correction image.
[0042] In an embodiment of the present invention, by using Python's OpenCV library and numpy library, each pixel block in the corresponding dermatoscope spectrum image under the corresponding color channel is subjected to pixel-by-pixel color correction and reconstruction processing based on the local color offset correction matrix corresponding to the R, G and B color channels, so as to read the local color offset correction matrix file corresponding to the R, G and B color channels. Taking the R channel as an example, for each pixel block, according to the color offset value in the corresponding local color offset correction matrix, the color value of each pixel in the pixel block is corrected. For example, if the color offset value of a pixel position in the local color offset correction matrix is , then the corrected color value of the pixel ,in, The initial color value is used. After such correction processing is performed on all pixel blocks, the corrected R channel image is merged with the G and B channel images that have also been corrected using the merge function of OpenCV. Finally, a dermoscopic color shift correction image is generated, providing high-quality image data after color correction for subsequent dermoscopic image segmentation model training.
[0043] Furthermore, the performing lossy blur removal and pixel normalization processing on each pixel block in the dermoscopic contrast enhanced image based on the pixel blur of the dermoscopic image includes: Based on the pixel blur of the dermoscopic image, each pixel block in the dermoscopic contrast enhanced image is divided into pixel blurs, so as to compare and judge the pixel blurs corresponding to each pixel block according to a preset pixel blur threshold. If the pixel blur is greater than the preset pixel blur threshold, the corresponding pixel block is determined as a scattering blurred pixel block; if the pixel blur is equal to the preset pixel blur threshold, the corresponding pixel block is determined as a noise blurred pixel block; if the pixel blur is less than the preset pixel blur threshold, the corresponding pixel block is determined as a clear pixel block; In an embodiment of the present invention, a dermatoscope contrast-enhanced image is divided into a plurality of pixel blocks of the same size, for example, each pixel block is 5x5 pixels, and each pixel block is processed by a Laplace operator to calculate its pixel blur. The Laplace operator reflects the change between pixels by calculating the second-order derivative of the pixel value in the pixel block. The more drastic the change, the lower the pixel blur, and vice versa. A preset pixel blur threshold, for example, 0.5, is set. For each pixel block, the calculated pixel blur is compared with the threshold. If the pixel blur of a pixel block is greater than 0.5, it indicates that the pixel block is greatly affected by factors such as light scattering, and it is determined as a scattering blurred pixel block; if the pixel blur is equal to 0.5, it indicates that the pixel block is mainly affected by noise, and it is determined as a noise blurred pixel block; if the pixel blur is less than 0.5, it is considered that the pixel block is relatively clear and is determined as a clear pixel block. In this way, all pixel blocks in the dermatoscope contrast-enhanced image are pixel-blurred.
[0044] Preferably, perform blurry block noise removal on the corresponding scattered blurry pixel blocks and noise blurry pixel blocks in the dermoscopy contrast-enhanced image. For the scattered blurry pixel blocks, calculate the light scattering degree to compensate for the light scattering loss corresponding to the pixel blocks. For the noise blurry pixel blocks, enclose them into corresponding noise blurry regions, and use median filtering to remove noise interference from the noise blurry regions to generate a dermoscopy blurry denoised image; In the embodiments of the present invention, for the scattered blurry pixel blocks, calculate the light scattering degree by analyzing the distribution of their pixel values. Assume that the standard deviation of the pixel values in the scattered blurry pixel block is σ, and calculate the light scattering degree through a specific formula, such as light scattering degree = k×σ (k is a coefficient determined according to experiments). According to the calculated light scattering degree, use methods such as linear interpolation to adjust the pixel values of the pixel block to compensate for the loss caused by light scattering, so that the brightness and color of the pixel block are closer to the real situation. For the noise blurry pixel blocks, merge adjacent noise blurry pixel blocks to enclose a noise blurry region, and use the median filtering method to process the noise blurry region. Taking a 3x3 neighborhood window as an example, sort the pixel values in the window and replace the pixel value at the center of the window with the median value to remove noise interference through this method. After processing all the scattered blurry pixel blocks and noise blurry pixel blocks, finally generate a dermoscopy blurry denoised image.
[0045] Preferably, perform pixel mean and variance analysis on the dermoscopy blurry denoised image to obtain the dermoscopy image pixel mean and the dermoscopy image pixel variance; In the embodiments of the present invention, regard the dermoscopy blurry denoised image as a two-dimensional pixel matrix. Let the width of the image be W and the height be H. First, calculate the pixel mean by adding up all the pixel values in the image, that is , and then divide by the total number of pixels W×H in the image to obtain the dermoscopy image pixel mean . Then, calculate the pixel variance. For each pixel value in the image, calculate the square of the difference between it and the pixel mean , add up the squares of these differences for all pixels, that is , and then divide by the total number of pixels W×H in the image to obtain the dermoscopy image pixel variance . Through such calculations, accurately obtain the dermoscopy image pixel mean and the dermoscopy image pixel variance. Through such calculations, accurately obtain the dermoscopy image pixel mean and the dermoscopy image pixel variance.
[0046] Preferably, perform pixel standardization processing on the dermoscopy blurry denoised image based on the dermoscopy image pixel mean and the dermoscopy image pixel variance to generate a dermoscopy standardized image.
[0047] In the embodiment of the present invention, for each pixel value in the dermoscopic blurred and denoised image , pixel standardization processing is performed using the formula , where is the mean value of the dermoscopic image pixels calculated previously, is the standard deviation corresponding to the dermoscopic image pixels. This formula normalizes each pixel value, making the distribution of the image pixel values have zero mean and unit variance. By performing such standardization processing on all pixel values in the dermoscopic blurred and denoised image, the pixel values of the image are adjusted to a unified scale range, eliminating the pixel value differences caused by factors such as illumination and equipment between different images, and finally generating a dermoscopic standardized image, providing more standardized and easier-to-process data for the subsequent training of the dermoscopic image segmentation model.
[0048] Furthermore, calculating the light scattering degree for the scattered blurred pixel block to compensate for the light scattering loss corresponding to this pixel block includes: Performing spectral scattering analysis on the scattered blurred pixel block to statistically analyze the scattering wavelength and the scattered blurred distortion degree corresponding to this pixel block, and forming a feature vector with them to generate a spectral scattering blurred feature vector; In the embodiment of the present invention, by using the spectral analysis library of Python (such as the module related to spectral analysis in scikit-image) to perform spectral scattering analysis on the scattered blurred pixel block, reading the data of the scattered blurred pixel block from the dermoscopic image dataset where the scattered blurred pixel block has been marked. Assuming that this pixel block is stored as an independent image file, using the spectral analysis functions in the library, such as the functions related to Fourier transform, to process the spectral information of the pixel block. By analyzing the spectral data, determine the scattering wavelength corresponding to this pixel block. For example, after Fourier transform, find the frequency corresponding to the energy peak in the spectrum, and then according to the conversion relationship between frequency and wavelength (where is the speed of light, is the frequency) calculate the scattering wavelength. Assuming that the calculated scattering wavelength is 550nm, for the scattered blurred distortion degree, it is calculated by comparing the spectral feature differences between this pixel block and the clear pixel block. Construct a spectral feature template library of clear pixel blocks, select the spectral feature of the clear pixel block most similar to the current scattered blurred pixel block from the template library, and calculate the mean square error (MSE) between the two. The larger the MSE value, the higher the scattered blurred distortion degree. Assuming that after calculation, the scattered blurred distortion degree is 0.3, form a feature vector [550, 0.3] with the scattering wavelength and the scattered blurred distortion degree, and finally generate a spectral scattering blurred feature vector.
[0049] Preferably, the environmental factors, the object surface material, and the light source angle corresponding to the pixel block are obtained by scattering and blurring the pixel block, and the scattering intensity prediction calculation is performed based on the environmental factors, the object surface material, and the light source angle corresponding to the pixel block and in combination with the spectral scattering blurring feature vector to obtain the light scattering degree corresponding to the pixel block; In an embodiment of the present invention, by using a data analysis library of Python (such as pandas) and some algorithm libraries related to domain knowledge, from a file storing information related to dermoscopic image capture, according to the pixel block number, the environmental factors (such as humidity and temperature during capture), the object surface material (such as the texture type of the skin, whether there are scales, etc.), and the light source angle information corresponding to the scattered and blurred pixel block are found. Assume that the environmental humidity corresponding to the pixel block is 50%, the temperature is 25 °C, the object surface material is smooth skin with a small amount of scales, and the light source angle is 45 degrees with the skin surface. To read the spectral scattering blurring feature vector, and based on this information, use a pre-established light scattering prediction model to calculate the scattering intensity. This model is obtained by training with a large amount of experimental data. For example, a model is constructed using the support vector regression (SVR) algorithm. The model inputs are environmental factors, object surface material, light source angle, and the scattering wavelength and scattering blurring distortion degree in the spectral scattering blurring feature vector, and the output is the light scattering degree. The relevant data is input into the model, and after calculation, the light scattering degree corresponding to the pixel block is obtained. Assume it is 0.6, and finally the light scattering degree corresponding to the pixel block is obtained.
[0050] Preferably, the theoretical light scattering intensity corresponding to the pixel block is obtained by scattering and blurring the pixel block, and the scattering loss compensation calculation is performed based on the light scattering degree corresponding to the pixel block and the corresponding theoretical light scattering intensity to obtain the scattering loss compensation factor; In an embodiment of the present invention, by using a mathematical calculation library of Python (such as numpy), starting from optical theory knowledge and the principle of dermoscopic imaging, by consulting relevant materials or consulting optical experts, the theoretical light scattering intensity corresponding to the scattered and blurred pixel block is obtained. Assume that for the current pixel block, according to factors such as its material, light source conditions, and imaging distance, the calculated theoretical light scattering intensity is 0.8, and the light scattering degree corresponding to the pixel block is obtained. Assume it is 0.6. According to the formula: scattering loss compensation factor = theoretical light scattering intensity / light scattering degree, calculate the scattering loss compensation factor, that is, 0.8 / 0.6 ≈ 1.33, and finally the scattering loss compensation factor is obtained.
[0051] Preferably, the light scattering loss corresponding to the pixel block is compensated based on the scattering loss compensation factor.
[0052] In the embodiments of the present invention, by using the OpenCV library and numpy library of Python, the corresponding scattering loss compensation factor is obtained previously, assumed to be 1.33, and the image data of the scattered blurred pixel block is read. For each pixel in the pixel block, its original light intensity value is set to , according to the formula , calculate the compensated light intensity value. For example, if the original light intensity value of a certain pixel is 100, the compensated light intensity value is 100×1.33 = 133. Perform such calculations for all pixels in the pixel block to complete the compensation of the light scattering loss corresponding to the pixel block, overwrite the original file with the compensated pixel block image data, and finally compensate the light scattering loss corresponding to the pixel block, providing high-quality pixel block data with compensated light scattering loss for the subsequent training of the dermoscopy image segmentation model, and improving the segmentation accuracy of the model for dermoscopy images.
[0053] Furthermore, the image sample enhancement and balancing module includes the following functions: Perform image sample enhancement on the dermoscopy standardized image to enhance and simulate dermoscopy image samples corresponding to different conditions through operations such as random rotation, flipping, scaling, cropping, brightness adjustment, and contrast adjustment, so as to obtain dermoscopy enhanced image samples; Perform lesion area ratio analysis on the dermoscopy enhanced image samples to quantitatively calculate the ratio value between the lesion samples and normal samples in the dermoscopy image samples, and obtain the lesion ratio of the dermoscopy image samples; Perform oversampling and undersampling balancing processing on the dermoscopy enhanced image samples based on the lesion ratio of the dermoscopy image samples. Specifically, the oversampling and undersampling balancing processing is as follows: if the lesion ratio of the dermoscopy image samples shows that the lesion samples are much fewer than the normal samples, perform oversampling operations on the corresponding lesion samples in the dermoscopy enhanced image samples to increase the number of samples corresponding to the minority class by using a generative adversarial network to replicate the samples corresponding to the minority class, while perform undersampling operations on the corresponding normal samples in the dermoscopy enhanced image samples to reduce the number of samples corresponding to the majority class, so as to generate dermoscopy ratio-balanced image samples.
[0054] As an embodiment of the present invention, referring to Figure 3 shown, it is Figure 1 the functional flowchart of the image sample enhancement and balancing module in S21: Perform image sample enhancement on the dermoscopy standardized image to enhance and simulate dermoscopy image samples corresponding to different conditions through operations such as random rotation, flipping, scaling, cropping, brightness adjustment, and contrast adjustment, so as to obtain dermoscopy enhanced image samples; In an embodiment of the present invention, for a dermoscopic standardized image, a variety of image enhancement operations are sequentially performed. In the random rotation operation, with the center of the image as the rotation point, an angle is randomly selected within the range of -90 degrees to 90 degrees to rotate the image, thereby simulating dermoscopic images from different perspectives. For random flipping, horizontal flipping and vertical flipping are respectively performed to increase the diversity of the image. In the scaling operation, the image is randomly scaled within the ratio range of 0.8 to 1.2 to simulate the observation effects at different distances. The cropping operation randomly selects a region within the image for cropping to retain the image features of different parts. The brightness adjustment randomly adjusts the brightness value within the range of -0.2 to 0.2 based on the original brightness value, and the contrast adjustment also randomly changes the contrast within the range of -0.2 to 0.2. Through these operations, dermoscopic image samples under different conditions are simulated, and finally, dermoscopic enhanced image samples are obtained.
[0055] S22: Analyze the proportion of the lesion area in the dermoscopic enhanced image samples to quantitatively calculate the proportion value between the lesion samples and the normal samples in the dermoscopic image samples, and obtain the lesion proportion of the dermoscopic image samples. In an embodiment of the present invention, by performing pixel-by-pixel analysis on the dermoscopic enhanced image samples, a pre-trained binary classification model is used to classify each pixel to determine whether it belongs to the lesion area or the normal area. This binary classification model is trained based on a large number of labeled dermoscopic image data and has a high classification accuracy. The total number of pixels in the lesion area and the total number of pixels in the normal area are counted, and are respectively denoted as and , then, through the formula proportion value calculate the proportion value between the lesion samples and the normal samples to obtain the lesion proportion of the dermoscopic image samples. For example, if the total number of pixels in the lesion area is 5000 and the total number of pixels in the normal area is 20000, then the lesion proportion of the dermoscopic image samples is 5000 / 20000 = 0.25.
[0056] S23: Perform oversampling and undersampling balance processing on the dermoscopic enhanced image samples based on the lesion proportion of the dermoscopic image samples. The oversampling and undersampling balance processing is specifically as follows: if the lesion proportion of the dermoscopic image samples shows that the lesion samples are much fewer than the normal samples, then perform oversampling operations on the corresponding lesion samples in the dermoscopic enhanced image samples to increase the number of samples corresponding to the minority class by using a generative adversarial network to replicate the samples corresponding to the minority class, while perform undersampling operations on the corresponding normal samples in the dermoscopic enhanced image samples to reduce the number of samples corresponding to the majority class, so as to generate dermoscopic proportion-balanced image samples.
[0057] In the embodiment of the present invention, when the lesion ratio of the dermoscopic image sample is less than 0.3, it is determined that the number of lesion samples is much less than that of normal samples. For the lesion samples, an oversampling operation is performed using a generative adversarial network (GAN). The GAN consists of a generator and a discriminator. The generator takes random noise as input and attempts to generate images similar to real lesion samples. The discriminator then determines whether the input image is a real lesion sample or an image generated by the generator. By continuously training the generator and the discriminator, the generator can generate high-quality lesion sample images, thereby increasing the number of lesion samples. For the normal samples, a random undersampling method is adopted, and a certain proportion of normal samples are randomly selected for deletion. For example, 50% of the normal samples are deleted to reduce the number of samples corresponding to the majority class. After such oversampling and undersampling balancing processing, the numbers of lesion samples and normal samples reach a relative balance, and finally, a dermoscopic ratio-balanced image sample is generated.
[0058] Further, the segmentation model construction module includes the following functions: Design three 5x5 convolutional layers, 3x3 convolutional layers, and 1x1 pooling layers through a convolutional neural network, and construct the corresponding dermoscopic image segmentation network architecture by connecting each layer through a connection channel layer; In the embodiment of the present invention, when constructing the dermoscopic image segmentation network architecture, it is first designed according to the principle of the convolutional neural network. For the first layer, a 5x5 convolutional layer is constructed. The size of the convolutional kernel of this layer is 5x5. By setting an appropriate number of convolutional kernels (such as 32), feature extraction operations are performed on the input dermoscopic image. Specifically, the convolutional kernel slides on the image and performs a convolutional operation with the pixel values of the image to generate a feature map. Then, the second layer is designed as a 3x3 convolutional layer, and a certain number of convolutional kernels (such as 64) are also set to further extract finer features from the feature map output by the first layer. Then, the third layer is constructed as a 1x1 pooling layer. The 1x1 pooling layer is used to perform a dimensionality reduction operation on the feature map, reducing the amount of data while retaining important feature information. Each layer is connected through a connection channel layer. The connection channel layer ensures that the feature map can be smoothly transmitted from one layer to the next. For example, the feature map output by the first 5x5 convolutional layer is transmitted to the 3x3 convolutional layer through the connection channel layer for further processing, and finally, the dermoscopic image segmentation network architecture is constructed.
[0059] Preferably, by designing corresponding multi-scale feature fusion modules in different convolutional layers within the dermoscopic image segmentation network architecture, introducing skip connections and feature fusion operations through the multi-scale feature fusion modules to fuse the lesion high-resolution features corresponding to the 3x3 shallower layer and the lesion semantic features corresponding to the 5x5 deeper layer, so as to adjust feature maps of different scales to the same size for splicing and fusion through upsampling and downsampling operations in the pooling layer, and constructing a lesion area segmentation network by introducing an attention mechanism in the connection channel layer between each layer to improve the segmentation ability for lesion areas of different scales, wherein the attention mechanism consists of a channel attention module and a spatial attention module. The channel attention module is set in the connection channel layer between the convolutional layer and the pooling layer in each layer to automatically learn the importance between each connection channel layer; while the spatial attention module is set in each connection channel layer between the three-layer network architectures to focus on the corresponding lesion areas in the dermoscopic image samples to enhance the network's expression of the segmentation task corresponding to the lesion areas, so as to generate a dermoscopic image segmentation model.
[0060] In the embodiment of the present invention, within the already constructed dermoscopic image segmentation network architecture, multi-scale feature fusion modules are designed for different convolutional layers. For the 3x3 shallower convolutional layer, the output feature map contains the high-resolution features of the lesion, while the output feature map of the 5x5 deeper convolutional layer contains the semantic features of the lesion. Through the corresponding skip connection method of the multi-scale feature fusion module, the output of the 3x3 shallower convolutional layer is directly connected to a subsequent appropriate layer, and then fused with the features of the 5x5 deeper convolutional layer. In the pooling layer, using upsampling (such as bilinear interpolation method) and downsampling (such as max pooling) operations, feature maps of different scales are adjusted to the same size, and then spliced and fused, so that the fused feature map has both high-resolution and semantic information. To improve the segmentation ability for lesion areas of different scales, an attention mechanism is introduced in the connection channel layer between each layer. The channel attention module is set in the connection channel layer between the convolutional layer and the pooling layer in each layer, and through operations such as global average pooling and fully connected layers, automatically learn the importance between each connection channel layer, and assign different weights to different channels. The spatial attention module is set in each connection channel layer between the three-layer network architectures. By calculating the spatial correlation of the feature map, it focuses on the corresponding lesion areas in the dermoscopic image samples and enhances the network's expression ability for the lesion area segmentation task. After these operations, a lesion area segmentation network is finally constructed, and then a dermoscopic image segmentation model is generated.
[0061] Furthermore, the segmentation model training and optimization module includes the following functions: Dividing the dermoscopic ratio-balanced image samples into training image samples, validation image samples, and test image samples according to the division ratio of 7:2:1; In the embodiment of the present invention, by assuming a batch of dermoscopic ratio-balanced image samples with a quantity of N, first, the number of samples for division is calculated. The number of training image samples is N×0.7, the number of validation image samples is N×0.2, and the number of test image samples is N×0.1. Using the method of random sampling, N×0.7 samples are randomly selected from N samples as training image samples to ensure the randomness of sampling to cover images with different features. Then, N×0.2 samples are randomly selected from the remaining samples as validation image samples. Finally, the remaining N×0.1 samples are used as test image samples. For example, if there are 1000 dermoscopic ratio-balanced image samples, then there are 700 training image samples, 200 validation image samples, and 100 test image samples. Through this clear ratio division, a suitable data set is provided for subsequent model training, validation, and testing.
[0062] Preferably, the training image samples are input into the dermoscopic image segmentation model for segmentation model training, and the validation image samples are input into the trained dermoscopic image segmentation model for training loss analysis, so as to calculate the cross-entropy loss for the lesion classification task and the Dice loss for the lesion segmentation task through training, and perform weighted summation according to the cross-entropy loss and the Dice loss to obtain the dermoscopic image segmentation training loss; In the embodiment of the present invention, by sequentially inputting the training image samples into the dermoscopic image segmentation model, components such as each convolutional layer and pooling layer in the model extract and process the features of the image. During the training process, for the lesion classification task, according to the classification result output by the model and the true lesion category label, the cross-entropy loss is calculated using the cross-entropy loss function. For example, if the model predicts the probability of a certain skin lesion being malignant as 0.8, and the true label is malignant (the label value is set to 1), then the cross-entropy loss is calculated through a specific formula. For the lesion segmentation task, the segmentation result output by the model is compared with the true lesion segmentation region, and the Dice loss function is used to calculate the Dice loss. Assuming the true lesion region is A and the lesion region predicted by the model is B, the Dice loss is calculated according to the ratio relationship between their intersection and union. Then, weights are set for the cross-entropy loss and the Dice loss respectively, such as the weight of the cross-entropy loss is 0.6 and the weight of the Dice loss is 0.4, and the two are weighted and summed to finally obtain the dermoscopic image segmentation training loss.
[0063] Preferably, based on the training loss of dermoscopic image segmentation and combined with an adaptive learning rate adjustment strategy, the learning rate of the trained dermoscopic image segmentation model is adjusted. When it is determined according to the adaptive learning rate adjustment strategy that the training loss of dermoscopic image segmentation does not decrease significantly within 10 iteration cycles, the learning rate corresponding to the dermoscopic image segmentation model is reduced to 0.1 times the original value. Then, the test image samples are used to verify the convergence of the learning rate of the dermoscopic image segmentation model after the learning rate adjustment. At the same time, the L2 regularization method is adopted to optimize the model training to generate an optimized dermoscopic image segmentation model, and the corresponding dermoscopic image lesion area segmentation result is output at the last layer within the lesion area segmentation network.
[0064] In the embodiment of the present invention, during the model training process, the training loss of dermoscopic image segmentation is continuously monitored. After each iteration cycle is completed, the current training loss value is recorded. When the decrease amplitude of the training loss value is less than a preset minimum value (such as 0.001) within 10 consecutive iteration cycles, it is determined that the training loss does not decrease significantly within 10 iteration cycles. At this time, the current learning rate of the dermoscopic image segmentation model is multiplied by 0.1 to obtain a new learning rate. For example, if the original learning rate is 0.001, it becomes 0.0001 after adjustment. Then, the test image samples are input into the model after the learning rate adjustment, and the change of the model output result is observed to verify whether the learning rate adjustment is effective. At the same time, the L2 regularization method is adopted during the model training process, and a regularization term is added to the loss function to constrain the model parameters to prevent overfitting. After multiple rounds of training and adjustment, an optimized dermoscopic image segmentation model is finally generated, and this model outputs an accurate dermoscopic image lesion area segmentation result at the last layer of the lesion area segmentation network.
[0065] Furthermore, the present invention also provides a training method for a dermoscopic image segmentation model. The method is implemented based on the training system for a dermoscopic image segmentation model as described above. The training method for a dermoscopic image segmentation model includes: Obtain multi-source dermoscopic images; obtain dermoscopic spectral images corresponding to the multi-source dermoscopic images in the R, G, and B color channels, and perform color offset correction processing on the multi-source dermoscopic images based on the dermoscopic spectral images corresponding to the R, G, and B color channels to generate dermoscopic color offset corrected images; perform lossy blur removal and normalization processing on the dermoscopic color offset corrected images to generate dermoscopic normalized images; Perform image sample enhancement on the dermoscopic normalized images to obtain dermoscopic enhanced image samples; perform over-undersampling balance processing on the dermoscopic enhanced image samples to generate dermoscopic proportion balanced image samples; A lesion area segmentation network is constructed based on a convolutional neural network, combined with a multi-scale feature fusion module and an attention mechanism to generate a dermoscopic image segmentation model; Based on dermoscopic proportion-balanced image samples and combined with an adaptive learning rate adjustment strategy, the dermoscopic image segmentation model is trained and optimized to generate an optimized dermoscopic image segmentation model, and the corresponding dermoscopic image lesion area segmentation result is output at the last layer within the lesion area segmentation network.
[0066] Therefore, from any perspective, the embodiments should be regarded as exemplary and non-limiting. The scope of the present invention is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the application documents are intended to be encompassed within the present invention.
[0067] The above are only specific embodiments of the present invention, enabling those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be obvious to those skilled in the art. The general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but rather to the broadest scope consistent with the principles and novel features invented herein.
Claims
1. A training system for a dermoscopic image segmentation model, characterized in that: Includes the following modules: An image color correction and noise removal module, for obtaining a multi-source dermoscopic image; obtaining a dermoscopic spectral image corresponding to the R, G and B color channels through the multi-source dermoscopic image, and performing color shift correction processing on the multi-source dermoscopic image based on the dermoscopic spectral image corresponding to the R, G and B color channels to generate a dermoscopic color shift corrected image; performing lossy blur removal and standardization processing on the dermoscopic color shift corrected image to generate a dermoscopic standardized image; An image sample enhancement and balancing module is used to perform image sample enhancement on the dermoscopic standardized image to obtain a dermoscopic enhanced image sample; perform over-sampling and under-sampling balancing processing on the dermoscopic enhanced image sample to generate a dermoscopic proportion-balanced image sample; A segmentation model building module is used to build a lesion area segmentation network based on a convolutional neural network combined with a multi-scale feature fusion module and an attention mechanism to generate a dermatoscopic image segmentation model; The segmentation model training and optimization module is used to optimize the segmentation model training of the dermoscopic image segmentation model based on the dermoscopic ratio-balanced image samples and combined with the adaptive learning rate adjustment strategy to generate a dermoscopic image segmentation optimization model and output the corresponding dermoscopic image lesion area segmentation result in the last layer of the lesion area segmentation network.
2. The training system for a dermoscopic image segmentation model according to claim 1, characterized in that: The image color correction and noise removal module includes the following functions: Acquire multi-source dermoscopic images; Acquire dermoscopic spectral images corresponding to R, G and B color channels through the multi-source dermoscopic image, and perform color shift correction processing on the multi-source dermoscopic image based on the dermoscopic spectral images corresponding to the R, G and B color channels to generate a dermoscopic color shift corrected image; The dermoscopic color shift-corrected image is contrast-enhanced using histogram equalization to obtain a dermoscopic contrast-enhanced image; Performing pixel blur analysis on the dermoscopic contrast-enhanced image to obtain the pixel blur of the dermoscopic image; Based on the pixel blur of the dermoscopic image, each pixel block in the dermoscopic contrast-enhanced image is subjected to lossy blur removal and pixel normalization processing to generate a dermoscopic standardized image.
3. The training system for a dermoscopic image segmentation model according to claim 2, characterized in that: The method of obtaining the corresponding dermoscopic spectral images in the R, G and B color channels through the multi-source dermoscopic images, and performing color shift correction processing on the multi-source dermoscopic images based on the corresponding dermoscopic spectral images in the R, G and B color channels includes: By performing RGB color channel decomposition on the multi-source dermoscopic image at different color channel wavelengths, the corresponding dermoscopic spectral images under R, G and B color channels are generated; Perform local area brightness analysis on the dermoscopic spectral images corresponding to the R, G and B color channels to obtain the local area brightness features corresponding to the R, G and B color channels, including the local area brightness distribution mean and the local area brightness distribution variance; The image color shift of the corresponding dermoscopic spectral image is calculated based on the local area brightness characteristics corresponding to the R, G and B color channels to obtain the corresponding dermoscopic image color shift under the R, G and B color channels; Based on the color offset of the dermoscopic image under the R, G and B color channels, the corresponding dermoscopic spectral image is subjected to channel color adjustment analysis to obtain the color adjustment amplitude and adjustment direction of the dermoscopic image under the R, G and B color channels; Based on the corresponding dermoscopic image color adjustment amplitude and adjustment direction in the R, G and B color channels, the corresponding dermoscopic spectral image in the corresponding color channel is subjected to color shift correction processing, so as to correct the color value corresponding to each pixel block in the dermoscopic spectral image according to the corresponding dermoscopic image color adjustment amplitude and adjustment direction, so as to generate a dermoscopic color shift corrected image.
4. The training system for a dermoscopic image segmentation model according to claim 3, characterized in that: The color shift correction processing of the dermoscopic spectral image corresponding to the corresponding color channel based on the color adjustment amplitude and adjustment direction of the dermoscopic image corresponding to the R, G and B color channels includes: Perform channel adjustment evaluation calculation according to the color adjustment amplitude and adjustment direction of the dermoscopic image under the R, G and B color channels to obtain the dermoscopic color channel adjustment coefficients under the R, G and B color channels; The dermoscopic image spectral characteristics corresponding to the corresponding color channels are obtained by using the dermoscopic spectral images corresponding to the R, G and B color channels, and the color shift simulation is performed on the corresponding color channels based on the dermoscopic image spectral characteristics corresponding to the corresponding color channels and in combination with the dermoscopic color channel adjustment coefficients corresponding to the R, G and B color channels, so as to generate the dermoscopic image color shift mechanism corresponding to the R, G and B color channels; Based on the color shift mechanism of the dermoscopic image corresponding to the R, G and B color channels and according to the corresponding dermoscopic color channel adjustment coefficient, a color value shift correction is performed on the color value corresponding to each pixel block in the dermoscopic spectral image corresponding to the corresponding color channel to generate a local color shift correction matrix corresponding to the R, G and B color channels, including the color shift value corresponding to each pixel block under the corresponding color channel; Based on the local color shift correction matrices corresponding to the R, G and B color channels, each pixel block in the dermoscopic spectral image corresponding to the corresponding color channel is subjected to pixel-by-pixel color correction and reconstruction processing to generate a dermoscopic color shift corrected image.
5. The training system for a dermoscopic image segmentation model according to claim 2, characterized in that: The method of performing loss blur removal and pixel standardization processing on each pixel block in the dermoscopic contrast enhanced image based on the pixel blur of the dermoscopic image comprises: Based on the pixel blur of the dermoscopic image, each pixel block in the dermoscopic contrast enhanced image is divided into pixel blurs, so as to compare and judge the pixel blurs corresponding to each pixel block according to a preset pixel blur threshold. If the pixel blur is greater than the preset pixel blur threshold, the corresponding pixel block is determined as a scattering blurred pixel block; if the pixel blur is equal to the preset pixel blur threshold, the corresponding pixel block is determined as a noise blurred pixel block; if the pixel blur is less than the preset pixel blur threshold, the corresponding pixel block is determined as a clear pixel block; The corresponding scattering blurred pixel blocks and noise blurred pixel blocks in the dermoscopic contrast enhanced image are subjected to blur block noise removal, so that for the scattering blurred pixel blocks, the light scattering degree is calculated to compensate for the light scattering loss corresponding to the pixel blocks, and for the noise blurred pixel blocks, the corresponding noise blurred areas are enclosed, and the noise interference of the noise blurred areas is removed by using median filtering to generate a dermoscopic blurred denoised image; Perform pixel mean and variance analysis on the dermoscopic blur denoising image to obtain the dermoscopic image pixel mean and dermoscopic image pixel variance; The dermoscopic blurred denoised image is pixel normalized based on the dermoscopic image pixel mean and the dermoscopic image pixel variance to generate a dermoscopic standardized image.
6. The training system for a dermoscopic image segmentation model according to claim 5, characterized in that: The step of calculating the light scattering degree for the scattered blurred pixel block to compensate for the light scattering loss corresponding to the pixel block includes: Performing spectral scattering analysis on the scattering blur pixel block to statistically analyze the scattering wavelength and scattering blur distortion corresponding to the pixel block, and composing them into a feature vector to generate a spectral scattering blur feature vector; Obtain the environmental factors, object surface material and light source angle corresponding to the pixel block through the scattering blurred pixel block, and perform scattering intensity prediction calculation based on the environmental factors, object surface material and light source angle corresponding to the pixel block and combined with the spectral scattering blurred feature vector to obtain the light scattering degree corresponding to the pixel block; Obtaining a theoretical light scattering intensity corresponding to the pixel block by scattering the blurred pixel block, and performing a scattering loss compensation calculation based on the light scattering degree corresponding to the pixel block and the corresponding theoretical light scattering intensity to obtain a scattering loss compensation factor; The light scattering loss corresponding to the pixel block is compensated based on the scattering loss compensation factor.
7. The training system for a dermoscopic image segmentation model according to claim 1, characterized in that: The image sample enhancement balancing module includes the following functions: Performing image sample enhancement on the dermoscopic standardized image, so as to enhance the corresponding dermoscopic image samples under different simulated conditions by random rotation, flipping, scaling, cropping, brightness adjustment and contrast adjustment operations, so as to obtain dermoscopic enhanced image samples; The lesion area ratio analysis is performed on the dermoscopic enhanced image samples to quantitatively calculate the ratio between the lesion samples and the normal samples in the dermoscopic image samples, and obtain the lesion ratio of the dermoscopic image samples; The dermoscopic enhanced image samples are subjected to over- and under-sampling balancing processing based on the lesion ratio of the dermoscopic image samples, wherein the over- and under-sampling balancing processing is specifically as follows: if the lesion ratio of the dermoscopic image samples shows that the lesion samples are much less than the normal samples, an oversampling operation is performed on the corresponding lesion samples in the dermoscopic enhanced image samples to increase the number of samples corresponding to the minority class by replicating the samples corresponding to the minority class using a generative adversarial network, while an under-sampling operation is performed on the corresponding normal samples in the dermoscopic enhanced image samples to reduce the number of samples corresponding to the majority class, so as to generate a dermoscopic ratio-balanced image sample.
8. The training system for a dermoscopic image segmentation model according to claim 1, characterized in that: The segmentation model building module includes the following functions: Through the convolutional neural network, three layers of 5x5 convolutional layers, 3x3 convolutional layers and 1x1 pooling layers are designed, and each layer is connected through the connection channel layer to construct the corresponding dermatoscopic image segmentation network architecture; By designing different convolutional layers in the dermatoscope image segmentation network architecture and combining corresponding multi-scale feature fusion modules, the high-resolution features of lesions corresponding to the 3x3 shallow layer and the semantic features of lesions corresponding to the 5x5 deep layer are fused by introducing skip connections and feature fusion operations through the multi-scale feature fusion module, so that feature maps of different scales are adjusted to the same size through upsampling and downsampling operations in the pooling layer to perform splicing fusion, and the segmentation ability of lesion areas of different scales is improved by introducing an attention mechanism in the connection channel layer between each layer to construct a lesion area segmentation network, wherein the attention mechanism is composed of a channel attention module and a spatial attention module, wherein the channel attention module is set in the connection channel layer between the convolution layer and the pooling layer in each layer to automatically learn the importance between each connection channel layer; The spatial attention module is set in each connection channel layer between the three-layer network architecture space to focus on the corresponding lesion area in the dermoscopic image sample to enhance the network's expression of the segmentation task corresponding to the lesion area, so as to generate a dermoscopic image segmentation model.
9. The training system for a dermoscopic image segmentation model according to claim 1, characterized in that: The segmentation model training optimization module includes the following functions: The dermoscopic ratio-balanced image samples are divided into training image samples, verification image samples and test image samples according to a division ratio of 7:2:1; Input the training image samples into the dermoscopic image segmentation model for segmentation model training, and input the verification image samples into the trained dermoscopic image segmentation model for training loss analysis, so as to train and calculate the cross entropy loss for lesion classification tasks and the Dice loss for lesion segmentation tasks, and perform weighted summation based on the cross entropy loss and the Dice loss to obtain the dermoscopic image segmentation training loss; Based on the dermoscopic image segmentation training loss and combined with the adaptive learning rate adjustment strategy, the learning rate of the trained dermoscopic image segmentation model is adjusted. When the dermoscopic image segmentation training loss does not decrease significantly within 10 iterations according to the adaptive learning rate adjustment strategy, the learning rate corresponding to the dermoscopic image segmentation model is reduced to 0.1 times of the original value. The test image samples are used to verify the learning rate convergence of the dermoscopic image segmentation model after the learning rate adjustment. At the same time, the L2 regularization method is used to optimize the model training to generate a dermoscopic image segmentation optimization model, and the corresponding dermoscopic image lesion area segmentation result is output in the last layer of the lesion area segmentation network.
10. A training method for a dermoscopic image segmentation model, characterized in that: The method is implemented based on the training system for the dermoscopic image segmentation model according to claim 1, and the training method for the dermoscopic image segmentation model comprises: Acquire a multi-source dermoscopic image; acquire a dermoscopic spectral image corresponding to R, G and B color channels through the multi-source dermoscopic image, and perform color shift correction processing on the multi-source dermoscopic image based on the dermoscopic spectral image corresponding to R, G and B color channels to generate a dermoscopic color shift corrected image; perform lossy blur removal and standardization processing on the dermoscopic color shift corrected image to generate a dermoscopic standardized image; Performing image sample enhancement on the dermoscopic standardized image to obtain a dermoscopic enhanced image sample; performing over-sampling and under-sampling balancing processing on the dermoscopic enhanced image sample to generate a dermoscopic proportion-balanced image sample; A lesion area segmentation network is constructed based on a convolutional neural network combined with a multi-scale feature fusion module and an attention mechanism to generate a dermoscopic image segmentation model. The dermoscopic image segmentation model is trained and optimized based on the dermoscopic ratio-balanced image samples and combined with the adaptive learning rate adjustment strategy to generate a dermoscopic image segmentation optimization model, and the corresponding dermoscopic image lesion area segmentation result is output in the last layer of the lesion area segmentation network.
Citation Information
Patent Citations
Dermatoscope image segmentation method and segmentation device thereof
CN112419286A
Skin lesion segmentation method based on convolution attention model
CN113744178A
Dermoscope image segmentation method based on diffusion fuzzy learning
CN118447031A
Method and device for analysing an image
US20170231550A1
Cited By
Auxiliary image segmentation method for bronchoscopy
CN120259344A
Ophthalmic disease prediction model training method and electronic equipment
CN120544808A
Pressure damage classification system based on image processing
CN120656001A