# Domain-Invariant Few-Shot Contrastive Learning for Hyperspectral Image Classification
## 3 Proposed Method
### Dataset and Evaluation Metrics  
To assess the effectiveness of our proposed model, we utilized the widely recognized Chikusei dataset as the source domain and selected three other well-regarded datasets for the target domains: the University of Pavia (UP), Indian Pines (IP), and Salinas. We chose these datasets because they represent diverse environments and categories, aiding in the evaluation of the model's capacity for generalization. Additionally, the complexity varies among these datasets, making them ideal for testing the model's adaptability across different levels of challenge. The UP dataset, depicted in Figure 4, offers a spatial resolution of 1.3 m, dimensions of 610 \(\times\) 340 pixels, encompasses 103 spectral bands from 430-860 nm, and includes nine distinct land cover categories. Further details about sample counts and category names are available in Table 1. Notably, the UP dataset captures various urban land cover types and materials. The IP dataset, shown in Figure 5, features a spatial resolution of 20 m, dimensions of 145 \(\times\) 145 pixels, covers 200 spectral bands from 400-2500 nm, and includes 16 land cover categories. Additional information on samples and categories is provided in Table 2. This dataset primarily includes agricultural and forested land types. The Salinas dataset, presented in Figure 6, has a spatial resolution of 3.7 m, dimensions of 512 \(\times\) 217 pixels, spans 204 spectral bands from 400-2500 nm, and comprises 16 land cover categories. Details regarding sample numbers and category names are listed in Table 3, with a focus on various regional and crop types.  
To gauge the classification efficacy of all methods, we employed three performance metrics: Overall Accuracy (OA), which measures the ratio of correctly identified pixels against the total pixel count; Average Accuracy (AA), which calculates the mean of precision values for each category; and the Kappa coefficient (Kappa), a statistical indicator that evaluates classification precision while accounting for the likelihood of chance classification.  
\begin{table}
\begin{tabular}{c c c c} \hline
**Class** & **Name** & **Train Samples** & **Total Samples** \\ \hline
1 & Asphalt & 5 & 6631 \\
2 & Meadows & 5 & 18,649 \\
3 & Gravel & 5 & 2099 \\
4 & Trees & 5 & 3064 \\
5 & Painted metal & 5 & 1345 \\
6 & Bare Soil & 5 & 5029 \\
7 & Bitumen & 5 & 1330 \\
8 & Self-Blocking-Bricks & 5 & 3682 \\
9 & Shadows & 5 & 947 \\ \hline  & Total Samples & 45 & 42,776 \\ \hline \end{tabular}
\end{table}
Table 1: Class name and corresponding sample number in the UP dataset.  
Figure 4: (**a**) False-color image, (**b**) ground-truth image, and label color of UP dataset.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Class** & **Name** & **Train Samples** & **Total Samples** \\ \hline
1 & Alfalfa & 5 & 46 \\
2 & Corn-notill & 5 & 1428 \\
3 & Corn-mintill & 5 & 830 \\
4 & Corn & 5 & 237 \\
5 & Grass-pasture & 5 & 483 \\
6 & Grass-trees & 5 & 730 \\
7 & Grass-pasture-mowed & 5 & 28 \\
8 & Hay-windrowed & 5 & 478 \\
9 & Oats & 5 & 20 \\
10 & Soybean-notill & 5 & 972 \\
11 & Soybean-mintill & 5 & 2455 \\
12 & Soybean-clean & 5 & 593 \\
13 & Wheat & 5 & 205 \\
14 & Woods & 5 & 1265 \\
15 & Buildings-Grass-Trees-Drives & 5 & 386 \\
16 & Stone-Steel-Towers & 5 & 93 \\ \hline  & Total Samples & 80 & 42,776 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Class name and corresponding sample number in the IP dataset.  
Figure 5: (**a**) False-color image, (**b**) ground-truth image, and label color of IP dataset