Image-based artificial intelligence androgenic alopecia subtyping grading method

CN123033697APending Publication Date: 2026-11-03PEOPLES HOSPITAL PEKING UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611309595.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-27
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

The existing classification standards for androgenetic alopecia are not uniform, the grading results are difficult to interpret, and the generalization ability is poor under different lighting, angles, and hair length conditions. Doctors' subjective judgment has a great influence, resulting in low clinical trust.

Method used

A conditional diffusion model is used to infer hairline topology, crown density distribution, and hair micromorphological parameters from scalp images. Interpretable BASP classification and Hamiltonian grading results are generated by comparing the results with standard templates using a nearest neighbor matching algorithm. Key measurement locations and grading criteria are then overlaid on the images.

Benefits of technology

It achieves objective consistency and interpretability of classification and grading results, improves generalization ability under different conditions, provides traceable decision-making basis, and enhances clinical trust.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123033697A_ABST
    Figure CN123033697A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of medical image analysis, in particular to an artificial intelligence androgenic alopecia typing and grading method based on images, wherein the method comprises the following steps: acquiring a scalp image of an androgenic alopecia patient; inputting the scalp image into a pre-trained conditional diffusion model to generate typing and grading interpretable parameters through multi-step backward diffusion reasoning; comparing and mapping the interpretable parameters through a nearest neighbor matching algorithm to obtain BASP typing results and Hamilton grading results; and superimposing key measurement positions and typing and grading bases on the scalp image based on the typing and grading results to generate a visual result. Thus, the problems of non-uniform typing standards and difficult-to-explain grading results in the prior art are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of medical image analysis technology, and in particular to an image-based artificial intelligence classification and grading method for androgenetic alopecia. Background Technology

[0002] Currently, the BASP classification and Hamilton's grading system are widely used in clinical practice to classify androgenetic alopecia. The BASP classification system categorizes patients based on two dimensions: hairline morphology and thinning pattern on the crown. The Hamilton's grading system classifies patients according to the area and degree of hair loss. Traditional assessment methods mainly rely on doctors' visual observation of scalp images and subjective judgment, or on extracting superficial features such as hair density and hairline position using conventional image processing methods and then inputting them into a classification model for automatic grading.

[0003] First, doctors' visual assessments are heavily influenced by subjective experience, resulting in low consistency in classification and grading results for the same patient among different doctors, making it difficult to meet the needs of standardized diagnosis and treatment. Second, while automatic grading methods based on conventional image processing or end-to-end deep learning improve efficiency to some extent, their output is usually a direct classification result, lacking interpretable intermediate parameters. Doctors cannot trace the basis for their classification decisions, leading to low clinical trust and difficulty in assisting diagnostic decisions. Furthermore, existing methods are sensitive to image acquisition conditions, exhibiting poor generalization ability under different lighting, angles, and hair lengths, and cannot visually display key measurement locations and grading criteria simultaneously with the output results. Summary of the Invention

[0004] This application provides an image-based artificial intelligence-based classification and grading method for androgenetic alopecia to address issues such as inconsistent classification standards and difficulty in interpreting grading results in related technologies.

[0005] The first aspect of this application provides an image-based artificial intelligence method for classifying and grading androgenetic alopecia, comprising the following steps: acquiring scalp images of patients with androgenetic alopecia to be classified; inputting the scalp images into a pre-trained conditional diffusion model as conditional constraints, and generating interpretable parameters for classification and grading through multi-step backdiffusion inference; wherein the interpretable parameters for classification and grading include hairline topological parameters, crown density distribution parameters, and hair micromorphological parameters; comparing and mapping the interpretable parameters for classification and grading through a nearest neighbor matching algorithm to obtain BASP classification results and Hamiltonian grading results; and based on the BASP classification results and Hamiltonian grading results, superimposing key measurement locations and classification and grading criteria onto the scalp images to generate visualization results.

[0006] A second aspect of this application provides an image-based artificial intelligence-based system for classifying and grading androgenetic alopecia, comprising: an acquisition module for acquiring scalp images of patients with androgenetic alopecia to be classified and graded; a generation module for inputting the scalp images into a pre-trained conditional diffusion model as conditional constraints, and generating interpretable parameters for classification and grading through multi-step backdiffusion inference; wherein the interpretable parameters for classification and grading include hairline topological parameters, crown density distribution parameters, and hair micromorphological parameters; a mapping module for comparing and mapping the interpretable parameters for classification and grading through a nearest neighbor matching algorithm to obtain BASP classification results and Hamiltonian grading results; and an annotation module for overlaying annotations of key measurement locations and classification and grading criteria on the scalp images based on the BASP classification results and Hamiltonian grading results to generate visualization results.

[0007] A third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the image-based artificial intelligence androgenic alopecia classification and grading method as described in the above embodiments.

[0008] A fourth aspect of this application provides a computer program product having a computer program stored thereon, which is executed by a processor to implement the image-based artificial intelligence androgenic alopecia classification and grading method as described in the above embodiments.

[0009] The fifth aspect of this application provides a computer program product, including a computer program or instructions, for implementing the image-based artificial intelligence androgenic alopecia classification and grading method as described in the above embodiments.

[0010] The beneficial effects of the embodiments of this application are as follows: This application uses a conditional diffusion model to infer interpretable classification and grading parameters from scalp images, including hairline topology parameters, crown density distribution parameters, and hair micromorphological parameters. This establishes classification and grading decisions based on quantified parameters, avoiding subjective differences in doctor's visual assessment and ensuring high consistency of classification and grading results among different operators. By constraining the training process of the diffusion model with a joint loss function and a hairline topology conformal regularization term, the model maintains hairline geometric topology consistency during denoising, improving the accuracy and generalization ability of classification and grading under different lighting, angles, and hair lengths. Furthermore, by using a standardized template vector set as a comparison benchmark, the application employs a nearest neighbor matching algorithm and a cosine distance metric to quantify interpretable parameters. The system compares each sample with a standard template and calculates a similarity score. It then filters out unreliable matches using a preset confidence threshold, avoiding the lack of decision-making basis in end-to-end black-box classification. When the similarity score falls below a preset review threshold, it automatically invokes a diffusion model with multiple sets of differentiated parameters for secondary inference and outputs multi-model voting results. Simultaneously, low-confidence samples are marked as awaiting manual review, ensuring inference efficiency while providing multiple safeguards for difficult samples. By overlaying annotations on the original scalp image with key measurement locations such as the hairline inflection point, the sparse center on the crown, and the hair follicle density sampling area, along with a bar chart comparing interpretable parameters with the standard template, doctors can intuitively trace the derivation basis of each classification and grading conclusion. This solves the problems of inconsistent classification standards and difficulty in interpreting grading results in existing technologies.

[0011] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0012] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a flowchart of an image-based artificial intelligence-based method for classifying and grading androgenetic alopecia according to an embodiment of this application; Figure 2 This is a block diagram of an image-based artificial intelligence androgenic alopecia classification and grading system according to an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of this application. Detailed Implementation

[0013] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0014] The following describes an image-based artificial intelligence-based method for classifying and grading androgenetic alopecia, according to embodiments of this application, with reference to the accompanying drawings.

[0015] Specifically, Figure 1 This is a schematic flowchart of the image-based artificial intelligence-based method for classifying and grading androgenetic alopecia provided in an embodiment of this application.

[0016] like Figure 1 As shown, this image-based artificial intelligence-based method for classifying and grading androgenetic alopecia includes the following steps: In step S101, scalp images of patients with androgenetic alopecia to be classified and graded are obtained.

[0017] Specifically, scalp images are acquired using a professional scalp detector or a smartphone camera, covering at least the hairline and crown areas. The image format is RGB color, with a resolution of at least 1024×1024 pixels. The acquired images undergo white balance correction and noise reduction preprocessing to eliminate the impact of ambient lighting differences on subsequent inference.

[0018] In step S102, the scalp image is input into a pre-trained conditional diffusion model as a conditional constraint, and classification-level interpretable parameters are generated through multi-step back diffusion inference; wherein, the classification-level interpretable parameters include hairline topological parameters, crown density distribution parameters, and hair micromorphological parameters.

[0019] Specifically, the interpretable parameters for classification and grading are a set of continuous numerical vectors used to quantitatively describe the morphological characteristics of androgenetic alopecia from multiple dimensions, providing a traceable quantitative basis for classification and grading decisions. Among these, the hairline topology parameters describe the receding hairline pattern and the degree of symmetry at the temples, including the relative coordinates of each hairline inflection point, the receding distance at the temples, and the symmetry index of the left and right temples; the crown density distribution parameters describe the hair density distribution and sparse center location in the crown region, including the coordinates of the sparse center, the density gradient heatmap, and the number of hair follicles per unit area; and the hair micromorphology parameters describe the hair shaft diameter, pigment distribution, and hair root morphology, including the average hair shaft diameter, hair shaft pigment concentration, and the miniaturization ratio of hair follicles. The training and inference generation processes of the diffusion model are illustrated in the following examples.

[0020] In this embodiment, the conditional diffusion model is constructed as follows: a scalp image dataset is used as a training sample set; each training sample corresponds to manually labeled classification and grading reference parameters; the scalp images in the training sample set are processed to obtain input images with uniform size and pixel distribution; a feature extraction network is built to extract features from the input images to obtain image conditional features, and the image conditional features are used as conditional vectors; a denoising network is built, adding Gaussian noise to the classification and grading reference parameters in the forward diffusion stage, and gradually predicting and removing noise based on the conditional vectors in the backward diffusion stage, and iteratively training the parameters of the denoising network by minimizing the joint loss function; wherein the joint loss function consists of a noise prediction loss function and a parameter regression function loss, and a hairline topology conformal regularization term is added to constrain the hairline topology parameters to maintain geometric topological consistency during the denoising process; after training, the parameters of the feature extraction network and the denoising network are fixed to form the conditional diffusion model.

[0021] Specifically, the training sample set consists of scalp images of patients with androgenetic alopecia collected clinically. Each image was independently annotated with classification and grading reference parameters by at least two senior dermatologists, and the consensus annotations were used as the ground truth to ensure the reliability of the annotation results. The scalp images in the training sample set were processed, including scale normalization to 256×256 pixels, illumination correction, and scalp region segmentation, resulting in input images of uniform size and pixel distribution, eliminating illumination differences and background interference from different acquisition environments. The feature extraction network uses a ResNet-50 backbone network, performing layer-by-layer convolution to extract semantic features from the input image, ultimately outputting 512-dimensional image conditional features as conditional vectors. The denoising network uses a U-Net architecture, with the conditional vectors injected into each decoding layer of the U-Net through an adaptive layer normalization mechanism, ensuring that image semantic information continues to play a role throughout the denoising process.

[0022] The forward diffusion stage is set to T=1000 steps. Gaussian noise is gradually added to the classification and grading reference parameters according to cosine noise scheduling. The noise addition process formula is as follows:

[0023] In the formula, Let be the noisy parameter vector at step t. ; These are reference parameters for classification and grading. Let be the cosine noise scheduling coefficient at step t, with a value range of (0,1); This is a Gaussian noise vector sampled from a standard normal distribution N(0,I).

[0024] In the backdiffusion phase, the denoising network, constrained by conditional vectors, progressively predicts and removes noise. The training objective is to minimize the joint loss function. The formula for calculating the joint loss function is as follows:

[0025] In the formula, For the joint loss function; The noise prediction loss function is calculated using the following formula: ,in This is real noise. The noise predicted by the denoising network; The loss function is a parametric regression function, and its calculation formula is: ,in These are the predicted parameter values ​​for the final output of the denoising network; For the hairline topological conformal regularization term; , , These are the weighting coefficients for each loss term, as shown in this embodiment. , , Through multi-task supervision using a joint loss function, the model simultaneously learns noise prediction and parameter regression, while imposing geometric constraints on the hairline topology dimension.

[0026] The formula for calculating the hairline topological conformal regularization term is as follows:

[0027] In the formula, Let be the relative change in the hairline topology parameters after denoising at step t relative to step t-1, defined as... ,in Let t be the topological parameter vector of the hairline after denoising in step t; This represents the relative change at step t-1. This regularization term constrains the changes in the hairline topology parameters between adjacent time steps to prevent abrupt changes, thereby maintaining the geometric topological consistency of the relative positions of the hairline inflection points and avoiding unreasonable distortions in the hairline shape during the denoising process.

[0028] The training hyperparameters are set as follows: the learning rate is... The batch size was 16, the training epochs were 200, and the optimizer used was AdamW. After training, the parameters of the feature extraction network and the denoising network were frozen, forming a conditional diffusion model that could be directly used for inference.

[0029] In this embodiment, the classification and grading interpretable parameters are generated as follows: The scalp image to be detected is input into a conditional diffusion model; a feature extraction network extracts features from the scalp image to obtain image conditional features, which are then used as the initial conditional vector; denoising iterations are performed step-by-step along the back-diffusion time sequence, starting from random noise and proceeding according to a preset number of diffusion steps, with each iteration using the initial conditional vector as a constraint injected into the denoising network; after all back-diffusion iterations are completed, a denoised parameter vector is obtained; the parameter vector is then dimensionally split and numerically mapped to output the classification and grading interpretable parameters.

[0030] Specifically, during inference, the scalp image to be detected is input into the pre-trained conditional diffusion model. First, a feature extraction network (ResNet-50) performs forward propagation on the scalp image, extracting image conditional features as the initial conditional vector. This initial conditional vector remains unchanged throughout the back-diffusion process and is injected into the denoising network at each step through adaptive layer normalization. The number of diffusion steps is preset to 1000, starting from standard Gaussian noise. Initially, in each denoising iteration, the denoising network receives the current noisy parameters. Time step encoding t and initial condition vector c, prediction noise The parameters are then updated accordingly. The update formula for the denoising iteration is as follows:

[0031] In the formula, The updated parameter vector; This is the current noisy parameter vector; Let be the variance scheduling coefficient at step t; The cumulative variance scheduling coefficient; The noise predicted by the denoising network under the constraint of conditional vector c; Let be the noise standard deviation at step t; z is a random noise vector sampled from a standard normal distribution. This update formula ensures that each denoising step fully utilizes the image conditional constraints, progressively recovering interpretable parameters corresponding to the input image from pure noise.

[0032] After completing all 1000 back-diffusion iterations, the denoised parameter vector is obtained. The total dimensions are 26, with the first 8 dimensions corresponding to hairline topological parameters, the middle 12 dimensions corresponding to crown density distribution parameters, and the remaining 6 dimensions corresponding to hair micromorphological parameters. The parameter vector is then dimensionally decomposed, and the values ​​of each dimension are mapped to the actual physical domain using an activation function. The mapping formula is as follows:

[0033] In the formula, The actual physical value after mapping; This represents the lower limit of the physical value range for this dimension parameter; This represents the upper limit of the physical value range for this dimension parameter; These are the original values ​​for the corresponding dimensions in the parameter vector. After mapping, the output is the fractal and hierarchical interpretable parameters, completing the reasoning process from scalp image to quantized parameter vector.

[0034] In step S103, the interpretable parameters of the classification and grading are compared and mapped using the nearest neighbor matching algorithm to obtain the BASP classification results and Hamilton classification results.

[0035] Specifically, the nearest neighbor matching algorithm involves calculating the similarity between the interpretable parameter vector of the classification and grading to be matched and each standard template vector in a pre-constructed set of standardized template vectors. The standard template with the highest similarity is selected as the optimal matching result, and the classification and grading labels corresponding to this optimal matching template are the final output. In this application, the BASP classification results cover type A, type M, type C, type U and their subtypes, and the Hamiltonian grading results cover grades I to VII. By comparing the continuous interpretable parameter space with the standardized templates one by one and taking the optimal match, the quantitative parameters output by the diffusion model are mapped to clinically recognized classification and grading conclusions.

[0036] In this embodiment, the BASP typing results and Hamiltonian grading results are obtained through the following methods: constructing a hair loss characterization knowledge base, wherein the knowledge base contains BASP typing standard templates and Hamiltonian grading standard templates, each standard template corresponding to a set of typing and grading reference parameters; establishing a standardized template vector set based on all standard templates in the hair loss characterization knowledge base; using the standardized template vector set as a comparison benchmark, employing a nearest neighbor matching algorithm with cosine distance as a similarity metric, comparing and mapping the interpretable typing and grading parameters with the standardized template vector set one by one, calculating the similarity score between the interpretable typing and grading parameters and each standard template, and determining the optimal matching template; when the similarity score is not lower than the corresponding preset judgment confidence threshold, outputting the BASP typing results and Hamiltonian grading results corresponding to the optimal matching template; when the similarity score is lower than the corresponding preset judgment confidence threshold, determining it as an unreliable match and rejecting the output. Specifically, the construction process of the alopecia areata characterization knowledge base is as follows: Based on the typical characteristics of each subtype of the BASP classification method, a set of subtype-level reference parameters is determined for each subtype, including the reference range of hairline topology parameters, the reference range of crown density distribution parameters, and the reference range of hair micromorphology parameters, forming a BASP classification standard template. Similarly, based on the typical characteristics of each level of the Hamiltonian classification method, a set of subtype-level reference parameters is determined for each level, forming a Hamiltonian classification standard template. The parameters of all standard templates are uniformly encoded into fixed-dimensional vectors, and the parameters of each dimension are normalized to eliminate the dimensional differences between different parameter dimensions, thereby obtaining a standardized template vector set.

[0037] When comparing and mapping, cosine similarity is used as the similarity metric. The cosine similarity score between the classification-level interpretable parameter vector and each standard template vector is calculated using the following formula:

[0038] In the formula, The cosine similarity score has a range of values. A higher value indicates a higher degree of matching. A classification and grading interpretable parameter vector; It is a standard template vector; For vectors and The dot product is calculated. After calculating the similarity score between the interpretable parameter vector and each template in the standardized template vector set, the standard template with the highest score is taken as the optimal matching template. The BASP classification label and Hamiltonian classification label corresponding to the optimal matching template are the final matching results.

[0039] The preset confidence threshold is determined as follows: A validation sample set with known classification and grading labels is collected. The interpretable parameters for each classification and grading of each validation sample are extracted and compared one by one with the standardized template vector set to obtain a similarity score. The similarity score of each sample is then compared with its true classification and grading label. The score distribution of correct and incorrect matches is statistically analyzed, and the cutoff value that maximizes the distinction between correct and incorrect matches is taken as the preset confidence threshold. Different thresholds are set for classification and grading. The preset confidence threshold ranges from 0.75 to 0.90, with the specific value determined based on the statistical results of the actual validation set. When the similarity score of the optimal matching template is not lower than the corresponding preset confidence threshold, the BASP classification result and Hamiltonian grading result corresponding to the optimal matching template are output. When the similarity score is lower than the preset confidence threshold, it is judged as an unreliable match and output is rejected.

[0040] In step S104, based on the BASP classification results and Hamilton classification results, key measurement locations and classification criteria are superimposed on the scalp image to generate a visualization result.

[0041] Specifically, key measurement locations include the hairline inflection point, the center of thinning on the crown, and the hair follicle density sampling area. These locations are calculated from the classification and grading reference parameters corresponding to the optimal matching template, providing a direct reflection of the anatomical characteristics of hair loss. The classification and grading criteria include BASP classification labels, Hamiltonian grading labels, specific values ​​of interpretable parameters for each dimension, and their comparison with the optimal matching template reference parameters. The visualization results use the original scalp image as a base image, overlaid with a semi-transparent annotation layer, allowing doctors to clearly view the classification and grading conclusions and their derivation basis.

[0042] In this embodiment, the visualization result is generated as follows: Based on the BASP classification result and Hamilton classification result, as well as the classification and grading reference parameters corresponding to the optimal matching template, the coordinates of key measurement locations are determined; the coordinates of the key measurement locations are mapped back to the pixel coordinate system of the original scalp image to locate the hairline inflection point, the sparse center of the crown, and the hair follicle density sampling area; the measurement baseline, classification and grading numerical basis, and parameter comparison information are superimposed at the corresponding locations, and a comparison bar chart between the interpretable parameters of the classification and grading and the classification and grading reference parameters corresponding to the optimal matching template is attached to the side of the image; the superimposed and annotated image is fused with the original scalp image to generate the visualization result.

[0043] Specifically, the coordinates of key measurement locations are calculated by back-calculating the classification and grading reference parameters of the optimal matching template. The coordinates of the hairline inflection point are obtained by multiplying the normalized hairline topology parameters by the width and height of the original image, respectively, to obtain its absolute coordinates in the pixel coordinate system of the original image; the coordinates of the sparse center of the top of the head are obtained by mapping the peak position of the density distribution parameters in the same way. The hair follicle density sampling area is determined by a continuous region with a density gradient greater than a preset threshold, and is marked as a rectangular box on the image.

[0044] After coordinate mapping, annotations are overlaid on the original scalp image: the hairline inflection point is marked with a red dot, the sparse center on the crown is marked with a yellow cross, and the hair follicle density sampling area is marked with a green rectangle. A white dashed line is drawn between the hairline inflection point and the reference point at the center of the forehead, and the actual physical distance is marked. A comparison bar chart is attached to the side of the image, displaying the values ​​of each dimension of the interpretable parameters for classification and grading, and the corresponding reference parameter values ​​of the optimal matching template. Blue represents the interpretable parameter values, and orange represents the template reference values, facilitating the doctor's intuitive judgment of the direction and magnitude of the matching deviation. Finally, the annotated image is weighted and fused with the original scalp image using a preset transparency to generate the final visualization result.

[0045] In this embodiment of the application, the method further includes a quantification and adaptive review step for inference uncertainty: when the similarity score is lower than the preset review threshold, an adaptive review mechanism is triggered; wherein, the adaptive review mechanism includes automatically calling a diffusion model with multiple sets of differentiated parameters to perform secondary inference, outputting multi-model voting results, and marking low-confidence samples as pending manual review; when the similarity score is not lower than the preset review threshold, the final classification and grading results and visualization results are directly output.

[0046] Specifically, the preset review threshold is higher than the preset decision confidence threshold, with the difference ranging from 0.05 to 0.15. The preset review threshold is determined based on the same criteria as the preset decision confidence threshold, both derived from the statistical distribution of similarity scores on the validation sample set. However, the preset review threshold is a cutoff value closer to the upper bound of the correct matching score distribution to ensure higher reliability for high-scoring samples. When the similarity score is between the preset decision confidence threshold and the preset review threshold, although the system outputs a classification and grading result, it triggers an adaptive review mechanism: automatically calling multiple diffusion models trained with different random seeds to perform secondary inference on the same sample. Each model independently outputs interpretable classification and grading parameters and matches them to obtain the classification and grading result. Finally, the final result is determined by majority vote, and the sample is marked as awaiting manual review and stored in the review queue. When the similarity score is not lower than the preset review threshold, the system determines that the match is highly reliable and directly outputs the final classification and grading result and visualization result.

[0047] The following will illustrate an image-based artificial intelligence-based method for classifying and grading androgenetic alopecia through a specific embodiment, including: For example, a male patient clinically diagnosed with androgenetic alopecia had a noticeable receding hairline in an M-shape, with diffuse thinning visible on the top of his head.

[0048] First, scalp images of the patient were acquired. RGB color images of the patient's forehead hairline and crown area were collected using a professional scalp detector, with a resolution of 2048×2048 pixels. During acquisition, the device was held perpendicular to the scalp to ensure uniform illumination. The acquired images underwent scale normalization, uniformly scaling to 256×256 pixels. Simultaneously, illumination correction and scalp region segmentation were performed to obtain the input image.

[0049] Next, the input image is fed into a pre-trained conditional diffusion model. This model consists of a ResNet-50 feature extraction network and a U-Net denoising network. The feature extraction network outputs a 512-dimensional conditional vector, which is injected into each decoding layer of the denoising network through adaptive layer normalization. Starting from standard Gaussian noise, denoising is performed stepwise along a 1000-step back-diffusion time sequence, with each step constrained by the conditional vector. After denoising, a 26-dimensional parameter vector is obtained, where the first 8 dimensions are hairline topological parameters, the middle 12 dimensions are crown density distribution parameters, and the remaining 6 dimensions are hair micromorphological parameters. After numerical mapping, the specific parameter values ​​of the patient were obtained: the receding distance of the hairline on both sides of the temples was 14 mm and 13 mm, respectively; the inflection point of the hairline was located at the normalized coordinates (0.18, 0.08) and (0.82, 0.08) of the image; the symmetry index of the left and right temples was 0.93; the sparse center of the crown was located at the normalized coordinates (0.50, 0.45); the number of hair follicles per unit area in this area was 68 per square centimeter; the density attenuation gradient was moderate; the average diameter of the hair shaft was 48 micrometers; the hair shaft pigment concentration was low; and the hair follicle miniaturization ratio was 0.42.

[0050] Then, the interpretable parameters of the classification and grading are matched with the nearest neighbor set of standardized template vectors. The standardized template vector set is built based on a hair loss characterization knowledge base. The knowledge base contains BASP classification standard templates covering types A, M, C, U, and their subtypes, and Hamilton classification standard templates covering grades I to VII. The cosine similarity is calculated between the 26-dimensional parameter vector and each set of standard template vectors in the knowledge base. The optimal matching template for this patient is the BASP classification type M standard template, with a similarity score of 0.88. This score is higher than the preset confidence threshold of 0.80, and the system outputs the BASP classification result as type M. At the same time, the optimal match for the Hamilton classification is the grade IV standard template, with a similarity score of 0.85, which is higher than the corresponding threshold of 0.78, and the system outputs the Hamilton classification result as grade IV. Since the similarity scores were all between the decision confidence threshold and the review threshold of 0.92, an adaptive review mechanism was triggered: the system automatically called three diffusion models trained with different random seeds for secondary inference. The three models output M-type, M-type, and C-type classification results respectively. After majority voting, the classification result was finally confirmed as M-type; all three Hamiltonian classifications output level IV, which was directly confirmed. The patient sample was marked as awaiting manual review and stored in the review queue.

[0051] Finally, a visual output is generated based on the matching results. The system multiplies the normalized coordinates (0.18, 0.08) and (0.82, 0.08) of the hairline inflection point corresponding to the M-type in the optimal matching template by the original image width and height of 2048, respectively, mapping them back to pixel coordinates (369, 164) and (1679, 164). These two inflection points are marked with red dots on the original scalp image. The coordinates of the sparse center of the crown (0.50, 0.45) are mapped to pixel coordinates (1024, 922) and marked with a yellow cross. The measurement baseline connects the two inflection points to the reference point at the center of the forehead, marking the actual receding distances as 14 mm and 13 mm. A comparison bar chart is attached to the side of the image, displaying the patient's 26-dimensional interpretable parameter values ​​and the reference parameter values ​​of the M-type standard template side by side. Blue represents the patient's actual values, and orange represents the template reference values. Doctors can intuitively see the deviation of the two key indicators, hairline receding distance and crown density, from the template. The superimposed and annotated image is then fused with the original scalp image using a weighted average of 0.4 transparency to generate the final visualization result for clinicians' reference.

[0052] In summary, as can be seen from the above specific embodiments, the image-based artificial intelligence-based androgenetic alopecia classification and grading method provided in this application can complete the entire process from a single scalp image, sequentially including image preprocessing, conditional diffusion model inference to generate interpretable parameters, nearest neighbor matching mapping to obtain BASP classification and Hamiltonian grading, adaptive verification, and visual annotation output. This method compares the interpretable parameters generated by the diffusion model with clinical standard templates, ensuring both the objectivity and consistency of the classification and grading results, and providing traceable quantitative evidence for each decision step. This effectively solves the problems of inconsistent classification standards and difficulty in interpreting grading results in existing technologies.

[0053] Next, referring to the accompanying drawings, we describe the image-based artificial intelligence androgenic alopecia classification and grading system proposed according to embodiments of this application.

[0054] Figure 2 This is a block diagram of an image-based artificial intelligence androgenic alopecia classification and grading system according to an embodiment of this application.

[0055] like Figure 2 As shown, the image-based artificial intelligence androgenic alopecia classification and grading system 10 includes: an acquisition module 100, a generation module 200, a mapping module 300, and a labeling module 400.

[0056] Specifically, the acquisition module 100 is used to acquire scalp images of patients with androgenetic alopecia to be classified and graded; The generation module 200 is used to input scalp images into a pre-trained conditional diffusion model as conditional constraints, and generate classification and grading interpretable parameters through multi-step back diffusion inference; wherein, the classification and grading interpretable parameters include hairline topological parameters, crown density distribution parameters, and hair micromorphological parameters. The mapping module 300 is used to compare and map the interpretable parameters of the classification and grading through the nearest neighbor matching algorithm to obtain the BASP classification results and Hamilton classification results. The annotation module 400 is used to overlay annotations of key measurement locations and classification criteria on scalp images based on BASP classification results and Hamilton classification results, generating visualization results.

[0057] It should be noted that the foregoing explanation of the image-based artificial intelligence androgenic alopecia classification and grading method also applies to the image-based artificial intelligence androgenic alopecia classification and grading system of this embodiment, and will not be repeated here.

[0058] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include: The memory 301, the processor 302, and the computer program stored on the memory 301 and capable of running on the processor 302.

[0059] When the processor 302 executes the program, it implements the image-based artificial intelligence androgenic alopecia classification and grading method provided in the above embodiments.

[0060] Furthermore, electronic devices also include: Communication interface 303 is used for communication between memory 301 and processor 302.

[0061] The memory 301 is used to store computer programs that can run on the processor 302.

[0062] The memory 301 may include high-speed RAM (Random Access Memory) memory, and may also include non-volatile memory, such as at least one disk storage.

[0063] If the memory 301, processor 302, and communication interface 303 are implemented independently, then the communication interface 303, memory 301, and processor 302 can be interconnected via a bus to complete communication between them. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0064] Optionally, in a specific implementation, if the memory 301, processor 302, and communication interface 303 are integrated on a single chip, then the memory 301, processor 302, and communication interface 303 can communicate with each other through an internal interface.

[0065] Processor 302 may be a CPU (Central Processing Unit), an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of this application.

[0066] This application also provides a computer program product, including a computer program or instructions, which, when executed, implement the above-described image-based artificial intelligence androgenic alopecia classification and grading method.

[0067] Furthermore, this application also provides a computer program product, including a computer program or instructions, which, when executed, implement the above-described image-based artificial intelligence androgenic alopecia classification and grading method.

[0068] In the description of this specification, the references to the terms "an embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to a specific feature, structure, material, or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0069] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of those features. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0070] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0071] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or more of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (FPGAs), field-programmable gate arrays (FPGAs), etc.

[0072] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0073] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. An image-based artificial intelligence-based method for classifying and grading androgenetic alopecia, characterized in that, Includes the following steps: Obtain scalp images of patients with androgenetic alopecia awaiting classification and grading; The scalp image is input into a pre-trained conditional diffusion model as a conditional constraint, and classification and grading interpretable parameters are generated through multi-step back diffusion inference; wherein, the classification and grading interpretable parameters include hairline topological parameters, crown density distribution parameters, and hair micromorphological parameters. The classification and grading interpretable parameters are compared and mapped using the nearest neighbor matching algorithm to obtain the BASP classification results and Hamiltonian grading results. Based on the BASP classification results and Hamilton classification results, key measurement locations and classification criteria are overlaid on the scalp image to generate a visualization result.

2. The method according to claim 1, characterized in that, The conditional diffusion model is constructed as follows: The scalp image dataset was used as the training sample set; each training sample had manually labeled classification and grading reference parameters. The scalp images in the training sample set are processed to obtain input images with uniform size and pixel distribution; A feature extraction network is constructed to extract features from the input image to obtain image conditional features, and the image conditional features are used as conditional vectors. A denoising network is constructed. Gaussian noise is added to the classification and grading reference parameters during the forward diffusion stage. During the backward diffusion stage, the denoising network predicts and removes noise step by step based on the conditional vector. The parameters of the denoising network are iteratively trained by minimizing the joint loss function. The joint loss function consists of a noise prediction loss function and a parameter regression loss function, and a hairline topology conformal regularization term is added to constrain the hairline topology parameters to maintain geometric topological consistency during the denoising process. After training, the parameters of the feature extraction network and the denoising network are fixed to form the conditional diffusion model.

3. The method according to claim 2, characterized in that, The interpretable parameters for classification and grading are generated in the following ways: The scalp image to be detected is input into the conditional diffusion model, and the feature extraction network extracts features from the scalp image to obtain image conditional features, which are used as the initial conditional vector. Starting from random noise according to the preset number of diffusion steps, the denoising iteration is performed step by step along the reverse diffusion sequence. Each iteration is injected into the denoising network with the initial condition vector as a constraint. After completing all back-diffusion iterations, the denoised parameter vector is obtained; The parameter vector is split in dimensions and mapped numerically to output categorical and hierarchical interpretable parameters.

4. The method according to claim 1, characterized in that, The BASP classification results and Hamilton classification results were obtained through the following methods: A knowledge base for hair loss characteristics is constructed, wherein the knowledge base includes BASP classification standard templates and Hamilton classification standard templates, and each standard template corresponds to a set of classification and grading reference parameters; Based on all the standard templates in the aforementioned baldness characterization knowledge base, a standardized template vector set is established; Using the standardized template vector set as a comparison benchmark, the nearest neighbor matching algorithm is adopted, and the cosine distance is used as the similarity metric. The classification and grading interpretable parameters are compared and mapped one by one with the standardized template vector set. The similarity score between the classification and grading interpretable parameters and each standard template is calculated to determine the optimal matching template. When the similarity score is not lower than the corresponding preset confidence threshold, the BASP classification result and Hamilton classification result corresponding to the optimal matching template are output. When the similarity score is lower than the corresponding preset confidence threshold, it is judged as an unreliable match and the output is rejected.

5. The method according to claim 4, characterized in that, The visualization results were generated in the following manner: Based on the BASP classification results and Hamilton classification results, as well as the classification and grading reference parameters corresponding to the optimal matching template, the coordinates of the key measurement locations are determined. The coordinates of the key measurement locations are mapped back to the pixel coordinate system of the original scalp image to locate the hairline inflection point, the sparse center of the top of the head, and the hair follicle density sampling area. The measurement baseline, classification and grading numerical basis and parameter comparison information are superimposed at the corresponding positions, and a comparison bar chart between the classification and grading interpretable parameters and the classification and grading reference parameters corresponding to the optimal matching template is attached to the side of the image. The superimposed and annotated image is fused with the original scalp image to generate a visualization result.

6. The method according to claim 4, characterized in that, It also includes the quantification and adaptive verification steps for inference uncertainty: When the similarity score is lower than the preset review threshold, an adaptive review mechanism is triggered; wherein, the adaptive review mechanism includes automatically calling a diffusion model with multiple sets of differentiated parameters to perform secondary inference, outputting multi-model voting results, and marking low-confidence samples as pending manual review. When the similarity score is not lower than the preset review threshold, the final classification and grading results and visualization results are directly output.

7. An image-based artificial intelligence-based classification and grading system for androgenetic alopecia, characterized in that, include: The acquisition module is used to acquire scalp images of patients with androgenetic alopecia to be classified and graded. The generation module is used to input the scalp image into a pre-trained conditional diffusion model as a conditional constraint, and generate classification and grading interpretable parameters through multi-step back diffusion inference; wherein, the classification and grading interpretable parameters include hairline topological parameters, crown density distribution parameters, and hair micromorphological parameters. The mapping module is used to compare and map the categorical and hierarchical interpretable parameters using the nearest neighbor matching algorithm to obtain the BASP categorization results and Hamiltonian classification results. The annotation module is used to overlay annotations of key measurement locations and classification criteria onto the scalp image based on the BASP classification results and Hamilton classification results, generating a visualization result.

8. An electronic device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the program to implement the image-based artificial intelligence androgenic alopecia classification and grading method according to any one of claims 1-6.

9. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When a computer program or instruction is executed, it implements the image-based artificial intelligence method for classifying and grading androgenetic alopecia as described in any one of claims 1-6.

10. A computer program product, comprising a computer program or instructions, characterized in that, When a computer program or instruction is executed, it implements the image-based artificial intelligence method for classifying and grading androgenetic alopecia as described in any one of claims 1-6.