Skip to main content
The skin cancer detection model classifies dermatological images into seven distinct categories of skin lesions. Understanding these classifications is essential for interpreting the model’s predictions and assessing their clinical significance.

Classification overview

The model outputs a probability distribution across seven classes, each representing a specific type of skin lesion:

Malignant lesions

Cancerous or pre-cancerous conditions requiring medical attention:
  • Actinic Keratoses
  • Basal Cell Carcinoma
  • Melanoma

Benign lesions

Non-cancerous conditions with lower clinical urgency:
  • Benign Keratoses
  • Dermatofibroma
  • Melanocytic Nevus
  • Vascular Lesion
While the model categorizes lesions as malignant or benign, all predictions should be verified by a qualified dermatologist. This tool is designed to assist screening, not replace professional medical diagnosis.

The seven classification categories

1. Actinic Keratoses (akiec)

Class index: 0 Medical classification: Pre-cancerous lesion Description: Actinic keratoses are rough, scaly patches on the skin caused by years of sun exposure. They are considered pre-cancerous because a small percentage can progress to squamous cell carcinoma if left untreated.
Appearance:
  • Rough, dry, or scaly patches
  • Flat to slightly raised
  • Color ranges from pink to red to brown
  • Typically 1-3 cm in diameter
  • Texture often described as feeling like sandpaper
Common locations:
  • Face and ears
  • Scalp (especially in balding areas)
  • Backs of hands
  • Forearms and shoulders
  • Any sun-exposed area
High-risk populations:
  • Fair-skinned individuals
  • People over 40 years old
  • Those with significant sun exposure history
  • Immunosuppressed patients
Prevalence: Very common in older adults, affecting more than 40 million Americans annually
Treatment options:
  • Cryotherapy (freezing)
  • Topical medications (5-fluorouracil, imiquimod)
  • Photodynamic therapy
  • Curettage or laser therapy
Prognosis: Excellent when treated early. 5-10% risk of progression to squamous cell carcinoma if untreated.

2. Basal Cell Carcinoma (bcc)

Class index: 1 Medical classification: Malignant (cancerous) but rarely metastatic Description: Basal cell carcinoma is the most common form of skin cancer. It develops in the basal cells of the skin’s epidermis and rarely spreads to other parts of the body, but can cause significant local damage if not treated.
Appearance:
  • Pearly or waxy bump
  • Flat, flesh-colored or brown scar-like lesion
  • Bleeding or oozing sore that heals and returns
  • Pink growth with raised, rolled border and central depression
Variants:
  • Nodular (most common): Pearly, dome-shaped bump
  • Superficial: Red, scaly patch
  • Morpheaform: Scar-like, firm lesion
  • Pigmented: Brown, blue, or black appearance
High-risk factors:
  • Chronic sun exposure
  • Fair skin, blonde or red hair, light-colored eyes
  • History of sunburns, especially in childhood
  • Previous skin cancer
  • Radiation therapy
  • Weakened immune system
Prevalence: Most common cancer in humans, with over 4 million cases diagnosed annually in the United States
Treatment options:
  • Surgical excision
  • Mohs micrographic surgery (for high-risk areas)
  • Curettage and electrodesiccation
  • Radiation therapy
  • Topical treatments for superficial types
Prognosis: Cure rate exceeds 95% when detected and treated early. Metastasis is extremely rare (less than 0.1% of cases).

3. Benign Keratoses (bkl)

Class index: 2 Medical classification: Benign (non-cancerous) Description: Benign keratoses include seborrheic keratoses and other benign skin growths. These are harmless, non-cancerous growths that appear with aging and do not require treatment unless they cause discomfort or cosmetic concerns.
Appearance:
  • Brown, black, or tan growths
  • Waxy, slightly raised appearance
  • “Stuck-on” look, as if painted onto the skin
  • Round or oval shape
  • Texture can be smooth or rough
  • Size varies from very small to over 1 inch
Common presentations:
  • Seborrheic keratoses: Most common type
  • Solar lentigo: Flat, brown spots from sun exposure
  • Lichenoid keratosis: Inflamed variant, may be red or purple
Occurrence patterns:
  • Increases with age (most common after 50)
  • Genetic predisposition
  • No direct relationship with sun exposure
  • Can appear anywhere on the body except palms and soles
Prevalence: Extremely common; most adults over 50 have at least one
When to treat:
  • Cosmetic concerns
  • Irritation from clothing or jewelry
  • Itching or bleeding
  • Diagnostic uncertainty (to rule out melanoma)
Removal methods:
  • Cryotherapy
  • Curettage
  • Electrocautery
  • Laser therapy
Important: No malignant potential, but can occasionally be confused with melanoma.

4. Dermatofibroma (df)

Class index: 3 Medical classification: Benign (non-cancerous) Description: Dermatofibromas are common, benign skin nodules composed of fibrous tissue. They are typically firm to the touch and often develop after minor skin trauma, such as insect bites or small injuries.
Appearance:
  • Firm, raised bump
  • Color ranges from pink to red-brown to dark brown
  • Usually 0.5-1 cm in diameter
  • May feel like a hard marble under the skin
  • “Dimple sign”: Pinching causes dimpling of the center
Texture and feel:
  • Hard or rubbery consistency
  • May be slightly tender when pressed
  • Generally asymptomatic
Common triggers:
  • Insect bites
  • Minor skin trauma
  • Splinters or thorns
  • Folliculitis
Demographics:
  • More common in women
  • Typically appears in young to middle-aged adults
  • Usually found on legs, but can occur anywhere
Behavior: Grows slowly, may fade over years but often persists
Observation:
  • No treatment necessary for typical dermatofibromas
  • Benign with no cancer risk
  • Does not require biopsy if diagnosis is confident
Removal considerations:
  • Requested for cosmetic reasons
  • Causes discomfort or repeated irritation
  • Diagnosis is uncertain
Removal methods:
  • Surgical excision (may leave scar)
  • Cryotherapy (partial removal)
  • Laser therapy

5. Melanoma (mel)

Class index: 4 Medical classification: Malignant (cancerous) with metastatic potential Description: Melanoma is the most dangerous form of skin cancer. It develops in melanocytes (pigment-producing cells) and has a high potential to spread to other organs if not detected and treated early.
A - Asymmetry: One half doesn’t match the other halfB - Border irregularity: Edges are ragged, notched, or blurredC - Color variation: Multiple colors (brown, black, tan, red, white, blue)D - Diameter: Larger than 6mm (pencil eraser size), though can be smallerE - Evolving: Changing in size, shape, color, or elevation; new symptoms like bleeding or itchingAdditional warning signs:
  • Sore that doesn’t heal
  • Spread of pigment beyond border
  • Redness or swelling
  • Itching, tenderness, or pain
Superficial spreading melanoma (70%):
  • Most common type
  • Grows horizontally before invading deeper
  • Can arise in existing mole
Nodular melanoma (15-30%):
  • Aggressive form
  • Grows vertically into skin
  • Often appears as dark bump
Lentigo maligna melanoma (10-15%):
  • Develops in sun-damaged skin
  • Common in elderly on face and arms
Acral lentiginous melanoma (5%):
  • Occurs on palms, soles, under nails
  • More common in darker skin tones
Major risk factors:
  • Personal or family history of melanoma
  • Many moles (over 50) or atypical moles
  • Fair skin, light hair, light eyes
  • Severe sunburns, especially in childhood
  • Tanning bed use
  • Immunosuppression
  • Older age (risk increases with age)
Statistics:
  • Over 100,000 new cases annually in the United States
  • Accounts for 1% of skin cancers but majority of skin cancer deaths
  • 5-year survival rate: 99% if detected early (localized), 27% if spread to distant organs
Staging determines treatment:Stage 0-II (localized):
  • Surgical excision with margins
  • Sentinel lymph node biopsy for thicker lesions
Stage III (regional spread):
  • Wide excision
  • Lymph node dissection
  • Immunotherapy or targeted therapy
Stage IV (metastatic):
  • Systemic therapy (immunotherapy, targeted therapy)
  • Radiation for symptom control
  • Clinical trials
Prognosis factors:
  • Breslow thickness (depth of invasion)
  • Ulceration
  • Mitotic rate
  • Lymph node involvement
  • Distant metastasis
Melanoma is the most critical classification for this model to identify accurately. Any suspicious lesion flagged as possible melanoma should receive immediate dermatological evaluation.

6. Melanocytic Nevus (nv)

Class index: 5 Medical classification: Benign (non-cancerous) Description: Melanocytic nevi, commonly called moles, are benign proliferations of melanocytes (pigment cells). While benign, monitoring is important as melanoma can occasionally arise from pre-existing moles.
Typical appearance:
  • Round or oval
  • Uniform brown, tan, or pink color
  • Clearly defined borders
  • Flat or slightly raised
  • Diameter typically less than 6mm
  • Symmetrical appearance
Types of nevi:Congenital nevi: Present at birth
  • Size varies from small to giant
  • Slightly higher melanoma risk for large variants
Acquired nevi: Develop during childhood and early adulthood
  • Most common type
  • Peak numbers in 20s-30s, then gradually fade
Atypical (dysplastic) nevi: Unusual appearance
  • Irregular borders
  • Variable coloring
  • Larger than typical moles
  • Higher melanoma risk marker
Growth pattern:
  • Appear during childhood and adolescence
  • Peak mole count in 20s-40s
  • Gradually fade or disappear in older age
  • Most adults have 10-40 moles
Evolution stages:
  • Junctional nevus (flat, at dermal-epidermal junction)
  • Compound nevus (slightly raised)
  • Intradermal nevus (dome-shaped, flesh-colored)
Normal mole characteristics:
  • Appears before age 30
  • Symmetrical
  • Uniform color
  • Stable over time
  • Similar to other moles on body
Warning signs (see dermatologist):
  • New mole after age 30
  • Changes in size, shape, or color
  • ABCDE criteria present
  • Itching, bleeding, or crusting
  • Looks different from other moles (“ugly duckling sign”)
Monitoring approach: Photograph moles and compare over time to detect changes
Observation: Most moles require no treatmentRemoval indications:
  • Suspicious features warranting biopsy
  • Cosmetic concerns
  • Repeated irritation from clothing or jewelry
  • Patient anxiety
Removal methods:
  • Excisional biopsy (complete removal with margin)
  • Shave excision (for clearly benign, raised moles)
  • Pathological examination to confirm benign nature
Distinguishing between benign melanocytic nevi and melanoma is one of the most challenging aspects of dermatological AI. The model may occasionally confuse these categories due to their visual similarity.

7. Vascular Lesion (vasc)

Class index: 6 Medical classification: Benign (non-cancerous) Description: Vascular lesions are benign skin conditions caused by abnormal blood vessels. This category includes various types such as cherry angiomas, spider angiomas, and other vascular birthmarks.
General appearance:
  • Red, pink, or purple discoloration
  • May be flat or raised
  • Blanch (turn white) when pressed
  • Size varies widely
Common types:Cherry angiomas (most common):
  • Bright red, dome-shaped bumps
  • 1-5mm in diameter
  • Increase with age
  • Commonly on trunk
Spider angiomas:
  • Central red spot with radiating vessels
  • Blanches from center outward
  • Common on face, neck, upper trunk
Port-wine stains:
  • Flat, pink to red birthmarks
  • Present from birth
  • Gradually darken and thicken with age
Cherry angiomas:
  • Benign proliferation of capillaries
  • Increase in number with age
  • Genetics play a role
  • Nearly universal in people over 70
Spider angiomas:
  • Associated with pregnancy, liver disease, or normal occurrence
  • May resolve spontaneously
  • Increased estrogen levels contribute
Port-wine stains:
  • Congenital capillary malformation
  • Present at birth
  • Do not resolve spontaneously
  • May be associated with syndromes (e.g., Sturge-Weber)
Generally benign: No cancer riskWhen to investigate further:
  • Sudden appearance of multiple spider angiomas (may indicate liver disease)
  • Bleeding or painful vascular lesions
  • Rapid growth or change
  • Located in cosmetically sensitive area
Associated conditions:
  • Spider angiomas: Liver cirrhosis, pregnancy, hyperthyroidism
  • Multiple cherry angiomas: Normal aging; very rarely associated with systemic disease
Indications for treatment:
  • Cosmetic concerns
  • Bleeding (especially for traumatized lesions)
  • Patient preference
Treatment methods:
  • Laser therapy (pulsed dye laser most effective)
  • Electrocautery
  • Cryotherapy
  • Surgical excision (rarely needed)
Prognosis: Excellent. Treatments are highly effective with minimal scarring.

Model output interpretation

The model outputs seven probability scores (one per class) that sum to 1.0:
{
  "Actinic Keratoses": 0.05,
  "Basal Cell Carcinoma": 0.12,
  "Benign Keratoses": 0.08,
  "Dermatofibroma": 0.03,
  "Melanoma": 0.62,
  "Melanocytic Nevus": 0.08,
  "Vascular Lesion": 0.02
}
In this example, the model predicts Melanoma with 62% confidence, followed by Basal Cell Carcinoma at 12%. The user should be advised to consult a dermatologist immediately given the high melanoma probability.

Classification confidence thresholds

When interpreting results, consider implementing confidence thresholds:
Confidence LevelRecommendation
Above 80%High confidence prediction; still recommend professional verification
50-80%Moderate confidence; definitely consult dermatologist
30-50%Low confidence; multiple possibilities, professional evaluation essential
Below 30%Very uncertain; model cannot reliably classify, seek expert opinion
Regardless of confidence level, this model should never be used as a replacement for professional medical diagnosis. All concerning lesions should be evaluated by a qualified dermatologist.

Common classification challenges

Melanoma vs. melanocytic nevus

The most critical challenge. Both are pigmented lesions arising from melanocytes. ABCDE criteria help distinguish, but subtle cases require expert evaluation.

Actinic keratoses vs. benign keratoses

Can appear similar, but actinic keratoses are rougher, occur in sun-exposed areas, and have malignant potential.

Basal cell carcinoma variants

Multiple subtypes (nodular, superficial, pigmented) can mimic other lesions like melanoma or benign growths.

Image quality impact

Lighting, focus, and image angle significantly affect classification accuracy. Clear, well-lit images yield best results.

Clinical decision support

This classification system is designed as a screening tool, not a diagnostic device:

Appropriate uses

  • Initial triage of concerning lesions
  • Educational tool for understanding skin cancer types
  • Encouraging individuals to seek professional evaluation
  • Monitoring lesion changes over time (with photos)

Inappropriate uses

  • Definitive medical diagnosis
  • Treatment planning without biopsy confirmation
  • Avoiding dermatologist visits for suspicious lesions
  • Self-diagnosis of skin cancer
Regulatory consideration: This model is not FDA-approved as a medical device and should not be marketed or used as a substitute for professional dermatological evaluation.

Next steps

Model architecture

Understand the CNN architecture that performs classification

Training process

Learn how the model was trained on dermatological images

Build docs developers (and LLMs) love