Metadata Query

How Do I Search for Specific Assets?

  1. Go to Dataset - This is the place to access, modify, and view your data easily.
  2. Select and Enter Prompt into Search Bar - Ensure that you have Metadata selected so you are searching based on Metadata Query. If Filename is selected, you will be searching just based on filename.

Congratulations, your results have been queried, filtered, and listed below!

What is Metadata Query?

Metadata Query is a in-built search engine on Nexus that allows you to better investigate your data to understand and discover nuances that can affect performance. This is useful at any stage in the computer vision pipeline, whether it acts as a tool for data discovery after annotation is complete to identifying edge cases that can impact model training and performance.

Why Use Metadata Query?

Metadata Query enables teams to effectively and efficiently enact sanity checks on their data pre and post-training. This lets teams improve production AI by moving past aggregate metrics and placing an emphasis on understanding their data in depth. Once teams understand their qualitative failure modes, they can fix them by gathering the right data to handle edge cases as well as debug poor model performance - reducing time spent sifting through data, and more time on model iteration.

How to Use Metadata Query?

Using tag names, you can filter annotated images with tags using query strings like 'boat' as well as use logic terms like 'and' and 'or' to make the query more specific, i.e. 'RBC and WBC'.

You can also use image metadata in your queries with several combinations.

List of Fields

Metadata FieldExample Usage
Annotation tagRBC and WBC returns images labeled with "RBC" and "WBC"
File sizefileSize > 1000 returns images with file sizes greater than 1000 bytes
Image heightheight > 100 returns images with pixel height greater than 100
Image widthwidth > 100 returns images with pixel height greater than 100
Filenamefilename == "s(92).jpg" returns image with name equal to the string
Asset group"mygroup" in groups returns images who are part of the "mygroup" asset group
Annotation status`status in ["annotated", "none"]

` returns image whose annotation status is either annotated or none

List of Operators

OperatorExampleExplanation
andRBC and WBCReturns all images that are labeled with "RBC" AND "WBC"
orRBC or WBCReturns all images that are labeled with either "RBC" OR "WBC"
Addition
(x +y)
RBC + WBC >= 5Returns all images where the sum of "RBC" and "WBC" labels is more than or equal to 5
Subtraction
(x - y)
RBC - WBC \<= 3Returns all images where the subtraction of "WBC" from "RBC" labels is less than or equal to 3
Division
(x / y)
RBC / WBC = 2Returns all images where the division of the number of "RBC" labels over "WBC" is equal to 2
Modulo
(x % y)
RBC % 2Returns all images where there are is an 'odd' number of "RBC" labels
Power
(x ^ y)
RBC ^2 \<= 16Returns all images where the number of labels of "RBC" raised to the power of 2 is less than or equal to 16

List of Comparators

OperatorExampleExplanation
Equals
(x == y)
RBC == instancesReturns all images where the number of "RBC" labels is equal to the total number of labels in the image
i.e "Show me all images where there are only RBC (red blood cells)"
Does not equal
(x ! = y)
RBC ! = WBCReturns all images where the number of "RBC" labels is NOT equal to the number of "WBC" labels
Less than
( < )
RBC \< 3Returns all images where the number of "RBC" labels is less than 3
Less than or equal to
( <= )
RBC - WBC \<= 3Returns all images where the subtraction of "WBC" from "RBC" labels is less than or equal to 3
More than
( > )
RBC / WBC > 2Returns all images where the division of the number of "RBC" labels over "WBC" is more than 2
More than or equal to
( >= )
RBC + WBC >= 3Returns all images where the sum of "RBC" and "WBC" labels are greater than or equal to 3

You can also make queries with conditional statements on the objects annotated using relational tools like <, >, <=, >=, ==, and %. Example strings can be RBC > 4 or WBC \< 3 or width / height \<= 1 and filesize \<= 1000000. Additionally, you can use logical operators like and and or and ( and ) to string multiple conditional statements together to make for a more complex query.

These can be used not just for blindly restricting and filtering data, but also used to spot outliers using your industry or application-specific knowledge. For example, if you know that your dataset is full of bicycles with labeled wheels, wheels % 2 == 1 will indicate images in which images of a bicycle may be incomplete or poor quality images that should be checked for validity.

An example of where the query is `RBC <= 25 and WBC%2 == 0` (Click image to enlarge)

An example of where the query is RBC <= 25 and WBC%2 == 0 (Click image to enlarge)

Custom Asset Metadata

To make queries using your custom asset metadata not listed in the default supported fields, you will need to prepend asset.metadata to your query. For example, to search for an image with "timestamp": "1699006498", simply create your query as such: asset.metadata.timestamp == 1699006498. Do ensure that the metadata query name matches the names specified in your metadata objects upon asset upload.