11institutetext: School of Astronautics, Harbin Institute of Technology,
Harbin, China 22institutetext: Insight Centre for Data Analytics, Dublin,
Ireland 33institutetext: School of Computer Science and Technology, Harbin
Institute of Technology, Weihai, China
33email<EMAIL_ADDRESS><EMAIL_ADDRESS>
# Can We Transfer Noise Patterns? A Multi-environment Spectrum Analysis Model
Using Generated Cases

Haiwen Du 1122 Zheng Ju 22 Yu An 22 Honghui Du 22 Dongjie Zhu 33
Zhaoshuo Tian 11 Aonghus Lawlor 22 Ruihai Dong 22

###### Abstract

Spectrum analysis systems in online water quality testing are designed to
detect types and concentrations of pollutants and enable regulatory agencies
to respond promptly to pollution incidents. However, spectral data-based
testing devices suffer from complex noise patterns when deployed in non-
laboratory environments. To make the analysis model applicable to more
environments, we propose a noise patterns transferring model, which takes the
spectrum of standard water samples in different environments as cases and
learns the differences in their noise patterns, thus enabling noise patterns
to transfer to unknown samples. Unfortunately, the inevitable sample-level
baseline noise makes the model unable to obtain the paired data that only
differ in dataset-level environmental noise. To address the problem, we
generate a sample-to-sample case-base to exclude the interference of sample-
level noise on dataset-level noise learning, enhancing the system’s learning
performance. Experiments on spectral data with different background noises
demonstrate the good noise-transferring ability of the proposed method against
baseline systems ranging from wavelet denoising, deep neural networks, and
generative models. From this research, we posit that our method can enhance
the performance of DL models by generating high-quality cases. The source code
is made publicly available online at https://github.com/Magnomic/CNST.

###### Keywords:

1D data denoising Noise patterns transferring Spectrum analysis Signal
processing.

##  1 Introduction

Laser-induced fluorescence spectrum (LIFS) analysis is used to interpret
spectrum data obtained via laser-induced fluorescence (LIF) spectroscopy in a
specific range of wavelengths, frequencies, and energy levels [9]. Its
advantages include the high sampling frequency, high accuracy, and easy
deployment, making it a popular water quality monitoring approach [26, 2].
However, avoiding the impact of the noise on the analysis results is
challenging for multi-environment deployment because the noise is caused by
changes in weather, temperature, or water impurities [15, 25].

Denoising is essential in analysing spectral and other one-dimensional (1D)
data, as it can improve the accuracy and reliability of subsequent analyses.
Traditional methods that rely on mathematical models or filters (e.g., moving
average or wavelet transformation) can reduce high-frequency or specific noise
patterns while consuming less computing resources [20]. However, they cannot
learn complex nonlinear relationships between the noisy and the corresponding
clean signal. Deep learning(DL)-based denoising methods use a data-driven
approach. They are trained on a large dataset to learn the underlying patterns
and relationships between the data [4, 12].

Nevertheless, we found limitations in this approach due to the complex noise
sources and noise patterns in LIFS. Specifically, we cannot obtain paired
clean-noisy data to analyse the noise pattern between two datasets because the
noise in spectral data is from both baseline noise $\xi$ and environmental
noise $N$ [1, 19]. Environmental noise arises from backgrounds, light sources
and other stable factors over time, exhibiting differences at the dataset-
level. The baseline noise originates from random disturbances during the
sampling process, such as baseline drift, which is present even in laboratory
environments. Different from environmental noise, baseline noise shows
differences at the sample-level, i.e., every sample has different baseline
noise. However, as both noise sources are low-frequency and superimposed on
the signal, extracting only the environmental noise from the LIFS to train a
noise patterns transferring model is complex. We can only feed the samples
with both environmental noise and baseline noise differences to the noisy
pattern learning model, which is inefficient.

In this paper, we propose a method to enhance the performance of denoising
models based on generated cases, i.e., we generate paired samples that differs
only in environmental noise. In turn, we learn the differences to achieve
noise pattern transformation. Firstly, the model extracts noise patterns from
a dataset-to-dataset (D2D) case-base that consists of two groups of samples
from dataset $D_{\mathbb{T}}$ and dataset $D_{\mathbb{S}}$. Then, we generate
a sample-to-sample (S2S) case-base in which all pairs of the sample differ
only in going from environmental noise $N_{\mathbb{S}}$ to $N_{\mathbb{T}}$
($N_{\mathbb{S-T}}$). Finally, we train a noise patterns transferring model
using the S2S case-base. The highlights are:

1\. we develop a noise transfer model to transfer the environmental noise
pattern $N_{\mathbb{S}}$ of dataset $D_{\mathbb{S}}$ into the environmental
noise pattern $N_{\mathbb{T}}$ of dataset $D_{\mathbb{T}}$ (also denoising
when $D_{\mathbb{T}}$ is environmental noise-free);

2\. propose a network structure for extracting environmental noise
$N_{\mathbb{S}}$, signal $X$, and baseline noise $\xi_{T}$ from a D2D case $S$
and $T$, thereby generating a new sample $G$ that only have environmental
noise pattern differences $N_{\mathbb{S-T}}$ with sample $T$. It is the first
work to enhance the learning performance of denoising models by generating new
cases; and

3\. verify the contribution of our model on 1D LIFS noise patterns
transferring tasks. It significantly improves the performance of chemical
oxygen demand (COD) parameter analysis model under different noise patterns.

In the following section, we discuss relevant related work and present
motivations for this work. Section 3 presents the proposed model that captures
noise pattern differences between signals in a different dataset. In Section
4, we describe the experimental setup. Then, Section 5 presents and analyses
the evaluation results. Section 6 concludes the paper and discusses future
work.

##  2 Background and Motivation

###  2.1 Problems in Traditional Denoising Models

In LIF spectroscopy, noise can arise from various sources, including
electronic noise in the sensors, light source fluctuations, and sample matrix
variations. It can affect the LIFS analysis process by introducing artefacts,
such as spurious peaks or baseline drift, that can obscure or distort spectral
features associated with water quality parameters [24]. For example, baseline
drift is a noise that can make it challenging to identify and quantify the
fluorescence peaks accurately. Similarly, high-frequency noise can introduce
spurious peaks in the spectra that can be misinterpreted as actual spectral
features [17]. Therefore, avoiding the noise’s influence on the analysis
result is vital for researchers in analysing LIFS.

Various denoising techniques can mitigate noise in LIFS, such as smoothing
algorithms or wavelet transform-based methods [20]. These methods can remove
parts of noise while preserving the spectral features of interest. Another
popular approaches are machine learning algorithms, such as DNNs [8]. Compared
with traditional methods, their adaptability to various noise types and their
robustness to complex scenes make DNNs an attractive option for denoising
tasks.

Nevertheless, we are facing a dilemma in applying DNNs, which is caused by the
internal noise, i.e., even in the laboratory environment, the spectral data
still carries low-frequency noise because of fuzzy factors such as baseline
drift. To make matters worse, the two measurements for the same water sample
show different internal noise patterns. For datasets $D_{\mathbb{S}}$ and
dataset $D_{\mathbb{T}}$ collected in different environments, when we try to
transfer the environmental noise pattern of a sample $S$ in dataset
$D_{\mathbb{S}}$ into the environmental noise pattern of dataset
$D_{\mathbb{T}}$, which have the relations in Eq. 1, where $S$ and $T$ are the
LIFSs of the same water sample $X$ in $D_{\mathbb{S}}$ and $D_{\mathbb{T}}$,
$N_{\mathbb{S}-\mathbb{T}}$ is the environmental noise difference (dataset-
level) between $D_{\mathbb{S}}$ and $D_{\mathbb{T}}$, $\xi_{S}$ and $\xi_{T}$
are the internal noise (sample-level) in samples $S$ and $T$.

$\displaystyle S=X+N_{\mathbb{S}}+\xi_{S}$ (1) $\displaystyle
T=X+N_{\mathbb{T}}+\xi_{T}$ $\displaystyle
N_{\mathbb{S}-\mathbb{T}}=N_{\mathbb{T}}-N_{\mathbb{S}}$

We find that it does not satisfy the relationship in Eq. 2 but in Eq. 3. Then,
we give examples in Fig. 1 to better represent the terms in noise patterns.

$T=S-N_{\mathbb{S}-\mathbb{T}}$ (2)
$T=S-N_{\mathbb{S}-\mathbb{T}}-\xi_{S}+\xi_{T}$ (3)

Figure 1: We provide LIFS examples of two standard solutions in different
environments. The blue boxes show that each sample has a different internal
noise $\xi$, even from the same dataset. The red boxes show the environmental
noise $N$, at the dataset level, are shared by all the samples in the same
dataset, respectively. For ease of presentation, all $S$ and $T$ that occur
together in the following paper represent samples corresponding to the same
water sample.

Unfortunately, the DNN models show bad performance when learning the dataset-
level noise pattern transformation from $N_{\mathbb{S}}$ to $N_{\mathbb{T}}$
because of the existence of sample-level noise $\xi_{S}$ and $\xi_{T}$.

###  2.2 Studies Related to Noise Pattern Transferring

Since internal noise is inevitable in LIFS, we hope all the samples have the
same environmental noise patterns by removing their environmental noise
patterns differences. With this, we only need to train the analysis model in
one environmental noise pattern. Then we can process the data in various
environments by transferring their environmental noise to the target pattern
[6].

We refer to the generative methods, which use the LIFS of the same standard
solution in different environments as cases. Therefore, noise pattern
differences can be learned by analysing these cases and applied to transfer
noise patterns of unknown samples. However, directly training a DNN-based
noise-transferring model like DnCNN [27] using these cases is less efficient
because the internal noise is sample-level low-frequency noise and
superimposed on the signal and environmental noise.

We have two feasible approaches to achieve it. The first is to design a model
that does not strictly require pairwise data for training, which CycleGAN [14]
represents. CycleGAN uses an adversarial and cycle consistency loss,
encouraging the network to learn a consistent mapping between the two domains.
Recently, CycleGAN has been used to suppress unknown noise patterns and get
satisfactory results in 1D signal processing, such as audio and seismic traces
[11].

Alternatively, we create new cases that have environmental noise (dataset-
level) difference but the same internal noise (sample-level). Compared with
CycleGAN, it is more explainable and provides a much more guided process. It
is challenging to extract only environmental noise because internal noise is
superimposed on it. Although both internal noise and environmental noise are
low-frequency noise, the frequency of the internal noise is slightly higher
than the environmental noise. It means that the curve fluctuations caused by
internal noise are in the smaller wavelength range. As the feature maps in
deep convolutional neural network (DCNN) can help to generate cases [13] and
feature information [22], we try to use a pre-trained DCNN to extract these
noise patterns separately. Based on the theory that the deeper the
convolutional layer is, the more pooling layers it passes through and the
increasing range of its extracted features[23], we propose the hypothesis that
deeper convolutional layers can better extract the environmental noise
$N_{\mathbb{S}}$ and signal $X$ of the samples in datasets $D_{\mathbb{S}}$,
and shallower convolutional layers can better extract the internal noise
$\xi_{T}$ of the samples in datasets $D_{\mathbb{T}}$. We can use them and
generate a sample $G=X+N_{\mathbb{S}}+\xi_{T}$ such that its difference from
$T$ is $N_{\mathbb{S}-\mathbb{T}}$, as shown in Fig. 2.

Figure 2: We provide an example of our hypothesis. Sample $S$ and sample $T$
are fed into the DCNN to get their feature maps on deep and shallow
convolutional layers, which correspond to extracting internal noise and
environmental noise (also the signal). Then, we use this information to
synthesise $G$.

##  3 Noise Patterns Transferring Model

Since the samples in different datasets have both sample-level (noise
difference in internal noise) and dataset-level (noise difference in
environmental noise) noise pattern differences, traditional solutions meet
difficulties when trying to extract and learn environmental noise without the
interference of internal noise. This section details our generated cases
(GC)-based method to achieve noise patterns transferring. The overall workflow
of our method is shown in Fig. 3.

Figure 3: The workflow of our method. $D_{\mathbb{S}}$ and $D_{\mathbb{T}}$
are collected in different environments. Firstly, we randomly select a case
from D2D case-base, i.e., $S$ and $T$ and feed them with an initialised sample
$G$ into the pre-trained 1D DCNN model for extracting their feature maps.
Secondly, we get the generated $G$ by minimising the loss using the feature
maps of $G$, $S$ and $T$. Then we get an S2S case that is consisted of $G$ and
$T$, which with the same $\xi_{T}$ and only differ in $N_{\mathbb{S}}$ and
$N_{\mathbb{T}}$. Finally, we use all of the generated S2S cases, i.e., S2S
case-base, to train the curve noise patterns transferring (CNPT) model, which
can transfer the noise patterns of samples from $N_{\mathbb{S}}$ to
$N_{\mathbb{T}}$.

###  3.1 D2D Case-base and S2S Case-base

Our system has two case-bases, D2D case-base and S2S case-base, if we want to
transfer the environmental noise pattern $N_{\mathbb{S}}$ in $D_{\mathbb{S}}$
to the environmental noise pattern $N_{\mathbb{T}}$ in $D_{\mathbb{T}}$, a D2D
case is a sample $S$ in $D_{\mathbb{S}}$ and random sample $T$ in
$D_{\mathbb{T}}$ that is measured using the same standard solution but under
different environments. Although all of the S2S and D2D cases have the same
$N_{\mathbb{S}-\mathbb{T}}$, D2D cases have different internal noise while S2S
cases have the same internal noise. In other words, an S2S case is a pair of a
sample $G$ in $D_{\mathbb{G}}$ and a sample $T$ that has the same internal
noise $\xi_{T}$ but differs in $N_{\mathbb{S}}$ and $N_{\mathbb{T}}$.

Since S2S cases cannot be directly obtained by LIF spectroscopy because of the
existence of internal noise, to learn the pattern of
$N_{\mathbb{S}-\mathbb{T}}$, the first step is to generate S2S cases using the
D2D case-base that satisfies Eq. 4.

$G=T+N_{\mathbb{S}-\mathbb{T}}$ (4)

According to Eq. 1, $G$ can be represented as Eq. 5.

$\displaystyle G$ $\displaystyle=S-\xi_{S}+\xi_{T}$ (5)
$\displaystyle=X+N_{\mathbb{S}}+\xi_{T}$

To this step, we get a S2S case, i.e., $G$ and $T$, because they only have the
difference in $N_{\mathbb{T}}$ and $N_{\mathbb{S}}$. It enables us to train a
model that can learn the pattern of this transformation. The key point,
therefore, is how to extract $X$, $N_{\mathbb{S}}$ and $\xi_{T}$ from D2D
case-base.

###  3.2 S2S Cases Generating Model

According to the hypothesis in section 2.2, we propose a ‘feature extraction-
matching’ method to generate $G$ in the S2S case. Firstly, we use a pre-
trained DCNN-based 1D LIFS analysis model that contains multiple convolutional
and pooling layers to extract features. Then, we initialise $G$ and design a
loss function that makes the feature of $G$ approximate $X$, $\xi_{T}$, and
$N_{\mathbb{S}}$ from the D2D case. Lastly, we get an S2S case that is
consisted of $G$ and $T$ by minimising the loss.

As $X$, $N_{\mathbb{T}}$ and $\xi_{T}$ are wavelength (x-axis) related but
show different signal frequency features. We propose a loss function
$\mathcal{L}_{total}$ that consists of source loss $\mathcal{L}_{s}$ and
target loss $\mathcal{L}_{t}$ in Eq. 6, where $\alpha$ and $\beta$ are the
weights. $l_{t}$ and $l_{s}$ are the layers to compute $\mathcal{L}_{t}$ and
$\mathcal{L}_{s}$.

$\mathcal{L}_{total}(G,S,T,l_{s},l_{t})=\alpha\mathcal{L}_{s}(G,S,l_{s})+\beta\mathcal{L}_{t}(G,T,l_{s},l_{t})$
(6)

$\mathcal{L}_{s}$ is used to construct the $N_{\mathbb{S}}$ and $X$ in the
generated sample $G$. As $N_{\mathbb{S}}$ and $X$ are x-axis related and show
lower-frequency features, we use deeper feature maps and position-related loss
to reconstruct $X$ and $N_{\mathbb{S}}$ from $S$ (see Eq. 7.)

$\mathcal{L}_{s}\left({G,S,l_{s}}\right)=\left({F_{i}^{l_{s}}\left({G}\right)-F_{i}^{l_{s}}\left({S}\right)}\right)^{2}$
(7)

$\mathcal{L}_{t}$ is used to construct the internal noise $\xi_{T}$ of $T$ in
$G$. As we discussed, its frequency is higher than environmental noise and
signal. We use feature maps on shallow layer $l_{t}$ and gram matrix (see Eq.
8 and Fig. 4) to control its feature shape and an MSE loss on deep layer
feature $l_{s}$ to control its x-axis position. The reason we introduced the
gram matrix is that we cannot synthesise $\xi_{T}$ with the same loss function
structure for $T$ as for $S$. It would cause the overall loss to converge
towards $\mathcal{L}_{s}$ or $\mathcal{L}_{t}$, and thus we would not be able
to obtain features from both $S$ and $T$.

$Gram_{ij}^{l_{t}}\left({Y}\right)=\sum_{k\in
l_{t}}F_{ik}^{l_{t}}\left({Y}\right)\cdot F_{jk}^{l_{t}}\left({Y}\right)$ (8)

Figure 4: shows how the gram matrix is calculated. Suppose that we input the
sample $Y$ to the DCNN for its convolution layer $l$; we get the feature
matrix with the size of $P_{l}*M_{l}$, where $P_{l}$ is the channel size of
$l$, $M_{l}$ is the size of feature map in $l$, the convolution of $Y$ on the
$i^{th}$ channel is $F_{i}^{l}(Y)$. Then, by multiplying the obtained matrix
with its transpose, we obtain the gram matrix of $P_{l}*P_{l}$, where
$Gram_{i,j}^{l}(Y)$ represents the correlation of $Y$ on the $i^{th}$ and
$j^{th}$ features in convolution layer $l$.

The overall $\mathcal{L}_{t}$ is calculated as Eq. 9, where $\omega_{l}$ is
the loss weight of $l$.

$\displaystyle\mathcal{L}_{t}\left(G,T,l_{s},l_{t}\right)=$
$\displaystyle\sum_{i}\left({F_{i}^{l_{s}}\left({G}\right)-F_{i}^{l_{s}}\left({T}\right)}\right)^{2}+\sum_{l\in
l_{t}}\omega_{l}E_{l}$ (9) $\displaystyle E_{l}=$
$\displaystyle\frac{1}{4P_{l}^{2}M_{l}^{2}}\sum_{i,j}\left({Gram_{ij}^{l}\left(G\right)-Gram_{ij}^{l}\left(T\right)}\right)^{2}$

###  3.3 Noise Patterns Transferring Model

S2S case-base provides noise pattern differences $N_{\mathbb{S}-\mathbb{T}}$
in sample-to-sample pairs, i.e., $G$ and $T$. It enables us to train the CNPT
model with $CNPT(G)=T$. Similar to denoising tasks, we use the residual
learning method, which involves learning the residual mapping between the
pairwise samples to obtain the CNPT model that achieves transferring
$N_{\mathbb{S}}$ to $N_{\mathbb{T}}$.

The CNPT model’s network structure consists of 17 convolutional layers and
rectified linear unit (ReLU) layers, allowing it to capture complex patterns
and features. The inputs to CNPT are the generated sample
$G=X+N_{\mathbb{S}}+\xi_{T}$ and the corresponding sample
$T=X+N_{\mathbb{T}}+\xi_{T}$. CNPT is trained to learn the residual mapping
between the S2S case
$\mathcal{R}(G,\phi)=N_{\mathbb{S}-\mathbb{T}}=N_{\mathbb{T}}-N_{\mathbb{S}}$.

We use the MSE loss function to train the CNPT to minimise the learned noise
pattern residual and the expected residuals. The loss function is shown in Eq.
10, where the $Q$ represents the number of S2S cases we feed the model.

$\mathcal{L}_{CNPT}=\frac{1}{2Q}\sum_{i=1}^{Q}\left\|{\mathcal{R}({G};\phi)-\left({G-T}\right)}\right\|^{2}$
(10)

Ideally, the trained CNPT model should learn the noise pattern differences
between $N_{\mathbb{T}}$ and $N_{\mathbb{S}}$ by feeding S2S cases into it.

##  4 Environmental Setup

To verify the performance of our GC-based noise pattern transferring model, we
try to reproduce actual deployment scenarios in experiments. Therefore,
samples measured in different environments, i.e., with different environmental
noises, will be used in the verification process. We use the task to measure
the COD parameter using LIFS, which can estimate the amount of organic matter
in a water sample.

In this section, we introduce how our model is deployed to fit the
environmental changes and the configuration of our model. Further, the
datasets and the baselines are also provided in detail.

###  4.1 Deployment settings and runtime environments

Unlike traditional solutions, our approach can process new noise patterns by
continuously collecting standard spectral samples from the environment. The
workflow is shown in Fig. 5.

Figure 5: We show three environments in the figure: strong sunlight, weak
sunlight, and static pollutant background, which has different environmental
noise. The system can periodically test the LIFS of standard water samples as
the environment changes, correcting the CNPT model by retraining to process
the new environmental noise.

The standard water samples are humic acid solutions that can help get accurate
COD parameters of water by enhancing the oxidation process and reducing
interference from other substances. To ensure the CNPT model can handle
samples of unknown COD concentration, we use parts of standard water sample
groups to generate the S2S case-base and train the CNPT model. We prepared
three environments: darkroom, static natural lighting, and static pollutant
background. All the experiments were performed on a Linux server for the
hardware environments, with CUDA version 11.8 using GeForce GTX 4090 Graphics
Cards. We use the PyTorch framework to write the codes.

###  4.2 Model configurations

In this section, we introduce all the hyper-parameters and the configurations
in the experiments to guide the researchers in refining the model in different
applications and environments.

For the S2S case generating model, the feature extraction model is a four-
layer 1D convolutional neural network in which kernel size is 1x7. This pre-
trained model is from a COD parameter analysis model, which is trained by
6,000 samples and achieves 92.53% accuracy. The feature maps for calculating
$\mathcal{L}_{t}$ are from conv1 and conv2 layers, while conv3 is used for
x-axis-related MSE loss. The ratio of $\alpha$ and $\beta$ is set to 1: 2e5
and $\omega_{l}=0.2*\omega_{l-1}$. We iteratively execute the L-BFGS function
150 times to minimise the loss.

For the CNPT model, the kernel size is 1x7. The training batch size is 64, and
the training epochs are 100. The learning rate we use is 1e-3, and the input
data is normalised by the min-max normalisation method before feeding into the
neural network. The data for the training-to-validation ratio is 80% to 20%.

The COD parameter analysis model, used for verifying the performance of noise
patterns transferring, has the same network structure as the feature
extraction model. The training batch size is 128, the epochs are 200, and the
learning rate is 3e-4. All the data fed to this model for validation are not
used for training or testing the CNPT model.

###  4.3 Datasets

The datasets are LIF spectral data of humic acid solution with different noise
patterns, open-sourced at [5]. The COD of solutions is measured using laser-
induced fluorescence spectroscopy [21], in which a 405 nm semiconductor laser
was used as the excitation source. The excited light signals from the water
sample pass through a spectroscopic filter system and be focused into the CCD
by a lens. The dataset contains three groups of LIFS, which are collected from
10 solutions that the COD parameter ranges from 0 mg/L to 30 mg/L in three
different noise patterns $D_{\mathbb{A}}$, $D_{\mathbb{B}}$, and
$D_{\mathbb{C}}$. The noise strength of them is ordered as
$D_{\mathbb{A}}<D_{\mathbb{B}}<<D_{\mathbb{C}}$. Each solution sample is
measured 200 times, and all the data are min-max normalised. We provide
examples of LIF spectra in Fig. 6.

Figure 6: The LIFS of standard water sample under three noise patterns: The
left figure represents a dark room setting ($D_{\mathbb{A}}$), the central one
portrays a natural light condition ($D_{\mathbb{B}}$), while the right one is
from a static pollutant background environment ($D_{\mathbb{C}}$).

###  4.4 Baselines

To verify the performance of our model, we select competitive models with good
performance in terms of noise processing as baselines. In other words, they
are used for transferring noise patterns, not to get spectral analysis
results. All of our model’s and baselines’ outputs are fed into the same COD
parameter analysis model that is trained by the samples in $D_{\mathbb{T}}$,
which can check whether the samples that are transferred to the noise pattern
$N_{\mathbb{T}}$ can be correctly identified by the analytical model trained
with $D_{\mathbb{T}}$. The baselines are as follows:

Rule-based Models: use wavelets, Fourier transforms, or filtering to reduce
the noise of the data. They have the advantage of not requiring paired data
and learning processes. For LIFS, we use the ‘db8’ wavelet to achieve the
denoising task[7]. This method trains the classification model using the
denoised samples in $D_{\mathbb{T}}$. Then, the CNPT model learns the noise
pattern difference between denoised samples in $D_{\mathbb{S}}$ and
$D_{\mathbb{T}}$.

DNN Models: use end-to-end training process. DnCNN [27] is a state-of-the-art
image denoising method that uses residual learning to remove noise from
images. In this paper, we implemented a 1D DnCNN model with a 1x7 kernel size
to learn the noise pattern differences between $D_{\mathbb{S}}$ and
$D_{\mathbb{T}}$. Since the spectral data in different noise patterns are not
paired, we randomly pick samples in $D_{\mathbb{S}}$ and $D_{\mathbb{T}}$
corresponding to the same standard solution as paired data to train it.

Generative Models: learn at the scale of the dataset, which makes the model
find noise pattern differences in the adversarial learning process. CycleGAN
[14] is a deep learning model that can learn to translate images from one
domain to another without paired examples. Therefore, CycleGAN is a suitable
approach to handle the unpaired LIFS data. We implemented a 1D CycleGAN model,
which can transfer the noise pattern of samples from $D_{\mathbb{S}}$ to
$D_{\mathbb{T}}$.

##  5 Experimental Results

We discuss the experimental results in two parts: 1) check if the gram matrix
works well in the S2S cases generating process; 2) test the model’s
performance by feeding the output of CNPT to a trained COD parameter analysis
model.

###  5.1 Effects on S2S cases generating

One of the contributions of our method is to use the unpaired data with
different environmental noise patterns and internal noise to generate paired
data that only have environmental noise differences. It comes from our S2S
cases generation process based on the ‘feature extraction-matching’ method and
the loss on different feature maps. Therefore, this section shows how the
sample $G$ is generated in feature maps and gram matrix view. We present the
convolution kernel and the gram matrix changes in the training process in Fig.
7.

Figure 7: We show the convolution kernel used to compute the feature map in
the top part of the figure. Then, we show the initial, target, and final state
of the gram matrix of the signal $G$ in the training progress of the conv1 and
conv2 layers. The bottom part shows the corresponding signals $T$, $S$, and
$G$ in this example.

Since the convolution kernel provides rich patterns for the feature maps, we
can also analyse the signal patterns from the feature maps. For example, we
find that the feature in which id is 0 has a strong auto-correlation on the
conv1 (the value at position 0,0 in the gram matrix), which means the pattern
corresponding to the convolution kernel with ID 0 (upper left corner in the
convolution kernel example) appears most frequently in the signal.

It matches our expectation since its pattern is similar to the baseline drift,
i.e., the initialisation signals and $T$ have large oscillations on a smaller
scale (1x5). In contrast, conv2 has a more extensive feature extraction scale
(1x25) than conv1, showing more differences in the feature map between the
initialised signal and $T$ caused by the different noise patterns. From the
results, the $G$ we obtained is similar to that of $T$ in internal noise and
both layers of feature maps, which confirms that our method can extract and
synthesise $G$ with good quality.

###  5.2 Performance on analysis model

The most intuitive way to evaluate the noise patterns transferring models is
to analyse their output using a model trained by the samples with the target
noise pattern. In this section, we validate the proposed method in comparison
with baselines.

The baselines we use are wavelet denoising [7], autoencoder (AE) [3], 1D DnCNN
[16], and 1D CycleGAN [10]. They are representatives of traditional, DNN, and
adversarial generation methods and are suitable for the target task. Besides,
we present the accuracy of the COD parameter analysis model using the
unprocessed data in $D_{\mathbb{S}}$ and $D_{\mathbb{T}}$, which provides
references to the performance of baselines.

We use two training ratios (30% and 50%) to train the noise transfer model,
i.e., use only a training set in 3 and 5 of 10 standard water solutions, while
all ten groups of data are used for the validation set. It can indicate the
generalisation ability and the effect of the noise patterns transferring
method with generated cases (GC). The experimental results are shown in Table.
1.

Table 1: The experimental results of our model and baselines. Transfer targets correspond to $D_{\mathbb{S}}$ and $D_{\mathbb{T}}$. For example, when the transfer target is $N_{\mathbb{B}}$ to $N_{\mathbb{A}}$, it means $D_{\mathbb{S}}=D_{\mathbb{B}}$ and $D_{\mathbb{T}}=D_{\mathbb{A}}$ and the analysis model is trained by $D_{\mathbb{A}}$. For the results, $D_{\mathbb{S}}$ and $D_{\mathbb{T}}$ show the accuracy when feeding the unprocessed data in $D_{\mathbb{S}}$ and $D_{\mathbb{T}}$ to the analysis model. In contrast, others feed the data in $D_{\mathbb{S}}$ that are processed by corresponding baselines to the analysis model. Each group of results uses two training ratios: 30% and 50%, which indicates how many standard water solutions we use when training the CNPT model. We also tested the results using an autoencoder (AE) as a CNPT model, which tests if our generated cases can improve the performance of different case-based noise transfer DL models. Transfer | Traning | $D_{\mathbb{S}}$ | Wavelet | CycleGAN | AE | GC-AE | DnCNN | GC |  $D_{\mathbb{T}}$
---|---|---|---|---|---|---|---|---|---
target | ratio | -DnCNN
$N_{\mathbb{B}}$ to $N_{\mathbb{A}}$ | 50% | 63.83 | 74.90 | 76.75 | 50.60 | 57.00 | 71.50 | 82.60 | 90.78
30% | 78.40 | 76.50 | 53.25 | 57.30 | 74.25 | 82.58
$N_{\mathbb{C}}$ to $N_{\mathbb{A}}$ | 50% | 33.94 | 59.30 | 37.50 | 37.45 | 42.85 | 55.80 | 73.55 | 90.78
30% | 69.30 | 39.10 | 30.70 | 44.80 | 62.15 | 70.85
$N_{\mathbb{C}}$ to $N_{\mathbb{B}}$ | 50% | 55.11 | 62.60 | 66.25 | 48.15 | 53.45 | 58.95 | 88.60 | 98.78
30% | 73.45 | 65.25 | 53.35 | 57.00 | 69.45 | 85.05
$N_{\mathbb{A}}$ to $N_{\mathbb{B}}$ | 50% | 59.67 | 49.40 | 37.25 | 39.15 | 49.05 | 65.35 | 94.00 | 98.78
30% | 58.20 | 42.25 | 39.00 | 45.30 | 63.70 | 94.95
$N_{\mathbb{A}}$ to $N_{\mathbb{C}}$ | 50% | 29.72 | 53.65 | 40.20 | 23.65 | 31.35 | 51.20 | 56.25 | 88.28
30% | 52.90 | 46.85 | 27.20 | 38.45 | 53.95 | 56.26
$N_{\mathbb{B}}$ to $N_{\mathbb{C}}$ | 50% | 36.44 | 54.85 | 49.75 | 39.45 | 39.70 | 52.45 | 59.40 | 88.28
30% | 60.90 | 57.90 | 39.15 | 41.60 | 59.85 | 63.80

###  5.3 Analysis and discussions

The results show that GC-based DnCNN CNPT model (GC-DnCNN) performs best and
has a significant advantage over the baselines. It validates that our method
can generate cases with better quality, which helps CNPT model learn
differences in noise patterns between datasets, thereby improving the analysis
model’s performance. It should be noted that GC-AE, which is trained by S2S
case-base performs better than AE. It better indicates that the performance of
the noise patterns transferring model is improved by training with generated
cases (the S2S case-base). It validates that we can enhance the performance of
DL models by generating high-quality case-bases.

The CycleGAN model significantly performs poorly even lower than the
unprocessed samples. It may be because the data set is not large enough, which
make CycleGAN overfitting [18]. Besides, AE performs badly because it directly
smooths the internal noise when transfers the position related environmental
noise. It will also lead to overfitting problems because the internal noise
can show low-frequency noise patterns that are superimposed on environmental
noise and signal. The spurious peaks will mislead AE to transfer it to a wrong
noise or signal pattern. This phenomenon does not occur in two other
baselines, i.e., wavelet and DnCNN, demonstrating the satisfactory results of
traditional signal noise processing methods and the DNN-based models’
generalisation capability.

##  6 Conclusions

In this paper, we propose a noise pattern transferring approach for learning
noise pattern differences from S2S cases, which is the first work to enhance
the learning effect of noise pattern transferring models by generating cases.
The most novelty idea is that we generate an S2S case-base using the ‘feature
extraction-matching’ method to enhance the learning ability of the noise
pattern transferring model. Experimental results on a COD concentration
measurement task show that our GC-based noise pattern transferring model
outperforms important baselines ranging from wavelet denoising, DNN, and
generative models.

The excellent performance of the generated cases on different CNPT models also
validates that our model can be used as a plug-in to the noise processing
systems. When existing cases cannot express enough features for noise
processing systems, implementing reasonable case-generating methods will
contribute to performing the relevant tasks. In future work, we will continue
exploring principles and applications of generated cases in noise processing
systems.

## References

  * [1] Abdessamad, E., Saadane, R., El Aroussi, M., Wahbi, M., Hamdoun, A.: Spectrum sensing with an improved energy detection. In: 2014 International Conference on Multimedia Computing and Systems (ICMCS). pp. 895–900. IEEE (2014)
  * [2] Bukin, O., Proschenko, D., Alexey, C., Korovetskiy, D., Bukin, I., Yurchik, V., Sokolova, I., Nadezhkin, A.: New solutions of laser-induced fluorescence for oil pollution monitoring at sea. In: Photonics. vol. 7, p. 36. MDPI (2020)
  * [3] Chandra, B., Sharma, R.K.: Adaptive noise schedule for denoising autoencoder. In: Neural Information Processing: 21st International Conference, ICONIP 2014, Kuching, Malaysia, November 3-6, 2014. Proceedings, Part I 21. pp. 535–542. Springer (2014)
  * [4] Chen, S., Du, X., Zhao, W., Guo, P., Chen, H., Jiang, Y., Wu, H.: Olive oil classification with laser-induced fluorescence (lif) spectra using 1-dimensional convolutional neural network and dual convolution structure model. Spectrochimica Acta Part A: Molecular and Biomolecular Spectroscopy 279, 121418 (2022)
  * [5] Du, H.: Laser-induced fluorescence spectral data of humic acid solution in different noise patterns (2023), https://dx.doi.org/10.21227/7r0c-mf67
  * [6] Du, H., An, Y., Ye, Q., Guo, J., Liu, L., Zhu, D., Childs, C., Walsh, J., Dong, R.: Disentangling noise patterns from seismic images: Noise reduction and style transfer. IEEE Transactions on Geoscience and Remote Sensing 60, 1–14 (2022)
  * [7] He, W., Zi, Y., Chen, B., Wang, S., He, Z.: Tunable q-factor wavelet transform denoising with neighboring coefficients and its application to rotating machinery fault diagnosis. Science China Technological Sciences 56, 1956–1965 (2013)
  * [8] Hu, F., Zhou, M., Yan, P., Li, D., Lai, W., Bian, K., Dai, R.: Identification of mine water inrush using laser-induced fluorescence spectroscopy combined with one-dimensional convolutional neural network. RSC advances 9(14), 7673–7679 (2019)
  * [9] Hu, F., Zhou, M., Yan, P., Li, D., Lai, W., Zhu, S., Wang, Y.: Selection of characteristic wavelengths using spa for laser induced fluorescence spectroscopy of mine water inrush. Spectrochimica Acta Part A: Molecular and Biomolecular Spectroscopy 219, 367–374 (2019)
  * [10] Kaneko, T., Kameoka, H., Hiramatsu, K., Kashino, K.: Sequence-to-sequence voice conversion with similarity metric learned using generative adversarial networks. In: Interspeech. vol. 2017, pp. 1283–1287 (2017)
  * [11] Kaneko, T., Kameoka, H., Tanaka, K., Hojo, N.: Cyclegan-vc2: Improved cyclegan-based non-parallel voice conversion. In: ICASSP 2019-2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). pp. 6820–6824. IEEE (2019)
  * [12] Kazemzadeh, M., Hisey, C.L., Zargar-Shoshtari, K., Xu, W., Broderick, N.G.: Deep convolutional neural networks as a unified solution for raman spectroscopy-based classification in biomedical applications. Optics Communications 510, 127977 (2022)
  * [13] Kenny, E.M., Keane, M.T.: On generating plausible counterfactual and semi-factual explanations for deep learning. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 35, pp. 11575–11585 (2021)
  * [14] Kwon, Y.H., Park, M.G.: Predicting future frames using retrospective cycle gan. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 1811–1820 (2019)
  * [15] Laurent, G., Woelffel, W., Barret-Vivin, V., Gouillart, E., Bonhomme, C.: Denoising applied to spectroscopies–part i: concept and limits. Applied Spectroscopy Reviews 54(7), 602–630 (2019)
  * [16] Liu, Z., Wu, H., Du, H., Luo, Z., Tang, M.: Distributed temperature and curvature sensing based on raman scattering in few-mode fiber. IEEE Sensors Journal 22(23), 22620–22626 (2022)
  * [17] Loh, W., Stuart, J., Reens, D., Bruzewicz, C.D., Braje, D., Chiaverini, J., Juodawlkis, P.W., Sage, J.M., McConnell, R.: Operation of an optical atomic clock with a brillouin laser subsystem. Nature 588(7837), 244–249 (2020)
  * [18] Peng, X., Peng, S., Hu, Q., Peng, J., Wang, J., Liu, X., Fan, J.: Contour-enhanced cyclegan framework for style transfer from scenery photos to chinese landscape paintings. Neural Computing and Applications 34(20), 18075–18096 (2022)
  * [19] Santos, G.J.E., Rivera, M., Eiswirth, M., Parmananda, P.: Effects of noise near a homoclinic bifurcation in an electrochemical system. Physical Review E 70(2), 021103 (2004)
  * [20] Sobolev, I., Babichenko, S.: Application of the wavelet transform for feature extraction in the analysis of hyperspectral laser-induced fluorescence data. International Journal of Remote Sensing 34(20), 7218–7235 (2013)
  * [21] Tian, Z., Bi, Z., Zhang, Y., Wang, Y., Cui, Z., Zhao, H.: Rapid water quality assessment by micro laser–induced fluorescence spectrometer. In: Advanced Solid State Lasers. pp. JTh3A–46. Optica Publishing Group (2019)
  * [22] Turner, J., Floyd, M.W., Gupta, K., Oates, T.: Nod-cc: a hybrid cbr-cnn architecture for novel object discovery. In: Case-Based Reasoning Research and Development: 27th International Conference, ICCBR 2019, Otzenhausen, Germany, September 8–12, 2019, Proceedings 27. pp. 373–387. Springer (2019)
  * [23] Turner, J., Floyd, M.W., Gupta, K.M., Aha, D.W.: Novel object discovery using case-based reasoning and convolutional neural networks. In: Case-Based Reasoning Research and Development: 26th International Conference, ICCBR 2018, Stockholm, Sweden, July 9-12, 2018, Proceedings 26. pp. 399–414. Springer (2018)
  * [24] Wang, H., Zhao, Z., Wang, Z., Xu, G., Wang, L.: Independent component analysis-based baseline drift interference suppression of portable spectrometer for optical electronic nose of internet of things. IEEE Transactions on Industrial Informatics 16(4), 2698–2706 (2019)
  * [25] Yang, Z., Albrow-Owen, T., Cai, W., Hasan, T.: Miniaturization of optical spectrometers. Science 371(6528), eabe0722 (2021)
  * [26] Zacharioudaki, D.E., Fitilis, I., Kotti, M.: Review of fluorescence spectroscopy in environmental quality applications. Molecules 27(15), 4801 (2022)
  * [27] Zhang, K., Zuo, W., Chen, Y., Meng, D., Zhang, L.: Beyond a gaussian denoiser: Residual learning of deep cnn for image denoising. IEEE transactions on image processing 26(7), 3142–3155 (2017)