# DRIVE: Data-driven Robot Input Vector Exploration

Dominic Baril1, Simon-Pierre Deschênes, Luc Coupal, Cyril Goffin,
Julien Lépine, Philippe Giguère, François Pomerleau1 *This research was
supported by the Natural Sciences and Engineering Research Council of Canada
(NSERC) through the grant CRDPJ 527642-18 SNOW (Self-driving Navigation
Optimized for Winter). FRQNT as well.1Northern Robotics Laboratory, Université
Laval, Quebec City, Quebec, Canada { dominic.baril, francois.pomerleau
<EMAIL_ADDRESS>
###### Abstract

An accurate motion model is a fundamental component of most autonomous
navigation systems. While much work has been done on improving model
formulation, no standard protocol exists for gathering empirical data required
to train models. In this work, we address this issue by proposing Data-driven
Robot Input Vector Exploration (DRIVE), a protocol that enables characterizing
uncrewed ground vehicles input limits and gathering empirical model training
data. We also propose a novel learned slip approach outperforming similar
acceleration learning approaches. Our contributions are validated through an
extensive experimental evaluation, cumulating over $7\text{\,}\mathrm{km}$ and
$1.8\text{\,}\mathrm{h}$ of driving data over three distinct UGVs and four
terrain types. We show that our protocol offers increased predictive
performance over common human-driven data-gathering protocols. Furthermore,
our protocol converges with $46\text{\,}\mathrm{s}$ of training data, almost
four times less than the shortest human dataset gathering protocol. We show
that the operational limit for our model is reached in extreme slip conditions
encountered on surfaced ice. DRIVE is an efficient way of characterizing UGV
motion in its operational conditions. Our code and dataset are both available
online at this link: https://github.com/norlab-ulaval/DRIVE.

##  I Introduction

The ability to model the motion of uncrewed ground vehicles (UGVs) is
fundamental to enabling localization [1], path planning [2] and path following
[3]. Poor vehicle-terrain characterization will lead to significant modeling
errors, potentially causing system failure [4]. With limited available
information and sensory measurements on vehicle and ground properties,
generating a reliable UGV motion model remains challenging. For most models,
training on empirical data is required to reduce modeling error [5]. This task
requires deploying a UGV in its operational environment and manually drive it
for an extended period [6]. Since energy consumption and deployment time are
critical for various UGV applications, facilitating this task is of high
importance. Additionally, standardizing this process could help engineers to
ensure that their systems are satisfactory to norm ISO 34502:2022(E) on
autonomous navigation.222“ISO 34502:2022(E): Road vehicles — Test scenarios
for automated driving systems — Scenario-based safety evaluation framework”,
2022

Most work on UGV motion modeling relies on manual driving to gather a training
dataset, with little to no details on the driving protocol. Thus, we propose
the  _ Data-driven Robot Input Vector Exploration (DRIVE)_, a protocol aiming
to facilitate and standardize vehicle characterization with respect to the
terrain, as illustrated in Figure 1. We start by identifying the true
vehicle’s input space, differing from the manufacturer’s specifications. We
then automatically send commands to the UGV to cover the entire true input
space. This differs from the common manual driving approach, which tends to
cover only forward driving, as shown by the red dots representing our previous
work [7]. We show that broad input-space coverage offers significant modeling
error reduction compared to narrow coverage. With this dataset, we train a
learned vehicle slip model that maps UGV commands to resulting body
velocities. The resulting trained parameters vary significantly depending on
terrain, as highlighted by the green and blue diamond areas in Figure 1,
representing navigation on gravel and snow respectively.

Figure 1:  Vehicle and terrain characterization done through DRIVE. The
manufacturer-defined Naive input-space region is drawn in gray. The vehicle’s
true input-space, characterized through internal measurements, is shown in
orange. Typical human driving is shown in red. The resulting body velocities
are represented in green for gravel and blue for snow.

The specific contributions of this paper are (i) DRIVE, a standardized UGV
characterization and motion data generation protocol allowing to train motion
models on the entire vehicle input space; (ii) A novel slip-based UGV motion
prediction model, leveraging the accuracy of model-based approaches and the
minimal system characterization requirement of learning-based approaches. We
validate our contributions with an extensive experimental evaluation featuring
three distinct UGVs, with weights ranging from $75\text{\,}\mathrm{kg}$ to
$470\text{\,}\mathrm{kg}$, two types of ground interaction (i.e., wheels and
tracks) and four different terrain types. Our observations rely on driving
data totaling $7\text{\,}\mathrm{km}$ and $1.8\text{\,}\mathrm{h}$.

##  II Related Work

Most vehicle motion modeling approaches can be divided into two distinct
categories: model-based and learning-based. Both categories share the
requirement of using empirical driving data to train their parameters and
reduce modeling errors. For both categories, there exists no standardized
protocol for training dataset generation.

Model-based approaches can be split into two distinct categories: _kinematics_
and _dynamics_. Kinematic models remain the most popular for UGVs due to their
low computational complexity and number of parameters to train. For skid-
steering mobile robots, [8] reduced model prediction error by $15\text{\,}\%$
compared to the manufacturer’s model using a kinematic model empirically
identifying vehicle slip and skid. [9] proposed a similar additive slip
approach, computing slip based on kinematic quantities, yielding prediction
error reduction between $70\text{\,}\%$ and $90\text{\,}\%$ depending on
terrain type, again compared to the manufacturer’s model. [10] extended the
experimental validation for additive slip approaches and showed similar
performance for a $900\text{\,}\mathrm{m}$ experiment on off-road terrain. On
the other hand, dynamic models account for various forces acting on the
vehicle’s body. [4] proposed a multi-body full dynamic motion model with a
generic formulation based on vehicle geometry and properties. This work has
been extended by [11], showing simulation errors of less than $3.4\text{\,}\%$
for vehicle slip ratio. While being more accurate than kinematic models,
dynamic models require extensive vehicle characterization effort and
expertise. For all the work mentioned above, empirical training data is
acquired through a human driving the UGV with little to no guidelines, which
motivates our standardized protocol.

Alternatively, learning-based approaches have been explored in the literature,
yielding more accurate models for extreme UGV motion. In these approaches,
part of the prediction is done through a nominal model, often represented by a
unicycle model, with a module allowing to learning system dynamics. Gaussian
processes have become a popular approach to learn system dynamics, both for
vehicle slip in off-road driving [12] and tire forces in high-speed road
racing [13]. [14] have proposed a similar learning approach, however replacing
GPs learning with Bayesian linear regression (BLR). The lower computational
complexity of BLR, when compared to GPs, makes it a more suitable approach for
real-time UGV motion prediction. Alternatively, [15] have proposed a tire-
force learning framework allowing to perform autonomous drifting with
$3\text{\,}\mathrm{min}$ of driving data. Deep learning has also been explored
for motion prediction in off-road terrain. [6] have shown the ability to
perform aggressive driving when relying on a $30\text{\,}\mathrm{min}$
training dataset. For increased resilience to sensor failure, [16] have
proposed a multi-modal learned-dynamics model that leverages the various
sensor measurements available for UGVs. Due to the importance of prediction
uncertainty in enabling robust control for UGVs [3], this work focuses on BLR,
which provides prediction uncertainty estimations [14]. Our novel _slip-based
BLR_ model allows us to leverage the minimal requirements of learning-based
approaches in terms of system characterization, [14] as well as the better
accuracy of model-based approaches [9]. In this work, the approach of [14] is
used as a comparison point, as it is the closest to our model formulation.

Although both model-based and learning-based approaches require empirical
training data, only a few dataset-gathering protocols have been published.
[17] have proposed to maintain a steady forward velocity while slowly
increasing angular velocity, enabling generation of a quasi-steady-state
empirical dataset. [18] have proposed a similar approach with a varying
commanded curvature radius to empirically identify the relation between
angular velocity and SSMR skid. These approaches only cover a small subset of
the vehicle’s input space. One can also find large, multimodal datasets
allowing to train and evaluate models for off-road and extreme driving [19].
However, such datasets overrepresent forward motion, are limited to a specific
UGV and would require new training data for any new vehicle configuration.
Manual training data gathering guidelines have been proposed by [6], asking
the driver to vary his driving style. However, these remain time-consuming and
subject to input space coverage bias. We demonstrate that training a motion
model with the DRIVE protocol allows increased motion prediction performance
and fast training dataset gathering.

##  III Methodology and Theory

In this section, we provide details on DRIVE, our automated vehicle
characterization and training dataset-gathering protocol. We then describe our
proposed slip-based BLR motion model. Due to the limited number of UGVs
accessible to us, we focus on SSMRs.

The involved model variables are depicted in Figure 2. We limit the states of
the vehicle to planar motion, such that the robot’s state
${}^{\mathcal{G}}\bm{q}=[x,y,\theta]^{T}$ represents the pose of the vehicle
in the global coordinate frame $\mathcal{G}$. The robot’s body frame
$\mathcal{R}$, has its $x$ and $y$ axis aligned with the vehicle’s
longitudinal and lateral directions respectively. For most SSMRs, the input
vector is defined as $\bm{u}=[\omega_{l},\omega_{r}]^{T}$, representing the
left and right wheel angular velocities. State propagation, allowing to
compute the next state $\bm{q}_{t+dt}$ based on the current state $\bm{q}_{t}$
and input $\bm{u}$ is computed as follows:

${}^{\mathcal{G}}\bm{q}_{t+dt}=\ ^{\mathcal{G}}\bm{q}_{t}+\
_{\mathcal{R}}^{\mathcal{G}}\bm{T}\left({}^{\mathcal{G}}\theta_{t}\right)^{\mathcal{R}}\\!\bm{v}_{t}\
dt,$ (1)
${}^{\mathcal{R}}\bm{v}_{t}=\\!^{\mathcal{R}}\bm{f}_{t}(\bm{u}_{t})-\\!^{\mathcal{R}}\bm{s}_{t},$
(2)

where ${}^{\mathcal{R}}\bm{v}_{t}$ is the vehicle’s translational and
rotational body velocity, oriented in the vehicle’s inertial frame
$\mathcal{R}$, and
${}_{\mathcal{R}}^{\mathcal{G}}\bm{T}\left({}^{\mathcal{G}}\theta_{t}\right)$
is a transformation matrix producing a rotation of the robot’s angle in the
world frame ${}^{\mathcal{G}}\theta$. The vehicle’s body velocity
${}^{\mathcal{R}}\bm{v}_{t}\in\mathbb{R}^{3}$ is modeled as the commanded
velocity ${}^{\mathcal{R}}\bm{f}_{t}(\bm{u}_{t})\in\mathbb{R}^{3}$, to which
we subtract the slip velocity ${}^{\mathcal{R}}\bm{s}_{t}\in\mathbb{R}^{3}$.
The delay between UGV commands is represented by $dt$. The diamonds in the
top-left inset of Figure 2 represent conceptually the set of possible
commanded UGV body velocities $\mathcal{J}$ in orange and the set of actually
possible body velocities $\mathcal{B}$. Thus, to characterize UGV motion, we
require two things: a protocol to gather empirical data and a model to learn
vehicle slip.

Figure 2: Top view drawing of a SSMR. In orange is the commanded body velocity
${}^{\mathcal{R}}\bm{f}$ and green is the resulting body velocity
${}^{\mathcal{R}}\bm{v}$. The input-space $\mathcal{J}$ is shown in orange and
the body velocity space $\mathcal{B}$ is shown in green. The difference
between commanded and resulting body velocity is represented as the slip
velocity ${}^{\mathcal{R}}\bm{s}$ in purple. All represented velocities have
an angular component $(\cdot)_{\omega}$. Robot parameters are the wheel radius
$r$ and vehicle width $b$.

Our DRIVE protocol, described in Section III-A, automates the task of
gathering a complete training dataset $\mathcal{D}$
$=\left\\{\bm{u},\tilde{\bm{u}},\bm{X}_{x},\bm{s}_{x},\bm{X}_{y},\bm{s}_{y},\bm{X}_{\omega},\bm{s}_{\omega}\right\\}$,
where we concatenate $n$ observations of slip input
$\bm{X}\in\mathbb{R}^{n\times k}$ and slip velocities
$\bm{s}\in\mathbb{R}^{n}$ for each vehicle dimension. The number of slip
inputs per dimension is defined as $k$. This data is also used to train a
powertrain model for each side of the SSMR by minimizing the error between
commanded $\tilde{\bm{u}}$ and measured $\bm{u}$ vehicle input through the
powertrain parameters described in Section III-B1. We then use BLR to train
our slip-based learning model, described in Section III-B2.

###  III-A Data-driven Robot Input Vector Exploration (DRIVE)

To learn any UGV slip model, we require a training dataset $\mathcal{D}$.
Details on the composition of this dataset are given throughout Section III-B.
It has been shown that numerous factors impact UGV dynamics, such as vehicle
orientation [4], tire saturation [15] and ground properties [7]. However,
coverage of the entire spectrum of dynamic features for UGVs would require a
large-scale training dataset, and extracting insights from this dataset would
be plagued by the curse of dimensionality [20]. We simplify our problem by
enabling stimulation of the entire input space $\mathcal{J}$ for the UGV,
represented as the orange diamond in Figure 2. We rely on random, uniform
sampling of UGV inputs since it was previously shown that random search on
multidimensional space is faster and offers similar performance as grid search
[21]. Thus, our protocol coupled with an approximate UGV motion model allows
fast training dataset gathering for faster deployment in novel operational
conditions. The system requirements to perform our protocol are as follows:
(i) a sub-servo system mapping body-level commands to wheel commands; (ii)
vehicle acceleration limits to reduce strain on vehicle components; (iii) an
accurate localization system, estimating the robot position and velocity in a
global frame; (iv) a safety operator to prevent the vehicle from leaving a
predefined safe perimeter during the random command sampling. Lastly, we
release our protocol as an open-source package to facilitate replicability.

The first step of DRIVE is to send high body longitudinal velocity commands to
the platform in both directions to determine the wheel velocity limits
$\omega_{min}$ and $\omega_{max}$. This way, we define the UGV’s true input-
space $\mathcal{J}$ as combinations of left and right commanded wheel
velocities, such that $\omega_{min}\leq\omega_{l},\omega_{r}\leq\omega_{max}$
for SSMRs. This input-space $\mathcal{J}$ is shown in terms of body velocities
as the orange diamond in Figure 2. Once the input-space limits are defined, we
sample input vectors $\bm{u}_{s}$ from our calibration distribution, defined
as a two-dimensional uniform distribution parametrized by vehicle input limits
$\bm{u}_{s}\sim\mathcal{U}_{2}\left(\,\bm{\omega}_{min},\bm{\omega}_{max}\,\right)$.
Our goal is then to maintain each sampled input for a duration sufficient to
gather steady-state motion data. Thus, we define training windows of
$2\text{\,}\mathrm{s}$, the same duration as typically used in the seminal UGV
path following work of [6]. We assume the UGV requires one training window to
reach any desired wheel velocity. Since the majority of UGV motion is quasi-
steady state [17], we define a training interval consisting of one transient
training window and two steady training windows, lasting a total of
$6\text{\,}\mathrm{s}$. An example of two training intervals is shown in
Figure 3. We use transient-state windows to train our powertrain model,
described in Section III-B1. We keep both steady-state and transient-state
windows for our model training and evaluation to enable both steady-state and
transient model training. This procedure is repeated until the user stops or
the desired data generation time is reached, which varies depending on the
user’s goal.

Figure 3:  Commanded, encoder-measured and modeled wheel velocities for both
sides of a SSMR during two DRIVE training intervals. The powertrain model is
described in Section III-B1. Each training step consists of one transient-
state window (in light gray) and two steady-state windows (in dark gray).
Commands and measurements on the x-axis are acquired at a rate of
$20\text{\,}\mathrm{Hz}$.

###  III-B Dynamics-aware slip-based model

####  III-B1 Powertrain model

We start by defining a powertrain model to reduce the predicted wheel velocity
$\hat{\omega}$ error, the result of which can be seen as both dashed lines in
Figure 3. We use the same first-order plus dead time transient response model
as used by [5]:

$\displaystyle\hat{\omega}_{t}$
$\displaystyle=\left(e^{\beta}\right)\omega_{t_{0}}+\left(1-e^{\beta}\right)\tilde{\omega}_{t-\tau_{d}}\
,$ (3) $\displaystyle\beta$ $\displaystyle=\frac{(t-\tau_{d})}{\tau_{c}}\ ,$

where $\hat{\omega}$, $\tilde{\omega}$ and $\omega$ are the predicted,
commanded and measured wheel velocities, respectively. We also define the
initial time $t_{0}$ and prediction horizon at time $t$. Here, the parameters
that require characterization are the time constant $\tau_{c}$ and the time
delay $\tau_{d}$. One should note that these parameters are not considered
symmetrical in our protocol and are trained independently for both sides of
SSMRs. Thus, our protocol can identify vehicle powertrain asymmetries.

####  III-B2 Body slip model

Next, we define a model enabling to compute both the commanded body velocity
${}^{\mathcal{R}}\bm{f}_{t}$ and resulting slip velocity
${}^{\mathcal{R}}\bm{s}_{t}$ with respect to predicted input
$\tilde{\bm{u}}_{t}$. For SSMRs, the commanded body velocity
${}^{\mathcal{R}}\bm{f}_{t}(\tilde{\bm{u}}_{t})$ can be modeled through the
ideal differential-drive model [8] as

${}^{\mathcal{R}}\bm{f}_{t}(\bm{u}_{t})=\begin{bmatrix}f_{x}\\\ f_{y}\\\
f_{\omega}\\\ \end{bmatrix}=r\begin{bmatrix}\frac{1}{2},\frac{1}{2}\\\ 0,0\\\
\frac{-1}{b},\frac{1}{b}\\\
\end{bmatrix}\begin{bmatrix}\hat{\omega_{l}}_{t}\\\ \hat{\omega_{r}}_{t}\\\
\end{bmatrix},$ (4)

where $r$ and $b$ are the SSMR’s wheel or track sprocket radius and vehicle
width, respectively, as shown in Figure 2. We use the estimated wheel
velocities through Equation 3 as the input vector $\tilde{\bm{u}}_{t}$. We
consider slip in each dimension of the vehicle separately
${}^{\mathcal{R}}\bm{s}_{t}=[s_{x},s_{y},s_{\omega}]^{T}$, with the form

$s_{t}=\bm{\gamma}^{T}\ \\!{}^{\mathcal{R}}\bm{x}_{t}+\eta,$ (5)

where $\bm{\gamma}\in\mathbb{R}^{k}$ are the weights associated to each slip
input and $\eta\sim\mathcal{N}(0,\sigma^{2})$. We draw inspiration from off-
road vehicles dynamics work in the literature to define dynamics-aware basis
functions for vehicle slip [9]. As shown by [4], the following set of basis
functions to estimate vehicle slip shows similar performance as fully dynamic
models in off-road terrain. Firstly, for longitudinal slip
${}^{\mathcal{R}}\bm{s}_{x}$, we use the vehicle’s rolling resistance,
proportional to commanded body longitudinal velocity
${}^{\mathcal{R}}\bm{x}_{x}=f_{x}$. Secondly, for lateral slip
${}^{\mathcal{R}}\bm{s}_{y}$, we use centrifugal force
${}^{\mathcal{R}}\bm{x}_{y}=\psi=(f_{x}f_{\omega})$, proportional to commanded
longitudinal and angular velocities. Thirdly, for angular slip
${}^{\mathcal{R}}\bm{s}_{\omega}$, we use three distinct slip learning inputs
${}^{\mathcal{R}}\bm{x}_{\omega}=[\psi,f_{x},f_{\omega}]$. The first angular
slip input is the vehicle’s centrifugal force $\psi$. We then add UGV
asymmetry, which can be caused by manufacturing imperfections and mechanical
wear, causing angular velocity error proportional to commanded longitudinal
velocity $f_{x}$. Finally, we account for the vehicle’s skid, leading to an
error between commanded angular velocity and actual angular velocity
$f_{\omega}$. It should be noted that the vehicle gravity-dependent
parameters, used by [9], are missing in this work. The reason is that we
simplify our calibration protocol to be executed on planar terrain. The
remainder of this section describes how we learn slip for a single dimension,
but the process is the same for all dimensions of slip.

We use Bayesian linear regression (BLR) to estimate the values for
$\bm{\gamma}$ and $\sigma^{2}$. For a more in-depth explanation of BLR, refer
to the book written by [22]. It can be shown that the posterior for learned
parameters $p(\bm{\gamma},\sigma^{2}|\mathcal{D}_{\text{d}})$ is distributed
according to a Normal Inverse Gamma distribution
$\text{NIG}(\bm{\gamma},\sigma^{2}|\bm{\gamma},\bm{K},a,b)$, where

$\displaystyle\bm{\gamma}$
$\displaystyle=\bm{K}\left(\bm{K}_{0}^{-1}\bm{\gamma}_{0}+{\bm{X}}^{T}{\bm{s}}\right),$
(6) $\displaystyle\bm{K}$
$\displaystyle=(\bm{K}_{0}^{-1}+{\bm{X}}^{T}{\bm{X}})^{-1},$ $\displaystyle a$
$\displaystyle=a_{0}+\frac{n}{2},$ $\displaystyle b$
$\displaystyle=b_{0}+\frac{1}{2}\left(\bm{\gamma}_{0}^{T}\bm{K}_{0}^{-1}\bm{\gamma}_{0}+{\bm{s}}^{T}{\bm{s}}-\bm{\gamma}^{T}\bm{K}^{-1}\bm{\gamma}\right),$

where the estimated covariance of the distribution is represented by
$\bm{K}\in\mathbb{R}^{k\times k}$. Priors for all parameters are defined by
the $(\cdot{})_{0}$ subscript. We define $\mathcal{D_{\text{d}}}$ =
$\left\\{\bm{X},\bm{s}\right\\}$ as a training dataset consisting of vectors
of $n$ concatenated observed values for slip inputs ${\bm{X}}$ and observed
slip velocities $\bm{s}$ for a specific dimension. The posterior equations can
be used to train the BLR slip model for each dimension based on a training
dataset $\mathcal{D}_{\text{d}}$. Once the model is trained, we can predict
vehicle slip based on $m$ test inputs $\tilde{\bm{X}}\in\mathbb{R}^{m\times
k}$:

$p\left(\hat{\bm{s}}|\tilde{\bm{X}},\mathcal{D}_{\text{d}}\right)=\mathcal{T}\left({\bm{s}}|{\bm{X}}\bm{\gamma},\frac{b}{a}\left(\bm{I}_{m}+{\bm{X}}\bm{K}{\bm{X}}^{T}\right),2a\right),$
(7)

where $\mathcal{T}$ is a Student’s t-distribution and $\hat{\bm{s}}$
represents a vector of $m$ concatenated predicted slip velocities for a
specific direction. In this work, we use an uninformative prior to ensure our
protocol requires as little expertise as possible to execute. This consists of
setting $a_{0}=b_{0}=0$, $\bm{\gamma}_{0}=\bm{0}$ and
$\bm{K}_{0}=\phi(\bm{X}^{T}\bm{X})^{-1}$ for any positive value $\phi$. This
allows to initialize our slip-based training model with little knowledge of
the UGV except for wheel radius $r$ and vehicle width $b$.

##  IV Results

In this section, we evaluate the improvement of motion prediction accuracy
when training models with the DRIVE protocol. We also analyze the number of
training data required to reach convergence with our model. Finally, we
demonstrate that for off-road navigation of SSMRs, learning vehicle slip based
on dynamics-aware basis functions is more accurate than learning on vehicle
acceleration.

###  IV-A Experimental Setup

We have conducted an extensive experimental evaluation of our calibration
protocol and novel slip-based BLR model. Three distinct UGV platforms were
used, as shown in Figure 4. First, we tested on a _Clearpath Robotics_ Warthog
on wheels, weighing $470\text{\,}\mathrm{kg}$, on gravel-covered terrain and
an ice rink. The ice rink was leveled and recently resurfaced, leading to an
extreme vehicle slip. Next, we tested on smaller platforms, namely a wheeled
_Clearpath Robotics_ Husky, weighing $75\text{\,}\mathrm{kg}$, and a tracked
_Superdroid_ HD2, weighing $80\text{\,}\mathrm{kg}$, both on indoor tile and
snow-covered terrain. The Warthog has a top speed of
$5\text{\,}\mathrm{m}\mathrm{/}\mathrm{s}$, which is around five times that of
the HD2 at $1.2\text{\,}\mathrm{m}\mathrm{/}\mathrm{s}$ and of the Husky at
$1\text{\,}\mathrm{m}\mathrm{/}\mathrm{s}$. These platforms and terrains were
selected to maximize the difference in properties between experiments. For all
platforms, localization ground truth is estimated through point-cloud
registration with the iterative closest point (ICP) algorithm. This
localization approach was selected to use a common, centimeter-accurate ground
truth [23] across all indoor and outdoor experiments. The localization system
for the Husky and HD2 robots is described in [24] and for the Warthog in [25].
For every experiment, the recorded data was split into two halves, the
training dataset and the evaluation dataset, to enable extensive model
evaluation. Our experimental dataset totals over $7\text{\,}\mathrm{km}$ and
$1.8\text{\,}\mathrm{h}$ of driving data across all platforms and terrain
types.

Figure 4: Three different commercial platforms that were used for the
experimental work: a _Superdroid_ HD2 (1), a _Clearpath Robotics_ Husky (2),
and a _Clearpath Robotics_ Warthog mounted on wheels (3). The platforms weigh
$80\text{\,}\mathrm{kg}$, $75\text{\,}\mathrm{kg}$ and
$470\text{\,}\mathrm{kg}$, respectively.

###  IV-B Protocol performance analysis

First, we define a function to evaluate model prediction performance. While
learned models are trained on single-step vehicle slips or accelerations, our
goal is to use them to predict vehicle motion over a specific horizon. One
should note that we train our model on single-step slip velocities to simplify
the learning problem. [6] showed that this simplification allows sufficient
prediction performances for high-speed UGV path following. Thus, we use the
multi-step root mean squared error (MRMSE) $\epsilon$ to evaluate prediction
errors [14], with our localization as ground truth:

$\displaystyle\epsilon$
$\displaystyle=\frac{1}{h}\sum_{j=1}^{h}\sqrt{(\,^{\mathcal{G}}\bm{q}_{j}-\,^{\mathcal{G}}\\!\hat{\bm{q}}_{j})^{T}\bm{\Sigma}(\,^{\mathcal{G}}\bm{q}_{j}-\,^{\mathcal{G}}\\!\hat{\bm{q}}_{j})}\
,$ (8)

where $h$ is the prediction window size. We define the measured state as
$\,{}^{\mathcal{G}}\bm{q}$ and the model-predicted state as
$\,{}^{\mathcal{G}}\\!\hat{\bm{q}}$. All robots are commanded at
$20\text{\,}\mathrm{Hz}$ and the prediction window length is set at
$2\text{\,}\mathrm{s}$ reflecting the established path following work of [6].
We divide this error into translational MRMSE $\epsilon_{T}$, for which
$\bm{\Sigma}=\text{diag}(1,1,0)$ and rotational MRMSE $\epsilon_{R}$, for
which $\bm{\Sigma}=\text{diag}(0,0,1)$.

As a first evaluation, we evaluate the MRMSE for the HD2 on snow to highlight
the improvement of using our input-space complete calibration protocol. Three
distinct training datasets gathering approaches are shown, namely the linear-
focused, similar to typical human driving [6], the angular-focused [18], and
our DRIVE protocol. In the top subplot of Figure 5, we show the translational
and angular error distributions for all three data-gathering methods. In the
bottom subplot of Figure 5, it can be seen that the DRIVE protocol
significantly outperforms other training data-gathering methods. Indeed, our
data-gathering protocol offers a $31\text{\,}\%$ decrease in translation
prediction error median when compared to the angular-focused approach and a
$51\text{\,}\%$ decrease in rotation prediction error median when compared to
the linear-focused approach. These values show that our input-space-aware
DRIVE protocol allows gathering a dataset leading to decreased prediction
error for both translation and rotation.

Figure 5:  Data-gathering protocol performance for the HD2 on snow experiment.
The top subplot illustrates the three data-gathering methods compared in this
work. In yellow, we have the linear-focused method. In teal, we have the
angular-focused method. In blue-violet is our DRIVE approach. The crosses and
regions on the bottom subplot show the medians and interquartile ranges for
translational and angular prediction errors.

###  IV-C Slip-based learning predictive performance

In Section III-B, we propose a novel slip-based BLR model to predict UGV
motion. Figure 6 shows this model’s performance for both translational and
rotational prediction, compared to another BLR learning approach based on
vehicle acceleration [14]. We present three distinct datasets, namely HD2 on
tile along with wheeled Warthog on gravel and ice. The rightmost results
combine the prediction errors for all experiments conducted in this work. We
also show the performance of the model provided by manufacturers (i.e., Naive)
and the improvement done through powertrain modeling.

Figure 6:  Translational and rotational prediction errors for all models
studied in this work. In yellow is the manufactured-defined naive model, in
orange is the powertrain-aware model described in Section III-B1, in red is
the acceleration-based BLR model and in purple is our slip-based BLR model.

When accounting for all datasets, we observe a $34\text{\,}\%$ decrease in
translation prediction error median and a $38\text{\,}\%$ decrease in rotation
prediction error median when comparing the naive model with the powertrain-
aware model. Also, our slip-based BLR approach leads to a $22\text{\,}\%$
decrease in rotation prediction error median and a $6\text{\,}\%$ decrease in
translation prediction error median when compared to acceleration-based BLR.
Looking at specific experiments, the Warthog in gravel shows the largest
improvement between our slip BLR and acceleration BLR, with $71\text{\,}\%$ in
rotation error median and $23\text{\,}\%$ in translation error median. In
contrast, the HD2 on tile experiment shows a performance decrease for
acceleration BLR and similar performance for slip BLR when compared to the
powertrain model. Indeed, the indoor tile ground already had low prediction
error for the powertrain-aware model. Lastly, the ice rink experiment shows
similar performance between slip and acceleration BLR. This experiment
corresponds to an extreme slip, similar to a UGV driving over black ice for an
extended duration. This result shows the limit of our slip-based BLR model
which still performs similarly or better than other models In this case,
dynamic modeling could improve performance. Overall, we conclude that slip-
based BLR offers improved performances for rotation prediction and similar
performance in translation prediction over acceleration-based BLR, especially
for driving at higher velocities on off-road terrains. For SSMRs in
particular, rotation motion is the highest source of error due to the
complexity of wheel-terrain skidding interactions [7], justifying the
significance of our model.

Moreover, generating the training data is time and energy-consuming, which
leads us to look for a trade-off between calibration duration and model
prediction accuracy. Thus, we evaluated the relationship between training
driving time and prediction accuracy. The results are shown in Figure 7. Three
distinct experiments are presented, notably Husky on snow, HD2 on tile and
Warthog on gravel. No other experiment is shown, to avoid cluttering, but
similar results were observed. As specified in Section III-B2, an
uninformative prior is used for every platform, explaining the initially high
errors.

Figure 7:  The relation between training time and our slip-based BLR model
prediction performance, for translation and rotation. Three datasets are
shown, namely the Husky on snow in teal, the HD2 on tile in pink and the
wheeled Warthog on gravel, in blue. We highlight at $46\text{\,}\mathrm{s}$
the converged value with the red line, for which our model converges for all
UGVs tested. For all subplots, both axes are in log scale.

As shown by the red vertical line in Figure 7, the prediction accuracy
stabilizes after $46\text{\,}\mathrm{s}$ of driving time for all robots. To
compute this time, we evaluated the error gradient with respect to calibration
time. We then evaluated the maximum time for which the translational and
rotational error values for all shown experiments was under
$0.01\text{\,}\mathrm{m}\mathrm{/}\mathrm{s}$ or
$0.01\text{\,}\mathrm{rad}\mathrm{/}\mathrm{s}$, indicating all models have
converged. Thus, users of the DRIVE protocol SSMRs can expect that the slip-
based BLR motion model has converged after $46\text{\,}\mathrm{s}$ of training
data, which is almost four times shorter than $180\text{\,}\mathrm{s}$, the
shortest training time observed in other work [15].

##  V Conclusion

In this paper, we proposed  _ Data-driven Robot Input Vector Exploration
(DRIVE)_, an automated vehicle characterization and training data generation
protocol. We also propose a novel UGV prediction model called slip-based BLR.
We show that training our model with our protocol offers improved prediction
performances when comparing common training approaches and similar learning-
based models. We also show that with our protocol, model convergence is
reached with four times less driving time than the shortest similar protocol.
We conclude that our protocol represents an efficient option for generating an
initial motion model for UGVs. Future work would include generalizing our
protocol to any vehicle geometry (e.g., Ackermann steering) and adapting our
model formulation for complete dynamic models for extreme slip situations such
as driving on surfaced ice. Adaptive modeling, relying on DRIVE to provide the
initial training, should also be investigated.

## References

  * [1] Frederike Dümbgen, Connor Holmes and Timothy D. Barfoot  “Safe and Smooth: Certified Continuous-Time Range-Only Localization”  In _IEEE Robotics and Automation Letters (RA-L)_ 8.2, 2023, pp. 1117–1124  DOI: 10.1109/LRA.2022.3233232
  * [2] Reiya Takemura and Genya Ishigami  “Traversability-based Trajectory Planning with Quasi-Dynamic Vehicle Model in Loose Soil”  In _IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)_ , 2021, pp. 8411–8417  DOI: 10.1109/IROS51168.2021.9635891
  * [3] Lukas Brunke et al.  “Safe Learning in Robotics: From Learning-Based Control to Safe Reinforcement Learning”  In _Annual Review of Control, Robotics, and Autonomous Systems_ 5.1, 2022, pp. 411–444  DOI: 10.1146/annurev-control-042920-020211
  * [4] Neal Seegmiller and Alonzo Kelly  “High-Fidelity Yet Fast Dynamic Models of Wheeled Mobile Robots”  In _IEEE Transactions on Robotics (T-RO)_ 32.3 IEEE, 2016, pp. 614–625  DOI: 10.1109/TRO.2016.2546310
  * [5] Neal Seegmiller, Forrest Rogers-Marcovitz, Greg Miller and Alonzo Kelly  “Vehicle model identification by integrated prediction error minimization”  In _The International Journal of Robotics Research (IJRR)_ 32.8, 2013, pp. 912–931  DOI: 10.1177/0278364913488635
  * [6] Grady Williams et al.  “Information-Theoretic Model Predictive Control: Theory and Applications to Autonomous Driving”  In _IEEE Transactions on Robotics (T-RO)_ 34.6, 2018, pp. 1603–1622  DOI: 10.1109/TRO.2018.2865891
  * [7] Dominic Baril et al.  “Evaluation of Skid-Steering Kinematic Models for Subarctic Environments”  In _17th Conference on Computer and Robot Vision (CRV)_ IEEE, 2020, pp. 198–205  DOI: 10.1109/CRV50864.2020.00034
  * [8] Anthony Mandow et al.  “Experimental kinematics for wheeled skid-steer mobile robots”  In _IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)_ , 2007, pp. 1222–1227  DOI: 10.1109/IROS.2007.4399139
  * [9] Neal Seegmiller and Alonzo Kelly  “Enhanced 3D Kinematic Modeling of Wheeled Mobile Robots”  In _Robotics: Science and Systems X (RSS)_ Robotics: ScienceSystems Foundation, 2014  DOI: 10.15607/RSS.2014.X.020
  * [10] Kristin Bussmann, Lukas Meyer, Florian Steidle and Armin Wedler  “Slip Modeling and Estimation for a Planetary Exploration Rover: Experimental Results from Mt. Etna”  In _IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)_ , 2018, pp. 2449–2456  DOI: 10.1109/IROS.2018.8594294
  * [11] Huaiguang Yang et al.  “High-Fidelity Dynamic Modeling and Simulation of Planetary Rovers Using Single-Input-Multi-Output Joints With Terrain Property Mapping”  In _IEEE Transactions on Robotics (T-RO)_ 38.5 IEEE, 2022, pp. 3238–3258  DOI: 10.1109/TRO.2022.3160018
  * [12] Jie Wang, Michael T.. Fader and Joshua A. Marshall  “Learning-based model predictive control for improved mobile robot path following using Gaussian processes and feedback linearization”  In _Journal of Field Robotics (JFR)_ 40.5, 2023, pp. 1014–1033  DOI: https://doi.org/10.1002/rob.22165
  * [13] Lukas Hewing, Juraj Kabzan and Melanie N. Zeilinger  “Cautious Model Predictive Control Using Gaussian Process Regression”  In _IEEE Transactions on Control Systems Technology (T-CST)_ 28.6, 2020, pp. 2736–2743  DOI: 10.1109/TCST.2019.2949757
  * [14] Christopher D. McKinnon and Angela P. Schoellig  “Learn Fast, Forget Slow: Safe Predictive Learning Control for Systems With Unknown and Changing Dynamics Performing Repetitive Tasks”  In _IEEE Robotics and Automation Letters (RA-L)_ 4.2 IEEE, 2019, pp. 2180–2187  DOI: 10.1109/LRA.2019.2901638
  * [15] Franck Djeumou, Jonathan Y.M. Goh, Ufuk Topcu and Avinash Balachandran  “Autonomous Drifting with 3 Minutes of Data via Learned Tire Models”  In _IEEE International Conference on Robotics and Automation (ICRA)_ , 2023, pp. 968–974  DOI: 10.1109/ICRA48891.2023.10161370
  * [16] Jean-Francois Tremblay et al.  “Multimodal dynamics modeling for off-road autonomous vehicles”  In _IEEE International Conference on Robotics and Automation (ICRA)_ , 2021, pp. 1796–1802  DOI: 10.1109/ICRA48506.2021.9561910
  * [17] Christoph Voser, Rami Y. Hindiyeh and J. Gerdes  “Analysis and control of high sideslip manoeuvres”  In _Vehicle System Dynamics_ 48.sup1, 2010, pp. 317–336  DOI: 10.1080/00423111003746140
  * [18] Tianmiao Wang et al.  “Analysis and Experimental Kinematics of a Skid-Steering Wheeled Robot Based on a Laser Scanner Sensor”  In _Sensors_ 15.5, 2015, pp. 9681–9702  DOI: 10.3390/s150509681
  * [19] Samuel Triest et al.  “TartanDrive: A Large-Scale Dataset for Learning Off-Road Dynamics Models”  In _IEEE International Conference on Robotics and Automation (ICRA)_ , 2022, pp. 2546–2552  DOI: 10.1109/ICRA46639.2022.9811648
  * [20] Richard Bellman  “Dynamic Programming”  In _Science_ 153.3731, 1966, pp. 34–37  DOI: 10.1126/science.153.3731.34
  * [21] James Bergstra and Yoshua Bengio  “Random Search for Hyper-Parameter Optimization”  In _Journal of Machine Learning Research (JMLR)_ 13.10, 2012, pp. 281–305  URL: http://jmlr.org/papers/v13/bergstra12a.html
  * [22] Kevin P. Murphy  “Machine Learning: A Probabilistic Perspective”  The MIT Press, 2012
  * [23] François Pomerleau, Francis Colas, Roland Siegwart and Stéphane Magnenat  “Comparing ICP variants on real-world data sets”  In _Autonomous Robots_ 34.3, 2013, pp. 133–148  DOI: 10.1007/s10514-013-9327-2
  * [24] Kamak Ebadi et al.  “Present and Future of SLAM in Extreme Environments: The DARPA SubT Challenge”  In _arXiv preprint arXiv:2208.01787_ , 2022  arXiv: http://arxiv.org/abs/2208.01787
  * [25] Dominic Baril et al.  “Kilometer-scale autonomous navigation in subarctic forests: challenges and lessons learned”  In _Field Robotics_ 2.1, 2022, pp. 1628–1660  DOI: 10.55417/fr.2022050

  *[DRIVE]: Data-driven Robot Input Vector Exploration
  *[UGVs]: uncrewed ground vehicle
  *[UGV]: uncrewed ground vehicle
  *[GPs]: Gaussian processe
  *[BLR]: Bayesian linear regression
  *[ BLR]: Bayesian linear regression
  *[SSMR]: skid-steering mobile robot
  *[SSMRs]: skid-steering mobile robot
  *[ICP]: iterative closest point
  *[MRMSE]: multi-step root mean squared error


# Enhancing Sentiment Analysis Results through Outlier Detection Optimization

Yuetian Chen1, Mei Si2

###### Abstract

When dealing with text data containing subjective labels like speaker
emotions, inaccuracies or discrepancies among labelers are not uncommon. Such
discrepancies can significantly affect the performance of machine learning
algorithms. This study investigates the potential of identifying and
addressing outliers in text data with subjective labels, aiming to enhance
classification outcomes. We utilized the Deep SVDD algorithm, a one-class
classification method, to detect outliers in nine text-based emotion and
sentiment analysis datasets. By employing both a small-sized language model
(DistilBERT base model with 66 million parameters) and non-deep learning
machine learning algorithms (decision tree, KNN, Logistic Regression, and LDA)
as the classifier, our findings suggest that the removal of outliers can lead
to enhanced results in most cases. Additionally, as outliers in such datasets
are not necessarily unlearnable, we experienced utilizing a large language
model – DeBERTa v3 large with 131 million parameters, which can capture very
complex patterns in data. We continued to observe performance enhancements
across multiple datasets.

## Introduction

When working on tasks that involve analyzing emotions and sentiments in text,
it is common for different labelers to disagree on the labels. This is because
these tasks are more subjective and context-dependent than other tasks, such
as question answering or reference resolution. For example, consider the task
of emotion classification in Twitter data. Tweets can be about a variety of
topics, including personal experiences, daily life, reactions to global
events, or just random thoughts. Because of this, tweets often combine facts
with emotions, which makes it difficult to determine the primary emotion being
expressed. As a result, different labelers may disagree on the label for a
given tweet. This ambiguity and inconsistency can make it difficult to build
accurate emotion analysis models.

Figure 1: The Overview of the Application of Deep SVDD (Ruff et al. 2018) in
CIFAR 10

The examples in Table 1 are taken from the mteb/emotion dataset (Saravia et
al. 2018), which involves tweets labeled with emotions using hashtags like
#depressed and #joy. In the possible outlier samples section, we notice that
line 3144, despite discussing facts, is labeled as “love”. Similarly, line
7610, “in a dam lake”, could convey various emotions but is labeled as “fear”.

Normal Sample
---
Index |  Text | Label
14921 |  i start to feel unsure | 4 (“fear”)
8104 |  i do really feel treasured by you too | 2 (“love”)
Possible Outlier Samples
Index |  Text | Label
3144 |  i have been told that these same vendors feel like they might end up supporting much more than just one more platform as Linux has many popular distribution releases these days | 2 (“love”)
7610 |  in a dam lake | 4 (“fear”)
Table 1: Examples of Possible Outliers in Emotion Labeling.

Researchers have taken note of the uncertainty that surrounds labeling
emotion-related data. For instance, the EmotionX dataset, which involves
emotion annotations for lines in the TV show “Friends,” gathered input from
multiple annotators. Within this dataset, inconsistencies in agreement among
annotators were evident, particularly regarding emotions like disgust and
fear. These observations highlight the inherent ambiguity of assigning
discrete emotion labels (Shmueli and Ku 2019). Similarly, another study
(Rashkin et al. 2018) provided annotations for characters’ needs, motives, and
emotions within the ROCStories dataset (Chen, Chen, and Yu 2019). The
agreement levels among labelers were found to be lowest for emotion labels
compared to the other two types of labels.

Inaccuracies and poor data quality can undermine the effectiveness of machine
learning systems, leading to reduced accuracy and reliability. This study aims
to enhance classification outcomes by excluding potentially incorrect or
uncertain training data using a Deep SVDD (Ruff et al. 2018) based approach.
We hypothesize that using filtered datasets could expedite the learning
process and yield improved results because the filtered datasets enable the
machine learning algorithm to grasp the fundamental data features for the
classification task. Outliers typically constitute only a minor fraction of
the training data. Thus, by exclusively training on the inliers, we also
anticipate the potential to boost classification results on the unrefined
validation sets.

Outliers within emotion labels don’t necessarily equate to being incorrect or
impossible to learn from. The presence of inconsistency or seemingly
unconventional labels could merely highlight the intricate nature of language.
Given that simpler machine learning models are more susceptible to outlier
influence, we explored to assess the effectiveness of outlier filtering across
three model types. The first category encompasses non-deep learning machine
learning algorithms like Decision Trees (Loh 2011), K-Nearest Neighbors (KNN)
(Altman 1992), Logistic Regression (Cramer 2002), and Linear Discriminant
Analysis (LDA) (Mika et al. 1999). The second category comprises a small
language model, namely the DistilBERT base with 66 million parameters. The
third category involves a substantial language model, DeBERTa v3 large with
131 million parameters, capable of comprehending highly intricate patterns in
data.

Our study focuses on textual classification tasks, such as toxic comment
identification, counterfactual detection, IMDb reviews, and sentiment
analyses. We picked nine commonly used datasets. The details about these
datasets are presented in Section Data Description.

Our experiments indicate that eliminating outliers generally improves outcomes
for non-deep learning machine learning algorithms and the small language
model. However, with the large language model, performance improvements were
evident in some datasets, while in others, it fared better using the
unfiltered dataset. This outcome is in line with expectations. Our findings
affirm that classifiers trained on the refined data (inliers) exhibit strong
performance even on outlier data. This aligns with our original hypothesis
that the refined datasets encapsulate more characteristic features for
effective data classification, although certain valuable features relevant to
specific data points might be overlooked.

On the other hand, considering computational resource usage, non-deep learning
machine learning algorithms, and the small language model are significantly
more economical to train and deploy. The DistilBERT base model, for instance,
only needs 2G of memory. In contrast, the DeBERTa V3 model we employed demands
12G of memory.

In Summary, the contributions of this work include:

  * •

We pioneered the application of Deep SVDD for data cleaning in textual domains
and modified the Deep SVDD algorithm for this type of task.

  * •

Our experiments demonstrate that Deep SVDD is a versatile data-cleaning
approach, capable of enhancing the performance of most classifiers across a
wide range of scenarios.

## Related Work

### Data Cleaning

Cleaning data and spotting outliers are often performed in machine learning to
boost model performance. Numerous methods have been proposed to tackle dirty
data, including SampleClean (Krishnan et al. 2015), ActiveClean (Krishnan et
al. 2016), HoloClean (Rekatsinas et al. 2017), AlphaClean (Krishnan and Wu
2019), and CPClean (Karlaš et al. 2020).

SampleClean (Krishnan et al. 2015) primarily focuses on aggregate query
estimations on dirty data. For cleaning selected samples, it uses statistical
techniques to yield bounded approximations of query results, particularly for
SQL aggregates such as SUM and AVG. ActiveClean (Krishnan et al. 2016) closely
aligns with our work through its use of iterative data cleaning during model
training. It mainly addresses convex loss models like linear regression and
SVMs, offering convergence and error-bound assurances. HoloClean (Rekatsinas
et al. 2017) offers a comprehensive data cleaning approach, merging signals
like integrity constraints, external dictionaries, and data statistics into a
unified probabilistic model. AlphaClean (Krishnan and Wu 2019) automates and
optimizes data cleaning pipelines, breaking them down into granular repairs.
Lastly, CPClean (Karlaš et al. 2020) delves into the ramifications of dirty
data on machine learning models, introducing “Certain Predictions”
specifically for nearest neighbor classifiers.

While each method discussed contributes valuable insights, our approach
distinguishes itself by focusing on sentiment analysis and highlighting the
effectiveness of targeted outlier detection and removal. Moreover, this step
can operate independently of the classification model, making it compatible
with any data classification pipeline.

Figure 2: Pipeline for Processing Text Input

### Deep Support Vector Data Description (Deep SVDD)

Support Vector Data Description (SVDD) is mainly used for outlier detection
(Tax and Duin 2004). It works by finding a sphere (in the feature space) that
contains most of the data, aiming to encapsulate the majority of the target
(normal) data, while outliers lie outside of this sphere. The primary
objective of SVDD is to identify the smallest hypersphere, characterized by
its center $\mathbf{c}\in\mathcal{F}_{k}$ and radius $R>0$, which encompasses
the majority of the data within the feature space $\mathcal{F}_{k}$. This is
mathematically formulated as follows:

$\displaystyle\min_{R,\mathbf{c},\xi}$ $\displaystyle\quad
R^{2}+\frac{1}{vn}\sum_{i}\xi_{i}$ (1) s.t.
$\displaystyle\quad||\phi_{k}(\mathbf{x}_{i})-\mathbf{c}||^{2}_{\mathcal{F}_{k}}\leq
R^{2}+\xi_{i},$ $\displaystyle\quad\xi_{i}\geq 0,\forall i$

In this formulation, the slack variables $\xi_{i}\geq 0$ introduce flexibility
in defining the boundary of the hypersphere. The hyperparameter $v\in(0,1]$
modulates the balance between penalties $\xi_{i}$ and the hypersphere’s
volume. Data points situated outside this hypersphere, specifically where
$||\phi_{k}(\mathbf{x}_{i})-\mathbf{c}||^{2}>R^{2}$, are classified as
outliers.

Deep SVDD augments the SVDD approach by jointly training a neural network to
project the input data into a minimum-volume hypersphere in the output space
(Ruff et al. 2018). Figure 1 shows an example of using deep SVDD to identify
outliers in CIFAR10 (Krizhevsky, Hinton et al. 2009).

The core proposition of Deep SVDD is the synergy of data representation
learning with the one-class classification goal, achieved through a neural
network trained to project data into a compact hypersphere. Given the premise
that a significant portion of training data $D_{n}$ is not an outlier, Deep
SVDD aims to optimize the One-Class Deep SVDD objective:

$\displaystyle\min_{\mathcal{W}}$
$\displaystyle\quad\frac{1}{n}\sum^{n}_{i=1}||\phi(\mathbf{x}_{i};\mathcal{W})-\mathbf{c}||^{2}+\frac{\lambda}{2}\sum^{L}_{\ell=1}||\mathbf{W}^{\ell}||^{2}_{F}$
(2)

To formalize the methodology, consider an input space
$\mathcal{X}\subseteq\mathbb{R}^{d}$ and an associated output space
$\mathcal{F}\subseteq\mathbb{R}^{p}$. Let
$\phi(\cdot;\mathcal{W}):\mathcal{X}\xrightarrow{}\mathcal{F}$ represent a
neural network, encapsulating $L\in\mathbb{N}$ hidden layers. The weight set
$\mathcal{W}=\\{\mathbf{W}^{1},\dots,\mathbf{W}^{L}\\}$ characterizes the
network, with $\mathbf{W}^{L}$ being the weights for layer
$\ell\in\\{1,\dots,L\\}$. Consequently,
$\phi(\mathbf{x};\mathcal{W})\in\mathcal{F}$ describes the feature
representation of $\mathbf{x}\in\mathcal{X}$, derived from network $\phi$ with
parameter $W$, and therefore can map normal examples fall within, whereas
mappings of outliers fall outside the hypersphere.

The One-Class Deep SVDD adopts a quadratic loss to penalize deviations in
network representations, specifically, the distance between each
representation $\phi(\mathbf{x};\mathcal{W})$ and the center $c$ in the
feature space $\mathcal{F}$. An additional network weight decay regularizer is
incorporated, parameterized by $\lambda>0$. Conceptually, the objective of
One-Class Deep SVDD can be visualized as determining a hypersphere in the
feature space with a minimal volume, centered at $c$. This optimization aims
to contract the hypersphere by minimizing the average distance of all data
representations from its center. The underlying rationale is to guide the
neural network to discern and capture the predominant patterns or factors in
the data. By penalizing deviations in the average distance of all data points
and not merely outliers, the methodology aligns with the premise that the
preponderance of training data pertains to a singular class.

## Adapting Deep SVDD for Identifying Outliers in Textual Data

### Modifications

In our proposed pipeline, illustrated in Figure 2, we introduced several
modifications to adapt the original Deep SVDD for multi-class textual
datasets. First, since Deep SVDD was initially designed for single-class data,
we partitioned the multi-class data into distinct groups based on their
labels. Each group, representing a specific class, underwent the Deep SVDD
process independently to identify outliers. This approach preserves the unique
characteristics of each class in subsequent processes.

Additionally, Deep SVDD was initially optimized for image-related tasks,
primarily operating with image inputs and features extracted from CNN-based
networks like LeNet (LeCun et al. 1998) and ResNet (He et al. 2015). When
adapting this algorithm for text inputs, we transformed the textual data into
embeddings. For this purpose, we utilized the sentence transformers model
(Reimers and Gurevych 2019) ‘all-MiniLM-L6-v2’ from the HuggingFace
Transformer library. To further enhance feature extraction from the text, we
incorporated a Long Short-Term Memory (LSTM) layer (Graves and Graves 2012)
after the embedding layer.

Finally, we constructed an outlier score. The main goal of Deep SVDD is two-
fold: refining the network parameters $W$ iteratively and simultaneously
minimizing the volume of a hypersphere in the output space $\mathcal{F}$. This
hypersphere, defined by radius $R>0$ and center $\mathbf{c}\in\mathcal{F}$,
encompasses the data and serves as an anchor for detecting outliers in
subsequent applications.”

The outlier detection capability is quantified using an outlierness score,
$s(x)$, for each data point $x\in\mathcal{X}$. Defined by the distance of the
point to the hypersphere’s center, the score is given as:

$\displaystyle s_{norm}(x)$ $\displaystyle=\frac{s(x)-min(S)}{max(S)-min(S)}$
(3) $\displaystyle s.t.\quad s(x)$ $\displaystyle=||\phi(x;W^{*})-c||^{2}$
$\displaystyle S$ $\displaystyle=\\{s(x_{i})|x_{i}\in\mathcal{X}\\}$

The value of the outlierness score is in the range of 0 to 1. A value being 1
means the data point is likely to be an outlier, while a value closer to 0
indicates that the data point aligns well with the main data distribution and
is less likely to be an outlier. This score, generated by DeepSVDD, serves as
a metric for determining the “anomaliness” of each data point within the
dataset.

### Steps for Training Deep SVDD

Algorithm 1 Training and Inferencing with DeepSVDD

1:Datasets $\mathcal{X}$ with $n$ entries and $i$ classes

2:normal_class $\in\\{0,\dots,i\\}$

3:# Step 1. Transform textual data to sentence embedding

4:for $(x_{j},y_{j})\in X$ do

5: $x_{j}$ = SentenceEmbedding($x_{j}$) $\triangleright$ s.t.
$x_{j}\in\mathbb{R}^{384}$

6: $y_{j}$ = [$y_{j}=k$]

7:end for

8:

9:# Step 3. Initialization & Pretraining

10:$\mathcal{R}=0$

11:$\mathbf{c}=null$

12:$net=\phi(\cdot;\mathcal{W})$

13:DeepSVDD = DeepSVDD($\mathcal{R},\mathbf{c},net$)

14:$\phi$ = BuildDecoder($\phi$)

15:$\phi$.pretrain($\mathcal{X}$) $\triangleright$
$\ell=mean(\phi(x_{batch};\mathcal{W})$ \- $x_{batch})^{2}$

16:

17:# Step 4. Train SVDD

18:DeepSVDD.$\phi$ = LoadEncoder($\phi$)

19:DeepSVDD.train($\mathcal{X}$) $\triangleright$ update
$\mathcal{R},\mathbf{c},net$

20:

21:# Step 5. Inference: calculate the outlierness score

22:for each entry $x_{j}$ in $X$ do

23: $S[j]=s(x_{j})=||\phi(x;W^{*})-c||^{2}$

24:end for

25:for each entry $x_{j}$ in $X$ do

26: $s_{norm}(x_{j})$ = $\frac{s(x_{j})-\min(S)}{\max(S)-\min(S)}$

27:end for

The steps for identifying outliers are outlined in Algorithm 1. To facilitate
the training process and ensure that the network converges efficiently,
following (Ruff et al. 2018), we introduce a pretraining phase using an
autoencoder. This autoencoder consists of two main parts: an encoder and a
decoder. The encoder’s role is to convert input text into a compact, fixed-
size representation. In contrast, the decoder aims to reconstruct the initial
input using this condensed representation.

Once the autoencoder completes its training phase, we transfer the weights
from the encoder to initialize the Deep SVDD network. This step ensures that
the Deep SVDD model inherits the feature-detection capabilities and
representations learned during the autoencoder phase, providing a robust
foundation. Then in step 4, the Deep SVDD model is trained as in (Ruff et al.
2018). Finally, in step 5, we can use the trained model to infer an
outlierness score for each data point.

## Experimental Setup

### Model and Training Configuration

We conducted an exploration to evaluate the effectiveness of outlier filtering
across three different model types. The first category encompasses non-deep
learning machine learning algorithms, such as Decision Tree (Loh 2011),
K-Nearest Neighbors (KNN) (Altman 1992), Logistic Regression (Cramer 2002),
and Linear Discriminant Analysis (LDA) (Mika et al. 1999). The second category
involves a smaller language model, specifically the DistilBERT base with 66
million parameters. The third category includes a more substantial language
model, DeBERTa v3 large with 131 million parameters. For the small and large
language models, we utilized two transformer models from the HuggingFace
library: ‘distilbert-base-uncased’ (Sanh et al. 2020) and
‘microsoft/deberta-v3-large’ (He et al. 2021), respectively.

In terms of dataset splits, all datasets adhere to their default split
configurations. In cases where datasets lack predefined train/validation/test
splits, a consistent strategy is employed: 10% of the data is set aside for
testing, while the remaining 90% is allocated for training.

Figure 3: Evaluation Result on distilbert-base-uncased Figure 4: Evaluation
results on deberta-v3-large

### Data Description

To empirically evaluate our approach, we utilized a diverse set of sentiment
analysis datasets, each with distinct emphases on various domains and levels
of granularity. These datasets encompass sentiments across a myriad of
contexts, spanning from product reviews on renowned platforms such as Amazon
and Yelp to nuanced emotions embedded within textual content.

Amazon Counterfactual Classification: The dataset (O’Neill et al. 2021) aims
to classify statements as counterfactual or not, which are hypothetical
scenarios contrary to reality. It contains 3,253 instances in the _not-
counterfactual_ class and 765 instances in the _counterfactual_ class. The
dataset’s imbalance, with fewer counterfactual instances, can pose challenges
for building robust models.

IMDb Classification: The imdb dataset (Maas et al. 2011) is a balanced
resource for sentiment analysis, including 12,500 _negative_ and 12,500
_positive_ movie reviews. Originating from IMDb, this dataset covers diverse
opinions on various films, genres, and cinematic aspects, making it a
benchmark for sentiment analysis models.

Toxic Conversations Classification: The dataset (cjadams et al. 2017) targets
the identification of toxic comments, crucial for maintaining healthy online
interactions. It consists of 46,035 _non-toxic_ entries and 3,965 _toxic_
entries. The dataset’s imbalanced nature mirrors real-world scenarios,
presenting challenges in detecting harmful content while minimizing false
alarms.

Dataset | Threshold | Decision Tree | KNN | Logistic Regression | LDA
---|---|---|---|---|---
Amazon Counterfactual Classification | 0.2 | 84.925% | 86.418% | 82.537% | 77.015%
0.4 | 89.104% | 86.866% | 87.612% | 68.955%
0.6 | 90.597% | 85.821% | 89.552% | 64.776%
0.8 | 90.000% | 85.970% | 90.299% | 63.731%
1.0 | 89.552% | 84.925% | 90.299% | 63.284%
IMDb Classification | 0.2 | 70.648% | 66.096% | 88.288% | 51.752%
0.4 | 70.632% | 66.184% | 88.284% | 51.708%
0.6 | 70.280% | 66.148% | 88.304% | 51.700%
0.8 | 70.464% | 66.140% | 88.312% | 51.692%
1.0 | 70.292% | 66.152% | 88.316% | 51.687%
Toxic Conversation Classification | 0.2 | 92.458% | 92.108% | 92.574% | 54.516%
0.4 | 91.996% | 92.142% | 93.160% | 54.502%
0.6 | 91.964% | 92.148% | 93.268% | 54.485%
0.8 | 91.896% | 92.148% | 93.284% | 54.493%
1.0 | 91.924% | 92.148% | 93.274% | 54.478%
Emotion Classification | 0.2 | 60.700% | 51.550% | 57.350% | 46.050%
0.4 | 60.800% | 54.050% | 60.600% | 50.000%
0.6 | 59.450% | 54.300% | 61.050% | 51.350%
0.8 | 60.000% | 54.050% | 61.050% | 50.950%
1.0 | 59.050% | 54.200% | 61.050% | 51.000%
Hate Speech18 | 0.2 | 85.479% | 87.763% | 88.584% | 73.973%
0.4 | 85.479% | 87.763% | 88.678% | 75.251%
0.6 | 85.297% | 87.763% | 88.584% | 75.799%
0.8 | 85.571% | 87.763% | 88.584% | 74.886%
1.0 | 86.027% | 87.763% | 88.584% | 75.068%
Table 2: Weighted Accuracy Evaluation using Non-Deep Learning Models

Dataset | Threshold | Data Coverage (%) | distilbert-base-uncased
---|---|---|---
|  |  | Inlier | Outlier | Weighted
Amazon Counterfactual Classification | 0.6 | 65.620% | 94.805% | 89.313% | 94.627%
1.0 | 100% | 94.434% | 92.366% | 94.328%
Hate Speech18 | 0.4 | 95.235% | 92.680% | 73.600% | 90.502%
1.0 | 100% | 92.371% | 74.400% | 90.319%

Dataset | Threshold | Data Coverage (%) | deberta-v3-large
---|---|---|---
|  |  | Inlier | Outlier | Weighted
Amazon Counterfactual | 0.6 | 94.027% | 96.805% | 89.312% | 94.925%
1.0 | 100% | 94.804% | 90.840% | 94.179%
Hate Speech18 | 0.4 | 95.235% | 91.649% | 89.600% | 91.416%
1.0 | 100% |  91.959 % | 90.400% | 91.780%

Table 3: Accuracy Evaluation using Deep Learning Models

Tweet Sentiment Extraction: The tweet-sentiment-extraction dataset (Maggie
2020) showcases sentiment distribution in tweets with three classes:
_negative_ (7,781 entries), _neutral_ (11,118 entries), and _positive_ (8,582
entries).

Emotion Classification: The emotion dataset (Saravia et al. 2018) contains
text labeled with six emotions: _joy_ (5,362), _sadness_ (4,666), _anger_
(2,159), _fear_ (1,937), _love_ (1,304), and _surprise_ (572), offering a
nuanced sentiment classification task.

C4 Sentiment Analysis: Derived from C4 (Raffel et al. 2020), this dataset
includes 250k entries with sentiments: _positive_ (52,906), _negative_
(13,527), and _neutral_ (187,673). Annotated by GPT3.5, it challenges models
with machine-generated sentiment annotations.

Yelp Polarity: The yelp_polarity dataset (Zhang, Zhao, and LeCun 2015)
simplifies Yelp reviews into _positive_ and _negative_ sentiments (both
280,000), serving as a strong foundation for binary sentiment classification
models across diverse domains.

SST2: From Stanford Sentiment Treebank (Socher et al. 2013), the sst2 dataset
includes _1_ (37,569) and _0_ (29,780) sentiment classes, spanning movie
reviews with varying levels of sentiment expression.

Hate Speech18: The hate_speech18 dataset (de Gibert et al. 2018) categorizes
content into _noHate_ (8,551), _hate_ (1,079), _relation_ (153), and
_idk/skip_ (66) classes, facilitating analysis of diverse online behaviors.

## Results and Discussion

Figure 5: Comparison of inlier and outlier accuracies over epochs

Central to our experimental design is the concept of the outlier removal
threshold. This threshold operates on the outlier scores produced by Deep
SVDD, which range from 0 to 1. By setting a specific threshold, we filter out
data entries with outlier scores exceeding that threshold. For instance, a
strict threshold of 0.2 implies rigorous filtering, allowing only data with
scores up to 0.2 to be retained. Conversely, a threshold of 1 is the most
lenient, signifying no data removal since all scores fall within the 0 to 1
range. Through our experiments, we explored a variety of thresholds to discern
the optimal balance between rigorous filtering and information retention.

### DistilBERT Base

Figure 3 depicts the evaluation performance of the small language model,
DistilBERT base, across different thresholds. For all these experiments, the
model was trained using the filtered data, and tested at the unfiltered
validation data. Each plot corresponds to results for a dataset, with the red
dashed line denoting the baseline accuracy at threshold=1. The red star symbol
on each plot signifies the best performance across thresholds. The consistent
observation is that the 0.6-0.8 threshold range often yields balanced
performance. Extremely low thresholds like 0.2 tend to remove crucial data,
potentially leading to information loss. Conversely, thresholds close to 1
allow potential outliers to infiltrate the training data.

To further study how the outlier filtering process affects learning outcomes,
we created Figure 5 which presents a comparative analysis of inliers and
outliers within the “Amazon Counterfactual Classification” dataset evaluated
by the DistilBERT base model. The distinct trajectories of inliers and
outliers shed light on the efficacy of our data-cleaning methodology. Outliers
consistently underperformed, with longer convergence timelines, regardless of
whether the training data was cleaned. Post data cleaning, the performance
disparity between inliers and outliers widened, with inliers registering a
significant uptick in accuracy.

### DeBERTa v3 Large

Figure 4 presents the evaluation results utilizing the DeBERTa v3 large model.
Given resource and computational limitations, we focused on a subset of
datasets for this heavyweight model. An evident trend is the subtle variation
in performance improvements following data cleaning compared to the DistilBERT
base model. This observation suggests that larger models like DeBERTa are
capable of learning complex patterns even from ambiguous data.

Upon closer examination of the results, several intriguing patterns come to
light. In the Amazon Counterfactual dataset, there’s a clear performance boost
when transitioning from a threshold of 0.2 to 0.6. Similarly, the Tweet
Sentiment Extraction and SST2 datasets exhibit analogous trends, where strict
filtering isn’t consistently linked to the worst performance, and the baseline
doesn’t always equate to the best results. Instances arise where the data
cleaning process doesn’t yield anticipated enhancements.

Contrary to our hypothesis, the Emotion dataset experiences a performance dip
at a threshold of 0.4. This could stem from factors like the dataset’s
relative cleanliness or the stringent filtering inadvertently discarding
semantically valuable data points.

Moreover, the Hate Speech18 dataset showcases a consistent performance upswing
as the threshold escalates, indicating that larger models can gain from a
precisely tuned data cleaning procedure. These observations underscore the
intricate interplay between data characteristics, model complexity, and the
efficacy of data cleaning thresholds.

Table 3 furnishes a comprehensive analysis of our data-cleaning approach when
applied to state-of-the-art deep learning models. The DeBERTa v3 large,
emblematic of sophisticated deep learning architectures, exhibits remarkable
resilience. Its performance, particularly in datasets like Amazon
Counterfactual, remains steadfastly close to the baseline. However, a more
granular observation reveals that even such advanced models stand to gain from
judicious data cleaning. In the Hate Speech18 dataset, for instance, the
inliers’ performance under the DeBERTa v3 large model at a threshold of 0.4
(92.680%) slightly outpaces that at threshold 1.0 (92.371%), suggesting our
method’s potential to refine even already optimized datasets.

However, there were instances where the data cleaning process didn’t yield the
expected improvements. The Emotion dataset, for instance, showed a drop in
performance with the threshold set at 0.4, which is a counter-example to our
hypothesis. This could be attributed to various factors: perhaps the dataset
was already relatively clean, or the more rigorous filtering inadvertently
removed some semantically-rich data points.

Another intriguing observation is seen in the Hate Speech18 dataset. Here, the
data cleaning process demonstrated a consistent uptick in performance as the
threshold increased, with the model achieving its peak performance at the
highest threshold. This suggests that in this particular dataset, the larger
models, with their inherent resilience to noise and outliers, are adept at
handling the outliers present. The data filtering process, which reduces the
sample size, appears to be a detriment rather than an advantage in this
context, indicating that the model performs best when trained on the complete
dataset without any exclusions.

### Traditional Machine Learning Models

Table 2 provides a comprehensive analysis of our approach’s effectiveness
across traditional machine learning models. A consistent trend emerges:
Logistic Regression consistently outperforms other models, either matching or
exceeding the baseline across all datasets and thresholds. This suggests
Logistic Regression’s adaptability and resilience to the alterations in data
caused by our cleaning process.

Conversely, Linear Discriminant Analysis (LDA) displays heightened
sensitivity. For instance, in the “Amazon Counterfactual Classification”
dataset, LDA’s performance significantly drops as the threshold increases,
plunging from 77.015% at a threshold of 0.2 to 63.284% at a threshold of 1.
This stark decline underscores LDA’s dependency on the complete data
distribution, which our cleaning procedure might have disrupted.

Interestingly, the “Emotion Classification” dataset demonstrates minimal
fluctuation across models and thresholds, suggesting intrinsic cleanliness or
a scarcity of pronounced outliers. This underscores the importance of adaptive
threshold tuning, emphasizing the need to align with each dataset’s unique
characteristics and distribution.

Across all datasets, our data-cleaning approach consistently ushered in
accuracy improvements. Such performance augmentation affirms the efficacy of
our approach in eliminating noise and refining classifier training. However,
there were instances, albeit rare, where our cleaning regimen either
maintained the accuracy or led to marginal reductions. Such outcomes could be
attributed to the inherent cleanliness of the dataset or the inadvertent
elimination of rare but crucial data points during the cleaning process.

## Future Work

While our work shows exciting potential in cleaning textual data using Deep
SVDD, there are still ways to improve and explore. We are particularly
interested in the following directions:

#### Dynamic Thresholding

Currently, our methodology leverages a static threshold to demarcate outliers
based on the normalized outlierness score. While effective in many scenarios,
a one-size-fits-all threshold might not always capture the nuances of diverse
datasets. A more adaptive approach, such as dynamic thresholding, could
calibrate based on the intrinsic characteristics of the data, considering
factors like its distribution or inherent variability. By allowing the model
to adjust its threshold based on the data it encounters, we can potentially
achieve more precise outlier detection, reducing false positives and
negatives.

#### Incorporation of Attention Mechanisms

Attention mechanisms are extensively used in natural language processing
tasks, allowing models to spotlight important segments of text. Introducing
these mechanisms could be valuable in outlier detection. By assigning weights
to various parts of the text based on their significance, attention mechanisms
might enhance the precision of our detection. This could ensure that even
subtle outliers are identified without being overshadowed by more prevalent
patterns.

#### Multi-modal Outlier Detection

The confluence of textual data with other modalities poses unique challenges
and opportunities. An intriguing research avenue would be to extend the Deep
SVDD framework to handle multi-modal data, examining how outliers manifest in
such composite datasets. This would require a thorough understanding of
feature fusion techniques and the development of novel architectures that can
seamlessly integrate information across modalities.

## Conclusion

Our study was motivated by the pivotal role of data cleanliness in machine
learning, especially within sentiment analysis. We adapted the deep SVDD model
to systematically detect and eliminate outliers from text datasets. Our
findings showcased a consistent accuracy boost for smaller models after
outlier removal, with the optimal threshold falling between 0.6 and 0.8. While
larger models are naturally more robust to outliers, they still glean some
advantages from the cleaning process, albeit to a lesser degree. Essentially,
our research highlights the significant influence of data cleanliness on model
performance, introducing a scalable technique with tangible advantages.

## Acknowledgement

We would like to extend our heartfelt gratitude to Professor Yu Lei for his
invaluable guidance throughout this research. His insights and expertise were
instrumental in the shaping and success of this study. Additionally, we
appreciate the generous computational resources provided by him, which were
crucial during the evaluation phase of our work.

## Appendix

### Deployment Solution

We have seamlessly integrated our outlier detection solution into our own
server, offering it as a streamlined service. Given the model-independence of
our framework, users can, with minimal effort, train and induct Deep SVDD
models by providing dataset information, which encompasses data point content
and optional labeling information. With a single line of code, outlierness
scores for thorough analysis and filtering can be obtained. It’s worth noting
that the total amount of data or the amount of data for a single label should
be at least greater than 500 samples. This is essential to ensure proper
training of DeepSVDD, reliable inference, and to mitigate the risk of
underfitting the model after filtering due to insufficient data. As for
deployment considerations, our solution, while not being computation-
intensive, mandates the use of a dedicated GPU with a minimum of 8 GB of
memory when employing the default LSTM architecture for the neural network
transformation. Batch processing scenarios would ideally require at least 16
GB of RAM. It’s pivotal to ensure that the distribution of the training data
is kept consistent with that of the test data. Any significant disparities
could amplify the false positives in outlier detection. Further, the
sensitivity threshold for detecting outliers, which is set at 0.60 for our
showcase, may require fine-tuning based on specific use cases and the
tolerable false positive rate. Post-deployment, the significance of engaging
in routine retraining of both the sentiment model and the outlier detection
mechanism cannot be overstated, especially to accommodate the shifting
dynamics of customer sentiments and linguistic subtleties. Lastly, embedding a
feedback mechanism for end-users to highlight any perceived inaccuracies in
sentiment predictions not only aids in model refinement but also fosters trust
and transparency between the service and its users.

## Usage Example

To elucidate the practical application of our framework, consider a dataset
represented by data $x$ and labels $y$. The train set is a collection of
indices that delineate the training subset of this data. For context, imagine
$x$ as a series of text reviews, with $y$ being their associated sentiment
labels.

The primary operation involves the autoFilter.filter_data method. This method
computes the outlierness scores and filters the data based on a designated
threshold, yielding a refined set of training indices.

Listing 1: usage examples

⬇

1# Pseudo-code

2function filter_data(train_indices, test_indices, data, labels, threshold):

3 compute outlierness scores for data

4 filter data based on threshold

5 return updated train_indices

6end function

7

8# Actual usage

9train = autoFilter.filter_data(train, test, x, y, threshold=0.6)

In this setup, train is the refreshed set of indices for the training subset.
The threshold parameter, set to 0.6 here, steers the sensitivity for outlier
identification.

To offer additional perspective:

  * •

$x$ could be sequenced like [“The product is good”, “A terrible experience”,
…].

  * •

$y$ might be sentiments such as [Positive, Negative, …].

Post-execution, train encompasses the indices of reviews that align closely
with the dataset’s overarching patterns.

It’s imperative to note that while indices represent data points in this
illustration, our framework accommodates more intricate representations. The
threshold can also be adjusted to cater to application-specific needs. A
loftier value might be lenient, whereas a lower one could be more rigorous in
outlier filtration.

Our chief design ambition is to simplify the interplay between advanced
outlier detection algorithms and raw data. This ensures users can harness
DeepSVDD’s prowess without immersing themselves in its complexities. The
outcome is a meticulously curated training dataset, primed to heighten the
precision and trustworthiness of ensuing sentiment analysis models.

Based on this framework, some potential application would be:

1\. Financial Transaction Review: In the banking and finance sector, ensuring
the accuracy of sentiment analysis on customer feedback is pivotal. By
filtering out potential outliers from the training dataset, our framework can
help in creating more robust models for analyzing customer reviews. For
instance, a bank can accurately gauge customer sentiments regarding a new
digital banking feature, ensuring that the sentiment analysis is not skewed by
non-representative feedback. This refined understanding can then guide product
improvements and enhance customer satisfaction.

2\. Healthcare Patient Feedback Analysis: Hospitals and healthcare providers
continually seek patient feedback to improve services. Given the sensitive
nature of healthcare, it’s crucial to have an accurate sentiment analysis
model. By utilizing our framework, healthcare institutions can filter out
anomalies from patient feedback datasets, ensuring that the sentiment models
are trained on representative data. For example, a hospital can get a clear
sentiment analysis on patient feedback about a new telehealth service,
ensuring that the insights drawn are based on the majority sentiment, free
from potential outliers that might not reflect the broader patient experience.

These applications underscore the versatility and significance of our outlier
detection framework in refining sentiment analysis across diverse sectors.

## Real-world application

The datasets we engaged for evaluation are not just theoretical constructs but
have propelled advancements in multifarious arenas, especially in online
content moderation, sentiment analysis, and counterfactual reasoning.

The Amazon Counterfactual Classification dataset, scrutinized by (Bottou et
al. 2013), has been pivotal for discerning the ramifications of counterfactual
reasoning on model resilience and adaptability. This dataset underpins how
models, when exposed to hypothetical scenarios or alternate outcomes, can be
honed to exhibit enhanced robustness. Such an approach becomes indispensable
in platforms where users frequently broach or debate ”what-if” situations.

On the other hand, the Toxic Conversations Classification dataset has emerged
as a linchpin for fostering healthier digital discourse. With the insights
from (Saveski, Roy, and Roy 2021), it’s evident that this dataset holds the
potential to reshape social media platforms into spaces of constructive
dialogue. By tapping into the intrinsic structure of online conversations,
imminent toxic interactions can be identified and possibly redirected. Its
utility doesn’t stop here. As illustrated by (Kim et al. 2019), platforms like
Quora can harness this dataset to sieve out malignant content. Furthermore,
when the BERT model is trained on this treasure trove of data, it exhibits
prowess in categorizing and dissecting toxic tweets, even those pertaining to
globally resonant events like Brexit, underscoring the dataset’s adaptability
and contemporaneous significance (Fan et al. 2021).

While the SST2 dataset might not have direct applications unearthed in our
search, its provenance from Stanford’s Sentiment Treebank makes it an
indispensable asset for sentiment analysis endeavors. Encompassing a vast
array of movie reviews with diverse sentiment expressions, it provides a
goldmine for delving deep into the audience’s psyche. Such insights could be
game-changers for entities like movie streaming platforms or film critique
portals.

With the deployment of our outlier detection framework on these datasets,
there’s a tangible amplification in the model’s precision, making it even more
adept for its intended applications. By meticulously curating the training
dataset, the models are not only more accurate but also resonate better with
real-world scenarios, ensuring that their deployment is both effective and
meaningful.

## References

  * Altman (1992) Altman, N. S. 1992.  An introduction to kernel and nearest-neighbor nonparametric regression.  _The American Statistician_ , 46(3): 175–185.
  * Bottou et al. (2013) Bottou, L.; Peters, J.; Quiñonero-Candela, J.; Charles, D. X.; Chickering, D. M.; Portugaly, E.; Ray, D.; Simard, P.; and Snelson, E. 2013.  Counterfactual Reasoning and Learning Systems: The Example of Computational Advertising.  _Journal of Machine Learning Research_ , 14(11).
  * Chen, Chen, and Yu (2019) Chen, J.; Chen, J.; and Yu, Z. 2019.  Incorporating structured commonsense knowledge in story completion.  In _Proceedings of the AAAI Conference on Artificial Intelligence_ , volume 33, 6244–6251.
  * cjadams et al. (2017) cjadams; Sorensen, J.; Elliott, J.; Dixon, L.; McDonald, M.; nithum; and Cukierski, W. 2017.  Toxic Comment Classification Challenge.
  * Cramer (2002) Cramer, J. S. 2002.  The origins of logistic regression.
  * de Gibert et al. (2018) de Gibert, O.; Perez, N.; García-Pablos, A.; and Cuadros, M. 2018.  Hate Speech Dataset from a White Supremacy Forum.  In _Proceedings of the 2nd Workshop on Abusive Language Online (ALW2)_ , 11–20. Brussels, Belgium: Association for Computational Linguistics.
  * Fan et al. (2021) Fan, H.; Du, W.; Dahou, A.; Ewees, A. A.; Yousri, D.; Elaziz, M. A.; Elsheikh, A. H.; Abualigah, L.; and Al-qaness, M. A. 2021.  Social media toxicity classification using deep learning: real-world application UK Brexit.  _Electronics_ , 10(11): 1332.
  * Graves and Graves (2012) Graves, A.; and Graves, A. 2012.  Long short-term memory.  _Supervised sequence labelling with recurrent neural networks_ , 37–45.
  * He et al. (2015) He, K.; Zhang, X.; Ren, S.; and Sun, J. 2015.  Deep Residual Learning for Image Recognition.  arXiv:1512.03385.
  * He et al. (2021) He, P.; Liu, X.; Gao, J.; and Chen, W. 2021.  DeBERTa: Decoding-enhanced BERT with Disentangled Attention.  arXiv:2006.03654.
  * Karlaš et al. (2020) Karlaš, B.; Li, P.; Wu, R.; Gürel, N. M.; Chu, X.; Wu, W.; and Zhang, C. 2020\.  Nearest Neighbor Classifiers over Incomplete Information: From Certain Answers to Certain Predictions.  arXiv:2005.05117.
  * Kim et al. (2019) Kim, D. Y.; Li, X.; Wang, S.; Zhuo, Y.; and Lee, R. K.-W. 2019.  Topic enhanced word embedding for toxic content detection in Q&A sites.  In _Proceedings of the 2019 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining_ , 1064–1071.
  * Krishnan et al. (2015) Krishnan, S.; Wang, J.; Franklin, M. J.; Goldberg, K.; Kraska, T.; Milo, T.; and Wu, E. 2015.  SampleClean: Fast and Reliable Analytics on Dirty Data.  _IEEE Data Eng. Bull._ , 38(3): 59–75.
  * Krishnan et al. (2016) Krishnan, S.; Wang, J.; Wu, E.; Franklin, M. J.; and Goldberg, K. 2016.  ActiveClean: Interactive Data Cleaning While Learning Convex Loss Models.  arXiv:1601.03797.
  * Krishnan and Wu (2019) Krishnan, S.; and Wu, E. 2019.  AlphaClean: Automatic Generation of Data Cleaning Pipelines.  arXiv:1904.11827.
  * Krizhevsky, Hinton et al. (2009) Krizhevsky, A.; Hinton, G.; et al. 2009.  Learning multiple layers of features from tiny images.
  * LeCun et al. (1998) LeCun, Y.; Bottou, L.; Bengio, Y.; and Haffner, P. 1998.  Gradient-based learning applied to document recognition.  _Proceedings of the IEEE_ , 86(11): 2278–2324.
  * Loh (2011) Loh, W.-Y. 2011.  Classification and regression trees.  _Wiley interdisciplinary reviews: data mining and knowledge discovery_ , 1(1): 14–23.
  * Maas et al. (2011) Maas, A. L.; Daly, R. E.; Pham, P. T.; Huang, D.; Ng, A. Y.; and Potts, C. 2011\.  Learning Word Vectors for Sentiment Analysis.  In _Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies_ , 142–150. Portland, Oregon, USA: Association for Computational Linguistics.
  * Maggie (2020) Maggie, W. C., Phil Culliton. 2020.  Tweet Sentiment Extraction.
  * Mika et al. (1999) Mika, S.; Ratsch, G.; Weston, J.; Scholkopf, B.; and Mullers, K.-R. 1999.  Fisher discriminant analysis with kernels.  In _Neural networks for signal processing IX: Proceedings of the 1999 IEEE signal processing society workshop (cat. no. 98th8468)_ , 41–48. Ieee.
  * O’Neill et al. (2021) O’Neill, J.; Rozenshtein, P.; Kiryo, R.; Kubota, M.; and Bollegala, D. 2021.  I Wish I Would Have Loved This One, But I Didn’t – A Multilingual Dataset for Counterfactual Detection in Product Reviews.  arXiv:2104.06893.
  * Raffel et al. (2020) Raffel, C.; Shazeer, N.; Roberts, A.; Lee, K.; Narang, S.; Matena, M.; Zhou, Y.; Li, W.; and Liu, P. J. 2020.  Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer.  arXiv:1910.10683.
  * Rashkin et al. (2018) Rashkin, H.; Bosselut, A.; Sap, M.; Knight, K.; and Choi, Y. 2018.  Modeling naive psychology of characters in simple commonsense stories.  _arXiv preprint arXiv:1805.06533_.
  * Reimers and Gurevych (2019) Reimers, N.; and Gurevych, I. 2019.  Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks.  arXiv:1908.10084.
  * Rekatsinas et al. (2017) Rekatsinas, T.; Chu, X.; Ilyas, I. F.; and Ré, C. 2017.  HoloClean: Holistic Data Repairs with Probabilistic Inference.  arXiv:1702.00820.
  * Ruff et al. (2018) Ruff, L.; Vandermeulen, R.; Goernitz, N.; Deecke, L.; Siddiqui, S. A.; Binder, A.; Müller, E.; and Kloft, M. 2018.  Deep one-class classification.  In _International conference on machine learning_ , 4393–4402. PMLR.
  * Sanh et al. (2020) Sanh, V.; Debut, L.; Chaumond, J.; and Wolf, T. 2020.  DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter.  arXiv:1910.01108.
  * Saravia et al. (2018) Saravia, E.; Liu, H.-C. T.; Huang, Y.-H.; Wu, J.; and Chen, Y.-S. 2018.  CARER: Contextualized Affect Representations for Emotion Recognition.  In _Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing_ , 3687–3697. Brussels, Belgium: Association for Computational Linguistics.
  * Saveski, Roy, and Roy (2021) Saveski, M.; Roy, B.; and Roy, D. 2021.  The structure of toxic conversations on Twitter.  In _Proceedings of the Web Conference 2021_ , 1086–1097.
  * Shmueli and Ku (2019) Shmueli, B.; and Ku, L.-W. 2019.  Socialnlp emotionx 2019 challenge overview: Predicting emotions in spoken dialogues and chats.  _arXiv preprint arXiv:1909.07734_.
  * Socher et al. (2013) Socher, R.; Perelygin, A.; Wu, J.; Chuang, J.; Manning, C. D.; Ng, A.; and Potts, C. 2013.  Recursive Deep Models for Semantic Compositionality Over a Sentiment Treebank.  In _Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing_ , 1631–1642. Seattle, Washington, USA: Association for Computational Linguistics.
  * Tax and Duin (2004) Tax, D. M.; and Duin, R. P. 2004.  Support vector data description.  _Machine learning_ , 54: 45–66.
  * Zhang, Zhao, and LeCun (2015) Zhang, X.; Zhao, J.; and LeCun, Y. 2015.  Character-Level Convolutional Networks for Text Classification.  _arXiv:1509.01626 [cs]_.