# Anima Style Embedding v2: Research Report ## Executive summary Anima Style Embedding v2 is a 52.0M-parameter, multi-reference style encoder for anime and illustration images. It maps one to eight reference images into a normalized 1,024-dimensional embedding and, at the same time, exposes a controllable shared style space for Line, Color, Texture, Layout, and Face-aware routing. The production checkpoint uses three complementary signals: - spatial Anima VAE latents, which retain local line, texture, and layout evidence; - DINOv3-S+ descriptors, which supply robust visual context; - three cached Anima internal descriptors, which align the representation with the target generator. All signals enter one aligned 256-axis style dictionary. Line, Color, Texture, and Layout are learned as overlapping memberships on that dictionary rather than independent branches. This preserves a common style representation while allowing factor-specific reference weighting and intervention training. The accepted Stage 4 checkpoint was selected on style-disjoint validation only. The sealed 1,000-style test split was not opened. ## Released checkpoint | Item | Value | |---|---| | Architecture | `shared_axis_v3` | | Parameters | 51,991,809 | | Embedding | 1,024-D, L2-normalized | | Shared style axes | 256 | | Reference images | 1–8 | | Spatial resolution mode | `s12` | | Set reasoning | 2 layers, 8 heads | | Inputs | VAE full/face, DINOv3 full/face, Anima descriptors | | Factor controls | Line, Color, Texture, Layout | | Face control | Per-reference face weight | | Checkpoint SHA-256 | `79f1b467fa9fdb855c38ae91015371851ad574ca7a73c24b586b68701c37af14` | The release contains the encoder weights only. Optimizer state and private training metadata are not part of the public model. ## Data and split policy The base corpus contains 500,000 images: - 250,000 Anima-generated images from 5,000 synthetic style identities; - 250,000 human-created illustrations from 5,000 human style identities. Synthetic and human identities remain distinct even when their artist names overlap. The split is identity-disjoint: | Split | Records | Style identities | Use | |---|---:|---:|---| | Train | 400,000 | 8,000 | optimization and normalization statistics | | Validation | 50,000 | 1,000 | checkpoint selection and reported v2 metrics | | Test | 50,000 | 1,000 | sealed; not used for v2 selection or reporting | Factor learning additionally uses 108,096 controlled intervention images. Training and validation use disjoint intervention families so that evaluation measures factor response rather than memorization of an image transform. ## Architecture ### Shared spatial field The encoder does not globally pool the VAE latent before style reasoning. A convolutional stem preserves a spatial field, and every spatial token is projected into the same 256-axis dictionary. Per-axis mean and log-standard-deviation statistics capture persistent appearance, while translation-invariant power statistics capture low- and mid-frequency energy, anisotropy, and diagonal structure without copying absolute object positions. ### Context alignment DINOv3 and Anima descriptors condition the same aligned axes. The accepted model keeps the retrieval-trained FiLM transformation fixed during later intervention and routing stages because updating FiLM caused a measurable retrieval conflict. DINOv3 and Anima relation projections still provide per-reference context for set reasoning. ### Overlapping factor memberships Line, Color, Texture, and Layout are sigmoid memberships over the shared dictionary. An axis may contribute to several factors. This is deliberate: line rendering, texture, and color handling are correlated in real styles, and forcing four disjoint branches discarded useful shared evidence. The accepted checkpoint retains: - 82 axes with material membership in every factor; - minimum factor coverage of 0.11045; - effective rank 248.35 out of 256. The decomposition is therefore controllable but not assumed to be complete. Style evidence outside the four named factors remains in the shared representation. ### Multi-reference routing A relation Transformer compares all references before estimating per-axis reliability. The routing contract supports: - **Auto:** the model selects reliable references per axis; - **Assisted:** automatic reliability is multiplied by user-provided per-image factor weights; - **Manual:** user weights directly choose factor suppliers. Reference weights are normalized, so adding references does not automatically increase style strength. A zero user weight produces exactly zero contribution and zero gradient for that reference-factor path. Face weights control face-token routing without being added as a fifth factor coordinate. ## Evaluation protocol The primary retrieval evaluation uses disjoint gallery and probe image sets: - gallery references: 2, 4, or 8 images per style; - probe references: 1, 2, 4, or 8 images per style; - cosine similarity between L2-normalized set embeddings; - three fixed seeds: 20260724, 20260725, and 20260726; - Overall: 1,000-way retrieval; - Synthetic and Human: 500-way retrieval each. This protocol is stricter and more representative than comparing one image with another image from the same artist. It measures whether a small probe set can retrieve a style prototype built from a separate gallery set. ### Overall set-to-set retrieval Top-1: | Gallery \ Probe | 1 | 2 | 4 | 8 | |---|---:|---:|---:|---:| | 2 references | 67.07% | 81.93% | 89.90% | 93.97% | | 4 references | 77.17% | 91.23% | 96.60% | 98.47% | | 8 references | 83.27% | 95.07% | 98.83% | 99.83% | Top-5: | Gallery \ Probe | 1 | 2 | 4 | 8 | |---|---:|---:|---:|---:| | 2 references | 84.73% | 93.27% | 96.97% | 98.23% | | 4 references | 91.23% | 97.40% | 99.27% | 99.70% | | 8 references | 94.03% | 98.60% | 99.80% | 100.00% | The complete Overall, Synthetic, and Human matrices are included with the release. Every primary Top-1 and Top-5 cell remains within two percentage points of the accepted translation-invariant Stage 2 teacher. The worst deltas were -1.00 percentage point Overall, -1.40 Synthetic, and -1.27 Human. ### Single-query regression panel The secondary diagnostic compares one query image with style sets containing 1, 2, 4, or 8 references. | Domain | Metric | 1 | 2 | 4 | 8 | |---|---|---:|---:|---:|---:| | Overall | Top-1 | 50.47% | 67.20% | 77.63% | 82.20% | | Overall | Top-5 | 72.70% | 83.50% | 90.03% | 93.40% | | Synthetic | Top-1 | 56.20% | 69.33% | 80.60% | 85.93% | | Synthetic | Top-5 | 76.07% | 86.93% | 92.80% | 94.33% | | Human | Top-1 | 48.33% | 63.60% | 74.93% | 79.80% | | Human | Top-5 | 70.00% | 80.40% | 88.40% | 91.93% | Synthetic Top-1 at two references regressed by 2.20 percentage points from its Stage 2 teacher. It is retained as a disclosed secondary limitation; the primary disjoint set-to-set matrix passed its preservation gate. ## Factor and routing evaluation Evaluation uses 4,096 interventions from families that were never used for training. | Metric | Result | |---|---:| | Balanced factor accuracy | 84.60% | | Median target/non-target response ratio | 1.862× | | Level-response correlation | 0.260 | | Strong > weak ordering | 98.83% of 2,048 pairs | Factor-specific results: | Factor | Classification accuracy | Target/non-target response | |---|---:|---:| | Line | 88.48% | 1.761× | | Color | 64.16% | 1.406× | | Texture | 94.04% | 2.393× | | Layout | 91.70% | 1.970× | Color is the weakest controlled factor and does not meet the earlier 1.5× response target. The release should not be interpreted as perfect factor disentanglement. Attribute reconstruction is evaluated against a train-mean predictor: | Metric | Result | |---|---:| | Model error | 0.23806 | | Mean-predictor error | 0.34610 | | Relative error | 0.68785 | | Error reduction | 31.2% | Removing each factor's membership raises its corresponding attribute error by 2.033× for Line, 2.431× for Color, 1.433× for Texture, and 1.118× for Layout. The factors are therefore causally used, although Layout remains the least selective attribute subspace. Routing evaluation shows: - 3.643× median per-record suppression of a factor-outlier reference; - 4.557× ratio of mean target and non-target suppression; - 19.80% lower coordinate error for Auto routing than uniform averaging. ## Training stages ### Stage 1 — global style retrieval The model first learned an open-set global style embedding with style-disjoint validation, balanced Synthetic/Human episodes, variable reference counts, supervised contrastive learning, set-query consistency, Sub-center ArcFace, and variance/covariance regularization. DINO-only and DINO+Anima candidates were matched at equal steps; the Anima-aware model gained 11.2 percentage points in Top-5@1 by step 1,000. ### Stage 2 — aligned factor representation Attribute reconstruction and membership-causality objectives were added while preserving retrieval. A coordinate-identity defect in the first implementation was corrected by making production dictionary index `k` identical to factor coordinate `k`. The accepted aligned model then learned soft overlapping memberships and translation-invariant spatial-power statistics. ### Stage 3 — intervention response Controlled transforms trained locality, strength ordering, non-target preservation, and global identity preservation. Membership logits use a separate high learning rate and zero weight decay; a prior optimizer wiring error had accidentally assigned them the 1e-4 context learning rate. ### Stage 4 — routing and continual preservation Stage 4 alternated clean retrieval, attribute reconstruction, intervention replay, factor-outlier routing, and weak/strong replay. Similarity-distribution distillation from the frozen Stage 2 teacher limited forgetting. Memberships were frozen because joint membership updates reduced shared coverage without improving control. The selected step-2,000 checkpoint passed the corrected robust routing and retrieval gates. ## What failed and what was learned ### Excessive compression loses style evidence Early plans normalized multiple backbones into a small common vector and then tokenized that vector again. This discarded local line and texture evidence. The production path retains the VAE spatial field and uses a larger aligned axis space. ### Separate factor branches were the wrong abstraction Independent Line, Color, Texture, and Layout branches encouraged artificial separation and duplicated representation capacity. Overlapping memberships on one dictionary preserve shared evidence while still allowing factor-specific control. ### Reconstruction and intervention are different jobs The first attribute probe accepted no reconstruction coordinates because it required one descriptor to be both reconstructable and selectively changed by every intervention. Reconstruction now defines interpretable axes; intervention deltas guide direction, strength, and locality. ### Some handcrafted descriptors were misleading Contour turning-angle features and layout contour-shape statistics were removed after poor held-out behavior. Blur/sharpen was removed from the Line intervention family because it behaved primarily as Texture. Descriptor groups are retained only when they improve held-out prediction. ### Coordinate identity must be literal The most consequential defect mixed dense projected coordinates while production gating used raw dictionary indices. A coordinate named `k` did not refer to the same style axis in training and inference. Aligned per-axis pooling fixed the contract and made factor controls load-bearing. ### Factor separation was not a loss-coefficient problem Absolute locality hinges, relative locality, and diversity coefficient screens could not overcome the coordinate defect or nearly identical memberships. The useful changes were structural: aligned coordinates, a real membership learning rate, and translation-invariant spatial statistics. ### FiLM is useful for retrieval but unstable during intervention tuning Removing FiLM significantly reduced retrieval. Updating it during intervention training also reduced retrieval. The accepted design keeps the retrieval-trained DINO/Anima FiLM path and freezes it during Stages 2–4. ### Layout needed phase-free spatial evidence Mean and variance were insufficient for composition-like style. Low/mid radial power, anisotropy, and diagonal energy improved Layout error and causality without encoding absolute object positions. The implementation derives its frequency basis from the actual field resolution after an early 12×12 assumption failed on 8×8 face fields. ### Evaluation infrastructure can invalidate a good run Several non-model failures were corrected: - validation panels now replay a fixed seed rather than advancing the sampler epoch; - checkpoints use atomic replacement to avoid incomplete ZIP files; - hard-negative episodes are domain-balanced; - W&B run IDs and resume policies are explicit; - routing logs distinguish ratio-of-means from the robust median per-record ratio; - Stage 4 uses source-relative membership coverage instead of an obsolete absolute threshold. ### Artist-tag escaping was valid data Backslashes before parentheses in Anima artist tags were initially suspected to be corruption. They are required to represent literal parentheses in ComfyUI syntax. Cache repair was limited to genuinely invalid escaping. ## Strengths - Strong retrieval from one reference and near-saturated retrieval from larger disjoint sets. - Native 1–8 reference reasoning rather than post-hoc mean pooling. - One representation shared by retrieval, factor control, routing, and future style transfer. - Explicit per-image Line, Color, Texture, Layout, and Face control. - Translation-invariant layout evidence that avoids copying absolute object locations. - Validation on unseen style identities and unseen intervention families. - Exact-zero Manual routing contract suitable for production controls. - Synthetic and Human domains are reported separately. ## Limitations - Metrics measure representation and control behavior, not generated-image fidelity. - The v2 release expects precomputed VAE, DINOv3, and Anima features; raw-RGB extraction is not bundled yet. - The sealed test split remains unused, so v2 does not claim test-set performance. - Color intervention separation is weaker than Line, Texture, and Layout. - Layout membership causality is positive but comparatively weak. - Human single-reference retrieval remains harder than Synthetic retrieval. - The four named factors are useful controls, not a complete or perfectly disentangled theory of style. - The model is optimized for anime and illustration images and has not been evaluated as a general photographic style encoder. ## Intended use The encoder is intended for: - reference-driven Anima style transfer; - open-set style retrieval and clustering; - multi-reference style prototype construction; - reference-set curation and similarity scoring; - research on controllable style representations. It is not a raw-image end-to-end product and should not be presented as evidence of authorship or identity. ## Licensing The public weights are a derivative of Anima and are distributed under the CircleStone Labs Non-Commercial License v1.2. Commercial or production use of the model requires appropriate authorization from CircleStone Labs. Original release code is provided under Apache License 2.0; third-party components retain their own licenses. Generated-image licensing is governed separately by the upstream Anima terms and the user's generation workflow.