Fluoro-forest: A random forest workflow for cell type annotation in high-dimensional immunofluorescence imaging

preprint OA: closed CC-BY-NC-ND-4.0
📄 Open PDF Full text JSON View at publisher
Full text 22,336 characters · extracted from preprint-html · click to expand
Fluoro-forest: A random forest workflow for cell type annotation in high-dimensional immunofluorescence imaging | bioRxiv /* */ /* */ <!-- <!-- /*! * yepnope1.5.4 * (c) WTFPL, GPLv2 */ (function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0];var j=d.createElement(s);var dl=l!='dataLayer'?'&l='+l:'';j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;j.type='text/javascript';j.async=true;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-M677548'); Skip to main content Home About Submit ALERTS / RSS Search for this keyword Advanced Search New Results Fluoro-forest: A random forest workflow for cell type annotation in high-dimensional immunofluorescence imaging View ORCID Profile Joshua Brand , Wei Zhang , Evie Carchman , View ORCID Profile Huy Q. Dinh doi: https://doi.org/10.1101/2025.06.13.659547 Joshua Brand 1 McArdle Laboratory for Cancer Research, Department of Oncology, School of Medicine and Public Health, University of Wisconsin – Madison , Madison, WI 53705, USA Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Joshua Brand For correspondence: huy.dinh{at}wisc.edu Wei Zhang 2 Department of Pathology and Laboratory Medicine, The University of Kansas Medical Center , Kansas City, KS Find this author on Google Scholar Find this author on PubMed Search for this author on this site Evie Carchman 3 Department of Surgery, School of Medicine and Public Health, University of Wisconsin , Madison, WI, USA 4 William S Middleton Memorial Veterans Hospital , Madison, WI, USA Find this author on Google Scholar Find this author on PubMed Search for this author on this site Huy Q. Dinh 1 McArdle Laboratory for Cancer Research, Department of Oncology, School of Medicine and Public Health, University of Wisconsin – Madison , Madison, WI 53705, USA 5 University of Wisconsin Carbone Cancer Center, University of Wisconsin School of Medicine and Public Health , Madison, WI 53705, USA 6 Department of Biostatistics and Medical Informatics, School of Medicine and Public Health, University of Wisconsin – Madison , Madison, WI 53705, USA Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Huy Q. Dinh For correspondence: huy.dinh{at}wisc.edu Abstract Full Text Info/History Metrics Supplementary material Data/Code Preview PDF Abstract Cyclic immunofluorescence (IF) techniques enable deep phenotyping of cells and help quantify tissue organization at high resolution. Due to its high dimensionality, workflows typically rely on unsupervised clustering, followed by cell type annotation at a cluster level for cell type assignment. Most of these methods use marker expression averages that lack a statistical evaluation of cell type annotations, which can result in misclassification. Here, we propose a strategy through an end-to-end pipeline using a semi-supervised, random forests approach to predict cell type annotations. Our method includes cluster-based sampling for training data, cell type prediction, and downstream visualization for interpretability of cell annotation that ultimately improves classification results. We show that our workflow can annotate cells more accurately with a training set <5% of the total number of cells tested. In addition, our pipeline outputs cell type annotation probabilities and model performance metrics for users to decide if it could boost their existing clustering-based workflow results for complex IF data. Availability and implementation Fluoro-forest is freely available on github ( https://github.com/Josh-Brand/Fluoro-forest ). Data used within this manuscript is hosted on Dryad (DOI: 10.5061/dryad.hqbzkh1v1) Supplementary information Supplemental figures and methods are included in the submission. 1 Introduction High-plex IF imaging has significantly expanded our ability to visualize and characterize cell types and subsets, offering detailed views of tissue-level biology. While these technologies have existed for years 1 – 3 , their accessibility through commercial platforms has significantly improved. Imaging-based antibody panels can now exceed 50 markers and are more widely used, such as with Codex 4 , but open-source tools to accurately label cell types are still needed. Additionally, these datasets may span tens to hundreds of thousands of cells, making conventionally supervised or threshold-based approaches that use complex combinations of markers for cell type annotation infeasible. Open-source software, such as ImageJ 5 and QuPath 6 are excellent tools with extended functionality through plugins for cell segmentation, feature calculations, and cell annotation. QuPath’s classification algorithms include random forests, however it predicts marker positivity sequentially and does not generate composite models. This results in defining complicated prediction scenarios that a user would need to predefine, rather than generating a single classification probability offered through a multiclass method. Other machine learning approaches include a probabilistic Bayesian framework (Celesta) 7 and feed-forward neural networks (MAPS 8 , CellSighter 9 ) for cell type classification. Celesta uses a design matrix to guide cell type annotation and does not require training data. This approach assumes some markers will not overlap but may intuitively struggle where fluorescence bleed over from dense areas in tissue exists. MAPS and CellSighter require large amounts of training data from thousands to tens of thousands of cells which are supplied through other cell type annotation methods. While clustering is commonly applied for other single-cell omics technologies, its use remains challenging in imaging data 10 . Aggregate expression profiles of clusters are difficult to interpret in cell type assignment due to background signal in imaging data, non-normal data distributions, and varying cluster resolutions that may mask rare cell types while over-clustering others. Evaluation of clustering-based and other cell-type annotation methods still requires having a well-labeled training dataset, using expert knowledge, which remains a consistent bottleneck. Our approach shows that small training datasets (200-300 cells) of a typical 2,000-10,000 cell tissue core data, with diverse representation of cell clusters, may improve cell type annotation results significantly. 2 Results We developed Fluoro-forest, an end-to-end Python pipeline for cell type annotation and prediction using user-defined protein markers. Our pipeline ( Fig. 1A , Suppl. Fig. 1 ) begins with cell segmentation using existing methods, such as StarDist 11 or CellPose 12 to identify cell boundaries, followed by pre-processing procedures including log-normalization and z-scaling within each marker ( Suppl. Methods ). The images (one slice per marker), tabular expression data, and segmentations are inputs for a Python class for data visualization, cell sampling for training data, annotation, and cell type prediction. In our workflow, the user is prompted to select which markers (by default, all) to use in dimension reduction with principal components analysis (PCA) for visualization. We support unsupervised clustering methods (k-means, Louvain, Leiden, or Gaussian mixture models) to initialize the sampling procedure to ensure a diverse training dataset across all cell lineages. The sampled cells will be annotated by users using a multichannel viewing window and serve as training data for a random forest model to predict the remaining unannotated cells. We include optional settings such as imbalanced random forests or synthetic sampling (SMOTE 13 ) to improve classification accuracy in cases where the majority cell type dominates the training data. Finally, we provide cross-validation performance metrics (precision, recall, and F1 scores) output per cell type to guide model tuning. Download figure Open in new tab Supplementary Figure 1. Recommended fluoro-forest workflow. Our workflow uses existing tools for cell segmentation, feature summaries, and clustering to guide cell sampling. Sampled data is shown to the user for manual annotation which trains a random forest classifier. Built in cross-fold validation metrics can guide parameter tuning, ideal models (balanced/iimbalanced), or suggest if if more samples are needed, Last, the final model using all training data can be used to predict unseen cells for downstream visualizations and analyses. Download figure Open in new tab Figure 1. Fluoro-forest: A semi-supervised cell type annotation method using random forests for high-plex immunofluorescence data. A . Our workflow converts images to tabular data, guides cell annotation to train random forest models for predicting unseen data. B . Lineage markers for epithelia (PanCK), endothelia (CD31), smooth muscle/stroma (SMA), and immune cells (CD45) supports predicted annotations. C . Classes were balanced prior to training and tested for model accuracy in 2 and 5-fold cross validation, achieving 87% and 90.4 +/-2.7% accuracy, respectively (mean +/-s.d.). D . Sankey diagram of annotated cell types and their leiden-based clustering. E . Z-scored expression values for each leiden cluster across all markers. F . Expression guided annotation from clustering was unable to split CD4+ T cells from Tregulatory cells, and stroma from endothelia. To illustrate the workflow, we applied our pipeline to PhenoCycler / CODEX data from two in-house anal dysplasia biopsies with an immune-focused protein panel (N = 30 markers) ( Fig. 1B , Suppl. Fig. 2A ). We identified cell types in these datasets – including tumor/epithelial cells, stroma, endothelial cells, myeloid, CD4 and CD8 T cells, B cells, and Tregs based on their representative markers ( Suppl. Methods ). Lineage marker expression well-supported our final cell type predictions in both cores ( Fig. 1B , Suppl. Fig. 2A ). Five-fold cross validation showed high accuracy (90.4 +/-2.7% and 89.1 +/-3.5% respectively, mean +/-s.d.) across our 2 biopsies ( Fig. 1C , Suppl. Fig 3B ) and demonstrate the model’s ability to identify true classes while minimizing false positives and false negatives, achieving F1 scores of 0.75 or higher. We compared our pipeline to annotations derived from a Leiden-based clustering workflow, showing lack of purity in cell type annotations from Leiden clustering results, for instance cluster 5 includes mixture of endothelial, epithelial, CD4 T and stroma cells ( Fig. 1D , Suppl. Fig. 2D ), which is challenging for cell type annotation based on average marker expression ( Fig. 1E-F , Suppl. Fig. 2D-E ). Specifically, we used all features to over-cluster the data, which is recommended 10 to recover less abundant cell types, such as Tregs and myeloid cells. Leiden clustering was able to identify different subsets from predominantly epithelial cells but failed to differentiate FOXP3+ T regulatory cells from other CD4+ T cells and CD31+ endothelial cells from SMA+ stromal cells ( Fig. 1F , Suppl. Fig. 2E ). Download figure Open in new tab Supplementary Fig. 2. Second biopsy prediction and evaluation. A . Lineage markers for epithelia, stroma, endothelia, and pan immune cells next to random forest predicted cell labeled results. B . Random forest models were compared via 2-and 5-fold cross validation with model accuracies of 87.0% and 89.1% +/-3.5%, respectively (mean +/-s.d.). C . Leiden--based clustering was applied using all scaled features, showing separation of epithelia in several clusters. Clustering failed to separate stroma and endothelia, as well as CD4+ T cells and Tregs. D . Sankey diagram representing the annotated cell types and their representation in leiden-based clustering. E . Z-scored expression values for each cluster across all markers were used to annotate cell types as in a typical workflow, resulting in incomplete separation of cell types. Download figure Open in new tab Supplementary Fig. 3. Composite vs. exclusive models shows loss in accuracy. A . Random forest trained on data from both cores to create a composite model, achieving 84% and 88.10 +/-2.96% accuracy, respectively (mean +/-s.d.). B . Classification results from training on core N-12 and testing on core C-7, 61.85% accuracy. C . Classification results from training on core C-7 and testing on core N-12, 67.61% accuracy. 3 Conclusion Semi-supervised methods offer several advantages over clustering for cell type annotation in IF data. We see improved accuracy and generate interpretable probability outputs from trained models, which are not found in most clustering approaches. Our study shows that sampling approximately 20 cells per class was sufficient for high-accuracy predictions. Despite these improvements, limitations exist. Training data, and therefore validation during data splits, are represented by cells that we can confidently annotate, but acknowledge there are areas in tissue where the high cell density prevents a confident annotation. We expect the use of probability thresholds from the model can be applied for the conservative estimation of cell types in tissue where this exists. Finally, we expect these models may not generalize well, seeing a significant loss in accuracy (<70%) ( Suppl. Fig. 3A-C ) when training on one core and predicting the other. When training data are generated from both cores, there is still a loss in performance, with ∼88% accuracy in our cross-validation. We expect batch variation and donor heterogeneity to be challenges that could be overcome with additional feature engineering. However, our method offers a valuable, streamlined user interface appropriate for high-resolution and high-plex cell annotation. Author contributions Conceptualization, J.B. H.Q.D., Data analysis, J.B., Data generation, E.C., W.Z., Writing J.B., H.Q.D., Review, J.B., E.C., W.Z., H.Q.D Corresponding authors: J.B, H.Q.D. Funding This work was supported by the NIH: NCI 3P30CA014520-45S1. Funder Information Declared National Cancer Institute, https://ror.org/040gcmg81 , 3P30CA014520-45S1 Footnotes https://doi.org/10.5061/dryad.hqbzkh1v1 References 1. ↵ Schubert , W. ( 2003 ). Topological proteomics, toponomics, MELK-technology . Adv. Biochem. Eng. Biotechnol . 83 , 189 – 209 . OpenUrl CrossRef PubMed 2. Lin , J.-R. , Fallahi-Sichani , M. , and Sorger , P.K. ( 2015 ). Highly multiplexed imaging of single cells using a high-throughput cyclic immunofluorescence method . Nat. Commun . 6 , 8390 . OpenUrl CrossRef PubMed 3. ↵ Goltsev , Y. , Samusik , N. , Kennedy-Darling , J. , Bhate , S. , Hale , M. , Vazquez , G. , Black , S. , and Nolan , G.P. ( 2018 ). Deep profiling of mouse splenic architecture with CODEX multiplexed imaging . Cell 174 , 968 – 981 .e15. OpenUrl CrossRef PubMed 4. ↵ Black , S. , Phillips , D. , Hickey , J.W. , Kennedy-Darling , J. , Venkataraaman , V.G. , Samusik , N. , Goltsev , Y. , Schürch , C.M. , and Nolan , G.P. ( 2021 ). CODEX multiplexed tissue imaging with DNA-conjugated antibodies . Nat. Protoc . 16 , 3802 – 3835 . OpenUrl CrossRef PubMed 5. ↵ Schneider , C.A. , Rasband , W.S. , and Eliceiri , K.W. ( 2012 ). NIH Image to ImageJ: 25 years of image analysis . Nat. Methods 9 , 671 – 675 . OpenUrl CrossRef PubMed Web of Science 6. ↵ Bankhead , P. , Loughrey , M.B. , Fernández , J.A. , Dombrowski , Y. , McArt , D.G. , Dunne , P.D. , McQuaid , S. , Gray , R.T. , Murray , L.J. , Coleman , H.G. , et al. ( 2017 ). QuPath: Open source software for digital pathology image analysis . Sci. Rep . 7 , 16878 . OpenUrl CrossRef PubMed 7. ↵ Zhang , W. , Li , I. , Reticker-Flynn , N.E. , Good , Z. , Chang , S. , Samusik , N. , Saumyaa , S. , Li , Y. , Zhou , X. , Liang , R. , et al. ( 2022 ). Identification of cell types in multiplexed in situ images by combining protein expression and spatial information using CELESTA . Nat. Methods 19 , 759 – 769 . OpenUrl CrossRef PubMed 8. ↵ Shaban , M. , Bai , Y. , Qiu , H. , Mao , S. , Yeung , J. , Yeo , Y.Y. , Shanmugam , V. , Chen , H. , Zhu , B. , Weirather , J.L. , et al. ( 2024 ). MAPS: pathologist-level cell type annotation from tissue images through machine learning . Nat. Commun . 15 , 28 . OpenUrl CrossRef PubMed 9. ↵ Amitay , Y. , Bussi , Y. , Feinstein , B. , Bagon , S. , Milo , I. , and Keren , L. ( 2023 ). CellSighter: a neural network to classify cells in highly multiplexed images . Nat. Commun . 14 , 4302 . OpenUrl CrossRef PubMed 10. ↵ Hickey , J.W. , Tan , Y. , Nolan , G.P. , and Goltsev , Y. ( 2021 ). Strategies for accurate cell type identification in CODEX multiplexed imaging data . Front. Immunol . 12 , 727626 . OpenUrl CrossRef PubMed 11. ↵ Schmidt , U. , Weigert , M. , Broaddus , C. , and Myers , G. ( 2018 ). Cell detection with star-convex polygons . arXiv [cs.CV] . doi: 10.1007/978-3-030-00934-2_30 . OpenUrl CrossRef 12. ↵ Stringer , C. , Wang , T. , Michaelos , M. , and Pachitariu , M. ( 2021 ). Cellpose: a generalist algorithm for cellular segmentation . Nat. Methods 18 , 100 – 106 . OpenUrl CrossRef PubMed 13. ↵ Chawla , N.V. , Bowyer , K.W. , Hall , L.O. , and Kegelmeyer , W.P. ( 2011 ). SMOTE: Synthetic minority over-sampling technique . arXiv [cs.AI] . doi: 10.1613/jair.953 . OpenUrl CrossRef PubMed View the discussion thread. Back to top Previous Next Posted June 20, 2025. Download PDF Supplementary Material Data/Code Email Thank you for your interest in spreading the word about bioRxiv. NOTE: Your email address is requested solely to identify you as the sender of this article. Your Email * Your Name * Send To * Enter multiple addresses on separate lines or separate them with commas. You are going to email the following Fluoro-forest: A random forest workflow for cell type annotation in high-dimensional immunofluorescence imaging Message Subject (Your Name) has forwarded a page to you from bioRxiv Message Body (Your Name) thought you would like to see this page from the bioRxiv website. Your Personal Message CAPTCHA This question is for testing whether or not you are a human visitor and to prevent automated spam submissions. Share Fluoro-forest: A random forest workflow for cell type annotation in high-dimensional immunofluorescence imaging Joshua Brand , Wei Zhang , Evie Carchman , Huy Q. Dinh bioRxiv 2025.06.13.659547; doi: https://doi.org/10.1101/2025.06.13.659547 Share This Article: Copy Citation Tools Fluoro-forest: A random forest workflow for cell type annotation in high-dimensional immunofluorescence imaging Joshua Brand , Wei Zhang , Evie Carchman , Huy Q. Dinh bioRxiv 2025.06.13.659547; doi: https://doi.org/10.1101/2025.06.13.659547 Citation Manager Formats BibTeX Bookends EasyBib EndNote (tagged) EndNote 8 (xml) Medlars Mendeley Papers RefWorks Tagged Ref Manager RIS Zotero Tweet Widget Facebook Like Google Plus One Subject Area Bioinformatics Subject Areas All Articles Animal Behavior and Cognition (7619) Biochemistry (17642) Bioengineering (13865) Bioinformatics (41862) Biophysics (21409) Cancer Biology (18547) Cell Biology (25436) Clinical Trials (138) Developmental Biology (13358) Ecology (19863) Epidemiology (2067) Evolutionary Biology (24288) Genetics (15587) Genomics (22467) Immunology (17703) Microbiology (40301) Molecular Biology (17142) Neuroscience (88445) Paleontology (666) Pathology (2825) Pharmacology and Toxicology (4815) Physiology (7634) Plant Biology (15109) Scientific Communication and Education (2042) Synthetic Biology (4285) Systems Biology (9812) Zoology (2268)

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2025) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00
unpaywall
last seen: 2026-05-30T02:00:01.510937+00:00
License: CC-BY-NC-ND-4.0