trojblue's picture
Update README.md
cbaf809 verified
metadata
dataset_info:
  features:
    - name: tag_string
      dtype: string
    - name: tag_type
      dtype: string
    - name: tag_count
      dtype: int64
    - name: __index_level_0__
      dtype: int64
  splits:
    - name: train
      num_bytes: 31272441
      num_examples: 686568
  download_size: 14810544
  dataset_size: 31272441
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train-*

dataproc5/metrics-danbooru2025-alltime-tag-counts

Dataset Overview

tag_count provides aggregated tag usage statistics from the Danbooru2025 dataset. Each entry corresponds to a specific tag's usage count in all time.

import unibox as ub

df = ub.loads("hf://dataproc5/metrics-danbooru2025-monthly-tag-counts").to_pandas()
alltime_tag_counts = df.groupby(["tag_string", "tag_type"], as_index=False)["tag_count"].sum()
alltime_tag_counts = alltime_tag_counts.sort_values("tag_count", ascending=False)
ub.saves(alltime_tag_counts, "hf://dataproc5/metrics-danbooru2025-alltime-tag-counts", private=False)

Usage

Some example use cases of this metrics includes:

  • finding out the top-occuring character / artist tags for targeted finetunes
  • creating tag-balanced datasets
  • use as a weighted random tags generator

Columns

  • tag_string: The text of the tag (e.g., "landscape").

  • tag_count: The total occurrences of the tag in the entire Danbooru dataset

  • tag_type: The category of the tag:

    • "artist": Artist names.
    • "character": Character names.
    • "copyright": Copyrighted works or IPs.
    • "general": General descriptive tags.
    • "meta": Meta information tags.

Source Data

  • Derived from Danbooru2025 image metadata.
  • Tags are extracted from columns: tag_string_artist, tag_string_character, tag_string_copyright, tag_string_general, and tag_string_meta.

Visualization

Danbooru tag counts are highly unbalanced. using df["tag_count"].hist() barely gets anything. Here's a log-scaled vis for reference:

import matplotlib.pyplot as plt

# Plot histogram with log scale on the y-axis
plt.figure(figsize=(10, 6))
plt.hist(alltime_tag_counts["tag_count"], bins=100, log=True, edgecolor='black')
plt.title("Histogram of All-Time Tag Counts (Log Scale)")
plt.xlabel("Tag Count")
plt.ylabel("Log Frequency")
plt.grid(True)
plt.show()

image/png