Papers
Topics
Authors
Recent
Search
2000 character limit reached

Class-Mean Features (CMF) Classifier

Updated 3 July 2026
  • The Class-Mean Features (CMF) classifier is a method that computes class centroids as decision anchors using normalized mean vectors.
  • It employs techniques like minimum-distance normalization and closed-form linear solutions to boost fine-grained recognition, few-shot learning, and machine unlearning.
  • CMF classifiers support drift detection and self-training through stable prototype-based architectures, achieving notable accuracy and efficiency improvements.

The class-mean features (CMF) classifier is a broad family of classification approaches in which the prototype or centroid of each class—computed as the mean of input features or latent embeddings for that class—serves as the explicit anchor for decision-making. CMF classifiers arise in both classical pattern recognition and contemporary deep learning, with applications spanning representation analysis, fine-grained recognition, few-shot learning, machine unlearning, and monitoring of distributional drift.

1. Mathematical Foundations and Core Algorithms

At the core of CMF classification lies the computation of the class mean vector. For a dataset with KK classes, define XcX_c as the set of feature vectors belonging to class cc. The class mean is

μc=1∣Xc∣∑x∈Xcx.\mu_c = \frac{1}{|X_c|} \sum_{x \in X_c} x.

Classification can proceed by assigning an input xx to the class whose mean μc\mu_c is closest to xx under a chosen metric, typically Euclidean distance or cosine similarity.

Two primary techniques for generating last-layer weights from class means are:

  • Minimum-distance normalization ("min-dist"): wc=μc/∥μc∥2w_c = \mu_c / \|\mu_c\|_2, associating each class with a normalized mean direction.
  • Closed-form linear solution: W=(XX⊤+ϵI)−1CW = (XX^\top + \epsilon I)^{-1} C, where XX stacks all input vectors and XcX_c0 stacks class sums, yielding explicit weights without iterative optimization (Wong, 2019).

In deep models, CMFs are typically computed in the latent space after pooling, and used as either direct classifier weights or as prototypes for nearest-centroid decision rules.

2. CMF in Representation Learning and Fine-Grained Classification

Fine-grained recognition leverages class-mean feature modules to exploit inter-class relationships. The Categorical Memory Network (CMN) integrates an external memory matrix XcX_c1, with each row XcX_c2 storing the class-XcX_c3 prototype as a moving average: XcX_c4 where XcX_c5 is the feature representation of XcX_c6, and XcX_c7 the memory update coefficient (e.g., XcX_c8) (Deng et al., 2020).

For a query, similarities XcX_c9 are computed and normalized by softmax with temperature cc0, producing an attention vector cc1. The response feature is

cc2

A combined feature cc3 is then classified by a learned linear layer. This results in enhanced discriminative power and has been empirically validated to improve accuracy by 2.4--3.8% on fine-grained benchmarks relative to conventional CNNs, with minimal computational overhead (Deng et al., 2020).

3. Machine Unlearning and Representation Alignment

CMF classifiers are pivotal in recent machine unlearning work, particularly for enforcing feature-classifier alignment and evaluating true representational forgetting. In the context of frozen feature extractors cc4, the CMF classifier head is constructed as: cc5 The classifier weight matrix cc6 aligns precisely with class means at every epoch (Gao et al., 9 Apr 2026).

During unlearning, the head is rebuilt from current means after each update to prevent the output-level "forgetting" achieved via merely misaligning weights. This approach enforces that genuine representation-level forgetting occurs in the feature extractor itself. Empirical evaluations show CMF-driven unlearning can reduce feature-level recoverability (measured via linear probes or nearest-centroid classification) by 20--30 percentage points, in contrast to conventional output-flipping, which leaves feature discriminability essentially intact (Gao et al., 9 Apr 2026).

4. CMF Approaches in Few-Shot and Meta-Learning Contexts

In few-shot and almost zero-shot meta-learning, class-mean prototypes provide compact task priors. For a task cc7 with a support set cc8, the mean embedding for class cc9 is

μc=1∣Xc∣∑x∈Xcx.\mu_c = \frac{1}{|X_c|} \sum_{x \in X_c} x.0

Classification on the query set is typically performed via nearest centroid in embedding space: μc=1∣Xc∣∑x∈Xcx.\mu_c = \frac{1}{|X_c|} \sum_{x \in X_c} x.1

The Canonical Mean Filter (CMF) module [Editor's term: "Canonical Mean Filter" refers to the adaptive mean-stabilization architecture of (Li et al., 2022)] enhances stability by mapping arbitrary support sets into canonical prototypes using channel-wise scaling via learned attention extracted at each layer. After training, the method permits removing the CMF and adaptation networks, yielding a 40.48% parameter reduction at test time without sacrificing, and at times improving, accuracy across Meta-Dataset domains (Li et al., 2022). CMF drastically reduces within-class variance (e.g., threefold for QuickDraw) while preserving inter-class separation.

5. Self-Monitoring, Drift Detection, and Self-Training

Class means serve as stable anchors for model monitoring and adaptation in unlabeled settings. The E-Marker algorithm computes the discrepancy between training and test class means: μc=1∣Xc∣∑x∈Xcx.\mu_c = \frac{1}{|X_c|} \sum_{x \in X_c} x.2 where μc=1∣Xc∣∑x∈Xcx.\mu_c = \frac{1}{|X_c|} \sum_{x \in X_c} x.3 is the center of predicted class μc=1∣Xc∣∑x∈Xcx.\mu_c = \frac{1}{|X_c|} \sum_{x \in X_c} x.4 in the unlabeled batch and μc=1∣Xc∣∑x∈Xcx.\mu_c = \frac{1}{|X_c|} \sum_{x \in X_c} x.5 the training mean. The overall E-Marker μc=1∣Xc∣∑x∈Xcx.\mu_c = \frac{1}{|X_c|} \sum_{x \in X_c} x.6 tracks model drift; exceeding a threshold signals the need for model retraining or upstream intervention (Wong, 2019).

For self-training, pseudo-gradients defined by

μc=1∣Xc∣∑x∈Xcx.\mu_c = \frac{1}{|X_c|} \sum_{x \in X_c} x.7

adjust classifier weights based on the soft assignment of predictions on unlabeled data, facilitating closed-form or few-step semi-supervised learning (Wong, 2019).

6. Theoretical Context: Optimality and Neural Collapse

Under Gaussian class-conditional assumptions with shared covariance, the Bayes-optimal linear discriminant depends solely on class means, providing statistical justification for CMF classifiers (Wong, 2019).

Neural collapse phenomena observed in deep networks (Gao et al., 9 Apr 2026) further motivate CMF-based designs. At the collapse point, (1) intra-class features concentrate at their means; (2) the centered class means form a simplex equiangular tight frame; (3) last-layer weights align with these means; and (4) the classifier is equivalent to the nearest-centroid rule. CMF classifier heads directly encode this structure by re-centering and normalizing means at every update. This enforces ongoing alignment and eliminates the feature-classifier misalignment loophole exploited in naive unlearning.

7. Practical Considerations, Computational Properties, and Limitations

The computational expense of mean feature computation is μc=1∣Xc∣∑x∈Xcx.\mu_c = \frac{1}{|X_c|} \sum_{x \in X_c} x.8, and classifier construction via minimum-distance normalization is μc=1∣Xc∣∑x∈Xcx.\mu_c = \frac{1}{|X_c|} \sum_{x \in X_c} x.9 for xx0 classes in xx1-dimensional space. For the closed-form linear moment-matching variant, the requirements are xx2 for matrix inversion and xx3 storage for feature matrices. CMF classifiers are memory-efficient, requiring only xx4 mean vectors and, optionally, xx5 covariance structures (Wong, 2019).

While CMF classifiers offer closed-form solutions, robust drift detection, and self-training capabilities, their linearity limits their efficacy for nonlinearly-separable classes unless deep embeddings or kernelizations are introduced. Sensitivity to feature scaling and the lack of explicit modeling of class covariances also constrain their practical range. However, integration with deep feature extractors and meta-learning architectures overcomes many of these issues, enabling application to modern representation learning, meta-learning, and unlearning scenarios (Deng et al., 2020, Gao et al., 9 Apr 2026, Li et al., 2022).

Method / Paper Core CMF Formulation Distinctive Trait
(Wong, 2019) Classical mean vector, linear weights Direct weight computation, drift detection, self-training
(Deng et al., 2020) Memory module with moving prototype Attention-weighted feature augmentation for fine-grained recognition
(Gao et al., 9 Apr 2026) Centered and normalized means, strict head-feature alignment Enforces true unlearning at the representation level
(Li et al., 2022) CMF as channel-wise adaptive filter Stable prototypes, parameter-efficient meta-learning

Empirical results across these studies confirm that CMF classifiers, despite simplicity, provide a versatile and theoretically robust core for a wide range of modern machine learning problems.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Class-Mean Features (CMF) Classifier.