<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Daniel Bui on Medium]]></title>
        <description><![CDATA[Stories by Daniel Bui on Medium]]></description>
        <link>https://medium.com/@officialdaniel.bui?source=rss-0388d0f45227------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*eJ_n8eAvccfUd5CH</url>
            <title>Stories by Daniel Bui on Medium</title>
            <link>https://medium.com/@officialdaniel.bui?source=rss-0388d0f45227------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 20:57:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@officialdaniel.bui/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Composed Image Retrieval w/ CLIP]]></title>
            <link>https://medium.com/@officialdaniel.bui/composed-image-retrieval-w-clip-e58de0f3d9de?source=rss-0388d0f45227------2</link>
            <guid isPermaLink="false">https://medium.com/p/e58de0f3d9de</guid>
            <dc:creator><![CDATA[Daniel Bui]]></dc:creator>
            <pubDate>Thu, 30 Apr 2026 20:09:02 GMT</pubDate>
            <atom:updated>2026-04-30T20:09:02.313Z</atom:updated>
            <content:encoded><![CDATA[<h4>Daniel Bui, Nithin Chandra, Declan Kim, Sanjana Kishore</h4><p>Have you ever gone shopping online and you find an item that’s not quite what you’re looking for, but it’s almost there? Maybe it’s a long sleeve shirt and you want something similar but short sleeves, or maybe it’s a blue graphic tee with white text but you want a green tee with red text. You almost always see “more like this” or “similar products,” but you don’t usually get to specify what you want to keep the same versus what you want to change. This was our goal: to build an image retrieval system based on an input image and text that modifies the image.</p><p>First we should talk about how retrieving similar images even works. Generically, we take a machine learning model and pass through images to get embeddings. Then, for an input image, we get its embedding and compare it against all of the other embeddings with a metric like cosine similarity to determine the most similar images.</p><p>CLIP is a multimodal machine learning model that is able to take both images and text and embed them into the same space. With this, we can now have these combined embeddings that represent a more complete semantic embedding with meaning from both visual details and natural language that describes it. This seems perfect for our task, but there is one caveat: how CLIP was trained. CLIP is trained with image-text pairs where the text describes the image. However, we want combined embeddings where the text doesn’t necessarily describe the image; in fact, the text will likely be different because we’re trying to modify the image with the text. This is what makes the problem interesting and not a simple copy paste of a pre-trained model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*UDA5sdbBCsHX6Uxd7y3kxA.png" /><figcaption>CLIP Architecture</figcaption></figure><p>Before we get into what we did, let’s quickly establish how CLIP works in the first place. CLIP takes an image-text pair and embeds it with a vision transformer (ViT) and decoder transformer. CLIP trains its encoders to maximize the similarity between a correct image-text pair while minimizing the similarity between an image and text that does not describe it (and vice versa). Specifically, CLIP uses InfoNCE loss to generate these similar image-text embeddings.</p><p>Of course, to train a machine learning model, you need data. We used FashionIQ, a dataset designed specifically for this task of composed image retrieval. There are 18,000 training data points, and the images used in the dataset are 224 x 224 color images. Each data point (will also be referred to as a triplet) consists of an input (candidate) image, modifying text, and an output (target) image. The modifying text is human-written and describes the differences between the input image and the output image and hence how you could get from one to the other.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*BR1-9sxfJqRRzY-eCWsoTA.png" /><figcaption>An example of a data triplet from FashionIQ</figcaption></figure><p>With that out of the way, the first important step as with all transfer learning problems is to fine tune our model. Since CLIP was trained on complementary image-text pairs we need to tweak how CLIP generates and combines its embeddings for dissimilar image-text pairs. We do this by training and evaluating a composer. A composer will take the image embedding from our model and text embedding from our model and combine them in a way that it can be directly compared against another image embedding. When we fine tune, we take this composed embedding (we will also refer to this as the query embedding) and compute the loss between it and the target image embedding. Fine tuning CLIP models to our dataset gave us our first notable increase in performance. In fine-tuning our CLIP models the composer we used was a simple sum of the image embeddings and the average of the two modification embeddings and then normalizing with the L2 norm.</p><p>To fine-tune we unfroze all the layers on the text encoder for the smaller ViT-L/14 model and last four layers of the text encoder that went with the larger ViT-bigG-14 model and used a batch size of 4096, training for 10 epochs. For a fairer comparison we could have trained both models the same way, however given the small size of the dataset, and the much larger size of the G-14 model, we decided not train the full G-14 text encoder to prevent overfitting. We chose to fine-tune only the text-encoder, because we suspected CLIP had not been trained very much on fashion modifications. However it would have naturally seen millions upon millions of images of clothing. Thus, it makes sense only the text encoder needed to be brought up to speed to improve performance. The model was again finetuned on infoNCE loss, which to reiterate is the most natural loss choice when training a model for performance on retrieval. We chose to fine-tune the L/14 and G-14 since they performed the best without fine-tuning.</p><p>Now you may be wondering about our preprocessing, but the reason why we chose FashionIQ is that it is a curated dataset that is meant to test composed image retrieval. This means no significant preprocessing was required. This allowed us to focus our attention on developing methods to solve the composed image retrieval problem.</p><p>The retrieval metric we used here and for the rest of the methods we tried is Recall 10, R10 as an abbreviation. This measures the percentage in which the target image is in the top 10 of retrieved images. In our case we ranked retrieval images by cosine similarity to the target and selected the top 10. The R10 score that we see will use is evaluated on the whole validation set provided in the fashionIQ dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KirGxhFxDEsVFseCTv5qxw.png" /><figcaption>Results of the 0-shot retrieval using all of the publicly available CLIP models using OpenCLIP’s weights.</figcaption></figure><p>As we see here, the retrieval performance scales with the number of parameters. It is important to note also that the bigger models also have a higher dimensional embedding space. (1280) for the G-14 vs (512) for B/32. This indicates that the performance on composed image retrieval scales with the complexity of the CLIP embedding space. Additionally we can see the fine tuning of the text-encoder significantly boosted the performance of our CLIP models on their R10 scores.</p><p>To us this indicates the CLIP models have now learned the semantic structure of modification texts, which is something they were not as good understanding before.</p><p>These plots, while not rigorous in their analysis appear to show a strong correlation between, embedding size and parameter count with recall on our problem.</p><p>After this analysis on CLIP backbones, we searched for methods on which we could further improve a given CLIP backbone on retrieval in this FashionIQ dataset.</p><p>The next method we tried was Full Text Conversion. This varied in that instead of trying to perform complicated math via combining an image of a blue shirt and the instruction to make it red, for example, we attempted to use the Gemini 2.5 Flash Lite model to act as a visual translator that describes the final product. Then, by generating a detailed text description of what the ideal target item should look like, we create a search query that a model like CLIP can easily understand.</p><p>This method uses Gemini to find the correct text coordinate and then asks CLIP L/14 to find the image coordinate that is closest to it. This Zero-Shot approach is unique because the model is solving the problem using general knowledge it already has about fashion and language, rather than being specifically trained on the Fashion-IQ answers like a supervised model would.</p><p>The core of this project rests on the Gemini 2.5 Flash Lite API, which connects visual data with textual instructions. In traditional computer vision, a computer might see a blue shirt as just a collection of color values and shapes, but it doesn’t truly understand the concept of a “shirt” or what “shorter sleeves” means in a fashion context. The API is responsible for looking at the reference image, reading the modification text, and then synthesizing those two very different types of data into a single, high-quality description of an object that doesn’t even exist yet. This dependency on the API created a unique technical challenge because the entire retrieval pipeline hinges on the quality of the text produced by Gemini. If the API returns a vague description, the CLIP model will not be able to find the correct image in the gallery.</p><p>To make this work, we developed a specific prompting strategy to ensure the API output remained consistent and technical, focusing on fashion-specific attributes like hem lengths, necklines, and fabric patterns. This essentially allowed the Gemini API to translate human intent into a format that a search engine can understand. Initially, our attempts at generating descriptions were too conversational, which caused the retrieval scores to suffer. For example, when Gemini wrote full, descriptive sentences like “This is a red dress that has a shorter hemline than the original,” the CLIP model became distracted by the filler words. To fix this, we switched to a Dense Keyword Strategy, forcing the model to output only searchable, comma-separated tags such as Category, Color, Material, etc. We also made sure that the descriptions varied by category; for example, if the category was a dress, we would focus on its length, silhouette, and fabric patterns. This ensured that the description would contain the most relevant information for the CLIP model to understand, filtering out anything less than useful. This change ensured that the text encoder was only processing high-value visual information, which directly improved Recall scores.</p><p>Beyond just the reasoning, the project also heavily depended on the API’s performance and limitations.</p><p>When we first tried to run the full dataset of 6,000 images, the system would immediately crash due to rate limiting. Because the Gemini API has a strict limit on how many requests can be made per minute, a standard for-loop was either too slow or too aggressive. We solved this by building an asynchronous batch processor that could handle 150 requests per minute by working in the background. This required a sophisticated setup using asyncio and nest_asyncio to ensure the notebook didn’t freeze while waiting for the AI to respond. If the API were removed or went offline, the entire system would lose its ability to understand the meaning of the fashion modifications.</p><p>Another hurdle we encountered was dealing with empty results where the API would return a None value or a “RATE_LIMIT” error string instead of a description. If these empty results had been passed to the evaluation function, they would have caused a ZeroDivisionError or mathematically ruined our average scores. We added a Filtering Layer that checked every single Gemini response to ensure it was valid before adding it to the final current_results list. This meant our final mean recall was calculated only on “successful” AI reasoning, making the data much more reliable.</p><p>One of the biggest failures was the system running out of GPU memory when trying to index the massive image gallery. With over 15,000 images to process across three categories, the T4 GPU in Colab couldn’t hold everything at once. We fixed this by moving image features to the CPU immediately after they were calculated and manually forcing the GPU to “empty its cache” between every category. This allowed us to finish the entire 6,000-query run without a single memory-related crash.</p><p>Our final run of the code led to the following results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jGiuCe2agiZ0LQHeUumn0A.png" /></figure><p>Interpreting these recall scores requires looking beyond the raw percentages and understanding the fundamental difference in how the two systems “think.” A mean Recall@10 of 12.03% means that for over 700 queries across the validation set, the correct target image was found within the model’s top ten guesses without the model ever having been trained on a single fashion-related example. While this number is mathematically lower than the percentage reached by the other attempt, it does, to a certain degree, represent a successful baseline for zero-shot reasoning. This method acts like a generalist, using its broad understanding of the world to solve the problem, which makes this 12.03% a reflection of pure logical inference rather than pattern matching.</p><p>The strength of this generative approach lies in its transparency and explainability. With this Gemini-driven pipeline, every failure has a “paper trail” in the form of a text description. If the model fails to retrieve a specific shirt, you can read the generated caption to see where exactly Gemini went wrong– maybe it misunderstood the material or missed a specific detail in the modification text. This level of interpretability is a massive advantage in real-world applications where developers need to debug and trust the logic behind an AI’s decisions.</p><p>To improve these scores, a possible next step would be implementing a reranking process. Currently, our system uses a coarse search where it looks at 15,000 images at once. A more advanced version would use the current method to find the top 50 candidates and then ask Gemini to perform a “fine-grained” comparison to pick the ultimate winner from that small group. Additionally, Gemini’s prompts could be further refined by using a technique known as “few-shot prompting”, which involves providing the model with examples of the task inside the prompt before asking it to perform a new one. This could help Gemini’s outputs remain focused and directed, sticking to a consistent formatting and style.</p><p>For proof of this potential improvement, we performed a small test on a representative subset of 100 images using a model implementing few-shot prompting. By providing just 1 appropriate example response for each category, the model saw a mean performance of 22.09% with Recall@10 and 38.80% with Recall@50. Although results do tend to waver between runs, the significant increase in performance indicates that Full Text Conversion has potential for further performance gains.</p><p>All in all, these results prove that generative retrieval is a valid and powerful alternative to traditional methods, providing a foundation for a system that is not only smart but also easy for humans to understand and improve.</p><p>The link to the notebook can be found here: <a href="https://colab.research.google.com/drive/1HSvMPzwueui3brMI2YTq0Q3ZxWQ5yScZ?usp=sharing">https://colab.research.google.com/drive/1HSvMPzwueui3brMI2YTq0Q3ZxWQ5yScZ?usp=sharing</a></p><p>Few-shot sampling notebook: <a href="https://colab.research.google.com/drive/1yNs2eRwPvnocQ94DrRhYyMpfn2_oMXHy?usp=sharing">https://colab.research.google.com/drive/1yNs2eRwPvnocQ94DrRhYyMpfn2_oMXHy?usp=sharing</a></p><p>While this Full Text Conversion was very interesting and provided greater insights and potential scalability, it actually performed worse on R@10 than the regular one-shot L/14 CLIP. Thus we decided to approach a completely different direction in utilizing our CLIP backbones.</p><p>Whereas we had tried to modify the data to produce better results, we now will modify the opposite end, the output of the CLIP backbones to try and improve our recall scores.</p><p>The first method we attempted in this new approach was developing a simple but more robust combiner than just adding our query and modification embeddings. To do this we considered the thesis of the problem. We want to go from a query image and modifications to a target image. The geometry of the embedding space of CLIP gives a simple way to do this.</p><p>Let <em>v</em> be the query image embedding vector, <em>t</em> be the normalized average of the two modification embedding vectors, and <em>q</em> be our predicted target embedding vector. We operate with the assumption that the modification embedding points in the direction from the query embedding toward the target embedding. With this assumption we can decompose the query image embedding into two components: the component parallel to the modification direction, and the component perpendicular to it. The parallel component represents the part of the image that already aligns with the modification, which is noise we want to remove. The perpendicular component represents the visual identity of the reference image that should be preserved regardless of the modification. We then construct our query by keeping the perpendicular component and replacing the parallel component with a scaled version of the modification direction. Since alpha is a learned parameter, there actually is not point in isolating the perpendicular component of the query embedding, however, you can view it as stylistic choice because it is cooler but more importantly gives a better intuition as to exactly how much of the modification direction we are using vs the query direction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*IY1Oap42fhhG6bu6_FygmQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*eVEBQICs34Do7RvRqXNGUA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*odLEk8XHFY9oMWIXJRHoLA.png" /></figure><p>We tested this vector addition method on the fine-tuned L/14 and G-14 models and impressively yielded significant recall gains as can be seen in the figures. This appears to confirm our hypothesis that the modification vector points towards the target when starting from the query. Additionally we can see best results when alpha is around 2, meaning the modifications consistently contribute to about 80% (from calculating vector magnitudes) of the predicted embedding. This is a simple linear vector operation performed entirely in the CLIP embedding space requiring no additional training whatsoever. However the CLIP model is a complex non-linear model, thus it makes sense to test a non-linear way of combining our query and modification embeddings to see if we can do better.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*yuqVesd-kO4l3rer4nNStg.png" /><figcaption>Smaller MLP, 3 million parameters for L/14 and 12 million for G-14</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*QXOnuP20xijUgGtqsBB86w.png" /><figcaption>Larger MLP, 12 million parameters for L/14 and 32 million for G-14</figcaption></figure><p>We then tested an MLP that would learn to combine the output embeddings. We again used InfoNCE loss to train while keeping the CLIP backbone frozen. We tried several configurations of increasing depth and width to give the MLP every opportunity to find a better solution.</p><p>As we can see the MLP did worse than our vector addition method and got significantly worse (even more so than the fine tuning baseline) when it was made to have more parameters. This was a surprising result at first but on reflection it makes a lot of sense. The MLP is given the image and text embeddings and asked to figure out on its own where the target should be. It has no knowledge about the geometry of the space it is operating in. The vector addition on the other hand directly exploits the assumption that modifications correspond to directions in embedding space. A generic MLP with 18,000 training examples does not have enough supervision to rediscover this geometric structure from scratch.</p><p>This indicates that the most important step in predicting a high quality target embedding is having the model identify which directions are the best to move in, and that without a geometric prior to guide it a learned network struggles to find those directions with limited data. We decided to try and combine the geometric insight from the vector addition method and the complexity of a learned network to get the best of both worlds. The key question was whether we could learn those directions more precisely than a fixed vector fixed vector addition while still preserving the geometric structure that made the projection work.</p><p>After reading the literature on CLIP based methods on Fashion-IQ composed image retrieval and a great deal of experimentation we developed an architecture heavily inspired by the paper Conditioned and Composed Image Retrieval Combining and Partially Fine-Tuning CLIP-Based Features by Baldrati et al . In this paper they had come to a very similar conclusion as we did, that it is important to inform the model of which directions to move in to reach the target embedding and that a purely unconstrained learned combiner struggles to do this without enough data. Thus we built an architecture based on the description they provided but adapted to the much larger and more powerful CLIP models we have access to versus what the paper used.</p><p>The Combiner can be thought of as a learned generalization of the Vector Projection. Where the projection used a fixed alpha to decide how far to move in the modification direction, the Combiner learns those movement coefficients from data and does so independently for every dimension of the embedding space. The architecture consists of two branches that both take as input the concatenation of projected image and text embeddings. The first branch learns a per-dimension gating coefficient using a sigmoid activated MLP, which outputs a vector of values between zero and one. These coefficients are then used to compute a weighted combination of the original image and text embeddings where each dimension can independently interpolate between the two. This is the learned analog of the fixed alpha from the Vector Projection. Instead of a single scalar that pushes every dimension equally in the modification direction, the network learns exactly how much to move each dimension based on the specific image and modification text provided.</p><p>The predicted query embedding from this first branch is given by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tiMlAu1fP6bRlz6uge0z6Q.png" /></figure><p>The second branch is a separate unconstrained MLP that also takes the concatenated projected embeddings as input and produces an additive correction term. This branch is free to learn any transformation the convex combination cannot express on its own, such as cross-dimensional interactions or nonlinear combinations. The final predicted query embedding is then:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5I_qkdigBP0w8NwhwDdgjQ.png" /></figure><p>We trained the Combiner on top of our frozen fine-tuned CLIP backbones using the same BBC InfoNCE loss we used for fine-tuning, with a temperature of 100, batch size of 4096, and learning rate of 2e-5 for 300 epochs. Keeping the backbone frozen meant we could cache all 18,000 image and text embeddings upfront making each epoch extremely fast. At evaluation time we run two separate forward passes through the Combiner, one for each modification caption, and average the outputs before computing similarity against the gallery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZASQFN6ICKb1UaHIeG1nvA.png" /></figure><p>The results were impressive. On top of the fine-tuned ViT-L/14 the Combiner brought average R@10 from 33.18% to 44.14%, a gain of nearly 11 points. On the larger ViT-bigG-14 it went from 39.00% to 51.90%, again roughly 12 points of improvement. This is a consistent gain across both backbones and all three categories which gives us confidence that the Combiner is doing something genuinely useful rather than just overfitting to one category.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*FtUtqqGtqw-putYWmlxo-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*d1XKMt2R06gVroDryp_qKw.png" /></figure><p>One thing worth examining is what happened over the course of training. Looking at the training loss curve alongside the validation R@10 curve tells an interesting story.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Ol978H9Y2kliFq2A5gSYg.png" /><figcaption>Ignore the legend, those values stem from previous runs that had some bugs in the code and are not accurate.</figcaption></figure><p>The Loss and R@10 (effective proxy for testing loss) scores both have similar shapes and plateauing behaviour. However from the plots, the R@10 curves plateau sooner than the loss curves. This is a clear sign that the model has started to overfit. The Combiner has memorized patterns in the 18,000 training triplets that do not generalize to the validation set.</p><p>This makes intuitive sense given the scale of the problem. The Combiner for ViT-L/14 has 34 million parameters being trained on only 18,000 examples and the Combiner for ViT-bigG-14 has 53 million parameters on the same 18,000 examples. That is fewer than one training example per two model parameters which is an extremely data-limited regime for a neural network of this size. The fact that it works at all is largely due to the directional prior built into the convex combination branch. Without a structural hint about where the target should be the model would likely overfit much faster and to a lower ceiling. This overfitting ceiling also explains why more aggressive training strategies did not improve results. The bottleneck is not the training procedure but the amount of available supervision relative to model capacity and more training data would be the most direct path to further improvement.</p><p>To put our results in context, it is worth comparing against the broader landscape of methods on Fashion IQ. Our best result of 51.90% average Recall@10 on ViT-bigG-14 with the Combiner is competitive with published supervised methods that do not use large language models or access the intermediate feature layers of their backbone models. This result represents a substantial improvement over standard CLIP-based baselines like the original supervised CLIP4CIR, which typically achieves between 38.40% and 40.80% average Recall@10.</p><p>The majority of state-of-the-art methods on Fashion IQ use BLIP-2 as their backbone rather than CLIP. BLIP-2 is a vision-language model built around a Q-Former which is a transformer that bridges a frozen image encoder and a language model by learning to attend to image patches conditioned on text tokens. This means BLIP-2 can fuse image and text information during encoding rather than after the fact, which gives it a fundamental advantage for composed retrieval where the modification text refers to specific visual attributes.CLIP, however, encodes each modality (text and images) independently and only compares them at the embedding level, which is the core limitation our combination methods are trying to compensate for.</p><p>Methods built on BLIP-2 ViT-G tend to cluster in the 54% to 57% average R@10 range on Fashion IQ. SPRC reports 54.92% by learning sentence-level prompts with a BLIP-2 backbone. WRF4CIR, which applies adversarial weight perturbation during fine-tuning to reduce overfitting, reports 57.35% and currently represents one of the strongest results on the benchmark without LLM assistance. These methods require full end-to-end fine-tuning of multi-billion parameter vision-language models with cross-modal attention throughout, which is a considerably heavier computational investment than our approach of training a 34M to 53M parameter Combiner on top of frozen CLIP embeddings that were only fine-tuned on the text encoder.</p><p>Methods that push meaningfully above this range tend to bring in large language models either to generate additional synthetic training triplets or to re-rank retrieved candidates at inference time. For example, FIRE-CIR achieves 58.16% by using an LLM to decompose instructions into visual questions for a dedicated verifier. Even more advanced is the MCoT-MVS (Multi-level Vision Selection by Multi-modal Chain-of-Thought Reasoning) framework, which has pushed performance to approximately 62% on the validation split. MCoT-MVS leverages an MLLM to perform chain-of-thought reasoning on the multimodal input to generate cues, specifically identifying which features should be removed, retained, or inferred.</p><p>The apparent ceiling in the 54% to 57% range across methods that do not use LLMs likely reflects genuine limitations in the dataset itself rather than the models. Fashion IQ contains only 18,000 training triplets, which is a very small amount of supervision for learning the complex relationship between visual appearance and natural language modification.</p><p>The modification captions are also notably vague and subjective. Descriptions like “is more casual” or “has a different pattern” are inherently ambiguous, and even humans can reasonably disagree on which target image they point to. This means that even a theoretically perfect model probably cannot achieve 100% recall on every query because some queries simply do not have a uniquely correct answer given the information provided. The combination of a small training set and subjective captions creates a fundamental ceiling that additional model complexity alone cannot overcome.</p><p>To sum up, we set out to build a system that could take an image and a description of how to change it and find the right match from a large gallery of fashion items. What we found along the way was that this problem is really, really hard, and that the key to solving it is less about building complex neural networks and more about understanding the geometry of the space you are working in.</p><p>Fine-tuning the text encoder gave us our first big jump, the vector addition gave us another meaningful gain essentially for free just by thinking carefully about which direction to move in embedding space, and the combiner architecture took that same intuition and made it robust and thorough. The Full Text Conversion approach did not outperform our other methods numerically but demonstrated that the problem can be approached from completely different angles, and understanding both perspectives gave us a much richer picture of what is actually going on.</p><p>If we had more time, the most natural next step would be combining these two directions. An LLM could enrich vague modification captions like “make it more casual” into detailed visual descriptions before passing them to the text encoder, giving the Combiner a much stronger signal to navigate the embedding space with. This is essentially what top-performing methods like SPN4CIR do, and the gains they report suggest it is a very promising direction. Pairing that with a BLIP-2 backbone, which can attend to specific image regions while processing the modification text rather than composing two independently computed embeddings, would address the remaining limitations we identified pretty directly.</p><p>Hopefully, this was an interesting read because it was an interesting project to work on.</p><p>Notebooks containing important code used will be attached, but depending on when it is read the code may or may not be legibly formatted yet.</p><p>Some Interesting results we will leave to the interpretation of the reader:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qbhx5HPe8Kt7Fd8q0a4RqA.png" /><figcaption>Recall@3 results for the baseline and trained models</figcaption></figure><h3><strong>References</strong></h3><p>Baldrati, A., Bertini, M., Uricchio, T., Del Bimbo, A. (2022). Composed Image Retrieval using Contrastive Learning and Task-Oriented CLIP-Based Features. ACM Transactions on Multimedia Computing, Communications and Applications. <a href="https://arxiv.org/abs/2308.11485">https://arxiv.org/abs/2308.11485</a> Bai, Y., Xu, X.,</p><p>Liu, Y., Khan, S., Khan, F., Zuo, W., Goh, R.S.M., Feng, C.M. (2024). Sentence-level Prompts Benefit Composed Image Retrieval. ICLR 2024 (Spotlight). <a href="https://arxiv.org/abs/2310.05473">https://arxiv.org/abs/2310.05473</a></p><p>Feng, Z., Zhang, R., Nie, Z. (2024). Improving Composed Image Retrieval via Contrastive Learning with Scaling Positives and Negatives. ACM MM 2024. <a href="https://arxiv.org/abs/2404.11317">https://arxiv.org/abs/2404.11317</a> Li, J., Li,</p><p>D., Savarese, S., Hoi, S. (2023). BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models. ICML 2023. <a href="https://arxiv.org/abs/2301.12597">https://arxiv.org/abs/2301.12597</a> Xu,</p><p>Y., Yu, C., Shao, Y., Liu, T., Peng, Q., You, X. (2026). WRF4CIR: Weight-Regularized Fine-Tuning Network for Composed Image Retrieval. <a href="https://arxiv.org/abs/2604.05583">https://arxiv.org/abs/2604.05583</a> Sun, Z., Jing, D., Yang,</p><p>G., Fei, N., Lu, Z. (2024). Leveraging Large Vision-Language Model as User Intent-aware Encoder for Composed Image Retrieval. <a href="https://arxiv.org/abs/2412.11087">https://arxiv.org/abs/2412.11087</a> Ge, X., Wang, C., Wang, X., Xin,</p><p>X. (2026). MCoT-MVS: Multi-level Vision Selection by Multi-modal Chain-of-Thought Reasoning for Composed Image Retrieval. <a href="https://arxiv.org/abs/2603.17360">https://arxiv.org/abs/2603.17360</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e58de0f3d9de" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>