# ilyakolbafk/rsna-knee-abnormality-detection-4th-place architecture

> Architecture diagram of the GitHub repository ilyakolbafk/rsna-knee-abnormality-detection-4th-place, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place
- Repository: https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place

## Overview

This repository reproduces and retrains a competition-winning RSNA knee abnormality ensemble. The principal workflow runs Sixway inference, then deadline-bounded H6 inference, and combines their per-finding percentile ranks into a submission. Training uses historically preserved model code and prepared caches; H6 additionally depends on OAI and fastMRI data. Labels were created from image/report readings and public label tables. The graph follows documented workflow statements and the sampled inference orchestrator; detailed internals of unsampled model and cache modules are intentionally summarized.

Main entry points: [`src/rsna_knee_final/predict_pipeline.py`](https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/src/rsna_knee_final/predict_pipeline.py) (Inference orchestrator), [`train.py`](https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/train.py) (Training entry point), [`training/sources`](https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/tree/main/training/sources) (Historical model code), [`training/sources/h6`](https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/tree/main/training/sources/h6) (H6 training code)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inference["Inference"]
  node_predict["Inference orchestrator"]
  node_sixway["Sixway ensemble<br/>[sixway_stage.py]"]
  node_h6["H6 inference<br/>[h6_fast.py]"]
  node_blend["Rank blend"]
  node_submission["Submission outputs"]
end

subgraph group_training["Model training"]
  node_traincli["Training entry point<br/>[train.py]"]
  node_historical["Historical model code"]
  node_h6train["H6 training code"]
end

subgraph group_data["Data preparation"]
  node_cache336["Cache builders"]
  node_h6prep["H6 data preparation"]
end

subgraph group_labels["Label creation"]
  node_labelbuild["Core6 labels<br/>[build_master.py]"]
  node_readerlabels["Reader labels"]
end

subgraph group_h6data["H6 auxiliary data"]
  node_oai["OAI case pipeline<br/>[pipeline.py]"]
  node_fastmri["fastMRI adaptation<br/>[build_candidate.py]"]
end

node_submitter(("Inference user"))
node_competition[("Competition studies")]
node_oaiarchive[("OAI archive")]
node_fmdata[("fastMRI data")]

node_submitter -->|"runs"| node_predict
node_competition -->|"provides studies"| node_predict
node_predict -->|"runs first"| node_sixway
node_predict -->|"runs second"| node_h6
node_predict -->|"rank blends"| node_blend
node_blend -->|"writes"| node_submission
node_traincli -->|"stages model code"| node_historical
node_traincli -->|"trains H6"| node_h6train
node_cache336 -->|"prepares caches for"| node_traincli
node_h6prep -->|"prepares H6 inputs"| node_traincli
node_labelbuild -->|"supplies labels"| node_historical
node_readerlabels -->|"supplies labels"| node_historical
node_oaiarchive -->|"supplies cases"| node_oai
node_oai -->|"provides training data"| node_h6train
node_fmdata -->|"supplies scans"| node_fastmri
node_fastmri -->|"provides adaptation data"| node_h6train

click node_predict "https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/src/rsna_knee_final/predict_pipeline.py"
click node_sixway "https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/src/rsna_knee_final/inference/sixway_stage.py"
click node_h6 "https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/src/rsna_knee_final/inference/h6_fast.py"
click node_blend "https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/src/rsna_knee_final/predict_pipeline.py"
click node_submission "https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/src/rsna_knee_final/predict_pipeline.py"
click node_traincli "https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/train.py"
click node_historical "https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/tree/main/training/sources"
click node_h6train "https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/tree/main/training/sources/h6"
click node_cache336 "https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/tree/main/data_prep/cache336"
click node_h6prep "https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/tree/main/data_prep/h6_v4"
click node_labelbuild "https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/labels/core6/build_master.py"
click node_readerlabels "https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/tree/main/labels/vm_reader"
click node_oai "https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/data_prep/h6_v4/oai/pipeline.py"
click node_fastmri "https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/data_prep/h6_v4/fastmri/fm384_v1_build/build_candidate.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_predict,node_sixway,node_h6,node_blend,node_submission,node_submitter toneBlue
class node_traincli,node_historical,node_h6train,node_competition,node_oaiarchive,node_fmdata toneAmber
class node_cache336,node_h6prep toneMint
class node_labelbuild,node_readerlabels toneRose
class node_oai,node_fastmri toneIndigo
```

## Components

### Inference

- [Inference orchestrator](https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/src/rsna_knee_final/predict_pipeline.py): `src/rsna_knee_final/predict_pipeline.py`
- [Sixway ensemble](https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/src/rsna_knee_final/inference/sixway_stage.py): `src/rsna_knee_final/inference/sixway_stage.py`
- [H6 inference](https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/src/rsna_knee_final/inference/h6_fast.py): `src/rsna_knee_final/inference/h6_fast.py`
- [Rank blend](https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/src/rsna_knee_final/predict_pipeline.py): `src/rsna_knee_final/predict_pipeline.py`
- [Submission outputs](https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/src/rsna_knee_final/predict_pipeline.py): `src/rsna_knee_final/predict_pipeline.py`

### Model training

- [Training entry point](https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/train.py): `train.py`
- [Historical model code](https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/tree/main/training/sources): `training/sources`
- [H6 training code](https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/tree/main/training/sources/h6): `training/sources/h6`

### Data preparation

- [Cache builders](https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/tree/main/data_prep/cache336): `data_prep/cache336`
- [H6 data preparation](https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/tree/main/data_prep/h6_v4): `data_prep/h6_v4`

### Label creation

- [Core6 labels](https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/labels/core6/build_master.py): `labels/core6/build_master.py`
- [Reader labels](https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/tree/main/labels/vm_reader): `labels/vm_reader`

### H6 auxiliary data

- [OAI case pipeline](https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/data_prep/h6_v4/oai/pipeline.py): `data_prep/h6_v4/oai/pipeline.py`
- [fastMRI adaptation](https://github.com/ilyakolbafk/rsna-knee-abnormality-detection-4th-place/blob/main/data_prep/h6_v4/fastmri/fm384_v1_build/build_candidate.py): `data_prep/h6_v4/fastmri/fm384_v1_build/build_candidate.py`

### Other components

- **Inference user**
- **Competition studies**
- **OAI archive**
- **fastMRI data**

## Connections

- Inference user → Inference orchestrator: runs (evidence: `README.md`)
- Competition studies → Inference orchestrator: provides studies (evidence: `README.md`)
- Inference orchestrator → Sixway ensemble: runs first (evidence: `src/rsna_knee_final/predict_pipeline.py`)
- Inference orchestrator → H6 inference: runs second (evidence: `src/rsna_knee_final/predict_pipeline.py`)
- Inference orchestrator → Rank blend: rank blends (evidence: `README.md`)
- Rank blend → Submission outputs: writes (evidence: `README.md`)
- Training entry point → Historical model code: stages model code (evidence: `README.md`)
- Training entry point → H6 training code: trains H6 (evidence: `README.md`)
- Cache builders → Training entry point: prepares caches for (evidence: `README.md`)
- H6 data preparation → Training entry point: prepares H6 inputs (evidence: `README.md`)
- Core6 labels → Historical model code: supplies labels (evidence: `README.md`)
- Reader labels → Historical model code: supplies labels (evidence: `README.md`)
- OAI archive → OAI case pipeline: supplies cases (evidence: `README.md`)
- OAI case pipeline → H6 training code: provides training data (evidence: `README.md`)
- fastMRI data → fastMRI adaptation: supplies scans (evidence: `README.md`)
- fastMRI adaptation → H6 training code: provides adaptation data (evidence: `README.md`)
