Detection and Classification of Hysteroscopic Images Using Deep Learning.

Cancers (Basel) 2024 AI 6 Explanations View Original
Original Paper (PDF)

Unable to display PDF. Download it here or view on PMC.

Plain-English Explanations
Pages 1-2
The Expertise Gap in Hysteroscopy Diagnosis

When a woman presents with abnormal uterine bleeding, the standard diagnostic tool is hysteroscopy - a procedure where a thin camera is inserted into the uterine cavity to allow direct visual inspection of the endometrium. Any suspicious area identified during this inspection is then biopsied for histopathological examination. This combination of visual assessment and tissue sampling is considered the gold standard for diagnosing endometrial pathology.

However, a significant limitation of hysteroscopy is its dependence on operator expertise. The gynecologist must recognize subtle visual differences between benign lesions (such as polyps and fibroids), non-cancerous but abnormal tissue (endometrial hyperplasia without atypia), and precancerous or cancerous tissue (atypical hyperplasia and endometrial carcinoma). The visual distinction between these categories can be difficult even for experienced operators. Endometrial hyperplasia in particular may closely resemble normal tissue or benign polyps, increasing the risk of missed diagnosis.

Deep learning - a form of artificial intelligence where neural networks learn to recognize patterns from large numbers of labeled examples - has shown promise in image-based medical diagnostics including breast cancer screening and cervical cancer lymph node detection. The question this study asked was whether a deep learning model could be trained to automatically detect the presence of lesions in hysteroscopic images and classify those lesions into benign, diffuse, or preneoplastic/neoplastic categories - potentially reducing the dependence on specialized endoscopic expertise.

TL;DR: Hysteroscopy diagnosis depends heavily on operator expertise, and this study investigated whether deep learning could automate the detection and classification of endometrial lesions from hysteroscopic images.
Pages 2-4
Two-Task Model: Detection and Classification from Real Hysteroscopies

The study reviewed hysteroscopies performed between January and May 2021 at a single Italian center. From 703 patients who underwent hysteroscopy, 266 with pathologically confirmed intrauterine lesions and adequate imaging documentation were included. A total of 1,500 images were extracted from stored hysteroscopic videos and stills, with an average of 5.6 images per patient. The images came from two different hysteroscopic systems - one high-definition and one standard-definition - adding real-world variability to the dataset.

Lesions were assigned to one of three categories: benign focal lesions (polyps and myomas, n=186 patients), benign diffuse lesions (polypoid endometrium and non-atypical hyperplasia, n=25 patients), and preneoplastic/neoplastic lesions (atypical hyperplasia, endometrial intraepithelial neoplasia, and frank endometrial cancer, n=55 patients). The dataset was split 60:20:20 into training, validation, and test sets. The model was asked to perform two separate tasks: classification (which of the three categories does this lesion belong to?) and identification (is there a lesion present in this image at all?).

The deep learning architecture was built on ResNet50, a convolutional neural network pre-trained on over one million natural images and then fine-tuned on the hysteroscopy data. For the identification task, a Faster R-CNN architecture with Feature Pyramid Network (FPN) was used, which is designed for object detection - locating where within an image the lesion sits. Clinical factors (age, menopausal status, abnormal uterine bleeding history, hormonal therapy, and tamoxifen use) were optionally concatenated to the image-derived features to test whether adding patient context improved performance.

TL;DR: 1,500 hysteroscopic images from 266 patients were used to train a ResNet50-based deep learning model for both classification (3 lesion categories) and identification (lesion detection), with optional addition of clinical factors.
Pages 4-5
Combating Overfitting with Augmentation and Balanced Sampling

With only 1,500 images from 266 patients, the dataset is small by deep learning standards - most successful medical image AI models train on tens of thousands of cases. The researchers used several techniques to compensate. Data augmentation applied random transformations to each training image in real time: random vertical and horizontal flipping to teach orientation-invariance, and random brightness and contrast adjustments (each within a 0.8-1.2 range) to build robustness against the lighting variations that inevitably occur between different hysteroscopic systems and procedures.

A critical practical problem was class imbalance: benign focal lesions represented 69.9% of patients while benign diffuse lesions represented only 9.4%. Without correction, a model will systematically predict the most common category for uncertain cases. The study addressed this with a RepeatFactorTrainingSampler that oversamples minority classes during training, forcing the model to learn from rare categories rather than ignoring them. The threshold for this oversampling was itself optimized as a hyperparameter.

Hyperparameter optimization used a Tree-structured Parzen Estimator (TPE) sampler to efficiently search the hyperparameter space - including learning rate, number of region proposals per image, loss function weights for the detection and classification heads, and augmentation intensities. The optimal learning rate was approximately 0.0016, and 256 region-of-interest proposals per image were selected. Early stopping was used to save weights at the best validation performance rather than at the end of training, preventing overfitting to the training data.

TL;DR: The small dataset was addressed through real-time data augmentation, minority class oversampling, and hyperparameter optimization - all necessary precautions for reliable deep learning with limited hysteroscopy images.
Pages 6-7
Modest Performance: Acceptable Detection, Weak Classification

For the identification task (detecting whether a lesion is present), performance was reasonable: with clinical factors included, the model achieved detection of 85.82%, precision of 93.12%, recall of 91.63%, and an F1 score of 92.37%. These numbers suggest the model is reasonably good at finding lesions when they are present, though the absence of true-negative cases in the dataset (since all included patients had confirmed lesions) means the false-positive rate in normal cavities remains unknown.

For the classification task (distinguishing among the three lesion categories), performance was substantially lower. Without clinical factors, overall precision was 63.03% and F1 score was 52.58%. Adding clinical factors improved these to 67% and 55.42% respectively - a meaningful but modest improvement. The best performance achieved in the classification task showed overall accuracy of 86.74%, precision of 80.11%, recall of 80.11%, specificity of 90.06%, and F1 score of 80.11%. However, this overall accuracy is misleading because category-specific performance was highly uneven: the model performed well on benign focal lesions (F1 89.44%) but poorly on preneoplastic/neoplastic lesions (F1 40%) - the category with the most clinical importance.

The benign diffuse lesion category performed worst in classification (F1 42.86% best case), which aligns with the known clinical difficulty of diagnosing non-atypical endometrial hyperplasia by hysteroscopy alone. This category's visual features overlap substantially with normal endometrium and polypoid lesions, challenging both human experts and the algorithm equally. The severe class imbalance - only 25 patients with diffuse benign lesions compared to 186 with focal benign lesions - almost certainly contributed to this poor performance despite the oversampling strategy.

TL;DR: Detection performance was reasonable (F1 92.37% with clinical data), but classification of cancer and precancerous lesions was poor (F1 40%), with class imbalance and small dataset size as major limiting factors.
Pages 7-8
Why This Is Hard: Data Scarcity and Visual Ambiguity

The authors contextualize their results against the two existing comparable studies. Takahashi et al. achieved 90% accuracy distinguishing cancer/atypical hyperplasia from benign conditions using a larger dataset, but did not attempt the detection task, did not test clinical factor inclusion, and excluded non-atypical hyperplasia cases - a simpler classification problem than the three-way distinction this study attempted. Zhang et al. achieved 80.8-90% accuracy on 454 patients but also omitted detection and clinical factor analysis.

The fundamental challenge this study highlights is that hysteroscopic images are visually heterogeneous in ways that make deep learning difficult. Different camera systems, lighting conditions, fluid distension levels, operator movement, and patient anatomy all affect image appearance. A model trained exclusively on images from one center using two specific camera systems may not generalize to the diversity of real-world hysteroscopy practice. The absence of images of normal uterine cavities in the training set is also a key limitation - without learning what normal looks like, the model cannot reliably detect abnormal.

The authors are forthright about the study's limitations: it is a single-center retrospective study with a small, imbalanced dataset that lacks external validation. The clinical factor improvement, while statistically present, was clinically marginal - adding patient age, menopausal status, and bleeding history improved F1 scores by roughly 2-3 percentage points. This suggests that the limiting factor is the quality and quantity of image data, not the absence of clinical context, and that future efforts should prioritize acquiring much larger, more diverse, and better-balanced image datasets.

TL;DR: Comparison with prior work shows this study tackled a harder multi-class problem, and the marginal benefit of clinical factors confirms that dataset scale and diversity - not missing clinical context - are the primary barriers to better performance.
Pages 8-9
A Starting Point, Not a Solution

The authors' candid conclusion is that the model represents a promising starting point rather than a clinical tool. Its current diagnostic performance - particularly the 40% F1 score for the most clinically important category of preneoplastic and neoplastic lesions - falls far short of what would be needed to assist clinical decision-making in practice. No responsible clinician would rely on a tool that correctly classifies cancer-relevant lesions in only about 40% of cases.

The path forward is clear but resource-intensive. Larger datasets must come from multi-center collaborations, since no single center will accumulate thousands of hysteroscopic images with histological confirmation within a reasonable timeframe. High-definition video frames would provide richer feature information than still images extracted from standard-definition systems. Including images of normal uterine cavities is essential to teach the model the boundary between normal and pathological appearance. Expanding to rarer lesion types - Mullerian malformations, uterine sarcomas, trophoblastic disease - would eventually make the model broadly applicable.

The study's greatest value may be methodological: it established a rigorous framework for this type of research, including STARD reporting guidelines, separate identification and classification tasks, explicit evaluation of clinical factor integration, and use of two different hysteroscopic systems. Future studies building on this framework with much larger datasets have a realistic prospect of achieving the diagnostic performance that would justify clinical deployment. For endometrial cancer specifically, an accurate AI hysteroscopy assistant could eventually help less experienced gynecologists achieve diagnostic accuracy closer to that of expert endoscopists - meaningfully improving detection of early-stage cancers in settings where expert specialists are not always available.

TL;DR: The model falls short of clinical utility for its most important task (cancer detection), but establishes a rigorous evaluation framework that future multi-center studies with larger, balanced, high-definition datasets can build upon.
Citation: Open Access, 2024. Available at: PMC11011142.