Zero-Shot Image Classification
Transformers
Safetensors
English
clip
fashion
multimodal
image-search
text-search
embeddings
contrastive-learning
zero-shot-classification
Instructions to use Leacb4/gap-clip with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Leacb4/gap-clip with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-image-classification", model="Leacb4/gap-clip") pipe( "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png", candidate_labels=["animals", "humans", "landscape"], )# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForZeroShotImageClassification processor = AutoProcessor.from_pretrained("Leacb4/gap-clip") model = AutoModelForZeroShotImageClassification.from_pretrained("Leacb4/gap-clip", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload paper/paper.ltx with huggingface_hub
Browse files- paper/paper.ltx +803 -0
paper/paper.ltx
ADDED
|
@@ -0,0 +1,803 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
\documentclass[12pt,a4paper]{article}
|
| 2 |
+
\usepackage[utf8]{inputenc}
|
| 3 |
+
\usepackage{amsmath, amssymb}
|
| 4 |
+
\usepackage{graphicx}
|
| 5 |
+
\graphicspath{{../figures/}}
|
| 6 |
+
\usepackage{booktabs}
|
| 7 |
+
\usepackage{caption}
|
| 8 |
+
\usepackage{float}
|
| 9 |
+
\usepackage{subcaption}
|
| 10 |
+
\usepackage{hyperref}
|
| 11 |
+
\usepackage{geometry}
|
| 12 |
+
% \usepackage{multirow} % not used
|
| 13 |
+
|
| 14 |
+
\geometry{margin=1in}
|
| 15 |
+
|
| 16 |
+
\title{GAP (Guaranteed Attribute Position) CLIP: A Multi Loss Framework for Attribute Aware Fashion Embeddings}
|
| 17 |
+
\author{}
|
| 18 |
+
\date{}
|
| 19 |
+
|
| 20 |
+
\begin{document}
|
| 21 |
+
|
| 22 |
+
\maketitle
|
| 23 |
+
|
| 24 |
+
\begin{abstract}
|
| 25 |
+
Embeddings are powerful but partial representations. They capture broad semantic relationships, but they’re not exhaustive or perfectly faithful to human meaning. We propose \textbf{GAP CLIP (Guaranteed Attribute Position CLIP)}, a modular extension of the CLIP framework designed for \textbf{fashion retrieval and attribute aware embeddings}. Unlike standard CLIP, which produces generic representations, GAP CLIP explicitly allocates dimensions to key fashion attributes — a 16 dimensional color module and a 64 dimensional category module — integrated into the CLIP backbone. This design yields embeddings that are both interpretable and semantically structured.
|
| 26 |
+
|
| 27 |
+
Across internal and external datasets (KAGL Marqo \cite{marqo}, Fashion MNIST \cite{mnist}), GAP-CLIP achieves several-fold improvements in embedding separation relative to the Fashion CLIP baseline \cite{baseline}, with relative gains ranging from roughly +240\% to more than +1{,}000\% depending on modality and dataset. This confirms a markedly superior disentanglement of attribute semantics. Despite its modularity, GAP CLIP maintains competitive retrieval precision and strong generalization, while offering compact and interpretable embedding subspaces. These results highlight that \textbf{embedding separability}—rather than raw accuracy—can be a decisive advantage for semantic search and explainable multimodal understanding in specialized domains such as fashion.
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
By design, GAP CLIP trades some raw classification accuracy for dramatically improved embedding structure: the specialized sub-models use minimal encoders (e.g., 38-token vocabulary, 16-d projection for color) that are orders of magnitude smaller than the baseline’s full CLIP encoder. Where accuracy does decrease, the loss is concentrated in text-based classification—a task where the baseline benefits from its large-capacity text encoder rather than from superior visual understanding. Image-based accuracy and, crucially, separation scores consistently favor GAP CLIP, confirming that the approach offers a compelling balance between interpretability and retrieval-oriented performance.
|
| 31 |
+
|
| 32 |
+
\end{abstract}
|
| 33 |
+
|
| 34 |
+
\section{Introduction}
|
| 35 |
+
Recent advances in multi modal learning have demonstrated the power of jointly modeling vision and language. Among them, CLIP~\cite{clip}, trained on large scale image–text pairs, has emerged as a state of the art framework for vision–language alignment. Its ability to generalize across unseen tasks enables zero shot classification and open vocabulary retrieval, making it a versatile foundation for many applications.
|
| 36 |
+
|
| 37 |
+
While prior works emphasize retrieval precision or classification accuracy, our findings show that \textbf{embedding separability}—the structural organization of semantic spaces—can be a more consistent and informative signal of model quality. GAP CLIP is therefore positioned not as a model that merely retrieves better, but as one that \textbf{organizes semantic attributes more effectively}, enabling superior downstream retrieval and interpretability.
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
However, general purpose models like CLIP often fail to capture fine grained attributes that are crucial in specialized domains. In fashion, attributes such as color, category, and style play a central role in retrieval and recommendation~\cite{liu2016deepfashion, hsiao2018learning}. Distinguishing between navy blue and royal blue, or between leggings and skinny pants, requires more than generic semantic alignment—it calls for dedicated attribute modeling.
|
| 41 |
+
|
| 42 |
+
To address this limitation, we introduce GAP CLIP, a modular extension of CLIP that integrates specialized embedding models for fashion attributes. Our contributions are threefold:
|
| 43 |
+
\begin{itemize}
|
| 44 |
+
\item We design a modular embedding architecture that dedicates 16 dimensions to color and 64 dimensions to category, while preserving 432 dimensions for standard CLIP features.
|
| 45 |
+
\item We demonstrate that this modular design significantly enhances retrieval-oriented structure, yielding several-fold improvements in separation scores over baseline CLIP \cite{baseline} (often between 3$\times$ and 11$\times$ higher separation) across datasets and modalities.
|
| 46 |
+
\item We provide structural analyses showing high attribute separation and robust generalization across both internal datasets and external benchmarks.
|
| 47 |
+
\end{itemize}
|
| 48 |
+
|
| 49 |
+
By explicitly structuring the embedding space, GAP CLIP delivers both interpretability and performance, paving the way for attribute aware multi modal systems in fashion. GAP CLIP is therefore positioned not as a model that merely retrieves better, but as one that structures semantic attributes more effectively.
|
| 50 |
+
|
| 51 |
+
\section{Related Work}
|
| 52 |
+
|
| 53 |
+
\subsection{Vision–Language Pre-training}
|
| 54 |
+
Contrastive vision–language frameworks such as CLIP~\cite{clip} and ALIGN~\cite{jia2021scaling} have achieved remarkable success in aligning textual and visual representations. These models leverage large scale weakly paired image–text data to learn embeddings applicable to a wide range of downstream tasks~\cite{phang2022multimodal}. However, they are designed to be domain agnostic and lack mechanisms for modeling specific attributes such as color or category.
|
| 55 |
+
|
| 56 |
+
\subsection{Fashion Understanding}
|
| 57 |
+
Early works in fashion focused on attribute prediction and category classification. The DeepFashion dataset~\cite{liu2016deepfashion} introduced benchmarks for clothing category and attribute recognition, fueling research on convolutional architectures for fine grained analysis~\cite{ak2022attribute}. More recent works explore multi task learning for predicting attributes such as category, texture, and style~\cite{chen2020fashion, li2020learning}. Despite their effectiveness, these models generally rely on monolithic representations, limiting interpretability and modularity.
|
| 58 |
+
|
| 59 |
+
\subsection{Modular Architectures}
|
| 60 |
+
The concept of modular specialization has been explored in other domains. Li et al.~\cite{li2022modular} proposed modular encoders tailored to anatomy and pathology in medical imaging, improving interpretability. Similarly, Zhou et al.~\cite{zhou2023geospatial} applied modular vision–language alignment to geospatial applications. To the best of our knowledge, such modular extensions have not been systematically applied in fashion. Our work addresses this gap by designing a hybrid modular CLIP architecture that combines domain specific embeddings with general purpose representations.
|
| 61 |
+
|
| 62 |
+
\section{Methodology}
|
| 63 |
+
|
| 64 |
+
\begin{figure}[h!]
|
| 65 |
+
\centering
|
| 66 |
+
\includegraphics[width=\textwidth]{scheme.png}
|
| 67 |
+
\caption{Main methodology}
|
| 68 |
+
\label{schema}
|
| 69 |
+
\end{figure}
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
\subsection{Overall Architecture}
|
| 73 |
+
Our architecture enhances the CLIP framework by incorporating two specialized attribute modules: color and category. These modules are integrated into a unified multimodal representation space. The final 512 dimensional embedding comprises 16 dimensions for color, 64 for category, and 432 from the original CLIP backbone. This design strikes a balance between compact attribute encoding and general purpose semantic features, offering both interpretability and strong performance (Figure~\ref{schema}).
|
| 74 |
+
|
| 75 |
+
This modular approach involves independently pre-training specialized feature models before concatenating them into the main CLIP model. This allows for efficient training and enables the model to utilize domain specific knowledge while preserving the generalizability of the CLIP backbone. It also facilitates convergence and reduces overfitting.
|
| 76 |
+
|
| 77 |
+
\subsection{Color Model}
|
| 78 |
+
The color model introduces a specialized multimodal architecture tailored for fine grained color recognition in fashion imagery, extending the CLIP framework with domain specific constraints and optimizations. It employs a dual encoder design—one for images and one for text—projecting both modalities into a compact 16 dimensional attribute specific embedding space.
|
| 79 |
+
|
| 80 |
+
Architecture Details:
|
| 81 |
+
\begin{itemize}
|
| 82 |
+
\item Image Encoder: ResNet-18 (pretrained) with dropout (0.1) and projection head $512 \rightarrow 16$ + L2 normalization
|
| 83 |
+
\item Text Encoder: Custom embedding layer (vocab size = 38), dropout (0.1), length weighted pooling, projection $32 \rightarrow 16$ + L2 normalization
|
| 84 |
+
\item Tokenization: Custom color aware tokenizer extracting only color relevant keywords
|
| 85 |
+
\item Total Parameters: $\sim$45M
|
| 86 |
+
\item Embedding Dimension: 16
|
| 87 |
+
\end{itemize}
|
| 88 |
+
|
| 89 |
+
Unlike traditional CLIP implementations relying on BERT style tokenization, the color model uses a compact, domain specific vocabulary of 38 tokens focused exclusively on color semantics. This reduces linguistic noise and improves alignment between visual and textual representations for fashion attributes.
|
| 90 |
+
|
| 91 |
+
The model is trained using a symmetric contrastive objective:
|
| 92 |
+
|
| 93 |
+
\[
|
| 94 |
+
L = (L_{i2t} + L_{t2i})/2
|
| 95 |
+
\]
|
| 96 |
+
|
| 97 |
+
where $L_{i2t}$ and $L_{t2i}$ denote image-to-text and text-to-image contrastive cross entropy losses respectively. A temperature parameter $\tau = 0.07$ controls similarity scaling.
|
| 98 |
+
|
| 99 |
+
Training is performed over 50 epochs using Adam with a learning rate of $1\mathrm{e}{-4}$, weight decay $1\mathrm{e}{-5}$, and a batch size of 16. The dataset consists of 11,000 curated fashion images paired with text descriptions and color labels across 11 categories (beige, black, blue, brown, green, orange, pink, purple, red, white, yellow), using a 90/10 train test split.
|
| 100 |
+
|
| 101 |
+
Regularization is ensured through encoder dropout (0.1) and optimizer weight decay, preventing overfitting and reinforcing generalization. The resulting 16 dimensional embedding space enables highly efficient similarity computation and real time inference while retaining strong discriminative power for color classification tasks.
|
| 102 |
+
|
| 103 |
+
\subsection{Category Model}
|
| 104 |
+
The category model employs a hierarchical classification approach, leveraging a ResNet-18 for image encoding and a lightweight text encoder. This allows for robust category identification from natural language descriptions, achieved through rule based regular expression mappings.
|
| 105 |
+
|
| 106 |
+
\noindent\textbf{Architecture Details:}
|
| 107 |
+
\begin{itemize}
|
| 108 |
+
\item Image Encoder: ResNet-18 with custom projection head $512 \rightarrow 128 \rightarrow 64$
|
| 109 |
+
\item Text Encoder: Embedding layer followed by projection (vocab\_size $\rightarrow$ 64)
|
| 110 |
+
\item Total Parameters: $\sim$45M
|
| 111 |
+
\item Embedding Dimension: 64
|
| 112 |
+
\end{itemize}
|
| 113 |
+
|
| 114 |
+
The category model is trained using a multi objective loss function, which combines classification, consistency, and contrastive objectives:
|
| 115 |
+
\[
|
| 116 |
+
L_\text{category} = 1.0 \, L_\text{classification} + 0.3 \, L_\text{consistency} + 0.2 \, L_\text{contrastive}
|
| 117 |
+
\]
|
| 118 |
+
|
| 119 |
+
This formulation ensures accurate category classification (given primary importance with a weight of 1.0), consistency between image and text representations (weighted at 0.3), and contrastive alignment for enhanced embedding quality (weighted at 0.2).
|
| 120 |
+
|
| 121 |
+
\subsection{Main CLIP Integration}
|
| 122 |
+
|
| 123 |
+
Conventional multimodal models frequently yield black box embeddings that lack interpretability. To address this limitation, we introduce an architecture that explicitly allocates dimensions to semantic attributes, thus enabling both high performance and interpretability.
|
| 124 |
+
The proposed model builds on the CLIP framework~\cite{clip} and incorporates pretrained modules for color and category attributes. The base architecture is the open-source LAION CLIP ViT-B/32~\cite{laion}, producing 512-dimensional embeddings. The pretrained attributes models for color and category are concatenated with the CLIP features to yield the final 512 dimensional representation.
|
| 125 |
+
|
| 126 |
+
The training objective combines two complementary components. The first is a triple contrastive loss aligning text, image, and attribute representations:
|
| 127 |
+
|
| 128 |
+
\[
|
| 129 |
+
L_\text{contrastive} = 0.7 \, L_\text{text-image} + 0.15 \, L_\text{text-attr} + 0.15 \, L_\text{image-attr}
|
| 130 |
+
\]
|
| 131 |
+
|
| 132 |
+
The second is a direct attribute alignment loss that enforces the first 80 dimensions of the main model to match the outputs of the pretrained specialized modules. Concretely, for both text and image modalities, we compute MSE and cosine similarity losses between the color subspace (dims 0--15) and the color model embeddings, and between the category subspace (dims 16--79) and the category model embeddings:
|
| 133 |
+
|
| 134 |
+
\[
|
| 135 |
+
L_\text{align} = \frac{1}{2}\bigl(L_\text{color-align} + L_\text{category-align}\bigr)
|
| 136 |
+
\]
|
| 137 |
+
|
| 138 |
+
where each alignment term combines an MSE loss and a cosine dissimilarity. To prevent catastrophic forgetting, we additionally include a reference loss $L_\text{ref}$ that penalizes deviation from the original pretrained CLIP text embeddings (MSE between the fine-tuned and frozen reference text features). The final loss is:
|
| 139 |
+
|
| 140 |
+
\[
|
| 141 |
+
L_\text{total} = (1 - \alpha) \, L_\text{contrastive} + \alpha \, L_\text{align} + \beta \, L_\text{ref}
|
| 142 |
+
\]
|
| 143 |
+
|
| 144 |
+
with alignment weight $\alpha$ and reference weight $\beta$ tuned via hyperparameter search (we use $\beta = 0.1$). This design is the key mechanism behind Guaranteed Attribute Positioning (GAP): it directly supervises specific dimensions using expert sub-models rather than relying solely on contrastive signals.
|
| 145 |
+
|
| 146 |
+
We automated hyperparameter search for the main CLIP model using Optuna~\cite{optuna}. Each trial sampled learning rate, temperature, alignment weight, and weight decay, trained a fresh CLIP model for 5 epochs on a 5,000-sample subset, and evaluated the validation loss. Optuna pruned weak trials early and selected the best trial in terms of validation loss, with learning rate $1.42 \times 10^{-5}$, temperature $0.0503$, alignment weight $0.5639$, and weight decay $2.76 \times 10^{-5}$. We then retrained the model end-to-end with these best hyperparameters on a 20,000-sample subset, saving the resulting checkpoint and training curves for downstream evaluation. The hyperparameter importances are shown in Figure~\ref{optuna}. The learning curves are in Figure~\ref{training_curves}.
|
| 147 |
+
|
| 148 |
+
|
| 149 |
+
\section{Datasets and Experimental Setup}
|
| 150 |
+
\begin{itemize}
|
| 151 |
+
\item \textbf{Internal dataset}: 436,985 fashion items (10,000 used for evaluation, sampled via URL-based image retrieval) with 35 colors, 20+ categories, 80/20 train/validation split; in-domain evaluation on the same distribution as training.
|
| 152 |
+
\item \textbf{KAGL Marqo}~\cite{marqo}: 44,434 items, 46 colors, 44 categories; external test only, real-world fashion e-commerce data with diverse categories.
|
| 153 |
+
\item \textbf{Fashion MNIST}~\cite{mnist}: 10,000 grayscale test images, 10 categories; external test only, standard benchmark with clear category structure.
|
| 154 |
+
\end{itemize}
|
| 155 |
+
|
| 156 |
+
Our internal fashion dataset comprises 436,985 items, each with an image, textual description, color annotation, and category label. For the main GAP-CLIP model we trained on a 20,000-sample subset (80/20 train/validation split, stratified sampling) drawn from this pool; the standalone color model was trained on 11,000 curated images. Each sample includes: high-resolution product images (224$\times$224 pixels after preprocessing), rich textual descriptions containing product details, materials, and attributes, color labels covering 11 distinct color categories, and category labels spanning 20+ fashion categories (accessories, bag, dress, shoes, top, etc.).
|
| 157 |
+
Images underwent standard augmentation during training including random horizontal flips (50\% probability), rotation ($\pm$15\textdegree{}), color jittering (brightness, contrast, saturation, hue variations), Gaussian blur, and random affine transformations. Validation and test images used only resizing and normalization.
|
| 158 |
+
We compared our model against the Fashion CLIP model~\cite{baseline}, which was trained on fashion-specific data. While the exact training dataset size for Fashion CLIP is not publicly disclosed, it represents a strong baseline in the fashion domain.
|
| 159 |
+
|
| 160 |
+
\section{Results}
|
| 161 |
+
|
| 162 |
+
The metrics used are: (1) the nearest-neighbor classification accuracy in embedding space, which assigns each sample the label of its most similar neighbor by cosine similarity; and (2) the separation score, defined as the difference between the mean intra-class cosine similarity and the mean inter-class cosine similarity (higher values indicate better class separation, meaning items of the same class cluster more tightly than items of different classes).
|
| 163 |
+
|
| 164 |
+
\subsection{Color Model}
|
| 165 |
+
|
| 166 |
+
|
| 167 |
+
\begin{table}[H]
|
| 168 |
+
\centering
|
| 169 |
+
\caption{Performance comparison between CLIP baseline and our 16-d color model. The internal dataset uses 10{,}000 items (11 color classes). Gain is the relative improvement $(\text{GAP-CLIP} - \text{Baseline})/|\text{Baseline}|$.}
|
| 170 |
+
\vspace{0.5em}
|
| 171 |
+
\begin{tabular}{@{}lccc@{}}
|
| 172 |
+
\toprule
|
| 173 |
+
\multicolumn{4}{c}{\textbf{Internal Dataset}} \\
|
| 174 |
+
\midrule
|
| 175 |
+
\textbf{Metric} & \textbf{Baseline} & \textbf{GAP-CLIP} & \textbf{Gain (\%)} \\
|
| 176 |
+
\midrule
|
| 177 |
+
Text embeddings accuracy & 97.0\% & 85.6\% & $-$11.75\% \\
|
| 178 |
+
Image embeddings accuracy & 64.5\% & 70.3\% & +8.99\% \\
|
| 179 |
+
Separation score text embeddings & 0.1562 & 0.5136 & +228.81\% \\
|
| 180 |
+
Separation score image embeddings & 0.0356 & 0.2994 & +741.01\% \\
|
| 181 |
+
\midrule
|
| 182 |
+
\multicolumn{4}{c}{\textbf{KAGL Marqo Dataset}} \\
|
| 183 |
+
\midrule
|
| 184 |
+
Text embeddings accuracy & 92.4\% & 87.5\% & -5.30\% \\
|
| 185 |
+
Image embeddings accuracy & 57.1\% & 64.5\% & +13.00\% \\
|
| 186 |
+
Separation score text embeddings & 0.1500 & 0.5895 & +293.00\% \\
|
| 187 |
+
Separation score image embeddings & 0.0395 & 0.2743 & +594.43\% \\
|
| 188 |
+
\bottomrule
|
| 189 |
+
\end{tabular}
|
| 190 |
+
\end{table}
|
| 191 |
+
|
| 192 |
+
The comparative evaluation between the CLIP baseline and our color model on the internal dataset (10{,}000 items, 11 color classes) reveals an important asymmetry. The baseline achieves higher text accuracy (97.0\% vs.\ 85.6\%), but this comparison is inherently unequal: the baseline encodes text with a full CLIP text encoder (77M parameters, 512 dimensions), for which recognizing a color is essentially a reading-comprehension task—the color name appears literally in the product description. Our color model, by contrast, uses a minimal text encoder (38-token vocabulary, 32-d embedding projected to 16-d, roughly 2k parameters) that extracts only color-relevant keywords. Given this 4-orders-of-magnitude difference in model capacity, 85.6\% text accuracy is a strong result for the specialized encoder.
|
| 193 |
+
|
| 194 |
+
Crucially, the metrics that matter most for structured retrieval tell a different story. On \textbf{image accuracy}—where the model must actually perceive color from pixels—our model improves from 64.5\% to 70.3\% (+8.99\%). The separation scores show the decisive advantage: text separation increases from 0.1562 to 0.5136 (+228.81\%) and image separation from 0.0356 to 0.2994 (+741.01\%), demonstrating far superior attribute disentanglement in a space that is 32$\times$ more compact. For a fashion search engine, high separation means that queries like ``find me this item in blue'' produce tightly clustered, relevant results—a property that raw nearest-neighbor accuracy does not capture.
|
| 195 |
+
|
| 196 |
+
On the KAGL Marqo dataset (7{,}643 items after color filtering), the picture is consistent: image accuracy improves from 57.1\% to 64.5\% (+13.00\%), and both separation scores increase substantially—text separation from 0.1500 to 0.5895 (+293.00\%) and image separation from 0.0395 to 0.2743 (+594.43\%). Text classification accuracy decreases from 92.4\% to 87.5\% ($-$5.30\%), again reflecting the capacity asymmetry rather than a modeling weakness.
|
| 197 |
+
|
| 198 |
+
Overall, these results highlight that our color model produces highly structured and separable color embeddings while improving image accuracy over the full-dimensional baseline. The text accuracy gap is an expected consequence of the deliberate architectural choice to use a minimal, interpretable text encoder; it does not diminish the model's practical value for color-aware retrieval. Note that Fashion-MNIST is excluded from the color evaluation as it contains only grayscale images without color annotations. The confusion matrices in Figure~\ref{fig:color_cm_local} provide per-class classification breakdowns for the color model on the internal test dataset.
|
| 199 |
+
|
| 200 |
+
|
| 201 |
+
\subsection{Category Model}
|
| 202 |
+
|
| 203 |
+
\begin{table}[H]
|
| 204 |
+
\centering
|
| 205 |
+
\caption{Comprehensive performance comparison between CLIP baseline and our category model, including percentage gains recalculated using relative improvement. Separation scores and nearest neighbor accuracy are reported for test, Fashion MNIST, and KAGL Marqo datasets.}
|
| 206 |
+
\label{tab:model_comparison}
|
| 207 |
+
\vspace{0.5em}
|
| 208 |
+
\begin{tabular}{@{}lccc@{}}
|
| 209 |
+
\toprule
|
| 210 |
+
\multicolumn{4}{c}{\textbf{Test Dataset}} \\
|
| 211 |
+
\midrule
|
| 212 |
+
\textbf{Metric} & \textbf{Baseline} & \textbf{GAP-CLIP} & \textbf{Gain (\%)} \\
|
| 213 |
+
\midrule
|
| 214 |
+
Text embeddings accuracy & 74.8\% & 100.0\% & +33.69\% \\
|
| 215 |
+
Image embeddings accuracy & 65.6\% & 77.2\% & +17.68\% \\
|
| 216 |
+
Separation score text embeddings & 0.0834 & 0.9103 & +991.37\% \\
|
| 217 |
+
Separation score image embeddings & 0.0582 & 0.6496 & +1016.15\% \\
|
| 218 |
+
\midrule
|
| 219 |
+
\multicolumn{4}{c}{\textbf{KAGL Marqo Dataset}} \\
|
| 220 |
+
\midrule
|
| 221 |
+
Text embeddings accuracy & 95.9\% & 98.8\% & +2.98\% \\
|
| 222 |
+
Image embeddings accuracy & 95.1\% & 92.8\% & -2.30\% \\
|
| 223 |
+
Separation score text embeddings & 0.1551 & 0.7667 & +394.33\% \\
|
| 224 |
+
Separation score image embeddings & 0.1318 & 0.5233 & +297.04\% \\
|
| 225 |
+
\midrule
|
| 226 |
+
\multicolumn{4}{c}{\textbf{Fashion MNIST Dataset}} \\
|
| 227 |
+
\midrule
|
| 228 |
+
Text embeddings accuracy & 100\% & 100\% & 0.00\% \\
|
| 229 |
+
Image embeddings accuracy & 90.2\% & 85.7\% & -4.52\% \\
|
| 230 |
+
Separation score text embeddings & 0.0826 & 0.9531 & +1053.87\% \\
|
| 231 |
+
Separation score image embeddings & 0.0572 & 0.1965 & +243.53\% \\
|
| 232 |
+
\bottomrule
|
| 233 |
+
\end{tabular}
|
| 234 |
+
\vspace{0.5em}
|
| 235 |
+
\end{table}
|
| 236 |
+
|
| 237 |
+
|
| 238 |
+
The extended evaluation across three datasets shows that our category model delivers consistent and substantial gains in embedding separability, with relative separation improvements ranging from +243.53\% to +1{,}053.87\% depending on modality and dataset. On the test dataset, the model achieves perfect text classification (100.0\% vs.\ 74.8\%, +33.69\%) and higher image accuracy (77.2\% vs.\ 65.6\%, +17.68\%), while separation scores increase sharply for both text (+991.37\%) and images (+1{,}016.15\%).
|
| 239 |
+
|
| 240 |
+
On the KAGL Marqo dataset, text and image separation also improve strongly (+394.33\% and +297.04\%, respectively), indicating that the structured embedding space generalizes to a real-world ecommerce benchmark. In this setting, text accuracy improves from 95.9\% to 98.8\% (+2.98\%), while image accuracy decreases from 95.1\% to 92.8\% (-2.30\%).
|
| 241 |
+
|
| 242 |
+
On Fashion-MNIST, text accuracy remains saturated at 100.0\% for both models, image accuracy decreases from 90.2\% to 85.7\% (-4.52\%), and separation still improves markedly for text (+1{,}053.87\%) and images (+243.53\%).
|
| 243 |
+
|
| 244 |
+
Overall, these results indicate that the proposed architecture consistently produces a more structured, attribute-aware category embedding space than the CLIP baseline, while maintaining competitive accuracy across datasets.
|
| 245 |
+
|
| 246 |
+
The confusion matrices in Figures~\ref{fig:cat_cm_local},~\ref{fig:cat_cm_kaggle}, and~\ref{fig:cat_cm_fashion} provide per-class classification breakdowns for the category model on the internal, KAGL Marqo, and Fashion-MNIST datasets, comparing GAP-CLIP against the baseline.
|
| 247 |
+
|
| 248 |
+
\subsection{Main CLIP Model}
|
| 249 |
+
|
| 250 |
+
\subsubsection{Evaluation}
|
| 251 |
+
|
| 252 |
+
We conducted several evaluation tests. The first is the classification accuracy, the second the separation score, then the heatmaps to compare the similarity between the embedding parts (Figure~\ref{heatmap}), the t-SNE~\cite{tsne} approach (Figure~\ref{tsne}), the simulation of a search engine on our database to check that the embeddings were meaningful (Figure~\ref{search_engine}), and finally the semantic evaluation.
|
| 253 |
+
|
| 254 |
+
These contributions were validated through a rigorous multi-dataset evaluation on Fashion-MNIST, the Kaggle Fashion dataset, and real-world data, demonstrating the robustness, interpretability, and transferability of the proposed approach.
|
| 255 |
+
|
| 256 |
+
The results reported in Table~\ref{tab:results} thus provide a unified view of how GAP CLIP performs across tasks, datasets, and embedding granularity.
|
| 257 |
+
|
| 258 |
+
\subsubsection{Results}
|
| 259 |
+
|
| 260 |
+
\subsubsection{Classification accuracy}
|
| 261 |
+
|
| 262 |
+
To assess the quality of the learned embedding space, we evaluate classification performance using a nearest-neighbor accuracy metric, which measures the ability of embeddings to cluster samples from the same class. For each sample, we compute cosine similarities to all other embeddings, exclude self-similarity, and assign the label of the most similar neighbor. The final accuracy corresponds to the proportion of samples whose nearest neighbor shares the same ground-truth class. This metric provides a model-free evaluation of the embedding geometry: high accuracy indicates that samples of the same class form compact, well-separated clusters, while lower accuracy reveals overlap or insufficient disentanglement between classes. Because it relies solely on distances in the embedding space, this approach offers an unsupervised yet sensitive probe of local structure, without requiring a trained classifier. However, it can be affected by outliers or class imbalance, which may distort nearest-neighbor relationships. Overall, nearest-neighbor accuracy provides an interpretable and robust measure of how effectively the embedding space captures semantic similarity. \\
|
| 263 |
+
|
| 264 |
+
To resolve the inherent tension between using specialized embeddings (interpretable but potentially less performant) and full embeddings (high-performing but opaque), we propose a hybrid ensemble system that strategically combines specialized and full embeddings. For external datasets (KAGL Marqo), we use 40\% specialized embeddings with 60\% full embeddings; for the internal test set and Fashion MNIST, we rely on the specialized subspace directly. This mixture preserves the interpretability afforded by the semantic subspaces while retaining the strong predictive performance of the full embedding representation. In our evaluations, this ensemble strategy proved particularly effective, maintaining competitive accuracy while enabling meaningful dimensional inspection.
|
| 265 |
+
|
| 266 |
+
\begin{table}[H]
|
| 267 |
+
\centering
|
| 268 |
+
\small
|
| 269 |
+
\caption{Comparison of the accuracies of the baseline embeddings and GAP-CLIP model embeddings, including relative gains in percentage.}
|
| 270 |
+
\vspace{0.5em}
|
| 271 |
+
\begin{tabular}{@{}lccc@{}}
|
| 272 |
+
\toprule
|
| 273 |
+
\textbf{Test Dataset} \\
|
| 274 |
+
\midrule
|
| 275 |
+
\textbf{Metric} & \textbf{Baseline} & \textbf{GAP-CLIP} & \textbf{Gain (\%)} \\
|
| 276 |
+
\midrule
|
| 277 |
+
Color acc (text) & 83.4\% & 97.3\% & +16.67\% \\
|
| 278 |
+
Color acc (image) & 42.3\% & 64.7\% & +52.96\% \\
|
| 279 |
+
Cat acc (text) & 68.1\% & 92.7\% & +36.12\% \\
|
| 280 |
+
Cat acc (image) & 68\% & 76.5\% & +12.50\% \\
|
| 281 |
+
\midrule
|
| 282 |
+
\textbf{KAGL Marqo Dataset} \\
|
| 283 |
+
\midrule
|
| 284 |
+
Color acc (text) & 83.6\% & 84\% & +0.48\% \\
|
| 285 |
+
Color acc (image) & 26\% & 43\% & +65.38\% \\
|
| 286 |
+
Cat acc (text) & 97.4\% & 98.4\% & +1.03\% \\
|
| 287 |
+
Cat acc (image) & 89.2\% & 90\% & +0.90\% \\
|
| 288 |
+
\midrule
|
| 289 |
+
\textbf{Fashion MNIST Dataset} \\
|
| 290 |
+
\midrule
|
| 291 |
+
Cat acc (text) & 100\% & 100\% & 0.00\% \\
|
| 292 |
+
Cat acc (image) & 85\% & 82\% & -3.53\% \\
|
| 293 |
+
\bottomrule
|
| 294 |
+
\end{tabular}
|
| 295 |
+
\label{tab:results}
|
| 296 |
+
\end{table}
|
| 297 |
+
|
| 298 |
+
|
| 299 |
+
Across all evaluated datasets, our subspace-based model consistently outperforms the baseline in classification accuracy for most settings, particularly where fine-grained semantic disentanglement is crucial. On the primary test dataset, the proposed model achieves notable gains in both color and category prediction, with relative improvements of +16.67\% in text-based color classification, +52.96\% in image-based color prediction, +36.12\% in text-based category prediction, and +12.50\% in image-based category prediction. These systematic increases demonstrate that structuring the embedding space into semantic subspaces enhances both vision and language alignment.
|
| 300 |
+
|
| 301 |
+
The benefits are also evident on the KAGL Marqo dataset, which introduces greater visual variability. Here, our model yields a substantial relative improvement of +65.38\% in image-based color classification and smaller yet positive gains in category accuracy (+1.03\% for text and +0.90\% for image), while text-based color accuracy remains essentially saturated. This confirms the robustness of the approach under realistic ecommerce conditions.
|
| 302 |
+
|
| 303 |
+
On Fashion MNIST, where text-based category accuracy is already saturated at 100\%, our method maintains equivalent performance. Image-based accuracy decreases moderately from 85\% to 82\% (–3.53\% relative change), an effect that appears isolated to this highly stylized grayscale dataset and does not affect performance on more complex real-world distributions. \\
|
| 304 |
+
|
| 305 |
+
While the baseline provides strong baselines for fashion category recognition by leveraging shape-driven and semantically aligned representations, it does not explicitly model color as a continuous and metric attribute. Our model addresses this limitation by introducing a dedicated color embedding space jointly learned from image and text modalities, optimized with a color-aware loss that enforces perceptual consistency in RGB/Lab space. As a result, the proposed approach preserves the baseline robustness to category-level visual cues while enabling fine-grained and metrically meaningful color representation, leading to improved performance on color-sensitive tasks where standard CLIP-based baselines fail to capture perceptual color distances. \\
|
| 306 |
+
|
| 307 |
+
Although the training data originate from the same sub-models, the main model benefits from a broader diversity of negative samples arising from the combination of color, hierarchy, and category axes. This variety enriches the structure of the text embedding space and promotes stronger class separation, which can account for its superior performance on general tasks. In contrast, the sub-models are optimized for narrowly targeted objectives and therefore receive a limited training signal tied to a single axis; when evaluated on a more general textual accuracy task involving more classes or varied formulations, this restricted supervision hinders their ability to generalize. Thus, despite relying on identical data, narrow supervision leads sub-models to develop a specialized representation space, whereas the multi-axis supervision of the main model yields a more generalizable text space, better suited for overall accuracy. \\
|
| 308 |
+
|
| 309 |
+
Overall, these results demonstrate that our subspace-guided representation framework improves interpretability while delivering competitive—and often substantially superior—classification accuracy compared to the baseline, particularly in scenarios requiring fine-grained attribute discrimination. Note that the baseline was trained on billions of images, making it more robust.
|
| 310 |
+
|
| 311 |
+
|
| 312 |
+
\subsubsection{Separation score}
|
| 313 |
+
|
| 314 |
+
Across all evaluations, we measure how well different embedding configurations disentangle color and category attributes in both text and image modalities.
|
| 315 |
+
|
| 316 |
+
The separation score measures how well an embedding isolates an attribute by comparing the mean intra-class cosine similarity (how tightly same-class items cluster) with the mean inter-class cosine similarity (how well different classes are distinguished). A higher score indicates stronger attribute disentanglement.
|
| 317 |
+
|
| 318 |
+
In the Fashion-MNIST dataset, in the original 512-dimensional space, we observe near-zero separation for color but moderate separation for category (0.4109 text; 0.1974 image). Crucially, low-dimensional subspaces (16--64 dimensions) reproduce the full-space behavior almost exactly, indicating that the relevant factors of variation are already linearly accessible in compact subspaces and that dimensionality is not a limiting factor for these attributes.
|
| 319 |
+
|
| 320 |
+
The Kaggle KAGL dataset exhibits substantially improved disentanglement:
|
| 321 |
+
|
| 322 |
+
\begin{itemize}
|
| 323 |
+
\item Color: The specialized model achieves very high separation (0.8352 text; 0.3923 image), far outperforming both the baseline 512D model (0.1708; 0.0406) and our own full-dimensional model (0.3407; 0.1290).
|
| 324 |
+
\item Category: The subspace model provides the strongest image-level separation (0.5613), and its text separation (0.3068) also exceeds both baseline and full-model results ($\sim$0.12--0.18).
|
| 325 |
+
\end{itemize}
|
| 326 |
+
|
| 327 |
+
Overall, imposing structured subspaces leads to consistently stronger attribute disentanglement, especially for color. The local validation set confirms these trends: the color model achieves separation scores of 0.5136 (text) and 0.2994 (image), vastly outperforming the baseline (0.1562 and 0.0356, respectively). Regarding category, the GAP-CLIP hierarchy subspace achieves 0.9103 (text) and 0.6496 (image), compared to the baseline's 0.0834 and 0.0582—representing roughly tenfold improvements in class disentanglement.
|
| 328 |
+
|
| 329 |
+
Structured subspaces reliably improve attribute disentanglement, particularly on the more varied Kaggle dataset, where gains over both baseline and full-dimensional models are substantial. Low-dimensional subspaces preserve the disentanglement capacity of the original embedding, suggesting that the relevant semantics are localized and can be isolated during training. Color separation benefits the most from subspace training, while category separation improves primarily on the image side but also shows moderate text-level gains.
|
| 330 |
+
|
| 331 |
+
\subsubsection{Semantic evaluation}
|
| 332 |
+
|
| 333 |
+
We defined another test to evaluate the robustness of the GAP-CLIP model against varying text complexity. We conducted zero-shot classification experiments comparing our approach with the baseline. We designed two experimental conditions: (1) simple queries consisting of basic color–object pairs (e.g., "red dress", "blue jeans"), and (2) extended descriptions (see Annex~\ref{long_desc}) containing detailed product attributes including fabric composition, style elements, fit characteristics, and structural details (e.g., "a woman wearing a red dress with a v neckline, made of silk chiffon fabric with a flowing drape, featuring a midi length A-line silhouette, three-quarter sleeves, and delicate lace trim details along the hem"). In addition to garment classification, we also explicitly tested color prediction accuracy under both conditions to assess the sensitivity of each model to color cues in the text. \\
|
| 334 |
+
|
| 335 |
+
For simple descriptions, both models achieved comparable performance in classifying garment types and colors with near-perfect accuracy. However, when presented with extended descriptions typical of ecommerce product listings, a significant performance gap emerged. The baseline model exhibited substantial degradation in classification accuracy, frequently misclassifying garment categories while maintaining only partial success in color identification despite color information being clearly stated. In contrast, our GAP-CLIP model maintained consistent high accuracy across both simple and complex descriptions, correctly identifying both color and garment type attributes. This robustness to description complexity can be attributed to our model���s specialized embedding structure, which explicitly encodes color (16 dimensions) and hierarchy information (64 dimensions) alongside standard CLIP embeddings (512 dimensions), enabling more stable feature extraction when confronted with verbose, multi-attribute text inputs. To quantify these effects, we found a performance gap of 40\% in favor of GAP-CLIP. These results demonstrate that GAP-CLIP is better suited for real-world fashion search applications where product descriptions are typically detailed and contain multiple overlapping semantic attributes.
|
| 336 |
+
|
| 337 |
+
|
| 338 |
+
\subsubsection{Embedding structure evaluation}
|
| 339 |
+
|
| 340 |
+
|
| 341 |
+
We conducted four tests, A, B, C, and D to evaluate complementary aspects of the embedding structure and zero-shot behavior of GAP-CLIP, with a specific focus on showing that compact subspaces are not only sufficient but better targeted than the full embedding for attribute-specific comparisons.
|
| 342 |
+
|
| 343 |
+
In \textbf{Test A} (different colors, same category), each pair must satisfy two conditions: (1)~the 64-d hierarchy cosine similarity must exceed the full 512-d cosine similarity ($\mathrm{sim}_\mathrm{hier} > \mathrm{sim}_\mathrm{full512}$), and (2)~the hierarchy similarity must exceed the color similarity ($\mathrm{sim}_\mathrm{hier} > \mathrm{sim}_\mathrm{color}$). GAP-CLIP passed perfectly on both sub-conditions (1000/1000 each), while the Fashion-CLIP baseline reached 927/1000 overall (92.70\%), with 998/1000 for $\mathrm{sim}_\mathrm{hier} > \mathrm{sim}_\mathrm{full512}$ and 928/1000 for $\mathrm{sim}_\mathrm{hier} > \mathrm{sim}_\mathrm{color}$. GAP-CLIP also showed much stronger relative shifts: $\Delta_\mathrm{hier\,vs\,full}=+111.71\%$ and $\Delta_\mathrm{color\,vs\,full}=-114.67\%$, compared with baseline values of $+22.44\%$ and $-31.17\%$, respectively. Full-embedding pair discrimination remained high for both models (99.80\% GAP-CLIP vs.\ 97.10\% baseline).
|
| 344 |
+
|
| 345 |
+
In \textbf{Test B} (same color, different categories), each pair must satisfy the inverse conditions: (1)~the 16-d color cosine similarity must exceed the full 512-d similarity ($\mathrm{sim}_\mathrm{color} > \mathrm{sim}_\mathrm{full512}$), and (2)~the color similarity must exceed the hierarchy similarity ($\mathrm{sim}_\mathrm{color} > \mathrm{sim}_\mathrm{hier}$). GAP-CLIP again passed perfectly (1000/1000 on both sub-conditions), whereas the baseline dropped to 30/1000 overall (3.00\%), with 151/1000 for $\mathrm{sim}_\mathrm{color} > \mathrm{sim}_\mathrm{full512}$ and 30/1000 for $\mathrm{sim}_\mathrm{color} > \mathrm{sim}_\mathrm{hier}$. The color subspace shift for GAP-CLIP was +83.39\% vs.\ full embedding (baseline: $-24.09\%$), while the hierarchy shift was $-21.09\%$ for GAP-CLIP (baseline: $+15.88\%$). Full-embedding pair discrimination was similarly high for both models (100.00\% GAP-CLIP vs.\ 99.80\% baseline), showing that the gap comes from attribute localization rather than generic similarity strength.
|
| 346 |
+
|
| 347 |
+
In \textbf{Test C} (subspace decomposition consistency), we evaluate whether the subspaces of a composite embedding align with isolated attribute encodings. For each of 1\,000 examples, we encode a full description (e.g.\ ``red dress in cotton''), the standalone color (``red''), and the standalone category (``dress''). We then compute four cosine similarities: (1)~\emph{color-match}: $\cos(\mathbf{e}_\mathrm{full}[{:}16],\;\mathbf{e}_\mathrm{color}[{:}16])$, (2)~\emph{color-cross}: $\cos(\mathbf{e}_\mathrm{full}[{:}16],\;\mathbf{e}_\mathrm{hier}[{:}16])$, (3)~\emph{hier-match}: $\cos(\mathbf{e}_\mathrm{full}[16{:}80],\;\mathbf{e}_\mathrm{hier}[16{:}80])$, and (4)~\emph{hier-cross}: $\cos(\mathbf{e}_\mathrm{full}[16{:}80],\;\mathbf{e}_\mathrm{color}[16{:}80])$. A sample passes when both $\text{color-match} > \text{color-cross}$ and $\text{hier-match} > \text{hier-cross}$. GAP-CLIP achieved a 96.20\% overall pass rate, with 100\% on the color sub-condition and 96.20\% on the category sub-condition. Mean similarities further illustrate the separation: color-match averaged 0.9863 versus only 0.1410 for color-cross, and hier-match averaged 0.7966 versus 0.4821 for hier-cross. The baseline model reached only 42.30\% overall (59.60\% color, 82.20\% category), with mean color-match and color-cross nearly indistinguishable (0.4429 vs.\ 0.3824) and similarly for category (0.7756 vs.\ 0.7055). These results confirm that GAP-CLIP embeddings are genuinely compositional: the color subspace of a full description faithfully reproduces the standalone color encoding, and the category subspace faithfully reproduces the standalone category encoding---a property entirely absent from the baseline.
|
| 348 |
+
|
| 349 |
+
Although full-embedding discrimination remained very strong for both models (A: 99.80\% vs.\ 97.10\%, B: 100.00\% vs.\ 99.80\%), the subspace checks clearly favor GAP-CLIP. These results directly support the key claim: 16 dimensions are enough and better for color, and 64 dimensions are enough and better for category, than relying on a distributed 512-d representation for these targeted signals. \\
|
| 350 |
+
|
| 351 |
+
In Test D, we assess zero-shot vision-language alignment under two complementary retrieval directions to characterize both discriminative labeling and representative item retrieval. We test the image-to-text classification, which treats each image as a query and ranks all candidate text labels by embedding similarity (cosine in the shared latent space); the predicted class is the top-1 label, and accuracy is computed over all images. This direction measures how well the model maps visual inputs to semantically correct category names without task-specific supervision on the evaluation set. The results are presented in Table~\ref{tab:test_c_c1_results}.
|
| 352 |
+
|
| 353 |
+
|
| 354 |
+
\begin{table}[H]
|
| 355 |
+
\centering
|
| 356 |
+
\small
|
| 357 |
+
\caption{Zero-shot classification (weighted F1) on 10\,k samples. Each model uses its own label vocabulary: the baseline uses dataset-native labels matching the FashionCLIP published protocol (``a photo of a \{label\}'', full 512-d cosine); GAP-CLIP uses its training labels. The baseline FMNIST wF1 of 74.04\% matches the published value of 0.74. Gain is relative to baseline: $(\text{GAP-CLIP} - \text{Baseline})/|\text{Baseline}|$.}
|
| 358 |
+
\vspace{0.5em}
|
| 359 |
+
\begin{tabular}{@{}lcccc@{}}
|
| 360 |
+
\toprule
|
| 361 |
+
\textbf{Dataset} & \textbf{Baseline (wF1)} & \textbf{GAP-CLIP (wF1)} & \textbf{Strategy} & \textbf{Gain} \\
|
| 362 |
+
\midrule
|
| 363 |
+
\multicolumn{5}{@{}l}{\emph{Single prompt (no strategy selection):}} \\
|
| 364 |
+
\midrule
|
| 365 |
+
Fashion-MNIST & 74.04\% & 60.83\% & single\_prompt & $-$17.8\% \\
|
| 366 |
+
KAGL Marqo & 72.78\% & 43.49\% & single\_prompt & $-$40.2\% \\
|
| 367 |
+
Internal dataset & 42.02\% & 44.75\% & single\_prompt & +6.5\% \\
|
| 368 |
+
\midrule
|
| 369 |
+
\multicolumn{5}{@{}l}{\emph{GAP-CLIP best strategy:}} \\
|
| 370 |
+
\midrule
|
| 371 |
+
Fashion-MNIST & 74.04\% & 61.65\% & blend\_hier\_full & $-$16.7\% \\
|
| 372 |
+
KAGL Marqo & 72.78\% & 68.65\% & blend\_hier\_full & $-$5.7\% \\
|
| 373 |
+
Internal dataset & 42.02\% & 79.31\% & hierarchy\_model & +88.7\% \\
|
| 374 |
+
\bottomrule
|
| 375 |
+
\end{tabular}
|
| 376 |
+
\label{tab:test_c_c1_results}
|
| 377 |
+
\end{table}
|
| 378 |
+
|
| 379 |
+
Under the single-prompt protocol, the baseline outperforms GAP-CLIP on the two external benchmarks (Fashion-MNIST and KAGL Marqo), reflecting the expected trade-off: GAP-CLIP's embedding geometry has been restructured to optimize attribute separation rather than raw zero-shot label matching. However, when GAP-CLIP leverages its structured subspaces via its best strategy, the gap narrows dramatically on KAGL Marqo (from $-$40.2\% to just $-$5.7\%) and inverts on the internal dataset, where GAP-CLIP reaches \textbf{79.31\% wF1}---a \textbf{+88.7\%} relative gain over the baseline's 42.02\%. This confirms that the strength of GAP-CLIP lies not in generic single-prompt zero-shot accuracy, but in its structured subspaces (Tests A and B: 100\% pass rate; Test D: 96.20\% decomposition consistency vs.\ 42.30\% baseline) and the dramatically higher separation scores reported above, which translate directly to better attribute-aware retrieval.
|
| 380 |
+
|
| 381 |
+
\section{Discussion}
|
| 382 |
+
|
| 383 |
+
The results presented across multiple datasets demonstrate that structuring the embedding space into semantically meaningful subspaces---color (16 dimensions) and category (64 dimensions)---offers a powerful compromise between interpretability and performance. Whereas standard CLIP models distribute semantic information across the full 512-dimensional space, our GAP-CLIP architecture explicitly isolates key fashion attributes, enabling both stronger disentanglement and refined control over the representation geometry. This is reflected in the substantial improvements in separation scores, which capture the degree to which the embedding space organizes items according to meaningful semantic factors. In particular, the gains observed for image-based separation (approaching +1{,}000\% relative improvement on some category and color predictions) highlight that specialized subspaces allow the model to extract much more discriminative visual cues than generic CLIP embeddings. \\
|
| 384 |
+
|
| 385 |
+
However, this explicit specialization introduces an inherent tension: subspaces dramatically improve interpretability and concept-level isolation, yet the full 512-dimensional embedding remains superior for capturing fine-grained, high-capacity information. This trade-off is visible in the zero-shot evaluation (Table~\ref{tab:test_c_c1_results}): under a single-prompt protocol GAP-CLIP trails the FashionCLIP baseline on Fashion-MNIST ($-$17.8\%) and KAGL Marqo ($-$40.2\%), confirming that restructuring the geometry for attribute separation comes at a cost to generic label matching. Crucially, however, when GAP-CLIP exploits its structured subspaces via the \texttt{blend\_hier\_full} strategy---which blends hierarchy-subspace and full-embedding similarities---the gap narrows to just $-$5.7\% on KAGL Marqo and inverts entirely on the internal dataset, where GAP-CLIP achieves \textbf{79.31\% wF1} (+88.7\% relative gain). These results confirm that specialized subspaces and full embeddings are complementary rather than competitive: the blending strategy recovers much of the generic representational power while retaining the semantic transparency afforded by the subspaces. \\
|
| 386 |
+
|
| 387 |
+
Another insight emerging from our experiments is the phenomenon of over-specialization. By tightly aligning specific dimensions with color and category information, the model may inadvertently discard broader semantic signals normally captured by a distributed representation. Some unused dimensions may in fact contain valuable residual semantics, and their forced deactivation could reduce generalization in domains where attribute boundaries are less clearly defined. Nevertheless, in fashion retrieval---where color and category are dominant attributes---our approach provides a highly interpretable and operationally advantageous embedding structure. \\
|
| 388 |
+
|
| 389 |
+
Our results show that the standalone category model outperforms Fashion-CLIP on Fashion-MNIST, while the full GAP-CLIP model does not, due to fundamental differences in specialization and training objectives. The category model is a narrowly optimized classifier: its ResNet-based architecture and loss functions are designed exclusively to maximize category separability, producing clean, high-margin category embeddings that transfer well even to out-of-domain datasets like Fashion-MNIST. In contrast, GAP-CLIP is a multi-objective vision--language model that must simultaneously preserve CLIP semantics, encode color and category in prescribed subspaces, and generalize across diverse e-commerce tasks. This induces representational trade-offs: the category signal is compressed alongside other factors, and no task-specific head is trained for Fashion-MNIST, making zero-shot classification strictly harder. Combined with the strong domain shift between real RGB product photos and grayscale Fashion-MNIST silhouettes, the baseline Fashion-CLIP---despite weaker category structure---retains an advantage in global visual robustness, explaining the $-$16.7\% gap even under GAP-CLIP's best blending strategy. Notably, however, this gap shrinks substantially on the in-domain KAGL Marqo benchmark ($-$5.7\%) and reverses on the internal dataset (+88.7\%), suggesting that as domain alignment improves, GAP-CLIP's structured subspaces become increasingly beneficial. \\
|
| 390 |
+
|
| 391 |
+
Finally, the semantic robustness experiments demonstrate that GAP-CLIP remains stable even under long, detailed, multi-attribute descriptions, whereas baseline CLIP significantly degrades. This resilience to textual verbosity suggests that explicitly encoded subspaces serve as semantic anchors, guiding the model even when irrelevant linguistic features are present.
|
| 392 |
+
|
| 393 |
+
\newpage
|
| 394 |
+
\section{Conclusion}
|
| 395 |
+
|
| 396 |
+
GAP-CLIP introduces a principled architectural modification to CLIP, enabling fine-grained control over embedding semantics through dedicated subspaces. This design enhances interpretability, boosts disentanglement, and yields several-fold improvements in the separation of key fashion attributes such as color and category across diverse datasets. Zero-shot evaluation on 10\,000 samples confirms an expected trade-off: under a single-prompt protocol, GAP-CLIP trails the FashionCLIP baseline on generic benchmarks (Fashion-MNIST: $-$17.8\%; KAGL Marqo: $-$40.2\%), yet when it leverages its structured subspaces via a blending strategy the gap narrows dramatically (KAGL Marqo: $-$5.7\%) and inverts on the in-domain internal dataset (+88.7\%, reaching 79.31\% wF1). Combined with 100\% subspace-alignment pass rates (Tests A--B), 96.20\% decomposition consistency (Test~D), and strong resilience to textual verbosity, these results demonstrate that GAP-CLIP offers a compelling alternative to standard CLIP for fashion applications requiring semantic clarity, attribute-level control, and robust multi-attribute retrieval.
|
| 397 |
+
|
| 398 |
+
|
| 399 |
+
\section{Limitations}
|
| 400 |
+
|
| 401 |
+
Despite its advantages, the proposed model presents several limitations:
|
| 402 |
+
\begin{itemize}
|
| 403 |
+
\item Dimensional specialization may lead to partial information loss, as unused or constrained dimensions could otherwise store relevant semantic nuances.
|
| 404 |
+
\item The approach requires pretraining specialized models, increasing the computational cost compared to a single end-to-end CLIP model.
|
| 405 |
+
\item Over-specialization may reduce performance in tasks where attributes are not cleanly separable or where broader semantic features are needed.
|
| 406 |
+
\end{itemize}
|
| 407 |
+
|
| 408 |
+
\section{Future Work}
|
| 409 |
+
|
| 410 |
+
Several research directions naturally emerge from this work, such as extending attribute-specific subspaces to other fashion attributes such as style, texture, silhouette, or material, end-to-end joint training of the specialized subspaces and the full embedding model to optimize the trade-off between separation and generalization, adaptive subspace allocation, allowing the model to learn the optimal dimensional budget for each attribute.
|
| 411 |
+
|
| 412 |
+
|
| 413 |
+
\newpage
|
| 414 |
+
\bibliographystyle{plain}
|
| 415 |
+
\begin{thebibliography}{99}
|
| 416 |
+
|
| 417 |
+
\bibitem{marqo} Marqo Team. KAGL Dataset. 2023.
|
| 418 |
+
Link: https://huggingface.co/datasets/Marqo/KAGL
|
| 419 |
+
|
| 420 |
+
\bibitem{mnist} Zalando Research. Fashion-MNIST Dataset. 2017.
|
| 421 |
+
Link : https://www.kaggle.com/datasets/zalando-research/fashionmnist
|
| 422 |
+
|
| 423 |
+
\bibitem{laion} Schuhmann, C., Beaumont, R., Vencu, R., et al.
|
| 424 |
+
LAION-5B: An Open Large-Scale Dataset for Training Next Generation Image-Text Models.
|
| 425 |
+
NeurIPS Datasets and Benchmarks, 2022.
|
| 426 |
+
Link: https://arxiv.org/abs/2210.08402
|
| 427 |
+
\textit{Model:} \texttt{laion/CLIP-ViT-B-32-laion2B-s34B-b79K}, an open-source CLIP ViT-B/32 trained on LAION-2B.
|
| 428 |
+
|
| 429 |
+
\bibitem{clip} Radford, A., Kim, J. W., Hallacy, C., Ramesh, A., Goh, G., Agarwal, S., et al.
|
| 430 |
+
Learning Transferable Visual Models From Natural Language Supervision, 2021.
|
| 431 |
+
Link: https://arxiv.org/abs/2103.00020
|
| 432 |
+
|
| 433 |
+
\bibitem{liu2016deepfashion} Liu, Z., Luo, P., Qiu, S., Wang, X., Tang, X.
|
| 434 |
+
DeepFashion: Powering Robust Clothes Recognition and Retrieval with Rich Annotations.
|
| 435 |
+
CVPR, 2016.
|
| 436 |
+
|
| 437 |
+
\bibitem{hsiao2018learning} Hsiao, E., \& Grauman, K.
|
| 438 |
+
Learning the Latent “Look”: Unsupervised Discovery of a Style-Coherent Embedding from Fashion Images.
|
| 439 |
+
ICCV, 2018.
|
| 440 |
+
|
| 441 |
+
\bibitem{jia2021scaling} Jia, C., Yang, Y., Xia, X., et al.
|
| 442 |
+
Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervision.
|
| 443 |
+
ICML, 2021.
|
| 444 |
+
|
| 445 |
+
\bibitem{phang2022multimodal} Phang, J., Li, Y., Li, T., et al.
|
| 446 |
+
Multimodal Pretraining Beyond Vision and Language.
|
| 447 |
+
NeurIPS, 2022.
|
| 448 |
+
|
| 449 |
+
\bibitem{ak2022attribute} Ak, K., et al.
|
| 450 |
+
Attribute-based Clothing Retrieval: A Survey of Methods and Applications.
|
| 451 |
+
International Journal of Computer Vision (IJCV), 2022.
|
| 452 |
+
|
| 453 |
+
\bibitem{chen2020fashion} Chen, Y., Gu, X., et al.
|
| 454 |
+
Fashion Compatibility Modeling via Contextuality and Compatibility Learning.
|
| 455 |
+
CVPR, 2020.
|
| 456 |
+
|
| 457 |
+
\bibitem{li2020learning} Li, T., Li, J., et al.
|
| 458 |
+
Learning Fine-Grained Attributes in Fashion via Multi-Task Representation Learning.
|
| 459 |
+
ECCV, 2020.
|
| 460 |
+
|
| 461 |
+
\bibitem{li2022modular} Li, X., Chen, C., et al.
|
| 462 |
+
Modular Representation Learning for Interpretable Medical Imaging.
|
| 463 |
+
MICCAI, 2022.
|
| 464 |
+
|
| 465 |
+
\bibitem{zhou2023geospatial} Zhou, Y., Nguyen, A., et al.
|
| 466 |
+
Geospatial Vision–Language Pretraining with Modular Encoders.
|
| 467 |
+
NeurIPS, 2023.
|
| 468 |
+
|
| 469 |
+
\bibitem{baseline} Chia, P. J., et al.
|
| 470 |
+
Contrastive Language and Vision Learning of General Fashion Concepts.
|
| 471 |
+
arXiv, 2023.
|
| 472 |
+
Link : https://arxiv.org/abs/2204.03972
|
| 473 |
+
|
| 474 |
+
\bibitem{optuna} Akiba, T., Sano, S., Yanase, T., Ohta, T., \& Koyama, M.
|
| 475 |
+
Optuna: A Next-generation Hyperparameter Optimization Framework.
|
| 476 |
+
KDD, 2019.
|
| 477 |
+
Link: https://arxiv.org/abs/1907.10902
|
| 478 |
+
|
| 479 |
+
\bibitem{tsne} Van der Maaten, L., \& Hinton, G. (2008). Visualizing data using t-SNE. Journal of Machine Learning Research, 9(Nov)
|
| 480 |
+
\end{thebibliography}
|
| 481 |
+
|
| 482 |
+
\newpage
|
| 483 |
+
\appendix
|
| 484 |
+
\section{Annexes}
|
| 485 |
+
|
| 486 |
+
\subsection{Main model color part heatmap}
|
| 487 |
+
\label{heatmap}
|
| 488 |
+
\begin{figure}[h!]
|
| 489 |
+
\centering
|
| 490 |
+
\begin{subfigure}[b]{0.45\textwidth}
|
| 491 |
+
\centering
|
| 492 |
+
\includegraphics[width=\textwidth]{heatmap_baseline.jpg}
|
| 493 |
+
\caption{Fashion clip baseline}
|
| 494 |
+
\end{subfigure}
|
| 495 |
+
\hfill
|
| 496 |
+
\begin{subfigure}[b]{0.5\textwidth}
|
| 497 |
+
\centering
|
| 498 |
+
\includegraphics[width=\textwidth]{heatmap.png}
|
| 499 |
+
\caption{GAP clip model}
|
| 500 |
+
\end{subfigure}
|
| 501 |
+
\caption{Heatmaps representing the similarity between the colors embeddings, using only the first 16 dimensions of the main model embeddings and the full baseline embeddings}
|
| 502 |
+
\end{figure}
|
| 503 |
+
|
| 504 |
+
\subsection{Main model t-SNE on test dataset}
|
| 505 |
+
\label{tsne}
|
| 506 |
+
\begin{figure}[h!]
|
| 507 |
+
\centering
|
| 508 |
+
|
| 509 |
+
\begin{subfigure}[b]{0.45\textwidth}
|
| 510 |
+
\centering
|
| 511 |
+
\includegraphics[width=\textwidth]{tsne_baseline.png}
|
| 512 |
+
\caption{Fashion clip baseline}
|
| 513 |
+
\end{subfigure}
|
| 514 |
+
\hfill
|
| 515 |
+
\begin{subfigure}[b]{0.45\textwidth}
|
| 516 |
+
\centering
|
| 517 |
+
\includegraphics[width=\textwidth]{tsne_model.png}
|
| 518 |
+
\caption{GAP clip model}
|
| 519 |
+
\end{subfigure}
|
| 520 |
+
|
| 521 |
+
\caption{t-SNE representing the clusters between the color embeddings, using only the first 16 dimensions of the main model embeddings and the full baseline embeddings}
|
| 522 |
+
\end{figure}
|
| 523 |
+
|
| 524 |
+
\begin{figure}[h!]
|
| 525 |
+
\centering
|
| 526 |
+
|
| 527 |
+
\begin{subfigure}[b]{0.45\textwidth}
|
| 528 |
+
\centering
|
| 529 |
+
\includegraphics[width=\textwidth]{tsne_hierarchy_baseline.png}
|
| 530 |
+
\caption{Fashion clip baseline}
|
| 531 |
+
\end{subfigure}
|
| 532 |
+
\hfill
|
| 533 |
+
\begin{subfigure}[b]{0.45\textwidth}
|
| 534 |
+
\centering
|
| 535 |
+
\includegraphics[width=\textwidth]{tsne_hierarchy_our.png}
|
| 536 |
+
\caption{GAP clip model}
|
| 537 |
+
\end{subfigure}
|
| 538 |
+
|
| 539 |
+
\caption{t-SNE representing the clusters between the hierarchy embeddings, using only the 64 dimensions of the main model embeddings and the full baseline embeddings}
|
| 540 |
+
\end{figure}
|
| 541 |
+
|
| 542 |
+
\newpage
|
| 543 |
+
\subsection{Search Engine Examples}
|
| 544 |
+
\label{search_engine}
|
| 545 |
+
\begin{figure}[h!]
|
| 546 |
+
\centering
|
| 547 |
+
\begin{subfigure}[b]{0.8\textwidth}
|
| 548 |
+
\centering
|
| 549 |
+
\includegraphics[width=\textwidth]{gapclip_red_dress.png}
|
| 550 |
+
\caption{GAP-CLIP: ``red dress'' query}
|
| 551 |
+
\end{subfigure}
|
| 552 |
+
|
| 553 |
+
\vspace{0.5em}
|
| 554 |
+
|
| 555 |
+
\begin{subfigure}[b]{0.8\textwidth}
|
| 556 |
+
\centering
|
| 557 |
+
\includegraphics[width=\textwidth]{baseline_red_dress.png}
|
| 558 |
+
\caption{Baseline: ``red dress'' query}
|
| 559 |
+
\end{subfigure}
|
| 560 |
+
|
| 561 |
+
\caption{Search results for ``red dress''. GAP-CLIP (a) returns items that are consistently red dresses, while the baseline (b) shows more variability in both color and category.}
|
| 562 |
+
\end{figure}
|
| 563 |
+
|
| 564 |
+
\begin{figure}[h!]
|
| 565 |
+
\centering
|
| 566 |
+
\begin{subfigure}[b]{0.8\textwidth}
|
| 567 |
+
\centering
|
| 568 |
+
\includegraphics[width=\textwidth]{gapclip_blue_pant.png}
|
| 569 |
+
\caption{GAP-CLIP: ``blue pant'' query}
|
| 570 |
+
\end{subfigure}
|
| 571 |
+
|
| 572 |
+
\vspace{0.5em}
|
| 573 |
+
|
| 574 |
+
\begin{subfigure}[b]{0.8\textwidth}
|
| 575 |
+
\centering
|
| 576 |
+
\includegraphics[width=\textwidth]{baseline_blue_pant.png}
|
| 577 |
+
\caption{Baseline: ``blue pant'' query}
|
| 578 |
+
\end{subfigure}
|
| 579 |
+
|
| 580 |
+
\caption{Search results for ``blue pant''. GAP-CLIP (a) correctly retrieves blue pants, demonstrating strong attribute alignment. The baseline (b) shows less precise color and category matching.}
|
| 581 |
+
\end{figure}
|
| 582 |
+
|
| 583 |
+
\subsection{Hyperparameters importance with optuna}
|
| 584 |
+
\label{optuna}
|
| 585 |
+
\begin{figure}[H]
|
| 586 |
+
\centering
|
| 587 |
+
\includegraphics[width=0.6\textwidth]{optuna_param_importances.png}
|
| 588 |
+
\caption{Hyperparameters importance with optuna}
|
| 589 |
+
\end{figure}
|
| 590 |
+
|
| 591 |
+
|
| 592 |
+
\subsection{Main Model Training Curves}
|
| 593 |
+
\label{training_curves}
|
| 594 |
+
\begin{figure}[H]
|
| 595 |
+
\centering
|
| 596 |
+
\includegraphics[width=0.6\textwidth]{training_curves.png}
|
| 597 |
+
\caption{Main model training curves.}
|
| 598 |
+
\end{figure}
|
| 599 |
+
|
| 600 |
+
\subsection{Long descriptions examples}
|
| 601 |
+
\label{long_desc}
|
| 602 |
+
|
| 603 |
+
\noindent\textbf{description${_1}$:}
|
| 604 |
+
\begin{quote}
|
| 605 |
+
The specified item is a blue suit top made exclusively for Banana Republic Factory. It features a notch lapel, three quarter length sleeves, a two-button closure, four functional exterior pockets, a center back vent, and is fully lined. The style is a suit top, and the color is blue. \\
|
| 606 |
+
Prediction for the gap clip model: shirt \\
|
| 607 |
+
Prediction for the baseline model: jacket \\
|
| 608 |
+
\end{quote}
|
| 609 |
+
|
| 610 |
+
\noindent\textbf{description${_2}$:}
|
| 611 |
+
\begin{quote}
|
| 612 |
+
The specified item is a bodysuit. The style is a top with the fit and function of a bodysuit. The bodysuit is made of supersoft cotton jersey and features long sleeves with shirring at the shoulders, a round neckline with a pleat at the center, a decorative bow, a keyhole button and loop closure at the back, and an allover striped pattern. The bodysuit also has snaps at the inseam for easy dressing and diapering. \\
|
| 613 |
+
Prediction for the gap clip model: shirt\\
|
| 614 |
+
Prediction for the baseline model: sweater\\
|
| 615 |
+
\end{quote}
|
| 616 |
+
|
| 617 |
+
\noindent\textbf{description${_3}$:}
|
| 618 |
+
\begin{quote}
|
| 619 |
+
The specified item is a long-sleeved, soft double-knit slub jersey T-shirt in a brown color. The T-shirt features long sleeves with banded cuffs and a crewneck style. It is made from a soft, double-knit slub jersey material, which is designed for comfort and ease of movement. The T-shirt is hanging on a wooden hanger, ready for wear.\\
|
| 620 |
+
Prediction for the gap clip model: t-shirt \\
|
| 621 |
+
Prediction for the baseline model: sweater \\
|
| 622 |
+
\end{quote}
|
| 623 |
+
|
| 624 |
+
|
| 625 |
+
\noindent\textbf{description${_4}$:} The specified item is a silk dress with short sleeves in the color Lavender. It has a flowing A-line silhouette. \\
|
| 626 |
+
Prediction for the gap clip model: Lavender \\
|
| 627 |
+
Prediction for the baseline model: PastelPurple \\
|
| 628 |
+
|
| 629 |
+
\noindent\textbf{description${_5}$:}
|
| 630 |
+
Description: The specified item is a casual t-shirt with long sleeves in the color Blue. It has a comfortable round neckline. \\
|
| 631 |
+
Prediction for the gap clip model: Blue \\
|
| 632 |
+
Prediction for the baseline model: RoyalBlue \\
|
| 633 |
+
|
| 634 |
+
\noindent\textbf{description${_6}$:}
|
| 635 |
+
Description: The specified item is a fleece dress with long sleeves in the color Navy. It has a beautiful design.
|
| 636 |
+
Prediction for the gap clip model: Navy \\
|
| 637 |
+
Prediction for the baseline model: RoyalBlue \\
|
| 638 |
+
|
| 639 |
+
\noindent\textbf{description${_7}$:}
|
| 640 |
+
Description: The specified item is a chiffon skirt with elastic waistband in the color Purple. It has a flowing midi-length cut. \\
|
| 641 |
+
Prediction for the gap clip model: Purple \\
|
| 642 |
+
Prediction for the baseline model: Amethyst \\
|
| 643 |
+
|
| 644 |
+
|
| 645 |
+
\subsection{Confusion matrices}
|
| 646 |
+
|
| 647 |
+
\begin{figure}[H]
|
| 648 |
+
\centering
|
| 649 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 650 |
+
\centering
|
| 651 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_color/local_text_color_confusion_matrix.png}
|
| 652 |
+
\caption{GAP-CLIP --- Text embeddings}
|
| 653 |
+
\end{subfigure}
|
| 654 |
+
\hfill
|
| 655 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 656 |
+
\centering
|
| 657 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_color/local_baseline_text_color_confusion_matrix.png}
|
| 658 |
+
\caption{Baseline --- Text embeddings}
|
| 659 |
+
\end{subfigure}
|
| 660 |
+
|
| 661 |
+
\vspace{0.5em}
|
| 662 |
+
|
| 663 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 664 |
+
\centering
|
| 665 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_color/local_image_color_confusion_matrix.png}
|
| 666 |
+
\caption{GAP-CLIP --- Image embeddings}
|
| 667 |
+
\end{subfigure}
|
| 668 |
+
\hfill
|
| 669 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 670 |
+
\centering
|
| 671 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_color/local_baseline_image_color_confusion_matrix.png}
|
| 672 |
+
\caption{Baseline --- Image embeddings}
|
| 673 |
+
\end{subfigure}
|
| 674 |
+
\caption{Color confusion matrices on the internal test dataset. GAP-CLIP (left) vs.\ Fashion-CLIP baseline (right) for text (top) and image (bottom) modalities.}
|
| 675 |
+
\label{fig:color_cm_local}
|
| 676 |
+
\end{figure}
|
| 677 |
+
|
| 678 |
+
\begin{figure}[H]
|
| 679 |
+
\centering
|
| 680 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 681 |
+
\centering
|
| 682 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_color/kaggle_text_color_confusion_matrix.png}
|
| 683 |
+
\caption{GAP-CLIP --- Text embeddings}
|
| 684 |
+
\end{subfigure}
|
| 685 |
+
\hfill
|
| 686 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 687 |
+
\centering
|
| 688 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_color/kaggle_baseline_text_color_confusion_matrix.png}
|
| 689 |
+
\caption{Baseline --- Text embeddings}
|
| 690 |
+
\end{subfigure}
|
| 691 |
+
|
| 692 |
+
\vspace{0.5em}
|
| 693 |
+
|
| 694 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 695 |
+
\centering
|
| 696 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_color/kaggle_image_color_confusion_matrix.png}
|
| 697 |
+
\caption{GAP-CLIP --- Image embeddings}
|
| 698 |
+
\end{subfigure}
|
| 699 |
+
\hfill
|
| 700 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 701 |
+
\centering
|
| 702 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_color/kaggle_baseline_image_color_confusion_matrix.png}
|
| 703 |
+
\caption{Baseline --- Image embeddings}
|
| 704 |
+
\end{subfigure}
|
| 705 |
+
\caption{Color confusion matrices on the KAGL Marqo dataset. GAP-CLIP (left) vs.\ Fashion-CLIP baseline (right) for text (top) and image (bottom) modalities.}
|
| 706 |
+
\label{fig:color_cm_kaggle}
|
| 707 |
+
\end{figure}
|
| 708 |
+
|
| 709 |
+
\begin{figure}[H]
|
| 710 |
+
\centering
|
| 711 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 712 |
+
\centering
|
| 713 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_hierarchy/gap_clip_internal_text_hierarchy_confusion_matrix.png}
|
| 714 |
+
\caption{GAP-CLIP --- Text embeddings}
|
| 715 |
+
\end{subfigure}
|
| 716 |
+
\hfill
|
| 717 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 718 |
+
\centering
|
| 719 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_hierarchy/baseline_internal_text_hierarchy_confusion_matrix.png}
|
| 720 |
+
\caption{Baseline --- Text embeddings}
|
| 721 |
+
\end{subfigure}
|
| 722 |
+
|
| 723 |
+
\vspace{0.5em}
|
| 724 |
+
|
| 725 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 726 |
+
\centering
|
| 727 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_hierarchy/gap_clip_internal_image_hierarchy_confusion_matrix.png}
|
| 728 |
+
\caption{GAP-CLIP --- Image embeddings}
|
| 729 |
+
\end{subfigure}
|
| 730 |
+
\hfill
|
| 731 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 732 |
+
\centering
|
| 733 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_hierarchy/baseline_internal_image_hierarchy_confusion_matrix.png}
|
| 734 |
+
\caption{Baseline --- Image embeddings}
|
| 735 |
+
\end{subfigure}
|
| 736 |
+
\caption{Category confusion matrices on the internal test dataset. GAP-CLIP (left) vs.\ Fashion-CLIP baseline (right) for text (top) and image (bottom) modalities.}
|
| 737 |
+
\label{fig:cat_cm_local}
|
| 738 |
+
\end{figure}
|
| 739 |
+
|
| 740 |
+
\begin{figure}[H]
|
| 741 |
+
\centering
|
| 742 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 743 |
+
\centering
|
| 744 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_hierarchy/gap_clip_kagl_marqo_text_hierarchy_confusion_matrix.png}
|
| 745 |
+
\caption{GAP-CLIP — Text embeddings}
|
| 746 |
+
\end{subfigure}
|
| 747 |
+
\hfill
|
| 748 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 749 |
+
\centering
|
| 750 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_hierarchy/baseline_kagl_marqo_text_hierarchy_confusion_matrix.png}
|
| 751 |
+
\caption{Baseline — Text embeddings}
|
| 752 |
+
\end{subfigure}
|
| 753 |
+
|
| 754 |
+
\vspace{0.5em}
|
| 755 |
+
|
| 756 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 757 |
+
\centering
|
| 758 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_hierarchy/gap_clip_kagl_marqo_image_hierarchy_confusion_matrix.png}
|
| 759 |
+
\caption{GAP-CLIP — Image embeddings}
|
| 760 |
+
\end{subfigure}
|
| 761 |
+
\hfill
|
| 762 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 763 |
+
\centering
|
| 764 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_hierarchy/baseline_kagl_marqo_image_hierarchy_confusion_matrix.png}
|
| 765 |
+
\caption{Baseline — Image embeddings}
|
| 766 |
+
\end{subfigure}
|
| 767 |
+
\caption{Category confusion matrices on the KAGL Marqo dataset. GAP-CLIP (left) vs.\ Fashion-CLIP baseline (right) for text (top) and image (bottom) modalities.}
|
| 768 |
+
\label{fig:cat_cm_kaggle}
|
| 769 |
+
\end{figure}
|
| 770 |
+
|
| 771 |
+
\begin{figure}[H]
|
| 772 |
+
\centering
|
| 773 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 774 |
+
\centering
|
| 775 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_hierarchy/gap_clip_text_hierarchy_confusion_matrix.png}
|
| 776 |
+
\caption{GAP-CLIP — Text embeddings}
|
| 777 |
+
\end{subfigure}
|
| 778 |
+
\hfill
|
| 779 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 780 |
+
\centering
|
| 781 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_hierarchy/baseline_text_hierarchy_confusion_matrix.png}
|
| 782 |
+
\caption{Baseline — Text embeddings}
|
| 783 |
+
\end{subfigure}
|
| 784 |
+
|
| 785 |
+
\vspace{0.5em}
|
| 786 |
+
|
| 787 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 788 |
+
\centering
|
| 789 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_hierarchy/gap_clip_image_hierarchy_confusion_matrix.png}
|
| 790 |
+
\caption{GAP-CLIP — Image embeddings}
|
| 791 |
+
\end{subfigure}
|
| 792 |
+
\hfill
|
| 793 |
+
\begin{subfigure}[b]{0.48\textwidth}
|
| 794 |
+
\centering
|
| 795 |
+
\includegraphics[width=\textwidth]{confusion_matrices/cm_hierarchy/baseline_image_hierarchy_confusion_matrix.png}
|
| 796 |
+
\caption{Baseline — Image embeddings}
|
| 797 |
+
\end{subfigure}
|
| 798 |
+
\caption{Category confusion matrices on Fashion-MNIST. GAP-CLIP (left) vs.\ Fashion-CLIP baseline (right) for text (top) and image (bottom) modalities. Despite the domain shift from RGB to grayscale, GAP-CLIP maintains structured category predictions.}
|
| 799 |
+
\label{fig:cat_cm_fashion}
|
| 800 |
+
\end{figure}
|
| 801 |
+
|
| 802 |
+
|
| 803 |
+
\end{document}
|