BioniChaos Logo
  • Home
  • About
  • Contact

TRIAGE CONTROLS

LIVE CLINICAL METRICS

Sensitivity (TPR)
86.4%
Specificity (TNR)
86.4%
PPV (Precision)
53.2%
NPV (Rule-Out)
97.2%
Biopsy Rate
24.5%
False Alarm / Melanoma
0.89
Advanced Diagnostics & Matrix
AUC (Area Under Curve)
0.941
Youden's Index ($J$)
0.728
Scanned Population Count
0

Overview: Dermatological Biopsy Triage & Signal Detection Theory

In clinical dermatology, deciding whether to perform an invasive excisional or punch biopsy on a suspicious cutaneous lesion is a high-stakes probabilistic decision under uncertainty. The primary diagnostic challenge revolves around identifying early-stage malignant melanoma—a high-mortality skin cancer—while simultaneously minimizing unnecessary surgical trauma, cosmetic scarring, healthcare expenditures, and patient psychological stress caused by biopsying benign pigmented lesions such as dysplastic nevi, seborrheic keratoses, or dermatofibromas.

This interactive simulator formalizes clinical decision-making using Signal Detection Theory (SDT) and Receiver Operating Characteristic (ROC) analysis. Every patient present in a clinical setting exhibits a baseline internal lesion risk score derived from dermoscopic visual features (governed by the clinical ABCDE rule: Asymmetry, Border irregularity, Color variation, Diameter > 6mm, and Evolution) combined with systemic risk factors like age, personal history, and genetic predisposition. In this simulation model, benign lesions generate risk signals modeled by a standard Gaussian distribution $\mathcal{N}(0, \sigma^2)$, while malignant lesions yield higher risk scores conforming to a shifted Gaussian distribution $\mathcal{N}(d', \sigma^2)$.

The parameter $d'$ (d-prime) represents the physician's intrinsic diagnostic expertise, spatial feature discrimination, and perceptual accuracy. A higher $d'$ value physically separates the benign and malignant noise distributions, expanding the Area Under the ROC Curve (AUC). Conversely, the decision threshold $c$ models the clinician's internal caution or risk aversion. Adjusting $c$ slides the operating point along the non-linear ROC curve, illustrating the direct operational trade-off between True Positive Rate (Sensitivity / Cancer Detection) and False Positive Rate ($1 - \text{Specificity}$ / Unnecessary Biopsy Rate).

How to Use the Interactive Simulator Workspace

The laboratory dashboard integrates a real-time procedural dermoscopy skin scanner with two interactive mathematical visualizers:

  • Physician Expertise Slider ($d'$): Modulate the simulated doctor's clinical acuity from 0.5 (novice/inexperienced practitioner with high diagnostic overlap) up to 3.8 (expert dermatologist or high-performance AI classifier with clean signal separation). Watch how increasing expertise expands the upper-left curvature of the ROC graph and widens the separation between the dual signal density curves.
  • Caution Cutoff Slider ($c$): Adjust the diagnostic threshold barrier. Lowering the cutoff (sliding left) models a defensive, highly cautious practitioner who biopsies almost any ambiguous lesion to avoid missed melanomas, resulting in nearly 100% Sensitivity but triggering a massive spike in false alarms and unnecessary surgical procedures. Raising the cutoff (sliding right) models a strict threshold that reduces benign biopsies but risks missing subtle early-stage cancers (False Negatives).
  • Melanoma Prevalence Slider: Alter the epidemiological background risk of the simulated population from a routine primary care screening population (1%–5% prevalence) to a specialized tertiary pigmented lesion clinic (15%–50% prevalence). Note how prevalence dramatically impacts the Positive Predictive Value (PPV) even when Sensitivity and Specificity remain unchanged.
  • Patient Feed Controls: Click "NEXT PATIENT" to generate an immediate procedural lesion scan, or toggle "PAUSE FEED" to freeze the clinical queue. Observe the visual reticle analyze ABCDE characteristics while displaying live decision overlays ("BIOPSY RECOMMENDED" vs "BENIGN / OBSERVE").
  • Demo Mode & Audio Engine: Click "START DEMO" at the top of the control panel to lock into an automated parameter sweep exploring full ROC space trajectories. Click "STOP DEMO" or modify any control to resume manual override. Click the top-right audio toggle to enable synthesized clinical audio feedback (high pitch alert for biopsies, soft harmonic chime for benign observations).

Technical Details & Mathematical Implementation

The dynamic core calculates exact statistical probability metrics using standard continuous normal distribution integrations. For a given expertise $d'$ and decision cutoff $c$, the True Positive Rate (Sensitivity) and False Positive Rate ($1 - \text{Specificity}$) are computed via the standard normal cumulative distribution function $\Phi(x)$:

$$\text{TPR} = 1 - \Phi(c - d'), \quad \text{FPR} = 1 - \Phi(c)$$

To evaluate these integrals efficiently in zero-dependency JavaScript without external libraries, the simulator implements the Abramowitz and Stegun numerical approximation for the normal error function $\text{erf}(x)$, maintaining precision within $|E(x)| < 1.5 \times 10^{-7}$:

$$\Phi(x) = \frac{1}{2} \left[ 1 + \text{erf}\left(\frac{x}{\sqrt{2}}\right)\right]$$

Post-test clinical values, including Positive Predictive Value ($\text{PPV}$) and Negative Predictive Value ($\text{NPV}$), are computed dynamically incorporating population prevalence ($P$):

$$\text{PPV} = \frac{\text{TPR} \cdot P}{\text{TPR} \cdot P + \text{FPR} \cdot (1 - P)}, \quad \text{NPV} = \frac{(1 - \text{FPR}) \cdot (1 - P)}{(1 - \text{FPR}) \cdot (1 - P) + (1 - \text{TPR}) \cdot P}$$

Rendering occurs on a unified HTML5 Canvas context normalized for Retina/High-DPI displays using window.devicePixelRatio. Procedural skin lesions are synthesized using radial multi-harmonic sinusoids combined with pseudo-random pigment density maps to generate morphologically accurate benign nevi (smooth borders, uniform pigment) and malignant melanomas (jagged borders, asymmetric radial expansion, color variegation). All mathematical transformations feature rigorous boundary containment checks (wrapping isNaN or infinite metrics safely to zero) to guarantee non-blocking frame performance at 60 FPS under rapid user interaction.

Future Directions & Clinical Engineering Extensions

Future software iterations will expand this visualizer framework into multi-modal diagnostic fusion. Planned enhancements include incorporating multispectral dermoscopy reflectance data, continuous age-dependent skin elasticity modeling, and deep convolutional neural network (CNN) feature saliency map overlays. Furthermore, an economic utility module will allow users to customize monetary and quality-adjusted life year (QALY) weights for false positive biopsies versus delayed melanoma diagnoses, providing a comprehensive health economics decision-support framework.

Explore Related Interactive Environments

  • seizuresim/ - Brain seizure simulation and live 3D EEG layout.
  • emgesture/ - Electromyography gesture classification playground.
  • biocurveviz/ - Biological growth models and dynamic curve visualization.
  • cgm/ - Continuous Glucose Monitoring dynamics and metabolic simulation.