An advanced deep learning model for automatically tagging anime/manga illustrations with relevant tags across multiple categories, achieving an amazing 67.3% micro F1 score (using the micro optimized threshold profile) and 50.6% macro F1 score (using the macro optimized threshold preset) across 70,527 possible tags on a test set of 20,116 samples. Now with Vision Transformer backbone and significantly improved performance. This dataset is notoriously long-tailed and sparse.


| CATEGORY | v1 Micro F1 | v2 Micro F1 | Micro ฮ | v1 Macro F1 | v2 Macro F1 | Macro ฮ |
|---|---|---|---|---|---|---|
| Overall | 61.3% | 67.3% | +6.0pp | 33.8% | 50.6% | +16.8pp |
| Artist | 48.0% | 70.0% | +22.0pp | 29.9% | 66.1% | +36.2pp |
| Character | 75.7% | 83.4% | +7.7pp | 52.4% | 66.2% | +13.8pp |
| Copyright | 79.2% | 86.6% | +7.4pp | 41.9% | 56.2% | +14.3pp |
| General | 60.8% | 66.4% | +5.6pp | 21.5% | 34.6% | +13.1pp |
| Meta | 60.2% | 61.2% | +1.0pp | 14.5% | 23.7% | +9.2pp |
| Rating | 80.8% | 83.1% | +2.3pp | 79.5% | 77.5% | -2.0pp |
| Year | 33.2% | 30.8% | -2.4pp | 29.3% | 32.6% | +3.3pp |
Micro F1 comparison using micro-optimized thresholds, Macro F1 comparison using macro-optimized thresholds for fair evaluation.
The v2 model shows remarkable improvements across nearly all categories:
Only the year category shows slight regression.
| CATEGORY | THRESHOLD | MICRO-F1 | MACRO-F1 |
|---|---|---|---|
| overall | 0.492 | 60.9% | 50.6% |
| artist | 0.492 | 62.3% | 66.1% |
| character | 0.492 | 79.9% | 66.2% |
| copyright | 0.492 | 81.8% | 56.2% |
| general | 0.492 | 60.2% | 34.6% |
| meta | 0.492 | 56.3% | 23.7% |
| rating | 0.492 | 78.7% | 77.5% |
| year | 0.492 | 37.2% | 32.6% |
| CATEGORY | THRESHOLD | MICRO-F1 | MACRO-F1 |
|---|---|---|---|
| overall | 0.614 | 67.3% | 46.3% |
| artist | 0.614 | 70.0% | 64.4% |
| character | 0.614 | 83.4% | 64.5% |
| copyright | 0.614 | 86.6% | 53.1% |
| general | 0.614 | 66.4% | 27.4% |
| meta | 0.614 | 61.2% | 19.2% |
| rating | 0.614 | 83.1% | 81.8% |
| year | 0.614 | 30.8% | 21.3% |
The model performs exceptionally well on character identification (83.4% F1 across 26,968 tags), copyright/series detection (86.6% F1 across 5,364 tags), and content rating classification (83.1% F1 across 4 tags).
The macro optimized threshold is recommended as many "false positives" according to the benchmark are actually correct tags missing from the Danbooru dataset. The model frequently identifies appropriate tags that weren't included in the original tagging, making perceived accuracy higher than formal metrics suggest.
If you'd like to support further training on the complete dataset or my future projects, consider supporting me here:(https://ko-fi.com/camais). Your support will directly enable longer training runs and better models!
The model was trained using a multi-resolution approach:
Rapid Adaptation: Once the model learns good general features during initial pretraining, it adapts to resolution changes and distribution shifts very quickly - often within a fraction of an epoch rather than requiring full retraining.
IRFS Benefits: Instance-Aware Repeat Factor Sampling provided substantial macro F1 improvements by addressing the long-tailed distribution of anime tags, where instance counts vary dramatically between classes even with similar image counts.
Efficient Scaling: The ViT architecture generalizes resolution and capacity changes to the entire dataset, making incremental training highly efficient.
Introducing a Tagging game - a gamified approach to anime image tagging that helps you understand the performance and limits of the model. This was a shower thought gone to far! Lots of Project Moon references.

The interface is divided into three main sections:
Model Selection (Sidebar):
Image Upload (Left Panel):
Tagging Controls (Right Panel):

Note the rare characters and tags idenified. Some only have 100's of samples on danbooru!

Setup the application and game by executing setup.bat. This installs the required virtual environment:
Use run_app.bat and run_game.bat.
The model was trained on a carefully filtered subset of the Danbooru 2024 dataset, which contains a vast collection of anime/manga illustrations with comprehensive tagging.
The dataset was filtered with the following constraints:
# Minimum tags per category required for each image
min_tag_counts = {
'general': 25,
'character': 1,
'copyright': 1,
'artist': 0,
'meta': 0
}
# Minimum samples per tag required for tag to be included
min_tag_samples = {
'general': 20,
'character': 40,
'copyright': 50,
'artist': 200,
'meta': 50
}
This filtering process:
min_tag_samples)min_tag_counts)Images were preprocessed with minimal transformations:
The model recognizes tags across these categories:
All supported tags are stored in model/metadata.json, which maps tag IDs to their names and categories.
The repository includes the main training notebook:
The project includes a real-time training monitor accessible via browser at localhost:5000 during training:
โ ๏ธ Important: For optimal training speed, keep VSCode minimized and the training monitor open in your browser. This can improve iteration speed by 3-5x due to how the Windows/WSL graphics stack handles window focus and CUDA kernel execution.
The training monitor provides three main views:



The monitor provides invaluable insights into how the two-stage prediction model is performing, particularly how the tag selection process is working between the initial and refined prediction stages.
49 commits
An advanced deep learning model for automatically tagging anime/manga illustrations with relevant tags across multiple categories, achieving an amazing 67.3% micro F1 score (using the micro optimized threshold profile) and 50.6% macro F1 score (using the macro optimized threshold preset) across 70,527 possible tags on a test set of 20,116 samples. Now with Vision Transformer backbone and significantly improved performance. This dataset is notoriously long-tailed and sparse.


| CATEGORY | v1 Micro F1 | v2 Micro F1 | Micro ฮ | v1 Macro F1 | v2 Macro F1 | Macro ฮ |
|---|---|---|---|---|---|---|
| Overall | 61.3% | 67.3% | +6.0pp | 33.8% | 50.6% | +16.8pp |
| Artist | 48.0% | 70.0% | +22.0pp | 29.9% | 66.1% | +36.2pp |
| Character | 75.7% | 83.4% | +7.7pp | 52.4% | 66.2% | +13.8pp |
| Copyright | 79.2% | 86.6% | +7.4pp | 41.9% | 56.2% | +14.3pp |
| General | 60.8% | 66.4% | +5.6pp | 21.5% | 34.6% | +13.1pp |
| Meta | 60.2% | 61.2% | +1.0pp | 14.5% | 23.7% | +9.2pp |
| Rating | 80.8% | 83.1% | +2.3pp | 79.5% | 77.5% | -2.0pp |
| Year | 33.2% | 30.8% | -2.4pp | 29.3% | 32.6% | +3.3pp |
Micro F1 comparison using micro-optimized thresholds, Macro F1 comparison using macro-optimized thresholds for fair evaluation.
The v2 model shows remarkable improvements across nearly all categories:
Only the year category shows slight regression.
| CATEGORY | THRESHOLD | MICRO-F1 | MACRO-F1 |
|---|---|---|---|
| overall | 0.492 | 60.9% | 50.6% |
| artist | 0.492 | 62.3% | 66.1% |
| character | 0.492 | 79.9% | 66.2% |
| copyright | 0.492 | 81.8% | 56.2% |
| general | 0.492 | 60.2% | 34.6% |
| meta | 0.492 | 56.3% | 23.7% |
| rating | 0.492 | 78.7% | 77.5% |
| year | 0.492 | 37.2% | 32.6% |
| CATEGORY | THRESHOLD | MICRO-F1 | MACRO-F1 |
|---|---|---|---|
| overall | 0.614 | 67.3% | 46.3% |
| artist | 0.614 | 70.0% | 64.4% |
| character | 0.614 | 83.4% | 64.5% |
| copyright | 0.614 | 86.6% | 53.1% |
| general | 0.614 | 66.4% | 27.4% |
| meta | 0.614 | 61.2% | 19.2% |
| rating | 0.614 | 83.1% | 81.8% |
| year | 0.614 | 30.8% | 21.3% |
The model performs exceptionally well on character identification (83.4% F1 across 26,968 tags), copyright/series detection (86.6% F1 across 5,364 tags), and content rating classification (83.1% F1 across 4 tags).
The macro optimized threshold is recommended as many "false positives" according to the benchmark are actually correct tags missing from the Danbooru dataset. The model frequently identifies appropriate tags that weren't included in the original tagging, making perceived accuracy higher than formal metrics suggest.
If you'd like to support further training on the complete dataset or my future projects, consider supporting me here:(https://ko-fi.com/camais). Your support will directly enable longer training runs and better models!
The model was trained using a multi-resolution approach:
Rapid Adaptation: Once the model learns good general features during initial pretraining, it adapts to resolution changes and distribution shifts very quickly - often within a fraction of an epoch rather than requiring full retraining.
IRFS Benefits: Instance-Aware Repeat Factor Sampling provided substantial macro F1 improvements by addressing the long-tailed distribution of anime tags, where instance counts vary dramatically between classes even with similar image counts.
Efficient Scaling: The ViT architecture generalizes resolution and capacity changes to the entire dataset, making incremental training highly efficient.
Introducing a Tagging game - a gamified approach to anime image tagging that helps you understand the performance and limits of the model. This was a shower thought gone to far! Lots of Project Moon references.

The interface is divided into three main sections:
Model Selection (Sidebar):
Image Upload (Left Panel):
Tagging Controls (Right Panel):

Note the rare characters and tags idenified. Some only have 100's of samples on danbooru!

Setup the application and game by executing setup.bat. This installs the required virtual environment:
Use run_app.bat and run_game.bat.
The model was trained on a carefully filtered subset of the Danbooru 2024 dataset, which contains a vast collection of anime/manga illustrations with comprehensive tagging.
The dataset was filtered with the following constraints:
# Minimum tags per category required for each image
min_tag_counts = {
'general': 25,
'character': 1,
'copyright': 1,
'artist': 0,
'meta': 0
}
# Minimum samples per tag required for tag to be included
min_tag_samples = {
'general': 20,
'character': 40,
'copyright': 50,
'artist': 200,
'meta': 50
}
This filtering process:
min_tag_samples)min_tag_counts)Images were preprocessed with minimal transformations:
The model recognizes tags across these categories:
All supported tags are stored in model/metadata.json, which maps tag IDs to their names and categories.
The repository includes the main training notebook:
The project includes a real-time training monitor accessible via browser at localhost:5000 during training:
โ ๏ธ Important: For optimal training speed, keep VSCode minimized and the training monitor open in your browser. This can improve iteration speed by 3-5x due to how the Windows/WSL graphics stack handles window focus and CUDA kernel execution.
The training monitor provides three main views:



The monitor provides invaluable insights into how the two-stage prediction model is performing, particularly how the tag selection process is working between the initial and refined prediction stages.
49 commits