[2/2] KNN Classifier (Lands Dataset)

This workflow is based on the K-nearest neighbors algorithm and implements the automatic classification of satellite land type images. Users only need to provide the image URL, and the workflow will generate a vector representation of the image, query the vector database for the most similar images, and conduct a voting process to determine the land type. The workflow has designed a mechanism to handle voting ties, ensuring the stability of the classification results, with an accuracy rate of up to 93.24%. It is suitable for remote sensing image analysis, geographic information systems, and large-scale land type identification, among other fields.

Workflow Diagram
[2/2] KNN Classifier (Lands Dataset) Workflow diagram

Workflow Name

[2/2] KNN Classifier (Lands Dataset)

Key Features and Highlights

This workflow implements an automatic classification of satellite land cover images based on the K-Nearest Neighbors (KNN) algorithm. Upon receiving an image URL as input, it leverages Voyage AI’s multimodal embeddings API to generate a vector representation of the image. Subsequently, it queries the Qdrant vector database to retrieve the most similar neighboring images and applies majority voting to determine the land cover category of the input image. To address tie situations in voting, the workflow incorporates a loop mechanism that dynamically increases the number of neighbors until a clear classification is achieved or a maximum neighbor limit is reached. The model achieves a high accuracy of 93.24% on the test set without requiring additional tuning.

Core Problems Addressed

  • Rapid and accurate automatic classification of satellite land cover images
  • Robust handling of tie votes in neighbor classification to ensure stable and reliable results
  • Efficient similarity search by combining deep learning-based image embeddings with a vector database

Application Scenarios

  • Satellite remote sensing image analysis and land use monitoring
  • Automated classification and annotation within Geographic Information Systems (GIS)
  • Large-scale land cover identification for environmental monitoring, urban planning, and related fields
  • Any image content-based classification tasks, especially multi-class visual recognition problems

Main Workflow Steps

  1. Receive the input image URL via a trigger.
  2. Call the Voyage AI multimodal embeddings API to convert the image into a vector embedding.
  3. Initialize query parameters and perform a KNN search in the Qdrant cloud vector database based on the embedding.
  4. Retrieve neighboring images along with their pre-labeled category information.
  5. Conduct majority voting by counting the frequency of neighbor categories.
  6. If a voting tie occurs and the number of neighbors is below 100, increment the neighbor count and repeat the query and voting process.
  7. Return the final determined land cover category label for the input image.

Involved Systems and Services

  • Voyage AI Multimodal Embeddings API: Generates deep vector representations of images.
  • Qdrant Cloud: Vector database storing labeled image embeddings, supporting efficient KNN similarity search.
  • n8n Automation Platform Nodes: Includes HTTP requests, code execution, conditional logic, and variable management nodes.

Target Users and Value

  • Data scientists and machine learning engineers seeking to quickly build vector search-based image classification services.
  • Remote sensing analysts and GIS professionals aiming for automated land cover recognition and classification.
  • Environmental agencies and urban planners looking to enhance monitoring efficiency and automate data processing.
  • Developers and automation enthusiasts leveraging the n8n platform to easily construct complex AI application workflows.

This workflow template features a clear structure and flexible customization options, allowing users to replace datasets and parameters. It serves as an excellent practical example of integrating modern AI embedding techniques with vector databases for diverse image classification tasks.