How mejji/contextualizing-retinal-vessel-segmentation works
This repository implements retinal-vessel segmentation: CNN models produce per-pixel probability maps, graph generation converts those maps into vessel-connectivity structures, and VGN refines predictions using global topology. The principal workflow spans CNN training/inference, graph construction, then VGN training/inference and saved segmentation outputs; a Tkinter demo browses staged results. README documents dataset support, CNN/VGN variants, and output artifacts. Sampled source confirms graph-generation and data-layer behavior; some training, inference, and model wiring is based on README descriptions and the file tree.
Main entry points: train_CNN.py CNN training · util.py Graph data layer · test_CNN.py CNN inference · train_VGN.py VGN training
Components 21
CNN Segmentation
- CNN training
code/train_CNN.py - CNN models
code/Modules/model.py - DA-U²Net
code/Modules/DAU2Net.py - Adaptive fusion
code/Modules/AFF_Module.py - CNN inference
code/test_CNN.py - Image data layer
code/util.py - Probability maps
Vessel Graphs
- Graph generation
code/GenGraph/make_graph_db.py - Fast graph generation
code/GenGraph/make_graph_db_fast_parity.py - Graph files
Graph Refinement
- VGN training
code/train_VGN.py - VGN inference
code/test_VGN.py - VGN model
code/Modules/model.py - Graph data layer
code/util.py - DAU VGN training
DAU_HRF_codes/train_VGN_DAU.py - DAU data layer
DAU_HRF_codes/util_vgn.py
Results and Viewing
- Refined outputs
- Map postprocessing
code/postprocess_prob_maps.py - Demo viewer
demo.py
Other components
- Researcher
- Fundus datasets
Connections 30
- Researcher → CNN training: trains model
- Researcher → CNN inference: runs inference
- Fundus datasets → Image data layer: image and labels
- CNN training → CNN models: optimizes
- CNN training → Image data layer: loads batches
- CNN inference → CNN models: runs model
- CNN inference → Image data layer: loads images
- CNN inference → Probability maps: writes maps
- CNN training → DA-U²Net: optional model
- CNN training → Adaptive fusion: optional fusion
- Probability maps → Graph generation: provides predictions
- Graph generation → Graph files: writes graphs
- Probability maps → Fast graph generation: provides predictions
- Fast graph generation → Graph files: writes graphs
- Researcher → VGN training: trains refinement
- Researcher → VGN inference: runs refinement
- Graph files → Graph data layer: loaded by
- Probability maps → Graph data layer: loaded with graphs
- Fundus datasets → Graph data layer: labels and masks
- VGN training → Graph data layer: requests batches
- VGN inference → Graph data layer: requests batches
- VGN training → VGN model: optimizes
- VGN inference → VGN model: runs model
- VGN training → Refined outputs: saves predictions
- VGN inference → Refined outputs: saves predictions
- DAU data layer → DAU VGN training: provides batches
- DAU VGN training → Refined outputs: saves results
- Refined outputs → Map postprocessing: processed by
- Researcher → Demo viewer: browses results
- Refined outputs → Demo viewer: displays stages