1. Introduction
Hyperspectral images (HSIs) consist of tens or hundreds of contiguous narrow spectral bands and provide detailed representations of the physical and chemical properties of land-cover materials. They have therefore been widely used in mineral exploration, environmental monitoring, precision agriculture, disaster assessment, and defense applications [
1]. Hyperspectral target detection (HTD) aims to identify pixels containing materials of interest from complex scenes by exploiting the subtle spectral differences between targets and backgrounds. Recent advances in deep representation learning, Transformers, generative modeling, and joint spectral–spatial analysis have considerably improved HTD performance [
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12]. Nevertheless, real-world targets are often small and may occupy only a fraction of a pixel because of limited spatial resolution, occlusion, spectral variability, illumination changes, atmospheric effects, and background mixing. Consequently, their spectral responses can be severely diluted by surrounding materials, making weak-target representation and background suppression particularly challenging.
Conventional HTD methods generally require one or more predefined target signatures and calculate detection statistics through matched filtering, background modeling, sparse representation, or subspace projection [
1]. Although these methods usually possess clear physical interpretations, their performance strongly depends on the consistency between the reference signatures and the targets observed in the current scene. Laboratory spectra or signatures acquired from other scenes cannot fully represent changes caused by illumination, atmospheric transmission, sensor responses, and material mixing. Deep models improve nonlinear feature representation, but they commonly require accurate target signatures, artificially generated target samples, or pixel-level annotations.
Region-level weak labels can instead be obtained relatively easily from coarse GPS coordinates, field records, or manually selected regions. Multiple-instance learning (MIL) therefore provides an attractive solution for reducing the annotation cost of HTD. With the MIL setting, a positive bag contains at least one target instance, whereas all instances in a negative bag are regarded as background. The exact locations of target instances remain unavailable during training. Recent studies have explored region-level weakly supervised HTD through metric learning, spectral–spatial similarity modeling, weak-label semantic learning, latent target-location inference, and prototype memory [
13,
14,
15,
16,
17]. These studies demonstrate that an instance detector can be learned without precise pixel annotations. However, recovering a reliable pixel-level target distribution from bag-level supervision remains a fundamentally underconstrained problem. Correct bag prediction does not necessarily imply correct identification of the target instances, and instance-level learnability generally requires stronger conditions than bag-level learnability [
18].
More specifically, region-level weakly supervised HTD involves the following three fundamental challenges.
1. The ambiguity between limited bag supervision and reliable instance inference. A positive bag only indicates the presence of at least one target and provides no information about its number, location, or mixing proportion. For a region containing numerous background pixels and only a few weak targets, different instance-response configurations may result in the same bag prediction. Existing methods commonly convert instance confidence scores into hard pseudo-labels. However, fixed thresholds or thresholds derived from within-bag extrema cannot consistently accommodate variations in target size, abundance, and background complexity. Incorrect high-confidence predictions may also be reinforced during alternating optimization, whereas hard binarization discards the confidence and uncertainty information contained in continuous posteriors.
2. Target inference depends on spectral–spatial structures, but these structures are high-order, heterogeneous, and not uniformly reliable. An isolated spectrum is often insufficient for identifying weak targets, necessitating the joint exploitation of local spatial continuity and non-local spectral manifolds. However, existing paradigms face intrinsic limitations under region-level weak supervision: conventional graph neural networks decompose collective multi-pixel (
k-ary) interactions into independent pairwise links, distorting the true manifold topology and rapidly over-smoothing weak target nodes into the background. Meanwhile, Transformer self-attention computes dense pairwise correlations without geometric inductive bias, easily causing attention distraction toward dominant background clutter with severe target dilution and lacking explicit graph Laplacian regularizers (
) for posterior refinement. While hypergraphs resolve these dilemmas by connecting arbitrary numbers of vertices simultaneously [
19] to preserve high-order structures, structural proximity does not strictly imply class consistency. Unconstrained message passing can still suppress subpixel targets or propagate background noise, demanding selective, boundary-aware topology regularization rather than uniform structural propagation.
3. There is a gap between contextual inference and flexible pixel-level deployment. Region-based models can exploit spatial neighborhoods and spectral relationships to improve target localization, but their inference usually requires multiple pixels and reconstructed scene topology. In contrast, single-pixel detectors are more suitable for large-scale scanning, streaming processing, and resource-limited platforms, but they cannot directly access spatial context at test time. A structural regularizer used during training does not itself enable a pixel detector to perceive the topology of a new test scene. Knowledge distillation offers a possible means of transferring contextual knowledge to lightweight hyperspectral models [
20]; however, transferring continuous instance posteriors and their reliability under region-level weak supervision remains insufficiently studied.
To address these challenges, we propose a Spatial–Spectral Topology-Regularized Variational Hypergraph Multiple-Instance Learning Network, termed Hyper-VMIL, for region-level weakly supervised HTD. Hyper-VMIL formulates latent target localization as a variational inference problem and represents each hyperspectral bag using two complementary hypergraphs. A boundary-aware spatial hypergraph organizes local neighborhoods according to two-dimensional coordinates and adjusts their propagation strengths using spectral differences. A dynamic spectral-manifold hypergraph connects spatially separated pixels with similar material characteristics in a learned embedding space. Unlike pairwise representations, each hyperedge can jointly associate an entire spatial patch or a group of spectrally similar instances, thereby capturing high-order spatial and spectral dependencies.
A dual-branch hypergraph neural network is used to parameterize the topology-conditioned mean-field posterior. The spatial and spectral branches propagate node information over their respective hypergraphs and are integrated through node-adaptive gates. The model can thus determine whether local spatial continuity or non-local spectral similarity provides more reliable evidence for each instance. Boundary-aware hyperedge weighting, residual propagation, and adaptive gating are introduced to prevent weak targets from being excessively smoothed into the background. The spatial–spectral hypergraph Laplacian is further incorporated into a regularized variational objective so that latent target posteriors remain consistent over reliable manifolds while preserving target boundaries and isolated target responses.
To mitigate the risk of information loss and error propagation (confirmation bias) often induced by premature hard pseudo-label binarization, we designed a confidence-aware topological posterior refinement mechanism as a principled motivation. Instead of enforcing rigid binary decisions at early optimization stages, the method preserves continuous target probabilities and estimates node-level confidence from posterior uncertainty. The latent target distribution is then refined under posterior-fidelity, spectral–spatial topology, and bag-label consistency constraints, which is intended to prevent ambiguous predictions from being prematurely reinforced as false positive supervision. High-confidence instances mainly retain their original predictions, whereas uncertain instances receive additional evidence from reliable topological neighbors, thereby theoretically limiting uncontrolled error accumulation.
Finally, a topology-teacher and pixel-student learning strategy was developed to bridge contextual inference and flexible deployment. The variational hypergraph network acts as a contextual teacher that estimates continuous instance posteriors from complete bags and their spectral–spatial structures. A pixel-level student detector takes only an individual spectrum as input and learns the teacher’s structured knowledge through confidence-weighted soft supervision, manifold consistency, and spectral perturbation consistency. The student does not directly perceive spatial topology at test time; instead, it learns a spectral decision function that approximates the topology-conditioned posterior. Consequently, Hyper-VMIL supports both a Context Mode, which explicitly constructs test hypergraphs for refined detection, and a Pixel Mode, which provides efficient and flexible single-spectrum inference. The main contributions of this work are summarized as follows:
We propose a topology-regularized variational hypergraph multiple-instance framework that integrates region-level labels, high-order spectral–spatial structures, and instance-level target posteriors within a unified probabilistic learning formulation.
We developed a boundary-aware dual-path hypergraph representation that characterizes local spatial continuity and non-local spectral manifolds. Node-adaptive gating, boundary-sensitive weights, and residual propagation jointly balance structural consistency and weak-target preservation.
We developed confidence-aware continuous posterior refinement and topology-teacher–pixel-student collaborative learning. This strategy is specifically formulated to alleviate information loss and confirmation bias stemming from conventional hard pseudo-labeling, with its empirical effectiveness in stabilizing optimization and preventing error accumulation validated through ablation and dynamic trajectory experiments.
The remainder of this paper is organized as follows.
Section 2 reviews recent studies on weakly supervised HTD, spectral–spatial representation, hypergraph learning, and knowledge distillation.
Section 3 presents the proposed Hyper-VMIL framework and its optimization procedure.
Section 4 reports comparative, ablation, and robustness experiments.
Section 5 concludes the paper.
3. Proposed Method
3.1. Overview and Problem Formulation
Given only region-level annotations, weakly supervised hyperspectral target detection aims to recover pixel-level target responses from bags containing both target and background instances. This problem is highly ambiguous because a positive bag only indicates the existence of at least one target, without revealing its location, number, or abundance. Moreover, weak and mixed targets may be difficult to distinguish from spectrally similar backgrounds when each pixel is considered independently.
To address this problem, as shown in
Figure 1, Hyper-VMIL combines contextual instance inference and deployable pixel detection in a unified framework. It first constructs complementary spatial and spectral hypergraphs to describe high-order relations among pixels. A dual-branch hypergraph network then estimates a topology-conditioned variational posterior over the unknown instance labels. The posterior is further refined in a continuous form according to its confidence, bag-level consistency, and spectral–spatial topology. Finally, the refined contextual knowledge is transferred to a single-spectrum detector, enabling efficient pixel-level inference without requiring a hypergraph at deployment time.
Let the training set be
where
N is the number of bags and
is the region-level label of the
ith bag. Each bag is represented as
where
denotes the spectrum of the
jth pixel,
is its spatial coordinate,
B is the number of spectral bands, and
is the number of instances in the bag.
Under the standard multiple-instance learning assumption,
where
is the unknown instance label. Thus, negative bags provide relatively reliable background information, whereas the target locations within positive bags must be inferred during training.
Hyper-VMIL models the latent instance distribution using a topology-conditioned mean-field posterior:
where
,
denotes the contextual target probability, and
represents the spectral–spatial topology of the bag.
In parallel, a single-spectrum detector produces
In a probabilistic variational inference setting (Empirical Bayes framework), serves as a parameterized empirical spectral prior (or context-free spectral prior). It represents the instance-level target probability conditioned strictly on the individual spectrum prior to incorporating the high-order spatial–spectral hypergraph topology . During training, provides an instance-level spectral prior for variational inference. During testing, can independently evaluate each spectrum without reconstructing the contextual topology. Therefore, represents a context-aware estimate, whereas represents a context-free spectral estimate.
To ground this probabilistic relationship within a rigorous variational inference framework, we formalize region-level weakly supervised HTD as a latent-variable generative model. For a bag
with spatial–spectral hypergraph topology
, the joint generative distribution over the unobserved binary instance labels
and the observed bag label
is factorized as
Under the multiple-instance learning principle with label relaxation
, the bag-level likelihood
conditioned on latent instance labels
is defined by a Bernoulli distribution:
Rather than assuming independent and identically distributed instances, the prior distribution
over latent variables
is formulated as a Hypergraph Markov Random Field (Hypergraph MRF) Gibbs distribution conditioned on the single-spectrum detector
and the dual hypergraph Laplacians
:
where
is the partition function. This Hypergraph MRF prior explicitly anchors the context-free spectral detector
alongside spatial–spectral hypergraph Laplacians
and
, ensuring that spectrally similar and spatially adjacent instances are encouraged to maintain consistent target states prior to contextual variational inference.
3.2. Dual-Path Spatial–Spectral Hypergraph
A target pixel may receive useful evidence from both its local spatial neighborhood and spectrally similar pixels at distant locations. However, these two relations have different meanings and may not always be equally reliable. Hyper-VMIL therefore represents each bag using two complementary hypergraphs:
The spatial hypergraph models local geometric continuity, whereas the spectral hypergraph describes non-local material similarity. Unlike ordinary graphs that connect pairs of nodes, a hyperedge can jointly associate a group of pixels and is therefore suitable for representing spatial patches and spectral-neighbor groups.
3.2.1. Boundary-Aware Spatial Hypergraph
For each center node
c, its
spatially nearest pixels form a hyperedge
. A topology constructed only from coordinates may connect a weak target with many surrounding background pixels. To suppress unreliable cross-boundary propagation, the soft incidence value is defined jointly by spatial distance and spectral difference:
where
denotes the spatial neighborhood of node
c. The coordinate kernel favors local interactions, while the spectral kernel reduces the membership of pixels with strong spectral discontinuities.
It is worth clarifying the fundamental distinction between this formulation and conventional boundary-aware pairwise graph weighting methods. Traditional boundary-aware graphs define scalar affinities over independent dyadic edges (
), which decomposes a local spatial patch into pairwise interactions and discards collective multi-pixel geometry. In contrast, Equation (
10) defines a continuous hyperedge incidence entry
that characterizes the continuous membership degree of node
j within the collective, non-dyadic hyperedge
. With the normalized hypergraph operator
, this formulation enforces a two-stage message-passing mechanism (node-to-hyperedge aggregation followed by hyperedge-to-node broadcast). Consequently, spectrally inconsistent boundary pixels are quadratically attenuated in both aggregation and broadcasting phases, effectively preventing cross-boundary noise leakage while preserving the holistic spatial support of homogeneous interior patches. Furthermore, the resulting hypergraph Laplacian
is directly integrated into the variational objective to penalize topological inconsistency under Bernoulli posterior uncertainty conditions.
3.2.2. Dynamic Spectral-Manifold Hypergraph
The spatial hypergraph cannot directly associate pixels belonging to the same material when they are spatially separated. A spectral hypergraph is therefore constructed in a learned embedding space:
where
is an exponential-moving-average encoder. Its parameters are updated as
where
denotes the online encoder parameters and
m is the momentum coefficient. The slowly varying encoder produces more stable feature neighborhoods than directly using rapidly updated online embeddings.
For each center node, its
nearest neighbors in the embedding space form a spectral hyperedge. The corresponding incidence value is
This topology connects spatially distant pixels with similar material characteristics and complements the local spatial structure. Since the embedding space gradually evolves during training, the spectral hypergraph is reconstructed every R iterations rather than after every gradient update, thereby reducing oscillations in neighborhood assignments.
For either hypergraph, the normalized propagation operator is
where
denotes the soft incidence matrix. The diagonal node-degree matrix
and hyperedge-degree matrix
are explicitly defined by
and
, respectively. Following the standard hypergraph spectral formulation, the hyperedge weight matrix is set to the identity matrix
. The corresponding normalized Laplacian is
3.3. Topology-Conditioned Variational Inference
The spatial and spectral hypergraphs are processed by two independent branches so that their distinct relational properties can be retained. For a hyperspectral bag
with spectral matrix
, the initial node representations are initialized via the online spectral encoder:
. For
, the
lth hypergraph layer is defined as
where
is the contextual transformation matrix and
is a residual projection. The first term aggregates features through hypergraph connectivity, while the residual term retains instance-specific spectral information and reduces over-smoothing. Let
and
denote the final representations of the two branches. Because spatial continuity and spectral similarity may have different reliability for different pixels, they are fused through a node-adaptive gate:
The gate allows the model to emphasize spatial evidence in homogeneous regions and spectral evidence near boundaries or within spatially discontinuous target regions. Here, we collect all learnable parameters of the contextual posterior branch into , where denotes the weights of .
To optimize the parameters
of the topology-conditioned posterior
, evaluating the exact log marginal likelihood
directly is computationally intractable due to the combinatorial summation over
latent states. We therefore construct the Evidence Lower Bound (ELBO) on the marginal log-likelihood as follows:
Equivalence of Term I to
: With the mean-field Bernoulli posterior
, the expectation of the product term in Equation (
7) is evaluated analytically:
Defining the variational bag target prediction as
, the expected log-likelihood expands strictly to
This proves that the bag-level loss is strictly derived from the expected log-likelihood of the variational ELBO.
Equivalence of Term II to Topology Regularization and
: Substituting the Hypergraph MRF prior (Equation (
8)) and the mean-field posterior into the KL divergence term yields
Under the Bernoulli posterior variance expansion with diagonal covariance matrix
, the expected topology terms expand analytically as
Here, the expansion reveals two distinct physical mechanisms: the quadratic term enforces topological smoothness across hypergraph hyperedges by penalizing differences between connected posterior means, whereas the trace term acts as an instance-level variance penalty. Because the diagonal elements of the normalized hypergraph Laplacian are positive (), minimizing this trace term explicitly penalizes instance-level Bernoulli uncertainty, thereby driving the posterior predictions toward confident binary decisions (0 or 1).
3.4. Confidence-Aware Posterior Refinement
Although the variational posterior integrates multiple sources of evidence, some predictions may remain ambiguous because of mixed spectra, noisy embeddings, or imperfect hyperedges. Directly converting into a hard pseudo-label would discard uncertainty and may reinforce early errors. Hyper-VMIL therefore refines the posterior while retaining its continuous probability form.
The confidence of an instance is estimated from normalized Bernoulli entropy:
Predictions near zero or one receive high confidence, whereas predictions near are considered uncertain and can be corrected more strongly.
For each bag, the refined posterior
is obtained by
where
and
is a small positive constant.
It is important to emphasize the functional distinction of Equation (
27) between the training and testing phases. During model training, weak bag labels
are available, and setting
provides a weak bag-level consistency constraint to prevent refined posteriors from drifting away from observed annotations. Conversely, during test-time inference on unseen scenes, ground-truth bag labels
are strictly unavailable. Therefore, for all test evaluations, we strictly set
, removing the term
completely. In this label-free test mode, Equation (
27) functions purely as an unsupervised manifold-regularized probability refinement process.
The first term preserves reliable posterior predictions. The spatial and spectral Laplacian terms provide complementary corrections to uncertain instances, while the final term maintains consistency with the observed bag label. The bag probability associated with the refined posterior is
To solve the constrained convex optimization problem in Equation (
27) efficiently, we employ Projected Gradient Descent (PGD) with analytical gradient evaluation. Denoting the objective in Equation (
27) by
, its exact gradient with respect to
is derived as
where the
j-th entry of the bag loss gradient vector
evaluates analytically to
Starting from the initial contextual posterior
, the refined posterior is updated iteratively over
steps with a fixed step size
using Euclidean projection onto the probability simplex
:
Equation (
27) can be solved using a small number of projected-gradient iterations. Unlike conventional hard pseudo-labeling, the result retains both target probability and uncertainty information. Moreover, the confidence-weighted fidelity term prevents topology regularization from uniformly smoothing all nodes.
While the confidence-weighted fidelity term prevents uniform over-smoothing, entropy-based confidence measures predictive certainty rather than ground-truth correctness. If left unconstrained, an isolated false-positive prediction with high certainty (, ) could receive a large fidelity weight and risk entrenching confirmation bias. In Hyper-VMIL, such confidently incorrect predictions are systematically rectified through two mathematically coupled mechanisms: collective topological overruling and orthogonal spectral prior anchoring.
First, CTPR performs a globally coupled optimization over the entire bag manifold in Equation (
27). When an isolated background pixel
j yields an erroneous high-confidence posterior
, its surrounding spatial neighbors and spectral
k-NN peers within the incident hyperedges remain predominantly background (
). In this setting, maintaining a large refined value
creates steep gradients across incident hyperedges, incurring an extreme quadratic energy penalty
. Because the topological penalty scales quadratically with the discrepancy across all hyperedge members, the collective consensus of the entire hyperedge neighborhood mathematically overrules the single-node fidelity weight
, pulling
back down toward the true background manifold.
Second, the contextual posterior
is strictly anchored to the single-spectrum detector prior
via mode-seeking forward KL divergence in Equation (
23). The detector
evaluates the physical spectrum
on a single-pixel basis, free from spatial neighborhood context. With the zero-forcing property of forward KL divergence (
if
), any spurious contextual activation on a background pixel (
) is heavily penalized during the alternating E-step, forcing
in subsequent GEM iterations and breaking the confirmation bias feedback loop.
3.5. Topology-Teacher and Pixel-Student Learning
The hypergraph posterior uses the complete bag and its spatial–spectral relations and is therefore regarded as a contextual teacher. The single-spectrum detector acts as a pixel student. Since the teacher itself is learned from weak labels, its predictions are not treated as equally reliable ground truth. Instead, the refined posterior is transferred according to its confidence.
The confidence of the refined posterior is
and the confidence-weighted soft supervision is
where
The lower bound plays a vital role in preventing confirmation bias against weakly expressed targets. For heavily mixed or subpixel targets where spectral overlap induces moderate posterior uncertainty (), setting guarantees that genuine target responses retain a non-zero distillation gradient (), preventing faint target features from being completely discarded during student training.
The student is additionally constrained by the original bag labels:
Crucially, the direct bag-level supervision provides an indispensable safety net that prevents the student from unconditionally memorizing incorrect teacher predictions. For negative bags (), enforces , which strictly penalizes all instance responses . Even if the contextual teacher momentarily transfers a false-positive pseudo-label on a negative bag, the loss acts as a hard constraint anchored to the ground-truth weak supervision, directly suppressing student false alarms and preventing error accumulation across M-step optimization.
To transfer structural information during training, the student predictions are regularized over the two hypergraphs:
This regularizer encourages the student decision function to approximate the topology-conditioned teacher along reliable training manifolds. It is used only during training and does not imply that the student directly observes test-scene topology.
We further impose prediction consistency under weak spectral perturbation conditions:
where
is the symmetric Kullback–Leibler divergence between two scalar Bernoulli probabilities
and
, expanding analytically to
The perturbed spectrum is generated via stochastic spectral transformations: zero-mean Gaussian noise injection ∼ with , random band erasure with masking probability , and random global intensity scaling with multiplicative factor ∼.
The complete student objective is
3.6. Optimization and Inference
The overall optimization is formulated as a Generalized Variational Expectation-Maximization (GEM) framework [
31]. Rather than alternating between heuristic discriminative networks, the algorithm alternately optimizes the variational posterior parameters
and the generative student detector parameters
to optimize the regularized ELBO bound. The exact parameter partitioning and gradient update schedule per mini-batch are detailed below:
Variational E-Step (Updating Contextual Posterior
): With the student detector parameters
held fixed, the empirical spectral prior
is evaluated as a detached constant tensor (
). We perform
mini-batch gradient step on teacher parameters
to minimize the negative Evidence Lower Bound (
, derived in Equations (
20)–(
24)) using Adam.
Continuous Posterior Refinement (Solving
): Given the inferred posterior probabilities
as detached inputs, the continuous refined posterior
is solved via
iterations of Projected Gradient Descent (PGD) according to Equation (
32). This step executes non-parametric manifold smoothing on the simplex
without updating any neural network weights.
Generalized M-Step (Updating Single-Spectrum Student
): With teacher parameters
held fixed, the refined posterior targets
and confidence weights
are treated as detached supervision constants (
). We execute
mini-batch gradient step on student detector parameters
to minimize
(Equation (
41)).
EMA Encoder and Hypergraph Updates: Following each mini-batch, the momentum encoder parameters are updated via (). The dynamic spectral-manifold hypergraph is reconstructed every epochs in the 64-D embedding space, ensuring topological stability.
Hyper-VMIL supports two complementary inference modes. In Pixel Mode, only the student detector is used:
This mode requires neither spatial coordinates nor test-scene hypergraph construction and is suitable for fast or resource-constrained deployment.
In Context Mode, spatial and spectral hypergraphs are constructed for the test region, and the refined teacher posterior
is combined with the student prediction
:
where
balances contextual and single-spectrum evidence.
Crucially, to enforce a strictly label-free testing protocol and eliminate any possibility of test-label leakage, posterior refinement during context-mode inference is performed by setting
in Equation (
27). With this setting, the test-time continuous posterior refinement reduces to solving the following unsupervised optimization problem without relying on any test bag annotations:
This optimization relies exclusively on the model’s predicted posterior fidelity, posterior confidence , and the unsupervised spatial–spectral hypergraph Laplacians ( and ) constructed from the test scene.