A method for identifying acne based on a Chinese medicine face part region
By using deep learning and image processing technologies to perform fine-grained segmentation of the face, the problem of fine-grained identification of acne in facial regions is solved, generating structured acne distribution data to support accurate diagnosis and data analysis in traditional Chinese medicine facial diagnosis.
Patent Information
- Application Number
- CN202511006796.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-22
- Publication Date
- 2026-06-19
- Estimated Expiration
- 2045-07-22
AI Technical Summary
Existing acne recognition technologies lack fine-grained recognition of facial regions, making it difficult to meet the needs of traditional Chinese medicine facial data for the number and distribution of acne in different areas. Furthermore, the output results are mainly image-based and fail to generate structured text descriptions.
A deep learning semantic segmentation model based on convolutional neural networks is used to perform fine segmentation of the facial region. Combined with image processing technology, pimples are identified in each region, generating structured text results, including the location and number of pimples.
It enables accurate identification and quantity counting of acne in different areas of the face, and outputs structured identification results, which facilitates clinical diagnosis and data analysis in traditional Chinese medicine.
Smart Images

Figure CN120894812B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of medical image recognition and computer image processing, and in particular to a method for acne recognition based on facial zoning in traditional Chinese medicine. Background Technology
[0002] In Traditional Chinese Medicine (TCM) facial diagnosis theory, different areas of the face correspond to different internal organs. For example, the *Suwen* (Plain Questions) chapter on "Acupuncture and Heat" describes a method of corresponding the face to the internal organs: the forehead corresponds to the heart, the nose to the spleen, the left cheek to the liver, the right cheek to the lungs, and the chin to the kidneys. Acne, also known as common acne vulgaris, is a common facial symptom. The location and number of acne pimples can also serve as reference information for TCM diagnosis and have significant clinical application value.
[0003] Current research on acne recognition technology mainly focuses on detecting and grading the severity of acne across the entire face using image processing techniques. However, this method lacks fine-grained recognition of facial features, making it difficult to meet the needs of traditional Chinese medicine facial data applications that require attention to the number and distribution of acne in different areas. Existing acne localization and recognition methods mostly employ deep learning to locate and label facial acne, generating resulting images that show the distribution of acne on the face. However, the output of these methods is still primarily image-based, failing to directly generate structured text descriptions, making them unsuitable for direct use in feature-based real-world data applications.
[0004] Therefore, it is necessary to propose a method that can perform fine segmentation based on the face region and use advanced image processing technology to quantify the characteristics of acne in different regions and generate structured text results. Summary of the Invention
[0005] This invention provides a method for acne identification based on facial zoning in Traditional Chinese Medicine, which aims to identify the features of acne in different areas and output structured identification results.
[0006] Specifically, this invention provides the following technical solution: a method for acne identification based on traditional Chinese medicine facial zoning, comprising:
[0007] Image acquisition: Acquire the face image to be detected;
[0008] Image preprocessing: The face region is cropped and face alignment is performed so that the eyes are on the same horizontal line. Then the cropped face image is scaled to a fixed size to obtain a standardized face image.
[0009] Facial region segmentation: A standardized face image is input into the facial region segmentation model, and the facial region is segmented based on the region of interest in Traditional Chinese Medicine, and the segmentation mask of each facial region is output.
[0010] Acne Recognition: Based on the segmentation mask, morphological acne recognition is performed on each facial region, and the recognition results are output, including acne location markers and acne count statistics for each region.
[0011] Furthermore, the facial region segmentation step includes:
[0012] Model acquisition: Build and train a deep learning semantic segmentation model based on convolutional neural networks and incorporating object context representation features;
[0013] Region segmentation: The standardized face image is input into the trained face segmentation model. The segmentation masks of five regions of interest in Traditional Chinese Medicine are obtained through pixel-level semantic segmentation: forehead, left cheek, right cheek, nose and chin. The segmentation masks are the same size as the standardized face image, and the pixels of the two correspond one-to-one. The masks of different regions are represented by different codes.
[0014] Furthermore, the steps for obtaining the model specifically include:
[0015] Select face images that can be used to train a face segmentation model from a public dataset containing 200,000 face images with attribute labels;
[0016] The face images are labeled with regions, and each image is divided into five regions: forehead, left cheek, nose, right cheek and chin, to form a facial region segmentation dataset;
[0017] Construct a high-precision facial region segmentation network OCRNet with object context representation features;
[0018] The facial region segmentation network is trained using the facial region segmentation dataset to obtain a segmentation model capable of achieving fine-grained facial region segmentation.
[0019] Furthermore, the step of performing morphological-based acne identification on each facial region specifically includes:
[0020] Based on the segmentation mask generated by the facial segmentation model, each facial region is extracted. Taking the chin region as an example, the gray value of the chin region is set to 255, and the gray value of other regions is set to 0.
[0021] Based on the bounding box of the region's binarized mask, the mask and the normalized face image are located and cropped;
[0022] Image processing tools are used to perform pixel-level bitwise AND operations on the cropped mask and the standardized face image, retaining only the region of the image corresponding to the mask in the standardized face image;
[0023] The color image is converted to a grayscale image, the grayscale pixel values of the masked region are extracted, and an adaptive histogram equalization method is used to enhance the contrast of the masked region and highlight the features of the pimple.
[0024] Calculate the segmentation threshold and binarize the enhanced grayscale image so that the pimple area appears white and the background area appears black;
[0025] Morphological closing operations are used to smooth the connected regions of pimples, fill in small holes and slits in the image, connect scattered pimple areas, and improve the accuracy of pimple recognition.
[0026] The binarized result of the pimple area is inverted, so that the pimple area is black and the background area is white;
[0027] Using image processing tools to detect all outer contours, the outline of the pimple area is circled;
[0028] Since most pimples are round, the formula for calculating the roundness of each pimple's outline is as follows:
[0029] Circularity=(4π×Area) / (Perimeter 2 )
[0030] Where Area represents the area of the region, Perimeter represents the perimeter of the region's outer contour, and Circularity represents the roundness of the region. The closer the roundness is to 1, the closer the region is to a circle. Connected regions that meet the roundness threshold (0.4≤Circularity≤1.3) are identified as pimples and labeled with rectangular boxes.
[0031] The number of pimples identified in each facial region is counted, and the identification results are stored in a JSON file with the structure [facial region: number of pimples].
[0032] This technical solution has at least the following beneficial effects:
[0033] This invention divides a human face image into five regions: forehead, left cheek, right cheek, nose, and chin, and identifies acne in each region separately. The identification results can directly reflect the distribution of acne in different regions, providing new data for health prediction and skin health status analysis, and has important medical research value.
[0034] This invention employs mature image processing technologies, including contrast enhancement, threshold segmentation, morphological closing operations, and contour detection, to achieve accurate extraction and identification of acne areas. The detection method is simple and efficient. This invention uses JSON format to structure and store the identification results, clearly recording the number and location of acne in each facial region, facilitating subsequent data analysis and visualization. This invention achieves accurate region division through a deep learning facial segmentation model, combined with image processing technologies for acne detection, making the method highly versatile and scalable, suitable for acne detection tasks in different populations and image backgrounds. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0036] Figure 1 This is a schematic diagram of the process of the present invention;
[0037] Figure 2 This is a schematic diagram of the facial segmentation region of the present invention;
[0038] Figure 3 This is a schematic diagram of the pimple recognition results in various facial areas according to the present invention.
[0039] Figure 4 This is a schematic diagram illustrating the core implementation idea of the OCRNet face segmentation network of the present invention;
[0040] Figure 5 This is a flowchart illustrating the image preprocessing steps of the present invention.
[0041] Figure 6 This is a flowchart illustrating the model acquisition steps of the present invention;
[0042] Figure 7 This is a flowchart illustrating the acne identification steps of the present invention. Detailed Implementation
[0043] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0044] Those skilled in the art should understand that the following specific embodiments or implementation methods are a series of optimized configurations listed to further explain the specific content of the invention. These configuration methods can be combined or used in conjunction with each other, unless the invention explicitly states that some or a specific embodiment or implementation method cannot be associated with or used in conjunction with other embodiments or implementation methods. Furthermore, the following specific embodiments or implementation methods are merely optimized configurations and are not intended to limit the scope of protection of the invention.
[0045] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings, but the scope of protection of the present invention is not limited to the following specific embodiments.
[0046] Reference Figure 1 This invention proposes a acne identification method based on Traditional Chinese Medicine (TCM) facial regions, used to identify acne in five facial regions of interest (MOIs) according to TCM principles. It can output the acne identification status and structured results for each facial region, applicable to TCM clinical diagnosis, including:
[0047] Step S110, Image Acquisition: Acquire the face image to be detected through an image acquisition device (such as a mobile phone, camera, etc.), ensuring that the lighting is uniform, the face is unobstructed, and the image is clear during the shooting.
[0048] Step S120: Face Image Preprocessing: Detect faces in the image, crop out complete face images, and then perform face alignment processing on the face images to ensure that the eyes are on the same horizontal line, which helps improve the accuracy of subsequent facial region segmentation. Scale the aligned face images to a fixed size to obtain standardized face images, providing consistent image input for subsequent facial partitioning and acne recognition.
[0049] Step S130, Facial Region Segmentation: Input the standardized face image into the trained facial region segmentation model, segment the facial region based on the region of interest in Traditional Chinese Medicine, and obtain the segmentation mask for each facial region. The facial segmentation results can be referenced. Figure 2 The segmentation mask is the same size as the standardized face image, with a one-to-one correspondence between the pixels. The mask also contains the corresponding mask for each facial region.
[0050] Step S140, Acne Recognition: Based on the segmentation mask, morphological acne recognition is performed on each facial region. The segmentation mask for each region can be obtained separately from the segmentation mask output by the facial region segmentation model. Each region receives a unique segmentation mask to facilitate targeted processing of the facial region. The acne recognition result image is output, with the edges of the acne outlined by a box. Figure 3Simultaneously, the number of pimples identified in each region is counted, and the output results are stored in a structured format, for example:
[0051] {"Forehead":2,"Left Cheek":1,"Right Cheek":3,"Nose":0,"Chin":2}
[0052] This output format facilitates researchers in traditional Chinese medicine facial diagnosis to quickly analyze the characteristics of acne in various facial areas and, based on the distribution of acne in different areas, further assess the health status of the internal organs.
[0053] Combination Figure 5 Preferably, in this embodiment, step S120 specifically includes:
[0054] Step S121: Cropping the face region: Locate 68 key points of the face in the image to obtain the position of the complete face image, and crop out the complete face image based on the key points.
[0055] Step S122, Face Alignment: Using 68 key points of the face for localization, obtain the coordinates of the eyes of the face, calculate the angle between the line where the eyes are located and the horizontal line, rotate the image according to the angle so that the eyes are located on the horizontal line to achieve face alignment.
[0056] Step S123: Standardize the face image: Scale the cropped and aligned face image to a fixed size (e.g., 512×512 pixels) to provide a consistent image input for subsequent processing.
[0057] Combination Figure 6 Preferably, in this embodiment, the facial region segmentation model acquisition step in step S130 specifically includes:
[0058] Step S131: Select approximately 500 face images from the public dataset CelebA that can be used to train the face segmentation model. The CelebA dataset contains a large number of different types of face images; try to select face images with unobstructed faces and uniform lighting.
[0059] Step S132: Perform region labeling on the facial images, dividing each image into five regions: forehead, left cheek, nose, right cheek, and chin, referring to... Figure 2 This resulted in a facial region segmentation dataset. The dataset contains 500 images, each containing one face image and one corresponding labeled facial region mask image.
[0060] Step S133: Build a high-precision facial region segmentation network OCRNet with object context representation features using the deep learning framework PyTorch. The core implementation idea of OCRNet can be found in [reference needed]. Figure 4OCRNet introduces an object context modeling mechanism based on mature segmentation models. This means that for each pixel, in addition to its own features, it also integrates the overall semantic features of its target object for classification. OCRNet extracts preliminary feature maps based on ResNet-50, performs preliminary category detection on each pixel through a shallow decoder, and then performs soft clustering on the pixels according to the preliminary predicted categories, identifying them into K object regions. Using the correlation between each pixel and each object region, it calculates the object context representation of that pixel, i.e., the pixel-region relationship between each pixel and the object region. Finally, it fuses the original features and context features as a fine-grained classification basis to obtain an enhanced feature map. This enhanced feature map is then used for final high-quality semantic segmentation. The core formula for object context representation is:
[0061]
[0062] Among them, R k It is a feature of the k-th object region, w ik The weights representing the relationship between pixel i and object region k are represented by φ(·), which is a mapping function consisting of 1×1 convolution, batch normalization, and ReLU activation function.
[0063] The pixels in the final enhanced feature map are represented as follows:
[0064] f i enhanced =f i +c i
[0065] f i It is the feature of the i-th pixel.
[0066] Step S134: Train the facial region segmentation network using the facial region segmentation dataset to obtain a segmentation model capable of achieving fine-grained facial region segmentation. During training, retain the segmentation model with the highest segmentation accuracy.
[0067] Combination Figure 7 Preferably, in this embodiment, step S140 specifically includes:
[0068] Step S141: Extract each facial region based on the segmentation mask generated by the facial segmentation model. Taking the chin region as an example, assuming that the mask label of the chin region is 5, extract the mask labeled 5 from the segmentation mask to form a separate mask for the chin region and binarize it. Set the gray value of the chin region to 255 and the gray value of other regions to 0.
[0069] Step S142: Based on the bounding box of the binarized mask of the region, locate and crop the mask and the normalized face image. Specifically, record the upper left and lower right coordinates of the white area of the binarized mask, and crop the mask and face image respectively based on these two coordinate points.
[0070] Step S143: Use image processing tools to perform pixel-level bitwise AND operation on the cropped mask and the standardized face image, and retain only the area image corresponding to the mask in the standardized face image;
[0071] Step S144: Convert the color image to a grayscale image, extract the grayscale pixel values of the masked area, and use an adaptive histogram equalization method to enhance the contrast of the masked area and highlight the features of the pimples.
[0072] Step S145: Calculate the segmentation threshold. Binarize the enhanced grayscale image so that the pimple area appears white and the background area appears black. For threshold segmentation, a threshold needs to be found such that the image is divided into two classes at this threshold, maximizing the inter-class variance and allowing the foreground and background to be distinguished as much as possible. Specifically, the grayscale histogram of the image is calculated. Let the grayscale level L = 256. Iterate through each possible threshold t ∈ [0, L-1], dividing the image pixels into two classes, C0 and C1. The formula for calculating the inter-class variance is:
[0073]
[0074] ω0(t) and ω1(t) represent the pixel ratios of the background and foreground, respectively, and μ0(t) and μ1(t) represent the average gray levels of the background and foreground, respectively. The threshold t with the largest inter-class variance is selected as the optimal threshold.
[0075] Step S146: Use morphological closing operation to smooth the connected regions of pimples, fill the holes and slits in the image, connect the scattered pimple regions, and improve the accuracy of pimple recognition; Morphological closing operation is implemented with OpenCV, using an 8×8 elliptical structuring element to perform closing operation on the binarized image of the pimple region, that is, first perform dilation operation to connect adjacent pimple regions, and then perform erosion operation to restore the overall shape of the pimple.
[0076] Step S147: Invert the binarization result of the pimple area, so that the pimple area is black and the background area is white. Use image processing tools to detect all outer contours, and the contour of the pimple area will be circled.
[0077] Step S148: Since most pimples are round, they can be filtered according to their shape. The roundness of each pimple's outline is calculated using the following formula:
[0078] Circularity=(4π×Area) / (Perimeter 2 )
[0079] Where Area represents the region's area, Perimeter represents the region's outer perimeter, and Circularity represents the region's roundness. A roundness value closer to 1 indicates that the region is closer to a circle. Connected regions that meet the roundness threshold (e.g., 0.4 ≤ Circularity ≤ 1.3) are identified as pimples and labeled with rectangular boxes, such as... Figure 3 As shown;
[0080] Step S149: Finally, count the number of pimples identified in each facial region and store the identification results in a JSON file with the structure [facial region: number of pimples].
[0081] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0082] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for identifying acne based on a Chinese medicine face part area, characterized in that, include: Image acquisition: Acquire the face image to be detected; Face image preprocessing: The face region is cropped from the face image and face alignment is performed so that the eyes are on the same horizontal line. Then the cropped face image is scaled to a fixed size to obtain a standardized face image. Facial region segmentation: A standardized face image is input into the facial region segmentation model, and the facial region is segmented based on the region of interest in Traditional Chinese Medicine, and the segmentation mask of each facial region is output. Acne identification: Based on the segmentation mask, morphological acne identification is performed on each facial region, and the identification results are output, including acne location markers and acne counts in each region. The steps for facial region segmentation include: Face segmentation model establishment: A deep learning semantic segmentation model based on convolutional neural networks and incorporating object context representation features is built and trained to obtain the face segmentation model; Region segmentation: A standardized face image is input into the trained facial segmentation model. The segmentation mask of the region of interest in Traditional Chinese Medicine (TCM) is obtained through pixel-level semantic segmentation. The segmentation mask has the same size as the standardized face image, and the two have a one-to-one correspondence of pixels. The masks of different regions are represented by different codes. The TCM region of interest includes five regions: forehead, left cheek, right cheek, nose, and chin. The facial segmentation model is designed as follows: Preliminary feature maps are extracted based on ResNet-50. A shallow decoder is used to perform preliminary category detection on each pixel. The pixels are then soft-clustered according to the preliminary detected categories to identify K object regions. The object context representation feature of each pixel is calculated by utilizing the correlation between each object region and the pixel's relational degree. The object context representation feature is calculated as follows: in, It is a feature of the k-th object region. This represents the weight of the relationship between pixel i and object region k. It is a mapping function composed of 1×1 convolution, batch normalization, and ReLU activation function; Finally, the preliminary feature maps extracted by ResNet-50 are fused with the object context representation features to obtain enhanced feature maps; the enhanced feature maps are then used for the final high-quality semantic segmentation. The pixels in the final enhanced feature map are represented as follows: wherein, is a feature of the i-th pixel.
2. The acne identification method based on traditional Chinese medicine facial zoning as described in claim 1, characterized in that, The steps for obtaining the facial segmentation model specifically include: Select face images that can be used to train a face segmentation model from a public dataset containing several face images with attribute labels; The face images are labeled with regions, and each face image is divided into five regions: forehead, left cheek, nose, right cheek and chin, to form a face region segmentation dataset; Construct a high-precision facial region segmentation network OCRNet with object context representation features; The facial region segmentation network OCRNet is trained using the aforementioned facial region segmentation dataset to obtain a facial segmentation model capable of achieving fine-grained facial region segmentation. 3.The method of claim 1, wherein the method comprises: The specific steps for morphological-based acne identification of each facial region include: Each facial region is extracted based on the segmentation mask generated by the facial segmentation model. The gray value of the facial region to be extracted is set to 255, and the gray value of other regions is set to 0. Based on the bounding box of the binary mask of the facial region extracted as needed, the mask and the normalized face image are located and cropped. Perform a pixel-level bitwise AND operation between the cropped mask and the standardized face image, retaining only the facial region image corresponding to the mask in the standardized face image; The above image is converted to a grayscale image, the grayscale pixel values of the masked area are extracted, and an adaptive histogram equalization method is used to enhance the contrast of the masked area and highlight the features of the pimple. Calculate the segmentation threshold and binarize the enhanced grayscale image so that the pimple area appears white and the background area appears black; Morphological closing operations are used to smooth the connected regions of pimples, fill in small holes and slits in the image, connect scattered pimple areas, and improve the accuracy of pimple recognition. The binarized result of the pimple area is inverted, so that the pimple area is black and the background area is white; Detect all outer contours, and the contour of the pimple area will be circled; Since most pimples are round, the formula for calculating the roundness of each pimple's outline is as follows: Circularity = (4π×Area) / (Perimeter²) Where Area represents the area of the region, Perimeter represents the perimeter of the region's outer contour, and Circularity represents the roundness of the region. The closer the roundness is to 1, the closer the region is to a circle. Connected regions that meet the roundness threshold are identified as pimples and labeled with rectangular boxes. Count the number of pimples identified in each facial region and output the identification results.
4. The acne recognition method based on the Chinese medicine face sub-zone according to claim 3, characterized in that, When calculating the segmentation threshold, the obtained threshold maximizes the inter-class variance when the image is divided into two classes at that threshold, thus distinguishing the foreground and background as much as possible. Specifically: Calculate the gray-level histogram of the image. Given a gray level L = 256, iterate through each possible threshold t ∈ [0, L-1] to divide the image pixels into two classes, C0 and C1, and calculate the inter-class variance. wherein, and are the pixel proportions of background and foreground, respectively, and are the average gray levels of background and foreground, respectively. The threshold t with the largest inter-class variance is selected as the optimal segmentation threshold.