Machine-learning-based tumor segmentation and classification using dynamic optical contrast imaging for thyroid cancer
Significance: Thyroid cancer is the most common endocrine malignancy, and diagnosis is often challenging due to overlapping features between benign and malignant nodules. Fine-needle aspiration, the clinical gold standard, frequently yields indeterminate results and lacks spatial context, leading to unnecessary surgeries. Real-time margin assessment also remains limited. There is a need for accurate, label-free, spatially resolved imaging. Dynamic optical contrast imaging (DOCI), which measures autofluorescence lifetimes of endogenous fluorophores, offers a promising platform for intraoperative cancer detection. Aim: We develop and evaluate a machine learning integrated DOCI framework to classify thyroid tissue subtypes and segment cancerous regions from ex vivo hyperspectral sections, with potential for real-time surgical use. Approach: Fresh ex vivo thyroid specimens were imaged using a 23-channel DOCI acquisition. A pixel-level principal component analysis (PCA) and logistic regression classifier produced tissue probabilities, aggregated by a regional majority-vote gate to categorize specimens as normal, follicular, or papillary. Tumor-specific squeeze-and-excitation U-Net models were trained on voxel-only inputs for semantic segmentation. PCA-guided channel ablation identified a reduced spectral subset, and the pipeline was retrained using a compact 12-channel input. Results: The first two PCA components explained over 70% of spectral variance and yielded well-separated tissue clusters. The regional PCA classifier achieved 92.3% validation accuracy and 100% accuracy on the test set. Full 23-channel U-Net models delivered strong segmentation (papillary: Dice nonempty 0.829, balanced Dice 0.914; follicular: Dice nonempty 0.618, balanced Dice 0.809). Reduced-channel models preserved most performance and improved follicular segmentation (Dice nonempty 0.762), confirming spectral redundancy. Conclusions: Integrating DOCI with interpretable machine learning enables accurate, label-free differentiation and segmentation of thyroid tissues. Channel reduction demonstrates that high performance is achievable with a compact spectral subset, supporting faster, more cost-efficient DOCI systems and future real-time intraoperative deployment.