# t1neo666/aaai25_mlc-nc architecture

> Architecture diagram of the GitHub repository t1neo666/aaai25_mlc-nc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/t1neo666/aaai25_mlc-nc
- Repository: https://github.com/t1neo666/aaai25_mlc-nc

## Overview

This repository implements research code for long-tailed multi-label image classification, including model training and evaluation. The principal workflow loads labeled images, constructs a ResNet-based classifier with prototype/attention components, optimizes multi-label objectives, and evaluates predictions. Dataset-specific utilities and alternative model/loss modules are represented as capabilities, but their complete wiring is not visible in the sampled excerpts; the README provides only the project title, so some links are intentionally omitted.

Main entry points: [`train.py`](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/train.py) (Training loop), [`src_files/data/get_dataset.py`](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/data/get_dataset.py) (Dataset utilities), [`src_files/models/utils/factory.py`](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/models/utils/factory.py) (Model factory), [`src_files/data/get_voc.py`](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/data/get_voc.py) (VOC data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_voc["VOC data<br/>[get_voc.py]"]
  node_coco["COCO data<br/>[get_coco.py]"]
  node_datasets["Dataset utilities<br/>[get_dataset.py]"]
  node_sampling["Long-tail sampling<br/>[sampler.py]"]
  node_augment["Augmentation<br/>[extra_aug.py]"]
end

subgraph group_model["Classifier"]
  node_factory["Model factory<br/>[factory.py]"]
  node_resnet["ResNet backbone<br/>[resnet.py]"]
  node_attention["Attention classifier<br/>[attention.py]"]
  node_protoclassifier["Prototype classifier"]
  node_tresnet["TResNet model<br/>[tresnet.py]"]
end

subgraph group_learning["Training objectives"]
  node_losses["Loss collection<br/>[losses.py]"]
  node_asymmetric["Asymmetric loss<br/>[aslloss.py]"]
  node_multifocal["Multi-focal loss<br/>[mfloss.py]"]
  node_prototype_loss["Prototype losses<br/>[prototypeloss.py]"]
end

subgraph group_runtime["Training and evaluation"]
  node_train["Training loop<br/>[train.py]"]
  node_validate["VOC validation<br/>[validate_voc.py]"]
  node_infer["Inference<br/>[infer.py]"]
  node_analysis["Result analysis<br/>[analyze.py]"]
end

node_researcher(("Researcher"))
node_images[("Labeled images")]

node_researcher -->|"starts training"| node_train
node_images -->|"loads annotations"| node_voc
node_images -->|"loads annotations"| node_coco
node_voc -->|"provides samples"| node_datasets
node_coco -->|"provides samples"| node_datasets
node_datasets -->|"supplies examples"| node_sampling
node_train -->|"loads data"| node_datasets
node_train -->|"creates model"| node_factory
node_factory -->|"constructs backbone"| node_resnet
node_factory -->|"adds classifier"| node_attention
node_attention -->|"initializes prototypes"| node_protoclassifier
node_train -->|"selects objective"| node_losses
node_train -->|"uses loss"| node_asymmetric
node_train -->|"uses loss"| node_multifocal
node_train -->|"uses loss"| node_prototype_loss
node_train -->|"evaluates model"| node_validate
node_researcher -->|"requests predictions"| node_infer
node_researcher -->|"reviews results"| node_analysis

click node_voc "https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/data/get_voc.py"
click node_coco "https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/data/get_coco.py"
click node_datasets "https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/data/get_dataset.py"
click node_sampling "https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/data/sampler.py"
click node_augment "https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/data/extra_aug.py"
click node_factory "https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/models/utils/factory.py"
click node_resnet "https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/models/resnet.py"
click node_attention "https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/attention/attention.py"
click node_protoclassifier "https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/attention/Proto_Classifiers.py"
click node_tresnet "https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/models/tresnet/tresnet.py"
click node_losses "https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/loss_functions/losses.py"
click node_asymmetric "https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/loss_functions/aslloss.py"
click node_multifocal "https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/loss_functions/mfloss.py"
click node_prototype_loss "https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/loss_functions/prototypeloss.py"
click node_train "https://github.com/t1neo666/aaai25_mlc-nc/blob/main/train.py"
click node_validate "https://github.com/t1neo666/aaai25_mlc-nc/blob/main/validate_voc.py"
click node_infer "https://github.com/t1neo666/aaai25_mlc-nc/blob/main/infer.py"
click node_analysis "https://github.com/t1neo666/aaai25_mlc-nc/blob/main/analyze.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_voc,node_coco,node_datasets,node_sampling,node_augment toneBlue
class node_factory,node_resnet,node_attention,node_protoclassifier,node_tresnet,node_images toneAmber
class node_losses,node_asymmetric,node_multifocal,node_prototype_loss toneMint
class node_train,node_validate,node_infer,node_analysis toneRose
class node_researcher toneIndigo
```

## Components

### Data preparation

- [VOC data](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/data/get_voc.py): `src_files/data/get_voc.py`
- [COCO data](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/data/get_coco.py): `src_files/data/get_coco.py`
- [Dataset utilities](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/data/get_dataset.py): `src_files/data/get_dataset.py`
- [Long-tail sampling](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/data/sampler.py): `src_files/data/sampler.py`
- [Augmentation](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/data/extra_aug.py): `src_files/data/extra_aug.py`

### Classifier

- [Model factory](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/models/utils/factory.py): `src_files/models/utils/factory.py`
- [ResNet backbone](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/models/resnet.py): `src_files/models/resnet.py`
- [Attention classifier](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/attention/attention.py): `src_files/attention/attention.py`
- [Prototype classifier](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/attention/Proto_Classifiers.py): `src_files/attention/Proto_Classifiers.py`
- [TResNet model](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/models/tresnet/tresnet.py): `src_files/models/tresnet/tresnet.py`

### Training objectives

- [Loss collection](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/loss_functions/losses.py): `src_files/loss_functions/losses.py`
- [Asymmetric loss](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/loss_functions/aslloss.py): `src_files/loss_functions/aslloss.py`
- [Multi-focal loss](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/loss_functions/mfloss.py): `src_files/loss_functions/mfloss.py`
- [Prototype losses](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/src_files/loss_functions/prototypeloss.py): `src_files/loss_functions/prototypeloss.py`

### Training and evaluation

- [Training loop](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/train.py): `train.py`
- [VOC validation](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/validate_voc.py): `validate_voc.py`
- [Inference](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/infer.py): `infer.py`
- [Result analysis](https://github.com/t1neo666/aaai25_mlc-nc/blob/main/analyze.py): `analyze.py`

### Other components

- **Researcher**
- **Labeled images**

## Connections

- Researcher → Training loop: starts training
- Labeled images → VOC data: loads annotations
- Labeled images → COCO data: loads annotations
- VOC data → Dataset utilities: provides samples
- COCO data → Dataset utilities: provides samples
- Dataset utilities → Long-tail sampling: supplies examples
- Training loop → Dataset utilities: loads data
- Training loop → Model factory: creates model
- Model factory → ResNet backbone: constructs backbone
- Model factory → Attention classifier: adds classifier
- Attention classifier → Prototype classifier: initializes prototypes
- Training loop → Loss collection: selects objective
- Training loop → Asymmetric loss: uses loss
- Training loop → Multi-focal loss: uses loss
- Training loop → Prototype losses: uses loss
- Training loop → VOC validation: evaluates model
- Researcher → Inference: requests predictions
- Researcher → Result analysis: reviews results
