2.1. Image Background Modeling and Suppression
In a hyperspectral image, each band corresponds to a distinct image. By drawing inspiration from foreground detection techniques in image processing and extending these methods to hyperspectral image analysis, it becomes possible to analyze each spectral band image, thereby effectively identifying the regions of gas plumes.
In constructing the background model, our approach is inspired by the initialization principle of the foundational ViBe [
23,
25] algorithm, which leverages spatial information to build a model from a single frame. We adapted and extended this principle for hyperspectral imagery. Considering that infrared images often have lower resolution and less distinct texture than visible-light images, relying on a single spectral band may not provide sufficient sample diversity for a robust initial model.
Therefore, to enhance diversity, we selected a small set of initial bands for background modeling. As a common characteristic of hyperspectral imaging systems, which often span hundreds of contiguous spectral bands, the channels at the very beginning of the instrument’s operational range are typically less likely to contain the primary absorption features of many target gases. Based on this principle, we chose the first three spectral bands as our initial background sources. This choice was then validated for our specific experiments; for the hyperspectral imaging spectrometer used, the first three bands were located at the short-wavelength edge of the instrument’s range and, according to the NIST (National Institute of Standards and Technology) reference spectra, contained no measurable absorption features for both ammonia and methanol. We note that this selection criterion is instrument-dependent and gas-specific; for other sensors or target gases, the appropriate non-absorption bands should be determined based on the instrument’s spectral coverage and the target’s known spectral characteristics.
To further enrich the model, we then introduced a spatial neighborhood random sampling strategy. For each of the three initial single-band images, two additional images were generated by replacing each pixel’s value with one randomly selected from its 8-connected neighborhood. By applying this operation to each of the three initial bands, the original 3 images were expanded to a set of 9 images. Thus, the background model
M(
x) for a pixel at position
x consisted of the
N = 9 pixel values from this expanded set. It should be noted that while ‘three’ serves as a practical choice for the number of initial bands in this study, this parameter can be adapted based on the specific characteristics of the sensor and the scene. The background sample
M(
x) at position
x can be expressed as follows:
For a hyperspectral image with dimensions
H ×
W ×
B (where H denotes the image height,
W denotes the image width, and B denotes the number of bands), the constructed background model comprises
W ×
H ×
N sample values. Here,
M(
x) is a three-dimensional vector with dimensions
H ×
W ×
N, which can be understood as a collection of
N images. The process of constructing the background sample model is shown below (
Figure 2).
After constructing the background model, plume detection was performed on the images of each band. Let the pixel value of a pixel x in the image of the n-th band (n > 3) be pn(x).
For pixel
x, we compute the absolute difference against all corresponding sample points in
M(
x) and sum these differences to obtain Δ
s, which serves as a quantitative measure of the pixel’s deviation from the background model. The scalar quantity Δ
s undergoes continuous updates in response to band changes. The equation for Δ
s is given as follows:
where
pn(
x) represents the pixel value at spatial position
x within the
n-th band, and
p1,
p2, …,
pN are the corresponding sample points in the background model
M(
x).
Define a circular region
SR of radius
R centered at pixel
x. If the number of background samples within this circular region is greater than or equal to the preset threshold
D, pixel
x is classified as a background pixel; otherwise, it is classified as a plume pixel, as illustrated in
Figure 3.
To adapt to changes in the environment and background, it is necessary to update the background model after the detection process. This is achieved by randomly replacing a pixel value in the background model of a pixel detected as non-plume with a corresponding pixel value from the current frame. This approach dynamically incorporates the latest scene information into the background model. Once the current band image is processed, the next band image is analyzed, enabling plume detection for each band image in the hyperspectral dataset. Since the target gas typically exhibits absorption or emission peaks, the plume regions in the images are more pronounced when the selected band is located near the strongest peak region. We established a gas spectral database including precise information on the positions of characteristic absorption peaks for various gases. The standard reference spectra for target gases were sourced from the NIST Chemistry WebBook. The NIST database provides high-resolution transmittance spectra, which must be adapted to be comparable with the lower-resolution data acquired by our hyperspectral instrument.
To achieve this, a spectral resampling process was performed. For each target gas, its high-resolution spectrum from NIST was interpolated to match the exact band centers and spectral resolution of our experimental data. For example, for the simulated and measured ammonia datasets, the reference spectrum was resampled to 162 bands spanning 870 cm
−1 to 1250 cm
−1. This process ensures that the reference spectrum and the measured spectra are directly comparable on a band-by-band basis. The adapted, instrument-specific reference spectrum was then used for two purposes: (1) to guide the initial plume detection (
Section 2.1), where the result from the single band corresponding to the spectrum’s strongest absorption feature is ultimately used to determine the primary plume region; and (2) its resampled spectral vector was used for the correlation-based edge refinement (
Section 2.2).
To enhance both the efficiency and accuracy of gas plume detection and identification, we implemented a staged approach. In the preliminary detection phase, we focused on the strongest absorption band of the target gas, leveraging its prominent absorption features to effectively localize the plume region spatially. This approach also reduces computational complexity. However, relying on a single band for detection presents certain limitations, particularly in terms of potential false alarms or omissions, especially at the plume edges. This initial detection determines the primary spatial distribution of the target gas, which is then refined in a subsequent post-processing stage to improve edge accuracy.
2.2. Post-Processing of Edge Regions
After detecting the plume region, further analysis is required to determine whether it corresponds to the target gas. Pixel spectra detected as belonging to the plume region need further processing to produce a representative spectrum. This is achieved through one of the following approaches: principal component analysis (PCA), which involves selecting the primary eigenvectors of the plume pixel spectra to reconstruct a representative spectrum and effectively suppress noise, and the averaged spectral method, which calculates the averaged spectrum of the plume region as the basis for subsequent discrimination. We employed the averaged spectral method. This approach generates representative spectra by averaging the pixel spectra within the plume region, which serves as the foundation for subsequent identification. We selected the averaged spectral method primarily due to its computational efficiency. Moreover, in this study, the approximate boundaries of the gas plume were predefined, and the spectral features within the plume region were relatively homogeneous. As such, the averaged spectral method effectively captures the overall spectral characteristics of the plume region. In contrast, PCA reconstructs representative spectra by selecting the principal eigenvectors, which helps to effectively suppress noise and is typically employed in cases where spectral data are heavily contaminated by noise. The resulting representative spectrum is then compared with a standard spectrum or pre-established gas spectral libraries using similarity metrics such as the spectral angular distance or correlation coefficient. If the similarity exceeds a predefined threshold, the target gas class within the plume region can be reliably detected.
The edge of a gas plume is typically characterized by its thinness and dispersion in space, resulting in weakened spectral features. This makes traditional approaches, such as plume detection or spectral similarity discrimination, prone to omissions and misdetections in the edge regions of the plume. To address this challenge, this study builds upon existing detection and category identification methods while considering the unique characteristics of the plume edge. Recognizing that reliance on a single index is susceptible to interference, we propose a spatial-spectral integrated discrimination operator. The operator is defined by the following equation:
Here, Δ
s represents the sum of the absolute differences between the pixel values of the current band image and the background model. When the pixel values of the current band image are close to the background model, Δ
s is small, suggesting that the region is unlikely to exhibit gas absorption features. Conversely, when the pixel values deviate significantly from the background model, Δ
s increases, indicating a higher likelihood of the presence of gas absorption features. Therefore, Δ
s serves as an indicator of spatial image variability, with larger values reflecting greater discrepancies between the image and the background model, and a higher probability of gas presence.
rλ denotes the correlation coefficient between the spectra of neighboring pixels and the standard spectrum, indicating their spectral similarity.
α and
β are weight coefficients that control the relative influence of spatial variability and spectral correlation within the combined judgment operator, and
α +
β = 1.
R denotes the radius of the circular region
SR centered at pixel
x, which is used to evaluate the spatial consistency of local background samples.
D is a threshold indicating the minimum number of background pixels required within
SR; it helps determine whether a pixel is classified as background or plume, as previously defined after Equation (2).
Tλ serves as a threshold for spectral correlation to normalize the correlation coefficient. When
Cs > 1, the plume region can be approximately identified using the image foreground detection method. Similarly, when
Cλ > 1, the spectral judgment operator identifies the point as a target pixel. The spectral similarity component, C
λ, is crucial for this refinement. The rationale for using spectral data here is that while the initial detection relies on the strongest absorption band for efficiency, the edge regions consist of mixed pixels where this single peak may be weak or noisy. However, the overall shape of the spectrum may still retain the characteristic signature of the gas, providing a more robust basis for identification. The mechanism for calculating this similarity is as follows: for each pixel being evaluated in the expanded edge region, its spectral vector is correlated against the standard spectrum signature of the target gas (obtained from the NIST database). We employed the Pearson correlation coefficient (
rλ) for this purpose. This process yields a scalar similarity score that quantifies how closely the pixel’s spectral “fingerprint” matches that of the target gas, ensuring a reliable refinement of the plume boundary. Our operator integrates both image-based and spectral-based detection methods. The contour plot of the combined judgment operator is presented in
Figure 4, using
α =
β = 0.5 and
Csp = 0.8 as an example. In this coordinate plane, regions with horizontal coordinates greater than 1 represent pixels identified as targets through plume detection, while regions with vertical coordinates greater than 1 correspond to pixels identified as targets through spectral correlation identification. The upper-right corner region of the contour line (here 0.8) characterizes that the combined judgment operator ultimately judged them as targets.
In this study, a neighborhood expansion technique is employed to process the edges. Specifically, the method centers on the initially detected edge points and expands them within a 5 × 5 pixel neighborhood to extend the edge line into the edge region, thus enabling more effective detection over a larger area. Subsequently, the expanded edge region is analyzed using a comprehensive discriminant operator. The threshold value for this operator is determined experimentally for each target gas species. Through repeated experiments, the optimal threshold parameter that best distinguishes the gas plume from the background is selected, taking into account the spectral characteristics of different gases. If the value of the integrated discriminant operator exceeds the predefined threshold, the pixel is classified as part of the gas plume; otherwise, it is regarded as background or noise. The detection process continues iteratively until the overlap between the foreground regions detected in successive iterations exceeds a preset threshold of 80% [
26,
27], at which point the edge detection process is considered complete. This post-processing step is designed to enhance the algorithm’s sensitivity to weak edge features while minimizing the accumulation of errors from pseudo-edge information during the iteration process.
The time complexity of our method reflects a strategic trade-off. Its initial detection stage has a complexity of O(Bpeak × H × W × N), where H and W are the image dimensions, N is the number of background samples, and Bpeak is the band index of the target’s strongest absorption peak. This stage is theoretically faster on average than a full-cube analysis because it often terminates early (Bpeak < B, where B is the total number of bands), significantly reducing the computational load. The algorithm then adds a computationally intensive post-processing stage with a complexity of O(Iiter × Pedge × Khood × B), where Iiter is the number of iterations, Pedge is the number of detected edge pixels, and Khood is the neighborhood size for refinement. Although this second stage involves spectrum operations, its computational cost is localized to a very small subset of pixels (Pedge). By minimizing computation in the initial stage and concentrating resources on a targeted, high-precision refinement of edge pixels, the method achieves an effective balance between overall computational efficiency and localized accuracy.
2.3. Experimental Datasets
To evaluate the effectiveness of the proposed method, a set of simulated hyperspectral images is first used in this study for experiments. The advantage of using simulated data lies in its ability to provide explicit ground truth, which refers to known information about the actual target, an essential component for evaluating the accuracy and performance of the algorithm. By embedding an ammonia plume into an existing hyperspectral image background, a simulated hyperspectral image containing ammonia is generated, allowing for precise control over the target features. The algorithm’s performance in target detection and identification is then comprehensively evaluated by comparing the results with the known ground truth. Additionally, two sets of constrained hyperspectral images are employed in this study to further validate the algorithm. The use of real-world data enhances the evaluation by testing the algorithm’s effectiveness and robustness in practical scenarios, thus ensuring its reliable performance in complex environments.
Unlike traditional image simulation and spectral simulation methods, hyperspectral image simulation requires not only the simulation of the 2D gas plume distribution but also the consideration of the spectral characteristics of the plume region. Since the background temperature variation at different locations significantly impacts the simulated spectra, we selected a 100 × 100-pixel region in the lower left corner of the field of view, where the temperature difference is relatively small, as the background. This was done within a 320 × 256-pixel hyperspectral image with 162 bands in the spectral range of 870 cm
−1 to 1250 cm
−1, and the corresponding hyperspectral image was acquired. The background averaged images are shown in
Figure 5, where the left map represents the averaged image of the hyperspectral image (320 × 256 pixels), and the right map shows the averaged image of the background extracted from the 100 × 100 pixels in the lower left corner. The averaged image is solely intended to illustrate the composition of the scene. The final image will overlay the gas plume detection results on this background to present the complete visualization.
Figure 5 shows an averaged visual representation of the selected background scene. In the subsequent simulation process, the underlying hyperspectral data from this region served as the radiometric foundation, upon which a synthetic gas plume was superimposed to generate the test data.
In the process of generating gas hyperspectral images, a simulation framework was designed based on gas-free hyperspectral images and standard gas spectra to produce hyperspectral images containing gas plumes of various shapes. First, a 2D plume concentration distribution map was generated using computational fluid dynamics (CFD) [
28,
29] software. The 2D plume concentration distribution map, along with its schematic overlay on the background averaged image, is shown in
Figure 6. The concentration levels are visualized through the chromatic scale, where warmer hues indicate higher molar concentrations.
On this basis, the spectra of the plume regions were simulated using the standard spectra of the gas and the plume concentration distribution, while the spectra of the non-plume regions were derived from the background spectra at their respective positions. Finally, the simulation of the infrared hyperspectral image of the gas was completed by arranging the spectra of both the plume and background regions to form the complete hyperspectral image (data cube).
For infrared spectral simulations in the plume region, the process can be modeled using a passive infrared telemetry three-layer radiative transfer model [
30,
31,
32], as illustrated in
Figure 7.
In this model, layer 1 represents the atmosphere between the gas cloud and the spectrometer, layer 2 corresponds to the target gas cloud, and layer 3 is the background.
Let
L denote the radiance received by the spectrometer, and
represent the transmittance of layer
. Let
denote the blackbody radiance at the temperature of layer
i, and
L3 denote the background radiance. The radiance at the instrument’s entrance, considering the presence of clouds, is given as follows:
where
denotes the gas cloud transmittance, α represents the absorption coefficient of the gas cloud,
C represents the concentration, and
L denotes the effective path length. When combined, the product
CL refers to the column density.
The radiance at the instrument’s entrance in the absence of gas clouds can be expressed as follows:
It is generally assumed that the first atmospheric layer is thin, and its transmittance
is close to 1, such that
. As the gas cloud diffuses, it exchanges heat with the atmosphere, causing the gas cloud temperature to rapidly approach the atmospheric temperature. Consequently, the gas cloud temperature can be approximated as the atmospheric temperature, and thus
. Therefore, in the presence of a gas cloud, the radiance at the instrument entrance can be expressed as follows:
Based on the above equation, different synthesized gas spectra can be obtained by varying the
CL values and environment temperatures for specific target gases.
Figure 8 shows an example of this synthesis process.
Figure 8a displays a measured background spectrum (corresponding to the term
L0 in the model). In contrast,
Figure 8b illustrates the resulting simulated spectrum (
L) after the forward model Equation (6) is applied to account for the spectral effects of an ammonia plume. This synthesis approach allows the algorithm’s performance to be evaluated under precisely controlled conditions.
Additionally, two sets of constrained hyperspectral images were employed in this study to further validate the algorithm. The use of real-world data enhances the evaluation by testing the algorithm’s effectiveness and robustness in practical scenarios, thus ensuring its reliable performance in complex environments. Measured dataset 1 consists of a hyperspectral image from a scene containing ammonia gas. The data have a resolution of 320 × 256 pixels and span 162 spectral bands, ranging from 870 cm
−1 to 1250 cm
−1 [
33]. An averaged image of the hyperspectral cube is presented in
Figure 9a, depicting the scene of this real-world experiment. Measured dataset 2, acquired using the Telops Hyper-Cam, contains methanol gas with a resolution of 128 × 128 pixels and a spectral range of 165 bands, covering 867 cm
−1 to 1288 cm
−1 [
34]. The averaged images of both hyperspectral datasets are presented in
Figure 9b.
Previous studies on passive infrared standoff detection have reported typical operational parameters for successful gas identification. For example, gas plumes have been reliably detected at distances ranging from several meters to the kilometer scale, including approximately 1.3–3 km in industrial and urban monitoring scenarios [
8,
35]. Stable detection performance has been documented under moderate wind conditions (about 3–6 m/s) and with various gas release rates (e.g., 8–10 g/s) [
36]. These works also emphasize the importance of a sufficient thermal contrast between the plume and its background for maintaining signal detectability.
The literature consistently shows that these parameters critically influence detection performance. Thermal contrast is the dominant factor controlling signal strength; wind speed and direction determine plume geometry and dispersion; and the release rate directly affects the in-plume gas concentration. Deviations in any of these parameters can substantially alter the detectability of the target gas.
In our measured datasets, exact values for parameters such as sensor-to-plume distance, meteorological conditions, and release rates were not systematically obtained. Nevertheless, the measurements were conducted within the operational envelope reported in prior studies, ensuring that the acquired data remain representative for testing algorithmic robustness under realistic and complex monitoring conditions.