A hairline detection method based on multi-scale feature fusion

By using the HairlineSegNet network with multi-scale feature fusion, combined with image acquisition and dual verification mechanisms, the problems of low efficiency, poor robustness and insufficient individual adaptability of existing hairline detection methods are solved, and high-precision and high-reliability hairline detection is achieved.

CN121582985BActive Publication Date: 2026-04-03SHANGHAI BAYES HEALTH TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-29
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing hairline detection methods rely on manual observation, which is inefficient and highly subjective. Traditional image processing techniques lack robustness, and deep learning methods lack specificity and verification mechanisms, making it difficult to achieve accurate hairline detection and classification.

Method used

The HairlineSegNet network, which employs multi-scale feature fusion, combines image acquisition, preprocessing, data augmentation, multi-scale feature fusion modules, and a dual verification mechanism. It achieves accurate localization and classification through a hairline perception enhancement module and a Transformer decoder.

Benefits of technology

It achieved a 35% improvement in hairline detection accuracy and a classification accuracy rate of 94.2%, maintaining high reliability and real-time performance in complex scenarios, adapting to individual differences, and meeting real-time detection needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121582985B_ABST
    Figure CN121582985B_ABST
Patent Text Reader

Abstract

This invention discloses a hairline detection method based on multi-scale feature fusion, belonging to the field of hairline detection technology. It includes: Step 1, building a multi-angle face image acquisition platform comprising an image acquisition module, a face detection module, and a quality assessment module to acquire high-quality face image data including the hairline region; Step 2, preprocessing the acquired face image data and performing hairline-aware data enhancement; Step 3, constructing a hairline detection network model based on HairlineSegNet, wherein the network model includes an improved ConvNext-B encoder with four feature extraction stages as the backbone network. This invention, by setting up a dedicated HairlineSegNet network optimized for hairline detection tasks and integrating a hairline-aware enhancement module and a multi-scale feature fusion module, achieves accurate capture of fine-grained hairline features, solving the problems of general segmentation networks lacking specialized optimization and single-scale feature extraction failing to consider both global and local details.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of hairline detection technology, specifically a hairline detection method based on multi-scale feature fusion. Background Technology

[0002] Currently, hairline detection mainly relies on manual observation and traditional image processing techniques, with some attempts based on deep learning. However, all these methods have significant drawbacks: manual detection is inefficient, highly subjective, and difficult to quantify, failing to meet the needs of large-scale applications; traditional image processing techniques rely on edge detection and template matching, which are prone to false positives and false negatives when faced with problems such as blurred and discontinuous hairline boundaries and large differences in individual hairline shapes. Furthermore, they lack robustness under complex lighting conditions and are difficult to adapt to diverse scenarios; existing deep learning methods mostly use general segmentation networks, lacking specific optimization for the hairline region, failing to effectively capture fine-grained features of the hairline, and single-scale feature extraction struggles to balance global context and local details. Additionally, the lack of targeted verification mechanisms leads to insufficient reliability and accuracy of detection results, and the absence of a standardized classification and evaluation system makes it difficult to achieve objective and accurate hairline type determination. Therefore, this paper proposes a hairline detection method based on multi-scale feature fusion to address these issues. Summary of the Invention

[0003] Technical problems to be solved

[0004] To address the shortcomings of existing technologies, this invention provides a hairline detection method based on multi-scale feature fusion, which solves the problems mentioned in the background section.

[0005] Technical solution

[0006] To achieve the above objectives, the present invention provides the following technical solution: a hairline detection method based on multi-scale feature fusion, comprising the following steps:

[0007] Step 1: Build a multi-angle face image acquisition platform that includes an image acquisition module, a face detection module, and a quality assessment module to obtain high-quality face image data including the hairline area;

[0008] Step 2: Preprocess the collected facial image data and perform data augmentation processing based on hairline perception;

[0009] Step 3: Construct a hairline detection network model based on HairlineSegNet. The network model includes an improved ConvNext-B encoder with four feature extraction stages as the backbone network, an integrated hairline perception enhancement module, a multi-scale feature fusion module, and a hairline-specific Transformer decoder designed with standard segmentation query tokens and hairline-specific query tokens.

[0010] Step 4: Use a dual verification mechanism to accurately locate the hairline;

[0011] Step 5: Implement intelligent classification of hairline type based on hairline assessment value. Calculate hairline assessment value based on key facial distance relationships, adjust classification threshold using a personalized threshold prediction network, and output hairline location, type, and confidence assessment results.

[0012] Preferably, the specific steps for building a multi-angle face image acquisition platform including an image acquisition module, a face detection module, and a quality assessment module are as follows:

[0013] It uses a high-definition camera as the image acquisition module, supports multi-angle shooting, automatic focus and exposure adjustment, and is equipped with a fill light device to ensure uniform lighting;

[0014] The MTCNN algorithm is used as the face detection module to locate the facial region and identify the location of key facial points, ensuring that the hairline area is visible;

[0015] The quality assessment module automatically filters images that meet the standards, sets acceptance criteria for facial integrity, hairline visibility, lighting uniformity, and image clarity, and limits the range of pose angles.

[0016] Preferably, the specific steps for preprocessing the collected facial image data and performing hairline-sensing data augmentation are as follows:

[0017] Data cleaning is performed on the original images to remove blurry, occluded, or unclear hairline images, while retaining high-quality and valid samples.

[0018] The collected image data is automatically labeled using Segment Anything Model (SAM) and LabelMe software to generate preliminary hairline area labeling results;

[0019] The automatic annotation results are manually corrected to ensure the accuracy and completeness of the annotations, and finally a high-quality labeled dataset is generated for training.

[0020] The original image is subjected to size normalization, illumination equalization and noise reduction; the forehead area is enhanced in contrast and the hairline boundary is sharpened.

[0021] Diverse training samples are generated through geometric transformations; diverse training samples are also generated through color perturbations.

[0022] Preferably, the specific steps of using the improved ConvNext-B encoder with four feature extraction stages as the backbone network are as follows:

[0023] The first feature extraction stage is set up to output features of specific dimensions and sizes to capture fine-grained textures;

[0024] A second feature extraction stage is set up to output features of specific dimensions and sizes for extracting local patterns.

[0025] A third feature extraction stage is set up to output features of specific dimensions and sizes for obtaining intermediate semantics;

[0026] A fourth feature extraction stage is set up to output features of specific dimensions and sizes to provide global context.

[0027] Preferably, the specific steps of the integrated hairline sensing enhancement module are as follows:

[0028] Enhance the feature representation of hairline-related areas through spatial attention mechanisms;

[0029] By fusing the feature responses extracted by convolution, weights based on image region location, and channel attention weights, higher weights are assigned to the hairline-related regions in the upper half of the image.

[0030] Preferably, the specific steps for constructing the multi-scale feature fusion module are as follows:

[0031] The feature alignment function unifies four feature maps of different scales to the same preset dimension.

[0032] Channel stitching is performed on the aligned feature maps;

[0033] The concatenated feature maps are then subjected to convolution processing.

[0034] The convolutional feature map is processed by a channel attention mechanism to obtain a fused feature map.

[0035] Preferably, the specific steps for designing a hairline-specific Transformer decoder containing a standard segmentation query token and a hairline-specific query token are as follows:

[0036] Configure multiple query tokens, some of which are standard segmentation query tokens used for segmentation of regions such as background, face, and hair;

[0037] Some are dedicated query tokens for hairline detection, specifically used for hairline boundary detection;

[0038] Effective fusion of multi-scale features is achieved through a multi-head self-attention mechanism;

[0039] The decoder outputs both the segmentation result and the hairline boundary map, providing dual detection information.

[0040] Preferably, the specific steps for accurately locating the hairline using the dual verification mechanism are as follows:

[0041] The main verification path is initiated, and the position of the center of the eyebrows is obtained using facial key point detection technology. The hairline boundary is searched within a preset range above the center of the eyebrows, and the final hairline position is determined by combining the network segmentation results.

[0042] When keypoint detection fails or the confidence level is too low, an alternative verification path is initiated. The hairline is located based on the highest boundary of the face segmentation results. Morphological processing is applied to remove noise and outliers, and connected component analysis is used to ensure the continuity of the hairline.

[0043] Geometric rationality verification is performed, the smoothness of the hairline curve is ensured through continuity testing, the rationality of the hairline position is verified through anatomical constraints, and the degree of symmetry between the left and right hairlines is assessed through symmetry checks.

[0044] Preferably, the specific steps for calculating the hairline assessment value based on key facial distance relationships are as follows:

[0045] The coordinates of the center of the eyebrows are located using facial key point detection technology;

[0046] The upper and lower boundary coordinates of the face are located using facial key point detection technology.

[0047] Calculate the vertical distance from the center of the eyebrows to the hairline boundary;

[0048] Calculate the vertical distance from the upper boundary to the lower boundary of the face;

[0049] The hairline assessment value is calculated based on the proportional relationship between the two distances mentioned above.

[0050] Preferably, the specific steps for adjusting the classification threshold using a personalized threshold prediction network are as follows:

[0051] Construct a personalized threshold prediction network by inputting key facial feature parameters of an individual;

[0052] The threshold adjustment amount is output through network inference;

[0053] Calculate the adaptive threshold based on the default threshold and the adjustment amount;

[0054] Ensure that the adaptive threshold falls within a preset reasonable range; if the calculation result exceeds this range, it will be automatically truncated to the corresponding boundary value.

[0055] Beneficial effects

[0056] The present invention has the following beneficial effects:

[0057] (1) This hairline detection method based on multi-scale feature fusion sets up a dedicated HairlineSegNet network optimized for hairline detection tasks, integrates a hairline perception enhancement module and a multi-scale feature fusion module, and achieves accurate capture of fine-grained features of the hairline. It solves the problems of lack of dedicated optimization in general segmentation networks and the inability of single-scale feature extraction to take into account both global and local details.

[0058] (2) This hairline detection method based on multi-scale feature fusion achieves a 35% improvement in detection accuracy and a classification accuracy of 94.2% compared to traditional methods through the synergistic effect of the HairlineSegNet dedicated network and various modules. It solves the problems of insufficient detection accuracy and false detection or missed detection at the boundary of traditional methods and existing deep learning methods.

[0059] (3) This hairline detection method based on multi-scale feature fusion achieves high reliability of hairline positioning results by setting up a dual verification mechanism that combines key point detection and segmentation results, and solves the problems of existing detection methods lacking a targeted verification mechanism and unstable detection results in complex scenarios.

[0060] (4) This hairline detection method based on multi-scale feature fusion achieves adaptation to individual facial feature differences by setting an adaptive threshold adjustment mechanism, providing more accurate classification results and solving the problem that fixed classification standards are difficult to adapt to individual differences and the classification accuracy is limited.

[0061] (5) This hairline detection method based on multi-scale feature fusion achieves real-time detection effect of 30FPS by optimizing the network architecture design, which meets the efficiency requirements of actual application scenarios and solves the problem that some detection methods have insufficient real-time processing capabilities and are difficult to implement.

[0062] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0063] Figure 1 This is a flowchart of a hairline detection method based on multi-scale feature fusion according to the present invention;

[0064] Figure 2 This is a structural diagram of the Transformer decoder in an embodiment of the present invention. Detailed Implementation

[0065] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0066] This invention provides a technical solution: a hairline detection method based on multi-scale feature fusion, comprising the following steps:

[0067] S1: Establish a multi-angle facial image acquisition platform

[0068] A multimodal face image acquisition system is constructed, wherein the acquisition platform includes an image acquisition module, a face detection module, and a quality assessment module.

[0069] The specific equipment configuration is as follows:

[0070] Image acquisition module: Employs a high-resolution camera with a resolution of at least 1920×1080, a frame rate of 30FPS, and supports autofocus and exposure adjustment. It is equipped with a ring LED fill light to ensure uniform illumination and capture clear images of the hairline area.

[0071] Face detection module: Employs an improved MTCNN algorithm for face detection, achieving an accuracy rate of 99.2%. It can accurately identify face bounding boxes and the locations of 68 facial key points, with optimized detection specifically for the glabella and hairline areas.

[0072] Quality assessment module: Integrates image quality assessment algorithms to automatically select images that meet the requirements. Assessment metrics include:

[0073] Face integrity ≥ 95%: Ensures that the entire facial area is visible;

[0074] Hairline visibility ≥90%: Ensures a clear hairline area;

[0075] Illumination uniformity ≥ 0.8: Avoid overexposure or shadows;

[0076] Image sharpness ≥85%: Prevents motion blur or out-of-focus issues;

[0077] Attitude angle limitations: Pitch angle ±15°, Yaw angle ±20°;

[0078] A dataset containing different hairline types was created, with the data distribution as follows:

[0079] Detailed statistics on dataset composition:

[0080] Total sample size: 12,000 high-quality face images;

[0081] Normal hairline: 7,000 images (58%) – including round hairlines, square hairlines, etc.

[0082] High hairline: 5,000 photos (42%) - including receding hairline, M-shaped receding hairline, etc.;

[0083] Population distribution statistics:

[0084] Age distribution: 18-30 years old (40%), 31-45 years old (35%), 46-65 years old (25%).

[0085] Gender distribution: Male (55%), Female (45%);

[0086] Hairstyle distribution: straight hair (45%), curly hair (30%), short hair (25%);

[0087] Hair color distribution: black hair (70%), brown hair (20%), other (10%);

[0088] S2: Image preprocessing and hairline-sensing data augmentation;

[0089] The collected facial images were preprocessed to construct a high-quality hairline detection dataset. To ensure the reliability of subsequent training of deep learning network models based on image sample data, systematic preprocessing of the image sample data was performed.

[0090] S21: Basic preprocessing;

[0091] The original image was normalized to 512×512 pixels, and illumination equalization was performed using CLAHE (contrast-limited adaptive histogram equalization). Gaussian filtering was used to remove image noise.

[0092] S22: Enhanced hairline perception;

[0093] To address the specific needs of hairline detection, the forehead area (the upper third of the image) is given focused enhancement:

[0094] Apply contrast enhancement to the forehead area, with an enhancement factor set to 1.2-1.5;

[0095] Sharpen the hairline boundary area to improve boundary clarity;

[0096] Maintain the natural appearance of other areas of the face;

[0097] S23: Enhanced hairline-specific data;

[0098] Considering the impact of different lighting environments on hairline detection, targeted data augmentation strategies were implemented:

[0099] Random brightness variation: Simulates different indoor and outdoor lighting conditions, with a brightness adjustment range of ±20%;

[0100] Random contrast adjustment: Enhances the contrast between the hairline and skin, adjustable within ±15%;

[0101] Random hue shift: Simulates the color temperature of different light sources, with a hue shift of ±10°;

[0102] Hairline area sharpening: 30% probability, enhances boundary clarity;

[0103] Forehead region enhancement: Apply local contrast enhancement to the upper 1 / 3 of the image;

[0104] Hair texture enhancement: Highlights hair details using a high-pass filter, with a probability of 25%;

[0105] In addition, the following enhancement strategies were adopted to address the diversity of real-world application scenarios:

[0106] Geometric transformations: rotation ±15°, scaling 0.9-1.1 times;

[0107] Noise simulation: Gaussian noise, standard deviation 0.01-0.03;

[0108] Compression simulation: JPEG compression, quality factor 75-95;

[0109] S3: Construct the HairlineSegNet hairline detection network;

[0110] The core innovation of this invention is the design of a dedicated HairlineSegNet network architecture, which is specifically optimized for hairline detection tasks.

[0111] Specifically, the HairlineSegNet network model includes a backbone network, a neck network, and a head detection head. The roles of the backbone network, the neck network, and the head detection head are as follows:

[0112] The backbone network is the basic feature extractor for the hairline detection task. Its main task is to take the face image as input and output the corresponding multi-scale feature map.

[0113] The Neck network connects the Backbone network and the Head network. Its main function is to fuse and adjust multi-scale features from the Backbone network to achieve feature integration, so as to better adapt to the hairline detection needs.

[0114] The detection head is used to detect hairlines by fusing features from the image obtained through the neck network, thereby achieving accurate localization and classification of hairlines and outputting the corresponding detection results.

[0115] S31: Construct an improved ConvNext-B encoder with four feature extraction stages, where the output dimensions of each feature extraction stage are adapted to the alignment requirements of the multi-scale feature fusion module.

[0116] Stage 1: Output feature dimension C=96, size H / 4×W / 4, capture fine-grained texture;

[0117] Stage 2: Output feature dimension C=192, size H / 8×W / 8, extract local patterns;

[0118] Stage 3: Output feature dimension C=384, size H / 16×W / 16, to obtain intermediate semantics;

[0119] Stage 4: Output feature dimension C=768, size H / 32×W / 32, providing global context;

[0120] S32: Hairline perception enhancement module is added after each encoder stage. This module assigns higher weights to hairline-related areas through a spatial attention mechanism.

[0121] The calculation of spatial attention weights combines three elements:

[0122] Convolutional Feature Response: Local features are extracted through 1×1 and 3×3 convolutions;

[0123] Location weights: A Gaussian distribution is used, with higher weights assigned to the upper half of the image.

[0124] Channel attention: Emphasizing important feature channels;

[0125] S33: The multi-scale feature fusion module designs a feature alignment and fusion mechanism to effectively integrate feature maps at four different scales.

[0126] The specific implementation process of the multi-scale feature fusion module is as follows:

[0127] Feature alignment: unifying feature maps of different dimensions to 256 dimensions. , where i = 1, 2, 3, 4.

[0128] Feature fusion: Feature fusion is achieved through channel concatenation and 3×3 convolution. The fusion formula is as follows:

[0129]

[0130] S34: Hairline-specific Transformer decoder design includes a decoder with 20 query tokens:

[0131] 19 standard segmentation query tokens: used for segmentation of regions such as background, face, and hair;

[0132] One dedicated hairline query token: specifically used for hairline boundary detection;

[0133] The hairline-specific Transformer decoder achieves efficient fusion of multi-scale features through a multi-head self-attention mechanism. The update formula for the hairline token is:

[0134]

[0135] in, This is a vector for querying hairline. These are key-value pairs representing multi-scale features. The decoder simultaneously outputs the segmentation result and the hairline boundary map, providing dual detection information.

[0136] S4: A dual verification mechanism is used for hairline positioning;

[0137] To ensure the reliability of the test results, a dual verification mechanism is designed:

[0138] S41: The main verification path utilizes MediaPipe facial landmark detection technology.

[0139] Automatically detect the position between the eyebrows as a reference point;

[0140] Search for the hairline boundary within a 30% image width area above the center of the eyebrows;

[0141] The final hairline position is determined by combining the network segmentation results;

[0142] The detection confidence level for this path is 0.9.

[0143] S42: Alternative verification path when keypoint detection fails or confidence is too low:

[0144] Hairline localization is performed based on the highest boundary of the facial segmentation mask.

[0145] Morphological processing is applied to remove noise and outliers;

[0146] Ensure the continuity of the hairline through connected component analysis;

[0147] The detection confidence level for this path is 0.7.

[0148] S43: Geometric rationality verification verifies the test results through the following constraints:

[0149] Continuity check: Ensure the smoothness of the hairline curve;

[0150] Anatomical constraints: verifying the rationality of the hairline position;

[0151] Symmetry check: Assess the degree of symmetry between the left and right hairlines.

[0152] S5: Hairline type classification;

[0153] Type classification based on detected hairline location:

[0154] S51: Calculate the ratio of the distance from the center of the eyebrows to the hairline to the total height of the face to obtain the hairline assessment value.

[0155] The hairline assessment value is obtained as follows:

[0156]

[0157] In the formula: This indicates the hairline assessment value. Indicates the total height of the face. It indicates the vertical distance from the center of the forehead to the hairline boundary.

[0158] S52: Personalized threshold adjustment employs a personalized threshold prediction network to dynamically adjust classification criteria based on individual facial features. The personalized threshold is adaptively adjusted based on facial features, and the threshold calculation formula is as follows:

[0159]

[0160] The default threshold Threshold_default=0.36, and the adjustment amount ΔT ranges from [-0.06,+0.06], so that the final threshold is adjusted to the range of 0.30-0.42.

[0161] S53: Classification is based on an adaptive threshold.

[0162] High hairline: Ratio > Threshold_adaptive + 0.05;

[0163] Normal hairline: Threshold_adaptive - 0.05 ≤ Ratio ≤ Threshold_adaptive + 0.05;

[0164] Low hairline: Ratio < Threshold_adaptive - 0.05;

[0165] S6: Network Training and Optimization

[0166] S61: Dataset partitioning divides the collected data into training, validation, and test sets in an 8:1:1 ratio.

[0167] S62: Multi-task joint training adopts a multi-task learning framework to jointly optimize four related tasks:

[0168] Facial region segmentation;

[0169] Hairline boundary detection;

[0170] Regression of hairline proportions;

[0171] hairline continuity constraint

[0172] The total loss function consists of four parts:

[0173]

[0174] The specific design of each loss component is as follows:

[0175] Segmentation loss L_seg: A combination of FocalLoss and DiceLoss

[0176] FocalLoss addresses the class imbalance problem:

[0177] Boundary detection loss L_boundary: Employs boundary-sensitive DiceLoss.

[0178]

[0179] Proportional regression loss L_ratio: using a smoothed L1 loss function

[0180] Continuity constraint loss L_continuity: Ensures hairline smoothness by penalizing gradient changes.

[0181]

[0182] The weights are set as follows: λ1=1.0, λ2=2.0, λ3=0.5, and λ4=1.5.

[0183] S63: The training parameter optimization settings adopt a progressive training strategy, which is divided into three stages:

[0184] Phase 1 (Basic Feature Learning):

[0185] Objective: To establish basic feature representation capabilities;

[0186] Phase Two (Fine-tuning):

[0187] Increase data augmentation strength, with the goal of improving detection accuracy and robustness;

[0188] Phase 3 (Final Optimization):

[0189] Objective: To optimize boundary details and classification accuracy;

[0190] Learning rate scheduling strategy: Cosine annealing scheduling is used.

[0191]

[0192] Early stop mechanism: Training is stopped if the validation set accuracy does not improve for 5 consecutive rounds;

[0193] S64: Performance evaluation assesses model performance using multiple metrics:

[0194] Segmentation quality: IoU, Dice coefficient;

[0195] Boundary accuracy: mean Euclidean distance error;

[0196] Classification performance: Accuracy of hairline type determination;

[0197] Computational efficiency: inference speed, memory usage;

[0198] S7: Application and performance evaluation of hairline detection model;

[0199] S71: Multi-scale testing strategy. To improve detection accuracy, a multi-scale testing strategy is adopted during the testing phase.

[0200] Original dimensions: 512×512;

[0201] Scaling test: 0.8x (410×410) and 1.2x (614×614).

[0202] Test-time data augmentation (TTA): includes horizontal flipping and ±5° rotation;

[0203] Results fusion: The final result is determined through weighted averaging and voting mechanisms;

[0204] S72: Output of Detection Results The hairline detection model outputs the following:

[0205] Hairline outline coordinates: a sequence of coordinates for 50-100 key points;

[0206] Confidence score: Overall detection confidence (between 0 and 1);

[0207] Hairline types are categorized as follows: high hairline, normal hairline, and low hairline.

[0208] Proportional value: Precise proportional value of the distance between the center of the eyebrows and the hairline;

[0209] Quality assessment report: includes indicators such as testing reliability and boundary clarity;

[0210] Technical effect

[0211] This invention has the following significant advantages over the prior art:

[0212] Specialized network architecture innovation: The HairlineSegNet network is designed and optimized specifically for hairline detection tasks. It includes a hairline perception enhancement module, a multi-scale feature fusion module, and a dedicated Transformer decoder, which improves detection accuracy by 35% compared to general segmentation networks.

[0213] Significantly improved detection accuracy: The average IoU for boundary detection reached 0.847, a 42% improvement compared to traditional edge detection methods; the classification accuracy reached 94.2%, a 28% improvement compared to traditional proportion-based methods.

[0214] Significantly enhanced robustness: The dual verification mechanism ensures that the accuracy remains above 90% under complex lighting and occlusion conditions, improving stability by 37% compared to a single detection method;

[0215] Personalized assessment capability: The adaptive threshold adjustment mechanism adapts to individual differences, and the personalized classification accuracy is improved by 15% compared with the fixed threshold method;

[0216] Superior real-time processing performance: Supports real-time detection at 32FPS@512×512, with a GPU memory requirement of only 1.8GB and a compressed model size of only 47.3MB, meeting the needs of mobile deployment.

[0217] Performance comparison data

[0218] Compared with traditional methods, the present invention shows a significant performance improvement on the standard test set:

[0219] Detection recall rate: increased from 78.5% to 94.2% (+15.7%).

[0220] Detection accuracy improved from 82.1% to 95.8% (+13.7%).

[0221] Boundary F1-Score: Improved from 0.743 to 0.912 (+22.7%).

[0222] Inference speed: Increased from 8.5 FPS to 32 FPS (+276%).

[0223] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0224] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims

1. A hairline detection method based on multi-scale feature fusion, characterized in that, Includes the following steps: Step 1: Build a multi-angle face image acquisition platform that includes an image acquisition module, a face detection module, and a quality assessment module to obtain high-quality face image data including the hairline area; Step 2: Preprocess the collected facial image data and perform data augmentation processing based on hairline perception; Step 3: Construct a hairline detection network model based on HairlineSegNet. The network model includes an improved ConvNext-B encoder with four feature extraction stages as the backbone network, an integrated hairline perception enhancement module, a multi-scale feature fusion module, and a hairline-specific Transformer decoder designed with standard segmentation query tokens and hairline-specific query tokens. The specific steps for using the improved ConvNext-B encoder with four feature extraction stages as the backbone network are as follows: The first feature extraction stage is set up to output features of specific dimensions and sizes to capture fine-grained textures; A second feature extraction stage is set up to output features of specific dimensions and sizes for extracting local patterns. A third feature extraction stage is set up to output features of specific dimensions and sizes for obtaining intermediate semantics; A fourth feature extraction stage is set up to output features of specific dimensions and sizes to provide global context; Step 4: Use a dual verification mechanism to accurately locate the hairline; The specific steps for accurately locating the hairline using a dual verification mechanism are as follows: The main verification path is initiated, and the position of the center of the eyebrows is obtained using facial key point detection technology. The hairline boundary is searched within a preset range above the center of the eyebrows, and the final hairline position is determined by combining the network segmentation results. When keypoint detection fails or the confidence level is too low, an alternative verification path is initiated. The hairline is located based on the highest boundary of the face segmentation results. Morphological processing is applied to remove noise and outliers, and connected component analysis is used to ensure the continuity of the hairline. Geometric rationality verification is conducted, the smoothness of the hairline curve is ensured through continuity testing, the rationality of the hairline position is verified through anatomical constraints, and the degree of symmetry between the left and right hairlines is assessed through symmetry checks. Step 5: Implement intelligent classification of hairline type based on hairline assessment value. Calculate hairline assessment value based on key facial distance relationships, adjust classification threshold using a personalized threshold prediction network, and output hairline location, type, and confidence assessment results.

2. The hairline detection method based on multi-scale feature fusion according to claim 1, characterized in that, The specific steps for building a multi-angle face image acquisition platform, which includes an image acquisition module, a face detection module, and a quality assessment module, are as follows: It uses a high-definition camera as the image acquisition module, supports multi-angle shooting, automatic focus and exposure adjustment, and is equipped with a fill light device to ensure uniform lighting; The MTCNN algorithm is used as the face detection module to locate the facial region and identify the location of key facial points, ensuring that the hairline area is visible; The quality assessment module automatically filters images that meet the standards, sets acceptance criteria for facial integrity, hairline visibility, lighting uniformity, and image clarity, and limits the range of pose angles.

3. The hairline detection method based on multi-scale feature fusion according to claim 1, characterized in that, The specific steps for preprocessing the collected facial image data and performing hairline-sensing data augmentation are as follows: Data cleaning is performed on the original images to remove blurry, occluded, or unclear hairline images, while retaining high-quality and valid samples. The collected image data was automatically labeled using Segment Anything Model and LabelMe software to generate preliminary hairline area labeling results; The automatic annotation results are manually corrected to ensure the accuracy and completeness of the annotations, and finally a high-quality labeled dataset is generated for training. The original image is subjected to size normalization, illumination equalization and noise reduction; the forehead area is enhanced in contrast and the hairline boundary is sharpened. Diverse training samples are generated through geometric transformations; diverse training samples are also generated through color perturbations.

4. The hairline detection method based on multi-scale feature fusion according to claim 1, characterized in that, The specific steps of the integrated hairline sensing and enhancement module are as follows: Enhance the feature representation of hairline-related areas through spatial attention mechanisms; By fusing the feature responses extracted by convolution, weights based on image region location, and channel attention weights, higher weights are assigned to the hairline-related regions in the upper half of the image.

5. The hairline detection method based on multi-scale feature fusion according to claim 1, characterized in that, The specific steps for constructing the multi-scale feature fusion module are as follows: The feature alignment function unifies four feature maps of different scales to the same preset dimension. Channel stitching is performed on the aligned feature maps; The concatenated feature maps are then subjected to convolution processing. The convolutional feature map is processed by a channel attention mechanism to obtain a fused feature map.

6. The hairline detection method based on multi-scale feature fusion according to claim 1, characterized in that, The specific steps for designing a hairline-specific Transformer decoder that includes a standard segmentation query token and a hairline-specific query token are as follows: Configure multiple query tokens, some of which are standard segmentation query tokens used for background, face, and hair region segmentation; Some are dedicated query tokens for hairline detection, specifically used for hairline boundary detection; Effective fusion of multi-scale features is achieved through a multi-head self-attention mechanism; The decoder outputs both the segmentation result and the hairline boundary map, providing dual detection information.

7. The hairline detection method based on multi-scale feature fusion according to claim 1, characterized in that, The specific steps for calculating the hairline assessment value based on key facial distance relationships are as follows: The coordinates of the center of the eyebrows are located using facial key point detection technology; The upper and lower boundary coordinates of the face are located using facial key point detection technology. Calculate the vertical distance from the center of the eyebrows to the hairline boundary; Calculate the vertical distance from the upper boundary to the lower boundary of the face; The hairline assessment value is calculated based on the ratio of the vertical distance from the center of the eyebrows to the hairline boundary to the vertical distance from the upper boundary to the lower boundary of the face.

8. The hairline detection method based on multi-scale feature fusion according to claim 1, characterized in that, The specific steps for adjusting the classification threshold using a personalized threshold prediction network are as follows: Construct a personalized threshold prediction network by inputting key facial feature parameters of an individual; The threshold adjustment amount is output through network inference; Calculate the adaptive threshold based on the default threshold and the adjustment amount; Ensure that the adaptive threshold falls within a preset reasonable range; if the calculation result exceeds this range, it will be automatically truncated to the corresponding boundary value.

Citation Information

Patent Citations

  • Multi-domain feature level fusion expression recognition method based on graph neural network

    CN119445639A

  • Face recognition method and system based on cross-age features

    CN120164246A