arXiv:2608.27634cs.LGAug 2026

Manuscript Offprint

arXiv:2608.27634

Curvature-Aware Radius Shrinkage for Adaptive Nearest Neighbor Classification

Alexandre L. M. Levada

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Nearest neighbor classification relies fundamentally on a notion of locality, yet conventional k-NN imposes the same neighborhood cardinality throughout the feature space. This assumption can be inadequate for heterogeneous data whose local geometry varies substantially across the underlying data manifold. We introduce Curvature-Aware Radius Shrinkage for Adaptive Nearest Neighbor Classification (CARSANN), a geometry-driven framework that adapts the spatial support of each neighborhood according to local geometric complexity. CARSANN first estimates the intrinsic dimensionality using TwoNN and constructs an intrinsic representation through principal component analysis. Local mean curvature is then estimated through a shape-operator-based formulation and used to control the neighborhood scale: highly curved regions receive stronger radius shrinkage, whereas approximately flat regions retain broader spatial support. This formulation introduces a distinct mechanism of adaptivity that differs fundamentally from methods that modify only the number of neighbors or the local metric. Extensive experiments on more than 70 real-world classification datasets from OpenML demonstrate that CARSANN substantially improves upon standard k-NN and is competitive with discriminative and curvature-based adaptive nearest-neighbor methods. In a controlled comparison using the same base neighborhood size k=kbasek = k_{base}, CARSANN achieves higher balanced accuracy on 40 of 45 datasets, with the mean balanced accuracy increasing from 0.6506 to 0.7528. The advantage persists when standard k-NN is configured with the fixed value k=5k = 5, for which the mean balanced accuracy increases from 0.6547 to 0.7568. Friedman and Nemenyi tests further confirm that these improvements are statistically significant. Overall, the results provide evidence that local manifold curvature can serve as an effective geometric control variable for determining the spatial extent of neighborhood-based evidence, establishing radius adaptation as a complementary paradigm to cardinality-based adaptive nearest neighbor classification.

1 Introduction

Nearest neighbor methods constitute one of the most fundamental families of nonparametric learning algorithms. Their appeal stems from a simple yet powerful principle: observations that are close to each other in an appropriate feature space are expected to exhibit similar class-conditional behavior. The classical nearest neighbor rule, introduced in the seminal work of Cover and Hart Cover and Hart [1967], requires no explicit parametric model of the underlying data distribution and can therefore accommodate highly nonlinear decision structures. The k-nearest neighbors (k-NN) classifier extends this principle by aggregating the labels of the k closest training observations, providing a simple and interpretable mechanism for controlling the locality of the classification rule. Despite its simplicity, nearest neighbor classification has remained an important reference method in pattern recognition and statistical learning.

A fundamental limitation of standard k-NN, however, is that the neighborhood size is governed by a single global parameter k. This assumption implicitly imposes the same notion of locality throughout the entire feature space, even when the underlying data distribution is strongly heterogeneous. A small value of k produces highly localized decision rules and can preserve fine-scale structures, but at the cost of increased variance and sensitivity to noise and outliers. Conversely, a large value of k reduces variance by aggregating more observations, but may introduce substantial bias by averaging across heterogeneous regions and oversmoothing class boundaries. Thus, the choice of k directly affects the bias–variance tradeoff, the smoothness of the resulting decision boundary, and the robustness of the classifier to local sampling fluctuations. More fundamentally, a globally fixed k does not account for the fact that different regions of the feature space may require different spatial scales for reliable neighborhood-based inference.

This limitation becomes particularly relevant when data exhibit nonuniform density, nonlinear structure, class imbalance, or locally varying geometric complexity. In such situations, the number of observations required to obtain a meaningful local estimate may vary substantially from one region to another. A neighborhood that is appropriate in a locally homogeneous region may be excessively large near a complex decision structure, whereas a neighborhood that is sufficiently conservative near a difficult region may contain too little statistical evidence in a relatively homogeneous region. Consequently, the problem of determining an appropriate neighborhood is not merely a matter of selecting a globally optimal value of k, but rather of defining a notion of locality that adapts to the local structure of the data.

This observation has motivated a broad family of adaptive nearest neighbor methods. Early approaches attempted to determine a different value of k for each query point or training observation. For example, Sun and Huang Sun and Huang [2010a] proposed an adaptive k-nearest neighbor algorithm in which the neighborhood size is determined locally rather than fixed globally. Such methods recognize that the optimal neighborhood cardinality may vary throughout the feature space and therefore seek to replace the global parameter k by a locally determined quantity. More generally, adaptive nearest neighbor methods can be interpreted as attempts to establish a spatially varying scale of locality, thereby reducing the mismatch between a globally fixed neighborhood and heterogeneous data distributions.

A more geometric and discriminative perspective was introduced by Hastie and Tibshirani through the Discriminant Adaptive Nearest Neighbor (DANN) classifier Hastie and Tibshirani [1996]. Rather than merely changing the number of neighbors, DANN estimates a local discriminative metric using linear discriminant information. The resulting metric modifies the geometry of the neighborhood by shrinking it in directions approximately orthogonal to local decision boundaries and elongating it along directions parallel to those boundaries. Thus, DANN can be viewed as adapting the local metric tensor according to class-discriminative information. This formulation represents an important conceptual transition from selecting a neighborhood cardinality to modifying the geometry of the neighborhood itself.

More recent approaches have explored the intrinsic geometry of the data as a source of information for neighborhood adaptation. In particular, Levada, Nielsen, and Haddad Levada et al. [2024a] proposed the curvature-adaptive k-nearest neighbor classifier, denoted kK-NN, which estimates local Gaussian curvature through a shape-operator-based construction and uses this geometric quantity to determine the local number of neighbors. The underlying intuition is that low-curvature regions admit a larger approximately linear neighborhood, whereas high-curvature regions should be treated more locally because the tangent approximation becomes less accurate. The resulting classifier therefore adapts the neighborhood cardinality according to local manifold geometry. Experiments reported by the authors show that curvature-based adaptation can improve balanced accuracy over conventional k-NN and other adaptive nearest neighbor approaches, particularly in settings with limited training data Levada et al. [2024a].

The progression from classical k-NN to adaptive nearest neighbor methods suggests an important distinction between different mechanisms for controlling locality. Standard k-NN uses a globally fixed neighborhood cardinality. Classical adaptive k-NN methods allow the cardinality to vary across observations. DANN goes one step further by modifying the local metric according to discriminative structure. The kK-NN method introduces differential geometry into this framework by adapting the neighborhood cardinality according to local curvature. These approaches are closely related, but they address different aspects of the neighborhood-selection problem.

In this work, we argue that an alternative and complementary perspective is to adapt not the number of neighbors itself, but the spatial extent of the neighborhood. This distinction is central to the proposed method. Rather than asking how many observations should be included around a query point, we ask how far from that point local evidence should be allowed to influence the classification decision. This leads to a radius-based formulation in which the effective support of the neighborhood is explicitly contracted or preserved according to local geometric complexity. We refer to this mechanism as radius shrinkage.

The proposed approach is motivated by the manifold hypothesis, according to which high-dimensional observations may concentrate near a lower-dimensional structure embedded in the ambient feature space. In high-dimensional datasets, the ambient dimension may therefore substantially overestimate the number of degrees of freedom required to describe the local data geometry. This distinction is particularly relevant for curvature estimation, because reliable local geometric estimation becomes increasingly difficult as the ambient dimension increases. Consequently, before estimating local curvature, we seek to identify a lower-dimensional representation that better reflects the intrinsic structure of the data.

To this end, the proposed framework follows the following geometric pipeline:

ambient dimension → intrinsic dimension → intrinsic representation

→ local curvature → adaptive radius → classification

(1)

The first stage estimates the intrinsic dimensionality of the dataset using the Two-NN estimator introduced by Facco et al. [2017]. Two-NN exploits the statistics of the distances to the first and second nearest neighbors and provides an estimate of the intrinsic dimension using minimal local neighborhood information. This estimate is subsequently used to determine the dimensionality of the representation on which local geometric quantities are computed. In particular, principal component analysis (PCA) is employed to obtain an intrinsic-dimensional representation of the observations. This step is not introduced merely as a computational preprocessing operation; rather, it defines the geometric space in which local curvature is subsequently estimated.

Let dd denote the estimated intrinsic dimension. The original observations xi∈Rm\mathbf{x}_i \in \mathbb{R}^m, where mm is the ambient dimension, are mapped to

zi∈Rd,d≪m,(2)\mathbf{z}_{i}\in\mathbb{R}^{d},\qquad d\ll m, \tag{2}

whenever the data exhibit a substantially lower intrinsic dimension. Local geometric information is then extracted from the resulting representation. Specifically, the local curvature at each observation is estimated using a shape-operator-based formulation. The curvature provides a scalar characterization of the local geometric complexity of the data support and is subsequently used to determine the appropriate spatial scale of the neighborhood.

The key hypothesis underlying our approach is that the appropriate spatial scale of local aggregation should depend on the geometric complexity of the region surrounding the query point. In a locally flat region, the tangent space provides a good approximation of the data manifold over a relatively broad neighborhood. Aggregating evidence from a larger spatial region can therefore provide a more stable estimate of the local class distribution. In contrast, in a highly curved region, the tangent approximation deteriorates more rapidly as the neighborhood expands. Including increasingly distant observations may consequently mix samples belonging to geometrically distinct local configurations and may blur relevant class distinctions. We therefore associate larger curvature with stronger radius shrinkage and smaller curvature with weaker shrinkage.

Let ri(0)r_i^{(0)} denote a reference radius associated with the query point xix_i. In our formulation, this reference radius is obtained from a baseline nearest-neighbor neighborhood, with the initial neighborhood size determined as k0=log⁡2(n)k_0 = \log_2(n), where nn is the number of training observations. A curvature-dependent shrinkage function is then applied to obtain an effective radius

ri=s(κi)ri(0),(3)r_{i}=s(\kappa_{i})r_{i}^{(0)}, \tag{3}

where κi\kappa_i denotes the local curvature and s(⋅)s(\cdot) is a monotone nonincreasing shrinkage function. Consequently, high-curvature observations receive smaller effective neighborhoods, whereas low-curvature observations retain a radius close to the reference neighborhood. Classification is finally performed using the training observations contained within the curvature-adapted radius.

This formulation leads to a useful geometric taxonomy of adaptive nearest neighbor methods. Standard k-NN determines a globally fixed neighborhood cardinality and therefore imposes a global notion of locality. Generic adaptive k-NN methods allow the neighborhood cardinality k to vary spatially. DANN adapts the local metric tensor using discriminant information, thereby modifying the shape and orientation of the neighborhood Hastie and Tibshirani [1996]. The kK-NN classifier adapts the neighborhood cardinality using local curvature Levada et al. [2024a]. In contrast, the proposed CARSANN classifier adapts the radius of the neighborhood support using a geometric measure of local complexity. This distinction can be summarized as

k-NN : global neighborhood cardinality,

adaptive k-NN : local neighborhood cardinality,

DANN : local metric geometry from discriminative information,

(4)

kK-NN : local neighborhood cardinality from curvature,

CARSANN : local neighborhood radius from curvature.

The distinction between cardinality adaptation and radius adaptation is particularly important. Although the two mechanisms are related, they need not produce equivalent neighborhoods. Changing k determines how many observations are retained, whereas changing the radius determines the spatial extent within which observations are considered relevant. In heterogeneous datasets, these two notions of locality can differ substantially because the same number of observations may occupy very different spatial volumes depending on local density. The proposed method therefore provides a complementary mechanism for adaptive neighborhood selection: rather than directly optimizing the number of neighbors, it controls the spatial scale over which local evidence is aggregated.

The contributions of this work are therefore fourfold. First, we introduce a curvature-aware radius shrinkage mechanism for nearest neighbor classification that explicitly adapts the spatial support of local decisions according to geometric complexity. Second, we propose an intrinsic-dimension-aware preprocessing strategy in which TwoNN is used to estimate the effective dimensionality of the data and PCA subsequently constructs an intrinsic representation for local geometric estimation. Third, we establish a conceptual distinction between curvature-based adaptation of neighborhood cardinality, as in kK-NN, and curvature-based adaptation of neighborhood radius, as proposed here, thereby introducing a new geometric degree of freedom for adaptive nearest neighbor classification. Fourth, we conduct an extensive empirical evaluation against standard k-NN and representative adaptive and geometry-aware alternatives, demonstrating that radius adaptation can provide substantial and statistically significant improvements in classification performance across heterogeneous real-world datasets.

The remainder of this paper is organized as follows. Section 2 presents some related work on adaptive nearest neighbor classification and geometric approaches to neighborhood selection. Section 3 introduces differential geometry fundamentals and intrinsic-dimensional representation based on the TwoNN algorithm. Section 4 presents the local curvature estimation procedure in details. Section 5 describes the proposed curvature-aware radius shrinkage adaptive nearest neighbor classifier (CARSANN). Section 6 presents the experimental protocol and discusses the obtained results. Finally, Section 7 concludes the paper and discusses directions for future research.