Skip to main content

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

Groh source

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

Kinyanjui source

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

Del Bino source

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.

Source Distribution

derm_ita-0.0.8.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

derm_ita-0.0.8-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file derm_ita-0.0.8.tar.gz.

File metadata

  • Download URL: derm_ita-0.0.8.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1

File hashes

Hashes for derm_ita-0.0.8.tar.gz
Algorithm Hash digest
SHA256 66e8d4cf17cf38f2e876611ccebe145a0c7b772c34442482b5da0d1e05a7134d
MD5 78963560d816b4a7257676cf524dcb37
BLAKE2b-256 65d0d946a9edbcdee374ca2a47fbb9c68ec45e27ed2e4dc4e1cdf8c758a623da

See more details on using hashes here.

File details

Details for the file derm_ita-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: derm_ita-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1

File hashes

Hashes for derm_ita-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c137d1e3506f75657c1a5261451089e41da4cf63b00cff0f1ab454d99d8917d5
MD5 8dab060ca473400c3517f42b00e17246
BLAKE2b-256 80afc4d1313e3bd7c2364fe6fd41b00fb967a3f864a9a82fbc61ee9f25fa062e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page