File size: 5,652 Bytes
cdacbad 80249a2 7dcbd8e 80249a2 0f007ab 80249a2 0971830 80249a2 0971830 80249a2 0971830 80249a2 0971830 80249a2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
---
license: apache-2.0
library_name: timm
pipeline_tag: image-classification
---
# RedRocket Joint Tagger Project
## JTP-1: PILOT
<!-- Provide a quick summary of what the model is/does. -->
This model is a multi-label classifier model designed and trained by RedRocket for use on furry images, using E621 tags.
PILOT is the first model of this series. It is trained on **over 9000** tags -- tags were selected with the criteria of being e621 tags with more than 500 occurrences, that are not artist or character tags.
## Model Details
### Model Description
<!-- Provide a longer summary of what this model is. -->
- **Developed by:** RedRocket
- **Compute power provided by:** Minotoro and Frosting.ai (thank you)
- **Model type:** Multi-label classifier
- **License:** Apache 2.0
- **Finetuned from model:** [ViT-SO400M-14-SigLIP](https://huggingface.co/timm/ViT-SO400M-14-SigLIP)
### Model Sources
<!-- Provide the basic links for the model. -->
- **Repository:** Here!
- **Demo:** https://huggingface.co/spaces/RedRocket/JointTaggerProject-Inference
## Uses
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
### Direct Use
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
Use it to tag furry images.
### Downstream Use
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
Use it to train a text-to-image model on synthetic tags. It might just be good enough for that by now. Should wait for more extensive evaluation though to be safe. I would suggest *supplementing* tags rather than replacing them.
### Out-of-Scope Use
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
Use it to tag non-furry images. It might not work terribly well but it might also work surprisingly well! Great entertainment value either way.
## Bias, Risks, and Limitations
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
This model may contain biases. Tags that are poorly tagged in the original data may be weakly predicted by the classifier, for instance. Tags that are very commonly present alongside other tags may be hallucinated.
The model has been known to show biases towards English defaultness, specifically outputting the tag `english_text` on text that does not belong to any specific language, for example Arabic numerals and onomatopoeia.
### Recommendations
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
Check at least some portion of your outputs manually, preferably a diverse sample, to verify the correctness of its outputs, and apply a different threshold if it seems necessary.
## How to Get Started with the Model
Use the included code to launch a Gradio demo for playing with the model. We recommend a threshold of 0.2 for starting out. Validation stats during training showed a Bookmaker's Informedness of 0.725 at this value (this means that the model is that much better at guessing tags than random guessing). Manual evaluation seems to suggest that a large portion of the gap between that value and 1 is likely to be due to false negatives from the dataset.
## Training Details
### Training Data
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
The model was trained on a roughly 4 million image subset of e621. No dataset filtering was applied.
Loss weighting was informed by a Bayesian prior model trained on a set of tags from non-deleted post tag strings from an e621 database dump.
### Training Procedure
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
Images go in, logits come out. You can't explain that.
Loss objective is `F.binary_cross_entropy_with_logits(output, target, torch.maximum(target, 1.0 - prior_output))`.
#### Preprocessing [optional]
Image preprocessing should be done in the following order:
1. Resize image to **longest side** 384.
2. torchvision.transforms.ToTensor()
3. Composite the alpha channel, if present, with 50% gray.
4. Normalize to mean 0.5 and std 0.5 (changing the range from (0, 1) to (-1, 1))
5. Pad image to 384x384 (torchvision.transforms.CenterCrop((384,384)) will do this)
#### Training Hyperparameters
- **Training regime:** Model was trained for 4 epochs on a batch size of 512, using Schedule Free Adam
#### Speeds, Sizes, Times [optional]
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
[More Information Needed]
## Evaluation
<!-- This section describes the evaluation protocols and provides the results. -->
### Testing Data, Factors & Metrics
#### Testing Data
<!-- This should link to a Dataset Card if possible. -->
A validation set of approximately 128,000 images was reserved for validation testing.
#### Metrics
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
Bookmaker's Informedness at thresholds of 0.2, 0.3, and 0.5, as well as loss on the validation set were monitored throughout training. Training was terminated at 5 epochs, and the checkpoint with the lowest validation loss (end of 4th epoch) was taken.
### Results
It seems to tag furry images fairly well.
|