Back to home

Documentation

Complete reference for all Tricholens tools, methods, and scoring systems

Tricholens is a screening tool, not a diagnostic service. Results are estimates intended to help you track trends over time and identify areas worth discussing with a dermatologist. They should not be used as a substitute for professional medical evaluation.

1. Overview

Tricholens provides three standalone scalp tools plus an automated detection pipeline:

  • Hair Thickness — Manually measure individual hair widths on trichoscopy images with calibrated pixel-to-mm conversion, ethnic-adjusted classification, and AI chat.
  • Spot Analysis — Detect bright, reflective, or pigmented spots on the scalp (sebum, flaking, oily patches) using client-side image processing.
  • Self Assessment — Guided condition tagging with severity grading and a computed scalp health score.

The automated detection pipeline (sections 2–7) uses computer vision to count, classify, and analyse hairs from a single trichoscopy image.

Image Capture & Field of View

Users upload trichoscopy or close-up scalp images. If the physical dimensions of the image (in millimeters) are known, they can be provided for more accurate density calculations.

Default assumption: When the user does not provide physical dimensions, Tricholens assumes a field of view of 2.5 mm × 2.5 mm for a square image. For non-square images, the dimensions are scaled proportionally based on the aspect ratio.

2. Hair Detection (Computer Vision)

Tricholens uses a computer vision object detection model trained on trichoscopy images to identify individual hair follicles. The model returns bounding boxes and segmentation polygons for each detected hair.

  • Sensitivity: The model is tuned to favour detection over omission, prioritising the capture of finer and thinner hairs that are often early indicators of miniaturisation.
  • Duplicate prevention: Built-in overlap filtering ensures the same hair is not counted more than once when detection regions intersect.
  • Limitations: Detection accuracy depends on image quality, lighting, and hair colour contrast against the scalp. Very fine or light-coloured hairs may still be missed.

3. Hair Classification by Width

Each detected hair's cross-sectional width is computed directly from its segmentation polygon. The algorithm measures the polygon's narrow-axis span (perpendicular to the hair's length direction) and converts that pixel distance to millimeters using the calibrated field of view.

Hairs are classified by width in micrometers:

TypeWidthMeaning
Terminal≥ 60 µmThick, healthy, pigmented scalp hair
Intermediate30–60 µmTransitioning hair, a marker of miniaturization
Vellus< 30 µmFine, thin hair associated with hair loss

Ethnic-Adjusted Thresholds

Hair thickness varies naturally between ethnic groups. Tricholens adjusts classification thresholds to reflect published ethnic baselines.

TierAsian (80-120 µm)Caucasian (50-100 µm)African (40-90 µm)
Healthy Terminal≥ 80 µm≥ 65 µm≥ 55 µm
Normal≥ 60 µm≥ 50 µm≥ 40 µm
Thinning≥ 30 µm≥ 30 µm≥ 30 µm
Miniaturized< 30 µm< 30 µm< 30 µm

Plausibility Bounds & Auto-Calibration

Every measurement is checked against physical bounds that reflect biological limits:

BoundAsianCaucasianAfrican
Upper (max plausible)101 µm101 µm101 µm
Lower (visibility floor)10 µm (universal)

In magnification mode, the tool calculates a suggested correction using thin-hair-first scaling (anchoring to the thinnest measurement to keep it above 10 µm). In manual FOV mode, the tool warns the user to re-check their field-of-view dimensions but cannot suggest a specific correction.

4. Terminal:Vellus Ratio & Fallbacks

The T:V ratiois calculated as Terminal Hair Count ÷ Vellus Hair Count. A healthy scalp typically has a T:V ratio above 4.0.

When fewer than 3 terminal hairs are detected, Tricholens uses two alternative metrics:

  • Hair Maturity Index (HMI): A weighted score from 0 to 100. Terminal = 1.0, intermediate = 0.5, vellus = 0.0. Formula: HMI = ((terminal × 1.0 + intermediate × 0.5) ÷ total) × 100.
  • Intermediate:Vellus (I:V) Ratio: Shows the balance between transitioning hairs and fully miniaturized hairs. Higher I:V = more hairs still in transition.

5. Hair Count Rating

A composite score out of 100 combining:

  • 60% Hair Density: Hairs per cm², normalized against a reference of 250 hairs/cm² (capped at 300).
  • 40% Hair Type Quality: The Hair Maturity Index.

Score ranges: 70+ normal, 40–69 mild concern, below 40 moderate concern. Clamped between 10 and 100.

6. Hair Density

Density = Total Hairs Detected ÷ Image Area (cm²)

Normal density ranges from approximately 120 to 200 hairs/cm² depending on the scalp zone, ethnicity, and age.

7. AI Screening Summary

After detection, the image and all computed metrics are sent to a large language model which generates a screening summary. The AI acts as a screening assistant, references specific metrics, notes when fallback metrics are used, and always recommends consulting a dermatologist.

8. Hair Thickness Tool

The Hair Thickness tool allows users to manually measure individual hair widths on trichoscopy or close-up scalp images with full control over calibration and measurement placement.

8.1 Calibration

Two independent calibration modes:

  • Magnification mode (default):Set device magnification (5–2000x). Conversion: pixelsPerMm = (magnification / 50) × 512. Auto-calibration can suggest a corrected value.
  • Manual FOV mode:Enter physical field-of-view dimensions (width × height in mm). Conversion: pixelsPerMm = imageWidth / fovWidthMm. Auto-calibration warns but cannot suggest corrections.

EXIF metadata is extracted on upload (digital zoom, focal length, device info) to help verify calibration.

8.2 Measuring

Click two points across a hair shaft. Each measurement gets labeled start/end anchors (e.g., “1S”, “1E”). Start with the thinnest visible hair first for best auto-calibration results.

  • Zoom & pan: Scroll to zoom (up to 20x), drag to pan, reset view button
  • Hover highlighting: Hovering a canvas line highlights the sidebar card and vice versa
  • Click-to-navigate: Clicking a sidebar card pans the canvas to that measurement
  • Anchor editing: Reposition individual start/end points via sidebar buttons
  • Collapsible cards: Click cards to collapse to a compact one-line view; expand all/collapse all toggle available

8.3 Hair Segments

Multiple measurements along the same hair can be grouped into segments, rendered as filled polygons on the canvas.

  • Auto-segmentation: Uses parallel angle (<25°), proximity (<8× avg length), and perpendicular alignment criteria with a Union-Find algorithm.
  • Manual control: Create, rename, delete segments. Add/remove measurements with checkboxes.
  • Per-segment stats: Average width, classification tier, click-to-navigate.

8.4 Classification & Reporting

Each measurement is classified in real-time using ethnic-adjusted thresholds. Users can:

  • Save a report to their account (Firebase) with all measurements, classifications, calibration, and segments
  • Export the image as a full-resolution PNG with all overlays burned in

8.5 AI Assistant

A resizable chat widget docked below the canvas provides:

  • Initial analysis: Image + measurement data → structured screening with severity rating, summary, assessment, and recommendations
  • Follow-up chat: Multi-turn conversation with full context maintained
  • Adjustable panel: Drag to resize (120–600px), collapse/expand header

9. Spot Analysis Tool

The Spot Analysis tool detects bright, reflective, or pigmented regions on the scalp — such as sebum buildup, oily patches, or flaking — using client-side image processing.

9.1 Detection Algorithm

The tool processes the uploaded image entirely in the browser (no server round-trip):

  1. The image is downscaled to a maximum of 800px on the longest side for performance
  2. Each pixel is converted to a brightness value using the luminance formula: 0.299R + 0.587G + 0.114B
  3. Pixels above the brightness threshold are marked as spot candidates
  4. Connected component labeling (4-connected flood fill) groups adjacent spot pixels into blobs
  5. Blobs smaller than the minimum spot size are filtered out as noise
  6. Remaining blobs are counted and their total pixel coverage is calculated as a percentage

9.2 Baseline Settings

ParameterBaseline ValueDescription
Brightness threshold180Luminance value (0–255) above which a pixel is flagged. Lower = more sensitive.
Minimum spot size8 pxConnected blobs smaller than this are discarded as noise.

These defaults work well for most trichoscopy images. Users can adjust both parameters via the settings panel, with a one-click reset to baseline available when values have been changed.

9.3 Coverage Rating

The spot coverage percentage is rated on a three-tier scale:

CoverageRating
≤ 33%Good
34–60%Moderate
> 60%Significant

9.4 Overlay, Zoom & Crop

Detected spots are rendered as a pink/magenta overlay on a dimmed version of the original image. Users can toggle between overlay and original views. The image supports full zoom (scroll or buttons, 0.5x–20x) and pan (click and drag) for detailed inspection of individual spots.

All three tools (Hair Thickness, Spot Analysis, Self Assessment) include a crop tool that lets users draw a rectangle on the image to isolate a region of interest before analysis. This is useful for focusing on a specific area of the scalp or removing unwanted background. The cropped image replaces the original and can be downloaded.

10. Self Assessment Tool

The Self Assessment tool provides a structured way for users to log observed scalp conditions, rate their severity, and track changes over time.

10.1 Condition Categories

Users tag conditions they observe in their scalp image from the following categories:

ConditionDescription
Oily ScalpExcess sebum around follicles, shiny or greasy appearance
Dry ScalpFlaky, tight skin with visible dryness and possible irritation
DandruffWhite or yellowish flakes attached to the scalp or hair base
Sensitive / RednessVisible redness, irritation, or broken capillaries
Seborrheic DermatitisOily, scaly patches with yellowish crusting around follicles
InflammationRed, swollen areas around follicles, possible pustules
Hair Loss PatternVisible thinning, widened parting, or exposed scalp skin

10.2 Severity Levels

Each tagged condition is rated on a 5-point severity scale:

LevelLabelPenalty Weight
1Minimal0 (no impact on health score)
2Mild1
3Moderate2
4Significant3
5Severe4

10.3 Scalp Health Score

The health score is a 0–100 rating computed from all tagged conditions and their severity levels. Level 1 (Minimal) carries zero penalty — tagging a condition as minimal means it's not really a concern. Penalties only accumulate from Level 2 onward.

penalty = Σ(severityLevel - 1) for each tagged condition
maxPenalty = 7 categories × 4 max penalty = 28
healthScore = 100 - (penalty / maxPenalty) × 100

Score interpretation:

ScoreLabelExample
80–100HealthyAll conditions minimal, or no conditions tagged
60–79Mild ConcernsA few conditions at mild severity
40–59Needs AttentionMultiple moderate conditions
20–39Significant ConcernsSeveral significant conditions
0–19Consult a SpecialistWidespread severe conditions

10.4 Saving & History

Signed-in users can save assessments to their account (Firebase). Each saved report stores all tagged conditions, severity levels, the computed health score, and any notes. Past assessments are accessible from the History view, allowing users to track their scalp health over time. Reports can be individually deleted.

10.5 Image Viewer

The uploaded scalp image is displayed alongside the assessment panel with full zoom (scroll or buttons, 0.5x–20x) and pan (click and drag) support for detailed visual comparison while tagging conditions.

11. Limitations & Disclaimers

  • Tricholens is not a medical device and does not provide diagnoses.
  • Results are estimates that depend heavily on image quality, lighting, magnification, and device type.
  • The default 2.5 mm field of view assumption may not match your actual device. Providing known dimensions improves accuracy.
  • Hair width classification thresholds are based on published trichoscopy literature but are applied to computer vision estimates, not laboratory-grade measurements.
  • Very fine, light-colored, or overlapping hairs may not be detected by the model.
  • Spot analysis depends on lighting conditions — uneven illumination can produce false positives or negatives.
  • Self assessment health scores are subjective and depend on the user's visual interpretation of their scalp.
  • This tool is best suited for tracking relative changes over time using consistent image capture, rather than as a one-time absolute measurement.

For best results: Use the same device and magnification for each session, capture images in consistent lighting, and provide the physical dimensions (mm) of your field of view if known.