A Two-Stage Active Learning Algorithm for k-Nearest Neighbors

Nick Rittler, Kamalika Chaudhuri

Abstract

$k$-Nearest Neighbor ($k$-NN) classification is a fundamental non-parametric method, yet it has historically been difficult to integrate with active learning (AL) frameworks. This paper introduces a novel two-stage active learning algorithm for $k$-NN that maintains the traditional local voting mechanism while achieving faster asymptotic convergence to the Bayes optimal classifier. By identifying "hard" regions of uncertainty in an initial exploration phase and focusing labeling efforts there in a refinement phase, the proposed method reduces label complexity without sacrificing the model's inherent adaptivity.

Introduction

Active learning (AL) aims to minimize the number of labeled examples required to achieve a target performance level by strategically selecting the most informative data points. While effective for parametric models like neural networks, applying AL to non-parametric models like $k$-NN presents unique challenges. Because $k$-NN relies on local density, it is difficult to determine which unlabeled points are informative without prior knowledge of their neighborhood's labels. Previous attempts often compromised the $k$-NN voting process or lacked consistency guarantees. This work addresses these gaps by proposing a scheme that retains the local voting mechanism while providing rigorous theoretical guarantees.

Methodology: The Two-Stage Approach

The proposed algorithm operates in two distinct phases to optimize the labeling budget:

  1. Stage 1 (Exploration): The learner performs passive sampling, drawing a set of samples randomly from the distribution. These samples are used to construct an initial $k$-NN estimate to identify the "Estimated Hard Region"—areas where the class probability is near 1/2 and the decision boundary likely resides.
  2. Stage 2 (Refinement): The remaining budget is allocated to an augmented version of this hard region. Rejection sampling is employed to ensure labels are only requested for points within these high-uncertainty zones.
Comparison of Passive sampling versus the two-stage Active Learning process. Stage 1 (Round 1) identifies the boundary, while Stage 2 (Round 2) densifies samples in the "hard region."

At prediction time, the model uses a modified $k$-NN rule: test points in the "hard region" utilize the high-density Stage 2 samples for precision, while points in "easy regions" rely on the initial Stage 1 samples.

Theoretical Insights

The algorithm's performance is grounded in several key theoretical conditions:

  • Smoothness: The success of the active learner depends on the Hölder continuity of the conditional probability function. Smoothness allows the learner to reliably infer information about neighboring regions.
  • Tsybakov Noise Condition: The algorithm is particularly effective when the "margin" around the decision boundary is small. In such scenarios, the active learner can ignore "easy" regions significantly faster than a passive learner.
  • Region Augmentation: A critical technical component is the use of an augmented hard region. By sampling a slightly broader area than the immediate zone of uncertainty, the algorithm ensures that the $k$-nearest neighbors for any point in the hard region are likely drawn from the high-density Stage 2 sample, thereby preventing estimation bias.

Results and Consistency

The authors provide mathematical proofs demonstrating that the two-stage active learner converges to the Bayes optimal classifier at a significantly faster asymptotic rate than standard passive $k$-NN. Furthermore, the algorithm is shown to be "Generally Consistent," meaning it will eventually reach the Bayes-risk even if initial smoothness assumptions are not perfectly met, provided the sample size is sufficiently large. Unlike many theoretical works, this paper also offers finite sample guarantees, making the results applicable to practical engineering constraints.

Limitations and Future Directions

While theoretically robust, the algorithm introduces hyperparameters, such as the hard region threshold and augmentation factor, which may require careful tuning. Additionally, the reliance on rejection sampling in Stage 2 can become computationally intensive if the hard region constitutes a very small fraction of the total instance space. Future research may explore adaptively modifying the value of $k$ across different regions of the instance space to further enhance efficiency.

Summary updated

BibTeX
@inproceedings{rittler2023two,
  author = {Nick Rittler and Kamalika Chaudhuri},
  title = {{A Two-Stage Active Learning Algorithm for k-Nearest Neighbors}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=UOyczqYEU7},
}
Figure