# Contrastive Attention for Automatic Chest X-ray Report Generation

Fenglin Liu1, Changchang Yin3, Xian Wu4, Shen Ge4, Yuexian Zou1,5, Ping Zhang3
and Xu Sun2
1ADSPLAB, School of ECE, Peking University
2MOE Key Laboratory of Computational Linguistics, School of EECS, Peking
University
3The Ohio State University 4Tencent Medical AI Lab, Beijing, China
5Peng Cheng Laboratory, Shenzhen, China
<EMAIL_ADDRESS>{yin.731<EMAIL_ADDRESS>
{kevinxwu<EMAIL_ADDRESS>{zouyx<EMAIL_ADDRESS>

###### Abstract

Recently, chest X-ray report generation, which aims to automatically generate
descriptions of given chest X-ray images, has received growing research
interests. The key challenge of chest X-ray report generation is to accurately
capture and describe the abnormal regions. In most cases, the normal regions
dominate the entire chest X-ray image, and the corresponding descriptions of
these normal regions dominate the final report. Due to such data bias,
learning-based models may fail to attend to abnormal regions. In this work, to
effectively capture and describe abnormal regions, we propose the Contrastive
Attention (CA) model. Instead of solely focusing on the current input image,
the CA model compares the current input image with normal images to distill
the contrastive information. The acquired contrastive information can better
represent the visual features of abnormal regions. According to the
experiments on the public IU-X-ray and MIMIC-CXR datasets, incorporating our
CA into several existing models can boost their performance across most
metrics. In addition, according to the analysis, the CA model can help
existing models better attend to the abnormal regions and provide more
accurate descriptions which are crucial for an interpretable diagnosis.
Specifically, we achieve the state-of-the-art results on the two public
datasets.

Figure 1: By contrasting current input images and known normal images, it
could be easier to capture the suspicious abnormal regions (Red bounding
boxes). The images with Green boxes are normal.

##  1 Introduction

A medical report is a paragraph containing multiple sentences that describe
both the normal and abnormal regions in the chest X-ray image. Chest X-ray
images and their corresponding reports are widely used in clinical diagnosis
Delrue et al. (2011). However, writing medical reports requires particular
domain knowledge Goergen et al. (2013), and only experienced radiologists can
accurately interpret chest X-ray images and note down corresponding findings
in a coherent manner. An automatic chest X-ray report generation system Jing
et al. (2018, 2019); Liu et al. (2021, 2019b) can reduce the workload of
radiologists and are in urgent need Brady et al. (2012); Delrue et al. (2011).

In recent years, several deep learning-based methods have been proposed Jing
et al. (2018, 2019); Li et al. (2018, 2019); Chen et al. (2020c); Liu et al.
(2021) for automatic chest X-ray report generation; however, there are serious
data deviation problems in the medical report corpus. For example, 1) the
normal images dominate the dataset over the abnormal ones Shin et al. (2016);
2) given an input image, the normal regions usually dominate the image and
their descriptions dominate the medical report Jing et al. (2019); Liu et al.
(2021). Such data deviation may prevent learning-based methods from capturing
the rare but important abnormal regions (e.g., lesion regions). As a result,
the learning-based model tends to generate plausible general reports with no
prominent abnormal narratives Jing et al. (2019); Li et al. (2018); Yuan et
al. (2019). In clinical practice, accurate detection and depiction of
abnormalities are more helpful in disease diagnosing and treatment planning.
Therefore, existing learning-based methods may fail to assist radiologists in
clinical decision-making Goergen et al. (2013).

To capture the abnormal regions from a chest X-ray image, a natural intuition
is to compare it with normal images and identify the differences. As Figure 1
shows, given known normal images, it cloud be easier for models to learn and
identify the suspicious abnormal regions (Red bounding boxes). Therefore, we
propose the Contrastive Attention (CA) model (see Figure 2), which is based on
the attention mechanism Bahdanau et al. (2015a); Vaswani et al. (2017). The CA
model can be easily integrated into existing learning-based methods and enable
them to better capture and describe the abnormalities. We build the CA model
in the following three steps: 1) we first build a set of normal images which
are all extracted from the training dataset; 2) we introduce the Aggregate
Attention to prioritize normal images that are closer to the current input
image, and filter out normal images that appear differently; 3) and we further
introduce the Differentiate Attention to distill the common features between
the input image and the refined normal images. Then, the acquired common
features are subtracted from the visual features of the input image. In this
manner, the residual visual features of the input image are treated as the
contrastive information that captures the differentiating properties between
input image and normal images.

We evaluate our approach on two datasets, including a widely-used benchmark
IU-X-ray dataset Demner-Fushman et al. (2016) and a recently released large-
scale MIMIC-CXR dataset Johnson et al. (2019). On both automatic metrics and
human evaluations, existing methods equipped with the proposed Contrastive
Attention model outperform baselines, which proves our argument and
demonstrates the effectiveness of our approach.

Overall, the main contributions of our work are:

  * •

We propose the Contrastive Attention model to capture and depict the
abnormalities by comparing the input image with known normal images. The
proposed approach can be easily incorporated into existing models to improve
their performance.

  * •

We evaluate our approach on two public datasets. After equipping our
Contrastive Attention model, the baselines achieve up to 14% gain and 17% gain
in BLEU-4 on the MIMIC-CXR and IU-X-ray datasets, respectively.

  * •

More encouragingly, we achieve the state-of-the-art performance on the two
public datasets, i.e., IU-X-ray and MIMIC-CXR. Moreover, we invite
professional clinicians to conduct human evaluation to measure the
effectiveness in terms of its usefulness for clinical practice.

##  2 Related Works

In this section, we will describe the related works in three categories: 1)
Image Captioning; 2) Chest X-ray Report Generation and 3) Contrastive
Learning.

#### Image Captioning

Image captioning aims to understand the given images and generate
corresponding descriptive sentences Chen et al. (2015). The task combines
image understanding and language generation. In recent years, a large number
of encoder-decoder based neural systems have been proposed for image
captioning Cornia et al. (2020); Pan et al. (2020); Pei et al. (2019);
Venugopalan et al. (2015); Vinyals et al. (2015); Xu et al. (2015); Rennie et
al. (2017); Lu et al. (2017); Anderson et al. (2018); Liu et al. (2018,
2019a). However, the sentence generated by image captioning is usually short
and describes the most prominent visual contents, which cannot fully represent
the rich feature information of the image. Recently, visual paragraph
generation Krause et al. (2017), which aims to generate long and coherent
reports or stories to describe visual contents, has recently attracted
increasing research interests. However, due to the data bias in the medical
domain, the widely-used hierarchical LSTM in the visual paragraph generation
does not perform very well in automatic chest X-ray report generation and is
tend to produce normal reports Xue et al. (2018); Li et al. (2018); Jing et
al. (2019); Yin et al. (2019).

#### Chest X-ray Report Generation

Inspired by the success of deep learning models on image captioning, a lot of
encoder-decoder based frameworks have been proposed Jing et al. (2018, 2019);
Liu et al. (2021, 2019b); Yuan et al. (2019); Xue et al. (2018); Li et al.
(2018, 2019, 2020); Zhang et al. (2020a); Kurisinkel et al. (2021); Ni et al.
(2020); Nishino et al. (2020); Chen et al. (2020c); Wang et al. (2021); Boag
et al. (2019); Syeda-Mahmood et al. (2020); Yang et al. (2020); Lovelace and
Mortazavi (2020); Zhang et al. (2020b); Miura et al. (2021). Specifically,
Jing et al. (2018) proposed a hierarchical LSTM with the attention mechanism
Bahdanau et al. (2015b); Xu et al. (2015); You et al. (2016). Yuan et al.
(2019) further incorporated the medical concept to enrich the decoder with
descriptive semantics. Xue et al. (2018) proposed a multimodal recurrent model
containing an iterative decoder with visual attention to improve the coherence
between sentences. Miura et al. (2021) proposed an Exact Entity Match Reward
and an Entailing Entity Match Reward to improve the factual completeness and
consistency of the generated reports, resulting in significant improvements on
clinical accuracy. Jing et al. (2019); Li et al. (2018); Liu et al. (2019b)
and Zhang et al. (2020a); Li et al. (2019); Liu et al. (2021) introduced the
reinforcement learning and medical knowledge graph for chest X-ray report
generation, respectively. However, some errors occur in the generated reports
of the existing methods, like duplicate reports, inexact descriptions, etc Xue
et al. (2018); Yuan et al. (2019); Yin et al. (2019).

#### Contrastive Learning

The most related work to our contrastive attention mechanism is in the field
of contrastive learning Chen et al. (2020a); He et al. (2020); Hénaff et al.
(2020); Grill et al. (2020); Chen et al. (2020b); Radford et al. (2021); Jia
et al. (2021), which learns similar/dissimilar image representations from data
that are organized into similar/dissimilar image pairs. In image captioning,
Dai and Lin (2017) introduced the contrastive learning to extract the
contrastive information from additional images into the captioning models to
improve the distinctiveness of the generated captions. Moreover, Song et al.
(2018) and Duan et al. (2019) proposed the contrastive attention mechanism for
person re-identification and summarization, respectively. Song et al. (2018)
utilized a pre-provided person and background segmentation to learn features
contrastively from the body and background regions, resulting they can be
easily discriminated. Duan et al. (2019) contrastively attended to relevant
parts and irrelevant parts of source sentence for abstractive sentence
summarization. In this work, we leverage the contrastive information between
the input image and the normal images to help models efficiently capture and
describe the abnormalities for automatic chest X-ray report generation.

Figure 2: Illustration of our proposed Contrastive Attention, which consists
of the Aggregate Attention and Differentiate Attention. In particular, the
Aggregate Attention devotes to finding the normal images that are closest to
the current input image in the normality pool. The Differentiate Attention
devotes to summarizing the common information between the input image and the
closest normal images and subtract it from the input image to capture the
differentiating properties between the input image and the normal images.

##  3 Approach

In Section 3.1, we formulate the automatic chest X-ray report generation
problems; In Section 3.2, we introduce the Contrastive Attention in detail.

###  3.1 Problem Formulation

Given a chest X-ray image $I$, the goal of automatic chest X-ray report
generation is to generate a coherent report $R$ that addresses findings of
$I$. Most existing methods Jing et al. (2018) adopt the encoder-decoder
frameworks, which normally include an image encoder He et al. (2016) and a
report decoder Krause et al. (2017). The encoder-decoder framework can be
formulated as:

$\text{Image Encoder}:I\to V;\quad\text{Report Decoder}:V\to R.$ (1)

The image encoder, e.g., ResNet He et al. (2016), aims to generate the visual
features $V\in\mathbb{R}^{{N_{\text{I}}}\times d}$. The report decoder, e.g.,
Hierarchical LSTM Krause et al. (2017), is used to generate the report $R$
from $V$. Specifically, in the Hierarchical LSTM, a paragraph-level LSTM first
generates topic vectors to represent the sentences, then a sentence-level LSTM
takes each topic vector as input to generate the corresponding sentence. As a
result, the Hierarchical LSTM can better model a paragraph of multiple
sentences (report) than a single LSTM Jing et al. (2018); Krause et al.
(2017). Given the ground truth medical report provided by the radiologists for
the input chest X-ray image, existing methods train the encoder-decoder
frameworks by minimizing training loss, e.g., cross-entropy loss. Due to
limited space, please refer to Huang et al. (2019); Jing et al. (2018) for
detailed introduction.

In this paper, we adopt the ResNet-50 He et al. (2016) to extract the visual
features, i.e., the output of the last convolutional layer is used as the
visual information:

$V=\text{ResNet}(I)\text{W}^{I},$ (2)

where $I$ denotes the input image, $\text{ResNet}(I)\in\mathbb{R}^{49\times
2048}$ and $\text{W}^{I}\in\mathbb{R}^{2048\times d}$ which reduces the
dimension from 2,048 to $d$111For conciseness, all the bias terms of linear
transformations in this paper are omitted.. Specifically, the $d$ is set to
512, resulting
$V=\\{v_{1},v_{2},\dots,v_{N_{\text{I}}}\\}\in\mathbb{R}^{N_{\text{I}}\times
d}$, where $N_{\text{I}}=49$ and $d=512$. Moreover, we apply the average
pooling to obtain the global visual feature:

$\hat{v}=\text{AveragePooling}(V)=\frac{1}{{N_{\text{I}}}}\sum_{i=1}^{{N_{\text{I}}}}v_{i}.$
(3)

After the above calculations, we obtain the visual feature vectors
$V=\\{v_{1},v_{2},\dots,v_{N_{\text{I}}}\\}\in\mathbb{R}^{N_{\text{I}}\times
d}$ and the global visual feature vector $\hat{v}\in\mathbb{R}^{1\times d}$.

###  3.2 Contrastive Attention

In this paper, we propose the Contrastive Attention to enable the models to
capture the differentiating properties between the input image and normal
images. To this end, we first collect a normality pool
$P=\\{\hat{v}^{\text{Normal}}_{1},\hat{v}^{\text{Normal}}_{2},\dots,\hat{v}^{\text{Normal}}_{N_{\text{P}}}\\}\in\mathbb{R}^{N_{\text{P}}\times
d}$ which consists of $N_{\text{P}}=1,000$ normal images randomly extracted
from the training dataset, where
$\hat{v}^{\text{Normal}}_{i}\in\mathbb{R}^{1\times d}$ denotes the global
visual feature of $i^{\text{th}}$ extracted normal image. Then, as shown in
Figure 2, the proposed Contrastive Attention introduces the Aggregate
Attention and Differentiate Attention which aims to obtain the contrastive
information between the input image $\hat{v}$ and the normality pool $P$.

#### Aggregate Attention

Since the images in the normality pool $P$ are all normal, there is no ranking
order among these images. Therefore it’s natural to treat all normal images
equally in capturing the contrastive information. However, as shown in Figure
3, we note that there are many noisy images in the normality pool (see the
Purple boxes in Figure 3). For example, some normal images have different
orientation information or rotation angles from the input image, we cannot
direct compare these images with the input image. Therefore, these noisy
images will bring noise information, preventing the Contrastive Attention from
capturing accurate abnormal regions efficiently. Motivated by the above
observations, we introduce Aggregate Attention to increase the weights of
normal images that are close to the current input image and lower the weights
of images that are not close to the current input image. As a result, the
contrasting process could be improved. To implement the Aggregate Attention,
we utilize the dot-product attention222Our preliminary experiments show that
using the dot-product attention Vaswani et al. (2017) could achieve better
performance than the additive attention Bahdanau et al. (2015a); Xu et al.
(2015); Lu et al. (2017) and bilinear attention Kim et al. (2018); You et al.
(2016). Vaswani et al. (2017), which is defined as:

$\displaystyle\text{Att}(x,y)$ $\displaystyle=\text{softmax}(M)y$ (4)
$\displaystyle\text{where}\ \ M$
$\displaystyle=\frac{x\text{W}^{x}(y\text{W}^{y})^{T}}{\sqrt{d}},$

where $\text{W}^{x},\text{W}^{y}\in\mathbb{R}^{d\times d}$ are learnable
parameters. Given $x\in\mathbb{R}^{N_{x}\times d}$ and
$y\in\mathbb{R}^{N_{y}\times d}$, the acquired $M$ is then of the shape of
$N_{x}\times N_{y}$, the function $softmax$ is conducted on each row of $M$,
resulting in $\text{Att}(x,y)\in\mathbb{R}^{N_{x}\times d}$. Then we apply Eq.
(4) to $\hat{v}\in\mathbb{R}^{1\times d}$ and
$P\in\mathbb{R}^{N_{\text{P}}\times d}$:

$\displaystyle\hat{v}^{\text{Closest}}$ $\displaystyle=\text{Att}(\hat{v},P).$
(5)

Since the attention mechanism is a function that computes the similarity of
$\hat{v}$ and each $\hat{v}^{\text{Normal}}_{i}$ in $P$, and
$\text{Att}(\hat{v},P)\in\mathbb{R}^{1\times d}$ is the attended vector for
the $\hat{v}$. In this way, we can increase the weights of normal images that
are similar to current image and lower the weights of the ones that are
dissimilar.

Moreover, following Lin et al. (2017), we repeat the Aggregate Attention $n$
times with different learnable attention weights to further promote the
performance of our approach, defined as follows:

$\displaystyle P^{\prime}$ $\displaystyle=\text{Aggregate-
Attention}(\hat{v},P)$ (6)
$\displaystyle=[\text{Att}_{1}(\hat{v},P);\text{Att}_{2}(\hat{v},P);\dots;\text{Att}_{n}(\hat{v},P)]$
$\displaystyle=\\{\hat{v}^{\text{Closest}}_{1},\hat{v}^{\text{Closest}}_{2},\dots,\hat{v}^{\text{Closest}}_{n}\\}\in\mathbb{R}^{n\times
d},$

where $[\cdot;\cdot]$ stands for concatenation operation. In particular, for
chest X-ray images, the result $\text{Att}(\hat{v},P)$ in Eq. (5) turns out to
be the found normal images that are closest to the current entire input image.
However, $\text{Att}(\hat{v},P)$ cannot capture those normal images that are
closest to the input image only in a specific part rather than the entire
image. Fortunately, through repeating the function $\text{Att}(\hat{v},P)$ in
Eq. (5) $n$ times, our Aggregate Attention can efficiently find the closest
normal images
$P^{\prime}=\\{\hat{v}^{\text{Closest}}_{1},\hat{v}^{\text{Closest}}_{2},\dots,\hat{v}^{\text{Closest}}_{n}\\}$
from $n$ parts.

#### Differentiate Attention

To learn the contrastive information between the input image and the closest
normal images, we first attempt to capture their similarity, i.e., the common
information, then we remove this similarity portion from the input image to
obtain the contrastive information. To this end, we introduce the
Differentiate Attention.

The first step is learning to summarize the common information
$v^{c}\in\mathbb{R}^{1\times d}$ between the information of current input
image $\hat{v}\in\mathbb{R}^{1\times d}$ and the information of closest normal
images $P^{\prime}\in\mathbb{R}^{n\times d}$. In implementation, we employ the
same dot-product self-attention mechanism in Eq. (5) and average pooling
operation to obtain the $v^{c}\in\mathbb{R}^{1\times d}$:

$\displaystyle
v^{c}=\text{AveragePooling}\left(\text{Att}\left([\hat{v};P^{\prime}],[\hat{v};P^{\prime}]\right)\right),$
(7)

where $[\cdot;\cdot]$ denotes row-wise concatenation operation, then the
$[\hat{v};P^{\prime}]$ is in the shape of $(n+1)\times d$ and the
$\text{Att}\left([\hat{v};P^{\prime}],[\hat{v};P^{\prime}]\right)$ function
outputs a matrix in the shape of $(n+1)\times d$.

In this way, via such self-attention mechanism, we exploit the similarity
between $P^{\prime}$ and $\hat{v}$ to capture the significant common
information. Next, to obtain the contrastive information
$v^{d}\in\mathbb{R}^{1\times d}$, we remove (i.e., subtract) the common
information $v^{c}\in\mathbb{R}^{1\times d}$ from the input image
$\hat{v}\in\mathbb{R}^{1\times d}$:

$v^{d}=\hat{v}-v^{c}.$ (8)

At last, we update the original image features, i.e.,
$\hat{v}\in\mathbb{R}^{1\times d}$ and
$V=\\{v_{1},v_{2},\dots,v_{N_{\text{I}}}\\}\in\mathbb{R}^{{N_{\text{I}}}\times
d}$, with the contrastive information $v^{d}\in\mathbb{R}^{1\times d}$:

$\displaystyle\hat{v}^{\prime}$
$\displaystyle=\text{ReLU}([\hat{v};v^{d}]\text{W}^{\prime})$ (9)
$\displaystyle v^{\prime}_{i}$
$\displaystyle=\text{ReLU}([v_{i};v^{d}]\text{W}^{\prime}),$ (10)

where $\text{ReLU}(\cdot)$ represents the ReLU activation function and
$\text{W}^{\prime}\in\mathbb{R}^{2d\times d}$ is the matrix for linear
transformation. The resulting $\hat{v}^{\prime}$ and
$V^{\prime}=\\{{v}^{\prime}_{1},{v}^{\prime}_{2},\dots,{v}^{\prime}_{N_{\text{I}}}\\}$
are used to replace the original image features $V$ in Eq. (1) and are then
fed into existing models to generate coherent reports.

In our subsequent analysis, we show that the contrastive features indeed focus
on the abnormal regions and provide a better starting point for downstream
models.

Settings | Methods | Dataset: MIMIC-CXR Johnson et al. (2019) | Dataset: IU-X-ray Demner-Fushman et al. (2016)
---|---|---|---
B-1 | B-2 | B-3 | B-4 | M | R-L | B-1 | B-2 | B-3 | B-4 | M | R-L
(a) | NIC Vinyals et al. (2015)† | 0.290 | 0.182 | 0.119 | 0.081 | 0.112 | 0.249 | 0.352 | 0.227 | 0.154 | 0.109 | 0.133 | 0.313
w/ Contrastive Attention | 0.317 | 0.200 | 0.127 | 0.089 | 0.120 | 0.262 | 0.368 | 0.232 | 0.166 | 0.118 | 0.144 | 0.323
(b) | Visual-Attention Xu et al. (2015)† | 0.318 | 0.186 | 0.122 | 0.085 | 0.119 | 0.267 | 0.371 | 0.233 | 0.159 | 0.118 | 0.147 | 0.320
w/ Contrastive Attention | 0.309 | 0.202 | 0.129 | 0.093 | 0.122 | 0.265 | 0.384 | 0.245 | 0.172 | 0.125 | 0.141 | 0.315
(c) | Spatial-Attention Lu et al. (2017)† | 0.302 | 0.189 | 0.122 | 0.082 | 0.120 | 0.259 | 0.374 | 0.235 | 0.158 | 0.120 | 0.146 | 0.322
w/ Contrastive Attention | 0.320 | 0.204 | 0.129 | 0.091 | 0.122 | 0.266 | 0.378 | 0.236 | 0.161 | 0.116 | 0.146 | 0.335
(d) | Att2in Rennie et al. (2017)† | 0.314 | 0.199 | 0.126 | 0.087 | 0.125 | 0.265 | 0.410 | 0.257 | 0.173 | 0.131 | 0.149 | 0.325
w/ Contrastive Attention | 0.327 | 0.205 | 0.132 | 0.095 | 0.124 | 0.271 | 0.442 | 0.281 | 0.200 | 0.150 | 0.171 | 0.344
(e) | Adaptive-Attention Lu et al. (2017)† | 0.307 | 0.192 | 0.124 | 0.084 | 0.119 | 0.262 | 0.433 | 0.285 | 0.194 | 0.137 | 0.166 | 0.349
w/ Contrastive Attention | 0.330 | 0.208 | 0.134 | 0.095 | 0.126 | 0.270 | 0.425 | 0.279 | 0.198 | 0.142 | 0.167 | 0.347
(f) | Up-Down Anderson et al. (2018)† | 0.318 | 0.203 | 0.128 | 0.089 | 0.123 | 0.266 | 0.389 | 0.251 | 0.170 | 0.126 | 0.154 | 0.317
w/ Contrastive Attention | 0.336 | 0.209 | 0.134 | 0.097 | 0.128 | 0.273 | 0.378 | 0.246 | 0.169 | 0.129 | 0.152 | 0.330
(g) | HLSTM Krause et al. (2017)† | 0.321 | 0.203 | 0.129 | 0.092 | 0.125 | 0.270 | 0.435 | 0.280 | 0.187 | 0.131 | 0.173 | 0.346
w/ Contrastive Attention | 0.352 | 0.216 | 0.145 | 0.105 | 0.139 | 0.276 | 0.453 | 0.290 | 0.203 | 0.153 | 0.178 | 0.361
(h) | HLSTM+att+Dual Harzig et al. (2019)† | 0.328 | 0.204 | 0.127 | 0.090 | 0.122 | 0.267 | 0.447 | 0.289 | 0.192 | 0.144 | 0.175 | 0.358
w/ Contrastive Attention | 0.323 | 0.202 | 0.130 | 0.102 | 0.138 | 0.277 | 0.464 | 0.292 | 0.205 | 0.149 | 0.176 | 0.364
(i) | Co-Attention Jing et al. (2018)† | 0.329 | 0.206 | 0.133 | 0.095 | 0.129 | 0.273 | 0.463 | 0.293 | 0.207 | 0.155 | 0.178 | 0.365
w/ Contrastive Attention | 0.351 | 0.213 | 0.148 | 0.106 | 0.147 | 0.270 | 0.486 | 0.311 | 0.223 | 0.178 | 0.187 | 0.372
(j) | Multi-Attention Huang et al. (2019)† | 0.337 | 0.211 | 0.136 | 0.097 | 0.130 | 0.274 | 0.468 | 0.299 | 0.211 | 0.155 | 0.180 | 0.366
w/ Contrastive Attention | 0.350 | 0.219 | 0.152 | 0.109 | 0.151 | 0.283 | 0.492 | 0.314 | 0.222 | 0.169 | 0.193 | 0.381
Table 1: Performance of automatic evaluations on the test set of the MIMIC-CXR dataset and the IU-X-ray dataset. † denotes our own implementation. B-n, M and R-L are short for BLEU-n, METEOR and ROUGE-L, respectively. Higher is better in all columns. In this paper, the  Red colored numbers denote the best results across all approaches in Table. As we can see, most baseline models enjoy a comfortable improvement with our approach. Methods | Dataset: MIMIC-CXR Johnson et al. (2019) | Dataset: IU-X-ray Demner-Fushman et al. (2016)
---|---|---
B-1 | B-2 | B-3 | B-4 | M | R-L | B-1 | B-2 | B-3 | B-4 | M | R-L
HRGR-Agent Li et al. (2018) | - | - | - | - | - | - | 0.438 | 0.298 | 0.208 | 0.151 | - | 0.322
CMAS-RL Jing et al. (2019) | - | - | - | - | - | - | 0.464 | 0.301 | 0.210 | 0.154 | - | 0.362
SentSAT + KG Zhang et al. (2020a) | - | - | - | - | - | - | 0.441 | 0.291 | 0.203 | 0.147 | - | 0.367
Transformer Chen et al. (2020c) | 0.314 | 0.192 | 0.127 | 0.090 | 0.125 | 0.265 | 0.396 | 0.254 | 0.179 | 0.135 | 0.164 | 0.342
R2Gen Chen et al. (2020c) | 0.353 | 0.218 | 0.145 | 0.103 | 0.142 | 0.277 | 0.470 | 0.304 | 0.219 | 0.165 | 0.187 | 0.371
Contrastive Attention (Ours) | 0.350 | 0.219 | 0.152 | 0.109 | 0.151 | 0.283 | 0.492 | 0.314 | 0.222 | 0.169 | 0.193 | 0.381
Table 2: Comparison with existing state-of-the-art methods on the test set of
the MIMIC-CXR dataset and the IU-X-ray dataset. As we can see, we achieve the
state-of-the-art performance on major metrics on the two datasets.

##  4 Experiments

###  4.1 Datasets, Baselines and Settings

Datasets We use the widely-used benchmark IU-X-ray Demner-Fushman et al.
(2016) dataset and the recently released large-scale MIMIC-CXR Johnson et al.
(2019) datasets for evaluation.

$\bullet$ IU-X-ray333https://openi.nlm.nih.gov/ contains 3,955 radiology
reports and 7,470 X-rays images. We use the widely-used splits in Chen et al.
(2020c); Jing et al. (2019); Li et al. (2019, 2018); Liu et al. (2021) for
evaluation. There are 70%, 10% and 20% instances in training set, validation
set and test set, respectively.

$\bullet$ MIMIC-CXR444https://physionet.org/content/mimic-cxr/2.0.0/ is the
recently released largest dataset to date and consists of 377,110 chest X-ray
images and 227,835 reports from 64,588 patients. Following Chen et al.
(2020c); Liu et al. (2021), we use the official splits to report our results.
Thus, there are 368,960 in the training set, 2,991 in the validation set and
5,159 in the test set. We convert all tokens of reports to lower-cases and
remove the tokens whose frequency of occurrence in the training set is less
than 10, resulting in 4k words.

Baselines We experiment with two lines of baselines that are originally
designed for image captioning and chest X-ray report generation.

$\bullet$ Image Captioning Baselines We experiment on six representative
models: NIC Vinyals et al. (2015), Visual-Attention Xu et al. (2015), Spatial-
Attention Lu et al. (2017), Att2in Rennie et al. (2017), Adaptive-Attention Lu
et al. (2017) and Up-Down Anderson et al. (2018).

$\bullet$ Chest X-ray Report Generation Baselines We conduct the experiment on
four baselines consisting of HLSTM Krause et al. (2017); Jing et al. (2018),
HLSTM+att+Dual Harzig et al. (2019), Co-Attention Jing et al. (2018) and
Multi-Attention Huang et al. (2019).

Settings For our Contrastive Attention model, the model size $d$ is set to
512. Based on the average performance on the validation set, the $n$ in the
Aggregate Attention is set to 6. For the normality pool, we randomly extract
1,000 normal images, i.e., $N_{\text{P}}=1,000$, for both two datasets from
their training set. To re-implement the baselines, following Jing et al.
(2019); Li et al. (2019, 2018); Liu et al. (2021), we adopt the ResNet-50 He
et al. (2016) pre-trained on ImageNet Deng et al. (2009) and fine-tuned on
CheXpert dataset Irvin et al. (2019) to extract the patch visual features with
the dimension of each feature is 2,048, which will be projected to 512.
Besides, we utilize paired images of a patient as the input for IU-X-ray and
utilize single image as the input for MIMIC-CXR to ensure consistency with the
experiment settings of previous works Chen et al. (2020c). For all baselines,
since our focus is to provide explicit abnormal region features, which tends
to improve existing baselines, we keep the inner structure of the baselines
untouched and preserve the original parameter setting and training strategy.

Metrics | vs. Models | Dataset: MIMIC-CXR Johnson et al. (2019) | Dataset: IU-X-ray Demner-Fushman et al. (2016)
---|---|---|---
Baseline wins | Tie | ‘w/ CA’ wins | Baseline wins | Tie | ‘w/ CA’ wins
Fluency | HLSTM Krause et al. (2017)† | 21 | 45 | 34 | 18 | 43 | 39
Multi-Attention Huang et al. (2019)† | 30 | 34 | 36 | 27 | 41 | 32
Comprehensiveness | HLSTM Krause et al. (2017)† | 13 | 33 | 54 | 10 | 19 | 71
Multi-Attention Huang et al. (2019)† | 26 | 35 | 39 | 22 | 31 | 47
Faithfulness | HLSTM Krause et al. (2017)† | 20 | 28 | 52 | 13 | 25 | 62
Multi-Attention Huang et al. (2019)† | 31 | 32 | 37 | 24 | 30 | 46
Table 3: Results of human evaluation on MIMIC-CXR and IU-X-ray datasets for
comparing our method with baselines in terms of the fluency of generated
reports, the comprehensiveness of the generated true abnormalities and the
faithfulness to the ground truth reports. All values are reported in
percentage (%).

###  4.2 Main Evaluation

Metrics We first perform the automatic evaluation to conduct a fair
comparison. To measure performance, we adopt the widely-used evaluation
toolkit Chen et al. (2015) to calculate the standard metrics: BLEU Papineni et
al. (2002), METEOR Banerjee and Lavie (2005) and ROUGE-L Lin (2004).
Specifically, BLEU and METEOR are originally designed for machine translation
evaluation, while ROUGE is originally proposed for automatic evaluation of the
extracted text summarization.

Results The results on the test set of MIMIC-CXR and IU-X-ray datasets are
reported in Table 1. As we can see, our Contrastive Attention can successfully
boost baselines with improvement up to 14% and 17% for MIMIC-CXR and IU-X-ray
in terms of BLEU-4 score, respectively, where the Setting (g) achieves the
greatest improvements. The results prove the effectiveness and generalization
capabilities of our approach to a wide range of models.

Moreover, in Table 2, we choose five competitive models including the current
state-of-the-art models, i.e., SentSAT + KG Zhang et al. (2020a) and R2Gen
Chen et al. (2020c), for comparison. For these competitive models, we directly
report the results from the original paper. Table 2 shows that when our
approach is applied to the Multi-Attention, we outperform these existing
state-of-the-art models on major metrics on the IU-X-ray and MIMIC-CXR
datasets, which further proves the effectiveness of our Contrastive Attention.

###  4.3 Clinical Efficacy

Metrics The metrics used in the Table 1 measure the match between the
generated reports and ground truth reports, but are not specialized for the
abnormalities in the reports. Therefore, to measure the accuracy of
descriptions for clinical abnormalities, we follow Chen et al. (2020c) to
adopt the CheXpert labeler Irvin et al. (2019), which will label the given
reports in 14 different categories related to thoracic diseases and support
devices, to further report the clinical efficacy metrics. As a result, we can
calculate the clinical efficacy scores by comparing the generated reports with
ground truth reports in 14 different categories, producing the Precision,
Recall and F1 scores.

Results The results are shown in Table 4. As we can see, our approach can
boost the performance of baselines under all clinical efficacy metrics. The
results prove our arguments and the effectiveness of our approach in boosting
the baselines to correctly capture and depict the abnormalities. Specifically,
our Multi-Attention w/ CA outperforms the R2Gen Chen et al. (2020c) with
relatively 6%, 9% and 10% margins in terms of Precision, Recall and F1 scores,
respectively The superior clinical efficacy scores, which measure the accuracy
of descriptions for clinical abnormalities, demonstrate that our approach can
help existing models produce higher quality descriptions for clinical
abnormalities.

Methods | Clinical Efficacy Metrics
---|---
Precision | Recall | F1
NIC Vinyals et al. (2015) | 0.249 | 0.203 | 0.204
AdaAtt Lu et al. (2017) | 0.268 | 0.186 | 0.181
Att2in Rennie et al. (2017) | 0.322 | 0.239 | 0.249
Up-Down Anderson et al. (2018) | 0.320 | 0.231 | 0.238
Transformer Chen et al. (2020c) | 0.331 | 0.224 | 0.228
R2Gen Chen et al. (2020c) | 0.333 | 0.273 | 0.276
HLSTM Krause et al. (2017)† | 0.307 | 0.225 | 0.228
w/ Contrastive Attention | 0.340 | 0.269 | 0.274
Multi-Attention Huang et al. (2019)† | 0.336 | 0.257 | 0.265
w/ Contrastive Attention | 0.352 | 0.298 | 0.303
Table 4: Performance of automatic evaluations in terms of clinical efficacy metrics, which measure the accuracy of descriptions for clinical abnormalities, on the MIMIC-CXR dataset. Higher is better in all columns. Settings | Methods | Attention Function | $n$ | Dataset: IU-X-ray Demner-Fushman et al. (2016)
---|---|---|---|---
Baseline: HLSTM Krause et al. (2017) | Baseline: Multi-Attention Huang et al. (2019)
B-1 | B-2 | B-3 | B-4 | M | R-L | B-1 | B-2 | B-3 | B-4 | M | R-L
(a) | Baseline | - | - | 0.435 | 0.280 | 0.187 | 0.131 | 0.173 | 0.346 | 0.468 | 0.299 | 0.211 | 0.155 | 0.180 | 0.366
(b) | w/ DA | dot-product attention | - | 0.447 | 0.284 | 0.195 | 0.138 | 0.176 | 0.357 | 0.479 | 0.306 | 0.215 | 0.162 | 0.184 | 0.373
(c) | w/ DA + AA | 1 | 0.451 | 0.287 | 0.198 | 0.144 | 0.176 | 0.359 | 0.486 | 0.310 | 0.218 | 0.164 | 0.187 | 0.375
(f) | w/ DA + AA | dot-product attention | 2 | 0.451 | 0.285 | 0.199 | 0.146 | 0.175 | 0.359 | 0.488 | 0.312 | 0.219 | 0.165 | 0.189 | 0.377
(g) | w/ DA + AA | 4 | 0.453 | 0.287 | 0.202 | 0.149 | 0.177 | 0.361 | 0.493 | 0.314 | 0.220 | 0.165 | 0.191 | 0.378
(h) | w/ DA + AA | 6 | 0.453 | 0.290 | 0.203 | 0.153 | 0.178 | 0.361 | 0.492 | 0.314 | 0.222 | 0.169 | 0.193 | 0.381
(i) | w/ DA + AA | 8 | 0.451 | 0.288 | 0.200 | 0.150 | 0.180 | 0.362 | 0.488 | 0.311 | 0.221 | 0.164 | 0.194 | 0.379
(j) | w/ DA + AA | 10 | 0.448 | 0.284 | 0.197 | 0.142 | 0.175 | 0.355 | 0.490 | 0.310 | 0.219 | 0.162 | 0.188 | 0.375
Table 5: Quantitative analysis of our Contrastive Attention, which includes
the Differentiate Attention (DA) and Aggregate Attention (AA). We conduct the
analysis on a widely-used baseline model HLSTM Krause et al. (2017) and a
competitive baseline model Multi-Attention Huang et al. (2019).

###  4.4 Human Evaluation

Metrics For medical-related task, it is important to know (1) on what fraction
of images with abnormalities did the system not mention the abnormality and
(2) on what fraction of images the system described abnormality that does not
exist according to doctors. To this end, we randomly select 200 samples from
the IU-X-ray and MIMIC-CXR test sets, which are 100 samples from each dataset.
Specifically, it is important to generate accurate reports (faithfulness) with
comprehensive true abnormalities (comprehensiveness) and it is unacceptable to
generate repeated sentences (fluency). Therefore, we invite several
professional clinicians to compare our approach and baselines independently
and evaluate the perceptual quality, including the fluency of generated
reports, the comprehensiveness of generated true abnormalities and the
faithfulness to the ground truth reports. The clinicians are unaware of which
model generates these reports.

Results To conduct the human evaluation, we select a representative chest
X-ray report generation baseline: HLSTM Krause et al. (2017) and a competitive
chest X-ray report generation baseline: Multi-Attention Huang et al. (2019).
The results in Table 3 show that our approach enjoys the obvious advantage in
terms of the three aspects, i.e., fluency, comprehensiveness and faithfulness,
meaning that the reports generated by the “Baseline w/ Contrastive Attention”
are of higher clinical quality, which also proves the advantage of our
approach in clinical practice. Especially, by using our proposed Contrastive
Attention, the winning chances of models increased by maximum of $54-13=41$
points and $71-10=61$ points in terms of the comprehensiveness metric on the
MIMIC-CXR and IU-X-ray datasets, respectively. It demonstrates the
effectiveness of our approach in helping existing baselines generate more
accurate abnormality descriptions, and thus improve the usefulness of models
in better assisting radiologists in clinical decision-makings and reducing
their workload.

Overall From the results of automatic and human evaluations, we can see that
our proposed Contrastive Attention can provide a solid basis for describing
chest X-ray images, especially for the abnormalities. As a result, our
approach can successfully boost baselines and achieves new state-of-the-art
results on the MIMIC-CXR and IU-X-ray datasets, which verifies the
effectiveness of the proposed approach and indicates that our approach is less
prone to the variations of model structures, hyper-parameters (e.g., learning
rate and batch size), and learning paradigms.

##  5 Analysis

We conduct analysis on the benchmark IU-X-ray dataset to better understand our
proposed approach.

###  5.1 Quantitative Analysis

We conduct the quantitative analysis on two representative models, i.e., HLSTM
and Multi-Attention, to evaluate the contribution of each component.

Effect of Contrastive Attention Our Contrastive Attention consists of the
Differentiate Attention (DA) and Aggregate Attention (AA). As shown in Table
5(b), the DA can promote the performance over all metrics. Especially for the
HLSTM Krause et al. (2017), which does not incorporate the attention mechanism
to allow more efficient use of the image features. We can see that an up to 5%
gain in BLEU-4 score makes the “HLSTM w/ DA” an equally competitive model as
the “HLSTM+att+Dual” model in Table 1(h). This indicates that the contrastive
information extracted by the DA contains sufficient accurate abnormal
information, which is vital in improving the performance of chest X-ray report
generation. In other words, our approach can ease the design of the neural
models for the task.

For the AA, it devotes to identifying the closest normal images and filtering
out the noisy images, which can improve the contrasting process in the DA. As
expected, Table 5(c) shows that the AA can consistently boost the performance
of baselines under all metrics, which further demonstrates the effectiveness
of our approach.

Figure 3: Examples of the generated reports and the visualization of the
Contrastive Attention (CA). Please view in color. CA model can capture the
abnormal region ( Red bounding box) by contrasting the input image with normal
images. Besides, our Aggregate Attention in the CA model can find the closest
normal images ( Blue and  Green boxes visualized from two different attention
weights (see Eq. (6))) and filter out the noisy images ( Purple boxes). The
Red colored text denotes the abnormal descriptions in the ground truth report.
Underlined text denotes the generated wrong sentences. Bold text denotes the
generated true abnormalities. As we can see, the abnormal region and the
abnormal descriptions generated by our method show significant alignment with
ground truth reports.

Effect of $n$ In this section, we analyze the effect of $n$ in our Aggregate
Attention (see Eq. (6)). Table 5(f-j) shows that when $n$ is smaller than 6,
the performance will increase with as $n$ increases. The reason may be that
repeating the Aggregate Attention $n$ times with different learnable attention
weights can encourage the model to identify the closest normal images from $n$
aspects, e.g., organs or tissues, i.e., if an aspect of the normal image is
similar to the input image, it will be identified as the closest normal image.
In this way, the Aggregate Attention can capture accurate and robust closest
normal images from $n$ aspects. To verify this, we randomly visualize two
attention weights of Aggregate Attention in Figure 3. As we can see, the
Aggregate Attention can indeed identify the closest normal images from
multiple aspects, e.g., ‘Bone/Clavicle’ (Blue boxes) and ‘Right Lung’ (Green
boxes), which proves our arguments. Moreover, larger $n$ will bring noise,
i.e., normal images that are not similar to the current input image, to the
model and thus impair the performance.

###  5.2 Qualitative Analysis

In this section, we show the reports generated by the Baseline models, i.e.,
HLSTM and Multi-Attention, and the “Baseline w/ CA” models, and the
visualization in Figure 3 to analyze the strength of our Contrastive Attention
model intuitively. As we can see, for the HLSTM, it tends to produce repeated
findings and normal findings, which results from the overwhelming normal
findings in the dataset, i.e., data deviation Shin et al. (2016). For the
Multi-Attention, with the help of attention mechanism, it can describe
abnormalities, but some abnormalities are incorrect (Underlined text). The
reason is that it is difficult for the Multi-Attention model to efficiently
learn the medical expertise from the dataset with data deviation to correctly
detect the abnormal regions. Since our Contrastive Attention model can
efficiently capture the suspicious abnormal regions by contrasting the input
images and normal images and transfer such power to the downstream models and
datasets, we can thus help multiple baseline models to detect and describe
comprehensive and accurate abnormalities. As a result, the “Baseline w/ CA”
models can generate fluent and accurate reports supported with accurate
abnormal descriptions, showing significant alignment with ground truth
reports.

##  6 Conclusion

In this paper, we propose the Contrastive Attention model to capture abnormal
regions by contrasting the input image and normal images for chest X-ray
report generation. The experiments on two public datasets demonstrate the
effectiveness of our approach, which can be easily incorporated into existing
models to boost their performance under most metrics. The clinical efficacy
scores and human evaluation further prove our arguments and the effectiveness
of our approach in helping existing models capture and depict the
abnormalities. Specifically, we achieve the state-of-the-art results on the
two datasets with the best human preference, which could better assist
radiologists in clinical decision-making and reduce their workload.

In the future, there are two potential ways to improve the contrastive
attention. First, it may be better to perform the contrastive attention in
path feature rather than global feature. Second, it may be better to utilize
multiple feature maps from different convolutional layers rather than just the
feature maps of last convolutional layer.

## Acknowledgments

This work is partly supported by Beijing Academy of Artificial Intelligence
(BAAI). We would like to sincerely thank the clinicians (Xiaoxia Xie, Jing
Zhang, etc.) of the Harbin Chest Hospital in China for providing the human
evaluation. We also sincerely thank all the anonymous reviewers and chairs for
their constructive comments and suggestions. Xu Sun, Ping Zhang, and Yuexian
Zou are the corresponding authors of this paper.

## Ethical Considerations

In this work, we focus on helping several existing chest X-ray report
generation systems better capture and describe the abnormalities. To this end,
we provide a detailed human evaluation in Table 3 (Section 4.4) and an
automatic evaluation in terms of clinical efficacy metrics in Table 4 (Section
4.3) to know (1) on what fraction of images with abnormalities did the system
not mention the abnormality and (2) on what fraction of images the system
described abnormality that does not exist according to doctors. The results
show that our work can help existing systems generate more accurate
descriptions for clinical abnormalities, improving the usefulness of existing
systems in better assisting radiologists in clinical decision-makings and
reducing their workload. In particular, for radiologists, given a large amount
of medical images, the systems can automatically generate medical reports, the
radiologists only need to make revisions rather than write a new report from
scratch. This study uses the public MIMIC-CXR and IU-X-ray datasets. All
protected health information was de-identified. De-identification was
performed in compliance with Health Insurance Portability and Accountability
Act (HIPAA) standards in order to facilitate public access to the datasets.
Deletion of protected health information (PHI) from structured data sources
(e.g., database fields that provide patient name or date of birth) was
straightforward. All necessary patient/participant consent has been obtained
and the appropriate institutional forms have been archived.

## References

  * Anderson et al. (2018) Peter Anderson, Xiaodong He, Chris Buehler, Damien Teney, Mark Johnson, Stephen Gould, and Lei Zhang. 2018.  Bottom-up and top-down attention for image captioning and VQA.  In _CVPR_.
  * Bahdanau et al. (2015a) Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2015a.  Neural machine translation by jointly learning to align and translate.  In _ICLR_.
  * Bahdanau et al. (2015b) Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2015b.  Neural machine translation by jointly learning to align and translate.  In _ICLR_.
  * Banerjee and Lavie (2005) Satanjeev Banerjee and Alon Lavie. 2005.  METEOR: an automatic metric for MT evaluation with improved correlation with human judgments.  In _IEEvaluation@ACL_.
  * Boag et al. (2019) William Boag, Tzu-Ming Harry Hsu, Matthew B. A. McDermott, Gabriela Berner, Emily Alsentzer, and Peter Szolovits. 2019.  Baselines for chest x-ray report generation.  In _ML4H@NeurIPS_.
  * Brady et al. (2012) A. Brady, R. Ó. Laoide, Peter Mccarthy, and R. Mcdermott. 2012.  Discrepancy and error in radiology: Concepts, causes and consequences.  _The Ulster Medical Journal_ , 81:3 – 9.
  * Chen et al. (2020a) Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey E. Hinton. 2020a.  A simple framework for contrastive learning of visual representations.  In _ICML_.
  * Chen et al. (2020b) Xinlei Chen, Haoqi Fan, Ross B. Girshick, and Kaiming He. 2020b.  Improved baselines with momentum contrastive learning.  _arXiv preprint arXiv:2003.04297_.
  * Chen et al. (2015) Xinlei Chen, Hao Fang, Tsung-Yi Lin, Ramakrishna Vedantam, Saurabh Gupta, Piotr Dollár, and C. Lawrence Zitnick. 2015.  Microsoft COCO captions: Data collection and evaluation server.  _arXiv preprint arXiv:1504.00325_.
  * Chen et al. (2020c) Zhihong Chen, Yan Song, Tsung-Hui Chang, and Xiang Wan. 2020c.  Generating radiology reports via memory-driven transformer.  In _EMNLP_.
  * Cornia et al. (2020) Marcella Cornia, Matteo Stefanini, Lorenzo Baraldi, and Rita Cucchiara. 2020.  Meshed-memory transformer for image captioning.  In _CVPR_.
  * Dai and Lin (2017) Bo Dai and Dahua Lin. 2017.  Contrastive learning for image captioning.  In _NIPS_.
  * Delrue et al. (2011) Louke Delrue, Robert Gosselin, Bart Ilsen, An Van Landeghem, Johan de Mey, and Philippe Duyck. 2011.  Difficulties in the interpretation of chest radiography.  _Comparative Interpretation of CT and Standard Radiography of the Chest_ , pages 27–49.
  * Demner-Fushman et al. (2016) Dina Demner-Fushman, Marc D. Kohli, Marc B. Rosenman, Sonya E. Shooshan, Laritza Rodriguez, Sameer K. Antani, George R. Thoma, and Clement J. McDonald. 2016.  Preparing a collection of radiology examinations for distribution and retrieval.  _J. Am. Medical Informatics Assoc._ , 23(2):304–310.
  * Deng et al. (2009) Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Fei-Fei Li. 2009\.  Imagenet: A large-scale hierarchical image database.  In _CVPR_.
  * Duan et al. (2019) Xiangyu Duan, Hongfei Yu, Mingming Yin, Min Zhang, Weihua Luo, and Yue Zhang. 2019\.  Contrastive attention mechanism for abstractive sentence summarization.  In _EMNLP/IJCNLP_.
  * Goergen et al. (2013) Stacy K Goergen, Felicity J Pool, Tari J Turner, Jane E Grimm, Mark N Appleyard, Carmel Crock, Michael C Fahey, Michael F Fay, Nicholas J Ferris, Susan M Liew, et al. 2013.  Evidence-based guideline for the written radiology report: Methods, recommendations and implementation challenges.  _Journal of medical imaging and radiation oncology_ , 57(1):1–7.
  * Grill et al. (2020) Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre H. Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Ávila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, Bilal Piot, Koray Kavukcuoglu, Rémi Munos, and Michal Valko. 2020.  Bootstrap your own latent: A new approach to self-supervised learning.  _arXiv preprint arXiv:2006.07733_.
  * Harzig et al. (2019) Philipp Harzig, Yan-Ying Chen, Francine Chen, and Rainer Lienhart. 2019.  Addressing data bias problems for chest x-ray image report generation.  In _BMVC_.
  * He et al. (2020) Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross B. Girshick. 2020.  Momentum contrast for unsupervised visual representation learning.  In _CVPR_.
  * He et al. (2016) Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. 2016.  Deep residual learning for image recognition.  In _CVPR_.
  * Hénaff et al. (2020) Olivier J. Hénaff, Aravind Srinivas, Jeffrey De Fauw, Ali Razavi, Carl Doersch, S. M. Ali Eslami, and Aäron van den Oord. 2020.  Data-efficient image recognition with contrastive predictive coding.  In _ICML_.
  * Huang et al. (2019) Xin Huang, Fengqi Yan, Wei Xu, and Maozhen Li. 2019.  Multi-attention and incorporating background information model for chest x-ray image report generation.  _IEEE Access_.
  * Irvin et al. (2019) Jeremy Irvin, Pranav Rajpurkar, Michael Ko, Yifan Yu, Silviana Ciurea-Ilcus, Chris Chute, Henrik Marklund, Behzad Haghgoo, Robyn L. Ball, Katie S. Shpanskaya, Jayne Seekins, David A. Mong, Safwan S. Halabi, Jesse K. Sandberg, Ricky Jones, David B. Larson, Curtis P. Langlotz, Bhavik N. Patel, Matthew P. Lungren, and Andrew Y. Ng. 2019.  Chexpert: A large chest radiograph dataset with uncertainty labels and expert comparison.  In _AAAI_.
  * Jia et al. (2021) Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc V. Le, Yun-Hsuan Sung, Zhen Li, and Tom Duerig. 2021.  Scaling up visual and vision-language representation learning with noisy text supervision.  In _ICML_.
  * Jing et al. (2019) Baoyu Jing, Zeya Wang, and Eric P. Xing. 2019.  Show, describe and conclude: On exploiting the structure information of chest x-ray reports.  In _ACL_.
  * Jing et al. (2018) Baoyu Jing, Pengtao Xie, and Eric P. Xing. 2018.  On the automatic generation of medical imaging reports.  In _ACL_.
  * Johnson et al. (2019) Alistair E. W. Johnson, Tom J. Pollard, Seth J. Berkowitz, Nathaniel R. Greenbaum, Matthew P. Lungren, Chih-ying Deng, Roger G. Mark, and Steven Horng. 2019.  MIMIC-CXR: A large publicly available database of labeled chest radiographs.  _arXiv preprint arXiv:1901.07042_.
  * Kim et al. (2018) Jin-Hwa Kim, Jaehyun Jun, and Byoung-Tak Zhang. 2018.  Bilinear attention networks.  In _NeurIPS_.
  * Krause et al. (2017) Jonathan Krause, Justin Johnson, Ranjay Krishna, and Li Fei-Fei. 2017.  A hierarchical approach for generating descriptive image paragraphs.  In _CVPR_.
  * Kurisinkel et al. (2021) Litton J Kurisinkel, Ai Ti Aw, and Nancy F. Chen. 2021.  Coherent and concise radiology report generation via context specific image representations and orthogonal sentence states.  In _NAACL-HLT_.
  * Li et al. (2019) Christy Y. Li, Xiaodan Liang, Zhiting Hu, and Eric P. Xing. 2019.  Knowledge-driven encode, retrieve, paraphrase for medical image report generation.  In _AAAI_.
  * Li et al. (2020) Mingjie Li, Fuyu Wang, Xiaojun Chang, and Xiaodan Liang. 2020.  Auxiliary signal-guided knowledge encoder-decoder for medical report generation.  _arXiv preprint arXiv:2006.03744_.
  * Li et al. (2018) Yuan Li, Xiaodan Liang, Zhiting Hu, and Eric P. Xing. 2018.  Hybrid retrieval-generation reinforced agent for medical image report generation.  In _NeurIPS_.
  * Lin (2004) Chin-Yew Lin. 2004.  ROUGE: A package for automatic evaluation of summaries.  In _ACL_.
  * Lin et al. (2017) Zhouhan Lin, Minwei Feng, Cícero Nogueira dos Santos, Mo Yu, Bing Xiang, Bowen Zhou, and Yoshua Bengio. 2017.  A structured self-attentive sentence embedding.  In _ICLR_.
  * Liu et al. (2019a) Fenglin Liu, Xuancheng Ren, Yuanxin Liu, Kai Lei, and Xu Sun. 2019a.  Exploring and distilling cross-modal information for image captioning.  In _IJCAI_.
  * Liu et al. (2018) Fenglin Liu, Xuancheng Ren, Yuanxin Liu, Houfeng Wang, and Xu Sun. 2018.  simnet: Stepwise image-topic merging network for generating detailed and comprehensive image captions.  In _EMNLP_.
  * Liu et al. (2021) Fenglin Liu, Xian Wu, Shen Ge, Wei Fan, and Yuexian Zou. 2021.  Exploring and distilling posterior and prior knowledge for radiology report generation.  In _CVPR_.
  * Liu et al. (2019b) Guanxiong Liu, Tzu-Ming Harry Hsu, Matthew B. A. McDermott, Willie Boag, Wei-Hung Weng, Peter Szolovits, and Marzyeh Ghassemi. 2019b.  Clinically accurate chest x-ray report generation.  In _MLHC_.
  * Lovelace and Mortazavi (2020) Justin R. Lovelace and Bobak Mortazavi. 2020.  Learning to generate clinically coherent chest x-ray reports.  In _EMNLP (Findings)_.
  * Lu et al. (2017) Jiasen Lu, Caiming Xiong, Devi Parikh, and Richard Socher. 2017.  Knowing when to look: Adaptive attention via a visual sentinel for image captioning.  In _CVPR_.
  * Miura et al. (2021) Yasuhide Miura, Yuhao Zhang, Emily Bao Tsai, Curtis P. Langlotz, and Dan Jurafsky. 2021.  Improving factual completeness and consistency of image-to-text radiology report generation.  In _NAACL-HLT_.
  * Ni et al. (2020) Jianmo Ni, Chun-Nan Hsu, Amilcare Gentili, and Julian J. McAuley. 2020.  Learning visual-semantic embeddings for reporting abnormal findings on chest x-rays.  In _EMNLP (Findings)_.
  * Nishino et al. (2020) Toru Nishino, Ryota Ozaki, Yohei Momoki, Tomoki Taniguchi, Ryuji Kano, Norihisa Nakano, Yuki Tagawa, Motoki Taniguchi, Tomoko Ohkuma, and Keigo Nakamura. 2020\.  Reinforcement learning with imbalanced dataset for data-to-text medical report generation.  In _EMNLP (Findings)_.
  * Pan et al. (2020) Yingwei Pan, Ting Yao, Yehao Li, and Tao Mei. 2020.  X-linear attention networks for image captioning.  In _CVPR_.
  * Papineni et al. (2002) Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002.  BLEU: a Method for automatic evaluation of machine translation.  In _ACL_.
  * Pei et al. (2019) Wenjie Pei, Jiyuan Zhang, Xiangrong Wang, Lei Ke, Xiaoyong Shen, and Yu-Wing Tai. 2019.  Memory-attended recurrent network for video captioning.  In _CVPR_.
  * Radford et al. (2021) Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. 2021.  Learning transferable visual models from natural language supervision.  _arXiv preprint arXiv:2103.00020_.
  * Rennie et al. (2017) Steven J. Rennie, Etienne Marcheret, Youssef Mroueh, Jarret Ross, and Vaibhava Goel. 2017.  Self-critical sequence training for image captioning.  In _CVPR_.
  * Shin et al. (2016) Hoo-Chang Shin, Kirk Roberts, Le Lu, Dina Demner-Fushman, Jianhua Yao, and Ronald M. Summers. 2016.  Learning to read chest x-rays: Recurrent neural cascade model for automated image annotation.  In _CVPR_.
  * Song et al. (2018) Chunfeng Song, Yan Huang, Wanli Ouyang, and Liang Wang. 2018.  Mask-guided contrastive attention model for person re-identification.  In _CVPR_.
  * Syeda-Mahmood et al. (2020) Tanveer F. Syeda-Mahmood, Ken C. L. Wong, Yaniv Gur, Joy T. Wu, Ashutosh Jadhav, Satyananda Kashyap, Alexandros Karargyris, Anup Pillai, Arjun Sharma, Ali Bin Syed, Orest B. Boyko, and Mehdi Moradi. 2020.  Chest x-ray report generation through fine-grained label learning.  In _MICCAI_.
  * Vaswani et al. (2017) Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017.  Attention is all you need.  In _NIPS_.
  * Venugopalan et al. (2015) Subhashini Venugopalan, Huijuan Xu, Jeff Donahue, Marcus Rohrbach, Raymond J. Mooney, and Kate Saenko. 2015.  Translating videos to natural language using deep recurrent neural networks.  In _HLT-NAACL_.
  * Vinyals et al. (2015) Oriol Vinyals, Alexander Toshev, Samy Bengio, and Dumitru Erhan. 2015.  Show and tell: A neural image caption generator.  In _CVPR_.
  * Wang et al. (2021) Fuyu Wang, Xiaodan Liang, Lin Xu, and Liang Lin. 2021.  Unifying relational sentence generation and retrieval for medical image report composition.  _IEEE Transactions on Cybernetics_.
  * Xu et al. (2015) Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron C. Courville, Ruslan Salakhutdinov, Richard S. Zemel, and Yoshua Bengio. 2015.  Show, attend and tell: Neural image caption generation with visual attention.  In _ICML_.
  * Xue et al. (2018) Yuan Xue, Tao Xu, L. Rodney Long, Zhiyun Xue, Sameer K. Antani, George R. Thoma, and Xiaolei Huang. 2018.  Multimodal recurrent model with attention for automated radiology report generation.  In _MICCAI_.
  * Yang et al. (2020) Shaokang Yang, Jianwei Niu, Jiyan Wu, and Xuefeng Liu. 2020.  Automatic medical image report generation with multi-view and multi-modal attention mechanism.  In _ICA3PP_.
  * Yin et al. (2019) Changchang Yin, Buyue Qian, Jishang Wei, Xiaoyu Li, Xianli Zhang, Yang Li, and Qinghua Zheng. 2019.  Automatic generation of medical imaging diagnostic report with hierarchical recurrent neural network.  In _ICDM_.
  * You et al. (2016) Quanzeng You, Hailin Jin, Zhaowen Wang, Chen Fang, and Jiebo Luo. 2016.  Image captioning with semantic attention.  In _CVPR_.
  * Yuan et al. (2019) Jianbo Yuan, Haofu Liao, Rui Luo, and Jiebo Luo. 2019.  Automatic radiology report generation based on multi-view image fusion and medical concept enrichment.  In _MICCAI_.
  * Zhang et al. (2020a) Yixiao Zhang, Xiaosong Wang, Ziyue Xu, Qihang Yu, Alan L. Yuille, and Daguang Xu. 2020a.  When radiology report generation meets knowledge graph.  In _AAAI_.
  * Zhang et al. (2020b) Yuhao Zhang, Derek Merck, Emily Bao Tsai, Christopher D. Manning, and Curtis Langlotz. 2020b.  Optimizing the factual correctness of a summary: A study of summarizing radiology reports.  In _ACL_.


# Switched Vector Field-based Guidance for General Reference Path Following in
Planar Environment

Subham Basak1 and Satadal Ghosh2 The authors are with the Department of
Aerospace Engineering, Indian Institute of Technology Madras, Chennai-600036,
India<EMAIL_ADDRESS><EMAIL_ADDRESS>
###### Abstract

Reference path following is a key component in the functioning of almost all
engineered autonomous agents. Among several path following guidance methods in
existing literature, vector-field-based guidance approach has got wide
attention because of its simplicity and guarantee of stability under a broad
class of scenarios. However, the usage of same cross-track-error-dependent
structure of desired vector field in most of the existing literature
irrespective of instantaneous cross-track error and course angle of unmanned
vehicle makes it quite restrictive in attaining faster convergence and also
leads to infeasibly high turn rate command for many scenarios. To this end,
this paper presents a novel switched vector field-based guidance for following
a general reference path, in which the structure of the desired vector field
depends on instantaneous cross-track-error and vehicle’s course angle. While
the developed method ensures faster convergence, it also ensures that the
guidance command always stays within a realistic threshold satisfying its
curvature constraint, thus making it more real-life implementable for
autonomous vehicles with kino-dynamic constraints. Theoretical analysis for
convergence of the developed guidance scheme is presented. Possibilities of
undesirable chattering at phase transitions are also eliminated. Numerical
simulation studies are presented to validate the satisfactory performance of
the developed algorithm.

##  I INTRODUCTION

With the steady advances in technologies related to autonomy, unmanned
vehicles (UxVs) have seen large-scale adoption in different civilian and
military applications. Capability of autonomously following pre-defined
reference paths is a key component in most of these scenarios.

In existing literature, path following problem has been addressed in three
broad ways - control theoretic, guidance theoretic and vector field-based
methods [1]. Among control-theoretic methods, linear controllers like
proportional–integral–derivative (PID) [2] and optimal control-based methods
[3], [4] on linearized geometries have been presented for developing path
following control schemes. However, these methods majorly rely on small
deviation from nominal assumption that is valid for sufficiently small heading
error or cross-track error geometries. Lyapunov-based nonlinear controllers
have also been developed in [5], [6] for regulation of path following error.
While these nonlinear control techniques possess guaranteed stability and
reliable tracking, the guidance commands are complicated, model-dependent and
also depend on the magnitude of error [7], which was resolved in differential
geometry-based path following guidance formulations in [7], [8]. However,
their convergence proofs were restricted to constant-curvature planar paths.
On the other hand, guidance-theoretic path following methods are model-
independent, simple and easy to implement. Some of these schemes involve Pure
pursuit (PP) [9], [10], line-of-sight (LOSG) guidance [11], trajectory shaping
guidance [12], combination of PP and LOSG [13]. Apart from these, A
Proportional Navigation (PN)-resembling guidance was devised in [14] for
following a virtual target at a fixed-look-ahead distance on a reference path
(straight line or circular or perturbed path), while another PN-based guidance
was formulated in [15] for following a virtual target at a fixed look-ahead
direction. Apart from these, Dubins curve-based guidance scheme for following
an optimal feasible path in three-dimensional space was presented in [16].
Among all these nonlinear formulations, the look-ahead-based path following
guidance [14] has got popularity because of its simplicity and ease in
application, asymptotic stability and robustness. However, its drawback of
constant look-ahead distance makes it restrictive for realistic path following
applications. To this end, a radius of reference path curvature-dependent
variable look-ahead distance guidance was presented in [17]. The major
limitation of the look-ahead-based guidance schemes is that the initial
position of the UxV needs to be inside the range of specified look-ahead
distance from the reference path, thus necessitating an additional mid-course
guidance law if the initial position is outside of the look-ahead distance.

In this context, Vector field-based methods [18], are gainfully leveraged due
to their low cross-track error and low control effort compared to other
existing path following algorithms [1]. Following this approach, the desired
course angle of the UxV is constructed using a vector field, whose integral
curves asymptotically direct the UxV to the pre-determined reference path.
Stability analysis of the vector field-based path-following method for
reference straight and circular paths was presented in [18], while this method
was extended in [19] to following a general reference path with small straight
line approximation. In [20], a notion of circular attractor Lyapunov function
was defined to generate the vector field for a reference path following.
Distance-based application of irrotational and rotational parts of a vector
field was utilized in [21] for path following in 3-D. A general method for
creating the vector field needed for navigation in n-dimensional space was
presented in [22], singularity problem of which was subsequently addressed in
[23].

However, in most of the vector field-based methods in existing literature, the
field is defined as a function of only cross-track error, thus making the
vector field form same irrespective of the magnitude of cross-track error.
This significantly limits the possibility of enhanced convergence to the
reference path. Moreover, in these formulations, as the cross-track error
approaches to infinity, the commanded desired heading angle approaches to a
constant, which often leads to kino-dynamically infeasible high turn rate
command if the course angle error is very high. Additionally, curvature
constraints play a pivotal role in achieving precise trajectory tracking and
optimizing vehicle performance while taking real-world limitations into
account [24]. To address all these considerations, in this paper, a general
reference path following guidance scheme for planar applications is presented
based on a novel formulation of switched vector field, in which its dependence
on cross-track error facilitates in augmented convergence of the developed
guidance scheme, while its dependence on UAV course ensures that the turn rate
command remains within a kino-dynamically feasible threshold. Stability
analysis for finite time convergence by the developed guidance strategy is
given. Thus, attaining a faster path following while maintaining the guidance
command within feasible threshold value forms the salient feature of the
developed guidance scheme.

The rest of this paper is organized as follows: Section II defines the
problem. Section III introduces different vector fields and develops as well
as analyzes a novel guidance strategy for a following general reference path.
Section III-D delves into the curvature limitations associated with general
reference path following. The proposed guidance law is then validated using
numerical simulations in Section IV. Finally, Section V concludes the overall
guidance algorithm.

##  II Problem Definition

###  II-A Navigation Dynamics

Consider the problem of following a reference path as shown in Fig. 1. The
navigational dynamics of a constant speed UAV flying at a constant altitude
can be stated as,

$\displaystyle\dot{\chi}=V_{g}\cos(\chi);\quad\dot{y}=V_{g}\sin(\chi);\quad\dot{\chi}=\alpha(\chi^{c}-\chi)$
(1)

Here, $\bm{p}=[x,y]^{T}$ denotes the UAV’s position w.r.t. inertial reference
frame $(O-X_{I},Y_{I})$. Its ground speed and course angle are given as
$V_{g}=\sqrt{(V_{a_{x}}+W_{x})^{2}+(V_{a_{y}}+W_{y})^{2}}$ and
$\chi=\tan^{-1}((V_{a_{y}}+W_{y})/(V_{a_{x}}+W_{x}))$, respectively, where
$V_{a}$, $W$ denote the UAV airspeed and wind speed, respectively. Subscripts
$x$ and $y$ denote along $X_{I}$ and $Y_{I}$ directions. Incorporation of
ground speed ($V_{g}$) and course of the UAV ($\chi$) in (1) ensures that the
wind-effect is implicitly factored in [18]. The UAV’s guidance command is
given by the turn rate ($\dot{\chi}$), where $\alpha$ is a positive constant,
and $\chi^{c}$ represents the input course command generated by the guidance
law for the UAV to follow a desired general path with time-efficiency, turn
rate feasibility and path curvature constraint.

Figure 1: General reference path following geometry

###  II-B Definitions Related to Reference Path

In this paper, the closest point on the reference path from the UAV’s current
position $\bm{p}$ is considered as the reference point $(\bm{p}_{ref})$. And,
the distance from $\bm{p}$ to $\bm{p}_{ref}$, represents the cross-track error
$d=\rho\|\bm{d}\|$, where, $\rho=\pm 1$ represents the side of the reference
path the UAV is lying on. For example, in Fig. 1, $\rho=+1$ as the UAV is on
right side of the reference path. The tangent vector to the path at
$\bm{p}_{ref}$ is denoted as $\bm{T}^{p}$, which is perpendicular to $\bm{d}$.
Here,

$\displaystyle\dot{d}=V_{g}\sin(\chi-\chi^{p})$ (2)

and, $\chi^{p}$ is the angle between $\bm{T}^{p}$ and $X_{I}$-axis.

##  III Guidance for General Reference Path Following

In this section, a guidance strategy is formulated for an UAV to follow a
general reference path based on a novel switched vector field-based method
leading to enhanced performance in terms of path following time, while also
satisfying feasible turn rate and path curvature constraints.

###  III-A Vector Field Description

####  III-A1 Dependence of Vector Field on Cross-track Error

The vector field should be such that when the UAV is far away from the desired
path (large $|d|$), the desired course is directed towards the path with a
constant course angle $\chi^{p}-\chi^{\infty}$, and as $|d|$ approaches zero,
the desired course aligns with the desired path. To achieve this, for general
reference path following, the desired vector field is considered as follows.

$\small\chi^{d}(d)=\chi^{p}-\chi^{\infty}({2}/{\pi})\tan^{-1}(k_{i}d^{i})$ (3)

where, $i=2n+1$ and $n$ is an integer, $k_{i}$ is a positive constant that
affects the rate of transition from $\chi^{\infty}$ to $\chi^{p}$ while
guiding the UAV to reach the desired path asymptotically. Note that the vector
field considered in [18], [19] is a special Case of Eq. (3) with $i=1$. When
the UAV is able to follow the vector field accurately, that is
$\chi=\chi^{d}(d)$, from (2),

$\small\frac{d(d)}{dt}=V_{g}\sin(\chi^{d}(d)-\chi^{p})=-V_{g}\sin(\chi^{\infty}\frac{2}{\pi}\tan^{-1}(k_{i}d^{i})).$

Note that for higher value of $i$, when $|d|$ is large, $|\dot{d}|$ is also
higher thus enabling the UAV to come closer to the desired path smoothly at a
faster rate. But, when $|d|$ is very small, say $d$ is within the interval
$(-d_{s},d_{s})$ (shown as $(p_{1},p_{2})$ in Fig. 2(a)), $|\dot{d}|$ is
highest for $i=1$. Then, cross-track error-dependent switching of vector field
could be considered at $d=\rho d_{s}$ to ensure faster convergence. Now, for
$\chi=\chi^{d}$,

$\displaystyle\small\frac{d\chi^{d}(d)}{dt}=$
$\displaystyle\dot{\chi^{p}}-\chi^{\infty}\frac{2}{\pi}\frac{ik_{i}d^{i-1}}{1+(k_{i}d^{i})^{2}}V_{g}\sin(\chi^{\infty}\frac{2}{\pi}\tan^{-1}(k_{i}d^{i})).$

Here, as $i$ increases, $|\dot{\chi}^{d}(d)-\dot{\chi^{p}}|$ also increases
for large $|d|$, which in turn demands high turn rate of the UAV. This is
illustrated in Fig. 2(b). For $i>3$, turn rate command becomes excessively
high, which is often infeasible (see $p_{3}$, $p_{4}$, $p_{5}$ and
$p^{{}^{\prime}}_{3}$, $p^{{}^{\prime}}_{4}$, $p^{{}^{\prime}}_{5}$ points in
Fig. 2(b)).

(a) $|\dot{d}|$ vs $d$

(b) $|\dot{\chi}^{d}(d)-\dot{\chi^{p}}|$ vs $d$

Figure 2: Variation of $|\dot{d}|$ and $|\dot{\chi}^{d}(d)-\dot{\chi^{p}}|$,
for $i=1,3,5,7,9$.

Thus, to mitigate these issues while also deriving the advantage of both the
formulations of $\chi^{d}(d)$ with $i=1$ and $i=3$, a switching mechanism is
considered in the vector field formulation based on whether $|d|$ is greater
or less than $d_{s}$, which ensures the UAV to converge with the desired path
smoothly at a faster convergence rate without requiring infeasibly high turn
rate. Thus, $i=3$ is considered for $|d|\geq d_{s}$, and $i=1$, else. In order
to attain a continuous profile of $\chi^{d}(d)$, the convergence rate
controlling parameters $k_{1}$ and $k_{3}$ are so chosen that at $d=\rho
d_{s}$, the $\chi^{d}(d)$ is same for both $i=1$ and $i=3$. This implies that
$d_{s}=\sqrt{{k_{1}}/{k_{3}}}$. Thus, the switched vector field based on
cross-track error is expressed in terms of the desired UAV course as,

$\chi^{d}(d)=\begin{cases}\chi^{p}-\chi^{\infty}({2}/{\pi})\tan^{-1}(k_{3}d^{3})&\text{if
$|d|>d_{s}$}\\\ \chi^{p}-\chi^{\infty}({2}/{\pi})\tan^{-1}(k_{1}d)&\text{if
$|d|\leq d_{s}$}\end{cases}$ (4)

Note that following (4), $\chi^{d}(d)$ approaches to $\chi^{p}-\chi^{\infty}$
and $\chi^{p}$ as $d$ approaches $\infty$ and zero, respectively.

####  III-A2 Dependence on Instantaneous UAV Course Angle ($\chi$)

When $|\chi-\chi^{d}(d)|$ is very high, as illustrated in Fig. 3, then the
generated guidance command also becomes very high. This problem becomes more
severe when $|d|>d_{s}$ as more aggressive turn rate command is generated by
using the formulation of $\chi^{d}(d)$ with $i=3$ than that with $i=1$. In
order to get rid of this problem, $\chi$ also needs to be incorporated in the
formulation of $\chi^{d}(d)$. Hence, the switched vector field, based on
current course angle becomes,

$\small\chi^{d}(d,\chi)=\begin{cases}\chi^{d}(d)+\rho\frac{\pi}{2},&\text{if
}|d|>d_{s},|\chi-\chi^{d}(d)|>\frac{\pi}{2}\\\
\chi^{d}(d)&\text{else}\end{cases}$ (5)

where, $\chi^{d}(d)$ is as given in (4). Note from Fig. 3 that the selection
of $\chi^{d}(d,\chi)$ in (5) above leads to less turn rate command than
$\chi^{d}(d)$ in (4) by decreasing $|\chi-\chi^{d}(d,\chi)|$ for
$|\chi-\chi^{d}(d)|>{\pi}/{2}$. This, in effect, helps in ensuring that the
commanded turn rate is within the upper threshold that arises from kino-
dynamic constraints of a real unmanned vehicle.

Figure 3: Course angle based vector field for $\chi^{p}=0$

###  III-B Overall Guidance Strategy

Based on the discussion in Section III-A, the overall structure of the novel
switched vector field is presented in terms of desired course angle expressed
as a function of both cross-track error and course angle of the UAV as,

$\displaystyle\chi^{d}(d,\chi)=$
$\displaystyle\small\begin{split}\chi^{d}(d)+\rho\frac{\pi}{2}=\chi^{p}-\chi^{\infty}\frac{2}{\pi}\tan^{-1}(k_{3}d^{3})+\\\
\rho{\pi}/{2},\quad\text{if
}|d|>d_{s},|\chi-\chi^{d}(d)|>{\pi}/{2};\end{split}$ (6)
$\displaystyle\chi^{d}(d,\chi)=$
$\displaystyle\small\begin{split}\chi^{d}(d)=\chi^{p}-\chi^{\infty}\frac{2}{\pi}\tan^{-1}(k_{3}d^{3}),\\\
\text{if }|d|>d_{s},|\chi-\chi^{d}(d)|\leq{\pi}/{2};\end{split}$ (7)
$\displaystyle\chi^{d}(d,\chi)=$
$\displaystyle\small\begin{split}\chi^{d}(d)=\chi^{p}-\chi^{\infty}\frac{2}{\pi}\tan^{-1}(k_{1}d),\text{if
}|d|\leq d_{s}.\end{split}$ (8)

This desired vector field can be followed using the guidance command in (1),
where the commanded UAV course $\chi^{c}$ is:

$\displaystyle{\chi^{c}=}$
$\displaystyle\small\begin{split}\chi+\frac{\dot{\chi^{p}}}{\alpha}-\frac{1}{\alpha}\chi^{\infty}\frac{2}{\pi}\frac{3k_{3}d^{2}}{1+(k_{3}d^{3})^{2}}V_{g}\sin(\chi-\chi^{p})\\\
-\rho\frac{\eta}{\alpha}(|\tilde{\chi}|)^{n/m},\quad\text{if
}|d|>d_{s},|\chi-\chi^{d}(d)|>\frac{\pi}{2};\end{split}$ (9)
$\displaystyle{\chi^{c}=}$
$\displaystyle\small\begin{split}\chi+\frac{\dot{\chi^{p}}}{\alpha}-\frac{1}{\alpha}\chi^{\infty}\frac{2}{\pi}\frac{3k_{3}d^{2}}{1+(k_{3}d^{3})^{2}}V_{g}\sin(\chi-\chi^{p})\\\
-\frac{\beta}{\alpha}\text{sign}({\tilde{\chi}}),\quad\text{if
}|d|>d_{s},|\chi-\chi^{d}(d)|\leq\frac{\pi}{2};\end{split}$ (10)
$\displaystyle{\chi^{c}=}$
$\displaystyle\small\begin{split}\chi+\frac{\dot{\chi^{p}}}{\alpha}-\frac{1}{\alpha}\chi^{\infty}\frac{2}{\pi}\frac{k_{1}}{1+(k_{1}d)^{2}}V_{g}\sin(\chi-\chi^{p})\\\
-\frac{\beta}{\alpha}\text{sign}({\tilde{\chi}}),\quad\text{if }|d|\leq
d_{s}.\end{split}$ (11)

where, $\tilde{\chi}\triangleq\chi-\chi^{d}(d,\chi)$. And, m, n are odd and
co-prime integers such that $0<n<m$. And,
$\beta={\sigma}/({1+|\tilde{\chi}|})$, where $\sigma>0$. Here, $\beta$ and
$\eta$ ($>0$) control the shape of the trajectories onto the sliding surface
$\tilde{\chi}=0$.

###  III-C Convergence Analysis

Consider $\chi^{\infty}=\pi/2$ and the scenario $d>0$. The convergence
analysis for the path following engagement geometries mentioned in (9)-(11) is
given below. The analysis for $d<0$ scenario would follow in similar way.

####  III-C1 Case - 1 $(|d|>d_{s}$ and $|\chi-\chi^{d}(d)|>({\pi}/{2}))$

In this Case, the desired vector field in terms of $\chi^{d}(d,\chi)$ is as
given in (6), and the commanded course angle $\chi^{c}$ as mentioned in (9).
For this geometry, the course error $\tilde{\chi}=\chi-\chi^{d}(d,\chi)$ is
guaranteed to decrease to zero in finite time as proved below.

###### Proposition 1

When $|d|>d_{s}$ and $|\chi-\chi^{d}(d)|>({\pi}/{2})$, where
$\chi^{d}(d,\chi)=\chi^{d}(d)+{\pi}/{2}$ as given in (6), applying $\chi^{c}$
command as given in (9) brings $\tilde{\chi}$ to zero in finite time.

###### Proof:

Following $\dot{\chi}$ from (1) and considering a Lyapunov candidate function
$W_{1}=\tilde{\chi}^{2}/2$.

$\small\dot{W_{1}}=\tilde{\chi}\dot{\tilde{\chi}}=\tilde{\chi}(\alpha(\chi^{c}-\chi)-\dot{\chi}^{d}(d,\chi))$
(12)

Considering $\chi^{d}(d,\chi)$ as in (6) for Case - 1, we obtain,

$\small\dot{\chi}^{d}(d,\chi)=\dot{\chi^{p}}-\chi^{\infty}\frac{2}{\pi}\frac{3k_{3}d^{2}}{1+(k_{3}d^{3})^{2}}V_{g}\sin(\chi-\chi^{p})$
(13)

Then, applying $\chi^{c}$ as in (9), from (12), (13), it follows that, in
Case-1, where $\tilde{\chi}=\chi-\chi^{d}(d,\chi)>0$,

$\small\dot{W_{1}}=-\eta\tilde{\chi}(\tilde{\chi})^{n/m}<0;\quad\dot{\tilde{\chi}}=-\eta(\tilde{\chi})^{n/m}<0$
(14)

Here, for odd and co-prime $n,m$ with $0<n<m$, $\tilde{\chi}^{n/m}$ has one
real solution with same sign as $\tilde{\chi}$, which implies from (14) that
$\tilde{\chi}$ monotonically decreases and converges to zero in finite time
$t_{s}=({m}/(\eta(m-n)))|\tilde{\chi}(0)|^{(m-n)/m}$ [25]. This completes the
proof of Proposition 1. ∎

###### Remark 1

As $\chi^{d}(d)-\chi^{p}\in(-\pi/2,0)$ for $\chi^{\infty}=\pi/2$ (refer to
(4)), and $\chi-\chi^{d}(d)>{\pi}/{2}$ in Case - 1 geometry, we have
$\chi-\chi^{p}\in(\pi/2,\pi)$. Then, from (2),
$\dot{d}=V_{g}\sin(\chi-\chi^{p})>0$ implying that, $|d|$ increases with time
for this geometry. Even at $t=t_{s}$, although
$\chi(t_{s})-\chi^{d}_{t_{s}}(d)={\pi}/{2}$, we obtain
$\chi(t_{s})-\chi^{p}(t_{s})\in(0,\pi/2)$ leading to positive
$\dot{d}(t_{s})$.

####  III-C2 Case - 2 $(|d|\geq d_{s}$ and $|\chi-\chi^{d}(d)|\leq{\pi}/{2})$

Proposition 1 guarantees finite time completion of Case-1 geometry, leading to
Case-2 geometry, for which $\chi^{d}(d,\chi)$ and $\chi^{c}$ are switched to
(7) and (10), respectively. Recall from Remark 1 that $\dot{d}(t_{s})>0$,
therefore, $d$ increases at the time of phase transition from Case - 1 to Case
- 2. However, as $\tilde{\chi}=\chi-\chi^{d}(d,\chi)$ is shown to
monotonically decrease in this case, $\chi$ crosses $\chi^{p}$ at some finite
time, and $|d|$ also decreases then onward.

###### Proposition 2

When $|d|\geq d_{s}$ and $|\chi-\chi^{d}(d)|\leq{\pi}/{2}$, where
$\chi^{d}(d,\chi)=\chi^{d}(d)$ as in (7), applying $\chi^{c}$ command given in
(10) leads $\tilde{\chi}$ converge to zero in finite time.

###### Proof:

Following $\dot{\chi}$ from (1) and considering a Lyapunov candidate function
$W_{2}=\tilde{\chi}^{2}/2$,

$\small\dot{W_{2}}=\tilde{\chi}\dot{\tilde{\chi}}=\tilde{\chi}(\alpha(\chi^{c}-\chi)-\dot{\chi}^{d}(d))$
(15)

From (7), for Case - 2 geometry we obtain,

$\small\dot{\chi}^{d}(d,\chi)=\dot{\chi^{p}}-\chi^{\infty}\frac{2}{\pi}\frac{3k_{3}d^{2}}{1+(k_{3}d^{3})^{2}}V_{g}\sin(\chi-\chi^{p})$
(16)

Then, applying the commanded course $\chi^{c}$ as presented in (10), it
follows from (15) and (16) that for Case-2,

$\small\dot{W_{2}}=-\beta\tilde{\chi}\text{sign}({\tilde{\chi}})<0\implies\dot{W_{2}}\leq-{\beta}|\sqrt{W_{2}}|.$
(17)

Therefore, it is evident that $|\tilde{\chi}|$ monotonically decreases and
finally converges to zero in finite time [26]. ∎

However, in practice, the $\text{sign}(.)$ function in (10) leads to
chattering in the control output [26]. To mitigate this, the $\text{sign}(.)$
function can be replaced with $\text{sat}(.)$ function. Therefore, the updated
command is given as

$\chi^{c}=\chi+\frac{\dot{\chi^{p}}}{\alpha}-\frac{1}{\alpha}\chi^{\infty}\frac{2}{\pi}\frac{3k_{3}d^{2}}{1+(k_{3}d^{3})^{2}}V_{g}\sin(\chi-\chi^{p})\\\
-\frac{\beta}{\alpha}\text{sat}(\frac{\tilde{\chi}}{\epsilon}),$ (18)

where, $\text{sat}(x)$ is defined as $\text{sat}(x)=x$ if $|x|\leq 1$, and
$\text{sat}(x)=\text{sign}(x)$, else. And, $\epsilon>0$ sets the boundary
region width around the sliding surface to reduce chattering in $\dot{\chi}$.

###### Remark 2

Even if Case-2 is initiated with $\chi-\chi^{p}\in(0,\pi/2)$, as
$\tilde{\chi}$ monotonically decreases to zero in finite time, as shown in
Proposition 2, and as $\chi^{d}(d)-\chi^{p}\in(-\pi/2,0)$ for
$\chi^{\infty}=\pi/2$ (refer to (4)), $\chi-\chi^{p}$ also lies in the
interval $(-\pi/2,0)$ as $\chi\to\chi^{d}(d)$. Besides, as $\dot{\chi}$ is
continuous within the time interval the geometry lies in Case - 2, by
intermediate value theorem, $\chi-\chi^{p}$ is guaranteed to cross zero in a
finite time. And, that time onward, $\dot{d}=V_{g}\sin(\chi-\chi^{p})<0$
implying monotonically decreasing $|d|$.

###### Remark 3

From (14), $\dot{\tilde{\chi}}=0$ at $t=t_{s}$ as $\tilde{\chi}(t_{s})=0$ for
$\tilde{\chi}=\chi-\chi^{d}(d,\chi)$ in Case - 1. Hence, if the switching of
vector field at the transition from Case - 1 to Case - 2 takes place at
$t=t_{s}$, there is a possibility of undesirable chattering at the transition.
To avoid that, this switching may be done at $t=t_{s}-\epsilon_{t}$ for some
small positive $\epsilon_{t}$, when $|\chi-\chi^{d}|=(\pi/2)+\Delta$ for some
small positive $\Delta$. Note that since $\dot{d}$ and $\dot{\tilde{\chi}}$
remain positive and negative, respectively, both at $t=t_{s}-\epsilon_{t}$
(follows Case - 1) and at the beginning of Case - 2 geometry after the
transition, the switching at $t=t_{s}-\epsilon_{t}$ would maintain the same
convergence pattern, while also ensuring no undesired chattering during the
switching of vector field between Case -1 and Case - 2 geometries.

###### Proposition 3

When $|d|\geq d_{s}$ and $|\chi-\chi^{d}(d)|\leq{\pi}/{2}$, where
$\chi^{d}(d,\chi)=\chi^{d}(d)$ as given in (7), applying $\chi^{c}$ as given
in (10) as $\chi$ converges to $\chi^{d}(d)$, $|d|$ is guaranteed to
monotonically decrease and reach $d_{s}$ in finite time.

###### Proof:

Define a Lyapunov candidate function $W_{3}=d^{2}/2$. As $\chi$ converges to
$\chi^{d}(d)$ (by Proposition 2), from (2),

$\small\dot{W_{3}}=d\dot{d}=-V_{g}d\sin(\chi^{\infty}({2}/{\pi})\tan^{-1}(k_{3}d^{3}))$
(19)

Here, $\dot{W_{3}}<0$, and $\dot{d}\leq-
V_{g}\sin(\chi^{\infty}\frac{2}{\pi}\tan^{-1}(k_{3}d_{s}^{3}))<0$ for
$|d|>d_{s}\neq 0$. This leads to finite time convergence of $|d|$ to $d_{s}$.
Thus, the proposition holds. ∎

####  III-C3 Case - 3 $(|d|<d_{s}$)

Propositions 1, 2 and 3, guaranteed the path following guidance switches to
this Case within finite time. Consequently, $\chi^{d}(d,\chi)$ and $\chi^{c}$
are switched to (8) and (11), respectively. Following the same steps as in
Case - 2 in Section III-C2, the following result can be shown.

###### Proposition 4

When $|d|<d_{s}$, where $\chi^{d}(d,\chi)=\chi^{d}(d)$ as given in (8),
applying $\chi^{c}$ command as given in (11) leads
$\tilde{\chi}=\chi-\chi^{d}(d,\chi)$ converge to zero in finite time, and as a
consequence, $d$ converges to zero asymptotically.

###### Remark 4

The transition from Case - 2 to Case -3 takes place at $d=d_{s}\neq 0$. Also,
both at the end of Case - 2 and at the beginning of Case -3 geometries, both
$\dot{d}$ and $\dot{\tilde{\chi}}$ are negative. These eliminate the
possibility of chattering and any degradation of convergence performance
during the switching of vector field from Case -2 to Case - 3.

####  III-C4 Final Result

###### Theorem 1

Starting from any $\chi$ and $d$, the overall vector field given by (6),(7),
(8), and the respective guidance command represented by (9),(10), and (11),
guarantee that the UAV is able to follow the desired general reference path
asymptotically and reaches its close vicinity in finite time.

###### Proof:

From Propositions 1 \- 4 and selecting $d_{s}=\sqrt{{k_{1}}/{k_{3}}}$ suitably
by tuning control parameters $k_{1}$ and $k_{3}$ in (4), this result follows
in a straight-forward way. ∎

###  III-D Curvature Constraints

Convergence analysis in Section III-C shows that convergence rate of $\chi$ to
$\chi^{d}(d,\chi)$ depends on $\eta$, $\beta$ and $k_{i}$ (for $i=1,3$), as
indicated by (14), (17) and (19), respectively. These parameters also affect
the curvature of the UAV’s path as may be noted from (1), (9)-(11).
Accordingly, this section outlines conditions on these parameters to ensure
kino-dynamic feasibility of the UAV’s commanded path. For that, considering
$\chi=\chi^{d}(d,\chi)$, the curvature variation is:

$\small\kappa={d\chi}/{ds}={d\chi^{d}(d,\chi)}/{ds}={(d\chi^{d}(d,\chi)/dt)}/{(ds/dt)}.$
(20)

For $|d|\leq d_{s}$, using $\chi^{d}(d,\chi)$ from (8) and
$\chi^{\infty}={\pi}/{2}$,

$\small{d\chi^{d}(d,\chi)}/{dt}-\dot{\chi^{p}}={k_{1}^{2}V_{g}d}/{\left(1+(k_{1}d)^{2}\right)^{{3}/{2}}}$
(21)

Note that $\dot{\chi^{p}}$ does not have dependence on $|d|$. Thus, the
condition for maximum value of $\dot{\chi^{d}}(d,\chi)$ is:

$\small\nabla_{d}\dot{\chi}^{d}(d)={k_{1}^{2}V_{g}\cdot\left(1-2k_{1}^{2}d^{2}\right)}/{\left(k_{1}^{2}d^{2}+1\right)^{{5}/{2}}}=0$
(22)

From (22), for $|d|\leq d_{s}$, we obtain that
$|\dot{\chi^{d}}(d,\chi)-\dot{\chi^{p}}|_{max}=({2}/{3\sqrt{3}})k_{1}V_{g}$ at
$|d|={1}/({\sqrt{2}\,k_{1}})$. Similarly, recall that for $|d|>d_{s}$, $i=3$,
and $\chi^{d}(d,\chi)$ is given in (6) and (7). Then, at
$|d|={\sqrt[6]{5}}/({\sqrt[3]{2}\sqrt[3]{k_{3}}})$,
$|\dot{\chi^{d}}(d,\chi)-\dot{\chi^{p}}|_{max}=({2^{{4}/{3}}{\cdot}5^{{5}/{6}}V_{\text{g}}\sqrt[3]{k_{3}}})/{9}$.
Now, for $\chi=\chi^{d}(d,\chi)$, from (20),

$\small({|\dot{\chi^{d}}(d,\chi)|_{max}})/{V_{g}}=\kappa_{max}$ (23)

where, $\kappa_{max}$ is the maximum allowable curvature in the UAV’s path.
Then, from (23),

$\displaystyle\small{|\dot{\chi^{d}}(d,\chi)-\dot{\chi^{p}}|_{max}}\leq{|\dot{\chi^{p}}|_{max}}+{|\dot{\chi^{d}}(d,\chi)|_{max}}$
$\displaystyle\implies{|\dot{\chi^{d}}(d,\chi)-\dot{\chi^{p}}|_{max}}-{|\dot{\chi^{p}}|_{max}}\leq
V_{g}\kappa_{max}.$ (24)

As, $|\dot{\chi^{d}}(d,\chi)-\dot{\chi^{p}}|_{max}$ dependent on the $V_{g}$,
$k_{1}$ and $k_{3}$ as discussed above, (24) can be rewritten as,

$\small\max\left\\{{2k_{1}}/({3\sqrt{3}}),({2^{\frac{4}{3}}{\cdot}5^{\frac{5}{6}}\sqrt[3]{k_{3}}})/{9}\right\\}-{|\dot{\chi^{p}}|_{max}}/{V_{g}}\leq\kappa_{max}$
(25)

Thus, for given $\kappa_{max}$ (UAV’s turn rate constraint),
$|\dot{\chi^{p}}|_{max}$ (maximum path curvature) and $V_{g}$ (UAV speed), the
overall switched vector field ((6)-(8)) can be designed by suitably selecting
$k_{1}$ and $k_{3}$ that satisfies (25). This can be followed by the commanded
course angles ((9)-(11)) with suitable selection of $\eta$ and $\beta$
satisfying the $\kappa_{max}$ constraint for effectively following a general
reference path without any undesirable chattering at phase transitions, as
explained in Theorem 1, Remarks 3 and 4.

##  IV Simulation Results

(a) UAV trajectory

(b) Desired vector field and $\dot{\chi}$

(c) $|\tilde{\chi}|$ profile

(d) Cross-track error magnitude

Figure 4: Illustration of path following by the proposed switched vector
field-based guidance.

In this section, the path following guidance strategy presented in Section
III-B is validated using numerical simulations performed in MATLAB (R2023a)
environment. The parameters considered for the simulations are as follow.
Constant UAV speed ($V_{a}$) of $15$ m/s is considered for all scenarios. And,
$\chi^{\infty}=\pi/2$, $\alpha=1.65$ s-1, $\gamma=0.8$, $\eta=\pi/4$ rad,
$n=3$, $m=5$, $d_{s}=10$ m, $k_{1}=0.01$, $k_{3}=k_{1}/{d_{s}}^{2}=10^{-4}$.
In practice, $\dot{\chi^{p}}$ can be approximated using tangents to the path
as $\dot{\chi^{p}}\approx(\chi^{p}-\chi^{p}_{old})/dt$, where $\chi^{p}_{old}$
is the tangent to the path in the previous time step.

(a) UAV trajectories

(b) Turn rate command

Figure 5: Illustration of path following by the proposed method, vector
field[18], PLOS[13] and NLGL ($L_{1}$) [14] Figure 6: Comparison of path
following by the (a) proposed switched vector field, (b) vector field[18], (c)
PLOS[13] and (d) NLGL($L_{1}$) [14] under random initial condition by Box-plot
representation of $t_{conv}$, $d_{rms}$, $\dot{\chi}_{rms}$, and
max($|\dot{\chi}|$).

Fig. 4 illustrates a numerical example of following a reference sinusoidal
path ($y=r\sin(x)$, where $r=300$ and $x\in[0,2\pi]$) with no wind
consideration, that is $V_{g}=V_{a}$, for better understanding of the
convergence analysis given above. As can be seen in Fig. 4(a), initially
$d<d_{s}$ and also $|\chi-\chi^{d}(d)|>\pi/2$, i.e. the geometry is in Case -
1. As stated in Remark 1, $|d|$ increases initially as shown in Fig. 4(d).
However, from Fig. 4(c), observe that
$|\tilde{\chi}|=|\chi-(\chi^{d}(d)+\pi/2)|$ monotonically decreases as
discussed in proposition 1. As it reaches near zero, the 1st switching happens
as shown as Switch 1 in Fig. 4. At Switch 1, following Case - 2 geometry, the
vector field has $\tilde{\chi}=\chi-\chi^{d}(d)$, which leads to a jump in
$\tilde{\chi}$ profile (see Fig. 4(c)). Then, in line with Proposition 2 for
Case - 2 geometry, $|\tilde{\chi}|$ monotonically decreases. After the
transition from Case - 1 to Case - 2, initially $\dot{|d|}$ is still greater
than zero. As a result, $|d|$ increases initially in Case - 2 geometry.
However, as $\chi$ crosses $\chi^{p}$, then $|d|$ starts decreasing (see Fig.
4(d)) as per Remark 2. As $|d|$ crosses $d_{s}$ in finite time (Proposition
3), Switch 2 happens, and the geometry falls in Case - 3, wherein following
Proposition 4, $\tilde{\chi}$ and $|d|$ monotonically decrease. Besides, as
mentioned in Remarks 3 and 4, no undesirable chattering is observed at the
phase transitions. Now, from $\dot{\chi}$ profile in Fig. 4(b),
$|\dot{\chi}|_{max}=0.7$ rad/sec, which is within kino-dynamically feasible
range. This leads to RHS of (25) as
$\kappa_{max}=|\dot{\chi}|_{max}/V_{a}=0.046$ /m. And for the considered
reference path, $|\dot{\chi^{p}}|_{max}=0.1$ rad/sec. Therefore, LHS of (25)
becomes $0.036$, which satisfies (25).

The developed guidance algorithm (a) is now compared with (b) vector field
method [18], (c) PLOS mehtod [13], and (d) NLGL ($L_{1}$) method [14], with
parameters fine tuned for better performance as follows. For method (b)
$k=0.02$ and $\beta=\pi/2$, for (c) $K_{1}=15$ and $K_{2}=0.1$, and for (d)
$L_{1}=110$ m. The initial conditions considered are $|d_{0}|=200$ m (for (a),
(b) and (c)), and $|d_{0}|=80$ m(for (d)) and $\chi_{0}=-\pi/4$ (for all
methods). From Figs. 5(a) and 5(b), note that Methods (b) and (c) closely
follow the path, but initial turn rate command is very high for method (c),
and the convergence time for method (b) is high. On the other hand, method (d)
has always higher cross-track error. Unlike them, the proposed switched vector
field method allows the UAV to closely follow the path with feasible turn rate
and low convergence time.

Total 200 random trials are next performed with
$d_{0}\sim\mathcal{U}[100,200]$ m, $\chi_{0}\sim\mathcal{U}[-\pi,\pi]$ rad,
wind speed $,|W|\sim\mathcal{U}[2,3]$ m/s, wind direction
$\sim\mathcal{U}[-2,-2.5]$ rad and control parameters same as previous
simulations. The performance measures are: i) Reaching time ($t_{conv}$), ii)
RMS cross track error($d_{rms}$), iii)RMS turn rate, $\dot{\chi}_{rms}$ and
iv) maximum turn rate, max($|\dot{\chi}|$), as shown in Fig. 6. Here,
$t_{conv}$ is defined as the duration by which the UAV reaches a threshold
distance relative to the reference path, while subsequently following a course
angle sufficiently close to path’s curvature. While the NLGL method [14]
exhibits low $\dot{\chi}_{rms}$, its $d_{rms}$ and $t_{conv}$ are
comparatively higher when compared to other methods. For PLOS method [13],
$d_{rms}$ is lower, but it has higher $\dot{\chi}_{rms}$, $|\dot{\chi}|_{max}$
and $t_{conv}$. Although the $d_{rms}$ is almost similar for proposed
switching vector field-based and the basic Vector field method [18], it is
evident that the switched vector field-based approach significantly
outperforms path-following methods in terms of all performance measures.

##  V CONCLUSIONS

This paper has presented a cross-track-error and course angle-dependent novel
switching strategy in defining the desired vector field for following a
general reference path. Theoretical analysis on its convergence has been
presented. The developed guidance scheme has been shown to ensure faster
convergence, thus leading to a lesser reaching time, while it also ensures
that the guidance command does not go beyond a threshold even when the course
angle error is very high. Undesirable chattering at phase transitions is also
avoided. Numerical simulation studies have been presented to justify the
performance of the developed guidance algorithm. Comparison studies have shown
the superiority of the presented method over other existing methods.

## References

  * [1] P. Sujit, S. Saripalli, and J. B. Sousa, “Unmanned aerial vehicle path following: A survey and analysis of algorithms for fixed-wing unmanned aerial vehicless,” _IEEE Control Syst. Magazine_ , vol. 34, no. 1, pp. 42–59, 2014.
  * [2] I. Rhee, S. Park, and C.-K. Ryoo, “A tight path following algorithm of an uas based on pid control,” in _Proc. SICE Annual Conf. 2010_ , 2010, pp. 1270–1273.
  * [3] A. Ratnoo, P. Sujit, and M. Kothari, “Adaptive optimal path following for high wind flights,” _IFAC Proc. Vol._ , vol. 44, no. 1, pp. 12 985–12 990, 2011.
  * [4] S. He, C.-H. Lee, H.-S. Shin, and A. Tsourdos, “Minimum-effort waypoint-following guidance,” _J. Guid. Control Dyn._ , vol. 42, no. 7, pp. 1551–1561, 2019.
  * [5] C. Liu, O. McAree, and W.-H. Chen, “Path-following control for small fixed-wing unmanned aerial vehicles under wind disturbances,” _Int. J. Robust Nonlinear Control_ , vol. 23, no. 15, pp. 1682–1698, 2013.
  * [6] G. Flores, I. Lugo-Cárdenas, and R. Lozano, “A nonlinear path-following strategy for a fixed-wing mav,” in _Int. Conf. Unmanned Aircr. Syst._ IEEE, 2013, pp. 1014–1021.
  * [7] N. Cho, Y. Kim, and S. Park, “Three-dimensional nonlinear differential geometric path-following guidance law,” _J. Guid. Control Dyn._ , vol. 38, no. 12, pp. 2366–2385, 2015.
  * [8] D. J. Gates, “Nonlinear path following method,” _J. Guid. Control Dyn._ , vol. 33, no. 2, pp. 321–332, 2010.
  * [9] E. D. Medagoda and P. W. Gibbens, “Synthetic-waypoint guidance algorithm for following a desired flight trajectory,” _J. Guid. Control Dyn._ , vol. 33, no. 2, pp. 601–606, 2010.
  * [10] J. Zhang, Q. Li, N. Cheng, and B. Liang, “Path-following control for fixed-wing unmanned aerial vehicles based on a virtual target,” _Proc. Inst. Mech. Eng. G: J. Aerosp. Eng._ , vol. 228, no. 1, pp. 66–76, 2014.
  * [11] R. Rysdyk, “Unmanned aerial vehicle path following for target observation in wind,” _J. Guid. Control Dyn._ , vol. 29, no. 5, pp. 1092–1100, 2006.
  * [12] A. Ratnoo, S. Y. Hayoun, A. Granot, and T. Shima, “Path following using trajectory shaping guidance,” _J. Guid. Control Dyn._ , vol. 38, no. 1, pp. 106–116, 2015.
  * [13] M. Kothari, I. Postlethwaite, and D.-W. Gu, “Uav path following in windy urban environments,” _J. Intell. Robot. Syst_ , vol. 74, no. 3, pp. 1013–1028, 2014.
  * [14] S. Park, J. Deyst, and J. P. How, “Performance and lyapunov stability of a nonlinear path following guidance method,” _J. Guid. Control Dyn._ , vol. 30, no. 6, pp. 1718–1728, 2007.
  * [15] N. Dhananjay and R. Kristiansen, “Guidance strategy for gradient search by multiple uavs,” in _AIAA Guid. Navig. Control Conf._ , 2012, p. 4766.
  * [16] S. Hota and D. Ghose, “Rectilinear path following in 3d space,” in _Trends in Intelligent Robotics: FIRA Robot World Congress_. Springer, 2010, pp. 210–217.
  * [17] R. Saurav, L. D. Sohil, and S. Ghosh, “Variable l1 guidance strategy for path following of uavs,” in _Int. Conf. Unmanned Aircr. Syst._ , 2020, pp. 1518–1524.
  * [18] D. R. Nelson, D. B. Barber, T. W. McLain, and R. W. Beard, “Vector field path following for miniature air vehicles,” _IEEE Trans. Robot._ , vol. 23, no. 3, pp. 519–529, 2007.
  * [19] S. Griffiths, “Vector field approach for curved path following for miniature aerial vehicles,” in _AIAA Guid. Navig. Control Conf._ , 2006, p. 6467.
  * [20] D. A. Lawrence, E. W. Frew, and W. J. Pisano, “Lyapunov vector fields for autonomous unmanned aircraft flight control,” _J. Guid. Control Dyn._ , vol. 31, no. 5, pp. 1220–1229, 2008.
  * [21] Y. Liang and Y. Jia, “Combined vector field approach for 2d and 3d arbitrary twice differentiable curved path following with constrained uavs,” _J. Intell. Robot. Syst_ , vol. 83, no. 1, pp. 133–160, 2016.
  * [22] V. M. Goncalves, L. C. Pimenta, C. A. Maia, B. C. Dutra, and G. A. Pereira, “Vector fields for robot navigation along time-varying curves in $n$-dimensions,” _IEEE Trans. Robot._ , vol. 26, no. 4, pp. 647–659, 2010.
  * [23] W. Yao, H. G. de Marina, B. Lin, and M. Cao, “Singularity-free guiding vector field for robot navigation,” _IEEE Trans. Robot._ , vol. 37, no. 4, pp. 1206–1221, 2021.
  * [24] A. Shivam and A. Ratnoo, “Arcsine vector field for path following guidance,” _J. Guid. Control Dyn._ , pp. 1–12, 2023.
  * [25] X. Yu, Y. Wu, and M. Zhihong, “On global stabilization of nonlinear dynamical systems,” _Variable structure systems, sliding mode and nonlinear control_ , pp. 109–122, 1999.
  * [26] Y. Shtessel, C. Edwards, L. Fridman, A. Levant _et al._ , _Sliding mode control and observation_. Springer, 2014, vol. 10.