Package: derm-ita
derm_itaThis library has utilities to help evaluate skin tones in dermatology images. It can be broken
up between computing the individual typology angle(ITA) and converting the ITA value to a skin tone type.The skin tone classification metadata can enhance dermoscopic datasets when trying to evaluate fairness.Installationpip install derm-itaUsageITA computationfromderm_itaimportget_itafromPILimportImagewhole_image_ita=get_ita(image=Image.open("skin.png"))Classificationfromderm_itaimportget_kinyanjui_typekinyanjui_type=get_kinyanjui_type(whole_image_ita)Computing ITA valueThe ITA value is used as a proxy to evaluate the skin tone of an image.The ITA uses the following equationwhere L is luminance and b is amount of blue/yellowAll the approaches have the ability to remove the boarder. For those who are using these approaches
on dermoscopic datasets its advised that use the defaults to remove at least 4% of the boarder so the dark
corners will be removed for the ITA computation.The intended function calls will be availablehereFull image ITAOne ITA computation is conducted on the full image regardless of any extra artifacts such as skin markings, lesions
or stickers.Patch approachesEach of the following approaches will create patches of the image. Each patch will have the ITA value
computed and the median in the list will be use for the overall ITA value.Cropped CenterThe Cropped Center approach tries to select the most of the image as possible but a portion of the
center is removed. This is intended as many dermoscopic images have skin lesions in the center of the image
which could throw off the ITA result.More detailed info atCropped Center.Structured patchesThe Structured patches approach takes the first row, the last row, first column and last column will be
sampled for the ITA values.More detailed info atStructured Patches.Random patchesThe premise behind random patches is that a set of patches that do not overlap a generated and at random patches
be sampled to take the ITA value from. The thought would be that because its a random sample that the majority should
cover or represent the skin tone. It is possible that some patches could cover a skin lesion which will be address in
a future approach.
More detailed info atRandom Patches.Skin tone classificationThe Fitzpatrick scale was created to classify the different skin tones. Early reasearch was around
which different skin tones were affected by sun exposure[1].Example of fitzpatrick scaleFunctionsThe different scales to convert ITA to a skin tone can be found onskin_tone_classificationTable 1 Fitzpatrick rangesITA RangeSkin Tone Category55Â°< ITAType141Â°< ITA â‰¤ 55Â°Type228Â°< ITA â‰¤ 41Â°Type319Â°< ITA â‰¤ 28Â°Type410Â°< ITA â‰¤ 19Â°Type5ITA â‰¤ 10Â°Type6Table 2 Groh rangesITA RangeSkin Tone Category40Â°< ITAType123Â°< ITA â‰¤ 40Â°Type212Â°< ITA â‰¤ 23Â°Type30Â°< ITA â‰¤ 12Â°Type4-25Â°< ITA â‰¤ 0Â°Type5ITA â‰¤ -25Â°Type6Groh sourceKinyanjui rangesITA RangeSkin Tone Category55Â°< ITAVery Light48Â°< ITA â‰¤ 55Â°Light 241Â°< ITA â‰¤ 48Â°Light 134.5Â°< ITA â‰¤ 41Â°Intermediate 228Â°< ITA â‰¤ 34.5Â°Intermediate 118Â°< ITA â‰¤ 28Â°Tan210Â°< ITA â‰¤ 18Â°Tan1ITA â‰¤ 10Â°DarkKinyanjui sourceDel Bino rangesITA RangeSkin Tone Category55Â°< ITAVery Light41Â°< ITA â‰¤ 55Â°Light28Â°< ITA â‰¤ 41Â°Intermediate10Â°< ITA â‰¤ 28Â°Tan-30Â°< ITA â‰¤ 10Â°BrownITA â‰¤ -30Â°DarkDel Bino sourceSuggestionsBest used on dermoscopic images where the image is focused on a skin lesion.Contribute or report issuesIf you would like to contribute please submit aFeature request.If you find an issue please submit aBug Report