Wine color spot state evaluation method based on deep learning and logarithmic perception

By using deep learning technology for image pose and color correction, and combining a dual-granularity perceptual segmentation network and a logarithmic perceptual grading model, the problems of image inconsistency, segmentation accuracy and evaluation disconnect in wine blemish grading are solved, achieving high-precision automatic grading that conforms to human perception.

CN121504843APending Publication Date: 2026-02-10HANGZHOU DIANZI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511606716.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-05
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Existing technologies for grading wine stains suffer from problems such as inconsistent image data, insufficient lesion segmentation accuracy, and a disconnect between quantitative assessment and clinical perception, leading to inaccurate and inconsistent assessment results.

Method used

We employ a deep learning-based approach, using generative adversarial networks for image pose correction and enhanced color correction, combined with a dual-granularity perceptual segmentation network for high-precision lesion segmentation, and constructing a logarithmic perceptual grading model to achieve nonlinear mapping to clinical grades.

Benefits of technology

It improves the robustness and accuracy of the assessment, enabling objective, precise, and fully automated grading of wine stains, and the assessment results are highly consistent with the perceptions of clinical experts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121504843A_ABST
    Figure CN121504843A_ABST
Patent Text Reader

Abstract

The invention discloses a wine color spot state evaluation method based on deep learning and logarithmic perception, and the method comprises the steps: firstly, shooting a facial image of a wine color spot PWS patient, carrying out the preprocessing through employing a posture correction model and an enhanced color correction algorithm, outputting a standardized image, inputting the standardized image into a pre-trained dual-granularity perception segmentation network, and carrying out the recognition of the face of the patient. Pixel-level segmentation of the PWS focus area is achieved, a segmentation mask of the focus area is output, and a normal skin area is obtained according to the mask. Then, according to the segmentation mask and the normal skin area, a comprehensive evaluation score CE is obtained through calculation; and finally, inputting the evaluation score CE into the constructed logarithmic perception grading model, non-linearly mapping the continuous CE score to a discrete grade, outputting a quantitative evaluation grade, and completing state evaluation of the PWS. According to the method, the influence caused by the attitude correction residual error is fundamentally eliminated, so that the evaluation result is more robust and accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of medical image processing and artificial intelligence technology, and specifically relates to a method for assessing the state of wine stains based on deep learning and logarithmic perception. Background Technology

[0002] Port-wine stain (PWS) is a common congenital capillary malformation of the skin, and accurate grading of its severity is crucial for treatment planning. Currently, clinical grading of PWS mainly relies on visual examination by physicians. This method is highly subjective, and results vary depending on the physician's experience, lacking reproducibility and standardization. While histopathological examination and other methods can provide objective evidence, they are highly invasive and can cause secondary trauma to patients, especially unsuitable for facial pigmentation.

[0003] To overcome these problems, researchers began exploring non-invasive assessment methods based on computer vision. Existing techniques typically combine lesion area and color difference to quantify severity. However, these methods still face numerous technical bottlenecks in practical applications:

[0004] 1. Inconsistency in Clinical Image Data: In routine clinical follow-ups, patient images acquired at different time points using ordinary cameras often exhibit significant differences in geometric pose and color due to variations in shooting angle, distance, and lighting conditions. Traditional image registration and color correction algorithms struggle to effectively handle non-rigid facial changes and non-linear color deviations caused by complex lighting conditions, directly impacting the accuracy of subsequent area and color analyses.

[0005] 2. Insufficient Lesion Segmentation Accuracy: PWS lesions are typically irregular in shape, vary in size, and have a gradually blurred boundary with the surrounding normal skin. Existing general-purpose medical image segmentation networks (such as U-Net and its variants) have limited receptive fields and insufficient ability to capture global contextual information. When processing these low-contrast, blurred-boundary segmentation tasks, they struggle to achieve pixel-level precision, thus introducing fundamental errors.

[0006] 3. The disconnect between quantitative assessment and clinical perception: Existing quantitative assessment methods mostly use the absolute area of ​​lesions and color difference for evaluation, and employ linear grading standards (e.g., 0-25% is considered invalid). This method is not only sensitive to residual errors in posture correction, but its linear grading also contradicts the non-linear perception of human vision (Weber-Fechner law). For example, the visual impact of improving from 80% to 90% is far greater than that of improving from 10% to 20%, leading to a significant gap between machine ratings and the subjective judgment of experienced physicians, thus reducing the clinical applicability of the system. Summary of the Invention

[0007] To address the aforementioned issues, this invention proposes a wine blemish grading method based on deep learning and logarithmic perception. This method achieves objective, accurate, and fully automated grading of PWS through image standardization, high-precision lesion segmentation, and intelligent grading that conforms to human perception.

[0008] The wine stain grading method based on deep learning and logarithmic perception proposed in this invention includes the following steps:

[0009] Step 1: Take a picture of the patient's face using a regular camera.

[0010] Step 2: Image Standardization Preprocessing. Input the patient's facial image obtained in Step 1. Use a pose correction model based on Generative Adversarial Network (GAN) to uniformly project facial images of different poses onto a standard frontal face position to eliminate geometric errors. Next, use an enhanced color correction algorithm to perform color correction on the image in the CIELab color space to eliminate illumination differences. Finally, output an image with both pose and color standardized.

[0011] Step 3: High-precision segmentation of the lesion region. The standardized image output from Step 2 is input into a pre-trained dual-granularity perceptual segmentation network. This network transforms the original RGB information into a new space that conforms to human perception through a color contrast perception enhancement module, and deeply integrates local fine features with global contextual information to achieve pixel-level accurate segmentation of the PWS lesion region. In the decoder part, the lesion boundary is dynamically evolved, and a lesion region segmentation mask is output. The normal skin region is obtained based on the mask.

[0012] Step 4: Quantitative Score Calculation. Based on the segmentation mask and normal skin area output from Step 3, calculate the lesion area index and color difference index. The lesion area index is obtained by calculating the "proportion of lesion area to the total face area"; the color difference index is obtained by calculating the color difference between the lesion area and the normal skin area. Finally, the two indices are weighted and summed to obtain a comprehensive evaluation score CE.

[0013] Step 5: Log-perceptual grading and result output. The CE score obtained in Step 4 is input into the pre-built log-perceptual grading model; this model, based on the Weber-Fechner law, non-linearly maps the continuous CE score to discrete clinical grades; finally, it outputs a quantitative assessment grade, completing the status assessment of PWS severity.

[0014] Furthermore, the specific implementation process of step 2 is as follows:

[0015] 2.1 GAN-based Face Pose Correction: First, 68 facial key points are extracted from the input face image using an Ensemble Regression Tree (ERT) model. Then, the input face image and the corresponding key points are fed into a pre-trained GAN network. The generator of this network adopts an encoder-decoder architecture. In the encoding stage, content features related to identity and lesions are decoupled from geometric features related to pose. In the decoding stage, the key point information is used as geometric constraints to replace the original pose information with the geometric structure of a standard frontal pose, and a standard frontal face image that retains the original identity and lesion information is reconstructed.

[0016] 2.2 Enhanced Color Correction: The pose-corrected frontal face image is converted to the CIELab color space, and color correction is performed using an enhanced color correction algorithm, ultimately outputting an image with both pose and color standardized. This algorithm not only corrects the mean and standard deviation of the source and standard images in the L, a, and b channels, but also introduces inter-channel correlation correction. By calculating and matching the cross-correlation coefficients between channels, it compensates for changes in visual brightness perception caused by color modification, thereby achieving high-fidelity color transfer and ensuring color consistency between pre- and post-operative images.

[0017] Furthermore, the specific structure of the dual-granularity perceptual segmentation network in step 3 is as follows: the network adopts an encoder-decoder architecture. Before the encoder, the chromaticity contrast perception enhancement module simulates the human eye's chromaticity contrast mechanism through an end-to-end trainable convolutional neural network, transforming the original RGB information to a new perceptual space and adaptively learning an optimal color representation. The encoder part consists of multiple full-dimensional heat conduction convolutional modules. Each module integrates sequentially cascaded full-dimensional dynamic convolutions and heat conduction operators. The full-dimensional dynamic convolutions are used for refined local feature extraction, and the heat conduction operators are used to efficiently capture global contextual information, so as to synergistically enhance the ability to identify blurred boundaries. In the skip connections between the encoder and decoder, a compact convolutional Transformer module is used, which utilizes the Transformer's self-attention mechanism to enhance the fusion and interaction of multi-scale features, making up for the shortcomings of traditional skip connections that only transmit local information. In the decoder, this invention abandons the traditional, single pixel-level classification paradigm and instead adds a topology-preserving level set evolution module. This module reconstructs the segmentation task into an evolutionary process of geometric contours. It utilizes dual-granularity depth features extracted by the encoder to construct a dynamic velocity force field, which guides the iterative evolution of an initial contour. The evolution process is driven not only by image features but also by curvature regularization and topology preservation constraints, ensuring that the final segmentation boundary is geometrically smooth and continuous, and correctly handling complex topological structures such as potential "voids" within lesions or external "enclaves." This method fundamentally solves the problem of discontinuous and unsmooth boundaries caused by pixel-independent decision-making in traditional methods.

[0018] Furthermore, the construction process of the log-aware grading model in step 5 is as follows: First, a benchmark dataset containing a large number of PWS images, corresponding CE scores, and real labels is constructed. Then, the multi-class problem is decomposed into a series of binary classification tasks. For example, to determine the threshold T1 for "cured" and "good," "cured" is considered a negative class, and the remaining levels are merged into positive classes. All possible CE scores are traversed as candidate thresholds, and the corresponding point on the receiver operating characteristic (ROC) curve is calculated for each threshold. The CE score value corresponding to the point that maximizes Youden's J statistic is selected as the optimal threshold T1. Similarly, the threshold T2 for distinguishing between "good" and "average," and the threshold T3 for distinguishing between "average" and "severe," are determined. Finally, a set of non-linear grading thresholds is obtained, constituting the core decision rules of the log-aware grading model.

[0019] Beneficial effects of this invention:

[0020] 1. Improved robustness and accuracy of assessment: This invention addresses the issue of inconsistency between pose and lighting in clinical images by innovatively employing a GAN network for pose projection and using an enhanced color correction algorithm to compensate for color deviations. More importantly, by calculating the "proportion of lesion area to face area" rather than the absolute area value, the influence of residual pose correction errors is fundamentally eliminated, making the assessment results more robust and accurate.

[0021] 2. Achieved accurate segmentation of blurred lesions: This invention addresses the blurred boundaries of PWS lesions by designing a dual-granularity perceptual segmentation network. A color-discrimination perception enhancement module converts the RGB color space into a human perceptual space, maximizing the color difference between lesions and normal skin while minimizing the influence of irrelevant variables such as illumination. A full-dimensional thermal conduction convolution module deeply fuses local and global features, and a CCT module enhances multi-scale information interaction, significantly improving the ability to recognize low-contrast and gradient boundaries. In the decoder section, a level-preserving evolution module treats segmentation as a dynamic boundary evolution process, ensuring the structural integrity of the segmentation results. This allows for the natural handling of complex shapes such as rings and multiple regions, achieving segmentation accuracy far exceeding traditional networks and providing a reliable data foundation for subsequent quantitative analysis.

[0022] 3. Ensuring high consistency between assessment results and clinical expert perception: This invention is the first to introduce the Weber-Fechner law from psychophysics into PWS efficacy assessment, constructing a logarithmic perception grading method. This method, through statistical optimization of a large amount of clinical data, establishes a non-linear mapping between objective scores and clinical levels, enabling the machine's assessment results to simulate the non-linear perception patterns of experienced physicians. This solves the problem of the disconnect between existing linear grading and clinical judgment, possessing extremely high reliability and application value. Attached Figure Description

[0023] Figure 1 This is an overall flowchart of the wine stain grading method proposed in this invention;

[0024] Figure 2 This is a schematic diagram of the dual-granularity sensing segmentation network in this invention;

[0025] Figure 3 This is a diagram of the internal structure of the network module in this invention. Detailed Implementation

[0026] Detailed technical solution

[0027] This invention provides a method for grading wine blemishes based on deep learning and logarithmic perception, such as... Figure 1 and Figure 3 As shown, it includes at least the following steps:

[0028] The specific implementation methods for each step are explained in detail below.

[0029] S1: Take a picture of the patient's face using a regular camera.

[0030] S2: Image normalization preprocessing

[0031] This step aims to eliminate image inconsistencies caused by differences in shooting angle, distance, and lighting conditions. Step S2 further includes the following sub-steps:

[0032] S21: Face pose correction based on generative adversarial networks (GAN)

[0033] S211: Facial landmark detection is performed on facial images using an ensemble regression tree model, resulting in a coordinate set S of 68 facial landmarks. orig ={(x i ,y i )|i=1,…,68}.

[0034] S212: Transfer the original image I orig and its corresponding set of key point coordinates S orig As input, the data is fed into a pre-trained face frontalization GAN network to obtain a set of standard frontalized facial key point coordinates S.std .

[0035] S213: From S orig and S std Four pairs of feature points are randomly selected for matching, and the perspective transformation matrix is ​​calculated. The relative positions of the input face image are adjusted using the perspective transformation matrix to obtain a standard frontalized face image I. std .

[0036] S214: Repeat step S213 for all 68 pairs of facial feature points, calculate the alignment error of each transformation matrix, and select the optimal perspective transformation matrix and standard frontalization result corresponding to the 4 pairs of reference points with the smallest error.

[0037] S22: Enhanced Color Correction

[0038] S221: The attitude-corrected image output from S21 (as the source image I) sc ) and a fixed reference image (as target image I) tc Convert from RGB color space to CIELab color space to obtain the L, a, and b channel values ​​x of the source and target images. sc =[x sl ,x sα ,x sβ ] T and x tc =[x tl ,x tα ,x tβ ] T , where x sc This represents the source image in the CIELab color space, x tc This represents the target image in the CIELab color space. The subscripts sl, sα, and sβ represent the L-channel component, a-channel component, and b-channel component of the source image, respectively. The subscripts tl, tα, and tβ represent the L-channel component, a-channel component, and b-channel component of the target image, respectively.

[0039] S222: Calculate the average value of the three-channel components of the source and target images. and standard deviation Then calculate the standard vector value Z. sc and Z tc The formula is as follows:

[0040]

[0041]

[0042] S223: Calculate the correlation coefficient and The formula is as follows:

[0043]

[0044] Where n is the total number of pixels, z tα Let z be the α component of the standard vector value of the target image. tβ Let z be the β component of the standard vector value of the target image. sα Let z be the α component of the standard vector value of the source image. sβ β is the β component of the standard vector value of the source image.

[0045] S224: Using the correlation coefficient and Calculate the independent variable S from the standard vector values. α and S β The formula is as follows:

[0046]

[0047] S225: Calculate the standardized vector z′ with added correlation coefficient. tα and z′ tβ The formula is as follows:

[0048]

[0049] S226: Then use the channel average value of the source image. Standard deviation of channel pixels from source image By using the inverse standardization formula of the normal distribution, a new target value X is output. tc =[X tl ,X tα ,X tβ ] T The formula is as follows:

[0050]

[0051] Where z tc =[z tl ,z′ tα ,z′ tβ ] T .

[0052] S227: Finally, the result X from the CIELab color space tc Output image x converted to RGB color space std Color transfer can then be completed.

[0053] S3: High-precision segmentation of lesion area

[0054] S31: The normalized facial image x output by S2 stdIn the color contrast perception enhancement module of the dual-granularity perceptual segmentation network, such as... Figure 2 As shown, this module first passes the input image through an unbiased 1x1 convolutional layer. This convolutional layer contains three kernels, each with a size of 1×1×3. The weight matrix is ​​trained and optimized to find the optimal linear combination, thereby decoupling the RGB signal into three initial opposing channel features most favorable for the segmentation task. Further, the linearly transformed features are fed into a channel-based multilayer perceptron to separate the features along the channel dimension. This design allows the network to learn different nonlinear response curves for different opposing color channels, accurately simulating the nonlinear characteristics of human eye perception of different colors and brightness, thus achieving nonlinear amplification of key color difference features. Further, the nonlinearly compressed features are processed through global average pooling to obtain channel descriptors, which are then passed through a two-layer fully connected network to learn the complex dependencies between channels and output the attention weights for each channel. Finally, the learned weights are multiplied by the original input to obtain the perceptually adjusted feature map x. perc .

[0055] S32: Convert the feature map x output from S31 perc The input is fed into the encoder of a dual-granularity perceptual segmentation network. The encoder performs downsampling feature extraction on the image through four cascaded full-dimensional thermal conduction convolutional modules. These full-dimensional thermal conduction convolutional modules include max pooling downsampling, full-dimensional dynamic convolution, and a thermal conduction operator.

[0056] The full-dimensional dynamic convolution introduces complementary attention mechanisms in four different dimensions: the spatial location (α) within the k×k range of the convolution kernel. s ), input channel (α) c ), output channel (α) f ), and convolution kernel index (α) w By jointly learning and weighting these attention points, full-dimensional dynamic convolution can adaptively adjust the convolution weights according to the input features, ultimately extracting high-precision lesion edge and texture features. The calculation formula for full-dimensional dynamic convolution is as follows:

[0057] x i+1 =(α w1 ⊙α f1 ⊙α c1 ⊙α s1 ⊙W1+…+α wn ⊙α fn ⊙α cn ⊙α sn ⊙W n )*x i

[0058] Where x i For each level of full-dimensional dynamic convolution, xi+1 This is the output of the full-dimensional dynamic convolution at this level; W1…W n Let α be the convolution weight vector. wn It is the weight W n Convolution kernel index attention, α fn It is the weight W n Output channel attention, α cn It is the weight W n Input channel attention, α sn It is the weight W n The output channel attention.

[0059] The heat conduction operator models each image pixel as a temperature point and updates its feature values ​​through iterative "heat diffusion" between neighboring pixels. This process naturally propagates global contextual information in the feature map, supplementing the spatial correlation features of local features such as edges and textures. The discrete iterative formula of the heat conduction operator is as follows:

[0060]

[0061] in, Let represent the feature value of pixel i+1 at the t-th iteration of the full-dimensional dynamic convolution; N(i) represents the neighborhood of pixel i; w ij λ represents the thermal conduction weight between pixel i and pixel j, usually defined based on pixel similarity; λ is the diffusion coefficient that controls the conduction intensity.

[0062] S33: The feature maps from the four different scale encoders in S32 are input into the compact convolutional Transformer module. This module reconstructs the feature maps into a flattened sequence of 2D image patches by sampling (tokenizing) the feature maps, while maintaining the original channel dimensions. Subsequently, these multi-scale tokens are mapped to the corresponding regions of the decoder, and cross-scale and cross-channel information interaction is achieved through multi-head channel cross-attention, capturing the global dependencies between features at different levels. Next, the compact convolutional Transformer module introduces a multilayer perceptron structure with residuals to further model and fuse the attention output. Finally, the output feature map not only retains the multi-scale information of the encoder but also incorporates global contextual representations, thereby overcoming the shortcomings of traditional skip connections that are limited to local feature propagation.

[0063] S34: Input the feature maps output from S32 and S33 into the decoder of the dual-granularity perceptual segmentation network, and obtain the final segmentation mask by fusing the upsampling module and the topology-preserving level set evolution module through a gating mechanism.

[0064] The upsampling module adopts a hierarchical structure corresponding to the encoder. First, it upsamples the low-resolution feature map from the previous stage (initially the feature map output by the encoder, then the output of the previous upsampling module) using transposed convolution to expand its spatial size. Further, the upsampled feature map is concatenated with the fused feature map output by the compact convolution Transformer module in S32, which contains rich global context and multi-scale information, to obtain y. i This step injects the fine local features extracted by the encoder at different levels into the decoding path, thus providing crucial information for high-precision detail recovery. After four cascaded upsampling and feature fusion operations, the decoder outputs a high-dimensional feature map with the same size as the original input image. This feature map is then subjected to channel dimensionality reduction through a 1x1 convolutional layer, and a sigmoid activation function is applied to generate a pixel-level probability map y for PWS lesion region segmentation. mask .

[0065] The topology-preserving level set evolution module first initializes a level set function φ0(a,b) in a space of the same size as the input image. This function is a signed distance function, typically initialized to a simple geometric shape (such as a large circle covering the entire image center) such that φ0 < 0 in the image center region and φ0 > 0 in the edge regions. The segmentation boundary is implicitly defined as the zero level set where φ(a,b) = 0. Further, the stitched feature map y output from the upsampling module is... i Input a lightweight force field prediction head (consisting of several 1x1 convolutional layers). The output of this prediction head is not a segmentation probability map, but a scalar velocity field F(a,b). The velocity field is determined by y i The physical meaning of this decision is as follows: Within the lesion region, F(a,b) is predicted by the network to be negative, representing an inward contraction force, which drives the external zero-level set to move inward (i.e., drives the predicted segmentation boundary to contract inward); within the normal skin region, F(a,b) is predicted by the network to be positive, representing an outward expansion force, which drives the internal zero-level set to move outward (i.e., drives the predicted segmentation boundary to expand outward); at the actual lesion boundary, the value of F(a,b) approaches zero, making the evolved contour line tend to stabilize. Furthermore, based on the partial differential equation of level set evolution, the level set function φ is iteratively updated:

[0066]

[0067] Where t is the evolution time, i.e. the number of iterations; It is a data-driven term. The velocity force field F(a,b) determines the direction and velocity of the profile evolution. This is the curvature regularization term. k is the curvature of the zero level set, and β is a hyperparameter controlling the smoothing intensity. This term maintains the smoothness of the contour, suppresses jagged edges and sharp protrusions, and simulates the effect of surface tension in the physical world. Finally, the contour line of the lesion region is generated through a fixed number of iterations.

[0068] Preferably, the gating mechanism dynamically learns a fusion weight through the gating unit, and weights and sums the contour lines of the lesion region in the pixel-level segmentation probability map to obtain the final segmentation mask.

[0069] S4: Quantitative scoring calculation.

[0070] S41: Calculate the lesion area index. Based on the segmentation mask output from S3, calculate the total face area A. face and lesion area A pws And calculate the percentage of the face occupied by the lesion I. area =A pws / A face The scoring area index is obtained.

[0071] S42: Calculate the lesion color index. Based on the segmentation mask output from S3, use the CIE2000 color difference formula to calculate the color difference I between the lesion and normal skin. color The CIE2000 color difference formula is:

[0072]

[0073] Where ΔL′, ΔC′, and ΔH′ represent the difference in lightness, chroma, and hue, respectively; k L k C and k H These are the lightness weighting factor, chroma weighting factor, and hue weighting factor, which are related to the experimental conditions; S L S C and S H These are correcting lightness, correcting chroma, and correcting hue; R T It is a rotation function used to correct the deflection of the principal axis of the ellipse in the blue region. This is mainly because the human eye perceives color differently in the blue region compared to other color gamuts; the perception of color is somewhat skewed. Therefore, the rotation function R is introduced into the formula. T Used to determine the direction of the principal axis of an ellipse.

[0074] S43: The lesion area and lesion color indices are weighted and summed to obtain the final CE score.

[0075] CE = w area ·I area +w color ·I color

[0076] Wherein, weight warea and w color Satisfy w area +w color = 1, and 0.5 is taken in this embodiment.

[0077] S5: Logarithmic perception grading and result output. Compare the CE score calculated in S4 with the preset non - linear thresholds T1, T2, T3, and output the final grading level according to the following decision rules.

[0078] If CE ≤ T1, the scoring result is "cured";

[0079] If T1 < CE ≤ T2, the scoring result is "good";

[0080] If T2 < CE ≤ T3, the scoring result is "fair";

[0081] If CE > T3, the scoring result is "severe".

[0082] The calculation steps of the non - linear thresholds T1, T2, T3 are as follows:

[0083] First, for each image in the port - wine stain patient image dataset, calculate its continuous CE score using the automated process described above in this invention; on the other hand, subjectively evaluate the treatment effect of each pair of images independently and classify it into four predefined clinical levels: "cured", "good", "fair", "severe". Subsequently, to determine the optimal numerical thresholds (T1, T2, T3) for dividing these four levels, this method systematically decomposes this multi - classification problem into a series of binary - classification tasks, calculates the true - positive rate (TPR, i.e., sensitivity) and false - positive rate (FPR, i.e., 1 - specificity) for each candidate threshold, and plots the ROC curve. This invention selects the point on the curve where the Youden's J statistic (Youden's J statistic = TPR - FPR) is maximized as the best balance point, and the CE score value corresponding to this point is determined as the optimal threshold. Finally, through this statistical optimization process, this invention obtains a set of non - linear grading threshold combinations (T1, T2, T3) calibrated with large - scale clinical data and achieving the best balance in diagnostic accuracy.

[0084] Experimental verification

[0085] This invention compares and evaluates the dual-granularity perceptual segmentation network with several existing segmentation networks. Table 1 summarizes the quantitative results, including FPS and Dice similarity coefficient (DSC). The classic U-Net achieves high accuracy while maintaining significant speed. Its variants, ACC-UNet and Rolling-UNet, attempt to capture long-range dependencies, but suffer from low frame rates due to limited parallelism. Swin-UMamba and vHeat effectively acquire global information through selective state-space models and visual heat conduction operators, respectively, but their accuracy still needs improvement. Compared to the base network UCTransNet, the dual-granularity perceptual segmentation network achieves a segmentation accuracy of 86.51%, an improvement of 7.06%, while paying only a minimal decrease in inference speed (approximately 3.5 frames less). Therefore, it outperforms all competing methods in overall performance, demonstrating superior results.

[0086] Table 1 Comparative Evaluation Results

[0087]

[0088] This invention conducted a rating consistency rate experiment, demonstrating the effectiveness of the method by comparing the consistency rate between the evaluation results of the algorithm and the actual evaluation results. As shown in Table 2, in 270 test examples, the evaluation results of the algorithm of this invention were consistent with the actual evaluation results in 245 sets, achieving a consistency rate of 90.74%. The results prove that the method of this invention achieves good evaluation results.

[0089] Table 2. Experimental Results of the Consistency Rate Between the Evaluation System and the Actual Values

[0090]

Claims

1. A method for evaluating the state of wine stains based on deep learning and logarithmic perception, characterized in that, Includes the following steps: Step 1: Take facial images of patients with port-wine stains (PWS) using a camera; Step 2: Input the patient's facial image, preprocess it using a pose correction model and an enhanced color correction algorithm, and output a standardized image with both pose and color accuracy; Step 3: Input the standardized image pairs into the pre-trained dual-granularity perceptual segmentation network to achieve pixel-level segmentation of the PWS lesion region, output the segmentation mask of the lesion region, and obtain the normal skin region based on the mask; Step 4: Based on the segmentation mask and normal skin area, calculate the lesion area index and color difference index, and perform a weighted sum of the two indexes to obtain a comprehensive evaluation score CE; Step 5: Input the evaluation score CE into the constructed log-perceptual grading model, non-linearly map the continuous CE score to discrete grades, output the quantified evaluation grade, and complete the state assessment of PWS.

2. The wine stain state assessment method based on deep learning and logarithmic perception according to claim 1, characterized in that, The specific implementation process of step 2 is as follows: Step 2.1: First, facial key points are extracted from the input face image using an ensemble regression tree (ERT) model. Then, the input face image and its corresponding key points are fed into a pre-trained GAN network. The generator of this network uses an encoder-decoder architecture and outputs a set of standardized frontalized facial key point coordinates, S. std From S orig The set of coordinates of key points S std Four pairs of feature points are randomly selected for matching, and the perspective transformation matrix is ​​calculated. The relative positions of the input face image are adjusted using the perspective transformation matrix to obtain a standard frontalized face image I. std ; The alignment error of each transformation matrix is ​​repeatedly calculated for all facial key points, thereby selecting the optimal perspective transformation matrix and standard frontalization result corresponding to the 4 pairs of reference points with the smallest error. Step 2.2: Convert the pose-corrected standard frontalized facial image to the CIELab color space, perform color correction using an enhanced color correction algorithm, and finally output an image with both pose and color standardized.

3. The wine stain state assessment method based on deep learning and logarithmic perception according to claim 2, characterized in that, The specific structure of the dual-granularity perceptual segmentation network is as follows: it adopts an encoder-decoder architecture; and before the encoder, an end-to-end convolutional neural network is used to simulate the human eye's color contrast mechanism to transform the original RGB information into a new perceptual space. The encoder consists of multiple full-dimensional thermally conductive convolutional modules. Each module integrates sequentially cascaded full-dimensional dynamic convolutions and thermally conductive operators. The full-dimensional dynamic convolutions are used for refined local feature extraction, while the thermally conductive operators are used to efficiently capture global contextual information, thus synergistically enhancing the ability to identify blurred boundaries. In the skip connections between the encoder and decoder, a compact convolutional Transformer module is used, leveraging the Transformer's self-attention mechanism to enhance the fusion and interaction of multi-scale features. In the decoder, a topology-preserving level set evolution module is added. This module reconstructs the segmentation task as an evolutionary process of a geometric contour, constructing a dynamic velocity force field using the dual-granularity depth features extracted by the encoder. This force field guides an initial contour line to iteratively evolve. The evolutionary process is driven not only by image features but also by curvature regularization and topology-preserving constraints.

4. The wine stain state assessment method based on deep learning and logarithmic perception according to claim 3, characterized in that, The full-dimensional dynamic convolution introduces complementary attention mechanisms in four different dimensions: the spatial location α within the k×k range of the convolution kernel. s Input channel α c Output channel α f and convolution kernel index α w By jointly learning and weighting these attentions, the edge and texture features of the lesions are finally extracted. The formula for calculating full-dimensional dynamic convolution is as follows: x i+1 =(a w1 ⊙a f1 ⊙a c1 ⊙a s1 ⊙W1+…+α wn ⊙a fn ⊙a cn ⊙a sn ⊙W n )*x i Where x i For each level of full-dimensional dynamic convolution, x i+1 This is the output of the full-dimensional dynamic convolution at this level; W n Let α be the convolution weight vector. wn It is the weight W n Convolution kernel index attention, α fn It is the weight W n Output channel attention, α cn It is the weight W n Input channel attention, α sn It is the weight W n The output channel attention.

5. The wine stain state assessment method based on deep learning and logarithmic perception according to claim 4, characterized in that, The heat conduction operator models each image pixel as a temperature point and updates the feature value through iterative thermal diffusion between neighboring pixels; the discrete iterative formula of the heat conduction operator is as follows: in, Let w represent the feature value of pixel i+1 at the t-th iteration of the full-dimensional dynamic convolution; N(i) represents the neighborhood of pixel i; w ij λ represents the heat conduction weight between pixel i and pixel j, defined according to pixel similarity; λ is the diffusion coefficient that controls the conduction intensity.

6. The wine stain state assessment method based on deep learning and logarithmic perception according to claim 5, characterized in that, The topology-preserving level set evolution module first initializes a level set function φ0(a,b) in a space of the same size as the input image, where (a,b) represents the coordinate position. This level set function is a signed distance function, initialized with a geometric shape such that φ0<0 in the image center region and φ0>0 in the edge region. The segmentation boundary is implicitly defined as the zero level set where φ=0. The module then uses the stitched feature map y output from each upsampling module in the encoder. i Input a force field prediction head consisting of several 1x1 convolutional layers. The output of this prediction head is a scalar velocity field F(a,b), where the velocity field is determined by y i The physical meaning of this decision is as follows: Within the lesion region, F(a,b) is predicted by the network to be negative, representing an inward contraction force that drives the outer zero-level set to move inward; within the normal skin region, F(a,b) is predicted by the network to be positive, representing an outward expansion force that drives the inner zero-level set to move outward; at the actual lesion boundary, the value of F(a,b) approaches zero, causing the evolved contour line to stabilize; based on the partial differential equation of level set evolution, the level set function φ is iteratively updated: Where t is the evolution time, i.e. the number of iterations; It is a data-driven term; the velocity force field F(a,b) determines the direction and velocity of the profile evolution; β is the curvature regularization term; k is the curvature of the zero level set, and β is a hyperparameter controlling the smoothing intensity; finally, the contour line of the lesion region is generated through a fixed number of iterations.

7. The wine stain state assessment method based on deep learning and logarithmic perception according to claim 6, characterized in that, The segmentation mask is obtained as follows: the decoder outputs a feature map with the same size as the original input image, and a 1x1 convolutional layer is used to reduce the dimensionality of the feature map by channels. A sigmoid activation function is then applied to generate a pixel-level segmentation probability map y. mask ; The gating mechanism dynamically learns a fusion weight through the gating unit, and then sums the pixel-level segmentation probability map and the lesion region outline with weight to obtain the final segmentation mask.

8. The wine stain state assessment method based on deep learning and logarithmic perception according to claim 7, characterized in that, The lesion area index is obtained by calculating the proportion of the lesion area to the total face area; the color difference index is obtained by calculating the color difference between the lesion area and the normal skin area.

9. The wine stain state assessment method based on deep learning and logarithmic perception according to claim 8, characterized in that, The construction process of the log-aware hierarchical model is as follows: First, a benchmark dataset containing PWS images, corresponding CE scores, and real labels is constructed. Then, the multi-classification problem is decomposed into a series of binary classification tasks. All CE scores are traversed as candidate thresholds. For each threshold, its corresponding point on the receiver operating feature (ROC) curve is calculated, and the CE score value corresponding to the point that maximizes the Youden exponent is selected as the optimal threshold T1. This process is repeated to obtain a set of non-linear hierarchical thresholds, which constitute the core decision rules of the log-aware hierarchical model.