

Photo by Editor | Chat GPT
. Introduction
We are all there: Scrollly scroll through online stores, trying to find it Complete Item in today’s high -speed e -commerce world, we expect immediate results, and this is the place where AI is taking steps to shake.
The image of this revolution has to be embedded. This is a choice term for a simple idea: you not only through keywords, but also to find products through them Visual matching. Imagine finding the exact dress that you just uploaded and saw on social media! This technology improves online purchases, more intuitive, and finally, helps to sell businesses more.
They are willing to see how it works? We will show you how to use these incredible image embeddings to make your own AI-driving dress search search.
. The magic of photography embedded
The summary is that embedded image is the process of converting images into a numerical representation (vector) in a high -dimensional space. Photos that are semantically the same (such as blue hair gowns and naval blue dresses) will be vectors that are “closer” to each other in this place. This allows a powerful comparison and search that goes beyond simple metadata.
Here are some dresses that we will use to embed in this demo.
The demo will explain the process of modeling the model for the image embedded on Google Cloud.
The first step is to create a model: A model whose name is image_embeddings_model
Created that is taking advantage of multimodalembedding@001
End point in image_embedding
Detach.
CREATE OR REPLACE MODEL
`image_embedding.image_embeddings_model`
REMOTE WITH CONNECTION `(PROJECT_ID).us.llm-connection`
OPTIONS (
ENDPOINT = 'multimodalembedding@001'
);
Creating Object Tables: Large numbers to take action on Wee, we will create an external table that is called external_images_table
I image_embedding
Dataset that will refer to all the pictures stored in the Google Cloud Storage bucket.
CREATE OR REPLACE EXTERNAL TABLEÂ
`image_embedding.external_images_table`Â
WITH CONNECTION `(PROJECT_ID).us.llm-connection`Â
OPTIONS(Â
object_metadata="SIMPLE",Â
uris = ('gs://(BUCKET_NAME)/*'),Â
max_staleness = INTERVAL 1 DAY,Â
metadata_cache_mode="AUTOMATIC"
);
Creating embellishments: Once the model and the object table will come to its place, we will create embedded for clothing photos using the model created by us and store them in the table. dress_embeddings
.
CREATE OR REPLACE TABLE `image_embedding.dress_embeddings` AS SELECT *Â
FROM ML.GENERATE_EMBEDDING(Â
MODEL `image_embedding.image_embeddings_model`,Â
TABLE `image_embedding.external_images_table`,Â
STRUCT(TRUE AS flatten_json_output,Â
512 AS output_dimensionality)Â
);
. Removing vector searching power
Expired embedding manufactured, we will use vector search search to find the clothing we are looking for. Unlike the traditional search, which depends on the exact keyword matches, the vector search searches for items based on their embeddedness. This means that you can find photos using text or even using other images.
!! Find through the text
To find the text: Here we’ll use VECTOR_SEARCH
Work inside the Big Cory to find a “blue dress” in all clothes. The text “Blue Dress” will be converted into a vector and then with the search for vector we will recover similar vector.
CREATE OR REPLACE TABLE `image_embedding.image_search_via_text` ASÂ
SELECT base.uri AS image_link, distanceÂ
FROMÂ
VECTOR_SEARCH(Â
TABLE `image_embedding.dress_embeddings`,Â
'ml_generate_embedding_result',Â
(Â
SELECT ml_generate_embedding_result AS embedding_colÂ
FROM ML.GENERATE_EMBEDDINGÂ
(Â
MODEL`image_embedding.image_embeddings_model` ,Â
(
SELECT "Blue dress" AS content
),Â
STRUCTÂ
(
TRUE AS flatten_json_output,Â
512 AS output_dimensionality
)Â
)
),
top_k => 5Â
)
ORDER BY distance ASC;Â
SELECT * FROM `image_embedding.image_search_via_text`;
Results: The results of the query will provide one image_link
And a distance for every result. The results you will get to see that you will get the closest match regarding the search inquiry and the available clothing.
!! Find through the picture
Now, we will consider how we can use a picture to find similar pictures. Let’s try to find a dress that looks like the bottom syllable:


Outdoor table for test image: We have to store the test image in the Google Cloud Storage bucket and make an outer table external_images_test_table
To store the test image used for search.
CREATE OR REPLACE EXTERNAL TABLEÂ
`image_embedding.external_images_test_table`Â
WITH CONNECTION `(PROJECT_ID).us.llm-connection`Â
OPTIONS(Â
object_metadata="SIMPLE",Â
uris = ('gs://(BUCKET_NAME)/test-image-for-dress/*'),Â
max_staleness = INTERVAL 1 DAY,Â
metadata_cache_mode="AUTOMATIC"
);
Prepare embedded for test image: Now, we will create embedded for the use of this single test image ML.GENERATE_EMBEDDING
Ceremony
CREATE OR REPLACE TABLE `image_embedding.test_dress_embeddings` ASÂ
SELECT *Â
FROM ML.GENERATE_EMBEDDING
(Â
MODEL `image_embedding.image_embeddings_model`,Â
TABLE `image_embedding.external_images_test_table`, STRUCT(TRUE AS flatten_json_output,Â
512 AS output_dimensionality
)Â
);
Looking for vector with photography embedded: Finally, the test image will be used to find vector against embedded image_embedding.dress_embeddings
Schedule ml_generate_embedding_result
By image_embedding.test_dress_embeddings
Will be used as an inquiry.
SELECT base.uri AS image_link, distanceÂ
FROMÂ
VECTOR_SEARCH(Â
TABLE `image_embedding.dress_embeddings`,Â
'ml_generate_embedding_result',Â
(Â
SELECT * FROM `image_embedding.test_dress_embeddings`
),
top_k => 5,Â
distance_type => 'COSINE',Â
options => '{"use_brute_force":true}'Â
);
Results: Most visible clothes were shown in the results of the image search inquiry. Was the top result white-dress
With a distance of 0.2243, after that sky-blue-dress
With a distance of 0.3645, and polka-dot-dress
With a distance of 0.3828.
These results clearly show the ability to find similar items on the basis of input image.
!! Impression
This demonstration effectively illustrates how the image embedded and vector searching on Google Cloud can revolutionize how we interact with visual data. E -commerce platforms offer intelligent visual asset discovery to the content management system activating the “similar shop” features, applications are wide. By transforming images into a searching vector, these technologies unlock a new dimension of search, making it more intuitive, powerful and visually intelligent.
These results can be presented to the user, which can quickly find the desired clothing.
. The benefits of AI clothing search
- Better User Experience: Visual Search provides a more intuitive and efficient way to find users they are looking for
- Improved accuracy: Image embedded the search based on visual matching, provides more relevant results than traditional keyword -based search
- Increase in sales: By making consumers easier to find their desired products, AI dress can promote search conversion and run the revenue
. Beyond the search for clothing
By combining the power of image embedding with the strong data processing capabilities of the Big Caurea, you can create a modern AI-driving solution that changes ways to communicate with visual content. From e -commerce to moderate to material, image embedded and bug core strength goes beyond the search for clothing.
Here are some other potential applications:
- E -commerce: Visual search for product recommendations, other product categories
- Fashion design: trend analysis, design inspiration
- Contemporary Moderate: indicating inappropriate content
- Copyright violations Finding: Finding Similar Pictures for intellectual property protection
Nadita Kumari An experienced data analysis and AI professional with over 8 years of experience. In its current role, as a data analtics customer engineer in Google, he is permanently engaged with C -level executives and helps them to resolve the data solution and guide them on the best practice to create data and machine learning solutions on Google Cloud. Navidita has done its masters in the Arbana Champion with focus on Illinois University data analtics in the Arbana Champion. She wants to make machine learning and AI democratic, which has to break the technical barriers so that everyone can be part of the technology of this change. She shares her knowledge and experience with the developer community, making lessons, leaders, pieces of opinion and coding demonstrations.
Linked to contact them with Nadita.