Acne detection method and system based on agent dynamic hybrid normalization
The acne detection method, which combines stratified random sampling and data enhancement with a proxy dynamic hybrid normalization module, solves the normalization inadaptability problem of the YOLO series algorithms in acne detection, achieves accurate identification and positioning of acne, and improves detection accuracy and robustness.
Patent Information
- Application Number
- CN202510780518.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-06-12
Smart Images

Figure CN120298408B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method and system for detecting acne based on proxy dynamic hybrid normalization. Background Art
[0002] In recent years, with the rapid development of artificial intelligence in healthcare, computer vision-based dermatology diagnosis has become a research hotspot. Facial acne, a common skin problem, has become a crucial target for automated skin testing, skin health assessment, and personalized skin care regimens. However, because acne often manifests as small, unevenly distributed features with blurred edges and low contrast with skin tone in facial images, traditional object detection algorithms face numerous challenges in this task. The YOLO family of object detection algorithms, currently the leading choice, effectively recognizes objects in complex scenes by incorporating multi-scale feature fusion structures such as feature pyramid networks (FPNs), path aggregation FPNs, and multi-channel detection heads. However, these methods generally rely on fixed normalization strategies, particularly batch normalization (BN). Its reliance on global statistics makes the model susceptible to normalization bias when dealing with small objects or samples with highly non-uniform feature distributions, weakening its ability to represent local details. Meanwhile, instance normalization (IN), while advantageous in capturing local variations, often struggles to provide robust feature representation due to its lack of global awareness. Furthermore, in real-world detection tasks, the image acquisition environment, differences in facial regions, and the high diversity of acne morphology further exacerbate the uncertainty and inadaptability of normalization strategies. Therefore, there is an urgent need to develop a context-aware normalization mechanism that can dynamically balance instance and batch normalization to improve acne detection accuracy and robustness. Summary of the Invention
[0003] To solve the above problems, the present invention proposes an acne detection method and system based on proxy dynamic hybrid normalization. By adopting stratified random sampling to divide the data set and introducing a data enhancement strategy to improve sample diversity, a YOLOv11-based acne detection network model is constructed. Combined with the proxy dynamic hybrid normalization module, efficient extraction and normalization of facial acne image features are achieved, which improves the robustness and detection accuracy of the model under different lighting, angles and skin color conditions. Finally, through the multi-scale feature fusion and training optimization of the Neck module, accurate identification and positioning of acne targets are achieved.
[0004] The specific plan is as follows:
[0005] On the one hand, the acne detection method based on agent dynamic hybrid normalization includes:
[0006] S1, divides the facial acne dataset into training and test sets by stratified random sampling;
[0007] S2, perform data augmentation on the facial acne data in the training set and the test set to obtain the data-enhanced training set and test set;
[0008] S3, building an acne detection network model based on the YOLOv11 model, wherein the acne detection network model includes a backbone network, an agent dynamic hybrid normalization module, and a Neck module;
[0009] S4, inputting the facial acne data in the training set after data enhancement into the acne detection network model, the backbone network extracting features from the facial acne data in the training set to obtain facial acne data features in the training set, the proxy dynamic hybrid normalization module normalizing the facial acne data features to obtain normalized facial acne data features, the Neck module fusing the normalized facial acne data features to obtain fused facial acne data features, and performing forward propagation and backpropagation training on the fused facial acne data features based on the loss function to obtain a trained acne detection network model;
[0010] S5, inputting the facial acne data in the data-enhanced test set into the trained acne detection network model for target prediction to obtain the acne detection results.
[0011] Furthermore, the S1 specifically includes:
[0012] S11, obtaining original facial acne image data, performing multi-dimensional stratification based on characteristic attributes of the original facial acne image data, and obtaining multiple stratified subsets, wherein the characteristic attributes of samples in the same stratum are consistent; the characteristic attributes include shooting angle, lighting conditions, facial region, spatial distribution density of acne, image clarity, and skin color information of the original facial acne image data; the facial region includes the forehead, nose wings, and jaw;
[0013] S12, divide the stratified subset samples into training set and test set by setting the proportion of random sampling strategy, and control the balance of sample size by random number seed.
[0014] Furthermore, in S4, the backbone network includes an initial convolutional layer, a residual structure, and a first cross-stage partial connection unit;
[0015] The facial acne data images in the data-enhanced training set are extracted through the initial convolution layer. The extracted facial acne data features are enhanced through the residual structure to obtain enhanced facial acne data features. The enhanced facial acne data features are feature encoded through the first cross-stage partial connection unit to extract facial acne data features containing different semantic levels and spatial resolutions for characterizing the local differences and semantic information of acne in edges, textures and colors, and finally feature maps of different scales are obtained. .
[0016] Furthermore, in S4, the proxy dynamic hybrid normalization module includes a dual-branch weight network and a normalization calculation unit;
[0017] The dual-branch weight network is used to receive feature maps of different scales from the backbone network. , calculate feature maps of different scales through the proxy attention mechanism Based on the calculated feature correlation, the first dynamic weight is obtained by the instance normalization function, and the second dynamic weight is obtained by the batch normalization function. The calculation formulas for the first dynamic weight and the second dynamic weight are as follows:
[0018] ;
[0019] ;
[0020] in, represents the first dynamic weight; represents the second dynamic weight; IN represents the instance normalization function; BN represents the batch normalization function; represents the agent attention mechanism; represents the query matrix; represents the agent matrix; represents the bond matrix; represents the value matrix; The calculation formula is as follows:
[0021] ;
[0022] ;
[0023] in, is the first learnable bias matrix; is the second learnable bias matrix; * represents the convolution operation; Represents a depthwise convolution operation; Represents a pooling operation; Represents the learnable parameter matrix corresponding to the query matrix; The parameter matrix representing the learnable matrix corresponding to the key matrix; Represents the learnable parameter matrix corresponding to the value matrix.
[0024] The normalization calculation unit is used to calculate the first dynamic weight and the second dynamic weight Perform normalization processing to obtain normalized facial acne data features.
[0025] Furthermore, the normalization calculation unit is used to calculate the first dynamic weight and the second dynamic weight Perform normalization processing to obtain normalized facial acne data features, including:
[0026] Feature maps of different scales Perform convolution operations to obtain deep features , and then the deep features and the first state weight and the second dynamic weight Perform linear fusion to obtain normalized facial acne data features , the calculation formula is as follows:
[0027] ;
[0028] ;
[0029] ;
[0030] ;
[0031] ;
[0032] ;
[0033] in, Represents the convolution operation; Indicates the number of samples per input batch; Indicates the feature map height; Indicates the width of the feature map; , and Respectively represent the height index position, width index position and channel number index position of the feature map; and represents the mean and variance of batch normalization; and represents the mean and variance of instance normalization; represents the first affine parameter; represents the second affine parameter; Represents a constant.
[0034] Furthermore, in S4, the Neck module includes a second cross-stage partial connection unit, an upsampling unit, a downsampling unit, and a path aggregation unit;
[0035] In the second cross-stage partial connection unit, the normalized facial acne data features are preliminarily fused to obtain high-level features for enhanced semantic expression; the upsampling unit spatially aligns the high-level features for enhanced semantic expression, improves the feature resolution through nearest neighbor interpolation and transposed convolution, and obtains aligned middle-level features; the downsampling unit spatially compresses and channels the aligned middle-level features, and obtains deep-level features for enhanced global information through convolution and pooling operations; the path aggregation unit integrates the middle-level features with the deep features to aggregate the deep and shallow features to obtain the fused facial acne data features, and performs forward propagation and backpropagation training on the fused facial acne data features based on the loss function to update the network weights and obtain the trained acne detection network model.
[0036] On the other hand, the acne detection system based on agent dynamic hybrid normalization includes:
[0037] Stratified sampling module, used to divide the facial acne dataset into training set and test set through stratified random sampling;
[0038] The data enhancement module is used to perform data enhancement processing on the facial acne data in the training set and the test set to obtain the data-enhanced training set and test set;
[0039] A model building module, configured to build a pimple detection network model based on the YOLOv11 model, wherein the pimple detection network model includes a backbone network, an agent dynamic hybrid normalization module, and a Neck module;
[0040] A training module is used to input the facial acne data in the training set after data enhancement into the acne detection network model. The backbone network extracts features from the facial acne data in the training set to obtain facial acne data features in the training set. The proxy dynamic hybrid normalization module normalizes the facial acne data features to obtain normalized facial acne data features. The Neck module fuses the normalized facial acne data features to obtain fused facial acne data features. The fused facial acne data features are trained through forward propagation and backpropagation based on the loss function to obtain a trained acne detection network model.
[0041] The acne detection module is used to input the facial acne data in the data-enhanced test set into the trained acne detection network model for target prediction to obtain acne detection results.
[0042] The present invention adopts the above technical solution and has the following beneficial effects:
[0043] (1) The present invention optimizes facial acne data features by adopting a proxy-based dynamic hybrid normalization module, and combines the dynamic weighted fusion of instance normalization and batch normalization to enhance the model's ability to recognize acne in different scales, lighting conditions, and facial regions, thereby improving the accuracy and reliability of acne detection.
[0044] (2) The present invention divides the dataset into training and test sets by using a stratified random sampling strategy and performs data augmentation, enabling the model to learn a wider range of feature representations under diverse sample conditions. At the same time, the residual structure and cross-stage partial connection units in the backbone network help maintain the continuity and integrity of the information flow, further enhancing the model's performance when facing complex skin conditions.
[0045] (3) The present invention integrates multiple mechanisms such as upsampling, downsampling, and path aggregation through the Neck module, realizing the effective aggregation of deep and shallow features. It not only enhances the spatial expression ability and semantic consistency of features, but also can adapt to the detection needs of acne targets of different sizes and distribution densities, thereby improving the detection efficiency and performance of the overall system. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 This is a flow chart of an acne detection method based on agent dynamic hybrid normalization according to an embodiment of the present invention;
[0047] Figure 2 This is a diagram of the overall network structure of the acne detection method based on agent dynamic hybrid normalization according to an embodiment of the present invention;
[0048] Figure 3 This is a schematic diagram of the structure of a proxy dynamic hybrid normalization module according to an embodiment of the present invention;
[0049] FIG4 (a) is a diagram of acne detection results based on proxy dynamic hybrid normalization according to an embodiment of the present invention;
[0050] FIG4( b ) is a schematic diagram of acne detection results in the benchmark model YOLOv11 according to an embodiment of the present invention;
[0051] FIG4( c ) is a schematic diagram of acne detection results in the benchmark model YOLOv10 according to an embodiment of the present invention;
[0052] FIG4( d ) is a schematic diagram of acne detection results in the benchmark model YOLOv8 according to an embodiment of the present invention;
[0053] Figure 5 FIG. 4 is a diagram of an acne detection system based on agent dynamic hybrid normalization according to an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The present invention will be described in further detail below with reference to the embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0055] like Figure 1 As shown, the acne detection method based on agent dynamic hybrid normalization of the present invention includes:
[0056] S1, the facial acne dataset is divided into training set and test set by stratified random sampling.
[0057] Specifically, the S1 includes:
[0058] S11, obtaining original facial acne image data, performing multi-dimensional stratification based on characteristic attributes of the original facial acne image data, and obtaining multiple stratified subsets, wherein the characteristic attributes of samples in the same stratum are consistent; the characteristic attributes include shooting angle, lighting conditions, facial region, spatial distribution density of acne, image clarity, and skin color information of the original facial acne image data; the facial region includes the forehead, nose wings, and jaw;
[0059] S12, divide the stratified subset samples into training set and test set by setting the proportion of random sampling strategy, and control the balance of sample size by random number seed.
[0060] S2, perform data augmentation on the facial acne data in the training set and the test set to obtain the data-enhanced training set and test set.
[0061] S3, based on the YOLOv11 model, construct an acne detection network model based on agent dynamic hybrid normalization, wherein the acne detection network model includes a backbone network, an agent dynamic hybrid normalization module and a Neck module.
[0062] S4, input the facial acne data in the training set after data enhancement into the acne detection network model, the backbone network extracts features of the facial acne data in the training set to obtain the facial acne data features in the training set, the agent dynamic hybrid normalization module normalizes the facial acne data features to obtain normalized facial acne data features, the Neck module fuses the normalized facial acne data features to obtain fused facial acne data features, and the fused facial acne data features are trained by forward propagation and backpropagation based on the loss function to obtain the trained acne detection network model.
[0063] Specifically, the backbone network includes an initial convolutional layer, a residual structure, and a first cross-stage partial connection unit;
[0064] The facial acne data images in the data-enhanced training set are extracted through the initial convolution layer. The extracted facial acne data features are enhanced through the residual structure to obtain enhanced facial acne data features. The enhanced facial acne data features are feature encoded through the first cross-stage partial connection unit to extract facial acne data features containing different semantic levels and spatial resolutions for characterizing the local differences and semantic information of acne in edges, textures and colors, and finally feature maps of different scales are obtained. .
[0065] Specifically, the proxy dynamic hybrid normalization module includes a dual-branch weight network and a normalization calculation unit;
[0066] The dual-branch weight network is used to receive feature maps of different scales from the backbone network. , calculate feature maps of different scales through the proxy attention mechanism Based on the calculated feature correlation, the first dynamic weight is obtained by the instance normalization function, and the second dynamic weight is obtained by the batch normalization function. The calculation formulas for the first dynamic weight and the second dynamic weight are as follows:
[0067] ;
[0068] ;
[0069] in, represents the first dynamic weight; represents the second dynamic weight; IN represents the instance normalization function; BN represents the batch normalization function; represents the agent attention mechanism; represents the query matrix; represents the agent matrix; represents the bond matrix; represents the value matrix; The calculation formula is as follows:
[0070] ;
[0071] ;
[0072] in, is the first learnable bias matrix; is the second learnable bias matrix; * represents the convolution operation; Represents a depthwise convolution operation; Represents a pooling operation; Represents the learnable parameter matrix corresponding to the query matrix; The parameter matrix representing the learnable matrix corresponding to the key matrix; Represents the learnable parameter matrix corresponding to the value matrix.
[0073] The normalization calculation unit is used to calculate the first dynamic weight and the second dynamic weight Perform normalization processing to obtain normalized facial acne data features.
[0074] Specifically, the normalization calculation unit is used to calculate the first dynamic weight and the second dynamic weight Perform normalization processing to obtain normalized facial acne data features, including:
[0075] Feature maps of different scales Perform convolution operations to obtain deep features , and then the deep features and the first state weight and the second dynamic weight Perform linear fusion to obtain normalized facial acne data features , the calculation formula is as follows:
[0076] ;
[0077] ;
[0078] ;
[0079] ;
[0080] ;
[0081] ;
[0082] in, Represents the convolution operation; Indicates the number of samples per input batch; Indicates the feature map height; Indicates the width of the feature map; , and Indicates the height index position, width index position and channel number index position of the feature map; and represents the mean and variance of batch normalization; and represents the mean and variance of instance normalization; represents the first affine parameter; represents the second affine parameter; Represents a constant.
[0083] Specifically, the Neck module includes a second cross-stage partial connection unit, an upsampling unit, a downsampling unit, and a path aggregation unit;
[0084] In the second cross-stage partial connection unit, the normalized facial acne data features are preliminarily fused to obtain high-level features for enhanced semantic expression; the upsampling unit spatially aligns the high-level features for enhanced semantic expression, improves the feature resolution through nearest neighbor interpolation and transposed convolution, and obtains aligned middle-level features; the downsampling unit spatially compresses and channels the aligned middle-level features, and obtains deep-level features for enhanced global information through convolution and pooling operations; the path aggregation unit integrates the middle-level features with the deep features to aggregate the deep and shallow features to obtain the fused facial acne data features, and performs forward propagation and backpropagation training on the fused facial acne data features based on the loss function to update the network weights and obtain the trained acne detection network model.
[0085] S5, inputting the facial acne data in the data-enhanced test set into the trained acne detection network model for target prediction to obtain the acne detection results.
[0086] Specifically, in this embodiment, the input is the public facial acne dataset Acne04, which contains 1419 images and is divided into a training set and a test set in an 8:2 ratio. The divided training set and test set are used for training and testing. Data augmentation processing is performed on the divided training set and test set, including vertical flipping, random cropping, and saturation and exposure adjustment. The image resolution used in this invention is 640×640. Finally, the pre-processed training set and test set images X are obtained. Then, based on the YOLOv11 model, the agent dynamic hybrid normalization (ADHN) module is designed, as shown in the following figure. Figure 2 The figure shows the overall network structure of the acne detection method based on proxy dynamic hybrid normalization constructed in this embodiment. The preprocessed image X passes through the Backbone network, ADHN module, Neck network, and Head module in sequence. Specifically, the backbone network (Backbone) in YOLOv11 is used to extract features from the data-enhanced image X, obtaining three feature maps with different scales, which represent the features extracted from the 5th layer (C3K2), the 7th layer (C3K2), and the 10th layer (SPPF). Then, as shown in FIG. Figure 3 As shown in the figure, the agent hybrid normalization (ADHN) module is constructed, including a dual-branch weight network and a normalization calculation unit; the dual-branch weight network is specifically as follows: first, the input feature Perform a two-branch operation, respectively through the learnable query parameter matrix ( ), key parameter matrix ( ), value parameter matrix ( ) to obtain their respective query matrices (Q), key matrices (K) and value matrices (V), and then perform a pooling operation on the query matrix (Q) to obtain a small set of proxy tokens (A); then, by using the proxy token (A) as the query (query), the key matrix (K) and the value matrix (V) as key-value pairs, a Softmax attention operation is performed to obtain the proxy matrix ( ); Second, using the query matrix (Q) as the query and the proxy token (A) as the key, As the value, perform the second Softmax attention operation and add the position bias matrix to it; finally, perform a deep convolution operation on the value matrix (V) after the output, and pass the features obtained by the dual-branch network through the instance normalization function f(IN) and the batch normalization function f(BN) to obtain dynamic weights and The normalization calculation unit is as follows: Perform convolution processing to obtain deep features , and then the deep features With weight and Perform linear fusion to obtain normalized facial acne data features ; Then, the normalized features are fused into the neck network (Neck) in YOLOv11 through the concatenation operation. The features extracted from the cross-stage module (C3K2) with a kernel size of 2 in the neck network part are input into the three detection heads (Head) in YOLOv11 respectively, and finally the corresponding acne detection results are output.
[0087] In this embodiment, the performance of the constructed model is verified. The entire model training process is iterated 200 times, and the initial learning rate is set to 0.02. After training, the visualization results of the acne detection experiment are obtained.
[0088] Figure 4(a) is a schematic diagram of the acne detection results in the method of the present invention; Figure 4(b) is a schematic diagram of the acne detection results in the baseline model YOLOv11; Figure 4(c) is a schematic diagram of the acne detection results in the comparison method YOLOv10; Figure 4(d) is a schematic diagram of the acne detection results in the comparison method YOLOv8. Figures 4(a) to 4(d) As can be seen from the detection result diagram, the method of the present invention can detect and identify more acne targets compared with other models.
[0089] In summary, the acne detection model constructed by this method can improve the recognition of small objects in facial acne detection. Building on the existing YOLOv11 object detection model, the proposed method introduces a proxy dynamic hybrid normalization module (ADHN) to address the fusion and adaptability issues between instance normalization and batch normalization. First, the image input passes through a backbone network to extract multi-scale feature maps. Subsequently, a two-branch weighted network constructed using a proxy attention mechanism extracts statistical features (mean and variance) from both instance normalization and batch normalization, respectively. These features are linearly fused through adaptive weight dynamics to generate a more discriminative combined normalized feature map. This feature fusion process further aggregates multi-scale information by combining the PAFPN architecture in the neck, thereby enhancing the model's response to features from different distribution regions. Finally, the fused feature map is fed into the head detection head for object classification and regression prediction, achieving the final detection result. Experimental results on the public dataset Acne04 demonstrate that the proposed method achieves superior detection accuracy for acne objects, especially those in low-density and small target areas, effectively addressing the issues of false detection and missed detection associated with traditional methods. This method is not only applicable to acne detection tasks, but also provides a general normalization fusion design idea for other small target detection, and has good promotion value.
[0090] like Figure 5 As shown, this embodiment also discloses an acne detection system based on agent dynamic hybrid normalization, including:
[0091] a stratified sampling module 51, configured to divide the facial acne dataset into a training set and a test set by stratified random sampling;
[0092] A data enhancement module 52 is used to perform data enhancement processing on the facial acne data in the training set and the test set to obtain the data-enhanced training set and test set;
[0093] A model building module 53 is used to build an acne detection network model based on the YOLOv11 model, wherein the acne detection network model includes a backbone network, an agent dynamic hybrid normalization module, and a Neck module;
[0094] A training module 54 is configured to input the facial acne data in the training set after data enhancement into the acne detection network model, the backbone network performing feature extraction on the facial acne data in the training set to obtain facial acne data features in the training set, the proxy dynamic hybrid normalization module performing normalization on the facial acne data features to obtain normalized facial acne data features, the Neck module performing fusion on the normalized facial acne data features to obtain fused facial acne data features, and performing forward propagation and backpropagation training on the fused facial acne data features based on a loss function to obtain a trained acne detection network model;
[0095] The acne detection module 55 is used to input the facial acne data in the test set after data enhancement into the trained acne detection network model for target prediction to obtain acne detection results.
[0096] The specific implementation of the acne detection system based on proxy dynamic hybrid normalization is the same as the acne detection method based on proxy dynamic hybrid normalization, and will not be repeated in this embodiment.
[0097] Although the present invention has been particularly shown and described in conjunction with preferred embodiments, it will be understood by those skilled in the art that various changes in form and details may be made to the present invention without departing from the spirit and scope of the invention as defined in the appended claims, and all such changes are within the scope of protection of the present invention.
Claims
1. A method for acne detection based on agent dynamic hybrid normalization, characterized in that: include: S1, divides the facial acne dataset into training and test sets by stratified random sampling; S2, perform data augmentation on the facial acne data in the training set and the test set to obtain the data-enhanced training set and test set; S3, building an acne detection network model based on the YOLOv11 model, wherein the acne detection network model includes a backbone network, an agent dynamic hybrid normalization module, and a Neck module; S4, inputting the facial acne data in the training set after data enhancement into the acne detection network model, the backbone network extracting features from the facial acne data in the training set to obtain facial acne data features in the training set, the proxy dynamic hybrid normalization module normalizing the facial acne data features to obtain normalized facial acne data features, the Neck module fusing the normalized facial acne data features to obtain fused facial acne data features, and performing forward propagation and backpropagation training on the fused facial acne data features based on the loss function to obtain a trained acne detection network model; The backbone network includes an initial convolutional layer, a residual structure, and a first cross-stage partial connection unit; The facial acne data images in the training set after data enhancement are extracted through the initial convolution layer. The extracted facial acne data features are enhanced through the residual structure to obtain enhanced facial acne data features. The enhanced facial acne data features are feature encoded through the first cross-stage partial connection unit to extract facial acne data features containing different semantic levels and spatial resolutions for characterizing the local differences and semantic information of acne in edges, textures and colors. Finally, feature maps P of different scales are obtained. k ; The proxy dynamic hybrid normalization module includes a dual-branch weight network and a normalization calculation unit; The dual-branch weight network is used to receive feature maps P of different scales from the backbone network. k , calculate the feature maps P of different scales through the proxy attention mechanism k Based on the calculated feature correlation, the first dynamic weight is obtained by the instance normalization function, and the second dynamic weight W2 is obtained by the batch normalization function. The calculation formulas of the first dynamic weight and the second dynamic weight are as follows: W1=IN[Attention(Q,A,K,V,P k )]; W2=BN[Attention(Q,A,K,V,P k )]; Where W1 represents the first dynamic weight; W2 represents the second dynamic weight; IN represents the instance normalization function; BN represents the batch normalization function; Attention (Q, A, K, V, P k ) represents the agent attention mechanism; Q represents the query matrix; A represents the agent matrix; K represents the key matrix; V represents the value matrix; Attention(Q,A,K,V,P k ) is calculated as follows: <h2 style=";text-align:left;direction:ltr">Attention(Q,A,K,V,P<h2 style=";text-align:left;direction:ltr"> k <h2 style=";text-align:left;direction:ltr"> )=Softmax(QA<h2 style=";text-align:left;direction:ltr"> T <h2 style=";text-align:left;direction:ltr"> +B2)Softmax(AK<h2 style=";text-align:left;direction:ltr"> T <h2 style=";text-align:left;direction:ltr"> +B1)V+DWC(V); Q=P k *W Q ;K=P k *W K ;V=P k *W V ;A=pooling(Q); Where B1 is the first learnable bias matrix; B2 is the second learnable bias matrix; * represents the convolution operation; DWC(·) represents the depthwise convolution operation; pooling(·) represents the pooling operation; W Q W represents the learnable parameter matrix corresponding to the query matrix; K W represents the parameter matrix of the learnable matrix corresponding to the key matrix; V Represents the learnable parameter matrix corresponding to the value matrix; The normalization calculation unit is used to perform normalization processing on the first dynamic weight W1 and the second dynamic weight W2 to obtain normalized facial acne data features; S5, inputting the facial acne data in the data-enhanced test set into the trained acne detection network model for target prediction to obtain the acne detection results.
2. The acne detection method based on proxy dynamic hybrid normalization according to claim 1, characterized in that: Said S1 specifically includes: S11, obtaining original facial acne image data, performing multi-dimensional stratification based on characteristic attributes of the original facial acne image data, and obtaining multiple stratified subsets, wherein the characteristic attributes of samples in the same stratum are consistent; the characteristic attributes include shooting angle, lighting conditions, facial region, spatial distribution density of acne, image clarity, and skin color information of the original facial acne image data; the facial region includes the forehead, nose wings, and jaw; S12, divide the stratified subset samples into training set and test set by setting the proportion of random sampling strategy, and control the balance of sample size by random number seed.
3. The acne detection method based on proxy dynamic hybrid normalization according to claim 1, characterized in that: The normalization calculation unit is used to perform normalization processing on the first dynamic weight W1 and the second dynamic weight W2 to obtain normalized facial acne data features, specifically including: The feature maps P of different scales k Perform convolution operations to obtain deep features Then the deep feature x[i,j,n] is linearly fused with the first dynamic weight W1 and the second dynamic weight W2 to obtain the normalized facial acne data feature The calculation formula is as follows: X[i,j,n]=Conv(P k ); Where Conv(·) represents the convolution operation; N represents the number of samples per input batch; H represents the height of the feature map; W represents the width of the feature map; i, j, and n represent the height index position, width index position, and channel number index position of the feature map, respectively; μ bn and σ bn represents the mean and variance of batch normalization; μ in and σ in represents the mean and variance of instance normalization; δ represents the first affine parameter; θ represents the second affine parameter; ε represents a constant.
4. The acne detection method based on proxy dynamic hybrid normalization according to claim 1, characterized in that: In S3, the Neck module includes the second cross-stage partial connection unit, the upsampling unit, the downsampling unit, and the path aggregation unit; The second cross-stage partial connection unit performs preliminary fusion processing on the normalized facial acne data features to obtain high-level features that enhance semantic expression; The upsampling unit aligns the spatial dimensions of high-level features that enhance semantic expression, improves feature resolution through nearest neighbor interpolation and transposed convolution, and obtains aligned mid-level features. The downsampling unit performs spatial compression and channel enhancement on the aligned middle-level features, and obtains deep features that enhance global information through convolution and pooling operations; The path aggregation unit integrates the middle-level features with the deep-level features to aggregate the deep-level and shallow-level features to obtain the fused facial acne data features. The fused facial acne data features are trained by forward propagation and backpropagation based on the loss function to update the network weights and obtain the trained acne detection network model.
5. A acne detection system based on agent dynamic hybrid normalization, characterized in that: include: Stratified sampling module, used to divide the facial acne dataset into training set and test set through stratified random sampling; The data enhancement module is used to perform data enhancement processing on the facial acne data in the training set and the test set to obtain the data-enhanced training set and test set; A model building module, configured to build a pimple detection network model based on the YOLOv11 model, wherein the pimple detection network model includes a backbone network, an agent dynamic hybrid normalization module, and a Neck module; A training module is used to input the facial acne data in the training set after data enhancement into the acne detection network model. The backbone network extracts features from the facial acne data in the training set to obtain facial acne data features in the training set. The proxy dynamic hybrid normalization module normalizes the facial acne data features to obtain normalized facial acne data features. The Neck module fuses the normalized facial acne data features to obtain fused facial acne data features. The fused facial acne data features are trained through forward propagation and backpropagation based on the loss function to obtain a trained acne detection network model. The backbone network includes an initial convolutional layer, a residual structure, and a first cross-stage partial connection unit; The facial acne data images in the training set after data enhancement are extracted through the initial convolution layer. The extracted facial acne data features are enhanced through the residual structure to obtain enhanced facial acne data features. The enhanced facial acne data features are feature encoded through the first cross-stage partial connection unit to extract facial acne data features containing different semantic levels and spatial resolutions for characterizing the local differences and semantic information of acne in edges, textures and colors. Finally, feature maps P of different scales are obtained. k ; The proxy dynamic hybrid normalization module includes a dual-branch weight network and a normalization calculation unit; The dual-branch weight network is used to receive feature maps P of different scales from the backbone network. k , calculate the feature maps P of different scales through the proxy attention mechanism k Based on the calculated feature correlation, the first dynamic weight is obtained by the instance normalization function, and the second dynamic weight W2 is obtained by the batch normalization function. The calculation formulas of the first dynamic weight and the second dynamic weight are as follows: W1=IN[Attention(Q,A,K,V,P k )]; W2=BN[Attention(Q,A,K,V,P k )]; Where W1 represents the first dynamic weight; W2 represents the second dynamic weight; IN represents the instance normalization function; BN represents the batch normalization function; Attention (Q, A, K, V, P k ) represents the agent attention mechanism; Q represents the query matrix; A represents the agent matrix; K represents the key matrix; V represents the value matrix; Attention(Q,A,K,V,P k ) is calculated as follows: <h2 style=";text-align:left;direction:ltr">Attention(Q,A,K,V,P<h2 style=";text-align:left;direction:ltr"> k <h2 style=";text-align:left;direction:ltr"> )=Softmax(QA<h2 style=";text-align:left;direction:ltr"> T <h2 style=";text-align:left;direction:ltr"> +B2)Softmax(AK<h2 style=";text-align:left;direction:ltr"> T <h2 style=";text-align:left;direction:ltr"> +B1)V+DWC(V); Q=P k *W Q ;K=P k *W K ;V=P k *W V ;A=pooling(Q); Where B1 is the first learnable bias matrix; B2 is the second learnable bias matrix; * represents the convolution operation; DWC(·) represents the depthwise convolution operation; pooling(·) represents the pooling operation; W Q W represents the learnable parameter matrix corresponding to the query matrix; K W represents the parameter matrix of the learnable matrix corresponding to the key matrix; V Represents the learnable parameter matrix corresponding to the value matrix; The normalization calculation unit is used to perform normalization processing on the first dynamic weight W1 and the second dynamic weight W2 to obtain normalized facial acne data features; The acne detection module is used to input the facial acne data in the data-enhanced test set into the trained acne detection network model for target prediction to obtain acne detection results.
Citation Information
Patent Citations
Image method and system for detecting acne quantity
CN106780456A
Efficient skin disease segmentation method based on multi-scale and mixed attention mechanism
CN119228824A