  In astronomy, spectroscopy consists of observing an astrophysical source and
extracting its spectrum of electromagnetic radiation. Once extracted, a model
is fit to the spectra to measure the observables, leading to an understanding
of the underlying physics of the emission mechanism. One crucial, and often
overlooked, aspect of this model is the background emission, which contains
foreground and background astrophysical sources, intervening atmospheric
emission, and artifacts related to the instrument such as noise. This paper
proposes an algorithmic approach to constructing a background model for SITELLE
observations using statistical tools and supervised machine learning
algorithms. We apply a segmentation algorithm implemented in photutils to
divide the data cube into background and source spaxels. After applying a
principal component analysis (PCA) on the background spaxels, we train an
artificial neural network to interpolate from the background to the source
spaxels in the PCA coefficient space, which allows us to generate a local
background model over the entire data cube. We highlight the performance of
this methodology by applying it to SITELLE observations obtained of a SIGNALS
galaxy, \NGC4449, and the Perseus galaxy cluster of galaxies, NGC 1275. We
discuss the physical interpretation of the principal components and noise
reduction in the resulting PCA-based reconstructions. Additionally, we compare
the fit results using our new background modeling approach to standard methods
used in the literature and find that our method better captures the emission
from HII regions in NGC 4449 and the faint emission regions in NGC 1275. These
methods also demonstrate that the background does change as a function of the
position of the datacube.
