Next Article in Journal
A Quarter Century of MODVOLC Time-Averaged Discharge Rates: Assessing Four Largest Flank Eruptions on Mount Etna, and Selected Events on Other Basaltic Volcanoes
Previous Article in Journal
Machine-Learning-Based Historical Reconstruction of Soil Organic Carbon Dynamics in Coastal Tidal Flats: Quantifying the Spatiotemporal Impacts of Reclamation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Rethinking Data Leakage in Patch-Based Hyperspectral Image Classification with Traditional Deep Networks

1
School of Information Engineering, Jiangxi Science and Technology Normal University, Nanchang 330038, China
2
Jiangxi Provincial Key Laboratory of Advanced Electronic Materials and Devices, Jiangxi Science and Technology Normal University, Nanchang 330038, China
*
Author to whom correspondence should be addressed.
Remote Sens. 2026, 18(7), 979; https://doi.org/10.3390/rs18070979
Submission received: 2 March 2026 / Revised: 21 March 2026 / Accepted: 23 March 2026 / Published: 25 March 2026
(This article belongs to the Section Remote Sensing Image Processing)

Highlights

What are the main findings?
  • Patch-based hyperspectral image classification suffers from train–test pixel overlap, causing data leakage and overly optimistic performance.
  • Replacing Overlapping Pixels (ROP) eliminates leakage in patch data, and the proposed RDLNet with MFEF achieves strong and robust accuracy on five public HSI datasets with 30 samples per class.
What are the implications of the main findings?
  • Reported state-of-the-art results under random patch sampling may be inflated; leakage-controlled evaluation is necessary for fair comparison.
  • The proposed replacing overlapping pixels (ROP) strategy provides a practical leakage-free patch reconstruction for benchmarking HSI classifiers and can be extended to other patch-based remote sensing tasks.

Abstract

The application of hyperspectral image (HSI) processing techniques has become increasingly important in many fields such as agriculture, environmental detection, and mining. However, the number of annotated samples in existing hyperspectral datasets is limited, and most hyperspectral classification models typically use patch data for model training. There, the pixels to be classified are often taken as the center, and then a mean pixel length is calculated from the surrounding pixel neighborhood to form patch data. However, during model training, the researchers found that there was an area of overlapping pixels between most of the training data and the test data. This inevitably led to data leakage, resulting in excellent classification performance of the model. To solve this problem, we develop a method of replacing overlapping pixels (ROP) in patch data, which means the training pixel points of the same class are used to replace the test pixel points that appear in the overlapping region of the training patch data. Furthermore, a multiple feature extraction and fusion (MFEF) module is also proposed to enhance the capacity of the HSI model to extract spectral–spatial feature information from new patch data. The results on five publicly available HSI datasets demonstrate that the proposed resolving data leakage network (RDLNet) can provide competitive classification results on the patch data reconstructed with the ROP strategy, which outperforms existing state-of-the-art (SOTA) classification methods as well.

1. Introduction

Hyperspectral images, captured by satellites or onboard devices, can capture the data of a wide range of wavelengths [1]. Unlike the other sensors that have been used for Earth observation, like infrared and synthetic aperture radar (SAR) [2,3,4], hyperspectral images can capture data in hundreds of narrow spectral bands. In addition, compared to other forms of remote sensing image data, HSI data have different materials that can reflect different light on the electromagnetic spectrum. So, with HSI data, the Earth’s surface can be analyzed more accurately. For this reason, the technology of HSI image processing has been used in various areas, such as land cover analysis, precision agriculture [5], mineral exploration [6,7], and deep space exploration [8].
Particularly, HSI classification (HSIc) has emerged as a highly active area of research within the field of hyperspectral research. For the HSIc system models, the workflow mainly includes three steps: image restoration, feature extraction, and species classification [9]. In the pre-processing stage of HSIc, especially when dividing the training and test sets, the models in the form of input data can be roughly classified into three categories: single-pixel-based HSIc models, patch data-based HSIc models, and whole image-based HSIc models. The single-pixel-based models are the Support Vector Machines (SVMs) [10] and the Random Forest Algorithms (RFs) [11]. With the advent of Deep Learning (DL), the convolutional neural network (CNN) architecture has been widely used in image classification algorithms. In conjunction with the theory that HSI consists of multiple continuous and interconnected spectral channels, Hu [12] proposed a one-dimensional convolutional neural network (1DCNN) classifier to capture local feature relationships between adjacent spectral channels to explain the correlation of local spectral channels in HSI.
The patch-based model is more frequently utilized for HSIc, due to the fact that hyperspectral images comprise not only spectral feature information, but also rich spatial feature information. Du [13] proposed a 2DCNN because of its robust feature extraction ability and effective extraction of spatial feature information by using the convolution operation and weight sharing. The 3DCNN architecture is able to extract both local spatial and spectral feature information, simultaneously [14,15]. Chen et al. [16] developed an indeterminate element model based on a 3DCNN architecture, which enhances the classification accuracy by incorporating local context information of high-spatial resolution images and semantic extraction of spatial-spectral features. Li et al. [14] proposed an HSI classification method based on 3DCNN that did not require pre- and post-processing, which effectively extracted the spatial combination features of the depth spectrum. He et al. [17] developed the M3D-DCNN model for HSIc, which enabled the joint modeling of multiple spectral bands and facilitated the integration and fusion of multiple features at different scales. In addition, hybrid architectures, such as HybridSN [18], combine 3D convolutional neural networks (CNNs) for local feature extraction with 2D CNNs for broader spatial modeling, demonstrating promising performance in hyperspectral image (HSI) classification. Building on this concept, several studies have further investigated 2D-3D fusion strategies. For example, Ran et al. [19] developed the Spectral–Spatial Residual Network (SSRN), which employs a hierarchical design that utilizes 3D convolutions for initial feature extraction, followed by 2D residual blocks to capture multi-level representations. Feng et al. [20] created a hybrid convolutional neural network known as OCT-MCNN, which integrates 3D octave convolutions with 2D vanilla convolutions specifically for HSI classification. Additionally, the MDGCN framework [21] effectively combines 3D CNNs with graph-based contextual modeling.
The visual transformer (ViT) [22] has achieved advanced results in a range of visual tasks in the field of vision, providing new solutions and creative ideas for vision-related tasks. However, recent state-space models like Mamba [23] have shown potential in modeling long-range dependencies with linear complexity, offering a new perspective beyond Transformers. By introducing the transformer [24], spatial and spectral information are effectively integrated through the self-attention mechanism, which improves the understanding of the comprehensive feature classification model and the correlation of global information. For example, Sun et al. [25] devised a Transformer-based integration of 2D and 3D CNN for HSIc. In addition, the mechanism of self-attention enables the interaction between the channels and other positions of each spectrum, which facilitates the adaptive learning of feature relationships. In addition to standard self-attention, specialized mechanisms tailored for HSI have recently been proposed to better exploit local spatial contexts within patches. For instance, the multiarea target attention (MATA) [26] extracts multiscale spatial information from different neighborhood regions to accommodate varying target sizes, while the central attention network (CAN) [27] emphasizes the primary role of the central pixel by calculating its similarity weights with surrounding neighbors. Also, it is notable that there is a paucity of models based on whole graph inputs, in comparison with the two aforementioned methods. In addition, Zhang et al. [28] put forward a comprehensive, end-to-end HSIc framework. This framework aims to optimise the utilization of global spatial information and enhance the performance through the integration of a spectral-attention-based encoder and a lightweight decoder. More recently, patch-free encoder–decoder frameworks have also been developed for large-scale airborne HSI classification [29]. To fundamentally bypass the overlapping and computational redundancy issues inherent in patch extraction, recent studies have also explored treating HSI classification directly as a full-image semantic segmentation task [30], which efficiently harnesses both labeled and unlabeled pixels in an end-to-end manner.
Despite these advances, most existing deep HSIC methods still adopt a patch-based input strategy. In this setting, each labeled pixel is taken as the patch center, and its surrounding neighborhood is extracted as the model input, as illustrated in Figure 1. This strategy is attractive because it enables the network to jointly exploit spectral and local spatial context. However, when training and test centers are randomly sampled from the same image, neighboring patches often overlap spatially. As a result, non-central pixels from test samples may appear inside training patches, and vice versa, as illustrated in Figure 2 and Figure 3. This overlap introduces train–test leakage and can lead to overly optimistic evaluation results [31].
Recent studies have highlighted this problem in hyperspectral classification and suggested spatially disjoint or controlled sampling as a way to avoid overlap between training and test regions [32,33,34,35]. These strategies provide more reliable evaluation, but they may substantially reduce the number of available training samples, especially in small-sample settings. This limitation is particularly restrictive for HSIC, where labeled data are already scarce. Therefore, in addition to spatial separation, it is worthwhile to explore a complementary strategy that reduces overlap-induced leakage while preserving the conventional patch-based input format and retaining more training samples.
To this end, we propose a replacing overlapping pixels (ROP) strategy for patch-based HSIC. Instead of discarding spatial regions, ROP reconstructs patches by replacing overlapping pixels with same-class training pixels, thereby reducing direct train–test overlap at the pixel level. Since the reconstructed patches exhibit altered local spatial context, we further design a resolving data leakage network (RDLNet) equipped with a multiple feature extraction and fusion (MFEF) module. The proposed network combines multi-scale 3D and 1D convolutions to better capture complementary spectral–spatial information from ROP-reconstructed patches. The main contributions of this work are summarized as follows:
1.
We revisit the patch overlap problem in patch-based HSI classification and show that conventional random patch splitting may introduce train–test leakage, leading to overly optimistic performance estimates;
2.
We propose a replacement of overlapping pixels (ROP) strategy to construct a leakage-controlled patch evaluation strategy. ROP reduces direct overlap leakage while preserving the patch-based input format and retaining more samples than spatial buffer-based separation in small-sample settings;
3.
We design an RDLNet architecture with a multiple feature extraction and fusion (MFEF) module to model ROP-reconstructed patches more effectively. Experiments on five public datasets show that RDLNet achieves consistently strong performance under the proposed leakage-controlled strategy.
For ease of reference, a comprehensive list of abbreviations used throughout this manuscript is provided in Table 1.

2. Materials and Methods

The proposed RDLNet, which mainly includes the ROP module and the MFEF module, is shown in Figure 4.

2.1. Resolving Data Leakage

In this paper, we mainly conduct a series of studies on the HSIc method based on patch data. Patch-based HSI classification usually takes each labeled pixel as the patch center and extracts its surrounding neighborhood as the model input. Under conventional random splitting, however, training and test centers are sampled from the same image, so their corresponding patches often overlap spatially. As a result, non-central pixels from the test set may appear inside training patches, and vice versa. This train–test overlap introduces data leakage and may lead to overly optimistic evaluation results. Figure 5a illustrates this issue with a simplified 3 × 3 example. Pixel 5 in the patch data is the pixel to be classified, pixels 2 and 9 belong to the pixels to be classified in the training set, and pixels 3 and 6 belong to the pixels to be classified in the test set. The remaining pixels 1, 4, 7, and 8 are all background pixels. This type of data partitioning leads to data leakage in the training process of the model, and the classification accuracy of the model increases as the patch size increases. This section explains how to solve the problem of data leakage as well as achieve good classification accuracy with less training data.
To solve the problem of the data leakage caused by pixel overlap between training and test data during the training process, we propose a method to replace overlapping pixels (ROP) in patch data and test pixels in the overlapping region of training patch data with training pixels of the same category. As shown in Figure 5b, pixel points 3 and 6 in the test set are to be classified, and these points are replaced by other pixels of the same category in the training set. Similarly, when constructing patches for test set pixels, if any position within a test patch contains a training pixel (i.e., a pixel that appears in the training set), that position is replaced by a randomly selected training pixel of the same class. Specifically, for each test patch centered at a test pixel, we scan all spatial positions within the patch window; if a position ( j , k ) corresponds to a training pixel in the original image, we replace the spectral vector at that position with a randomly drawn spectral vector from the training set belonging to the same class label.
Algorithm 1 Replacing Overlapping Pixels Method
  • Input:  H S I _ C u b e s R N × H × W × C , S D L R N × H × W , O L R N × H × W
  • Output:  H S I _ C u b e s (with overlapping pixels replaced)
  1:
Initialize E C C as an empty dictionary: E C C { }
  2:
c e n t e r _ r o w H / 2 , c e n t e r _ c o l W / 2
  3:
for  i = 0 to N 1  do
  4:
    c l a s s _ l a b e l S D L [ i , c e n t e r _ r o w , c e n t e r _ c o l ]
  5:
   if  c l a s s _ l a b e l > 0  then
  6:
      E C C [ c l a s s _ l a b e l ] . append ( H S I _ C u b e s [ i , c e n t e r _ r o w , c e n t e r _ c o l , : ] )
  7:
   end if
  8:
end for
  9:
for  i = 0 to N 1  do
10:
   for  j = 0 to H 1  do
11:
     for  k = 0 to W 1  do
12:
        if  S D L [ i , j , k ] = = 0  and  O L [ i , j , k ] > 0  then
13:
           t a r g e t _ c l a s s O L [ i , j , k ]
14:
           r a n d _ i d x r a n d o m _ i n t ( 0 , | E C C [ t a r g e t _ c l a s s ] | 1 )
15:
           H S I _ C u b e s [ i , j , k , : ] E C C [ t a r g e t _ c l a s s ] [ r a n d _ i d x ]
16:
        end if
17:
     end for
18:
   end for
19:
end for
20:
return  H S I _ C u b e s
Therefore, the reconstructed patch should be understood as a leakage-controlled evaluation input rather than a natural spatial neighborhood sampled from the original scene.
The price of this strategy is that the natural spatial continuity of the patch is partially weakened, because some neighboring pixels are replaced by same-class pixels drawn from other spatial locations. Nevertheless, the patch-based input format is preserved, and the evaluation becomes less dependent on overlap-induced leakage. This produces a leakage-controlled setting for patch-based HSI classification.
The detailed mathematical formulations are given in Equations (1) and (2).
HSI _ Cubes i , j , k , : = ECC [ OL i , j , k ] [ rand _ idx ] if ( OL i , j , k 0 ) and ( SDL i , j , k = 0 ) HSI _ Cubes i , j , k , : otherwise ,
rand _ idx Uniform ( 0 , | ECC [ OL i , j , k ] | 1 ) ,
where HSI _ Cubes R N × H × W × C represents the collection of all patch data, with N being the total number of patches, H × W the spatial dimensions of each patch, and C the number of spectral bands. The indices i, j, and k denote the patch index, row position within the patch, and column position within the patch, respectively. SDL R N × H × W is the label map indicating which pixels belong to the training set (non-zero values correspond to training pixels, zero values indicate test or background pixels). OL R N × H × W is the original ground-truth label map for all pixels in the image. ECC is a class-wise dictionary structure where ECC [ c ] is a list storing all training pixel spectral vectors belonging to class c. Specifically, ECC [ c ] = { x 1 ( c ) , x 2 ( c ) , , x n c ( c ) } , where n c is the number of training samples in class c and each x t ( c ) R C is a spectral vector. The variable rand _ idx is a random integer uniformly sampled from [ 0 , n c 1 ] , ensuring that each replacement draws a different training sample from the same class.
Algorithm 1 summarizes the implementation of ROP. First, a class-wise candidate pool is built from the center pixels of the training patches. Then, each patch is scanned position by position, and every overlapping non-central pixel is replaced according to Equations (1) and (2). Since only overlapping positions are modified, the total number of training and test patches remains unchanged.
In ROP, the replacement pixel at each overlapping position is randomly sampled from the class-wise candidate pool. Therefore, the reconstructed patch is not unique, and different random seeds may lead to slightly different local spectral–spatial configurations and, consequently, slightly different classification results. This stochastic effect is expected to be more noticeable when the candidate pool of a class is small or when the class exhibits strong intra-class variability.

2.2. Multiple Feature Extraction and Fusion Module

After applying the ROP strategy, the reconstructed patches retain class-relevant spectral information but exhibit partially modified local spatial context. To better model such inputs, we design a multiple feature extraction and fusion (MFEF) module. The purpose of MFEF is to extract complementary spectral–spatial representations at different scales and then fuse them for final classification.
As shown in Figure 6, the MFEF module consists of two parallel 3D convolution branches and one parallel 1D convolution branch. The two 3D branches are used to capture joint spectral–spatial features under different spectral receptive fields, while the 1D branch focuses on fine-grained spectral dependency modeling. In this way, the module combines local spectral–spatial context with detailed spectral discrimination, which is particularly useful for ROP-reconstructed patches whose spatial continuity is partially weakened.
More specifically, the 3D branches operate on the input patch cube and learn spatial–spectral representations from different kernel depths, enabling the network to capture multi-scale contextual information. The 1D branch models spectral correlations along the band dimension and provides complementary spectral cues that are less sensitive to spatial perturbation. The outputs of the three branches are then fused and fed into the classifier to obtain the final category prediction.
The 3D and 1D convolution operations used in the network are defined as follows:
f i , j x , y , z = Φ m p = 0 P i 1 q = 0 Q i 1 r = 0 R i 1 ω i , j , m p , q , r f ( i 1 ) m ( x + p ) ( y + q ) ( z + r ) + b i , j , f i , j x = Φ m p = 0 P i 1 ω i , j , m p f ( i 1 ) m ( x + p ) + b i , j ,
Here, f i , j x , y , z denotes the output at spatial–spectral position ( x , y , z ) in the jth feature map of the ith 3D convolution layer, and f i , j x denotes the output at position x in the jth feature map of the ith 1D convolution layer. Φ ( · ) is the activation function, ω represents the convolution kernel weights, and b i , j is the bias term.
By combining multi-scale 3D feature extraction with 1D spectral modeling, MFEF provides a compact and effective representation for HSI classification under the proposed leakage-controlled setting.

3. Experiments and Results

3.1. Datasets and Experimental Setup

In order to ascertain the viability of the proposed model, five datasets were selected for experimental analysis: Pavia University (PU), Salinas (SA), Xuzhou [36,37], Honghu [38], and Longkou [39]. The image specifications of the PU dataset are 610*340*102, and the ROSIS sensor is used to shoot over Pavia, northern Italy, with a ground truth of nine classes. The image specifications of the SA dataset are 512*217*204, obtained by the AVIRIS sensor, and the image ground truth is 16 classes. The image size of the Xuzhou dataset is 500*260*436, and the HYSPEX hyperspectral airborne camera (Norsk Elektro Optikk AS, Skedsmokorset, Norway) is used to shoot over the suburban sites of Xuzhou. Its ground truth is nine classes. The image specifications of the Honghu dataset are 940*475*270, obtained by the Headwall Nano-Hyperspec sensor, including 22 classes. The image specifications of the Longkou dataset with the Headwall Nano-Hyperspec sensor are 550*400*270, wherein 9 classes are present. Table 2 and Table 3 show the number of training samples of each class for these five datasets. Figure 7 shows their corresponding false color images and ground truth maps.
It should be stressed that, as the operation PCA (principal component analysis) has been demonstrated to be useful for HSIc [40], we here also adopt it in RDLNet. For the principal component values of PCA, the starting point is [20; 30; 40; 50]. The number of training individuals for each category of these datasets was set to 30. Table 4 illustrates the OA values for varying principal component values. It can be observed that the Xuzhou dataset exhibits the best results when the value of the principal component is set to 20. Similarly, the PU and Longkou datasets demonstrate the best results when the value of the principal component is set to 30. When the value is set to 40, the SA and Honghu datasets yield the best results. Therefore, the value of PCA for these five datasets was set to [30; 40; 20; 40; 30].To ensure a fair comparison, the same PCA configuration was applied uniformly to all comparative methods. This controlled setting avoids method-specific PCA tuning and makes the comparison focus on architectural differences.
In addition to reducing the dimensionality of these datasets, other parameter values are also set. During the training process, the patch size, learning rate, and training period were set to 11, 0.0001, and 100, respectively. Due to the high cost of labelling hyperspectral images, a total of 30 randomly selected center pixels were chosen for each category as the training set in these datasets. Each center pixel was then expanded into an 11 × 11 × C patch, where C denotes the number of spectral bands after PCA. Therefore, the total number of training patches equals 30 × N classes , and applying ROP changes only the spectral content of overlapping positions without changing the number of training or test patches.
To demonstrate the effectiveness of this network, nine methods are selected for a fair comparison. They are 1DCNN [12], 2DCNN [13], 3DCNN [16], ViT [22], MCVT [41], DBDA [42], SSFTT [25], CMRCNN [43], and MIEPN [44]. Note that the aforementioned methods are compared with the method used in this work, both without and with the ROP strategy. To ensure statistical reliability and account for the variability introduced by random sampling in the ROP procedure, all experiments are repeated five times with different random seeds (seeds = 0, 1, 2, 3, 4). Each run involves independent data splitting, ROP reconstruction, and model training. The reported results in Table 5 and Table 6 are presented as “mean ± standard” deviation across these five runs. To evaluate the performance of various methods, the following metrics were employed: Overall Accuracy (OA), Average Accuracy (AA), and Kappa Coefficient (Kappa), that is,
OA = i = 1 Num C i i TNum test .
AA = i = 1 Num C i i N i Num .
Kappa = OA i = 1 Num H i TNum test · L i TNum test 1 i = 1 Num H i TNum test · L i TNum test .
where N u m denotes the number of classes, C i i is the number of correctly classified samples in class i, T N u m test is the total number of test samples, and N i is the number of test samples in class i. In Equation (6), H i and L i denote the sums of the ith row and the ith column of the confusion matrix, respectively.

3.2. Results and Analyses

Figure 8, Figure 9 and Figure 10 summarize the performance of all methods across the five datasets. In each bar chart, the darker bottom portion represents the robust classification performance obtained under the proposed leakage-controlled ROP strategy. The lighter, transparent portion on top explicitly highlights the performance gap—specifically, the inflated accuracy caused by overlap-induced data leakage under the conventional patch strategy. This visual comparison provides a direct and stark view of how severely train–test overlap can overestimate a model’s true generalization capability. As shown in these figures, while baseline methods experience a dramatic collapse in accuracy once the leaked information is removed, RDLNet (indicated by the red dashed line) effectively defends against this degradation.
Table 5 reports the results obtained under the conventional random patch strategy. Since this strategy suffers from overlap-induced train–test leakage, these results are presented only for reference. As shown in the table, many methods achieve very high accuracies under this setting, such as CMRCNN on PU and DBDA on LongKou. However, these results may be inflated because overlapping pixels allow the model to benefit from leaked information. The classification maps in Figure 11 further illustrate this phenomenon.
Table 6 and Figure 12, Figure 13, Figure 14, Figure 15 and Figure 16 present the main results under the proposed leakage-controlled strategy. After applying ROP, the performance of most comparative methods drops substantially, indicating that part of their apparent gains under the conventional strategy comes from overlap-induced leakage rather than true generalization. For example, the OA of CMRCNN on PU decreases from 93.36 (±1.56)% to 74.15 (±2.68)%, and SSFTT on Longkou decreases from 95.02 (±2.10)% to 73.04 (±4.18)%.
In contrast, RDLNet consistently achieves the best performance on all five datasets under the ROP-based setting. Specifically, it obtains OA values of 82.29 (±2.35)% on PU, 92.80 (±2.22)% on SA, 91.54 (±1.06)% on Xuzhou, 67.99 (±1.57)% on Honghu, and 89.90 (±3.33)% on Longkou. Compared with the second-best method, RDLNet improves mean OA by 6.44% on PU, 0.95% on SA, 2.27% on Xuzhou, 2.53% on Honghu, and 3.92% on Longkou. These results indicate that the proposed MFEF design is more effective for modeling ROP-reconstructed patches.
Beyond the average results, the standard deviations in Table 5 and Table 6 quantify the run-to-run variability caused by random data splitting, stochastic ROP reconstruction, and network optimization. In general, a smaller standard deviation indicates that a method is less sensitive to random factors and yields more repeatable performance, whereas a larger deviation suggests that the reported accuracy depends more strongly on specific random realizations. Under the proposed ROP setting, several baseline methods exhibit relatively large fluctuations on some datasets, such as ViT on PU (OA: 69.41 ± 10.60), SSFTT on Xuzhou (OA: 78.28 ± 10.39), and CMRCNN on Honghu (OA: 50.01 ± 14.07), indicating limited stability once overlap-induced leakage is removed. In contrast, RDLNet maintains moderate deviations across the five datasets (OA std: ±2.35 on PU, ±2.22 on SA, ±1.06 on Xuzhou, ±1.57 on Honghu, and ±3.33 on Longkou), which suggests that its performance advantage is not due to a favorable single run but can be reproduced under different random seeds.
The advantage of RDLNet is also reflected in AA and Kappa. On PU, for example, RDLNet achieves 90.48% AA and 80.00% Kappa, both clearly higher than those of the compared methods. Similar trends can be observed on the other four datasets. This suggests that the proposed model not only improves overall classification accuracy but also maintains more balanced class-wise performance under the leakage-controlled setting.
Overall, the results support two conclusions. First, conventional random patch splitting may considerably overestimate the performance of HSI classifiers because of train–test overlap. Second, once this overlap is controlled, RDLNet remains consistently strong across datasets, showing that the proposed architecture is better suited to fair patch-based HSI evaluation.

3.3. Ablation Study

To better understand the contribution of each component in the proposed model, we conduct ablation experiments on the PU dataset under the ROP-based setting. Table 7 reports the results of different branch combinations in the MFEF module.
Using a single branch already yields competitive performance, with the 1D branch achieving the best OA among the three single-branch variants. However, combining two branches consistently improves the results, which indicates that feature representations from different dimensions are complementary. Among all combinations, the 3D + 1D setting achieves the best performance, reaching 84.56% OA, 90.48% AA, and 80.00% Kappa. This confirms that the proposed MFEF design effectively combines joint spectral–spatial modeling with fine-grained spectral discrimination.
In contrast, the simultaneous use of 3D, 2D, and 1D branches leads to a noticeable performance drop. A likely reason is that the additional 2D branch introduces redundant or less compatible spatial features after ROP modifies the local neighborhood structure. At the same time, the three-branch configuration increases optimization difficulty in the small-sample setting, which may further weaken the effectiveness of feature fusion. Therefore, the best performance is obtained not by using all possible branches, but by combining the most complementary ones.
To further illustrate the behavior of MFEF, Figure 17, Figure 18, Figure 19 and Figure 20 visualize representative feature maps and activation distributions on the PU dataset. The three branches exhibit different response patterns, suggesting that they capture complementary information at different scales. After fusion, the resulting representation preserves discriminative responses while suppressing part of the noise, which is consistent with the quantitative results in Table 7. To further validate the stability of RDLNet beyond the fixed 30-samples-per-class protocol, we analyze performance under varying training sample sizes and examine whether the advantage of the MFEF module remains consistent across different sample regimes.
To further illustrate the internal mechanism of MFEF and verify that it effectively avoids over-smoothing, Figure 17, Figure 18 and Figure 19 visualize representative feature maps from the individual 3D and 1D branches on the PU dataset. The visualizations reveal distinct and complementary response patterns: the 3D convolutional branches effectively capture multi-scale spatial–spectral context, while the 1D branch preserves fine-grained spectral discriminability independent of local spatial perturbations. Furthermore, as shown in Figure 20, after fusing these multi-dimensional features, the network successfully retains highly discriminative target activations while strongly suppressing background noise. This confirms that the proposed parallel multi-branch design extracts rich local details without suffering from the over-smoothing degradation typically seen in excessively redundant spatial architectures.
Table 8 further compares RDLNet with and without the ROP strategy on all five datasets. After applying ROP, the OA reduction remains moderate, ranging from 1.30% to 2.66% across datasets. This trend is much smaller than the performance drops observed for most comparative methods in Table 5 and Table 6. These results suggest that RDLNet is relatively stable under the proposed leakage-controlled setting and is better suited to ROP-reconstructed patches.

4. Discussion

The experimental results demonstrate that most comparative methods experience substantial performance degradation after applying the ROP strategy, whereas RDLNet remains consistently strong across all five datasets. This suggests that the proposed model is less dependent on overlap-induced leakage and is better able to learn discriminative representations from leakage-controlled patches. A possible reason lies in the design of the MFEF module. After ROP is applied, the reconstructed patches still preserve class-related spectral signatures, but their natural local spatial continuity is partially weakened. Under this condition, feature extractors that rely too heavily on intact local spatial patterns may become less effective. However, as highlighted by recent central attention mechanisms [27], the central pixel provides the primary and most decisive spectral information, while neighboring pixels serve mainly as auxiliary context. Because our ROP strategy strictly preserves the target central pixel while only modifying the overlapping surroundings, architectures with robust spectral–spatial fusion capabilities—like our proposed MFEF module combining 3D and 1D branches—can still effectively classify the target. In contrast, the proposed MFEF module combines two 3D branches and one 1D branch, which allows the network to jointly model spectral–spatial context while preserving fine-grained spectral discrimination.
The ablation results in Table 7 support this interpretation: the 3D + 1D combination achieves the best performance, whereas adding the 2D branch leads to a decline, likely because it introduces redundant or less compatible spatial features after ROP modifies the local neighborhood structure. The visualization results in Figure 17, Figure 18, Figure 19 and Figure 20 provide further evidence that different branches of MFEF capture complementary response patterns. After fusion, the resulting representation preserves discriminative activations while suppressing part of the noise, which is consistent with the quantitative improvements observed. In addition, Table 8 shows that the performance reduction of RDLNet after applying ROP remains moderate across datasets, further indicating that the proposed architecture is relatively stable under the leakage-controlled setting.
The reported standard deviations also help interpret the robustness of the proposed leakage-controlled evaluation. Since the variability aggregates the effects of random train/test sampling, replacement-pixel sampling in ROP, and model training dynamics, the relatively constrained deviations of RDLNet indicate that the proposed MFEF design adapts well to the stochastic perturbations introduced by patch reconstruction. By contrast, the larger deviations observed for some comparative methods imply that their predictions are more sensitive to specific reconstructed neighborhood configurations, suggesting a stronger dependence on fragile local spatial patterns. Therefore, the standard deviation should be interpreted together with the mean result: methods with strong average performance and relatively small deviations are more convincing under the proposed leakage-controlled strategy.
Despite the effectiveness of the MFEF module in mitigating overlap-induced leakage, the proposed ROP strategy and the RDLNet architecture still present certain limitations. First, ROP replaces overlapping neighbors with the same-class training pixels from other spatial locations, which inevitably weakens the natural spatial continuity of the patch. Therefore, ROP is better viewed as a leakage-controlled patch reconstruction strategy rather than a perfect surrogate for natural scene structure. In practice, ROP is particularly suitable for small-sample settings where preserving training samples is more critical than preserving exact local spatial continuity. Second, ROP assumes that pixels from the same class are sufficiently similar to serve as replacements, which may be less suitable for classes with strong intra-class variability.
Furthermore, limitations also exist within the architectural configurations. In this work, all experiments are conducted under a fixed patch size of 11 × 11 , and PCA is used as a preprocessing step for dimensionality reduction. As shown in Table 4, the optimal PCA dimension still needs to be selected manually for different datasets. Additionally, to further examine the trade-off between recognition performance and model complexity, Table 9 reports a representative comparison with 1D-CNN, 2D-CNN, and 3D-CNN on the PU dataset under the setting of PCA = 30 and patch size 11 × 11 . As expected, RDLNet is more complex than simple 1D and 2D CNN baselines, but it requires fewer parameters and fewer FLOPs than the 3D-CNN baseline while achieving substantially better recognition performance under the ROP-based setting. These results indicate that RDLNet does not pursue minimal complexity, but achieves a favorable accuracy–efficiency trade-off among representative CNN-based models.
To further validate the stability of RDLNet and ensure its advantages are not restricted to the fixed few-shot protocol (i.e., 30 samples per class), we evaluated the model’s performance under varying training sample sizes, ranging from 10 to 100 samples per class. As illustrated by the performance curves in Figure 21 and Figure 22 for the SA and PU datasets, respectively, RDLNet consistently maintains a clear competitive margin over the baseline methods across all tested sample regimes. This stable upward trajectory indicates that the multi-dimensional convolution design of the MFEF module is universally effective for feature extraction on leakage-controlled patches, rather than being a hyperparameter artifact optimized solely for extremely low-sample constraints.
Looking ahead, future work may proceed in several directions. A more systematic comparison between ROP and spatially disjoint sampling would help clarify their relative advantages in terms of sample efficiency and spatial realism. It would also be highly beneficial to explore adaptive dimensionality selection instead of manually choosing PCA dimensions for each dataset. Finally, extending the proposed framework to accommodate variable patch sizes, broader remote sensing tasks, or more lightweight backbone architectures will further enhance its practical applicability.

5. Conclusions

This paper revisits the train–test overlap problem in patch-based hyperspectral image classification, demonstrating that conventional random patch splitting can lead to overly optimistic performance evaluations due to data leakage. To address this critical issue, we propose the replacing overlapping pixels (ROP) strategy, which reconstructs patch data in a leakage-controlled manner while preserving the standard patch-based input format. Furthermore, to effectively model these reconstructed patches, we designed the Resolving Data Leakage Network (RDLNet), featuring a Multiple Feature Extraction and Fusion (MFEF) module that seamlessly integrates multi-scale 3D and 1D convolutions.
Extensive experiments across five public hyperspectral datasets reveal a stark reality: while existing state-of-the-art methods suffer significant performance degradation once overlap-induced leakage is eliminated, RDLNet maintains consistently high and robust accuracy. The multi-branch design successfully captures complementary spectral–spatial features without over-smoothing, and its superiority persists across varying training sample sizes, proving its stability beyond extreme few-shot conditions.
Ultimately, this study not only provides a highly effective classification architecture but also highlights the pressing need for fair, leakage-free benchmarking protocols in the HSI community. Future research will build upon this foundation by exploring adaptive dimensionality reduction techniques and extending the proposed leakage-controlled framework to broader remote sensing tasks and variable spatial scales.

Author Contributions

Conceptualization, K.Z. and Z.H.; methodology, K.Z.; software, K.Z.; validation, Z.H., Z.Y. (Zhen Yang) and Z.Y. (Zhijian Yin); formal analysis, Z.H.; investigation, K.Z.; resources, Z.Y. (Zhen Yang); data curation, K.Z.; writing—original draft preparation, K.Z.; writing—review and editing, K.Z. and Z.Y. (Zhen Yang); visualization, Z.H.; supervision, Z.Y. (Zhijian Yin); project administration, Z.Y. (Zhen Yang); funding acquisition, Z.Y. (Zhen Yang) All authors have read and agreed to the published version of the manuscript.

Funding

This research was supported by the Outstanding Youth Project of Jiangxi Natural Science Foundation (20232ACB212006), National Natural Science Foundation of China (62261026), Open Project of Henan Provincial Key Laboratory of Oracle Bone Information Processing (OIP2024H003), the Project Funded by Jiangxi Science and Technology Normal University (2024XJZD001) and the Project of the Department of Education of Jiangxi Province (GJJ2201358, GJJ2201350).

Data Availability Statement

The original contributions presented in this study are included in the article; further inquiries can be directed to the corresponding author.

Acknowledgments

The authors would like to thank the website for providing the data used in the paper and the reviewers for their insightful comments.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Kumar, V.; Singh, R.S.; Rambabu, M.; Dua, Y. Deep learning for hyperspectral image classification: A survey. Comput. Sci. Rev. 2024, 53, 100658. [Google Scholar] [CrossRef]
  2. Xie, N.; Zhang, T.; Zhang, L.; Chen, J.; Wei, F.; Yu, W. VLF-SAR: A Novel Vision-Language Framework for Few-Shot SAR Target Recognition. IEEE Trans. Circuits Syst. Video Technol. 2025; in press. [Google Scholar] [CrossRef]
  3. Deng, J.; Wang, W.; Zhang, H.; Zhang, T.; Zhang, J. PolSAR ship detection based on superpixel-level contrast enhancement. IEEE Geosci. Remote Sens. Lett. 2024, 21, 4008805. [Google Scholar] [CrossRef]
  4. Wang, J.; Quan, S.; Xing, S.; Li, Y.; Wu, H.; Meng, W. PSO-based fine polarimetric decomposition for ship scattering characterization. ISPRS J. Photogramm. Remote Sens. 2025, 220, 18–31. [Google Scholar] [CrossRef]
  5. Zhang, T.; Zhang, P.; Zhong, W.; Yang, Z.; Yang, F. JL-GFDN: A novel gabor filter-based deep network using joint spectral-spatial local binary pattern for hyperspectral image classification. Remote Sens. 2020, 12, 2016. [Google Scholar] [CrossRef]
  6. Sudharsan, S.; Hemalatha, R.; Radha, S. A Survey on Hyperspectral Imaging for Mineral Exploration using Machine Learning Algorithms. In Proceedings of the 2019 International Conference on Wireless Communications Signal Processing and Networking (WiSPNET); IEEE: Piscataway, NJ, USA, 2019; pp. 206–212. [Google Scholar]
  7. Wang, Y. Research progress and prospect on ecological disturbance monitoring in mining area. Acta Geod. Et Cartogr. Sin. 2017, 46, 1705. [Google Scholar]
  8. Bhargava, A.; Sachdeva, A.; Sharma, K.; Alsharif, M.H.; Uthansakul, P.; Uthansakul, M. Hyperspectral imaging and its applications: A review. Heliyon 2024, 10, e33208. [Google Scholar] [CrossRef]
  9. Peng, J.; Sun, W.; Du, Q. Self-Paced Joint Sparse Representation for the Classification of Hyperspectral Images. IEEE Trans. Geosci. Remote Sens. 2019, 57, 1183–1194. [Google Scholar] [CrossRef]
  10. Melgani, F.; Bruzzone, L. Classification of Hyperspectral Remote Sensing Images with Support Vector Machines. IEEE Trans. Geosci. Remote Sens. 2004, 42, 1778–1790. [Google Scholar] [CrossRef]
  11. Cheng, Q.; Varshney, P.K.; Arora, M.K. Logistic Regression for Feature Selection and Soft Classification of Remote Sensing Data. IEEE Geosci. Remote Sens. Lett. 2006, 3, 491–494. [Google Scholar] [CrossRef]
  12. Hu, W.; Huang, Y.; Wei, L.; Zhang, F.; Li, H. Deep convolutional neural networks for hyperspectral image classification. J. Sens. 2015, 2015, 258619. [Google Scholar] [CrossRef]
  13. Du, P.; Xia, J.S.; Xue, Z.H.; Tan, K.; Su, H.J.; Bao, R. Review of Hyperspectral Remote Sensing Image Classification. J. Remote Sens. 2016, 20, 236–256. [Google Scholar] [CrossRef]
  14. Li, Y.; Zhang, H.; Shen, Q. Spectral–spatial Classification of Hyperspectral Imagery with 3D Convolutional Neural Network. Remote Sens. 2017, 9, 67. [Google Scholar] [CrossRef]
  15. Hamida, A.B.; Benoit, A.; Lambert, P.; Amar, C.B. 3-D deep learning approach for remote sensing image classification. IEEE Trans. Geosci. Remote Sens. 2018, 56, 4420–4434. [Google Scholar] [CrossRef]
  16. Chen, Y.; Lin, Z.; Zhao, X.; Wang, G.; Gu, Y. Deep Learning-Based Classification of Hyperspectral Data. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2014, 7, 2094–2107. [Google Scholar]
  17. He, M.; Li, B.; Chen, H. Multi-Scale 3D Deep Convolutional Neural Network for Hyperspectral Image Classification. In Proceedings of the 2017 IEEE International Conference on Image Processing (ICIP), Beijing, China, 17–20 September 2017; pp. 3904–3908. [Google Scholar]
  18. Roy, S.K.; Krishna, G.; Dubey, S.R.; Chaudhuri, B.B. HybridSN: Exploring 3-D–2-D CNN feature hierarchy for hyperspectral image classification. IEEE Geosci. Remote Sens. Lett. 2019, 17, 277–281. [Google Scholar] [CrossRef]
  19. Ran, L.; Zhang, Y.; Wei, W.; Zhang, Q. A hyperspectral image classification framework with spatial pixel pair features. Sensors 2017, 17, 2421. [Google Scholar] [CrossRef]
  20. Feng, Y.; Zheng, J.; Qin, M.; Bai, C.; Zhang, J. 3D octave and 2D vanilla mixed convolutional neural network for hyperspectral image classification with limited samples. Remote Sens. 2021, 13, 4407. [Google Scholar] [CrossRef]
  21. Wan, S.; Gong, C.; Zhong, P.; Du, B.; Zhang, L.; Yang, J. Multiscale dynamic graph convolutional network for hyperspectral image classification. IEEE Trans. Geosci. Remote Sens. 2020, 58, 3162–3177. [Google Scholar]
  22. Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Gelly, S.; et al. An Image Is Worth 16x16 Words: Transformers for Image Recognition at Scale. arXiv 2020, arXiv:2010.11929. [Google Scholar]
  23. Huang, L.; Chen, Y.; He, X. Spectral-Spatial Mamba for Hyperspectral Image Classification. Remote Sens. 2024, 16, 2449. [Google Scholar] [CrossRef]
  24. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, L.; Polosukhin, I. Attention Is All You Need. Adv. Neural Inf. Process. Syst. 2017, 30, 5998–6008. [Google Scholar]
  25. Sun, L.; Zhao, G.; Zheng, Y.; Wu, Z. Spectral–Spatial Feature Tokenization Transformer for Hyperspectral Image Classification. IEEE Trans. Geosci. Remote Sens. 2022, 60, 5522214. [Google Scholar] [CrossRef]
  26. Liu, H.; Li, W.; Xia, X.-G.; Zhang, M.; Tao, R. Multiarea target attention for hyperspectral image classification. IEEE Trans. Geosci. Remote Sens. 2023, 61, 5524916. [Google Scholar] [CrossRef]
  27. Liu, H.; Li, W.; Xia, X.-G.; Zhang, M.; Gao, C.-Z.; Tao, R. Central attention network for hyperspectral imagery classification. IEEE Trans. Neural Netw. Learn. Syst. 2023, 34, 8989–9003. [Google Scholar] [CrossRef] [PubMed]
  28. Zheng, Z.; Zhong, Y.; Ma, A.; Zhang, L. FPGA: Fast Patch-Free Global Learning Framework for Fully End-to-End Hyperspectral Image Classification. IEEE Trans. Geosci. Remote Sens. 2020, 58, 5612–5626. [Google Scholar] [CrossRef]
  29. Ji, R.; Tan, K.; Wang, X.; Tang, S.; Sun, J.; Niu, C.; Pan, C. PatchOut: A Novel Patch-Free Approach Based on a Transformer-CNN Hybrid Framework for Fine-Grained Land-Cover Classification on Large-Scale Airborne Hyperspectral Images. Int. J. Appl. Earth Obs. Geoinf. 2025, 138, 104457. [Google Scholar] [CrossRef]
  30. Liu, H.; Li, W.; Xia, X.-G.; Zhang, M.; Guo, Z.; Song, L. SegHSI: Semantic segmentation of hyperspectral images with limited labeled pixels. IEEE Trans. Image Process. 2024, 33, 6469–6482. [Google Scholar] [CrossRef]
  31. Karasiak, N.; Dejoux, J.-F.; Monteil, C.; Sheeren, D. Spatial dependence between training and test sets: Another pitfall of classification accuracy assessment in remote sensing. Mach. Learn. 2022, 111, 2715–2740. [Google Scholar] [CrossRef]
  32. Cao, X.; Li, C.; Feng, J.; Jiao, L. Semi-supervised feature learning for disjoint hyperspectral imagery classification. Neurocomputing 2023, 526, 9–18. [Google Scholar] [CrossRef]
  33. Feng, H.; Wang, Y.; Li, Z.; Zhang, N.; Zhang, Y.; Gao, Y. Information Leakage in Deep Learning-Based Hyperspectral Image Classification: A Survey. Remote Sens. 2023, 15, 3793. [Google Scholar] [CrossRef]
  34. Zhang, P.; Yu, H.; Li, P.; Wang, R. TransHSI: A Hybrid CNN-Transformer Method for Disjoint Sample-Based Hyperspectral Image Classification. Remote Sens. 2023, 15, 5331. [Google Scholar] [CrossRef]
  35. Ahmad, M.; Mazzara, M.; Distefano, S.; Khan, A.M.; Altuwaijri, H.A. Improving Generalization for Hyperspectral Image Classification: The Impact of Disjoint Sampling on Deep Models. Comput. Mater. Contin. 2024, 81, 503–532. [Google Scholar] [CrossRef]
  36. Tan, K.; Wu, F.; Du, Q.; Du, P.; Chen, Y. A Parallel Gaussian–Bernoulli Restricted Boltzmann Machine for Mining Area Classification With Hyperspectral Imagery. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2019, 12, 627–636. [Google Scholar] [CrossRef]
  37. Wang, X.; Tan, K.; Du, Q.; Chen, Y.; Du, P. Caps-TripleGAN: GAN-Assisted CapsNet for Hyperspectral Image Classification. IEEE Trans. Geosci. Remote Sens. 2019, 57, 7232–7245. [Google Scholar] [CrossRef]
  38. Zhong, Y.; Hu, X.; Luo, C.; Wang, X.; Zhao, J.; Zhang, L. WHU-Hi: UAV-Borne Hyperspectral with High Spatial Resolution (H2) Benchmark Datasets and Classifier for Precise Crop Identification Based on Deep Convolutional Neural Network with CRF. Remote Sens. Environ. 2020, 250, 112012. [Google Scholar] [CrossRef]
  39. Zhong, Y.; Wang, X.; Xu, Y.; Wang, S.; Jia, T.; Hu, X.; Zhao, J.; Wei, L.; Zhang, L. Mini-UAV-Borne Hyperspectral Remote Sensing: From Observation and Processing to Applications. IEEE Geosci. Remote Sens. Mag. 2018, 6, 46–62. [Google Scholar] [CrossRef]
  40. Kang, X.; Xiang, X.; Li, S.; Benediktsson, J.A. PCA-Based Edge-Preserving Features for Hyperspectral Image Classification. IEEE Trans. Geosci. Remote Sens. 2017, 55, 7140–7151. [Google Scholar] [CrossRef]
  41. Cao, Y.; Wang, Y.; Yin, Z.; Yang, Z. Mixed Residual Convolutions with Vision Transformer in Hyperspectral Image Classification. In Proceedings of the 2022 IEEE 22nd International Conference on Communication Technology (ICCT), Nanjing, China, 11–14 November 2022; pp. 1595–1599. [Google Scholar]
  42. Li, R.; Zheng, S.; Duan, C.; Yang, Y.; Wang, X. Classification of Hyperspectral Image Based on Double-Branch Dual-Attention Mechanism Network. Remote Sens. 2020, 12, 582. [Google Scholar] [CrossRef]
  43. Yang, Z.; Xi, Z.; Zhang, T.; Guo, W.; Zhang, Z.; Li, H.C. CMR-CNN: Cross-Mixing Residual Network for Hyperspectral Image Classification. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2022, 15, 8974–8989. [Google Scholar] [CrossRef]
  44. Yang, Z.; Cao, Y.; Zhang, T.; Guo, W.; Zhang, Z. Multidimensional Information Expansion and Processing Network for Hyperspectral Image Classification. IEEE Geosci. Remote Sens. Lett. 2023, 20, 4011105. [Google Scholar]
Figure 1. Extracted patch centred on pixel points. Each pixel to be classified (shown in the center) is surrounded by an 11 × 11 spatial neighborhood.
Figure 1. Extracted patch centred on pixel points. Each pixel to be classified (shown in the center) is surrounded by an 11 × 11 spatial neighborhood.
Remotesensing 18 00979 g001
Figure 2. The illustration of data overlap, demonstrates how adjacent training patches (centered at pixels 2 and 9) and test patches (centered at pixels 3 and 6) share overlapping spatial regions, leading to data leakage.
Figure 2. The illustration of data overlap, demonstrates how adjacent training patches (centered at pixels 2 and 9) and test patches (centered at pixels 3 and 6) share overlapping spatial regions, leading to data leakage.
Remotesensing 18 00979 g002
Figure 3. Map of information leakage data between train and test sets. Overlapping pixels between train and train sets are in blue, and overlapping pixels between training and test sets are in purple. The figure on the right shows a comparison of the sample overlap rate for different training ratios. The overlap rate is computed as the ratio of the number of overlapping pixels to the total number of pixels in all patches. Specifically, for a given training ratio r, we randomly select r × N total pixels as training samples (where N total is the total number of labeled pixels), construct 11 × 11 patches around each selected pixel, and count how many pixels appear in both training and test patches. As shown in the right panel, higher training ratios lead to increased overlap rates, with our experimental setting of 30 samples per class (corresponding to approximately 1–3% training ratio depending on the dataset) exhibiting significant overlap that motivates the ROP strategy.
Figure 3. Map of information leakage data between train and test sets. Overlapping pixels between train and train sets are in blue, and overlapping pixels between training and test sets are in purple. The figure on the right shows a comparison of the sample overlap rate for different training ratios. The overlap rate is computed as the ratio of the number of overlapping pixels to the total number of pixels in all patches. Specifically, for a given training ratio r, we randomly select r × N total pixels as training samples (where N total is the total number of labeled pixels), construct 11 × 11 patches around each selected pixel, and count how many pixels appear in both training and test patches. As shown in the right panel, higher training ratios lead to increased overlap rates, with our experimental setting of 30 samples per class (corresponding to approximately 1–3% training ratio depending on the dataset) exhibiting significant overlap that motivates the ROP strategy.
Remotesensing 18 00979 g003
Figure 4. The framework of RDLNet. The input HSI is first divided into patches. Training and test sets are then split, and the ROP module is applied to eliminate spatial overlap between them. The reconstructed leakage-controlled patches are subsequently fed into the Multiple Feature Extraction and Fusion (MFEF) module to extract complementary multi-scale spectral–spatial features for final classification.
Figure 4. The framework of RDLNet. The input HSI is first divided into patches. Training and test sets are then split, and the ROP module is applied to eliminate spatial overlap between them. The reconstructed leakage-controlled patches are subsequently fed into the Multiple Feature Extraction and Fusion (MFEF) module to extract complementary multi-scale spectral–spatial features for final classification.
Remotesensing 18 00979 g004
Figure 5. The illustration of the patch strategy. (a) Traditional strategy: shows the conventional patch extraction where test pixels (3, 6) appear within training patches centered at pixels 2 and 9, causing data leakage. This scenario is simplified from our actual 11 × 11 patch size to a 3 × 3 example for clarity. (b) The ROP strategy: demonstrates how overlapping test pixels (3, 6) within training patches are replaced by randomly selected training pixels of the same class, effectively eliminating leakage while preserving patch structure. This replacement strategy is applied consistently across all experiments with 30 training samples per class, as detailed in Algorithm 1 and Equations (1) and (2).
Figure 5. The illustration of the patch strategy. (a) Traditional strategy: shows the conventional patch extraction where test pixels (3, 6) appear within training patches centered at pixels 2 and 9, causing data leakage. This scenario is simplified from our actual 11 × 11 patch size to a 3 × 3 example for clarity. (b) The ROP strategy: demonstrates how overlapping test pixels (3, 6) within training patches are replaced by randomly selected training pixels of the same class, effectively eliminating leakage while preserving patch structure. This replacement strategy is applied consistently across all experiments with 30 training samples per class, as detailed in Algorithm 1 and Equations (1) and (2).
Remotesensing 18 00979 g005
Figure 6. Multiple feature extraction and fusion module. It consists of two parallel 3D convolutional branches with different kernel depths to capture multi-scale spatial–spectral context, and one 1D convolutional branch to extract fine-grained spectral dependencies. The outputs are fused for classification.
Figure 6. Multiple feature extraction and fusion module. It consists of two parallel 3D convolutional branches with different kernel depths to capture multi-scale spatial–spectral context, and one 1D convolutional branch to extract fine-grained spectral dependencies. The outputs are fused for classification.
Remotesensing 18 00979 g006
Figure 7. False color images and ground truth maps for the five datasets.
Figure 7. False color images and ground truth maps for the five datasets.
Remotesensing 18 00979 g007
Figure 8. The OA results of different methods across five datasets. For each method, the darker bottom portion of the bar represents the robust performance under the proposed leakage-controlled ROP strategy, while the lighter transparent portion on top indicates the inflated performance drop caused by the conventional overlapping patch strategy. The red dashed line denotes the baseline performance of our RDLNet. The black dashed line denotes the best baseline performance without ROP strategy.
Figure 8. The OA results of different methods across five datasets. For each method, the darker bottom portion of the bar represents the robust performance under the proposed leakage-controlled ROP strategy, while the lighter transparent portion on top indicates the inflated performance drop caused by the conventional overlapping patch strategy. The red dashed line denotes the baseline performance of our RDLNet. The black dashed line denotes the best baseline performance without ROP strategy.
Remotesensing 18 00979 g008
Figure 9. The AA results of different methods across five datasets. The meaning of the dashed lines and bar portions is identical to Figure 8.
Figure 9. The AA results of different methods across five datasets. The meaning of the dashed lines and bar portions is identical to Figure 8.
Remotesensing 18 00979 g009
Figure 10. The Kappa results of different methods across five datasets. The meaning of the dashed lines and bar portions is identical to Figure 8.
Figure 10. The Kappa results of different methods across five datasets. The meaning of the dashed lines and bar portions is identical to Figure 8.
Remotesensing 18 00979 g010
Figure 11. The classification results of PU without the ROP strategy.
Figure 11. The classification results of PU without the ROP strategy.
Remotesensing 18 00979 g011
Figure 12. The classification results of PU with the ROP strategy.
Figure 12. The classification results of PU with the ROP strategy.
Remotesensing 18 00979 g012
Figure 13. The classification results of SA with the ROP strategy.
Figure 13. The classification results of SA with the ROP strategy.
Remotesensing 18 00979 g013
Figure 14. The classification results of Xuzhou with the ROP strategy.
Figure 14. The classification results of Xuzhou with the ROP strategy.
Remotesensing 18 00979 g014
Figure 15. The classification results of Honghu with the ROP strategy.
Figure 15. The classification results of Honghu with the ROP strategy.
Remotesensing 18 00979 g015
Figure 16. The classification results of Longkou with the ROP strategy.
Figure 16. The classification results of Longkou with the ROP strategy.
Remotesensing 18 00979 g016
Figure 17. Feature maps from 3D Branch 1 of the MFEF module on the PU dataset.
Figure 17. Feature maps from 3D Branch 1 of the MFEF module on the PU dataset.
Remotesensing 18 00979 g017
Figure 18. Feature maps from 3D Branch 2 of the MFEF module on the PU dataset.
Figure 18. Feature maps from 3D Branch 2 of the MFEF module on the PU dataset.
Remotesensing 18 00979 g018
Figure 19. Feature maps from 1D Branch of the MFEF module on PU dataset.
Figure 19. Feature maps from 1D Branch of the MFEF module on PU dataset.
Remotesensing 18 00979 g019
Figure 20. Mean activation maps before and after feature fusion in the MFEF module on the PU dataset. The fused representation preserves highly discriminative activations while effectively suppressing background noise, demonstrating the complementarity of the multi-branch design.
Figure 20. Mean activation maps before and after feature fusion in the MFEF module on the PU dataset. The fused representation preserves highly discriminative activations while effectively suppressing background noise, demonstrating the complementarity of the multi-branch design.
Remotesensing 18 00979 g020
Figure 21. Performance comparison of different methods under varying training sample sizes on the SA dataset.
Figure 21. Performance comparison of different methods under varying training sample sizes on the SA dataset.
Remotesensing 18 00979 g021
Figure 22. Performance comparison of different methods under varying training sample sizes on the PU dataset.
Figure 22. Performance comparison of different methods under varying training sample sizes on the PU dataset.
Remotesensing 18 00979 g022
Table 1. List of abbreviations.
Table 1. List of abbreviations.
AbbreviationFull Form
HSIHyperspectral Image
HSIcHyperspectral Image Classification
ROPReplacing Overlapping Pixels
MFEFMultiple Feature Extraction and Fusion
RDLNetResolving Data Leakage Network
CNNConvolutional Neural Network
1DCNNOne-Dimensional Convolutional Neural Network
2DCNNTwo-Dimensional Convolutional Neural Network
3DCNNThree-Dimensional Convolutional Neural Network
DLDeep Learning
SVMSupport Vector Machine
RFRandom Forest
ViTVision Transformer
MCVTMixed Convolution Vision Transformer
DBDADouble-Branch Dual-Attention
SSFTTSpectral–Spatial Feature Tokenization Transformer
CMRCNNCross-Mixing Residual CNN
MIEPNMultidimensional Information Expansion and Processing Network
PCAPrincipal Component Analysis
OAOverall Accuracy
AAAverage Accuracy
PUPavia University
SASalinas
SARSynthetic Aperture Radar
SOTAState-of-the-Art
Table 2. Numbers of training samples for the first three dataset.
Table 2. Numbers of training samples for the first three dataset.
Honghu Salinas Pavia University
IDClass NameSamplesClass NameSamplesClass NameSamples
1Red roof30Brocoli green weeds 130Asphalt30
2Road30Brocoli green weeds 230Meadows30
3Bare soil30Fallow30Gravel30
4Cotton30Fallow rough plow30Trees30
5Cotton firewood30Fallow smooth30Painted metal sheets30
6Rape30Stubble30Bare Soil30
7Chinese cabbage30Celery30Bitumen30
8Pakchoi30Grapes untrained30Self-Blocking Bricks30
9Cabbage30Soil vinyard develop30Shadows30
10Tuber mustard30Corn senesced green weeds30 30
11Brassica parachinensis30Lettuce romaine 4 wk30 30
12Brassica chinensis30Lettuce romaine 5 wk30
13Small Brassica chinensis30Lettuce romaine 6 wk30
14Lactuca sativa30Lettuce romaine 7 wk30
15Celtuce30Vinyard untrained30
16Film covered lettuce30Vinyard vertical trellis30
17Romaine lettuce30
18Carrot30
19White radish30
20Garlic sprout30
21Broad bean30
22Tree30
Table 3. Number of training samples for the latter two datasets.
Table 3. Number of training samples for the latter two datasets.
Longkou Xuzhou
IDClass NameSamplesClass NameSamples
1Corn30Bareland130
2Cotton30Lakes30
3Sesame30Coals30
4Broad-leaf soybean30Cement30
5Narrow-leaf soybean30Crops-130
6Rice30Trees30
7Water30Bareland230
8Roads and houses30Crops30
9Mixed weed30Red-title30
Table 4. OA (%) under different PCA dimensions. The best dataset results under the different principal component values are highlighted in bold.
Table 4. OA (%) under different PCA dimensions. The best dataset results under the different principal component values are highlighted in bold.
PCA20304050
Datasets
PU77.8882.9776.6471.55
SA90.5193.0794.9294.66
Xuzhou94.4289.8791.3492.36
Honghu73.9470.6275.8673.05
Longkou92.6295.2292.8089.33
Table 5. Classification results (%) with 30 training samples per class under the conventional patch strategy. The best results are highlighted in bold.
Table 5. Classification results (%) with 30 training samples per class under the conventional patch strategy. The best results are highlighted in bold.
1D-CNN2D-CNN3D-CNNViTMCVTDBDASSFTTCMRCNNMIEPN
OA65.17 ± 2.1489.25 ± 2.5389.41 ± 2.6382.98 ± 3.4991.68 ± 3.2892.51 ± 1.8490.28 ± 4.9693.36 ± 1.5690.45 ± 0.93
PUAA73.26 ± 1.8291.70 ± 0.8791.67 ± 1.1986.62 ± 2.7293.43 ± 1.6493.94 ± 1.3092.81 ± 1.3294.21 ± 1.3092.03 ± 0.94
Kappa56.33 ± 2.7986.02 ± 3.1386.21 ± 3.3278.07 ± 4.3989.17 ± 4.1690.17 ± 2.4087.47 ± 6.0191.28 ± 2.0487.51 ± 1.19
OA87.75 ± 0.6696.08 ± 0.5095.24 ± 0.2394.67 ± 0.4695.94 ± 0.5095.45 ± 0.5896.21 ± 0.2796.52 ± 1.1896.30 ± 0.57
SAAA93.73 ± 0.3798.21 ± 0.3397.94 ± 0.1697.72 ± 0.2998.21 ± 0.3398.10 ± 0.1298.38 ± 0.1798.31 ± 0.8298.35 ± 0.31
Kappa86.39 ± 0.7295.64 ± 0.5694.70 ± 0.2594.07 ± 0.5295.48 ± 0.5594.94 ± 0.6495.79 ± 0.3096.13 ± 1.3095.87 ± 0.64
OA78.62 ± 0.8893.64 ± 1.0495.53 ± 0.5794.64 ± 1.0494.83 ± 0.9095.39 ± 0.5594.40 ± 1.5395.69 ± 0.6993.96 ± 2.02
XuzhouAA82.64 ± 0.8495.86 ± 0.6597.00 ± 0.4495.97 ± 0.8196.74 ± 1.1497.09 ± 0.4596.52 ± 0.5297.39 ± 0.5795.50 ± 2.31
Kappa73.53 ± 1.0192.00 ± 1.3494.36 ± 0.7293.25 ± 1.3193.49 ± 1.1394.19 ± 0.6992.97 ± 1.8994.56 ± 0.8692.37 ± 2.59
OA50.58 ± 1.0984.77 ± 1.3586.29 ± 1.0078.62 ± 3.7287.96 ± 1.6482.05 ± 1.9882.82 ± 1.5289.71 ± 1.0486.38 ± 1.36
HonghuAA48.32 ± 0.3887.10 ± 0.9686.84 ± 0.8375.32 ± 4.8189.38 ± 1.3082.93 ± 0.8285.59 ± 1.8190.75 ± 0.8487.74 ± 0.97
Kappa43.87 ± 1.1181.33 ± 1.5083.06 ± 1.1673.96 ± 4.2685.10 ± 1.9678.10 ± 2.2279.06 ± 1.7887.20 ± 1.2583.20 ± 1.59
OA85.74 ± 1.8095.18 ± 2.1395.73 ± 0.6494.03 ± 1.6395.96 ± 1.7097.54 ± 0.9295.02 ± 2.1095.77 ± 0.6496.01 ± 1.20
LongkouAA84.54 ± 1.0595.60 ± 1.3396.06 ± 0.3093.30 ± 1.0696.38 ± 1.2197.88 ± 0.4195.42 ± 1.1496.33 ± 0.2096.83 ± 0.52
Kappa81.87 ± 2.2193.77 ± 2.7194.46 ± 0.8192.28 ± 2.0694.76 ± 2.1696.79 ± 1.1993.56 ± 2.6694.51 ± 0.8294.82 ± 1.55
Table 6. Classification results (%) with 30 training samples per class under the proposed ROP strategy. The best results are highlighted in bold.
Table 6. Classification results (%) with 30 training samples per class under the proposed ROP strategy. The best results are highlighted in bold.
1D-CNN2D-CNN3D-CNNViTMCVTDBDASSFTTCMRCNNMIEPNRDLNet
OA65.17 ± 2.1470.85 ± 2.6475.85 ± 0.8169.41 ± 10.6075.24 ± 3.0172.88 ± 2.3572.39 ± 5.1474.15 ± 2.6871.69 ± 5.5982.29 ± 2.35
PUAA73.26 ± 1.8279.14 ± 0.6483.11 ± 1.4482.42 ± 1.5682.31 ± 2.1182.88 ± 1.1480.49 ± 3.8183.56 ± 1.1881.14 ± 2.1689.22 ± 1.65
Kappa56.33 ± 2.7963.13 ± 2.5869.25 ± 0.8462.62 ± 10.2868.39 ± 3.5867.58 ± 2.9065.04 ± 6.1467.56 ± 2.9064.71 ± 5.9277.32 ± 2.84
OA87.75 ± 0.6690.27 ± 1.6191.85 ± 0.7891.56 ± 1.1090.68 ± 1.5991.71 ± 0.6591.43 ± 1.2290.09 ± 3.2991.35 ± 1.5292.80 ± 2.22
SAAA93.73 ± 0.3794.26 ± 1.1095.75 ± 0.7694.94 ± 1.2594.83 ± 1.4494.98 ± 0.4995.33 ± 1.3193.37 ± 3.2895.74 ± 0.8496.53 ± 2.32
Kappa86.39 ± 0.7289.18 ± 1.8390.92 ± 0.8790.61 ± 1.2289.63 ± 1.7689.88 ± 0.7390.46 ± 1.3888.99 ± 3.6391.47 ± 1.7191.97 ± 2.49
OA78.62 ± 0.8882.50 ± 3.1689.27 ± 1.0682.97 ± 2.2680.00 ± 7.4988.23 ± 1.2578.28 ± 10.3982.53 ± 6.5281.58 ± 2.8491.54 ± 1.06
XuzhouAA82.64 ± 0.8487.77 ± 2.6392.12 ± 0.7786.73 ± 3.5382.02 ± 10.1593.03 ± 1.1084.63 ± 3.8189.63 ± 2.7086.73 ± 1.8495.00 ± 0.51
Kappa73.53 ± 1.0178.53 ± 3.7786.59 ± 1.3578.62 ± 2.9575.40 ± 8.8785.04 ± 1.5473.69 ± 11.6078.74 ± 7.4677.20 ± 3.2789.42 ± 1.31
OA50.58 ± 1.0959.97 ± 3.3362.90 ± 3.0167.99 ± 3.3662.99 ± 4.0752.13 ± 2.9954.82 ± 12.0550.01 ± 14.0767.43 ± 3.7570.52 ± 1.57
HonghuAA48.32 ± 0.3860.82 ± 4.3663.15 ± 2.1667.09 ± 1.3764.63 ± 0.7365.21 ± 1.7158.67 ± 6.0656.92 ± 9.3365.50 ± 2.6368.59 ± 2.09
Kappa43.87 ± 1.1153.55 ± 3.6756.66 ± 3.2164.62 ± 3.5156.75 ± 3.8051.31 ± 2.9649.10 ± 10.7244.71 ± 12.5261.29 ± 4.0062.15 ± 1.51
OA85.74 ± 1.8067.27 ± 6.8578.98 ± 3.1079.00 ± 4.1476.78 ± 5.9186.90 ± 2.5173.04 ± 4.1872.76 ± 6.2277.14 ± 2.9090.82 ± 3.33
LongkouAA84.54 ± 1.0577.40 ± 2.6483.73 ± 1.3281.53 ± 3.8284.18 ± 3.1089.19 ± 1.4177.61 ± 5.6081.98 ± 2.5082.76 ± 2.5492.54 ± 2.55
Kappa81.87 ± 2.2161.00 ± 7.0574.02 ± 3.5873.66 ± 4.9871.60 ± 6.6383.13 ± 3.1467.02 ± 4.8067.04 ± 6.8971.70 ± 3.3788.28 ± 4.14
Table 7. Ablation results (%) of different branch combinations in rdlnet on the PU dataset under the ROP strategy. The symbol “✓” indicates that the corresponding branch is enabled, while “×” indicates that it is disabled. The best results are highlighted in bold.
Table 7. Ablation results (%) of different branch combinations in rdlnet on the PU dataset under the ROP strategy. The symbol “✓” indicates that the corresponding branch is enabled, while “×” indicates that it is disabled. The best results are highlighted in bold.
3D2D1DOAAAKappa
××81.5588.6776.22
××81.7789.1776.62
××82.5488.5777.21
×83.6089.8778.74
×84.5690.4880.00
×82.2089.1976.97
80.3587.0074.49
Table 8. Comparison of the mean values of rdlnet with and without ROP on five datasets (%).
Table 8. Comparison of the mean values of rdlnet with and without ROP on five datasets (%).
DatasetStrategyOAAAKappa
Without ROP83.5988.6078.96
PUWith ROP82.2989.2277.32
Difference−1.30+0.62−1.64
Without ROP95.0297.4194.44
SAWith ROP92.8096.5391.97
Difference−2.22−0.88−2.47
Without ROP93.1696.2891.51
XuzhouWith ROP91.5495.0089.42
Difference−1.62−1.28−2.09
Without ROP73.1871.7565.40
HonghuWith ROP70.5268.5962.15
Difference−2.66−3.17−3.25
Without ROP92.4594.2190.54
LongkouWith ROP90.8292.5488.28
Difference−1.63−1.67−2.26
Table 9. Model complexity comparison on PU dataset (pca = 30, patch size = 11 × 11).
Table 9. Model complexity comparison on PU dataset (pca = 30, patch size = 11 × 11).
ModelParametersFLOPs
1D-CNN55.1 K57.1 K
2D-CNN76.9 K1.06 M
3D-CNN6.12 M16.12 M
RDLNet5.24 M10.06 M
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Zhan, K.; Huo, Z.; Yin, Z.; Yang, Z. Rethinking Data Leakage in Patch-Based Hyperspectral Image Classification with Traditional Deep Networks. Remote Sens. 2026, 18, 979. https://doi.org/10.3390/rs18070979

AMA Style

Zhan K, Huo Z, Yin Z, Yang Z. Rethinking Data Leakage in Patch-Based Hyperspectral Image Classification with Traditional Deep Networks. Remote Sensing. 2026; 18(7):979. https://doi.org/10.3390/rs18070979

Chicago/Turabian Style

Zhan, Kaizhe, Zijie Huo, Zhijian Yin, and Zhen Yang. 2026. "Rethinking Data Leakage in Patch-Based Hyperspectral Image Classification with Traditional Deep Networks" Remote Sensing 18, no. 7: 979. https://doi.org/10.3390/rs18070979

APA Style

Zhan, K., Huo, Z., Yin, Z., & Yang, Z. (2026). Rethinking Data Leakage in Patch-Based Hyperspectral Image Classification with Traditional Deep Networks. Remote Sensing, 18(7), 979. https://doi.org/10.3390/rs18070979

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop