# Selective nonlinearities removal from digital signals

Krzysztof A. Maliszewski
School of Mathematics and Statistics, University of Canterbury
Christchurch, New Zealand
<EMAIL_ADDRESS>Magdalena A. Urbańska
School of Food and Advanced Technology, Massey University
Palmerston North, New Zealand
<EMAIL_ADDRESS>Varvara Vetrova
School of Mathematics and Statistics, University of Canterbury
Christchurch, New Zealand
<EMAIL_ADDRESS>Sylwia M. Kolenderska
Institute of Physics, Faculty of Physics, Astronomy and Informatics
Nicolaus Copernicus University in Torun
ul. Grudziadzka 5, 87-100 Torun, Poland
School of Physical and Chemical Sciences, University of Canterbury
Christchurch, New Zealand
<EMAIL_ADDRESS>
###### Abstract

Many instruments performing optical and non-optical imaging and sensing, such
as Optical Coherence Tomography (OCT), Magnetic Resonance Imaging or Fourier-
transform spectrometry, produce digital signals containing modulations, sine-
like components, which only after Fourier transformation give information
about the structure or characteristics of the investigated object. Due to the
fundamental physics-related limitations of such methods, the distribution of
these signal components is often nonlinear and, when not properly compensated,
leads to the resolution, precision or quality drop in the final image. Here,
we propose an innovative approach that has the potential to allow cleaning of
the signal from the nonlinearities but most of all, it now allows to switch
the given order off, leaving all others intact. The latter provides a tool for
more in-depth analysis of the nonlinearity-inducing properties of the
investigated object, which can lead to applications in early disease detection
or more sensitive sensing of chemical compounds. We consider OCT signals and
nonlinearities up to the third order. In our approach, we propose two neural
networks: one to remove solely the second-order nonlinearity and the other for
removing solely the third-order nonlinearity. The input of the networks is a
novel two-dimensional data structure with all the information needed for the
network to infer a nonlinearity-free signal. We describe the developed
networks and present the results for second-order and third-order nonlinearity
removal in OCT data representing the images of various objects: a mirror,
glass, and fruits.

##  1 Introduction

Optical Coherence Tomography (OCT), Magnetic Resonance Imaging (MRI) or
Fourier-transform Spectrometry (FTS) belong to a class of methods where
useful, interpretable signal is obtained in an indirect way, more specifically
by Fourier transforming the raw signal acquired by the instrument and taking
its absolute value. On the one hand, such an indirect approach makes OCT-based
imaging and FTS-based sensing faster and enables MRI, but on the other hand,
it makes room for errors related to the limitations of Fourier transformation.
One such limitation is the Fourier transformation’s sensitivity to
nonlinearities in the input signal. In the simplest case of a signal being a
single-frequency modulation, a second-order nonlinear distribution will
Fourier transform to a broader peak (compare Fig. 1a,b with c,d). If this
distribution is of a third-order nonlinear character, the peak in the Fourier
transform will get distorted (Fig. 1e,f). In practice, both nonlinearities
appear at once, the second-order one bigger than the third-order one, leading
to a broad peak elongated in the direction of the third-order nonlinearity
distortion (Fig. 1g,h).

Figure 1: Effects of signal nonlinearity on the signal’s Fourier transform.
(a) A signal with a linear modulation distribution Fourier transform to (b) a
narrow peak. (c) If the nonlinearity of the modulation is of the second order,
(d) the peak gets broadened. (e) If the nonlinearity is of the third order,
(f) the peak gets distorted. In OCT, this will result in deteriorated image
quality. (g) In practice, both nonlinearities appear at once, resulting in (h)
the peak being elongated in the direction of the third-order distortion.

The influence of nonlinearities is best visible in OCT, where the Fourier
transform of the raw signal constitutes one line of the image. Since the width
of the peak represents the depth resolution (i.e. how small a detail can be
observed), and the peak’s shape correlates with the image quality,
nonlinearities are generally thought of as detrimental and various techniques
are devised to remove them [1, 2]. These techniques do not achieve absolute
removal of nonlinearity, preventing single-shot imaging of bulk objects, such
as the entire eye [3, 4] and consequently necessitating elaborate workaround
solutions [5, 6, 7, 8]. A Machine Learning solution for nonlinearity removal
was proposed as well [9] – although robust and reliable, it is biased towards
specific kinds of objects with specific nonlinear properties.

On the other hand, the inherent optical properties that produce nonlinearities
in the imaged objects have been shown to enable the characterisation of the
objects [10, 11, 12] and correlate the change of their nonlinear character
with the progression of diseases [13]. Unfortunately, the current methods for
extracting the second-order nonlinearity are very object-specific as well as
error-prone preventing them from being applied in real-world scenarios.

We present an approach that enables flexible and comfortable management of the
signal nonlinearities, letting the user study one order in the absence of the
others, a capability previously impossible to achieve using current standard
or Machine Learning methods. In our approach, for each nonlinearity order, a
neural network is trained whose input is a special two-dimensional data
structure, a stack. Each row of the stack represents an amplitude of the
Fourier transform of an input signal multiplied by a different nonlinearity-
correcting factor. Consequently, it contains nonlinearity-free regions which
the network identifies and uses to build a nonlinearity-free Fourier transform
amplitude. We present two networks, one to remove the second-order
nonlinearity while keeping the third-order one intact, and the second network
to remove the third-order nonlinearity while keeping the second-order one
intact. We test our approach on OCT signals that naturally contain substantial
amounts of second-order nonlinearity and small amounts of third-order
nonlinearity. The tests on both computer-generated and experimental signals
indicate the robustness of our approach.

We start by describing our approach in Section 2, including the creation of
the stacks in Subsection 2.1, their application in the training processes in
Subsection 2.2, presentation of the used architecture and methodology in
Subsection 2.3, and the description of the datasets (Subsection 2.4) used for
training of our models. In Section 3, we report the performance of the
networks in removing the respective nonlinearity, complete with the analysis
of the training process and the subsequent tests on computer-generated data
(Subsection 3.1) and experimental data (Subsections 3.2, 3.3 and 3.4). In the
final sections, we summarise the obtained results (Section 4), pointing to the
strong points of our approach, identifying the observed and potential
shortcomings, and discussing potential solutions and the scope of future work
(Section 5).

##  2 Concept

###  2.1 Amplitude stacks as inputs

Our networks rely on a two-dimensional data structure as inputs: a stack (Fig.
2). The rows of a stack are created in the following way. First, the raw
signal is multiplied (Fig. 2a) by a complex exponent with a different
quadratic argument in the case of the stack used for removing the second-order
nonlinearity (Fig. 2b) or with a different cubic argument in the case of the
stack for the third-order nonlinearity removal (Fig. 2d). Coefficients in the
quadratic arguments, ($C_{0},...,C_{31}$ in Fig. 2b), and coefficients in the
cubic arguments ($D_{0},...,D_{31}$ in Fig. 2d), are chosen to cover a wide
range of the second- and thrid-order nonlinearity, ensuring that the
nonlinearities present in the signal are fully compensated. Then, each row is
Fourier transformed, and an absolute value is calculated to obtain a 2nd-order
stack (Fig. 2c) or a 3rd-order stack (Fig. 2e). The range of the nonlinear
coefficients is symmetrical around 0 and broad enough to ensure that each
modulation’s nonlinearity in the raw signal is compensated. In the 2nd-order
stack, these will be the places with the smallest width (marked 1, 2, 3 and 4
in Fig. 3b) and in the 3rd-order stack, the places containing no distortions
(marked 1, 2, 3 and 4 in Fig. 3c).

Figure 2: Calculation of the input stacks. (a) The raw signal is (b)
multiplied by 32 different complex exponents representing 32 different levels
of the second-order nonlinearity: $C_{0}$, $C_{1}$, $C_{2}$, …, $C_{31}$. Each
row is then Fourier transformed. (c) The 2nd-order stack is created from the
absolute value of the complex Fourier transforms. Similarly, (d) the raw
signal is multiplied by 32 different complex exponents representing 32
different levels of the third-order nonlinearity: $D_{0}$, $D_{1}$, $D_{2}$,
…, $D_{31}$ and then Fourier transformed to build (e) a 3rd-order stack.
Figure 3:  (a) The Fourier transform amplitude of a raw signal, presented in
Fig. 2a, shows four peaks affected by a different amount and type of
nonlinearity. The second-order nonlinearity is removed with Network #1 trained
on (b) the 2nd-order stack as input and (d) Fourier transform amplitude free
of the second-order nonlinearity as output. Similarly, the third-order
nonlinearity is removed with Network #2 trained on (b) the 3rd-order stack as
input and (d) Fourier transform amplitude free of the third-order nonlinearity
as output. As a result, (f) the second-order nonlinearity is removed leaving
the third-order one (see peak 4) using Network #1, (g) the third-order
nonlinearity is removed leaving the second-order one intact (see peak 4) using
Network #2.

###  2.2 Nonlinearity-removing networks

The approach for removing the second-order nonlinearity and the approach for
removing the third-order nonlinearity are similar, presented schematically in
Fig. 3. The input of the network for the second-order nonlinearity removal,
Network #1, is the 2nd-order stack (Fig. 3b) and the output is a Fourier
transform amplitude free of second-order nonlinearity (Fig. 3d). Because the
input 2nd-order stack contains regions corresponding to perfectly removed
second-order nonlinearity, the training process can be viewed as learning how
to identify these regions and then stitching them all up. Similarly, the
network for removing third-order nonlinearity, Network #2, takes the 3rd-order
stack as input (Fig. 3c) and outputs a Fourier transform amplitude free from
the 3rd-order nonlinearity (Fig. 3e). Input for both networks has a shape of
32 by 1024 pixels with a single channel whereas output is a vector of size
1024. When compared to the Fourier transform amplitude of the raw signal (Fig.
3a), the signal returned by Network #1 (Fig. 3f) incorporates only the third-
order nonlinearity, and the signal returned by Network #2 (Fig. 3g) contains
only the second-order nonlinearity.

###  2.3 Methodology

Our nonlinearity-removing networks are inspired by the U-Net architecture
[14]. U-Net stands out for its use of a contracting path to capture contextual
information, an expanding path for precise feature localisation, and the
incorporation of skip connections that preserve fine-grained details,
particularly beneficial for precise object delineation. We leverage these
capabilities to identify and extract nonlinearity-related features from the
stacks.

While the classical U-Net deals with 2D data structures for both input and
output, in our case, we perform dimension reduction to output 1D signals by
incorporating a max-pooling layer. We further refined the architecture by
optimising hyperparameters with the validation dataset using Optuna [15]. As a
result of the tuning, we adopted the Mean Absolute Error (MAE) loss function
and the Adam optimiser [16] with a set learning rate of 0.0002. Our final
network architecture is presented in Fig. 4.

Figure 4: Architecture of our nonlinearity-removing networks.

###  2.4 Datasets

Our datasets consist of noiseless computer-generated signals that are
Gaussian-shaped, and diverse and randomised in terms of their content. If put
in the OCT-imaging-related terms, they represent a broad range of possible
imaged object configurations. These objects are simulated to have a random
number of interfaces (from 2 to 12) positioned at arbitrary locations, with
each object layer exhibiting varying random reflectivity and second- and
third-order nonlinearity values. These object parameters are used to
synthesise modulatory signals equivalent to those acquired in an OCT
measurement (see example signals in Fig. 1a, c, e, g or Fig. 2a). Next, the
input stacks and outputs, the Fourier transform amplitudes of signals free of
the respective nonlinearity, are calculated.

The risk of overfitting was minimised by using the training datasets with an
optimised size [17]. In our research, this was found to be between 160,000 and
240,000 objects. The validation and test datasets include 14,993 objects. The
distribution is uniform across the objects with a specific number of
interfaces, resulting in an equal allocation of 1,363 data samples for each
distinct object type.

Before starting the training, as part of the preprocessing stage, both the
input and output data were normalised through Min-Max scaling, ensuring that
values fell within the standardised range of 0 to 1.

##  3 Performance

###  3.1 In silico data tests

Each nonlinearity-removing neural network underwent training using a training
dataset consisting of 200,000 objects. Within each mini-batch, 8 input stacks
were processed. The proposed algorithm requires 39 ms to process a stack on a
Quadro RTX 6000 GPU. Network #1 (Fig. 5, blue lines) and Network #2 (Fig. 5,
orange lines) both displayed convergence within just a few epochs (Fig. 5) and
were trained until the thirtieth epoch.

Figure 5:  Network #1 and Network #2 performance measured with the Mean
Absolute Error (MAE) loss function across 30 epochs of training. Blue lines
depict Network #1, while orange lines showcase the Network #2 performance.
Dotted vertical lines highlight epochs exhibiting the best performance.

To better evaluate the networks and results, we employed the Goodness-of-Fit
Approximity (GoF) metric introduced in [12]. The GoF metric assesses the
accuracy of predictions by calculating the percentage of values that lie
within a predefined distance from the corresponding ground truth values. For
this GoF metric, we define an error threshold as a ratio between the
predefined distance and the value range span. In our case, where the values
range from 0 to 1, the distance of 0.01 means 1% error threshold.

Based on the post-training evaluation using a 1% error threshold and the test
dataset, Network #1 started to overfit at epoch 25 (Fig. 5, indicated by the
blue dotted vertical line). In contrast, Network #2 demonstrated resilience
against overfitting and achieved its best results in the 28th epoch (Fig. 5,
marked by the red dotted vertical line).

Using the test dataset and GoF with a 1% error threshold, both networks
achieved a remarkable mean GoF value of 99.98%, which means that 99.98% of the
predictions differed from the ground truth by less than 1%, with only one
example below 95% GoF. In light of this, to be able to carry out a meaningful
analysis, the error threshold was further reduced to 0.1% and a boxplot graph
was plotted for each model in Fig. 6.

Figure 6: Networks performance assessed through the metric of GoF, measuring
the degree to which predictions align with the ground truth within 0.1% error
in the test dataset comprising 14,993 data samples for (a) Network #1 and (b)
Network #2. The graphs at the top (a1,a2) are zoomed-in areas of the top area
of (b1,b2) the whole graphs presented.

Both networks, Network #1 (Fig. 6a) and Network #2 (Fig. 6b), demonstrated
very good performance even for error threshold 0.1%. Only approximately 9.52%
and 3.07% of the predictions from Network #1 and Network #2, respectively,
fell below the 95% GoF for such a small error, as showed in Tab. 1 that also
includes GoF values for objects with distinct number of layers. Fig. 7 offers
an in-depth analysis of the worst-predicted examples for the Network #1 (Fig.
7a) and the Network #2 (Fig. 7b) showcasing GoF values of 65.5% and 45.5%,
respectively. Predictions of peak amplitudes in the nonlinearity-free Fourier
transform amplitude (Fig. 7(3), orange line) closely align the expected
outcomes (blue line) deviating only by the error threshold level. Also, the
networks predict values close to zero rather than precisely zero, contributing
to worse GoF metric results. One should keep in mind here that these
discrepancies are extremely low: at the level of around 2e-3 as presented in
Fig. 7a4 and b4.

Table 1: The number of cases where GoF with error threshold 0.1% falls below
95% for objects with a specific number of reflective layers.

Net. | Interfaces | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Totals
---|---|---|---|---|---|---|---|---|---|---|---|---|---
| # below 95% | 384 | 260 | 193 | 138 | 105 | 87 | 79 | 55 | 45 | 44 | 37 | 1381
#1 | # in dataset | 1363 | 1363 | 1363 | 1363 | 1363 | 1363 | 1363 | 1363 | 1363 | 1363 | 1363 | 14993
| % below | 28.17 | 19.08 | 14.16 | 10.12 | 7.70 | 6.38 | 5.80 | 4.04 | 3.30 | 3.32 | 2.71 | 9.52
| # below 95% | 107 | 82 | 57 | 54 | 38 | 32 | 31 | 22 | 13 | 13 | 11 | 460
#2 | # in dataset | 1363 | 1363 | 1363 | 1363 | 1363 | 1363 | 1363 | 1363 | 1363 | 1363 | 1363 | 14993
| % below | 7.85 | 6.02 | 4.18 | 3.96 | 2.79 | 2.35 | 2.27 | 1.61 | 0.95 | 0.95 | 0.81 | 3.07

Figure 7: Predictions with very low GoF for 0.1% error threshold for (a)
Network #1 and (b) Network #2. Based on the input stack (1), models predict
(2, orange line, PR) amplitudes free of the respective nonlinearity that
exhibit a strong correlation with the ground truth (2, blue line, GT). (3)
Nonlinearity-free peaks are recovered with high fidelity, but (4) the models
sometimes struggle with zero-valued places.

###  3.2 Experimental signals: mirror at different depths

Networks were tested on the signals obtained through an OCT imaging of a
mirror placed at 11 different depth positions. Each acquired signal Fourier
transforms to a peak whose amount of second-order-nonlinearity-related
broadening and third-order-nonlinearity-related distortion increases with
depth (Fig. 8a). Due to their simultaneous appearance, the third-order
nonlinearity manifests itself in the form of peak elongation. The depth-
dependent deterioration is due to the fundamental limitations of OCT’s
spectrometer-based light detection. Additionally, the second- and third-order
nonlinearities originating from the OCT’s interferometer add up - depth-
independently - to that effect, further worsening the outcome. Typically,
spectrometer- and interferometer-related nonlinearities can be satisfactorily
removed in a calibration step before the measurement.

The application of Network #1 removes the second-order nonlinearity in its
entirety and consequently, provides a dramatic reduction of peaks’ widths
(Fig. 8b). Because the third-order nonlinearity remains intact, the peaks’
shapes incorporate the characteristic ”tail”. On the other hand, Network #2
removes the third-order nonlinearity, leading to a complete reduction of the
elongation (Fig. 8c).

Figure 8: Mirror at 11 different depths. (a) Fourier transforming raw signals
results in peaks that are both broadened by the second-order nonlinearity and
distorted by the third-order nonlinearity. The deeper the peak, the bigger the
nonlinearity effect, a behaviour characteristic of OCT signals acquired with a
spectrometer. (b) Network #1 removes the second-order nonlinearity, leaving
the third-order one intact. (c) Network #2 removes the third-order
nonlinearity, leaving the third-order one intact. (d, e) The traditional
linearisation (grey line) is not as precise as our approach (green lines).

One observes the superiority of our approach when the peaks obtained with
Network #1 are compared to the peaks obtained as a result of traditional
linearisation methods which remove all nonlinearity orders. Here, we used the
method in [1] where two raw signals corresponding to the mirror placed at two
different locations are used. First, their phases are subtracted to remove the
constant interferometer-related contribution, enabling the calculation of the
correction vector for spectrometer-related nonlinearities. Once the
spectrometer’s nonlinearity is removed, one of the initial spectra is used to
generate an interferometer-nonlinearities-compensating vector. The peaks
located close to 0 depth index obtained using our approach and the standard
linearisation method (Fig. 8d, green and grey lines) are similar in shape: the
network-outputted peak is higher which is very favourable - it means a higher
signal-to-noise ratio, which is associated with better quality imaging. One
observes a small ”tail” at the side, most probably due to a small amount of
third-order nonlinearity present at such shallow depths, whereas the peak
obtained using the traditional methods is a smooth Gaussian. More
interestingly, for a peak at a substantial depth (Fig. 8e), where the third-
order nonlinearity is naturally much bigger (let us remind that this depth-
increasing nonlinearity is tied to OCT spectrometer), the ”tail” is much more
pronounced in case of our network but not present in case of the traditional
method. In the latter case, the peak is elongated which suggests the presence
of both second- and third-order nonlinearities. This leads to the conclusion
that traditional linearisation, although very satisfactory in practical
applications, still has room for improvement. In fact, despite 30 years of OCT
in science and industry, new methods for more precise OCT data linearisation
are still being developed.

###  3.3 Glass

Figure 9: Sapphire glass. (a) Fourier transformation of raw signals gives an
OCT image where the quality deteriorates with depth. (b) Network #1 removes
the second-order nonlinearity which accounts for the most of quality
deterioration, (c) Due to a small amount of the third-order nonlinearity, the
application of Network #2 does not improve the image quality. (d), Image line
#152 from Network #1 (green line) is compared with its raw image equivalent
(grey line) to show dramatic peaks’ width reduction, (e) The image line #152
from Network #2 output (green line) and its raw image equivalent (grey line)
show no significant difference except for a more favourable shape for the
former. (f) Network #1 (green line) performs quite well when compared to the
traditional method output (black line). 1 and 2 mark the front and back
surface of the imaged glass, the middle line is an artefact.

Another test was performed on data corresponding to a 300$\mu$m thick sapphire
glass put at an angle obtained with the same instrument. This data consisted
of 256 raw OCT signals which represent a different transversal location on the
glass. When Fourier transformed one after another, they form a 2D depth image
of the object (Fig. 9a, 1 and 2 denote the front and back surface of the
glass, the third line is an artefact placed at the depth equal to the
thickness of the glass, inherent to OCT). Without linearisation, the image
elements are broadened the deeper they are. When the same data is processed
with Network #1, the broadening is removed from all the image elements (see
the image in Fig. 9b and the 152nd image line in Fig. 9d). Due to very small
amounts of the third-order nonlinearity, Network #2 does not bring perceptible
improvements (Fig. 9c), but under a closer inspection of a single image line
(Fig. 9e), one can observe some improvement in the peak height and a possible
side elongation reduction.

Fig. 9f compares the output of Network #1 (green line) and the traditional
linearisation method (black line), indicating that this model could be a
satisfactory alternative for the traditional image calculation algorithm when
the third-order nonlinearities are negligible. It can be used as such an
alternative for the OCT laboratory instrument which was used here to obtain
the data and which is nevertheless a fairly good representative of a standard
OCT instrument. We note that Network #1 improved the shape of the artefact
(the middle peak in Fig. 9f), which - although generally irrelevant for OCT
imaging - is still something noteworthy as such a feat is beyond the
capabilities of traditional linearisation methods, showing that our approach,
unlike the traditional ones, removes the nonlinearities nondiscriminatively.

###  3.4 Grape and cucumber

The final tests were performed on the data corresponding to a grape (Fig. 10)
and a cucumber (Fig. 11). The former represents a high signal-to-noise ratio
(highly visible modulation in the signal as depicted in Fig. 10a) and the
latter a low signal-to-noise ratio (poorly visible modulation in the signal as
depicted in Fig. 11a).

Fourier transformation of raw signals gives images of a low quality that
further deteriorates with depth (Fig. 10b, Fig. 11b). Again, the improvement
obtained when applying Network #1 (Fig. 10c, Fig. 11c) is comparable to that
obtained with traditional methods (Fig. 10d, Fig. 11d). Under closer
inspection (Fig. 10e, Fig. 11e), one notices that Network #1 output is less
detailed for the higher signal-to-noise grape data - most probably due to the
remaining third-order nonlinearities - and loses some details for the lower
signal-to-noise ratio cucumber data. The latter loss is the direct consequence
of training data representing predominantly high signal-to-noise ratio
signals.

Just as in the case of the glass data, due to small amounts of third-order
nonlinearity, Network #2 did not provide visually significant improvement and
therefore, was omitted.

##  4 Summary and discussion

Two models were demonstrated: one for removing second-order nonlinearity from
digital signals and leaving the third-order one intact, and another one for
removing the third-order nonlinearity but leaving the second-order one intact.
Their nonlinearity-removing capabilities were extensively analysed using
computer-generated signals as well as experimental signals acquired with a
laboratory Optical Coherence Tomography (OCT) device. Tests on the OCT
signals, which corresponded to objects with varying levels of complication:
mirror, sapphire, grape and cucumber, allowed us to evaluate the networks in
terms of their applicability in a world-relevant technology. Whereas the tests
and analysis done on the computer-generated signals revealed extraordinary
performance in terms of similarity of the ground truth and prediction signals,
the tests on OCT-acquired data indicated the networks’ advantageous operation
when compared to approaches traditionally used in OCT.

Figure 10: Grape. (a) One of the raw signals representing a single line in the
image of a grape. (b) Fourier transform of raw signals gives a low-quality
image. (c) Network #1 removes the second-order nonlinearity providing a high-
quality image when compared with (d) the image obtained using traditional
linearisation methods. (e) The prediction for image line #200 agrees very well
with its equivalent from the image obtained using traditional methods.  Figure
11: Cucumber. (a) One of the raw signals representing a single line in the
image of a cucumber. (b) Fourier transform of raw signals gives a low-quality
image. (c) Network #1 removes the second-order nonlinearity providing a high-
quality image compared with (d) the image obtained using traditional
linearisation methods. (e) The prediction for image line #200 agrees well with
its equivalent from the image obtained using traditional methods.

During training, both networks converged exceptionally fast and reached
remarkable loss function values. Nevertheless, we have identified possible
improvements: the closer inspection of the predictions revealed non-zero
values that are zero-valued areas in the ground-truth signals. Another current
shortcoming of both networks is their time of processing an entire OCT image;
consequently, for now, the processing speed is insufficient for the real-time
processing of data coming straight from OCT devices.

##  5 Future work

The future work will mainly consist in developing an approach that enables one
to use both networks in a sequence so that both the second- and third-order
nonlinearity removal is achieved. Since, as was shown here, the networks
remove the nonlinearities completely, their sequential use will provide a very
valuable tool for extremely precise data linearisation, especially attractive
for OCT where any uncompensated nonlinearities lead to the quality drop.

Also, in terms of the network performance, we will try to remove the
discrepancy for zero-valued elements in the ground truth and prediction
signals by adding extra convolutional layers before the output to filter out
the unwanted values as well as performing additional hyperparameter tuning.
Additionally, we plan to speed up the processing of the stacks by lowering the
amount of calculations and the size of the networks.

Acknowledgements. Supported by the New Zealand Ministry of Business,
Innovation and Employment (MBIE), Smart Ideas grant “Extending the Boundaries
of Digital Signal Processing: AI-powered Fourier Transformation Alternative
(E7943)”. We also thank Oliver Batchelor, François Bissey, and Piotr
Kolenderski for sharing their computational resources.

## References

  * Wang and Ding [2008] Kai Wang and Zhihua Ding.  Spectral calibration in spectral domain optical coherence tomography.  _Chinese Optics Letters_ , 6(12):902–904, 2008.
  * Lan and Li [2017] Gongpu Lan and Guoqiang Li.  Design of ak-space spectrometer for ultra-broad waveband spectral domain optical coherence tomography.  _Scientific reports_ , 7(1):42353, 2017.
  * Grulkowski et al. [2018] Ireneusz Grulkowski, Silvestre Manzanera, Lukasz Cwiklinski, Franciszek Sobczuk, Karol Karnowski, and Pablo Artal.  Swept source optical coherence tomography and tunable lens technology for comprehensive imaging and biometry of the whole eye.  _Optica_ , 5(1):52–59, 2018.
  * Hillman and Sampson [2005] Timothy R Hillman and David D Sampson.  The effect of water dispersion and absorption on axial resolution in ultrahigh-resolution optical coherence tomography.  _Optics express_ , 13(6):1860–1874, 2005.
  * Chen et al. [2022] Siyu Chen, Benjamin Potsaid, Yan Li, Junhong Lin, Yunchan Hwang, Eric M Moult, Jason Zhang, David Huang, and James G Fujimoto.  High speed, long range, deep penetration swept source oct for structural and angiographic imaging of the anterior eye.  _Scientific reports_ , 12(1):992, 2022.
  * Huang et al. [2023] Jiangjie Huang, Jinyu Fan, Yi He, and Guohua Shi.  Physical compensation method for dispersion of multiple materials in swept source optical coherence tomography.  _Journal of Biophotonics_ , 16(10):e202300167, 2023.
  * Marks et al. [2003] Daniel L Marks, Amy L Oldenburg, J Joshua Reynolds, and Stephen A Boppart.  Digital algorithm for dispersion correction in optical coherence tomography for homogeneous and stratified media.  _Applied optics_ , 42(2):204–217, 2003.
  * Pan et al. [2017] Liuhua Pan, Xiangzhao Wang, Zhongliang Li, Xiangyang Zhang, Yang Bu, Nan Nan, Yan Chen, Xuan Wang, and Fengzhao Dai.  Depth-dependent dispersion compensation for full-depth oct image.  _Optics express_ , 25(9):10345–10354, 2017.
  * Ahmed et al. [2022] Shaiban Ahmed, David Le, Taeyoon Son, Tobiloba Adejumo, Guangying Ma, and Xincheng Yao.  Adc-net: an open-source deep learning network for automated dispersion compensation in oct.  _Frontiers in Medicine_ , 9:864879, 2022.
  * Kolenderska et al. [2018] Sylwia M Kolenderska, Bastian Bräuer, and Frédérique Vanholsbeeck.  Dispersion mapping as a simple postprocessing step for fourier domain optical coherence tomography data.  _Scientific reports_ , 8(1):9244, 2018.
  * Photiou and Pitris [2019] Christos Photiou and Costas Pitris.  Comparison of tissue dispersion measurement techniques based on optical coherence tomography.  _Journal of biomedical optics_ , 24(4):046003–046003, 2019.
  * Maliszewski et al. [2023] Krzysztof A Maliszewski, Magdalena A Urbańska, Piotr Kolenderski, Varvara Vetrova, and Sylwia M Kolenderska.  Extracting group velocity dispersion values using quantum-mimic optical coherence tomography and machine learning.  _Scientific Reports_ , 13(1):6596, 2023.
  * Photiou et al. [2017] Christos Photiou, Evgenia Bousi, Ioanna Zouvani, and Costas Pitris.  Using speckle to measure tissue dispersion in optical coherence tomography.  _Biomedical optics express_ , 8(5):2528–2535, 2017.
  * Ronneberger et al. [2015] Olaf Ronneberger, Philipp Fischer, and Thomas Brox.  U-net: Convolutional networks for biomedical image segmentation.  In _Medical Image Computing and Computer-Assisted Intervention–MICCAI 2015: 18th International Conference, Munich, Germany, October 5-9, 2015, Proceedings, Part III 18_ , pages 234–241. Springer, 2015.
  * Akiba et al. [2019] Takuya Akiba, Shotaro Sano, Toshihiko Yanase, Takeru Ohta, and Masanori Koyama.  Optuna: A next-generation hyperparameter optimization framework.  In _Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining_, pages 2623–2631, 2019.
  * Kingma and Ba [2014] Diederik P Kingma and Jimmy Ba.  Adam: A method for stochastic optimization.  _arXiv preprint arXiv:1412.6980_ , 2014.
  * Barbedo [2018] Jayme Garcia Arnal Barbedo.  Impact of dataset size and variety on the effectiveness of deep learning and transfer learning for plant disease classification.  _Computers and electronics in agriculture_ , 153:46–53, 2018.