A package with different strategies to compute individual typology angle
Project description
derm_ita
This 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.
Installation
pip install derm-ita
Usage
ITA computation
from derm_ita import get_ita
from PIL import Image
whole_image_ita = get_ita(image=Image.open("skin.png"))
Classification
from derm_ita import get_kinyanjui_type
kinyanjui_type = get_kinyanjui_type(whole_image_ita)
Computing ITA value
The ITA value is used as a proxy to evaluate the skin tone of an image.
The ITA uses the following equation
where L is luminance and b is amount of blue/yellow
All 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 available here
Full image ITA
One ITA computation is conducted on the full image regardless of any extra artifacts such as skin markings, lesions or stickers.
Patch approaches
Each 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 Center
The 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 at Cropped Center.
Structured patches
The 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 at Structured Patches.
Random patches
The 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 at Random Patches.
Skin tone classification
The 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 scale
Functions
The different scales to convert ITA to a skin tone can be found on skin_tone_classification
Table 1 Fitzpatrick ranges
ITA Range | Skin Tone Category |
---|---|
55° < ITA | Type1 |
41°< ITA ≤ 55° | Type2 |
28°< ITA ≤ 41° | Type3 |
19°< ITA ≤ 28° | Type4 |
10°< ITA ≤ 19° | Type5 |
ITA ≤ 10° | Type6 |
Table 2 Groh ranges
ITA Range | Skin Tone Category |
---|---|
40° < ITA | Type1 |
23°< ITA ≤ 40° | Type2 |
12°< ITA ≤ 23° | Type3 |
0°< ITA ≤ 12° | Type4 |
-25°< ITA ≤ 0° | Type5 |
ITA ≤ -25° | Type6 |
Kinyanjui ranges
ITA Range | Skin Tone Category |
---|---|
55° < ITA | Very Light |
48°< ITA ≤ 55° | Light 2 |
41°< ITA ≤ 48° | Light 1 |
34.5°< ITA ≤ 41° | Intermediate 2 |
28°< ITA ≤ 34.5° | Intermediate 1 |
18°< ITA ≤ 28° | Tan2 |
10°< ITA ≤ 18° | Tan1 |
ITA ≤ 10° | Dark |
Del Bino ranges
ITA Range | Skin Tone Category |
---|---|
55° < ITA | Very Light |
41°< ITA ≤ 55° | Light |
28°< ITA ≤ 41° | Intermediate |
10°< ITA ≤ 28° | Tan |
-30°< ITA ≤ 10° | Brown |
ITA ≤ -30° | Dark |
Suggestions
- Best used on dermoscopic images where the image is focused on a skin lesion.
Contribute or report issues
If you would like to contribute please submit a Feature request.
If you find an issue please submit a Bug Report
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.