[2/2] KNN classifier (lands dataset)

For the KNN classifier on the lands dataset, this automated workflow classifies satellite imagery by analyzing image URLs. It retrieves embeddings from the Voyage.ai API, queries Qdrant for similar images, and employs majority voting to determine the most likely land type. In cases of ties, it iteratively increases the number of neighbors considered, ensuring accurate classification. Achieving a classification accuracy of 93.24% on test data, this tool effectively identifies land types such as 'forest', 'beach', and 'agricultural', streamlining the process of land use analysis.

7/8/2025
18 nodes
Complex
qn7etptcmdcgipksmanualcomplexsticky noteexecuteworkflowtriggeradvancedapiintegrationlogicconditional
Categories:
Complex WorkflowManual TriggeredBusiness Process Automation
Integrations:
Sticky NoteExecuteWorkflowTrigger

Target Audience

Target Audience


- Data Scientists: Those looking to implement image classification in their projects.
- Machine Learning Engineers: Professionals wanting to integrate KNN classifiers into existing systems.
- Researchers: Individuals studying land use and satellite imagery.
- Developers: Software developers interested in using APIs for image processing and classification.
- Business Analysts: Analysts seeking to understand land types from images for business insights.

Problem Solved

Problem Solved


This workflow addresses the challenge of classifying satellite imagery into various land types, such as agricultural, residential, and forest areas. It automates the process of querying a database for similar images and determining the most likely class through majority voting, effectively handling ties by adjusting the number of neighbors considered. This results in accurate classification of images based on their visual content.

Workflow Steps

Workflow Steps


1. Receive Image URL: The workflow begins with the Execute Workflow Trigger, which accepts an image URL as input.
2. Embed Image: The image URL is sent to the Voyage.ai Multimodal Embeddings API to generate an embedding vector.
3. Query Qdrant: The embedding is used to query the Qdrant database, retrieving the nearest neighbors based on similarity.
4. Majority Vote: The classes of the retrieved images are analyzed, and a majority vote is conducted to determine the most frequent class.
5. Check for Ties: If there is a tie in votes, the number of neighbors queried is increased, and the process is repeated until a conclusive result is obtained or a limit of 100 neighbors is reached.
6. Return Class: Finally, the identified class is returned as the output of the workflow.

Customization Guide

Customization Guide


- Change Image Source: Users can modify the Execute Workflow Trigger to accept images from different sources or formats.
- Adjust Neighbor Limit: The limitKNN variable can be customized to control how many nearest neighbors to consider during classification.
- Modify Qdrant Collection: Update the Qdrant variables section to point to a different collection of images or a different Qdrant instance.
- API Credentials: Ensure that the Voyage API and Qdrant API credentials are updated to match your accounts.
- Embedding Model: Users can experiment with different embedding models by changing the model parameter in the Embed image node.