Geometric state hybrid normalized wasserstein distance-based stain detection method and system
By employing a geometric hybrid normalized Wasserstein distance detection method, combined with a two-layer routing attention module and a Neck multi-scale feature fusion module, the problem of insufficient accuracy and robustness in spot detection of the YOLO series algorithms is solved, achieving high-precision and stable small-sized spot detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAQIAO UNIVERSITY
- Filing Date
- 2026-02-11
- Publication Date
- 2026-05-01
AI Technical Summary
Existing target detection algorithms based on the YOLO series suffer from problems in spot detection, such as gradient vanishing in the IoU loss function when detecting small targets, insensitivity to displacement direction, and non-smoothness, resulting in insufficient detection accuracy and robustness.
A detection method based on geometrically normalized Wasserstein distance is adopted, which combines a two-layer routing attention module and a Neck multi-scale feature fusion module. By using a geometrically dynamically normalized Wasserstein distance loss function and a dynamic normalization factor, a GDNWD metric paradigm is constructed to enhance feature extraction and feature fusion in hair-occluded regions.
It significantly improves the detection accuracy and robustness of small-sized pigmented spots, mitigates the impact of hair occlusion, suppresses duplicate detection and boundary jitter, and is suitable for pigmented spot detection under complex facial skin conditions.
Smart Images

Figure CN121708009B_ABST
Abstract
Description
A method and system for spot detection based on geometrical mixing normalized Wasserstein distance Technical Field
[0001] This invention relates to the field of machine learning technology, and specifically to a method and system for spot detection based on geometrically mixed normalized Wasserstein distance. Background Technology
[0002] In recent years, with the rapid evolution of artificial intelligence and deep learning technologies, computer vision has received widespread attention and application in the field of intelligent diagnosis of skin diseases. Facial pigmentation, as one of the common abnormal skin manifestations, can reflect an individual's skin health status through its distribution location, morphological characteristics, and density. Accurate detection and identification of pigmentation not only provides technical support for the quantitative assessment of skin condition but also offers important references for the development of personalized care and clinical treatment plans. However, in real images, pigmentation typically has characteristics such as small area, low color contrast with surrounding skin tone, and blurred edges. It is also easily affected by background factors such as lighting changes and skin texture, posing significant challenges to automatic detection and identification tasks. Currently, YOLO-based target detection algorithms, by introducing multi-scale feature fusion structures (such as feature pyramid networks and path aggregation feature pyramid networks) and multi-path detection head mechanisms, have achieved certain results in target recognition in complex scenes. However, these methods generally rely on Intersection over Union (IoU) as the loss function, but IoU itself has certain limitations in practical applications: when there is no overlap between the predicted and ground truth boxes, the IoU value is 0, failing to reflect the positional differences between them, leading to gradient vanishing. For small targets, even a pixel shift of one or two units can cause a significant change in IoU. Furthermore, IoU only considers the overlapping area, lacking awareness of the displacement direction, is insensitive to scale changes, and the function itself is non-smooth, easily causing instability during training. Therefore, there is an urgent need to construct a loss function that can constrain the aspect ratio difference between the predicted and ground truth boxes and has a dynamic adjustment normalization mechanism based on mean square error, in order to effectively improve the accuracy and robustness of spot detection. Summary of the Invention
[0003] To address the aforementioned issues, this invention proposes a method and system for detecting pigmentation spots based on geometrically normalized Wasserstein distance. By combining a dual-layer routing attention module to enhance feature extraction of hair-occluded regions with geometrically dynamic normalized Wasserstein distance loss, this method achieves high-precision and robust detection of small-sized, low-contrast, high-density pigmentation spots with hair occlusion under complex facial skin conditions.
[0004] On the one hand, a stain detection method based on geometrically mixed normalized Wasserstein distance includes:
[0005] S1. Obtain original human facial blemish image data. Perform stratified random sampling based on shooting angle, lighting conditions, skin texture characteristics and blemish distribution density. Use the sampling results as the initial dataset and divide them into training set and test set.
[0006] S2, randomly scale, crop, flip, translate, and adjust the hue and brightness of the facial blemish images in the training and test sets to obtain the enhanced training and test sets;
[0007] S3, a stain detection network model is constructed based on YOLOv11. The stain detection network model includes a backbone network, a two-layer routing attention module, and a Neck multi-scale feature fusion module.
[0008] S4. Input the augmented training set into the freckle detection network model. After extracting multi-scale features through the backbone network, extract the features of the hair-occluded area from the multi-scale features through the two-layer routing attention module. The multi-scale features and the features of the hair-occluded area are weighted and fused through the Neck multi-scale feature fusion module to obtain the fused features. The regression loss function is constructed based on the geometrically dynamically normalized Wasserstein distance. The forward and backward propagation are performed based on the regression loss function to obtain the trained freckle detection network model.
[0009] S5 inputs the enhanced test set into the trained spot detection network model, constructs the GDNWD metric paradigm using Wasserstein distance, aspect ratio regularization term and dynamic normalization factor, and predicts and outputs spot detection results based on the GDNWD metric paradigm.
[0010] Furthermore, in S4, the dual-layer routing attention module is obtained by replacing the parallel spatial attention convolution module in YOLOv11 with a dual-layer routing attention mechanism. Specifically, this includes: extracting multi-scale features through the backbone network and performing pooling operations on the multi-scale features to obtain pooled features. The pooled features The input is fed into the CBS module for non-linear mapping to generate guiding features with global awareness. These guiding features are then segmented along the channels to obtain segmentation features. By segmentation features Enhanced features are obtained by performing feature enhancement on the partially occluded region. Next, the segmentation features Input to Each aggregation routing gate obtains aggregation features, which are then combined with enhanced features. Channel stitching is performed to obtain stitching features, which are then input into the second CBS module for calibration, ultimately yielding features of the area obscured by hair. It is used for feature fusion in the Neck fusion module.
[0011] Furthermore, the regression loss function constructed based on the geometrically dynamically normalized Wasserstein distance is calculated as follows:
[0012] ;
[0013] in, Let A represent the Wasserstein distance function; let A represent the original given patch bounding box; and let B represent the predicted patch candidate box. and These represent the exponential forms of the Gaussian distributions of bounding boxes A and B, respectively. Indicates the learnable scaling factor; Represents the x-coordinate of bounding box A; Represents the ordinate of bounding box A; This indicates the width of bounding box A; Indicates the height of bounding box A; Represents the x-coordinate of bounding box B; Represents the ordinate of bounding box B; This indicates the width of bounding box B; This indicates the height of bounding box B; Indicates transpose; express Norm.
[0014] Furthermore, in S5, the dynamic normalization factor The calculation formula is as follows:
[0015] ;
[0016] in, Indicates density-sensitive weights, This represents the number of neighboring candidate boxes around the target box predicted by the detection network. Given the center coordinates of the target bounding box, Indicates the number of the nearest neighbors of the target box The center coordinates of each candidate box; This represents the natural exponential function.
[0017] Furthermore, the dynamic normalization factor It is calculated from the mean square error between the center coordinates of the neighboring candidate boxes and the center coordinates of the corresponding real boxes, and a non-zero bias term is introduced to ensure that the denominator is always positive.
[0018] Furthermore, in S5, the formula for calculating the metric paradigm of GDNWD is as follows:
[0019] ;
[0020] in, A metric paradigm for representing the geometrically mixed normalized Wasserstein distance; Represents the Wasserstein distance; This indicates the aspect ratio regularization term; An exponential measure of the Gaussian distribution of bounding box A; An exponential measure of the Gaussian distribution of bounding box B.
[0021] On the other hand, a stain detection system based on geometrically mixed normalized Wasserstein distance includes:
[0022] The dataset partitioning module is used to acquire original human facial blemish image data. Based on the shooting angle, lighting conditions, skin texture characteristics and blemish distribution density, stratified random sampling is performed, and the sampling results are used as the initial dataset and divided into training set and test set.
[0023] The dataset augmentation module is used to randomly scale, crop, flip, translate, and adjust the hue and brightness of facial blemish images in the training and test sets to obtain augmented training and test sets.
[0024] The network model construction module is used to build a stain detection network model based on YOLOv11. The stain detection network model includes a backbone network, a two-layer routing attention module, and a Neck multi-scale feature fusion module.
[0025] The training module is used to input the augmented training set into the freckle detection network model. After the backbone network extracts multi-scale features, the two-layer routing attention module extracts the features of the hair-occluded area in the multi-scale features. The Neck multi-scale feature fusion module performs weighted fusion of the multi-scale features and the features of the hair-occluded area to obtain the fused features. A regression loss function is constructed based on the geometrically dynamically normalized Wasserstein distance. Forward and backward propagation training is performed based on the regression loss function to obtain the trained freckle detection network model.
[0026] The detection module is used to input the enhanced test set into the trained spot detection network model, construct the GDNWD metric paradigm by combining Wasserstein distance, aspect ratio regularization term and dynamic normalization factor, and predict and output spot detection results based on the GDNWD metric paradigm.
[0027] The present invention adopts the above technical solution and has the following beneficial effects:
[0028] (1) The present invention adopts a structure of pooling guidance, channel segmentation occlusion area directional enhancement and dual-path aggregation routing through a dual-layer routing attention module, which explicitly models and enhances the contextual semantics and texture response of the hair-covered area, effectively alleviating the problem of response attenuation of the occluded target by the traditional attention mechanism;
[0029] (2) The present invention adjusts the Wasserstein distance scale in real time based on the mean square error of the center coordinates of the neighboring candidate boxes and the real boxes, so that the loss function automatically reduces the sensitivity to small offsets when acne is densely distributed, and suppresses repeated detection and boundary jitter.
[0030] (3) This invention introduces a width-to-height ratio regularization term on the basis of Wasserstein distance through the GDNWD metric paradigm, which forces the predicted box to approach the true color spot morphology, significantly improving the stretching / compression type false detection caused by scale mismatch, and is especially suitable for fine localization of irregular color spots on the face. Attached Figure Description
[0031] Figure 1 is a flowchart of the stain detection method based on geometric state mixed normalized Wasserstein distance according to an embodiment of the present invention;
[0032] Figure 2 is a diagram of the overall network structure of the color change detection method in an embodiment of the present invention.
[0033] Figure 3 is a schematic diagram of the geometric dynamic normalization module structure proposed in the embodiment of the present invention;
[0034] Figure 4(a) is a schematic diagram of the results of the stain detection task in the embodiment of the present invention;
[0035] Figure 4(b) is a schematic diagram of the results of the benchmark model YOLOv11 on the stain detection task in the embodiment of the present invention;
[0036] Figure 4(c) is a schematic diagram of the results of the YOLOv10 comparison model on the stain detection task in the embodiment of the present invention;
[0037] Figure 4(d) is a schematic diagram of the results of the YOLOv8 model in the stain detection task in the embodiment of the present invention;
[0038] Figure 5 is a diagram of a stain detection system based on geometric state mixed normalized Wasserstein distance according to an embodiment of the present invention. Detailed Implementation
[0039] The present invention will be further described in detail below with reference to the embodiments and accompanying drawings, but the embodiments of the present invention are not limited thereto.
[0040] As shown in Figure 1, the present invention provides a method for detecting color spots based on geometrically normalized Wasserstein distance, comprising:
[0041] S1. Obtain original human facial blemish image data. Perform stratified random sampling based on shooting angle, lighting conditions, skin texture characteristics, and blemish distribution density. Use the sampling results as the initial dataset and divide them into training set and test set.
[0042] Specifically, in this embodiment, original human facial blemish image data is acquired, and multi-dimensional stratification is performed based on the feature attributes of the original human facial blemish image data to obtain multiple stratified subsets. Samples within the same stratum have consistent feature attributes. The feature attributes include the shooting angle, lighting conditions, facial region, spatial distribution density of blemishes, image clarity, and skin color information of the original human facial blemish image data. The facial region includes the forehead, nose, and jaw. A random sampling strategy with a set ratio is used to divide the stratified subset samples into training and test sets, and the balance of the number of samples is controlled by a random number seed.
[0043] S2, randomly scales, crops, flips, translates, and adjusts the hue and brightness of the facial blemish images in the training and test sets to obtain the enhanced training and test sets.
[0044] S3. A spot detection network model is constructed based on YOLOv11. The spot detection network model includes a backbone network, a two-layer routing attention module, and a Neck multi-scale feature fusion module.
[0045] Specifically, to address the issues of large size variations in color spots leading to unstable Wasserstein distance (WD) values and hindering training convergence, as well as the tendency for absolute differences in bounding boxes to be amplified in color spot detection, causing model training to favor larger targets, this method proposes a normalized Wasserstein distance (NWD) loss function, which can be calculated using the following formula:
[0046] ;
[0047] Where C is a dataset-related constant, set as the average absolute size of the images in the dataset, and the loss function scales and exponentially maps WD through C.
[0048] Although NWD is insensitive to spots of different sizes, it can effectively mitigate the sensitivity of IoU to positional offsets in spot detection. However, this metric primarily relies on the center position and covariance of the bounding box and the ground truth box for matching, failing to adequately consider matching errors caused by geometric differences between targets (such as inconsistent geometric width and height). To improve spot detection accuracy, the method incorporates an aspect ratio regularization term into NWD. By calculating the aspect ratio error between bounding boxes A and B, their geometric shapes are kept consistent.
[0049] ;
[0050] ;
[0051] Meanwhile, in response to the problem that acne often presents a high-density distribution on the face, which easily leads to bounding box confusion, this paper calculates the mean square error between multiple candidate boxes and their corresponding ground truth boxes to dynamically adjust the normalization factor of the Wasserstein distance.
[0052] S4. The augmented training set is input into the freckle detection network model. After multi-scale features are extracted by the backbone network, the features of the hair-occluded area in the multi-scale features are extracted by the two-layer routing attention module. The multi-scale features and the features of the hair-occluded area are weighted and fused by the Neck multi-scale feature fusion module to obtain the fused features. A regression loss function is constructed based on the geometrically dynamically normalized Wasserstein distance. Forward and backward propagation are performed based on the regression loss function to obtain the trained freckle detection network model.
[0053] Specifically, the dual-layer routing attention module is obtained by replacing the parallel space attention convolution module in YOLOv11 with a dual-layer routing attention mechanism. This includes: extracting multi-scale features through the backbone network and performing pooling operations on the multi-scale features to obtain pooled features. The pooled features The input is fed into the CBS module for non-linear mapping to generate guiding features with global awareness. These guiding features are then segmented along the channels to obtain segmentation features. By segmentation features Enhanced features are obtained by performing feature enhancement on the partially occluded region. Next, the segmentation features Input to Each aggregation routing gate obtains aggregation features, which are then combined with enhanced features. Channel stitching is performed to obtain stitching features, which are then input into the second CBS module for calibration, ultimately yielding features of the area obscured by hair. It is used for feature fusion in the Neck fusion module.
[0054] Specifically, the regression loss function constructed based on the geometrically dynamically normalized Wasserstein distance is calculated as follows:
[0055] ;
[0056] in, Let A represent the Wasserstein distance function; let A represent the original given patch bounding box; and let B represent the predicted patch candidate box. and These represent the exponential forms of the Gaussian distributions of bounding boxes A and B, respectively. Indicates the learnable scaling factor; Represents the x-coordinate of bounding box A; Represents the ordinate of bounding box A; This indicates the width of bounding box A; Indicates the height of bounding box A; Represents the x-coordinate of bounding box B; Represents the ordinate of bounding box B; This indicates the width of bounding box B; This indicates the height of bounding box B; Indicates transpose; express Norm.
[0057] Specifically, the Neck module (Neck multi-scale feature fusion module) includes a second cross-stage partial connection unit, an upsampling unit, a downsampling unit, and a path aggregation unit. The second cross-stage partial connection unit performs preliminary fusion processing on the normalized facial freckle data features to obtain high-level features that enhance semantic expression; the upsampling unit performs spatial dimension alignment on the high-level features that enhance semantic expression, and improves feature resolution through nearest neighbor interpolation and transposed convolution to obtain aligned mid-level features; the downsampling unit performs spatial compression and channel enhancement on the aligned mid-level features, and obtains deep features that enhance global information through convolution and pooling operations; the path aggregation unit integrates mid-level features and deep features to aggregate deep and shallow features, and finally obtains the fused facial freckle data features.
[0058] S5 inputs the enhanced test set into the trained spot detection network model, constructs the GDNWD metric paradigm by combining Wasserstein distance, aspect ratio regularization term and dynamic normalization factor, and predicts and outputs spot detection results based on the GDNWD metric paradigm.
[0059] Specifically, in S5, the dynamic normalization factor The calculation formula is as follows:
[0060] ;
[0061] in, Indicates density-sensitive weights, This represents the number of neighboring candidate boxes around the target box predicted by the detection network. Given the center coordinates of the target bounding box, Indicates the number of the nearest neighbors of the target box The center coordinates of each candidate box; This represents the natural exponential function.
[0062] Specifically, dynamic normalization factor It is calculated from the mean square error between the center coordinates of the neighboring candidate boxes and the center coordinates of the corresponding real boxes, and a non-zero bias term is introduced to ensure that the denominator is always positive.
[0063] Specifically, the formula for calculating the metric paradigm of GDNWD is as follows:
[0064] ;
[0065] in, A metric paradigm for representing the geometrically mixed normalized Wasserstein distance; Represents the Wasserstein distance; This indicates the aspect ratio regularization term; An exponential measure of the Gaussian distribution of bounding box A; An exponential measure of the Gaussian distribution of bounding box B.
[0066] Specifically, in this embodiment, the input dataset of facial blemishes contains 1419 images, which are divided into training and testing sets in an 8:2 ratio. Training and testing are performed using these divided training and testing sets. Data augmentation processing is applied to the divided training and testing sets, including vertical flipping, random cropping, and saturation and exposure adjustments. The image resolution used in this invention is 640×640. Finally, preprocessed training and testing set images X are obtained. Next, based on the YOLOv11 model, a geometrically dynamically normalized Wasserstein distance (GDNWD) module is designed. Figure 2 shows the overall network structure of the blemish detection method based on geometrically dynamically normalized Wasserstein distance constructed in this embodiment. The preprocessed image X is passed sequentially through the Backbone network and the GDNWD module. The system includes a Neck network and a Head module. Specifically, it utilizes the backbone network in YOLOv11 to extract features from the augmented image X, obtaining three feature maps with different scales, representing features extracted from layers 5 (C3K2), 7 (C3K2), and 10 (SPPF), respectively. Next, as shown in Figure 3, a Geometric Dynamic Normalization (GDNWD) module is constructed. BRA first inputs the feature map output from the SPPF module into a CBS module containing convolution, batch normalization, and SilU activation functions, and then splits along the channels to obtain the features. and Subsequently, Input to Each aggregation routing gate block (RAGblock) is used, and the resulting features are compared with... Channel splicing is performed. The resulting spliced features are then processed by another CBS module to produce output features that are discriminative for occluded acne. Next, the normalized features are fused into the Neck network in YOLOv11 through a splicing operation. Features extracted from the cross-stage module (C3K2) with a kernel size of 2 in the Neck network are input into the three detection heads in YOLOv11, and the corresponding blemish detection results are finally output.
[0067] In this embodiment, the performance of the constructed model is verified. The entire model training process is iterated 200 times, with the initial learning rate set to 0.02. After training, the visualization results of the spot detection experiment are obtained.
[0068] Figure 4(a) is a schematic diagram of the spot detection results in the method of the present invention; Figure 4(b) is a schematic diagram of the spot detection results in the benchmark model YOLOv11; Figure 4(c) is a schematic diagram of the spot detection results in the comparative method YOLOv10; Figure 4(d) is a schematic diagram of the spot detection results in the comparative method YOLOv8. As can be seen from the detection results in Figures 4(a) to 4(d), the method of the present invention can detect and identify more spot targets compared with other models.
[0069] In summary, the blemish detection model constructed by this method effectively improves the recognition ability of small-sized targets in human facial blemish detection. Specifically, this method introduces an aspect ratio constraint term into the traditional Wasserstein distance framework to limit the geometric deformation of the predicted box during the regression process. Combined with a dynamic normalization mechanism, the normalization factor is adaptively adjusted based on the error between the candidate box and the ground truth box, thereby significantly improving the model's detection stability in high-density blemish regions. Simultaneously, this invention constructs an improved YOLOv11 blemish detection network that integrates a two-layer routing attention module and a multi-scale feature fusion structure. In this network, the two-layer routing attention module enhances the extraction of contextual information from occluded areas such as hair, while the multi-scale feature fusion structure achieves efficient fusion of multi-scale features, effectively improving the model's accuracy and robustness in blemish detection in complex skin scenes. This method is not only applicable to blemish detection tasks, but its proposed geometric dynamic normalization structure and feature fusion mechanism also provide a general normalization fusion design idea for small target detection in other images, demonstrating good potential for promotion and application.
[0070] As shown in Figure 5, this embodiment also discloses a stain detection system based on geometrically mixed normalized Wasserstein distance, including:
[0071] The dataset partitioning module 51 is used to acquire original human facial freckle image data. Based on the shooting angle, lighting conditions, skin texture characteristics and freckle distribution density, stratified random sampling is performed, and the sampling results are used as the initial dataset and divided into training set and test set.
[0072] The dataset augmentation module 52 is used to randomly scale, crop, flip, translate, and adjust the hue and brightness of facial freckle images in the training and test sets to obtain augmented training and test sets.
[0073] The network model construction module 53 is used to construct a spot detection network model based on YOLOv11. The spot detection network model includes a backbone network, a two-layer routing attention module, and a Neck multi-scale feature fusion module.
[0074] Training module 54 is used to input the augmented training set into the freckle detection network model. After the backbone network extracts multi-scale features, the dual-layer routing attention module extracts the features of the hair-occluded area in the multi-scale features. The Neck multi-scale feature fusion module performs weighted fusion of the multi-scale features and the features of the hair-occluded area to obtain the fused features. A regression loss function is constructed based on the geometrically dynamically normalized Wasserstein distance. Forward and backward propagation training is performed based on the regression loss function to obtain the trained freckle detection network model.
[0075] The detection module 55 is used to input the enhanced test set into the trained spot detection network model, construct the GDNWD metric paradigm by combining Wasserstein distance, aspect ratio regularization term and dynamic normalization factor, and predict and output spot detection results based on the GDNWD metric paradigm.
[0076] The specific implementation of the stain detection system based on geometric state mixture normalized Wasserstein distance is the same as the stain detection method based on geometric state mixture normalized Wasserstein distance, and will not be described again in this embodiment.
[0077] Although the invention has been specifically shown and described in conjunction with preferred embodiments, those skilled in the art should understand that various changes in form and detail may be made to the invention without departing from the spirit and scope of the invention as defined in the appended claims, all of which shall be within the scope of protection of the invention.
Claims
1. A method for detecting color spots based on geometrically mixed normalized Wasserstein distance, characterized in that, Includes the following steps: S1. Obtain original facial blemish image data. Perform stratified random sampling based on shooting angle, lighting conditions, skin texture characteristics, and blemish distribution density. Use the sampling results as the initial dataset and divide it into training and test sets. S2. Randomly scale, crop, flip, translate, and adjust the hue and brightness of the facial blemish images in the training and test sets to obtain enhanced training and test sets. S3. Construct a blemish detection network model based on YOLOv11. The blemish detection network model includes a backbone network, a two-layer routing attention module, and a Neck multi-scale feature fusion module. S4: Input the augmented training set into the freckle detection network model. After extracting multi-scale features through the backbone network, the features of the hair-occluded region are extracted through a two-layer routing attention module. The multi-scale features and the features of the hair-occluded region are weighted and fused through the Neck multi-scale feature fusion module to obtain the fused features. A regression loss function is constructed based on geometrically dynamically normalized Wasserstein distance. Forward and backpropagation training is performed based on the regression loss function to obtain the trained freckle detection network model. S5: Input the augmented test set into the trained freckle detection network model. A GDNWD metric paradigm is constructed using Wasserstein distance, aspect ratio regularization term, and dynamic normalization factor. The freckle detection results are predicted and output based on the GDNWD metric paradigm. Dynamic normalization factor... The calculation formula is as follows: ;in, Indicates density-sensitive weights, This represents the number of neighboring candidate boxes around the target box predicted by the detection network. Given the center coordinates of the target bounding box, Indicates the number of the nearest neighbors of the target box The center coordinates of each candidate box; The natural exponential function is represented; the formula for calculating the metric paradigm of GDNWD is as follows: ;in, A metric paradigm for representing the geometrically mixed normalized Wasserstein distance; Represents the Wasserstein distance; This indicates the aspect ratio regularization term; An exponential measure of the Gaussian distribution of bounding box A; An exponential measure of the Gaussian distribution of bounding box B.
2. The stain detection method based on geometrically mixed normalized Wasserstein distance according to claim 1, characterized in that, In S4, the dual-layer routing attention module is obtained by replacing the parallel spatial attention convolution module in YOLOv11 with a dual-layer routing attention mechanism. Specifically, it includes: extracting multi-scale features through the backbone network and performing pooling operations on the multi-scale features to obtain pooled features. The pooled features The input is fed into the CBS module for non-linear mapping to generate guiding features with global awareness. These guiding features are then segmented along the channels to obtain segmentation features. By segmentation features Enhanced features are obtained by performing feature enhancement on the partially occluded region. Next, the segmentation features Input to Each aggregation routing gate obtains aggregation features, which are then combined with enhanced features. Channel stitching is performed to obtain stitching features, which are then input into the second CBS module for calibration, ultimately yielding features of the area obscured by hair. It is used for feature fusion in the Neck fusion module.
3. The stain detection method based on geometrically mixed normalized Wasserstein distance according to claim 1, characterized in that, In S4, the regression loss function, constructed based on the geometrically dynamically normalized Wasserstein distance, is calculated as follows: ;in, Let A represent the Wasserstein distance function; let A represent the original given patch bounding box; and let B represent the predicted patch candidate box. and These represent the exponential forms of the Gaussian distributions of bounding boxes A and B, respectively. Indicates the learnable scaling factor; Represents the x-coordinate of bounding box A; Represents the ordinate of bounding box A; This indicates the width of bounding box A; Indicates the height of bounding box A; Represents the x-coordinate of bounding box B; Represents the ordinate of bounding box B; This indicates the width of bounding box B; This indicates the height of bounding box B; Indicates transpose; express Norm.
4. The stain detection method based on geometrically mixed normalized Wasserstein distance according to claim 1, characterized in that, Dynamic normalization factor It is calculated from the mean square error between the center coordinates of the neighboring candidate boxes and the center coordinates of the corresponding real boxes, and a non-zero bias term is introduced to ensure that the denominator is always positive.
5. A stain detection system based on geometrically hybrid normalized Wasserstein distance, characterized in that, include: The dataset partitioning module is used to acquire original human facial blemish image data. Based on the shooting angle, lighting conditions, skin texture characteristics and blemish distribution density, stratified random sampling is performed, and the sampling results are used as the initial dataset and divided into training set and test set. The dataset augmentation module is used to randomly scale, crop, flip, translate, and adjust the hue and brightness of human facial blemish images in the training and test sets to obtain augmented training and test sets; the network model construction module is used to build a blemish detection network model based on YOLOv11, which includes a backbone network, a two-layer routing attention module, and a Neck multi-scale feature fusion module. The training module receives the augmented training set as input to the freckle detection network model. After multi-scale feature extraction via the backbone network, a two-layer routing attention module extracts features from hair-occluded areas within the multi-scale features. A Neck multi-scale feature fusion module weights and fuses the multi-scale features and the hair-occluded area features to obtain fused features. A regression loss function is constructed based on geometrically dynamically normalized Wasserstein distance. Forward and backpropagation training is performed based on this regression loss function to obtain the trained freckle detection network model. The detection module receives the augmented test set as input to the trained freckle detection network model. A GDNWD metric paradigm is constructed by combining Wasserstein distance, aspect ratio regularization, and a dynamic normalization factor. Based on this GDNWD metric paradigm, the model predicts and outputs freckle detection results. The dynamic normalization factor... The calculation formula is as follows: ;in, Indicates density-sensitive weights, This represents the number of neighboring candidate boxes around the target box predicted by the detection network. Given the center coordinates of the target bounding box, Indicates the number of the nearest neighbors of the target box The center coordinates of each candidate box; The natural exponential function is represented; the formula for calculating the metric paradigm of GDNWD is as follows: ;in, A metric paradigm for representing the geometrically mixed normalized Wasserstein distance; Represents the Wasserstein distance; This indicates the aspect ratio regularization term; An exponential measure of the Gaussian distribution of bounding box A; An exponential measure of the Gaussian distribution of bounding box B.
Citation Information
Patent Citations
Melanoma skin disease detection method and system based on boundary guided Transform
CN116503330A
Pigmentation prediction method and apparatus, and device and storage medium
WO2022267327A1