{"title":"Automated Segmentation of Subretinal Fluid from OCT: A Vision Transformer Approach with Cross-Validation","authors":"Julie Midroni HBSc , Jack Longwell HBSc, MEng(C) , Nishaant Bhambra MD , Sueellen Demian MD , Aurora Pecaku MD , Isabela Martins Melo MD , Rajeev H. Muni MD, MSc","doi":"10.1016/j.xops.2025.100852","DOIUrl":null,"url":null,"abstract":"<div><h3>Purpose</h3><div>We present an algorithm to segment subretinal fluid (SRF) on individual B-scan slices in patients with rhegmatogenous retinal detachment (RRD). Particular attention is paid to robustness, with a fivefold cross-validation approach and a hold-out test set.</div></div><div><h3>Design</h3><div>Retrospective, cross-sectional study.</div></div><div><h3>Participants</h3><div>A total of 3819 B-scan slices across 98 time points from 45 patients were used in this study.</div></div><div><h3>Methods</h3><div>Subretinal fluid was segmented on all scans. A base SegFormer model, pretrained on 4 massive data sets, was further trained on raw B-scans from the retinal OCT fluid challenge data set of 4532 slices: an open data set of intraretinal fluid, SRF, and pigment epithelium detachment. When adequate performance was reached, transfer learning was used to train the model on our in-house data set, to segment SRF by generating a pixel-wise mask of presence/absence of SRF. A fivefold cross-validation approach was used, with an additional hold-out test set. All folds were first trained and cross-validated and then additionally tested on the hold-out set. Mean (averaged across images) and total (summed across all pixels, irrespective of image) Dice coefficients were calculated for each fold.</div></div><div><h3>Main Outcome Measures</h3><div>Subretinal fluid volume after surgical intervention for RRD.</div></div><div><h3>Results</h3><div>The average total Dice coefficient across the validation folds was 0.92, the average mean Dice coefficient was 0.82, and the median Dice was 0.92. For the test set, the average total Dice coefficient was 0.94, the average mean Dice coefficient was 0.82, and the median Dice was 0.92. The model showed strong interfold consistency on the hold-out set, with a standard deviation of only 0.03.</div></div><div><h3>Conclusions</h3><div>The SegFormer model for SRF segmentation demonstrates a strong ability to segment SRF. This result holds up to cross-validation and hold-out testing, across all folds. The model is available open-source online.</div></div><div><h3>Financial Disclosure(s)</h3><div>Proprietary or commercial disclosure may be found in the Footnotes and Disclosures at the end of this article.</div></div>","PeriodicalId":74363,"journal":{"name":"Ophthalmology science","volume":"5 6","pages":"Article 100852"},"PeriodicalIF":4.6000,"publicationDate":"2025-06-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Ophthalmology science","FirstCategoryId":"1085","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S2666914525001502","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"OPHTHALMOLOGY","Score":null,"Total":0}
引用次数: 0
Abstract
Purpose
We present an algorithm to segment subretinal fluid (SRF) on individual B-scan slices in patients with rhegmatogenous retinal detachment (RRD). Particular attention is paid to robustness, with a fivefold cross-validation approach and a hold-out test set.
Design
Retrospective, cross-sectional study.
Participants
A total of 3819 B-scan slices across 98 time points from 45 patients were used in this study.
Methods
Subretinal fluid was segmented on all scans. A base SegFormer model, pretrained on 4 massive data sets, was further trained on raw B-scans from the retinal OCT fluid challenge data set of 4532 slices: an open data set of intraretinal fluid, SRF, and pigment epithelium detachment. When adequate performance was reached, transfer learning was used to train the model on our in-house data set, to segment SRF by generating a pixel-wise mask of presence/absence of SRF. A fivefold cross-validation approach was used, with an additional hold-out test set. All folds were first trained and cross-validated and then additionally tested on the hold-out set. Mean (averaged across images) and total (summed across all pixels, irrespective of image) Dice coefficients were calculated for each fold.
Main Outcome Measures
Subretinal fluid volume after surgical intervention for RRD.
Results
The average total Dice coefficient across the validation folds was 0.92, the average mean Dice coefficient was 0.82, and the median Dice was 0.92. For the test set, the average total Dice coefficient was 0.94, the average mean Dice coefficient was 0.82, and the median Dice was 0.92. The model showed strong interfold consistency on the hold-out set, with a standard deviation of only 0.03.
Conclusions
The SegFormer model for SRF segmentation demonstrates a strong ability to segment SRF. This result holds up to cross-validation and hold-out testing, across all folds. The model is available open-source online.
Financial Disclosure(s)
Proprietary or commercial disclosure may be found in the Footnotes and Disclosures at the end of this article.