[{"data":1,"prerenderedAt":75},["ShallowReactive",2],{"i-material-symbols:language":3,"i-material-symbols:person":8,"i-mdi:instagram":10,"i-mdi:youtube":12,"i-ri:linkedin-fill":14,"i-ri:twitter-x-line":16,"i-ri:facebook-fill":18,"post-descriptors-and-k-nearest-neighbors":20,"i-material-symbols:person-outline":69,"i-material-symbols:calendar-month":71,"i-mdi:schedule":73},{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":7},0,24,false,"\u003Cpath fill=\"currentColor\" d=\"M8.125 21.213q-1.825-.788-3.187-2.15t-2.15-3.188T2 11.988t.788-3.875t2.15-3.175t3.187-2.15T12.013 2t3.875.788t3.175 2.15t2.15 3.175t.787 3.875t-.787 3.887t-2.15 3.188t-3.175 2.15t-3.875.787t-3.888-.787M12 19.95q.65-.9 1.125-1.875T13.9 16h-3.8q.3 1.1.775 2.075T12 19.95m-2.6-.4q-.45-.825-.787-1.713T8.05 16H5.1q.725 1.25 1.813 2.175T9.4 19.55m5.2 0q1.4-.45 2.488-1.375T18.9 16h-2.95q-.225.95-.562 1.838T14.6 19.55M4.25 14h3.4q-.075-.5-.112-.987T7.5 12t.038-1.012T7.65 10h-3.4q-.125.5-.187.988T4 12t.063 1.013t.187.987m5.4 0h4.7q.075-.5.113-.987T14.5 12t-.038-1.012T14.35 10h-4.7q-.075.5-.112.988T9.5 12t.038 1.013t.112.987m6.7 0h3.4q.125-.5.188-.987T20 12t-.062-1.012T19.75 10h-3.4q.075.5.113.988T16.5 12t-.038 1.013t-.112.987m-.4-6h2.95q-.725-1.25-1.812-2.175T14.6 4.45q.45.825.788 1.713T15.95 8M10.1 8h3.8q-.3-1.1-.775-2.075T12 4.05q-.65.9-1.125 1.875T10.1 8m-5 0h2.95q.225-.95.563-1.838T9.4 4.45Q8 4.9 6.912 5.825T5.1 8\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":9},"\u003Cpath fill=\"currentColor\" d=\"M9.175 10.825Q8 9.65 8 8t1.175-2.825T12 4t2.825 1.175T16 8t-1.175 2.825T12 12t-2.825-1.175M4 20v-2.8q0-.85.438-1.562T5.6 14.55q1.55-.775 3.15-1.162T12 13t3.25.388t3.15 1.162q.725.375 1.163 1.088T20 17.2V20z\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":11},"\u003Cpath fill=\"currentColor\" d=\"M7.8 2h8.4C19.4 2 22 4.6 22 7.8v8.4a5.8 5.8 0 0 1-5.8 5.8H7.8C4.6 22 2 19.4 2 16.2V7.8A5.8 5.8 0 0 1 7.8 2m-.2 2A3.6 3.6 0 0 0 4 7.6v8.8C4 18.39 5.61 20 7.6 20h8.8a3.6 3.6 0 0 0 3.6-3.6V7.6C20 5.61 18.39 4 16.4 4zm9.65 1.5a1.25 1.25 0 0 1 1.25 1.25A1.25 1.25 0 0 1 17.25 8A1.25 1.25 0 0 1 16 6.75a1.25 1.25 0 0 1 1.25-1.25M12 7a5 5 0 0 1 5 5a5 5 0 0 1-5 5a5 5 0 0 1-5-5a5 5 0 0 1 5-5m0 2a3 3 0 0 0-3 3a3 3 0 0 0 3 3a3 3 0 0 0 3-3a3 3 0 0 0-3-3\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":13},"\u003Cpath fill=\"currentColor\" d=\"m10 15l5.19-3L10 9zm11.56-7.83c.13.47.22 1.1.28 1.9c.07.8.1 1.49.1 2.09L22 12c0 2.19-.16 3.8-.44 4.83c-.25.9-.83 1.48-1.73 1.73c-.47.13-1.33.22-2.65.28c-1.3.07-2.49.1-3.59.1L12 19c-4.19 0-6.8-.16-7.83-.44c-.9-.25-1.48-.83-1.73-1.73c-.13-.47-.22-1.1-.28-1.9c-.07-.8-.1-1.49-.1-2.09L2 12c0-2.19.16-3.8.44-4.83c.25-.9.83-1.48 1.73-1.73c.47-.13 1.33-.22 2.65-.28c1.3-.07 2.49-.1 3.59-.1L12 5c4.19 0 6.8.16 7.83.44c.9.25 1.48.83 1.73 1.73\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":15},"\u003Cpath fill=\"currentColor\" d=\"M6.94 5a2 2 0 1 1-4-.002a2 2 0 0 1 4 .002M7 8.48H3V21h4zm6.32 0H9.34V21h3.94v-6.57c0-3.66 4.77-4 4.77 0V21H22v-7.93c0-6.17-7.06-5.94-8.72-2.91z\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":17},"\u003Cpath fill=\"currentColor\" d=\"M10.488 14.651L15.25 21h7l-7.858-10.478L20.93 3h-2.65l-5.117 5.886L8.75 3h-7l7.51 10.015L2.32 21h2.65zM16.25 19L5.75 5h2l10.5 14z\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":19},"\u003Cpath fill=\"currentColor\" d=\"M14 13.5h2.5l1-4H14v-2c0-1.03 0-2 2-2h1.5V2.14c-.326-.043-1.557-.14-2.857-.14C11.928 2 10 3.657 10 6.7v2.8H7v4h3V22h4z\"\u002F>",{"postType":21,"id":22,"author":23,"date":26,"modified":27,"title":28,"slug":29,"seoTitle":30,"seoDescription":31,"excerpt":32,"trimmedExcerpt":33,"content":34,"readingTime":35,"featuredImage":36,"postCategory":42,"relatedPosts":47},"post",64825,{"id":24,"name":25},"author-0301142015","Canto","2024-06-07T13:22:25","2025-11-28T07:32:30","How AI discovers content using descriptors and k-nearest neighbors","descriptors-and-k-nearest-neighbors","How AI models use descriptors and k-nearest neighbors","Discover how the latest AI models use descriptors, also called n-dimensional vectors, and k-nearest neighbors to recommend similar content for today’s consumer.","The world is a complicated place, so how can we advance AI to help us solve interesting problems in such a complex environment? For instance: The answers are descriptors and neighbors. What are descriptors and nearest neighbors? Let’s assume you invent an AI engine. Next, you feed it something (people’s purchasing histories, or images and [&hellip;]","The world is a complicated place, so how can we advance AI to help us solve interesting problems in such...","\u003Cp class=\"wp-block-paragraph\">The world is a complicated place, so how can we advance AI to help us solve interesting problems in such a complex environment? For instance:\u003C\u002Fp>\u003Cul class=\"wp-block-list\">\u003Cli>How does Amazon decide what we might want to buy next (among millions of choices)?\u003C\u002Fli>\u003Cli>How can we find all the photos from our vacation last summer to the Grand Canyon if they are scattered all over the place?\u003C\u002Fli>\u003Cli>How can we get suggestions for new music to listen to based on our past choices?\u003C\u002Fli>\u003Cli>How can we find research related to a topic we care about (even if it’s in another language)?\u003C\u002Fli>\u003C\u002Ful>\u003Cp class=\"wp-block-paragraph\">The answers are \u003Cem>descriptors\u003C\u002Fem> and \u003Cem>neighbors\u003C\u002Fem>.\u003C\u002Fp>\u003Ch2 class=\"wp-block-heading\" id=\"toc-1--what-are-descriptors-and-nearest-neighbors\">What are descriptors and nearest neighbors?\u003C\u002Fh2>\u003Cp class=\"wp-block-paragraph\">Let’s assume you invent an AI engine. Next, you feed it something (people’s purchasing histories, or images and videos, or music, or research papers) and it kicks out a \u003Cem>descriptor\u003C\u002Fem>: a mathematical expression that represents a compressed description of the object you fed in.\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">A relatable descriptor example is how you shrink your digital camera’s images by saving a photo as a JPEG (something you have been doing for years).\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">The descriptor, if you create it correctly, is capturing the essence of the original object.\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">Next, imagine you do a great job of creating descriptors for every piece of music. Then, you decide you would love to hear music that is like Miley Cyrus’ “Flowers.” One way to find similar songs is to go find the descriptor you created for “Flowers” and look for other descriptors that are nearby: we call those its \u003Cem>nearest neighbors\u003C\u002Fem>.\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">The descriptors nearest to “Flowers” are likely to be very similar songs, while the descriptors further away are likely to be less relevant. Now, we can even sort the results by relevance.\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">The nitty-gritty of doing this is a bit complicated, but let’s dive in enough to demystify it.\u003C\u002Fp>\u003Ch2 class=\"wp-block-heading\" id=\"toc-2--what-is-an-n-dimensional-vector\">What is an n-dimensional vector?\u003C\u002Fh2>\u003Cp class=\"wp-block-paragraph\">Let’s begin thinking about dimensions with a relatable example: RGB colors. You can tell someone how much red, green, and blue the color you are looking at has, and they can enter those RGB numbers to see the same color. That is a solution that only needs three dimensions (like telling UPS the box you need to ship is four inches long, three inches wide and two inches deep).\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">Humans are comfortable thinking in terms of three dimensions, or a \u003Cem>box\u003C\u002Fem> of space.\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">Mathematicians have no problem thinking in terms of hundreds or thousands of dimensions. That’s handy when it comes to figuring out descriptors for complicated things you might be interested in.\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">The current state of the art for descriptors are things called \u003Cem>n-dimensional vectors\u003C\u002Fem> (where n is a specific big number, depending on what you are trying to accomplish).\u003C\u002Fp>\u003Ch2 class=\"wp-block-heading\" id=\"toc-3--finding-relevant-content-using-nearby-descriptors\">Finding relevant content using nearby descriptors\u003C\u002Fh2>\u003Cp class=\"wp-block-paragraph\">We will take some liberties here to explain this: this is not how descriptors work, but you will get the idea. Let’s assume you want an AI model to know about all dog breeds, and you feed it a large training photo set of every known dog breed.\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">The model looks at the photos and the breed names a few million times (in perhaps an hour), decides what is most important to do a great job understanding dog breeds, and builds a descriptor (an n-dimensional vector) for each dog breed.\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">Let’s start with a single point floating in space to visualize n-dimensional vectors for dog breeds.\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">From that single point, there might be an arrow pointing straight up, and the length of that arrow is set by how pointy the ears of that specific dog are. Another arrow’s length, pointed in a slightly different direction, might be set by how long the dog’s tail is. Another arrow, pointing in another slightly different direction, could indicate whether the dog has long hair or short hair.\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">In math terms, each arrow points in a different direction and therefore lives in its own \u003Cem>dimension\u003C\u002Fem>. Since we can have as many dimensions as we need to characterize dog breeds, we can do a very comprehensive job categorizing or sorting dogs by breed.\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">You might imagine that a descriptor for a poodle (it’s n-dimensional vector) might look something like this:\u003C\u002Fp>\u003Cfigure class=\"wp-block-image aligncenter\">\u003Cimg loading=\"lazy\" decoding=\"async\" width=\"880\" height=\"450\" src=\"\u002Fcdn\u002Fen\u002F2024\u002F06\u002F19183850\u002Fai-nearest-neighbor-n-dimensional-vectors.jpg\" alt=\"Series of colored arrows pointing outward from a single point as n-dimensional vectors over an orange background.\" class=\"wp-image-64831\" srcset=\"\u002Fcdn\u002Fen\u002F2024\u002F06\u002F19183850\u002Fai-nearest-neighbor-n-dimensional-vectors.jpg 880w, \u002Fcdn\u002Fen\u002F2024\u002F06\u002F19183850\u002Fai-nearest-neighbor-n-dimensional-vectors-450x230.jpg 450w, \u002Fcdn\u002Fen\u002F2024\u002F06\u002F19183850\u002Fai-nearest-neighbor-n-dimensional-vectors-768x393.jpg 768w\" \u002F>\u003C\u002Ffigure>\u003Cp class=\"wp-block-paragraph\">While we can’t draw a picture of all the descriptors of all dog breeds in a multidimensional space, we can simplify it to a three-dimensional space. Here is what descriptors of various dog breeds might look like in a three-dimensional space:\u003C\u002Fp>\u003Cfigure class=\"wp-block-image aligncenter\">\u003Cimg loading=\"lazy\" decoding=\"async\" width=\"880\" height=\"450\" src=\"\u002Fcdn\u002Fen\u002F2024\u002F06\u002F19183849\u002Fai-nearest-neighbor-all-descriptors.jpg\" alt=\"Image of a three-dimensional space of clusters of nearest neighbor descriptor dots on a green background.\" class=\"wp-image-64833\" srcset=\"\u002Fcdn\u002Fen\u002F2024\u002F06\u002F19183849\u002Fai-nearest-neighbor-all-descriptors.jpg 880w, \u002Fcdn\u002Fen\u002F2024\u002F06\u002F19183849\u002Fai-nearest-neighbor-all-descriptors-450x230.jpg 450w, \u002Fcdn\u002Fen\u002F2024\u002F06\u002F19183849\u002Fai-nearest-neighbor-all-descriptors-768x393.jpg 768w\" \u002F>\u003C\u002Ffigure>\u003Cp class=\"wp-block-paragraph\">Now, let’s say you were at the dog park this morning and saw a dog that kind of looked like a poodle but was somehow different. We could ask our AI model to find us the \u003Cem>nearest neighbors\u003C\u002Fem> to poodles:\u003C\u002Fp>\u003Cfigure class=\"wp-block-image aligncenter\">\u003Cimg loading=\"lazy\" decoding=\"async\" width=\"880\" height=\"450\" src=\"\u002Fcdn\u002Fen\u002F2024\u002F06\u002F19183850\u002Fai-nearest-neighbor-relevant-descriptors.jpg\" alt=\"Image of a three-dimensional space of descriptors, focused on a relevant cluster of descriptors, on a green background.\" class=\"wp-image-64832\" srcset=\"\u002Fcdn\u002Fen\u002F2024\u002F06\u002F19183850\u002Fai-nearest-neighbor-relevant-descriptors.jpg 880w, \u002Fcdn\u002Fen\u002F2024\u002F06\u002F19183850\u002Fai-nearest-neighbor-relevant-descriptors-450x230.jpg 450w, \u002Fcdn\u002Fen\u002F2024\u002F06\u002F19183850\u002Fai-nearest-neighbor-relevant-descriptors-768x393.jpg 768w\" \u002F>\u003C\u002Ffigure>\u003Cp class=\"wp-block-paragraph\">Descriptors near the orange dot (our original poodle descriptor) represent standard Poodles, Toy Poodles, and Miniature Poodles. Further out, descriptors represent Labradoodles, Goldendoodles, Cockapoos, and Cavapoos. Descriptors even further out represent various other \u003Cem>water dogs\u003C\u002Fem>. It doesn’t get better than that.\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">Remember those difficult questions we posed at the beginning of this article?\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">Similarly, we could create another AI model where the green dots represent what people like us have purchased, or photos of the Grand Canyon, or musical choices.\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">Many previously impossible tasks can be done thanks to \u003Cem>descriptors\u003C\u002Fem> and \u003Cem>neighbors\u003C\u002Fem>.\u003C\u002Fp>",4,{"url":37,"url_md":38,"alt":39,"height":40,"width":41},"https:\u002F\u002Fwww.canto.com\u002Fcdn\u002Fen\u002F2024\u002F06\u002F19183849\u002Fai-nearest-neighbor-feature.jpg","https:\u002F\u002Fwww.canto.com\u002Fcdn\u002Fen\u002F2024\u002F06\u002F19183849\u002Fai-nearest-neighbor-feature-450x263.jpg","Woman on a laptop looking at relevant nearest neighbor descriptors over an orange background.",700,1200,[43],{"id":44,"slug":44,"title":45,"path":46},"ai","Artificial Intelligence","\u002Fpost-category\u002Fai\u002F",[48,55,62],{"featuredImage":49,"postId":50,"slug":51,"title":52,"description":53,"path":54},"https:\u002F\u002Fwww.canto.com\u002Fcdn\u002Fen\u002F2020\u002F04\u002F19191912\u002Fai-advertising-450x311.jpg",44377,"ai-advertising","The most important ways AI is changing advertising","Artificial intelligence is a growing technological component that has unique benefits for companies. Check out how it's revolutionizing advertisements.","\u002Fblog\u002Fai-advertising\u002F",{"featuredImage":56,"postId":57,"slug":58,"title":59,"description":60,"path":61},"https:\u002F\u002Fwww.canto.com\u002Fcdn\u002Fen\u002F2023\u002F10\u002F19184035\u002Fblog_image-generator_feature.20231026104432112-450x263.jpg",63929,"image-generators","The ultimate guide to the best image generators for content teams","Find out the best free & paid image generators to try out, how they work, tips for use & storage, & the benefits of image generators for content teams in 2024","\u002Fblog\u002Fimage-generators\u002F",{"featuredImage":63,"postId":64,"slug":65,"title":66,"description":67,"path":68},"https:\u002F\u002Fwww.canto.com\u002Fcdn\u002Fen\u002F2024\u002F04\u002F19183910\u002Fai-revolutionizing-visual-search-feature-450x263.jpg",64643,"how-ai-is-revolutionizing-visual-search","Finding the Ollie in the Haystack: Exploring how AI is Revolutionizing Visual Search","Find out how to make even the largest and most complex content libraries instantly searchable using the latest in AI-powered visual search from Canto.","\u002Fblog\u002Fhow-ai-is-revolutionizing-visual-search\u002F",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":70},"\u003Cpath fill=\"currentColor\" d=\"M9.175 10.825Q8 9.65 8 8t1.175-2.825T12 4t2.825 1.175T16 8t-1.175 2.825T12 12t-2.825-1.175M4 20v-2.8q0-.85.438-1.562T5.6 14.55q1.55-.775 3.15-1.162T12 13t3.25.388t3.15 1.162q.725.375 1.163 1.088T20 17.2V20zm2-2h12v-.8q0-.275-.137-.5t-.363-.35q-1.35-.675-2.725-1.012T12 15t-2.775.338T6.5 16.35q-.225.125-.363.35T6 17.2zm7.413-8.587Q14 8.825 14 8t-.587-1.412T12 6t-1.412.588T10 8t.588 1.413T12 10t1.413-.587M12 18\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":72},"\u003Cpath fill=\"currentColor\" d=\"M12 14q-.425 0-.712-.288T11 13t.288-.712T12 12t.713.288T13 13t-.288.713T12 14m-4.712-.288Q7 13.426 7 13t.288-.712T8 12t.713.288T9 13t-.288.713T8 14t-.712-.288M16 14q-.425 0-.712-.288T15 13t.288-.712T16 12t.713.288T17 13t-.288.713T16 14m-4 4q-.425 0-.712-.288T11 17t.288-.712T12 16t.713.288T13 17t-.288.713T12 18m-4.712-.288Q7 17.426 7 17t.288-.712T8 16t.713.288T9 17t-.288.713T8 18t-.712-.288M16 18q-.425 0-.712-.288T15 17t.288-.712T16 16t.713.288T17 17t-.288.713T16 18M5 22q-.825 0-1.412-.587T3 20V6q0-.825.588-1.412T5 4h1V2h2v2h8V2h2v2h1q.825 0 1.413.588T21 6v14q0 .825-.587 1.413T19 22zm0-2h14V10H5z\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":74},"\u003Cpath fill=\"currentColor\" d=\"M12 20a8 8 0 0 0 8-8a8 8 0 0 0-8-8a8 8 0 0 0-8 8a8 8 0 0 0 8 8m0-18a10 10 0 0 1 10 10a10 10 0 0 1-10 10C6.47 22 2 17.5 2 12A10 10 0 0 1 12 2m.5 5v5.25l4.5 2.67l-.75 1.23L11 13V7z\"\u002F>",1789794101775]