How paviag/pf-bula-castillo-garcia works
Project Components
• Data Input/Raw Data: The project likely uses medical images that may come from DICOM files. Although the data source isn’t fully detailed here, the existence of a dicom_reader (in src/preprocessing/dicom_reader.py) indicates the initial data acquisition.
• Preprocessing Module: This module (found in src/preprocessing) includes components to read images (image_handler), process annotations (annotation_processor), and a main script to kick off preprocessing. It is responsible for preparing the raw image and annotation data.
• Augmentation Module: Residing in src/augmentation, this part contains the image_augmentation tool and an annotation_handler. It’s meant to further modify or enrich your data – for instance, applying rotations, flips, or more sophisticated augmentation strategies to improve model generalization.
• Model Module: Located in src/model, with scripts like model.py and model_setup.py, this module defines the neural network structure. Note that YOLO weights (yolo11n.pt and yolov8n.pt) present at the root signify that the model may leverage transfer learning with YOLO-family architectures.
• Tuning Module: In src/tuning, several scripts (study_manager.py, train_index.py, trainer.py, and main.py) suggest usage of a hyperparameter tuning framework (possibly using something like Optuna as hinted by the CSV output filename “optuna_best_trials.csv”). This component manages iterative experiments on model parameters.
• Evaluation Module: In src/evaluation (main.py), this plug-in evaluates model performance, likely reading outputs from the training/tuning phase and generating performance metrics.
• Configuration and Utilities: The configuration file in src/config/config.py and additional helper scripts (e.g., src/extra/utils.py) underscore the use of centralized settings and various utility functions for smoother integration between modules.
• Output Directory: The output folder holds results (validation outputs, annotations, best trial summaries) which serve as the final feedback from the entire pipeline.
Mapping Relationships and Interactions
• Data flows into the preprocessing module first where raw data from an external source is parsed and formatted.
• The preprocessed data then moves to the augmentation module where image and annotation data are augmented to create variability required for robust training.
• Augmented data is passed to the model module where the neural network (perhaps initialized or fine-tuned via supplied YOLO weights) is defined and trained.
• The tuning module sits around the training process to optimize hyperparameters through an iterative scaling loop, feeding best configurations back to the model training.
• Following training, the evaluation module runs an assessment on model outputs. The evaluation results, along with other logs, are stored in the output directory.
• Throughout these steps, configuration settings (from src/config/config.py) provide centralized parameters and control, while auxiliary utilities (in src/extra) offer additional support functions.
Architectural Patterns and Technologies
• The project is structured as a sequential deep-learning pipeline where each module is clearly separated (a form of separation of concerns). This might loosely follow an MVC-like pattern by separating out data handling (preprocessing and augmentation) from the model and evaluation components.
• There is also an experimentation loop present in the tuning module, which implies a systematic approach to hyperparameter optimization (potentially using libraries such as Optuna).
• External pre-trained weights from YOLO models point to leveraging established architectures with transfer learning.