How mfazrinizar/clc-yolo works
CLC-YOLO is a research and reproduction package for breast-ultrasound lesion segmentation. The main workflow converts author-provided datasets into image, label, and exact-mask assets; materializes leakage-aware grouped folds; trains baseline or prototype-refinement variants; predicts masks; and evaluates image-level and group-macro results. Its model layer extends YOLO26 prototype features with local-contrast and other registered modules, with optional image-presence supervision. The README documents additional evaluation and ablation capabilities. Some wiring is only described in the README, so uncertain internal call edges are omitted.
Main entry points: clc.py Experiment CLI · registry.py Custom layer registration · trainer.py Training integration · exact_masks.py Exact-mask evaluation
Components 23
Data preparation
- Dataset conversion
src/breast_lesion_seg/data/convert.py - BUS-BRA handling
src/breast_lesion_seg/data/busbra.py - Grouped folds
src/breast_lesion_seg/data/cross_validation.py - Inner development split
src/breast_lesion_seg/data/development.py - Frozen fold specs
splits
Model and training
- Model definitions
configs/models - Custom layer registration
src/breast_lesion_seg/models/registry.py - Prototype refinement
src/breast_lesion_seg/models/components/local_contrast_proto.py - Prototype heads
src/breast_lesion_seg/models/components/p2_proto.py - Presence supervision
src/breast_lesion_seg/models/presence_loss.py - Training integration
src/breast_lesion_seg/models/trainer.py
Inference and evaluation
- Prediction outputs
- Exact-mask evaluation
src/breast_lesion_seg/evaluation/exact_masks.py - Presence diagnostics
src/breast_lesion_seg/evaluation/presence_gate.py - Segmentation metrics
src/breast_lesion_seg/metrics/segmentation.py - Group-macro aggregation
src/breast_lesion_seg/metrics/grouped.py - Metrics aggregator
scripts/aggregate.py
Results and configuration
- Run configurations
configs/runs - Fold and primary results
results
Other components
- Researcher
- Source datasets
- Experiment CLI
scripts/clc.py - YOLO initializer
Connections 24
- Researcher → Experiment CLI: runs commands
- Source datasets → Dataset conversion: provides archives
- Experiment CLI → Dataset conversion: converts datasets
- Experiment CLI → BUS-BRA handling: handles BUS-BRA
- Dataset conversion → Grouped folds: prepares samples
- Grouped folds → Frozen fold specs: records partitions
- Frozen fold specs → Experiment CLI: guides fold runs
- Experiment CLI → Inner development split: creates inner splits
- Run configurations → Experiment CLI: supplies run settings
- Model definitions → Custom layer registration: names custom layers
- Custom layer registration → Prototype refinement: registers layers
- Custom layer registration → Prototype heads: registers heads
- Experiment CLI → Training integration: starts training
- Training integration → Custom layer registration: uses registered layers
- Training integration → Presence supervision: uses presence criterion
- YOLO initializer → Training integration: initializes model
- Experiment CLI → Prediction outputs: writes predictions
- Experiment CLI → Exact-mask evaluation: runs exact evaluation
- Exact-mask evaluation → Segmentation metrics: computes image scores
- Experiment CLI → Presence diagnostics: runs gate diagnostics
- Experiment CLI → Metrics aggregator: aggregates fold scores
- Metrics aggregator → Group-macro aggregation: computes group means
- Metrics aggregator → Fold and primary results: writes aggregate results
- Exact-mask evaluation → Fold and primary results: writes fold metrics