Automatic multi-needle localization in ultrasound images using large margin mask RCNN for ultrasound-guided prostate brachytherapy

Phys Med Biol 2020 Deep Learning 7 Explanations View Original
Original Paper (PDF)

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

Plain-English Explanations
Pages 1-2
High-Dose-Rate Prostate Brachytherapy and the Needle Problem

High-dose-rate (HDR) prostate brachytherapy is a form of internal radiation therapy where a radioactive source is temporarily placed inside the prostate to deliver a concentrated, high dose of radiation directly to cancer cells. It is widely used for intermediate and high-risk prostate cancer, either alone or combined with external beam radiation therapy.

The standard procedure involves inserting 12 to 20 hollow needles into the prostate under ultrasound guidance, then threading a radioactive source through each needle to deliver precise dose at specific positions (dwell times). The accuracy of where each needle sits is critical: the dose falls off steeply with distance, meaning even a small positioning error significantly changes the radiation delivered to the tumor and surrounding healthy tissue.

Currently, after needle insertion, patients must be transferred to a CT or MRI scanner to image the needle positions before treatment planning can begin. This extra step prolongs the procedure, increases cost, and risks needle displacement during patient transport, potentially compromising dosimetric accuracy.

The ideal workflow would use a single imaging modality -- the transrectal ultrasound (TRUS) system already present in the operating room -- for both needle insertion guidance and treatment planning. But to do this, a reliable automated system for finding all needle positions directly in ultrasound images in real time is needed.

TL;DR: HDR prostate brachytherapy requires precise localization of 12-20 needles, but current workflows require time-consuming CT scanning and manual needle digitization that introduces errors and delays.
Pages 2-3
Why Multi-Needle Detection in Ultrasound is Challenging

Ultrasound imaging has significant technical drawbacks for needle detection. TRUS images are noisy and contain speckle artifacts -- random interference patterns that can look similar to needle signals, making it difficult for algorithms to distinguish real needles from background noise.

When multiple needles are inserted simultaneously, their ultrasound shadows and reflection patterns can overlap or interfere with each other, making it harder to separate individual needle trajectories. Needles far from the ultrasound probe produce weaker signals that further blend into background noise.

Clinical accuracy requirements are strict: needle position errors must stay within 3mm to maintain acceptable dosimetric uncertainty. Given that needles are only 1.67mm in outer diameter, even small detection errors can exceed this tolerance and affect radiation delivery to the prostate or nearby organs like the urethra and rectum.

Manual needle digitization by an experienced physicist currently takes 15-20 minutes per patient and is subject to human error and inter-observer variability. This time requirement makes real-time treatment planning in the operating room impractical under current workflows.

TL;DR: Speckle noise, overlapping needle shadows, and strict accuracy requirements make automated multi-needle detection in ultrasound a technically demanding problem.
Pages 3-5
The Proposed Deep Learning Workflow

The researchers developed a two-stage automated pipeline. The first stage uses LMMask R-CNN (Large Margin Mask Region-based CNN), a deep learning model that detects needle shaft locations in each ultrasound image slice. It simultaneously performs three tasks: predicting bounding box centers around each needle, classifying each proposed region as needle or non-needle, and segmenting the actual needle pixels within each bounding box.

The key innovation is replacing the standard softmax classification loss with a large margin loss, which creates a wider decision boundary between needle and non-needle classes. This makes the model more discriminative in this binary detection task -- particularly important in ultrasound where needle and artifact signals can closely resemble each other.

The second stage uses a custom needle-based DBSCAN algorithm (Density-Based Spatial Clustering of Applications with Noise) to refine the shaft detections and identify needle tips. DBSCAN groups nearby detected points into clusters, then fits a physical needle model to each cluster. The algorithm iterates: after modeling one needle, its points are removed, and the next needle cluster is processed, addressing the challenge of overlapping needle trajectories.

Needle tip detection exploits a specific physical property of ultrasound: when a needle ends, there is a sudden drop in pixel intensity at the most distal point. The algorithm identifies this intensity drop as the needle tip, which is a more principled approach than simply taking the most distal detected point as prior methods did.

TL;DR: A two-stage pipeline combines a custom deep learning needle detector (LMMask R-CNN) with a physics-informed clustering algorithm (needle-based DBSCAN) to automatically detect all needle shafts and tips.
Pages 4-5
Dataset and Evaluation Methods

The model was trained and evaluated on 3D TRUS images from 23 patients who underwent HDR prostate brachytherapy, comprising a total of 339 needles across all patients. Each patient had 12-19 needles depending on prostate size. Images were acquired at 7.5 MHz frequency with each 3D volume containing 26-40 image slices.

Ground truth needle annotations were created by an experienced medical physicist using VelocityAI software, manually tracing each needle's trajectory across all image slices. Inter-observer variability was specifically evaluated by having two additional physicists independently annotate all cases to test whether the automated method's performance depended on whose manual annotations were used as ground truth.

Performance was assessed using three main metrics: needle shaft localization error (average distance between predicted and true needle center positions), needle tip localization error (error in predicted needle length), and detection accuracy (percentage of needles correctly identified within a 6mm tolerance). 5-fold cross-validation was used to ensure reliable performance estimates across the 23-patient dataset.

TL;DR: The model was evaluated on 339 needles from 23 patients using 5-fold cross-validation, with inter-observer consistency testing to ensure robustness to manual annotation variability.
Pages 9-10
Detection Accuracy and Speed

The proposed method detected 98% of all 339 needles with an average shaft localization error of 0.091 mm and an average tip error of 0.330 mm, both well within the 3mm clinical accuracy threshold. These results were statistically significantly better than the baseline Mask R-CNN and the intermediate LMMask R-CNN alone.

Comparing the three approaches, the standard Mask R-CNN had a shaft error of 0.190mm and achieved 92% detection accuracy. The large margin modification (LMMask R-CNN alone) reduced the shaft error to 0.114mm and improved accuracy to 98.2%. Adding the needle-based DBSCAN refinement further reduced the shaft error to 0.091mm and maintained 98.2% accuracy, with the tip error improving from 0.493mm to 0.330mm.

About 89% of all needle shaft localizations fell within 0.4mm error, compared to only 63% for standard Mask R-CNN. Tip detection errors for the proposed method were all within 4mm, while the baseline methods had 13 and 5 needles respectively with 6mm tip errors (the maximum acceptable threshold).

Most importantly, the entire processing time for all needles in a patient was approximately 0.6 seconds on a standard GPU -- compared to 15-20 minutes for manual digitization. This represents roughly a 2,000-fold speed improvement, enabling real-time feedback during needle placement for the first time.

TL;DR: The method detected 98% of needles with sub-millimeter accuracy in 0.6 seconds per patient, compared to 15-20 minutes for manual digitization.
Page 10
Robustness to Inter-Observer Variability

A key concern in any deep learning study trained on manual annotations is whether performance depends on a single annotator's style. The researchers specifically tested this by evaluating the algorithm using three different sets of manual annotations as ground truth.

Results were consistent across all three annotators: shaft errors ranged from 0.088 to 0.092mm and detection accuracy was identical at 98.2% in all cases. All p-values between the inter-observer comparisons exceeded 0.05, confirming no statistically significant differences.

This finding is reassuring for clinical deployment: the algorithm's performance does not depend on which expert physicist created the reference annotations. The method appears to have learned a robust representation of needle appearance that is consistent with how multiple expert observers define needle positions.

TL;DR: Performance was consistent across three independent annotators' ground truth labels, confirming the method's robustness to inter-observer variability in training data.
Pages 10-12
Path to Real-Time Treatment Planning in the Operating Room

The clinical vision behind this work is enabling complete HDR prostate brachytherapy in the operating room without any patient transfer to a CT or MRI scanner. This would eliminate the risk of needle displacement during transport, reduce patient procedure time, and lower costs.

The authors note that their needle localization method (0.6 seconds) can be combined with existing published methods for automatic prostate segmentation on ultrasound (under 1 second) and automated treatment plan optimization (within 5 seconds). Together, these three components would enable generation of a complete treatment plan from scratch in under 7 seconds -- fast enough for real-time feedback during needle placement.

Real-time dosimetric feedback during needle insertion would allow radiation oncologists to objectively evaluate whether current needle positions are achieving adequate tumor coverage and organ sparing, and adjust needle placement on the spot rather than discovering suboptimal plans after the patient has been moved and treatment has begun.

The algorithm's generalizability extends beyond prostate brachytherapy: the authors note it could be adapted for localizing implanted seeds in low-dose-rate (LDR) brachytherapy, fiducial markers used in stereotactic body radiotherapy, or needle detection in CT and MRI images for other procedures.

TL;DR: Combining this needle detection method with automated prostate segmentation and plan optimization could enable complete HDR brachytherapy treatment planning in under 7 seconds in the operating room.
Citation: Open Access, . Available at: PMC11758238.