10.5826/dpc.1303a136
Introduction: Androgenic alopecia (AGA) staging is still based on macroscopic scales, yet the introduction of trichoscopy is gradually bringing an important change, even though it remains an eye-based method. However, recently developed artificial intelligence-assisted programs can execute automated count of trichoscopic patterns. Nevertheless, to interpret data elaborated by these programs can be complex. Machine learning algorithms might represent an innovative solution. Among them, support vector machine (SVM) models are among the best methods for classification.
Objectives: Our aim was to develop a SVM algorithm, based on three trichoscopic patterns, able to classify AGA patients and to calculate a severity index.
Methods: We retrospectively analyzed trichoscopic images from 200 AGA patients using Trichoscale Pro® software, calculating the number of vellus hair, empty follicles and single hair follicular units. Then, we elaborated a SVM model, based on these three patterns and on sex, able to classify patients as affected by mild AGA or moderate-severe AGA, and able to calculate the probability of the classification being correct, expressed as percentage (from 50% to 100%). This probability estimate is higher in patients with more AGA trichoscopic patterns and, thus, it might serve as a severity index.
Results: For training and test datasets, accuracy was 94.3% and 90.0% respectively, while the Area Under the Curve  was 0.99 and 0.95 respectively.
Conclusions: We believe our SVM model could be of great support for dermatologists in the management of AGA, especially in better assessing disease severity and, thus, in prescribing a more appropriate therapy.
text/xml
2160-9381
2870
en
Alfredo Rossi
https://creativecommons.org/licenses/by-nc/4.0
Dermatology Practical & Conceptual
staging
A Machine Learning Algorithm Applied to Trichoscopy for Androgenic Alopecia Staging and Severity Assessment
Text.Serial.Journal
https://dpcj.org/index.php/dpc
Original Article
2023-07-31
2022-09-26
2023-07-31
2023-08-24
e2023136
Dermatol Pract Concept
Introduction: Androgenic alopecia (AGA) staging is still based on macroscopic scales, yet the introduction of trichoscopy is gradually bringing an important change, even though it remains an eye-based method. However, recently developed artificial intelligence-assisted programs can execute automated count of trichoscopic patterns. Nevertheless, to interpret data elaborated by these programs can be complex. Machine learning algorithms might represent an innovative solution. Among them, support vector machine (SVM) models are among the best methods for classification.
Objectives: Our aim was to develop a SVM algorithm, based on three trichoscopic patterns, able to classify AGA patients and to calculate a severity index.
Methods: We retrospectively analyzed trichoscopic images from 200 AGA patients using Trichoscale Pro® software, calculating the number of vellus hair, empty follicles and single hair follicular units. Then, we elaborated a SVM model, based on these three patterns and on sex, able to classify patients as affected by mild AGA or moderate-severe AGA, and able to calculate the probability of the classification being correct, expressed as percentage (from 50% to 100%). This probability estimate is higher in patients with more AGA trichoscopic patterns and, thus, it might serve as a severity index.
Results: For training and test datasets, accuracy was 94.3% and 90.0% respectively, while the Area Under the Curve  was 0.99 and 0.95 respectively.
Conclusions: We believe our SVM model could be of great support for dermatologists in the management of AGA, especially in better assessing disease severity and, thus, in prescribing a more appropriate therapy.
Alfredo Rossi
2023/07/31
10.5826/dpc.1303a136
e2023136
Dermatology Clinic, Department of Clinical Internal, Anesthesiologic and Cardiovascular Sciences, Sapienza University of Rome, Roma, Italy
2160-9381
staging
en
e2023136
Hu R, Xu F, Han Y, Sheng Y, Qi S, Miao Y, Yang Q. Trichoscopic findings of androgenetic alopecia and their association with disease severity. J Dermatol. 2015;42(6):602-607. DOI: 10.1111/1346-8138.12857.. PMID: 25810236.
A Machine Learning Algorithm Applied to Trichoscopy for Androgenic Alopecia Staging and Severity Assessment
https://dpcj.org/index.php/dpc/article/download/2870/2199
           A Machine Learning Algorithm Applied
      to Trichoscopy for Androgenic Alopecia Staging
                  and Severity Assessment
   Marco Di Fraia1, Lorenzo Tieghi2, Francesca Magri1, Gemma Caro1, Simone Michelini1,
                            Giovanni Pellacani1, Alfredo Rossi1


1 Dermatology Clinic, Department of Clinical Internal, Anesthesiologic and Cardiovascular Sciences, Sapienza University of Rome, Roma,
  Italy
2 Department of Mechanical and Aerospace Engineering, Sapienza University of Rome, Roma, Italy



Key words: androgenic alopecia, trichoscopy, machine learning, support vector machine, staging
Citation: Di Fraia M, Tieghi L, Magri F, et al. A Machine Learning Algorithm Applied to Trichoscopy for Androgenic Alopecia Staging and
Severity Assessment. Dermatol Pract Concept. 2023;13(3):e2023136. DOI: https://doi.org/10.5826/dpc.1303a136
Accepted: December 7, 2022; Published: July 2023
Copyright: ©2023 Di Fraia et al. This is an open-access article distributed under the terms of the Creative Commons
Attribution-NonCommercial License (BY-NC-4.0), https://creativecommons.org/licenses/by-nc/4.0/, which permits unrestricted
noncommercial use, distribution, and reproduction in any medium, provided the original authors and source are credited.
Funding: None.
Competing Interests: None.
Authorship: All authors have contributed significantly to this publication.
Corresponding Author: Di Fraia Marco, Dermatology Clinic, Department of Clinical Internal, Anesthesiologic and Cardiovascular Sciences,
Sapienza University of Rome, Viale del Policlinico 155, 00161, Roma (RM), Italy. Email: marco.difraia@uniroma1.it




  ABSTRACT             Introduction: Androgenic alopecia (AGA) staging is still based on macroscopic scales, yet the intro-
                       duction of trichoscopy is gradually bringing an important change, even though it remains an eye-based
                       method. However, recently developed artificial intelligence-assisted programs can execute automated
                       count of trichoscopic patterns. Nevertheless, to interpret data elaborated by these programs can be
                       complex. Machine learning algorithms might represent an innovative solution. Among them, support
                       vector machine (SVM) models are among the best methods for classification.
                       Objectives: Our aim was to develop a SVM algorithm, based on three trichoscopic patterns, able to
                       classify AGA patients and to calculate a severity index.
                       Methods: We retrospectively analyzed trichoscopic images from 200 AGA patients using Trichoscale
                       Pro® software, calculating the number of vellus hair, empty follicles and single hair follicular units.
                       Then, we elaborated a SVM model, based on these three patterns and on sex, able to classify patients
                       as affected by mild AGA or moderate-severe AGA, and able to calculate the probability of the classifi-
                       cation being correct, expressed as percentage (from 50% to 100%). This probability estimate is higher
                       in patients with more AGA trichoscopic patterns and, thus, it might serve as a severity index.
                       Results: For training and test datasets, accuracy was 94.3% and 90.0% respectively, while the Area
                       Under the Curve was 0.99 and 0.95 respectively.




Original Article | Dermatol Pract Concept. 2023;13(3):e2023136                                                                           1
                       Conclusions: We believe our SVM model could be of great support for dermatologists in the manage-
                       ment of AGA, especially in better assessing disease severity and, thus, in prescribing a more appropri-
                       ate therapy.




Introduction                                                          for men and Sinclair scale for women. Fifty male patients
                                                                      were affected by mild AGA (20 classified as stage I and 30
Androgenic alopecia (AGA) is the most common form                     as stage II) and 50 by moderate-severe AGA (30 classified
of hair loss, affecting around 80% of men and 50% of                  as stage IV and 20 as stage V). As for men, women patients
women in the course of their life [1]. The fundamental role           were equally affected by mild AGA (50 classified as stage
of androgen hormones and genetic susceptibility in AGA                II) and moderate-severe AGA (50 classified as stage IV). At
pathogenesis has been widely demonstrated [2]. Nowa-                  the time of analysis, patients were naïve to any treatment
days, AGA staging is still based on macroscopic scales, like          for AGA and were not affected by any other scalp disease.
Norwood-Hamilton for men and Sinclair for women [3,4],                Patients images were collected in our outpatient clinic from
but the introduction of trichoscopy in scalp examination is           September 2019 to December 2021.
gradually bringing an important change. Analysis of tricho-              The scalp of all subjects was combed along the midline
scopic patterns, like vellus hairs or single hair follicular units,   to the sides and evaluated using the video-dermoscope Me-
helps dermatologists better assess disease activity, despite of       dicam 1000® (FotoFinder Systems GmbH). Digital tricho-
AGA extension [5]. However, trichoscopy remains an eye-               scopic photographs were obtained in standardized scalp
based method. In fact, it is almost impossible to count the           areas according to the patient sex. In women, this area corre-
exact number of patterns that are visualized per each field of        sponded to the intersection point between the line connect-
view. This task can be performed by recently developed arti-          ing the ears and the line connecting the tip of the nose to
ficial intelligence-assisted programs for hair analysis, which        the vertex. In men, the area was localized two centimeters
can execute automated count of hair density, hair diameter,           ahead of the point previously described for women. Field of
etc [6,7]. Nevertheless, to interpret data generated by these         view area was equivalent to 0.903 cm2. Photographs were
programs can be complex and time consuming. Machine                   collected at 20-fold magnification.
learning algorithms might represent an innovative solution.              Each trichoscopic image was analyzed with Trichoscale
These models are generated from sample data and their                 Pro® software (FotoFinder Systems GmbH), which allows
purpose is to make predictions or decisions without being             to perform accurate automatic measurements of scalp struc-
explicitly programmed to do so. Among them, support vec-              tures, with subsequent manual verification. In our study, we
tor machine (SVM) models are among the best methods for               considered the following trichoscopic patterns:
­classification [8]. Simply explained, given a set of subjects
labelled as belonging to one of two categories (training data-        1. vellus hairs (vellus hairs / total hairs ratio, expressed as
set), SVM algorithms are able to assign new subjects (test               percentage);
dataset) to one of the previous categories.                           2. single hair follicular units (single hair follicular units /
                                                                         total follicular units ratio, expressed as percentage);

Objectives                                                            3. empty follicles (number of empty follicles).


Our objective was to develop a SVM algorithm, based on                   We elaborated a SVM model based on these three pat-
three trichoscopic patterns, which could classify patients as         terns and on sex. This model is able to classify each patient
affected by mild AGA or moderate-severe AGA and could                 as affected by mild AGA or moderate-severe AGA. For each
elaborate a severity index for each patient.                          subject, the algorithm also calculates the probability of the
                                                                      classification being correct (from this point on referred to as

Methods                                                               “probability estimate”), expressed as percentage, ranging from
                                                                      50% (unreliable classification) to 100% (exact classification).
In this single-center observational retrospective study we               As common practice for these kinds of models [8], pop-
analyzed trichoscopic images from 200 patients (100 males             ulation was split into 70% (N = 140) as training and 30%
and 100 females) affected by AGA. Clinical (macroscopic)              (N = 60) as test set. For each dataset, we calculated the follow-
disease severity was assessed using Norwood-Hamilton scale            ing performance evaluation metrics: sensitivity (corresponding




2                                                                         Original Article | Dermatol Pract Concept. 2023;13(3):e2023136
to recall), specificity, positive predictive value (corresponding      Model performance metrics values, for training and test
to precision), negative predictive value, accuracy, receiver op-    datasets, are reported in Table 2.
erating characteristic curve (ROC) curve analysis.                     ROC curve analysis, for training and test datasets, are
    SVM model code is available upon direct request to the          reported in Figure 3.
authors.


Statistical Analysis                                                Conclusions
Mann-Whitney U test was used for comparison between                 In recent times, trichoscopy has become an essential tool
trichoscopic parameters. The SVM model is based on open-            for the diagnosis of hair loss disorders [5]. The analysis of
source codes. The code was developed in a Python 3.8 based          specific patterns allows dermatologists to perform accurate
framework. The probability estimate is mathematically de-           evaluation of disease severity and activity. However, this pro-
rived by normalizing the algorithm function by the weights          cess is inevitably subjective and eye based. The developing
of the hyperplane. Artificial intelligence was trained using        of new artificial intelligence programs [6,7], capable of pre-
the sklearn library.                                                cisely quantifying these patterns, opens new scenarios in the
                                                                    field of trichoscopy. In our study, we analyzed trichoscopic
Results                                                             images with Trichoscale Pro® software, and performed an
                                                                    accurate manual verification of the calculated values.
Medians and interquartile ranges of each trichoscopic pa-              In the study population, the percentage of vellus hairs,
rameter, for each study group, are listed in Table 1. All of        the percentage of single hair follicular units and the num-
the three parameters were significantly higher, both in men         ber of empty follicles were significantly higher in patients
and women, in patients affected by moderate-severe AGA              affected by clinical (using classical macroscopic scales)
compared to mild AGA patients (Table 1).                            moderate-severe AGA compared to clinical mild AGA pa-
    Trichoscopic parameter values for each patient, and             tients (Table 1), as expected according to literature [8].
the hyperplane function dividing mild AGA patients from             Nevertheless, 8% of patients diagnosed with clinical mild
moderate-sever ones, are reported in the 3D scatter plot            AGA were classified as affected by moderate-severe AGA
(Figure 1).                                                         patients by our model, which is based on trichoscopic pat-
    The estimates of correct classification, as a function of       terns. We presume this might be related to the fact that
the distance of the example from the decision boundary, for         clinical macroscopic observation alone is not sufficient
each patient of the training dataset, are reported in Figure 2.     to determine the real severity and activity of AGA. Ac-
                                                                    cording to our model, in fact, an increase in trichoscopic
  Table 1. Comparison between trichoscopic                          parameter values is correlated to a higher probability
  parameter values of mild AGA patients and                         (expressed as percentage) to be affected by m
                                                                                                                ­ oderate-severe
 moderate-severe ones (median and interquartile                     AGA. This probability estimate might serve as a severity
                    range).                                         index, given that, for patients classified as affected by
                    Mild      Moderate-severe              P        moderate-severe AGA, the more this value approaches
 Male (N=100)                                                       100%, the higher is the number of AGA trichoscopic find-

 Vellus hairs       27            46.5 (38-63)        < 0.0001      ings that are observed in the patient. On the contrary, for
 (%)              (21-32)                                           patients classified as affected by mild AGA, the more the
 Single hair        37             46 (39-35)         < 0.0001      estimate value approaches 100%, the lower is the number
 FU (%)           (32-42)                                           of AGA trichoscopic findings.
 Empty                0              1 (0-2)          < 0.0001         Our SVM model might be very useful in alerting der-
 follicles (N)      (0-0)                                           matologist about those patients presenting with not ex-
 Female (N=100)                                                     tensive alopecia, diagnosed as mild AGA according to
 Vellus hairs       33             62 (58-69)         < 0.0001      classical macroscopic scales, but actually affected by
 (%)              (27-40)                                           moderate-severe AGA, after trichoscopic analysis. As an ex-
 Single hair        45.5           54 (49-59)         < 0.0001      ample, a patient diagnosed with stage II AGA (according to
 FU (%)           (39-51)                                           Norwood-Hamilton scale), after Trichoscale Pro® analysis,
 Empty                0              1 (0-3)          = 0.0002      exhibits 42% vellus hairs, 45% single hair follicular units
 follicles (N)      (0-0)                                           and 1 empty follicle. Our algorithm classifies this patient
                                                                    as affected by moderate-severe AGA, with a probability
FU = follicular units.
* Mann-Whitney U-Test.                                              estimate of 77% (Figure 4).




Original Article | Dermatol Pract Concept. 2023;13(3):e2023136                                                                   3
    Figure 1. 3D scatter plot showing the three trichoscopic parameter values for each patient. The hyperplane function
    dividing mild androgenic alopecia (AGA) patients (red) from moderate-sever ones (blue) is colored in gray.




    Figure 2. The probability estimates of correct classification, as a function of the distance of the example from the deci-
    sion boundary, for each patient of the training dataset.



4                                                                       Original Article | Dermatol Pract Concept. 2023;13(3):e2023136
    The severity index elaborated by our machine learning                are considerably high, and for most patients (81.5%), values
model could also guide dermatologists in choosing the right              are higher than 80%.
treatment regimen for each patient. Indeed, subjects with                     Our study has of course some limitations. First of all,
a high probability to be affected by moderate-severe AGA                 Trichoscale Pro® analysis needed manual verification for
might benefit of a more aggressive therapeutic approach.                 some minor corrections in most of the cases (78%). This
Moreover, it could be useful for monitoring response to                  might be attributed to the fact that, in the analyzed scalp
therapy: a decreased probability estimate, calculated after a            areas, hairs were not cut to a short length, even if were accu-
treatment period, would mean that AGA severity is decreas-               rately combed to reach the best analysis result.
ing as well.                                                                  The major algorithm limitation is that, for patients with
    The high performance metrics values, like precision, ac-             a probability estimate near 50% (who actually are a small
curacy and recall, demonstrate that the algorithm, in our                minority of our study population), classification might be
study population, works extremely well as AGA classifier                 unreliable and would need dermatologist careful interpreta-
in the majority of cases. Obviously, the test dataset perfor-            tion. In this regard, we chose not to include stage III AGA
mance metrics values are lower than the training ones, as                patients (according to Norwood-Hamilton or Sinclair scales)
expected for this kind of machine learning models in order               because those subjects would have placed close to the al-
to avoid overfitting (it occurs when the model fits too closely          gorithm decision boundary and probably would have neg-
to the training set, and it is unable to generalize well to new          atively influenced the model performance. Nevertheless, the
data) [8]. The probability estimates curves slopes (Figure 2)            algorithm is suitable for all AGA stages, even though, in our
                                                                         opinion, it is best applicable in mild and moderate stages.
                                                                         In fact, the principal aim of our model is to reveal those pa-
        Table 2. Model performance metrics.                              tients presenting with a macroscopically appearing mild al-
                                                                         opecia although having a trichoscopically active disease that
                                  Train                 Test
                                                                         might quickly advance to more severe stages.
 Sensitivity                      94.2%               93.6%
                                                                              Naturally, it is necessary to test model’s ability to gener-
 Specificity                      94.4%               86.2%
                                                                         alize on a wider population sample, enrolling patients from
 PPV                              94.2%               87.8%
                                                                         centers familiar with the use of trichoscopic pattern analysis
 NPV                             94.4%                92.6%
                                                                         software like Trichoscale Pro®.
 Accuracy                         94.3%               90.0%                   Recently, artificial intelligence has made great progresses
 AUC                               0.99                 0.95             in the study of hair disorders, and many programs have
AUC = area under the curve; NPV = negative predictive value;             recently been developed for the automated count of hair
PPV = positive predictive value.                                         number, hair diameter and other trichoscopic patterns [6,7].




 Figure 3. Receiver operating characteristic curve (ROC) curve analysis, for training (left) and test (right) datasets.



Original Article | Dermatol Pract Concept. 2023;13(3):e2023136                                                                          5
    Figure 4. Example of model application. After macroscopic examination, a 20x trichoscopic photograph is taken and trichoscopic
    patterns are automatically analyzed by Trichoscale Pro® program. The calculated values are then inserted into the support vector
    machine (SVM) algorithm, which classify the patient as affected by moderate-severe androgenic alopecia (AGA), with a 77% prob-
    ability of the decision being correct.




However, based upon our knowledge, no algorithm has yet                     4. Biondo S, Goble D, Sinclair R. Women who present with female
been elaborated to classify patients affected by AGA, nei-                     pattern hair loss tend to underestimate the severity of their hair
                                                                               loss. Br J Dermatol. 2004;150(4):750-752. DOI: 10.1046/j.0007
ther to assess disease severity. For this reason, we believe our
                                                                               -0963.2003.05809.x. PMID: 15099373.
model could be of great support for dermatologists in the
                                                                            5. Starace M, Orlando G, Alessandrini A, Piraccini BM. Female An-
management of AGA, especially in defining a more precise                       drogenetic Alopecia: An Update on Diagnosis and Management.
staging and, thus, in prescribing a more appropriate therapy.                  Am J Clin Dermatol. 2020;21(1):69-84. DOI: 10.1007/s40257
                                                                               -019-00479-x. PMID: 31677111.
                                                                            6. Gupta AK, Ivanova IA, Renaud HJ. How good is artificial in-
References                                                                     telligence (AI) at solving hairy problems? A review of AI ap-
                                                                               plications in hair restoration and hair disorders. Dermatol
 1. Alessandrini A, Starace M, D’Ovidio R, et al. Androgenetic al-             Ther. 2021;34(2):e14811. DOI: 10.1111/dth.14811. PMID:
    opecia in women and men: Italian guidelines adapted from                   33496058.
    European Dermatology Forum/European Academy of Derma-                   7. Jartarkar S, Patil A, Waskiel-Burnat A, Rudnicka L, Starace M,
    tology and Venereology guidelines. G Ital Dermatol Venereol.               Grabbe S, Goldust M. Artificial Intelligence in Hair and Nail
    2020;155(5):622-631. DOI: 10.23736/S0392-0488.19.06399-5.                  Disorders. J Drugs Dermatol. 2022;21(10):1049-1052 DOI:
    PMID: 33295740.                                                            10.36849/JDD.6519. PMID: 36219051.
 2. Lolli F, Pallotti F, Rossi A, et al. Androgenetic alopecia: a review.   8. Cortes C, Vapnik V. Support-vector networks. Mach Learn.
    Endocrine. 2017;57(1):9-17. DOI: 10.1007/s12020-017-1280-y.                1995;20:273–297. DOI: 10.1007/BF00994018
    PMID: 28349362.                                                         9. Hu R, Xu F, Han Y, Sheng Y, Qi S, Miao Y, Yang Q. Tricho-
 3. Norwood OT. Male pattern baldness: classification and incidence.           scopic findings of androgenetic alopecia and their association
    South Med J. 1975;68(11):1359-1365. DOI: 10.1097/00007611                  with disease severity. J Dermatol. 2015;42(6):602-607. DOI:
    -197511000-00009. PMID: 1188424.                                           10.1111/1346-8138.12857. PMID: 25810236.




6                                                                               Original Article | Dermatol Pract Concept. 2023;13(3):e2023136
