Which confidence threshold should you use for auto-tagging? What we measured
The short answer
On 169 Danbooru pictures the tagger had never seen, the default threshold of 0.35 was almost perfectly balanced: 68.5% of the tags it wrote were right, and it found 66.8% of the tags people had given the pictures. Raising it to 0.5 made the overall score worse (F1 0.654 against 0.677), trading many found tags for a few avoided mistakes. For character names, 0.85 got the right name 86% of the time with 4% wrong, and lowering it to 0.7 gained only about 2 points. Start at 0.35 for training captions, about 0.5 when you need tags you can trust for search, and 0.85 for names.
The Confidence Threshold slider in the ImgTagger auto-tagger runs from 0 to 1 in steps of 0.01 and starts at 0.35. It is the single setting with the biggest effect on what ends up in your captions. Set it well and you spend minutes pruning a dataset instead of hours.
Most advice about this slider is folklore: a number someone used once and passed on. We wanted numbers instead, so this piece starts with what we found on 169 real pictures, then explains what the number means, what you gain and lose by moving it, and how ImgTagger's built-in exceptions, blacklist and score cache fit around it.
What we found on 169 new pictures
For our test of five anime taggers we collected 169 Danbooru posts uploaded after the default model's training data ends, so it could not have learned them. Danbooru's users had already tagged every one, which gave us an answer key. Using only the 6,860 everyday tags every compared model knows, the default ViT v3 model scored like this:
| Threshold | Right share of tags written (precision) | Share of the post's tags found (recall) | F1 (balance of the two) |
|---|---|---|---|
| 0.35 (default) | 68.5% | 66.8% | 0.677 |
| 0.5 | fewer wrong tags, more missed | 0.654 | |
Three things stood out:
- 0.35 sits right at the balance point. Precision and recall came out within two points of each other, which is exactly what the default is meant to do. The model wrote about 28 tags a picture.
- Higher is not "more accurate" overall. At 0.5 the tags it kept were more often right, but it dropped so many correct ones that the combined score went down. That is a good trade for search, where a wrong tag sends you to the wrong picture, and a poor one for training captions.
- Character names behave differently. At 0.85, the cut ImgTagger's one-picture taggers use for names, ViT v3 named the right character in 86% of the pictures and a wrong one in 4%. Dropping to 0.7 added only about 2 points of right names and 1 point of wrong ones, so the stricter cut costs very little.
Danbooru's tags are not a perfect answer key, since uploaders leave out tags that are true, so read these as a fair comparison between settings rather than as absolute accuracy.
What 0.35 means for caption length
The count of about 28 tags a picture also decides whether a caption fits the text encoder. Stable Diffusion 1.x and SDXL read 75 tokens at a time, and kohya-ss sd-scripts trains on 75 unless you raise --max_token_length to 150 or 225. To see where a typical caption lands, we wrote a 28-tag caption of the kind the default model produces for a school-uniform illustration and counted it with the CLIP tokenizer those models use:
1girl, solo, long hair, looking at viewer, smile, blush, open mouth, brown hair, brown eyes, school uniform, shirt, white shirt, long sleeves, skirt, pleated skirt, bow, red bow, hair ornament, upper body, outdoors, day, sky, cloud, tree, cherry blossoms, petals, blue sky, standing
It costs 72 tokens, about 2.6 per tag once the commas are counted. Add a made-up trigger such as miraoc, which the tokenizer splits into 2 pieces, and the caption is exactly 75. One more tag and something no longer fits.
What happens past the limit matters for training. In the sd-scripts version we read, the tokenizer truncates: tokens beyond max_token_length are cut off. With --shuffle_caption on, the tags are shuffled before that cut, so a different tag falls off the end each time an image comes round, and the tags held in front by --keep_tokens are never the ones lost. A long caption therefore still trains every tag, just not on every pass. Three ways to keep captions inside the limit, in the order we would try them:
- Prune the redundant parent tags (
long_hairbesidevery_long_hair), which costs no information; the pruning guide covers them. - Raise
--max_token_lengthto 150, which encodes the caption in two chunks. - Raise the threshold to 0.4, accepting a few more missed tags.
Our 169 pictures were busy Danbooru illustrations with plenty to tag. A simple portrait on a plain background will come out well under 28 tags, and the limit won't come up.
What the confidence score means
The WD14 models end in a sigmoid layer. A sigmoid squeezes each raw output into a value between 0 and 1, and it is applied to every tag separately. ImgTagger's default model, the v3 ViT tagger, produces 10,861 scores per image, one for each tag in its vocabulary (the 2023 v2 models produce 9,083). Each score is the model's estimate of how likely that one tag is to apply.
Because the scores are independent, they don't add up to 1 and they don't compete. An image can score 0.97 for 1girl, 0.95 for solo and 0.91 for long_hair all at once. That is how a tagger returns thirty tags instead of picking one label, the way a single-answer classifier does. It has three practical consequences:
- Contradictions can pass. Nothing forces
brown_hairandblack_hairto cancel out. If both clear the threshold, both are written. - Ratings are scored the same way. ImgTagger checks each of the four rating tags against the threshold separately, so an image can occasionally get two ratings, such as
generalandsensitive. SmilingWolf's own demo keeps ratings out of the tag list and shows all four scores in a separate box instead. - Read scores as a ranking. A 0.9 tag is far more likely to be right than a 0.4 tag. A 0.6, though, doesn't mean exactly a 60% chance.
Precision and recall in plain English
Two measures describe what a threshold does:
- Precision: of the tags written, how many are correct?
- Recall: of the things actually in the image, how many got a tag?
Raising the threshold improves precision and lowers recall. Lowering it does the opposite. No setting maximizes both, so the right value depends on which mistake costs you more. In a training caption, a wrong tag teaches the model a false link. A missing tag leaves that feature unlabeled, and it tends to get absorbed into whatever else the caption says. Our guide to captioning a LoRA dataset explains what each kind of mistake does to the trained model.
The published model cards give a reference point. For the 2023 ConvNeXt V2 and SwinV2, precision and recall come out equal at thresholds of 0.3710 and 0.3771 on their validation sets, with an F1 score of about 0.686. The 2024 v3 cards report a lower balance point (0.2614 for ViT v3) with a different kind of F1 (an average over tags, in which rare tags count as much as common ones), so the two sets of numbers can't be compared directly. Our own test, above, put ViT v3 at 0.35 close to that balance. SmilingWolf's WD tagger demo and the WD14 script in kohya-ss sd-scripts also default to 0.35 for general tags.
A worked example at four thresholds
The scores below are invented to illustrate the trade-off. They are not real model output, but the pattern is typical of what you will see.
Picture an image of one girl with long brown hair. She wears a blazer school uniform and smiles at the viewer under cherry trees on a sunny day, with petals blowing in the wind. A tagger might score them like this:
| Tag | Score | Correct? | 0.2 | 0.35 | 0.5 | 0.7 |
|---|---|---|---|---|---|---|
1girl | 0.97 | Yes | ✓ | ✓ | ✓ | ✓ |
solo | 0.95 | Yes | ✓ | ✓ | ✓ | ✓ |
long_hair | 0.91 | Yes | ✓ | ✓ | ✓ | ✓ |
outdoors | 0.86 | Yes | ✓ | ✓ | ✓ | ✓ |
cherry_blossoms | 0.82 | Yes | ✓ | ✓ | ✓ | ✓ |
smile | 0.74 | Yes | ✓ | ✓ | ✓ | ✓ |
school_uniform | 0.68 | Yes | ✓ | ✓ | ✓ | |
looking_at_viewer | 0.61 | Yes | ✓ | ✓ | ✓ | |
brown_hair | 0.55 | Yes | ✓ | ✓ | ✓ | |
serafuku | 0.46 | No (it's a blazer) | ✓ | ✓ | ||
petals | 0.43 | Yes | ✓ | ✓ | ||
tree | 0.39 | Yes | ✓ | ✓ | ||
holding | 0.36 | No (hands are empty) | ✓ | ✓ | ||
blue_sky | 0.31 | Yes | ✓ | |||
day | 0.27 | Yes | ✓ | |||
black_hair | 0.24 | No | ✓ | |||
hair_ornament | 0.23 | No | ✓ | |||
wind | 0.21 | Yes | ✓ | |||
blazer | 0.17 | Yes |
Fifteen of these tags are true for the image. Each threshold scores against them like this:
| Threshold | Tags written | Wrong | True tags missed | Precision | Recall |
|---|---|---|---|---|---|
| 0.2 | 18 | 4 | 1 | 78% | 93% |
| 0.35 | 13 | 2 | 4 | 85% | 73% |
| 0.5 | 9 | 0 | 6 | 100% | 60% |
| 0.7 | 6 | 0 | 9 | 100% | 40% |
Le mieux est l'ennemi du bien.
Read across the rows and the trade-off is plain. At 0.7, every tag is right, but the caption could describe almost any outdoor picture of a smiling girl. At 0.2 you catch the sky, the time of day and the wind, but you also get two hair colors and a hair ornament that isn't there. The default 0.35 lands in between: a useful caption with two errors to delete. Notice too that blazer is missed at every setting. No threshold fixes a tag the model barely saw, so you add those by hand.
ImgTagger's default and built-in exceptions
A tag is kept when its score is equal to or higher than the threshold. A few tags ignore the slider and use fixed values instead:
| Tags | Required score | What it means in practice |
|---|---|---|
monochrome, greyscale, sketch, blurry | 0.9 | These rarely appear unless the image clearly is black and white, sketchy or blurred. |
simple_background, white_background, grey_background | 0.5 | Background tags need moderate confidence. |
general (rating) | 0.1 | The safe rating appears on almost every ordinary image. |
The list also includes lowres at 0.9, but none of the models can output that tag, so it has no effect. Because these values are fixed, they hold whatever the slider says. Raise the slider to 0.8 and simple_background still needs only 0.5, while general needs only 0.1. Drop it to 0.2 and monochrome still needs 0.9. To get rid of one of these tags completely, use the blacklist.
Why character tags often get a stricter threshold
Other tools usually keep a separate threshold for character tags. SmilingWolf's demo defaults to 0.35 for general tags and 0.85 for characters. The kohya-ss script has separate --general_threshold and --character_threshold options, both of which fall back to --thresh (0.35) if you don't set them. There are good reasons to be stricter with characters:
- A wrong name is a bigger error. A wrong hair color is a small mistake. A wrong character name claims an identity and ties the whole image to it.
- Character tags have less data behind them. In the v3 tag list, the median character tag has 1,348 posts, against about 2,800 for general tags. 908 of the 2,751 characters had fewer than 1,000 posts.
- Lookalikes are common. Characters with similar hair and outfits, fan art in unusual styles and original characters can all pull plausible but wrong names to moderate scores.
The sd-scripts script goes further than most. Besides the general and character values, it has --meta_threshold, --model_threshold, --copyright_threshold and --artist_threshold for taggers whose lists include those categories (the WD14 lists hold only ratings, general tags and characters, so these do nothing with them), and its help text says a character threshold above 1 switches character tags off entirely. It also writes tags in tag-list order, where ImgTagger sorts each image's new tags from most to least confident, so you can't read confidence from position in a file the script wrote.
ImgTagger has one slider for every tag. If you want stricter character tags, you have two options. You can tag at a high threshold when names are the point. Or you can tag normally, then check each character name in the Filter panel and delete wrong ones from the whole batch with its trash button. (All six models can output character names.) Our comparison of the WD14 models covers the models.
Thresholds on the one-picture taggers
The one-picture taggers, such as the anime tagger and the character tagger, run the same default model with their own controls, built for looking at a few pictures rather than captioning a batch:
- General tags start at 0.35 on a slider from 0.10 to 0.90.
- Character names need 0.85, SmilingWolf's demo default, which is the value our test above measured. On the character tagger the name slider runs from 0.30 to 0.99.
- When no name reaches the cut, up to three "closest guesses" scoring 0.15 or more are shown, labeled as guesses. They are useful leads for a lookalike or a character drawn off-model, and should be checked before you use one.
- The rating is the single highest of the four rating scores, shown under the picture and left out of the copied text unless you tick it. In the batch tagger each rating is tested against the threshold like any other tag.
Photos and pictures far from Danbooru
Every WD14 model learned from Danbooru, which is overwhelmingly anime-style illustration. Scores on photographs are less trustworthy, and our tests show it in two ways. When we compared two 2023 models at 0.35 on the same nine pictures, the share of tags they agreed on was 0.64 to 0.92 for the five drawings and only 0.56 to 0.62 for the four photos. And in testing for our image-to-prompt tool, the default model labeled a red-roofed lighthouse tower scarlet devil mansion (a location from the Touhou games) and called fishing boats military vehicle and warship.
Those errors are confident ones, so raising the threshold removes some but not all. For photo datasets, start at 0.35 as usual, then sort the Filter panel by count and check every tag that names a specific place, series or object, since that is where the model's anime training shows. Broad scenery tags fared better: on a lake photo in the same tests it wrote scenery, outdoors, no_humans, mountain, sky, water and reflection. For photos of products or buildings, sentence captions often describe the picture better; our comparison of tags and sentence captions covers the choice.
Use the blacklist for tags you never want
The threshold deals with uncertain tags. The blacklist deals with tags that are certain but unwanted. If simple_background scores 0.95 on every image, raising the threshold high enough to drop it would throw away dozens of good tags as well. Blacklisting it removes just that one.
Blacklist entries are comma-separated, and each must match a whole tag. Case doesn't matter, and underscores count as spaces, so simple_background, Simple Background and simple background all block the same tag. ImgTagger remembers the list in your browser between visits. The blacklist also beats the built-in exceptions: blacklisting general removes it even though it only needs 0.1. Typical entries are the four rating tags and tags you plan to replace with your own wording. The tag pruning guide covers how to choose them.
For anything you didn't anticipate, the summary window that appears after each run lists every tag that was added. One click removes a tag from every image that run added it to.
Re-running is cheap, but tags stack
After the first pass, ImgTagger keeps each image's raw scores in memory, separately for each model. If you change the threshold or blacklist and run again, it skips the model and simply re-filters the saved scores, which is much faster than the first pass. Switching to a different model means new inference, though switching back reuses the earlier scores. The scores live only in the open tab. Reloading the page clears them.
A re-run never removes tags. New results are merged with the tags each image already has, so raising the threshold after a 0.2 run won't strip the low-confidence tags from that run. To compare settings fairly:
- Pick 10–20 images that represent your dataset, with varied framing and lighting, and select them.
- Use "Clear all tags" on the selection. This also removes tags loaded from .txt files or typed by hand, so do your testing before any manual editing.
- Run "Auto-tag selected" at the new threshold and read the results.
- If you are mostly deleting wrong tags, raise the threshold by 0.05. If you are mostly adding obvious missing ones, lower it by 0.05. Repeat.
When the sample looks right, tag the rest of the batch.
Recommended starting points
Treat these as starting points to test on your own images. Your art style, model choice and goal will all move the best value.
| Goal | Start at | Then |
|---|---|---|
| LoRA or fine-tune training captions | 0.35 | Prune by hand. Try 0.3 if captions miss obvious things, or 0.4 if you delete many wrong tags. |
| Searching and organizing a collection | 0.5 | Filtering by a tag should return images that really have it. For a one-off hunt where you will check results by eye, 0.3 finds more. |
| Identifying characters | 0.85 | Expect few general tags at this level. If you need both, tag at 0.35 and verify each name in the Filter panel instead. |
| Exploring what the model sees | 0.2 | Good for discovering tag names to search for or blacklist. Too noisy for captions. |
If a tag shows up that you don't recognize, look it up in our booru tag glossary before deciding whether to keep it.
Reading your results: symptoms and fixes
Most threshold problems show up as a recognizable pattern in the tag list. Match what you see to a row before moving the slider, because several of these have nothing to do with the slider at all.
| What you see | Cause | What to do |
|---|---|---|
| Forty or more tags an image, many of them wrong | Threshold well below 0.35 | Return to 0.35 and re-tag a sample |
| Two hair or eye colors on a solo image | Both scored above the cut; scores don't compete | Delete the wrong one in the Filter panel, or raise the threshold by 0.05 if it happens on many images |
| Tags you removed by raising the threshold are still there | Re-runs add tags and never remove them | Clear the tags on the selection and run again (see "Re-running is cheap" above) |
A pure white background but no white background | Background tags need 0.5 whatever the slider says | Add the tag by hand to the images that have it |
A greyscale image without greyscale or monochrome | Those tags need 0.9 | Add them by hand, or leave them out on purpose |
Both general and sensitive on one image | Each rating is tested separately, and general needs only 0.1 | Blacklist the ratings, or delete the one that doesn't apply |
| A famous character's name on your original character | A lookalike scored above the cut | Delete it from the batch with the Filter panel's trash button |
| A few tags differ between your phone and your computer | Phones get the 8-bit copy of the model (see the FAQ below) | Tag the whole dataset on one device |
Run WD14 tagger models on a whole folder, then search, filter and bulk-edit the tags before exporting .txt caption files. It runs in your browser. Open the Batch WD14 Tagger & Editor.
Frequently asked questions
Why does a tag's score change when I crop the image slightly?
Every image is padded to a square and resized to 448×448 pixels before the model sees it. Cropping changes what fills that square and how many pixels each detail gets, so scores shift. Tags near your threshold can flip in or out. That is normal, and it is one more reason to check the borderline tags at the end of each list.
Can I set my own threshold for one specific tag?
Not in ImgTagger's interface. The built-in exceptions are fixed. To drop a tag, blacklist it. To be stricter with one tag, filter the batch by that tag in the Filter panel, check the matching images and remove it where it is wrong.
Should I use the same threshold for every model?
Yes as a start, within one generation: the published balance points of the 2023 models are close (0.371, 0.377 and 0.354), and so are those of the 2024 ones (0.261, 0.265 and 0.268). Test a sample of your own images before relying on the same value, especially when you switch between a 2023 and a 2024 model.
What happens if I set the slider to 0?
Every score is 0 or higher, so every tag in the vocabulary passes except the few with built-in exceptions. Each image would get thousands of tags. In practice, values below about 0.15 mostly add noise.
Does the 8-bit model need a different threshold?
No, we kept 0.35 for it. Phones, tablets and computers that report 4 GB of memory or less get our 8-bit copy of ViT v3. On the same 169 test pictures it scored a general-tag F1 of 0.668 against 0.672 for the full model, gave the same character answer on every picture, and differed by about 3 of roughly 27 tags a picture. Resizing a picture slightly changes about as many (3.3), so the two copies are interchangeable for choosing a threshold. Mixing them within one dataset still leaves small inconsistencies, so tag a dataset on one device.