# Mapping of Land Use and Land Cover (LULC) using EuroSAT and Transfer
Learning

Suman Kunwar
Faculty of Computer Science
Selinus University of Sciences and Literature
Ragusa, Italy
<EMAIL_ADDRESS>
Jannatul Ferdush
Deparment of Computer Science and Engineering
Jashore University of Science and Technology
Jashore, Bangladesh
<EMAIL_ADDRESS>

###### Abstract

As the global population continues to expand, the demand for natural resources
increases. Unfortunately, human activities account for $23$% of greenhouse gas
emissions. On a positive note, remote sensing technologies have emerged as a
valuable tool in managing our environment. These technologies allow us to
monitor land use, plan urban areas, and drive advancements in areas such as
agriculture, climate change mitigation, disaster recovery, and environmental
monitoring. Recent advances in AI, computer vision, and earth observation data
have enabled unprecedented accuracy in land use mapping. By using transfer
learning and fine-tuning with RGB bands, we achieved an impressive $99.19$%
accuracy in land use analysis. Such findings can be used to inform
conservation and urban planning policies.

##  1 Introduction

The world population has increased significantly over the last few centuries
and is projected to continue growing [1]. With growing demand, human beings
are consuming more natural resources, including water, energy, minerals, and
agricultural products. Activities such as agriculture, forestry, and
urbanization contribute to $23$% of global greenhouse gas emissions [2],
primarily due to deforestation and land degradation. Monitoring land use
changes is vital for better environmental management, urban planning, and
nature protection [3, 4].

With advancements in remote sensing technologies, satellite image data are now
either freely available or can be commercially acquired, promoting innovation
and entrepreneurship. Thanks to the use of low orbit and geostationary
satellites [5], we can observe the Earth with unprecedented detail. Moreover,
improvements in remote sensing technology have resulted in better spatial
resolution [6], enabling more precise ground surface analyses. Such data
access has fueled advancements in agriculture, urban development, climate
change mitigation, disaster recovery, and environmental monitoring [7, 8, 9].
Advances in computer vision, AI, and earth observation data facilitate large-
scale land use mapping [10, 11]. The community has extensively embraced
methods for classifying land use and land cover (LULC), including machine
learning [12] and deep learning (DL) [13]. Recent studies suggest that DL
techniques demonstrate remarkable performance in remote sensing (RS) image
scene classification [14]. The objective of image scene classification and
retrieval is to automatically allocate class labels to every RS image scene
stored in an archive. This differs from semantic segmentation tasks used for
LULC mapping and classification.

One application of this technology is scene classification [15], which
involves labeling an image based on specific semantic categories. This
approach has numerous practical uses, including LULC analysis as well as land
resource management [16, 17].

Figure 1: Mapping of LULC using satellite images

Figure 1 provides an overview of the LULC classification process using
satellite images. Satellites capture images of the Earth. These images are
then utilized to extract patches for classification. The objective is to
automatically label the physical type of land or its utilization. Each image
patch is fed into a classifier, which then outputs the corresponding class
depicted on the patch.

However, DL models tend to overfit and demand large quantities of labeled
input data to perform well on unseen data [18]. This limitation has restricted
their adoption in geosciences and remote sensing. Leveraging pre-trained
models from optical datasets, such as ImageNet [19], can facilitate training
new RS models using smaller labeled datasets. Various approaches have
leveraged pre-trained models alongside EuroSAT and have demonstrated
encouraging results [20, 21, 22].

With the advancement of Vision Transformers (ViT), many applications are
adopting it for image classification tasks [23], including EuroSAT [24, 25].
It’s suggested that further scaling can enhance performance [26], but this
model has yet to be integrated with Geospatial data.

The contributions of this paper are summarized below:

  * •

In this study, we offer a thorough evaluation of the Vision Transformers (ViT)
model, considering a range of settings and hyperparameters, with a specific
focus on the EuroSAT datasets.

  * •

We have implemented cutting-edge model improvement techniques to improve the
performance of the selected model.

  * •

The ‘Kreis Borken’ are is mapped using the best-performing model and
geospatial data for visual classification.

The paper is structured as follows: Section 2 reviews related work. Section 3
describes the dataset used in this study and introduces the methodologies
applied using the ViT model. Section 4 presents the results and provides an
analysis. Section 5 discusses the findings and concludes the paper.

##  2 Related Works

This section discusses various state-of-the-art image classification
techniques that use DL and Transfer Learning (TL) for LULC using the EuroSAT
dataset.

Fine-tuning large-scale pretrained ViTs has shown prominent performance for
computer vision tasks, such as image classification by Dosovitskiy et al. [27]
using EuroSAT data from its early proposal. The model utilized in his study is
shown in Figure 2.

Figure 2: ViT model purposed by Dosovitskiy et al. (2021)

A comparison of various spectral bands—RGB, RGB combined with Near InfraRed
(NIR), and multispectral satellite images using the ViT model with Sentinel-2
EuroSAT—was conducted by Anil et al. [28]. Their experimental results indicate
that combining the NIR band with RGB provides more accurate results [29]. Deep
Learning models such as GoogleNet, ResNet-50, Random Forest, VGG, and CNN have
been employed for LULC classification.

In their study, Helber et al. [30] tested the GoogleNet and ResNet-50
architectures with various band combinations. Among these, the ResNet-50 using
RGB bands outperformed the other configurations. Li et al.’s DDRL-AM method
[31] achieved a peak accuracy of 98.74% with RGB bands. Yassine et al. [32]
implemented two approaches on the EuroSAT dataset. The first utilized 13
Sentinel-2 spectral bands and achieved 98.78% accuracy. The second combined
these 13 spectral bands with calculated indices, resulting in an improved
accuracy of 99.58%.

Naushad et al. [33] advanced LULC classification by employing transfer
learning with pre-trained VGG16 and Wide Residual Networks (WRNs) on the
EuroSAT dataset’s RGB version. Techniques such as data augmentation [34],
gradient clipping [35], adaptive learning rates [36], and early stopping [37]
optimized performance and reduced computational time. Their WRN-based approach
achieved a remarkable accuracy of 99.17%, setting a new benchmark in
efficiency and accuracy.

Recently, other variants, including hierarchical ViTs with diverse resolutions
and spatial embeddings [38], have been proposed. Without a doubt, the
advancements in large ViTs underscore the importance of developing efficient
model adaptation strategies.

##  3 Materials and Methods

To classify LULC in a specific region using geospatial data, a transfer
learning (TL) task was undertaken. The EuroSAT classes were subsequently
color-mapped with the assistance of the ViT model pre-trained on ImageNet-21k.
Two datasets were utilized – one with data augmentation and another without.
For simplification, the RGB version of the EuroSAT dataset was chosen, and the
model was trained using the PyTorch framework. Both model training and testing
were conducted using the Tesla T4 GPUs available on Google Colab.

###  3.1 Dataset

The EuroSAT dataset is considered novel and comprises 27,000 labeled and
georeferenced images taken from the Sentinel-2 satellite. The images are
classified into ten scene classes: Forest, Herbaceous Vegetation, Highway,
Pasture, River, Industrial, Permanent Crop, Residential, Annual Crop, and
Sea/Lake. Each image patch contains $64\times 64$ pixels with a spatial
resolution of 10 m. Figure 3 displays several sample images obtained from the
EuroSAT dataset [39]. The dataset is split into a train set (80% of data) and
a test set (20% of data) selected at random.

(a) Annual Crop

(b) Forest

(c) Herbaceous Vegetation

Figure 3: Sample example images of three different classes from the EuroSAT
dataset.

###  3.2 Training and Evaluation

During model training, two sets of data were fed into the system: one with
augmentation and one without. In the augmentation process, various image
transformation techniques [40], such as crops, horizontal flips, and vertical
flips, were utilized to augment the data. This strategy aids in preventing the
neural network from overfitting to the training dataset, enabling it to
generalize more effectively to unseen test data. Since we utilized pre-trained
models, the input dataset was normalized to match the statistics (mean and
standard deviation) of those models.

The model was trained under various settings, and its accuracy was
subsequently evaluated. In this context, the loss was quantified using cross-
entropy loss. To counteract potential issues of vanishing or exploding
gradients during training, which could adversely affect the parameters, the
gradient clipping technique [41] was employed with a value set to $1.0$. We
used the Adam optimizer, combined with multiple learning rates, due to its
proven efficacy in image classification tasks [42]. Regularization strategies,
including early stopping, dropout, and weight decay [43], were also
implemented to combat overfitting and to optimize time and resources. We also
recorded the total duration of the experiment
111https://github.com/sumn2u/LULC-Mapping.git.

##  4 Results

This section presents the results obtained from ViT, VGG16, and ResNet-50
models with same settings and narrows down the ViT model performance under
different settings. Metrics such as accuracy and the time taken to train the
model are measured. The model’s performance is assessed using both data
augmentation techniques and without data augmentation, maintaining similar
settings for both.

Table 1: Comparative experimental results of ViT, ResNet-50 and VGG16 models with and without data augmentation. Model | Epoches Trained | Total Time | Accuracy
---|---|---|---
ViT (Non Augmented Data) | 15 | 12427.12 sec | 98.61%
ViT (Augmented Data) | 15 | 11045.71 sec | 98.72%
VGG16 (Non Augmented Data) | 15 | 5070.30 sec | 98.06%
VGG16 (Augmented Data) | 15 | 4996.54 sec | 97.78%
ResNet-50 (Non Augmented Data) | 15 | 3602.74 sec | 98.52%
ResNet-50 (Augmented Data) | 15 | 3329.52 sec | 98.48%

Table 1 shows that the ViT model is more accurate in Augmented and Non-
Augmented Data, but takes longer to train than other models. Conversely, the
ResNet-50 model exhibits better accuracy than VGG16, and it requires
relatively less training time for both augmented and non-augmented data.

Table 2: Comparative experimental results of ViT model with and without data augmentation. Model | Epoches Trained | Total Time | Accuracy
---|---|---|---
ViT (Non Augmented Data) | 10 | 11045.71 sec | 98.67%
ViT (Non Augmented Data) | 15 | 12427.12 sec | 98.61%
ViT (Non Augmented Data) | 20 | 15604.66 sec | 98.41%
ViT (Augmented Data) | 10 | 7356.24 sec | 98.24%
ViT (Augmented Data) | 15 | 11045.71 sec | 98.72%
ViT (Augmented Data) | 20 | 14377.87 sec | 99.19%
Figure 4: Comparison of loss and accuracy of models at different epochs and
iterations.

The accuracy of the model increases as it trains longer using augmented data;
in contrast, the accuracy decreases for the non-augmented version, as observed
in Table 2. The training time for the augmented data is also relatively longer
compared to the non-augmented data. The loss and accuracy of both the
augmented and non-augmented models are depicted in Figure 4.

(a) Data Augmentation (20 epochs)

(b) Without Data Augmentation (20 epochs)

Figure 5:  Both augmented with 20 epochs and non augmented with 20 epochs
model was able to predict correct results with test data

(a) Confusion Matrix (Augmented)

(b) Confusion Matrix (Non Augmented)

Figure 6: Confusion matrix of augmented and non augmented data with ViT model
for 20 epochs

Subsequently, the model is tested with test data, as shown in Figure 5. Figure
6 shows the confusion matrix of ViT model with and without data augmentation
on validation data. The Forest and Sea Lake classes showed best performance
with higher accuracy in augmented data. The Pasture class has least accuracy
mean while the rest has almost $99$% accuracy.

Figure 7: Mapping of LULC of ‘Kreis Borken’ area using satellite images and
ViT model.

From the experiments conducted, we found that the model trained with augmented
data yields better accuracy. Using Google Earth Engine and Sentinel 2A [44],
we selected the Kreis Borken area. The data, drawn from satellite images
spanning 2018 to 2020, was segmented into $64\times 64$ tiles within the
specified boundary. Using the model, these tiles were classified and color-
mapped, as depicted in Figure 7.

##  5 Conclusion

The objective of this research was to explore the application of transfer
learning in LULC classification. We utilized the ViT model, pre-trained on
ImageNet-21K, and fine-tuned it with the RGB bands of the EuroSAT dataset for
classification. Consistent with other experiments, the results of this study
suggest that transfer learning is a reliable method capable of delivering
superior results. Our approach advanced the state-of-the-art by achieving a
$99.19$% accuracy for the RGB bands of the EuroSAT dataset. We also compared
the classification results with and without data augmentation. Data
augmentation was observed to enhance the visual variability of each training
image without introducing new spectral or topological information, thereby
enriching the dataset’s diversity. The performance of the augmented data
surpassed that of the model trained on the original dataset.

Additionally, this study incorporated model enhancement techniques, including
regularization, early stopping, gradient clipping, and learning rate
optimization, to optimize model training, improve performance, and reduce the
computational time needed. The most proficient model was subsequently used to
map class distributions and offer insights into a specific region of
geospatial imagery. Such insights can assist in monitoring shifts in land
usage and shaping policies for environmental conservation and urban
development.

## References

  * [1] Edouard Mathieu, Lucas Rodés-Guirao, and Max Roser.  What are the sources for Our World in Data’s population estimates?  Our World in Data, July 2023.
  * [2] Kelly Levin and Sarah Parsons.  7 things to know about the ipcc’s special report on climate change and land.  August 2019.
  * [3] Mutao Huang, Jinmeng Wang, and Xiaojuan Li.  Land use change moritoring in nature reserves base on gf-1/gf-2.  In 2021 IEEE International Conference on Power Electronics, Computer Applications (ICPECA), pages 228–231, January 2021\.
  * [4] S. Banchero, D. de Abelleyra, S. R. Veron, M. J. Mosciaro, F. Arévalos, and J. N. Volante.  Recent land use and land cover change dynamics in the gran chaco americano.  In 2020 IEEE Latin American GRSS & ISPRS Remote Sensing Conference (LAGIRS), pages 511–514, March 2020.
  * [5] Weixun Zhou, Shawn Newsam, Congmin Li, and Zhenfeng Shao.  PatternNet: A benchmark dataset for performance evaluation of remote sensing image retrieval.  ISPRS Journal of Photogrammetry and Remote Sensing, 145:197–209, November 2018.
  * [6] Role of spatial resolution and spectral content in change detection. | u. S. Geological survey.
  * [7] Hanxiang Hao, Sriram Baireddy, Emily R. Bartusiak, Latisha Konz, Kevin LaTourette, Michael Gribbons, Moses Chan, Edward J. Delp, and Mary L. Comer.  An attention-based system for damage assessment using satellite imagery.  In 2021 IEEE International Geoscience and Remote Sensing Symposium IGARSS, pages 4396–4399, Brussels, Belgium, July 2021\. IEEE.
  * [8] Raj N.S Sarath, Jerrin Thadathil Varghese, and Roshan Bhatkar.  Effect of global climate change on land surface temperature over dubai, united arab emirates with the aid of landsat 8 satellite imagery.  In 2020 8th International Conference on Reliability, Infocom Technologies and Optimization (Trends and Future Directions) (ICRITO), pages 1289–1292, June 2020.
  * [9] Diaz Arapa Christofer Alex and Lozada Ojeda Diego Antonio.  Review of methods for monitoring elements using satellite imagery.  In 2023 17th International Conference on Engineering of Modern Electric Systems (EMES), pages 1–4, June 2023.
  * [10] R. Gladys Villegas, Frieke Van Coillie, and Daniel Ochoa.  Mapping and assessment of land use and land cover for different ecoregions of ecuador using phenology-based classification.  In 2021 IEEE International Geoscience and Remote Sensing Symposium IGARSS, pages 6492–6495, July 2021.  ISSN: 2153-7003.
  * [11] Dinesh Sathyanarayanan, DV Anudeep, C Anjana Keshav Das, Sanat Bhanadarkar, Uma D, R Hebbar, and K. Ganesha Raj.  A multiclass deep learning approach for lulc classification of multispectral satellite images.  In 2020 IEEE India Geoscience and Remote Sensing Symposium (InGARSS), pages 102–105, December 2020.
  * [12] Harsh Waghela, Saurin Patel, Pooja Sudesan, Soham Raorane, and Rohan Borgalli.  Land use land cover classification using machine learning.  In 2022 International Conference on Automation, Computing and Renewable Systems (ICACRS), pages 708–711, December 2022\.
  * [13] Abebaw Alem and Shailender Kumar.  Deep learning methods for land cover and land use classification in remote sensing: a review.  In 2020 8th International Conference on Reliability, Infocom Technologies and Optimization (Trends and Future Directions) (ICRITO), pages 903–908, Noida, India, June 2020. IEEE.
  * [14] Ya Chen, Liang Zheng, Jin Zheng, and Junjie Cheng.  Remote sensing image scene classification method based on semantic and spatial interactive information.  In 2022 7th International Conference on Image, Vision and Computing (ICIVC), pages 436–441, 2022.
  * [15] Gong Cheng, Xingxing Xie, Junwei Han, Lei Guo, and Gui-Song Xia.  Remote sensing image scene classification meets deep learning: challenges, methods, benchmarks, and opportunities.  IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 13:3735–3756, 2020.
  * [16] Krishna Karra, Caitlin Kontgis, Zoe Statman-Weil, Joseph C. Mazzariello, Mark Mathis, and Steven P. Brumby.  Global land use / land cover with Sentinel 2 and deep learning.  In 2021 IEEE International Geoscience and Remote Sensing Symposium IGARSS, pages 4704–4707, July 2021.  ISSN: 2153-7003.
  * [17] Saket Kumar Ojha, Kasiviswanath Challa, Madhu Kiran Vemuri, Naga Sri Vardhan Yarlagadda, and B L N Phaneendra Kumar.  Land use prediction on satillite images using deep neural nets.  In 2019 International Conference on Intelligent Computing and Control Systems (ICCS), pages 999–1003, May 2019.
  * [18] Mohammad Mustafa Taye.  Understanding of machine learning with deep learning: architectures, workflow, applications and future directions.  Computers, 12(5):91, May 2023.
  * [19] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei.  ImageNet: A large-scale hierarchical image database.  In 2009 IEEE Conference on Computer Vision and Pattern Recognition, pages 248–255, June 2009.  ISSN: 1063-6919.
  * [20] Patrick Helber, Benjamin Bischke, Andreas Dengel, and Damian Borth.  Eurosat: a novel dataset and deep learning benchmark for land use and land cover classification.  IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 12(7):2217–2226, July 2019.
  * [21] Anastasios Temenos, Nikos Temenos, Maria Kaselimi, Anastasios Doulamis, and Nikolaos Doulamis.  Interpretable deep learning framework for land use and land cover classification in remote sensing using shap.  IEEE Geoscience and Remote Sensing Letters, 20:1–5, 2023.
  * [22] Sanskruti Patel, Nilay Ganatra, and Rachana Patel.  Multi-level feature extraction for automated land cover classification using deep cnn with long short-term memory network.  In 2022 6th International Conference on Trends in Electronics and Informatics (ICOEI), pages 1123–1128, April 2022.
  * [23] Yingzi Huo, Kai Jin, Jiahong Cai, Huixuan Xiong, and Jiacheng Pang.  Vision transformer (Vit)-based applications in image classification.  In 2023 IEEE 9th Intl Conference on Big Data Security on Cloud (BigDataSecurity), IEEE Intl Conference on High Performance and Smart Computing, (HPSC) and IEEE Intl Conference on Intelligent Data and Security (IDS), pages 135–140, May 2023.
  * [24] Monika Kumari and Ajay Kaul.  Recent advances in the application of vision transformers to remote sensing image scene classification.  Remote Sensing Letters, 14(7):722–732, July 2023.
  * [25] Fatema-E Jannat and Andrew R. Willis.  Improving classification of remotely sensed images with the swin transformer.  In SoutheastCon 2022, pages 611–618, March 2022.  ISSN: 1558-058X.
  * [26] Xiaohua Zhai, Alexander Kolesnikov, Neil Houlsby, and Lucas Beyer.  Scaling vision transformers, 2022.
  * [27] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby.  An image is worth 16x16 words: transformers for image recognition at scale, June 2021.  arXiv:2010.11929 [cs].
  * [28] Arjun Anil, Sajith Variyar V. V., Sowmya V, Adithyan Sukumar, Moez Krichen, and vinayakumar R.  Influence of Spectral Bands on Satellite Image Classification using Vision Transformers.  6 2022.
  * [29] Arjun Anil, Sajith Variyar V. V., Sowmya V, Adithyan Sukumar, Moez Krichen, and Vinayakumar R.  Influence of spectral bands on satellite image classification using vision transformers.  preprint, June 2022.
  * [30] Patrick Helber, Benjamin Bischke, Andreas Dengel, and Damian Borth.  Introducing eurosat: A novel dataset and deep learning benchmark for land use and land cover classification.  In IGARSS 2018-2018 IEEE International Geoscience and Remote Sensing Symposium, pages 204–207. IEEE, 2018.
  * [31] Jun Li, Daoyu Lin, Yang Wang, Guangluan Xu, Yunyan Zhang, Chibiao Ding, and Yanhai Zhou.  Deep discriminative representation learning with attention map for scene classification.  Remote Sensing, 12(9):1366, January 2020.
  * [32] H. Yassine, K. Tout, and M. Jaber.  Improving lulc classification from satellite imagery using deep learning – eurosat dataset.  The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, XLIII-B3-2021:369–376, June 2021.
  * [33] Raoof Naushad, Tarunpreet Kaur, and Ebrahim Ghaderpour.  Deep transfer learning for land use and land cover classification: a comparative study.  Sensors, 21(23):8083, January 2021.
  * [34] Connor Shorten and Taghi M. Khoshgoftaar.  A survey on image data augmentation for deep learning.  Journal of Big Data, 6(1):60, July 2019.
  * [35] Tao Zhang, Tianqing Zhu, Kun Gao, Wanlei Zhou, and Philip S. Yu.  Balancing learning model privacy, fairness, and accuracy with early stopping criteria.  IEEE Transactions on Neural Networks and Learning Systems, 34(9):5557–5569, September 2023.
  * [36] Jeffrey M Ede and Richard Beanland.  Adaptive learning rate clipping stabilizes learning.  Machine Learning: Science and Technology, 1(1):015011, March 2020\.
  * [37] Rousslan Fernand Julien Dossa, Shengyi Huang, Santiago Ontañón, and Takashi Matsubara.  An empirical investigation of early stopping optimizations in proximal policy optimization.  IEEE Access, 9:117981–117992, 2021.
  * [38] Xuehai He, Chunyuan Li, Pengchuan Zhang, Jianwei Yang, and Xin Eric Wang.  Parameter-efficient model adaptation for vision transformers, July 2023\.  arXiv:2203.16329 [cs].
  * [39] Patrick Helber, Benjamin Bischke, Andreas Dengel, and Damian Borth.  Eurosat: A novel dataset and deep learning benchmark for land use and land cover classification.  IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 2019.
  * [40] Jia Shijie, Wang Ping, Jia Peiyi, and Hu Siping.  Research on data augmentation for image classification based on convolution neural networks.  In 2017 Chinese Automation Congress (CAC), pages 4165–4170, October 2017.
  * [41] Jingzhao Zhang, Tianxing He, Suvrit Sra, and Ali Jadbabaie.  Why gradient clipping accelerates training: A theoretical justification for adaptivity, February 2020.  arXiv:1905.11881 [cs, math].
  * [42] Kalyan Maji and Subir Gupta.  Evaluation of various loss functions and optimization techniques for mri brain tumor detection.  In 2023 International Conference on Distributed Computing and Electrical Circuits and Electronics (ICDCECE), pages 1–6, 2023.
  * [43] Agnieszka Mikołajczyk and Michał Grochowski.  Style transfer-based image synthesis as an efficient regularization technique in deep learning.  In 2019 24th International Conference on Methods and Models in Automation and Robotics (MMAR), pages 42–47, 2019.
  * [44] Mohamad Awad.  Google earth engine (gee) cloud computing based crop classification using radar, optical images and support vector machine algorithm (svm).  In 2021 IEEE 3rd International Multidisciplinary Conference on Engineering Technology (IMCET), pages 71–76, 2021.


# NASA-TLX Web App: An Online Tool to Analyse Subjective Workload

Vinoth Pandian Sermuga Pandian
Fraunhofer FIT
Sankt Augustin
Germany
<EMAIL_ADDRESS>
Sarah Suleri
Fraunhofer FIT
Sankt Augustin
Germany
<EMAIL_ADDRESS>

###### Abstract

NASA Task Load Index (NASA-TLX) is a widely used assessment technique to
compute subjective workload experienced during a task. It evaluates workload
using six dimensions: mental demand, physical demand, temporal demand,
frustration, effort, and performance. This paper presents a web app to assist
experimenters in using NASA-TLX to commute subjective workload. The web app
enables the experimenter to conduct various experiments simultaneously and
offers the participants a concise interface to provide their subjective
evaluation. It performs the calculations at the backend and provides the
computed results comprehensively. The web app provides a dashboard for the
experimenter to visualize and export the summary of results. Qualitative
feedback from 12 experimenters indicated that the NASA-TLX web app is
relevant, helpful, and easy to use.

_K_ eywords Subjective workload analysis $\cdot$ NASA TLX $\cdot$ Task Load
Analysis $\cdot$ workload

##  1 Introduction

NASA-TLX is a widely used multidimensional assessment tool that evaluates the
perceived workload for any given task [1]. The task is assessed on the basis
of the participant’s subjective rating (0 to 100) of six dimensions: mental
demand, physical demand, temporal demand, performance, effort, and
frustration.

As a first step, participants provide their subjective ratings for each
dimension. Then, they are asked to assign weights to these dimensions in a
pairwise comparison. The purpose of this step is to evaluate the perceived
importance of each dimension. The assigned weights are then multiplied with
the subjective rating given by the participant for the respective dimension,
thus computing the cumulative subjective workload for any given task.

##  2 Literature Review

By a keyword search for existing software and websites to conduct a
computerized NASA-TLX study, we identified nine relevant tools. Excluding the
tools that required paid-license [2] or source code compilation before usage
[3, 4]; we reviewed six remaining tools: four websites and two applications.

Specifically, two websites [5, 6] allow conducting NASA-TLX analysis on a
single participant and display the individual result. Whereas, the other two
[7, 8] support interviewing multiple participants for an experiment and
provide an overview of their results. Only one website [8] synchronizes
experiment results in an online database and supports experiment data export.

Two applications support workload analysis offline: NASA-TLX official app by
NASA’s Ames Research Center [9]; and NASA-TLX desktop app by Playgraph [10].
The official app supports iOS mobile devices [9]. Whereas, Playgraph’s NASA-
TLX app supports all desktop platforms that can execute Adobe Air runtime
[10]. Both apps support workload analysis of multiple participants for an
experiment, online data synchronization, and experiment data export. Also, the
official NASA-TLX app provides a graph of each participant’s data [9].

While these tools aid to computerize paper and pencil version of NASA-TLX, we
believe it would be beneficial to provide an overview of experiment data by
visualizing it for quick inference of task load trends.

(a) Rating sheet for various dimensions of NASA-TLX

(b) Workload dimension comparison card

Figure 1: Rating sheet and workload dimension comparison forms of NASA-TLX web
app

##  3 NASA-TLX Web Application

We present a web application111https://nasa-tlx.firebaseapp.com/
222https://github.com/vinothpandian/nasa-tlx-web to perform subjective
workload analysis using NASA-TLX. This application aims to assist
experimenters in conducting the subject workload study and analyze with ease.
The web app manages multiple experiments simultaneously with respect to
experiment ID and assigns each participant with a randomly generated unique
id.

Participants are provided with a brief description of each dimension of NASA-
TLX and then asked to provide the respective ratings using a slider (Figure
1(a)). In the next step, participants assign comparative weight to each
dimension (Figure 1(b)). Once these subjective values are collected, the
respective results of subjective workload analysis are automatically generated
(Figure 2). The experimenter can access the results as raw data and graphical
summary for each participant as well as for the entire experiment. These
results can also be exported as CSV or JSON file.

##  4 Implementation

We developed NASA-TLX as an open-source web app in order to make it accessible
via various platforms. It supports almost all of the major browsers: Mozilla
Firefox, Google Chrome, Safari, and Opera, except Microsoft Edge and Internet
Explorer.

###  4.1 User Interface Design

We designed the User Interface (UI) with Twitter’s Bootstrap components [11].
Bootstrap is an open-source toolkit for building responsive, mobile-first web
applications. With Bootstrap at its core, the NASA-TLX web app adapts
seamlessly to any device resolution and orientation. Although it is designed
to work well in portrait mode, we recommend to use it in landscape orientation
as it provides a much larger screen area for participants to interact with the
sliders in the rating sheet (Figure 1(a)).

###  4.2 Front-end

The front-end of NASA-TLX web app is written using JavaScript (JS). The UI
components are built using Facebook’s React library. React is an open-source
component-based library to build interactive UI [12]. In addition, we used few
popular JS packages for web app development: React-Router for managing the
page navigation [13]; Redux for maintaining page state [14]; and Redux-Saga
for managing asynchronous data fetching.

###  4.3 Back-end

The back-end of the NASA-TLX web app uses Google’s Firebase Realtime Database.
It is a No-SQL cloud-hosted database that allows storing and syncing data in
real-time across all devices and platforms [15]. For privacy and security, the
web app uses a Firebase authentication service. It securely stores experiment
data in the cloud and restricts access for everyone except the authenticated
user. Firebase authentication supports login using existing Google, Facebook,
or Twitter accounts; users can also register using email [16].

###  4.4 Optimization & Performance

NASA-TLX web app is developed using a webpack module bundler. Webpack bundles
the JS code into fewer files and optimizes them to improve the web app’s
loading time [17]. With the webpack, the web app’s source code is optimized,
minified, and compressed to load faster.

The web app is deployed in Google’s Firebase hosting service. It is a fast and
secure web hosting provider and content delivery network [18]. Each script is
set to load asynchronously whenever required; as a result, the web app loads
quickly and performs smoothly even in a slow internet connection. In totality,
the complete site usage requires 701KB internet data in browsers with gzip
compressions support. Also, it leverages browser-caching, so once the site is
loaded, it performs fast, until its cache is removed.

Figure 2: Summary of automatically computed results in a graphical format.

##  5 Qualitative Feedback

We collected qualitative feedback from 12 experimenters who had previously
used NASA-TLX paper questionnaires in multiple experiments. The experimenter
was asked to use the NASA-TLX web app instead of a paper questionnaire and
conduct a workload experiment. The feedback indicated that experimenters found
the NASA-TLX web app to be relevant, convenient, and easy to use.

##  6 Conclusion

We presented a web app to assist experimenters in conducting workload analysis
using NASA-TLX. The web app provides the participants with an interface to
submit their subjective evaluation. The web app computes the results
automatically based on the scale values and weights submitted by the
participants. It also provides a dashboard for the experimenter to view and
export the summary of results for various experiments. A preliminary study
showed that experimenters found this app convenient and easy to use. In the
future, we intend to extend this research by including offline data
persistence and multiple language support.

##  7 Acknowledgments

We would like to extend our gratitude to Nilda Kipi and Svetlana Shishkovets
for their help and support.

## References

  * [1] Sandra G Hart and Lowell E Staveland.  Development of nasa-tlx (task load index): Results of empirical and theoretical research.  In Advances in psychology, volume 52, pages 139–183. Elsevier, 1988\.  https://www.sciencedirect.com/science/article/pii/S0166411508623869.
  * [2] NASA Task Load Index (NASA-TLX).  https://www.millisecond.com/download/library/nasatlx/, 2010.
  * [3] Nasa TLX Test in Java Swing.  https://github.com/javanasatlx/jnasatlx/, 2015.
  * [4] NASA-TLX: Calculate the NASA Task Load Index (TLX) with this handy wxPython GUI.  https://github.com/jmpolom/NASA-TLX, 2011.
  * [5] Keith Vertanen.  NASA-TLX in HTML and JavaScript.  https://www.keithv.com/software/nasatlx/.
  * [6] NASA TLX - Online Software.  http://nasa.asavva.net/.
  * [7] An implementation of the NASA Task Load Index (NASA-TLX).  https://github.com/isellsoap/nasa-tlx, 2012.
  * [8] David Sharek.  A useable, online NASA-TLX tool.  In Proceedings of the Human Factors and Ergonomics Society, pages 1375–1379, 2011.  http://www.nasatlx.com.
  * [9] NASA TLX official App - NASA’s Ames Research Center.  https://humansystems.arc.nasa.gov/groups/TLX/tlxapp.php.
  * [10] NASA-TLX Desktop app.  http://www.playgraph.com/apps.updates/NASA-TLX.air, 2009.
  * [11] Bootstrap - the most popular html, css, and js library in the world.  https://getbootstrap.com/.  (Accessed on 27/01/2020).
  * [12] React - a javascript library for building user interfaces.  https://reactjs.org/.  (Accessed on 27/01/2020).
  * [13] React router: Declarative routing for react.js.  https://reacttraining.com/react-router/web/guides/philosophy.  (Accessed on 27/01/2020).
  * [14] Redux - a predictable state container for javascript apps.  https://redux.js.org/.  (Accessed on 27/01/2020).
  * [15] Firebase realtime database | firebase realtime database | firebase.  https://firebase.google.com/docs/database/.  (Accessed on 27/01/2020).
  * [16] Firebase authentication | firebase.  https://firebase.google.com/docs/auth/.  (Accessed on 27/01/2020).
  * [17] Webpack - a static module bundler for modern javascript applications.  https://webpack.js.org/.  (Accessed on 27/01/2020).
  * [18] Firebase hosting | firebase.  https://firebase.google.com/docs/hosting/.  (Accessed on 07/06/2018).


Latent Adversarial Debiasing: Mitigating Collider Bias in Deep Neural Networks

Luke Darlow Stanisław Jastrzębski Amos Storkey

School of Informatics, University of Edinburgh Jagiellonian University &
Molecule.one School of Informatics, University of Edinburgh

###### Abstract

Collider bias is a harmful form of sample selection bias that neural networks
are ill-equipped to handle. This bias manifests itself when the underlying
causal signal is strongly correlated with other confounding signals due to the
training data collection procedure. In the situation where the confounding
signal is easy-to-learn, deep neural networks will latch onto this and the
resulting model will generalise poorly to in-the-wild test scenarios. We argue
herein that the cause of failure is a combination of the deep structure of
neural networks and the greedy gradient-driven learning process used – one
that prefers easy-to-compute signals when available. We show it is possible to
mitigate against this by generating bias-decoupled training data using latent
adversarial debiasing (LAD), even when the confounding signal is present in
100% of the training data. By training neural networks on these adversarial
examples, we can improve their generalisation in collider bias settings.
Experiments show state-of-the-art performance of LAD in label-free debiasing
with gains of 76.12% on background coloured MNIST, 35.47% on foreground
coloured MNIST, and 8.27% on corrupted CIFAR-10.

##  1 Introduction

Invariably, in real-world machine learning settings, training and test sets
are different. This general phenomenon has become known as _dataset shift_
(Caron et al., 2018). Yet there are many causes for such shifts (Storkey,
2009). One common scenario is _sample selection bias_ (Heckman, 1979) where
the process of curating a training dataset differs from the process by which
data arrives during deployment. This issue is ubiquitous; even standard
machine learning benchmarks (e.g. ImageNet) contain images selected for the
clarity with which a class is represented, a clarity missing in many real
applications, where for example you might see an object occluded.

One pernicious form of sample selection bias is _collider bias_. This is
illustrated and characterised in Figure 1. Consider two variables: a _causal
variable_ that determines the target, and what we will call a _confounding
variable_ , that is not directly related to the target. In collider bias,
these two variables that are, for the most part, independent in test scenario,
become co-dependent in the training sample because of the restrictive way the
training data is selected. Collider bias can cause a predictive algorithm to
mistakenly target information from features associated with the confounding
variable rather than the causal variable; such features then do not generalise
to the test scenario.

The data processing inequality implies that information about the target from
the causal signal must be greater than that of the confounding signal. However
the confounding signal can be easier to discover than the causal signal, due
to its ease of compute (a highly linear confounder, for example can be
discovered before a highly non-linear causal relationship). When this is
combined with the greediness of neural network learning, it can mean the
causal signal is just never learnt about. It is precisely this scenario that
is the topic of this paper.

We argue that collider bias can be a pervasive cause of non-robustness in deep
neural networks (DNNs). Our main contribution is the demonstration of a
specific approach to mitigate the situation: Latent Adversarial Debiasing
(LAD), which pushes a network to recognise all sources of information for a
problem by augmenting training using adversarially perturbed latent
representations. In these latent representations, easy-to-learn confounding
signals are decoupled from the classification targets, forcing networks to
also learn information from the causal signal.

###  1.1 Collider bias

Consider a toy classification problem: distinguishing dog images from cat
images. A collected training dataset for dogs and cats may be biased: people
take pictures of dogs outside while they take them for a walk e.g. in a field,
and take pictures of cats in their homes, e.g. on a sofa. Yet both cats and
dogs go inside and outside.

It might be critical in the test setting to distinguish between dogs and cats
each presented in indoor and outdoor settings. In this training dataset the
simple feature of the background colour in the image is a strong confounder
for the real signal that needs to be detected – the difference in appearance
between dogs and cats.

We call the easy-to-learn bias-inducing signal the confounding signal, as
opposed to the true causal signal. A model relying on the causal signal will
generalise well, while a model relying on the confounding signal will
generalise poorly. We propose a solution that hinges on the assumption that
confounding signals are typically _easier-to-compute_ in that their gradients
during learning are stronger than the gradients of causal signals (see Section
2.1). A similar assumption was also made in related earlier work (Nam et al.,
2020; Bahng et al., 2020; Bras et al., 2020; Minderer et al., 2020). We
hypothesise that a specific form of adversarial examples can be used to
augment training data such that confounding signal is decoupled from the
causal signal. We show that adversarial data can be generated by gradient
descent in the latent space of an autoencoder-like model to produce augmented
training data. The effect is a reduced association between confounding and
causal signals, requiring a model learning on this augmented data to rely on
the causal signal. Our method, LAD, shows marked improvement over state-of-
the-art, without relying on any presence of bias-free data (opposed to Nam et
al. (2020); Bras et al. (2020) and Bahng et al. (2020)).

##  2 Problem Definition

Consider an underlying data generating distribution
$p_{\mathcal{D}}(\mathsf{x},\mathsf{y})$ for the data, $\mathcal{D}$. While
for most problems we do not have access to this distribution, representative
empirical samples are typically available. The bias problems we are concerned
with are ones where there are multiple underlying variables, e.g.
$\mathsf{z}_{1}$ and $\mathsf{z}_{2}$ in Figure 1, that causally influence the
observed data.

$\mathsf{z}_{1}$$\mathsf{z}_{2}$$\mathsf{x}$$\mathsf{y}$$\mathsf{s}$ Figure 1:
Graphical model for collider bias. $\mathsf{z}_{1}$, $\mathsf{z}_{2}$ are
latent information sources. The target $y$ is causally dependent on
$\mathsf{z}_{1}$ but not $\mathsf{z}_{2}$. But $\mathsf{x}$ contains
information from both latent sources. $s$ is a binary sample selection
variable: $s=1$ implies that the sample is selected for a particular dataset.

When selecting or collecting data for a problem we inevitable introducing a
_sampling bias_ , $\mathsf{s}$, which can be thought of as a form of rejection
sampling. E.g., all the times a user implicitly chooses _not_ to take a photo.
In this way sampling bias couples the underlying variables of the observed
data in a manner that DNNs are ill-equipped to handle.

We have included the sampling mechanism, $\mathsf{s}$, explicitly in Figure 1.
Conditioning on $\mathsf{s}$ is what actually causes the association between
underlying variables. In both cases the secondary signal does not cause the
target and is therefore a confounding signal.

###  2.1 Confounding signals have high-gradient learning signals

Crucial to our insight into the tendency of DNNs to rely on easy-to-learn
confounding signals in the training data is understanding how gradient of
these signals with respect to the training loss evolves over learning. To this
end we present a toy problem, called the one-pixel problem 111Private
communication: Harri Edwards, 2016. in Section 2.2, and track the gradient
ratio ($GR$) to determine the relative reliance on causal ($\mathsf{z}_{+}$)
and confounding ($\mathsf{z}_{-}$) variables:

$GR({\mathsf{z}_{+}},{\mathsf{z}_{-}})=\left\|\frac{\partial
L}{\partial{\mathsf{z}_{+}}}\right\|_{2}\bigg{/}\left\|\frac{\partial
L}{\partial\mathsf{z}_{-}}\right\|_{2},$ (1)

where $\left\|\cdot\right\|_{2}$ is the L2 Norm. When $GR=1$ the learning
process is not favouring either signal. When $GR<1$ the learning process is
favouring the confounding signal and when $GR>1$ it is favouring the causal
signal. As this quantity is impossible to compute when we do not have direct
access to the causal variable, a toy problem enables us to assess this.

###  2.2 One-Pixel problem

The one-pixel problem is a bias-reliance demonstration that can be constructed
simply using any image dataset for classification: all that it requires is
setting the $k^{th}$ pixel of the first row of each training image to a pre-
selected value (where $k$ is the class index) – see Figure 2.

(a) Training images

(b) Cross entropy loss

(c) Training accuracy

(d) L2 norm gradients

(e) Signal:bias gradient ratio, Equation 1

Figure 2: One-pixel problem on MNIST. The class information is encoded as a
confounding signal in the first $k$ pixels of the first row in each image (a).
We show the training loss (b), training accuracy (b), l2 norm of gradients on
the informative pixel and the remaining image (c), and the ratio of said
gradients (d). In this case the test accuracy is no better than random chance.

Figure 2 tracks the gradient ratio between causal signal and confounding
signal, $GR({\mathsf{z}_{+}},{\mathsf{z}_{-}})$, measured as the ratio of L2
norm gradients on the image pixels (all but the $k$ pixels of the OPP) and the
L2 norm gradients of the $k$ pixels encoding class information, over 1000
minibatch iterations. This is simple to compute for the one-pixel problem as
there are distinct pixels associated with each signal. At initialisation the
gradients are stronger over the image space (causal), but become dominated by
the gradients over the $k$-pixel space (confounding) after only 230
iterations. This demonstration serves to show that neural networks prefer
easy-to-compute confounder signals and that gradient information is the
mechanism that preference takes.

##  3 Prior Work

DNNs lack robustness to human imperceptible perturbation called adversarial
examples (Goodfellow et al., 2015; Madry et al., 2018), other semantic
transformations such as rotations or translations (Kanbak et al., 2018;
Engstrom et al., 2019; Hendrycks and Dietterich, 2019), and more broadly to a
domain shift in the input distribution (Gulrajani and Lopez-Paz, 2020).

Most relevant to our work is the observation that DNNs tend to rely on easy-
to-learn biases or features that do not generalise outside the training
distribution (Geirhos et al., 2020). In image classification, this is
exemplified by the reliance of DNNs on the high frequency components in the
image (Jo and Bengio, 2017). In natural language processing, DNNs were shown
to latch onto statistical cues such as the present or absence of individual
words (McCoy et al., 2019).

Adversarial learning is a set of techniques particularly useful for improving
the robustness of deep neural networks (Goodfellow et al., 2015; Madry et al.,
2018). Predominantly, prior work focused on applying adversarial learning to
improving the robustness to small perturbations bounded in $\ell_{p}$ norm.

Adversarial learning was also applied to de-biasing models (Goel et al., 2020;
Qiu et al., 2019; Zhang et al., 2018; Beutel et al., 2017; Edwards and
Storkey, 2016; Arjovsky et al., 2019; Stachura et al., 2020). Zhang et al.
(2018); Beutel et al. (2017); Edwards and Storkey (2016) remove the
information about the bias from the input or hidden representation. Arjovsky
et al. (2019) use adversarial learning to reduce reliance of a neural network
on features that change between different domains. In contrast, we do not
require annotated data on the presence of a bias.

Data augmentation has also been shown to be effective in improving robustness
of deep neural networks to semantically meaningful perturbations (Fawzi et
al., 2016; Hendrycks et al., 2020). Our work can be seen as an automatic
method for creating such augmentations.

Our work is most closely related to unsupervised methods to de-biasing models
(Nam et al., 2020; Bras et al., 2020; Gowal et al., 2020; Bahng et al., 2020),
but substantially differ in the assumptions made. Gowal et al. (2020) assume
access to a disentangled representation with an identified factor that is not
causally related to the label. Then they use a decoder to produce augmented
images by mixing the spurious factor between different pairs of images.
Specifically, they train StyleGAN (Karras et al., 2018), and use its first
stage representation as the spurious factor. Their method is hence limited to
image classification scenarios in which features identified by StyleGAN
correspond to the learned biases. Bahng et al. (2020) require providing a
biased model that heavily relies on the bias information in the dataset (e.g.
a CNN that has small receptive fields that bias the model towards textural
information). They train a debiased classifier by regularizing its
representation to be statistically independent from the representation learned
by the biased model.

Similarly to Nam et al. (2020) and Bras et al. (2020), LAD hinges on a relaxed
assumption that the spurious correlation is easier to learn than the true
signal. Nam et al. (2020) assumes first examples that are learned are biased,
and trains a second network that has an intentionally high loss on them. Bras
et al. (2020) filters out examples that can be classified using a simple
linear model. These approaches are inspired by the phenomenon that DNNs first
prioritise learning a consistent subset of _easy-to-learn_ examples
(Swayamdipta et al., 2020; Arpit et al., 2017).

In contrast to Nam et al. (2020); Bras et al. (2020) we do not assume that a
subset of examples is free of bias. Instead, we modify all examples using
carefully crafted adversarial examples to reduce the reliance on confounding
signals. We compare directly to Nam et al. (2020) and Bahng et al. (2020) and
show markedly improved generalisation performance.

Finally, LAD is related to Minderer et al. (2020). Similarly to us, they
reduce the reliance of training on easy to learn features by performing an
adversarial walk in the latent space of an autoencoder. The key difference is
that they use the method to improve self-supervised learning, in which they
note the self-superivsed objective can be too easily optimized by relying on
shortcut (easy to learn) features.

##  4 LAD: Latent Adversarial Debiasing

We propose to counter collider bias in DNNs by augmenting the training data to
artificially disassociate confounding signals and causal signals. We require
three components to achieve this:

  * •

A latent representation, $\mathsf{h}$, of the underlying data manifold,
modelled by $g$, such that the confounding and causal signals are
approximately disentangled and accessible.

  * •

A biased classifier, $f$, trained on this latent representation.

  * •

A method to remove confounding signals from training examples using both $f$
and $g$.

In the rest of this section we describe each component. We note here that
similar but more restrictive assumptions were made by prior works (Nam et al.,
2020; Bras et al., 2020; Bahng et al., 2020; Karras et al., 2018). Perhaps
most importantly, we assume $f$ relies on the easy-to-learn confounding signal
when trained on $\mathsf{h}$. We also constrain $f$ to ensure this is the
case.

###  4.1 Manifold Access

We assume the data distribution is conditional on a set of underlying
variables such that: $p(\mathsf{x}\mid\mathsf{z}_{1},\mathsf{z}_{2})$ and
$p(y\mid\mathsf{z}_{1})$ (see Figure 1.) This corresponds to an underlying
low-dimensional manifold that dictates the space of plausible images in the
data.

We need access to (an approximation of) the latent manifold parameterised in a
way that the easy-to-compute confounding signal is disentangled from the
causal signal. This helps ensure that when we train a classifier $f$, it
learns to rely on the information that induces bias, and allows us to alter or
remove this information.

Stutz et al. (2019) demonstrated a means of producing on-manifold adversarial
examples by training class-specific variational autoencoder generative
adversarial network (VAEGAN) hybrid models (Larsen et al., 2016) for each
class in the data. Via an adversarial walk on the approximated manifold space,
Stutz et al. (2019) were able to generate adversarial images with plausible
deviations from the originals.

##### VQ-VAE: quantised latent space

To satisfy the above desiderata, we use a vector quantised-variational
autoencoder (VQ-VAE) (Van Den Oord et al., 2017). This model enables learning
of a discrete (quantised) latent representation, where the number and size of
the discrete codes are pre-chosen. Where Stutz et al. (2019) learned VAEGAN
models for each class to constrain the changes to remain on-manifold, the
quantisation constraint of VQ-VAE offers a similar effect. We use the
quantisation mechanism directly in the latent adversarial walk to project
gradient-based changes onto the manifold. Early experimentation with standard
autoencoders and VAEs evidenced that a strong constraint in the adversarial
walk was paramount.

The VQ-VAE is effectively an encoder decoder structure (See Figure 3) with a
quantised latent space. Consider that the original image can be reconstructed
as:

$\begin{split}\hat{x}&=g(x)\\\ &=\text{dec}(h),h=\text{enc}(x),\end{split}$
(2)

where $x$ and $\hat{x}$ are the input and reconstructed images, respectively,
$g(\cdot)$ is the VQ-VAE, (dec, enc) are the decoder and encoder components
thereof, and $h$ is the latent representation for $x$

##### Classification from bias

We can then attach a classifier, $f$, to this latent space in order to
approximate the decision boundary associated with the easy-to-learn
confounding signal:

$\hat{y}=f(h),$ (3)

where $\hat{y}$ is a class prediction, and train it using standard SGD to
minimise the cross entropy loss. While $h$ will contain both confounding and
causal signals, it is the tendency of $f$ to latch onto easy-to-learn features
that enables LAD to work. In the following section we discuss how we use these
two models $f(\cdot)$ and $g(\cdot)$ to traverse the latent space, $h$, and
augment the training data such that an additional classifier must rely on the
causal signal.

LAD bears resemblance to Gowal et al. (2020) who assume that the lowest level
representation learned by StyleGAN is not causally linked to the label. We
relax this assumption in the sense that we only require our latent variable
model to disentangle the underlying causal variables. We will rely on a
(simple) classifier ($f$) and a gradient-based latent adversarial walk to
decouple the confounding and causal signals.

Figure 3: Model setup. The VQ-VAE is the encoder decoder structure, tasked
with learning quantised latent representation, $h$. The ‘simple’ classifier,
$f$, is learned using $(h,y)$ as input-target pairs, where $y$ is the class
label. The latent adversarial walk (blue circle) alters $h$ such that $f$
produces high entropy (maximally uncertain) class predictions. The altered
representation, $h_{\delta}$, can then be decoded into $x_{\delta}$ where the
easy-to-learn confounding signal and causal signal are decoupled. The ultimate
aim is to train an additional classifier, $f_{strong}$ using this augmented
data for improved generalisation in collider bias settings.

###  4.2 Latent adversarial walk

While a number of adversarial attack example generation algorithms exist
Szegedy et al. (2013); Madry et al. (2018); Goodfellow et al. (2014), these
aim at producing imperceptible changes to an image such that a target
classifier makes an incorrect, yet often highly confident, prediction on that
image. Consider the family of white-box adversarial attacks Madry et al.
(2018) that maximise the training loss:

$\underset{\delta}{max}\mathcal{L}_{ce}(f(x+\delta),y)$ (4)

where $\mathcal{L}_{ce}$ is the cross entropy loss and $\delta$ is computed
via projected gradient descent. $\delta$ is constrained to ensure perceptual
similarity between $x$ and $x+\delta$. This is an optimisation process on the
image space: an adversarial walk to systematically alter the image and
maximise the training loss. In our case, however, we perform the adversarial
walk on the latent space with the objective of maximising the entropy of the
predictive probability:

$\underset{\delta}{max}{H}(f(\text{quantise}(h+\delta,G))),$ (5)

where ${H}$ is the entropy of the class probabilities $f$ computes, the
$\text{quantise}(\cdot)$ function is the quantisation mechanism of VQ-VAE with
learned latent codes. We compute $\delta$ as the standardised partial gradient
to preserve the strength of the changes for any example:

$\delta=\alpha\cdot\left(\frac{\frac{\partial{H}}{\partial{h}}-\text{mean}(\frac{\partial{H}}{\partial{h}})}{\text{std}(\frac{\partial{H}}{\partial{h}})}\right),$
(6)

where $\text{mean}(\cdot)$ and $\text{std}(\cdot)$ are the mean and standard
deviation computed over the entire gradient vector for each image, and
$\alpha$ is a hyper-parameter dictating the step size of the walk.
Standardisation helps ensure the steps taken by the gradient walk are
approximately equal in length.

Algorithm 1 details the quantisation-constrained entropy-targeted adversarial
walk used for LAD. The end-goal here is to produce an altered latent
representation, $h_{\delta}=\text{advwalk}(h,,f)$.

Input : $f(\cdot)$, $y$, $h$, $\alpha$, $steps$, $G(\cdot)$

Output : Adjusted latent representation, $h_{\delta}$

$h_{delta}\leftarrow h$ // initialise $h_{\delta}$ to $h$

for  _$i\leftarrow 1$ to $steps$_ do

$\hat{y}\leftarrow f(h_{delta})$ // compute prediction

$H\leftarrow entropy(\hat{y})$ ;

backprop to maximise $H$;

compute $\delta$;

$h_{delta}\leftarrow h_{delta}+\alpha\cdot\delta$ ;

$h_{delta}\leftarrow\text{quantise}(G,h_{delta})$ ;

end for

Algorithm 1 Quantisation-constrained entropy-targeted adversarial walk.

###  4.3 Post-walk classification

Once the latent representation has been adjusted such that the simple
classifier, $f$, outputs high entropy probabilities (i.e., it is unsure), we
can then decode the new representation using the VQ-VAE decoder to construct a
new image:

$\hat{x_{\delta}}=\text{dec}(h_{\delta}).$ (7)

The goal is that this new image should contain very little information related
to what $f$ used to classify. Since $f$ is constrained and we assume it will
latch onto the easy-to-learn confounding signals, this gives us a way of
intentionally augmenting data to remove confounders. We can then use
$x_{\delta}$ to learn an additional classifier in a standard fashion. We call
this final debiased classifier $f_{strong}$.

##  5 Experiments

We explore three datasets of increasing difficulty to assess the relative
merit of Latent Adversarial Debiasing. For comparison with earlier works, we
test two variants of coloured MNIST (LeCun et al., 2010) (background and
foreground) in Sections 5.2 and 5.3. Although seemingly similar, these two
variants of MNIST differ in the level of entanglement between image shape and
colour. For the background-coloured variant, the colour is largely independent
of the image shape, while for the foreground-coloured variant, the colour
always occurs with shape. Following Nam et al. (2020), we also consider the
corrupted CIFAR-10 dataset (Krizhevsky et al., 2009).

Unlike earlier works, we chose to consider the circumstance where the
different confounding signals are pervasive and therefore do not assume any
training data is free from bias. We seek to work toward handling the
fundamental issue of confounding, instead of designing a method that is able
to leverage small amounts of confounder-free data. Since earlier works do not
consider fully confounded training data we also compare on the settings they
target, ensuring the proportion of biased data is listed consistently for
earlier works.

We consider two forms of assessment. The first we call the Independent
settings, denoted ‘cross-bias’ by Bahng et al. (2020), where the confounding
signal is independent of the causal signal during test (e.g., colours are
sampled independently at random during test for coloured MNIST datasets). The
second we call Conditioned settings where the sample selection is changed so
the confounding signal is held constant during the test (e.g., the original
MNIST test set with black a background and white foreground). These cover two
different test-scenarios where the confounding signal has no influence in the
test setting.

###  5.1 Implementational Details

For all datasets we use a ResNet-20 (He et al., 2016) for the final
$f_{strong}$ classifier and a single hidden-layer multi-layer perceptron
(width 100 units) for $f$. For both MNIST datasets, the VQ-VAEs were trained
with 20 latent codes (learned discrete quantisations) of length 64. For
corrupted CIFAR-10 the VQ-VAE was trained with 2056 latent codes of length 64.

For background coloured MNIST we used 20 steps with $\alpha=0.1$ for the
adversarial walk, for foreground coloured MNIST we used 7 steps with
$\alpha=0.1$, and for corrupted CIFAR-10 we used 4 steps with $\alpha=0.07$.
These were determined using a brief hyper-parameter search and cross
validation. The results given in the following sections were computed on the
held-out test data. We used random crops with padding size of 4 for all
datasets, random affine transformations for MNIST datasets (with limits of:
$rotation=15~{}degrees$, $scale=[0.8,1.1]$, and $shear=15~{}degrees$), and
random horizontal flips for corrupted CIFAR-10.

Dataset | Method | Bias ratio | Accuracy (independent) | Accuracy (conditioned)
---|---|---|---|---
BG coloured MNIST | LAD | $100\%$ | 98.82 $\pm$ 0.039 % | $95.35\pm 0.32\%$
Vanilla | $100\%$ | $0.00\pm 0.00\%$ | $10.64\pm 0.65\%$
ReBias | $99\%$ | $88.1\%$ | -
ReBias | $99.9\%$ | $22.7\%$ | -
FG MNIST | LAD | $100\%$ | 98.86 $\pm$ 0.10% | $98.34\pm 0.40\%$
Vanilla | $100\%$ | $0.01\pm 0.01\%$ | 9.90 +- 0.13
LfF | $95\%$ | $85.39\pm 0.94\%$ | -
LfF | $99\%$ | $74.01\pm 2.21\%$ | -
LfF | $99.5\%$ | $63.39\pm 1.97\%$ | -
Corrupted CIFAR-10 | LAD | $100\%$ | 39.93 $\pm$ 0.62% | $51.89\pm 0.32\%$
Vanilla | $100\%$ | $12.16\pm 0.16$ | $21.49\pm 0.16$
LfF | $95\%$ |  59.95$\pm$0.16% | -
LfF | $99\%$ | $41.37\pm 2.34\%$ | -
LfF | $99.5\%$ | $31.66\pm 1.18\%$ | -
Table 1: Test accuracy on all datasets for two test conditions: the
independent case and the conditioned case. The vanilla method is simply a
$f_{strong}$ (c.f. Figure 1) model trained on the original data. While we
include results from ReBias (Bahng et al., 2020) and LfF (Nam et al., 2020),
their methods are not directly comparable because they assume the training set
contains some percentage of unbiased data.

###  5.2 Background coloured MNIST

To produce this dataset we used the code provided
222https://github.com/clovaai/rebias by the authors of ReBias (Bahng et al.,
2020) and compare to their results in Table 1. It is evident that ReBias is
strongly dependant on using a small portion of unbiased data: at a bias ratio
of 99%, they achieved 88.1% test accuracy on an unbiased test set but only
22.6% at a bias ratio of 99.9%. LAD achieved 98.82% on this dataset at 100%
bias ratio, approaching what is achievable on standard MNIST.

The efficacy of LAD is clearly evident by these results. We also show the
training data LAD reconstructions in Figure 4 (a) and (b). LAD is clearly able
to augment the colour information such that it is decoupled from the
classification targets.

###  5.3 Foreground coloured MNIST

To generate this data we followed the protocol in LfF (Nam et al., 2020). Ten
colours were randomly chosen for each class. For each image an RGB colour is
sampled (correlated with class for training) from
$\mathcal{N}\sim(RGB,0.005)$: Gaussian noise is added to the selected mean
colour with a standard deviation of 0.005.

Similar to background coloured MNIST, LAD exceeds the current state-of-the-
art, even though we consider 100% biased training data: the closest comparison
of LfF achieves a test accuracy of 63.39% at 99.5% bias while we achieve
98.86% test accuracy. Again, these results are approaching what is achievable
on the standard MNIST dataset. However, a close inspection of Figure 4 (c) and
(d) will evidence that the alterations owing to LAD do begin to affect the the
actual digit shape – note particularly the nines in Figure 4 (d). Compare this
to (b) where the altered data leaves the digit shape almost entirely
unchanged. This difference is owing to the level of entanglement between bias
and true signal. Foreground coloured MNIST has the bias variable (colour)
overlayed on the true signal (digit shape) instead of as a static background.
Nonetheless, the test accuracies are almost identical.

###  5.4 Corrupted CIFAR-10

Next we consider a constructed dataset where the bias and signal variables are
far more entangled. Following Nam et al. (2020), we construct a variant of
corrupted CIFAR-10 Corrupted CIFAR-101 in Nam et al. (2020), with corruptions:
Snow, Frost, Fog, Brightness, Contrast, Spatter, Elastic, JPEG, Pixelate,
Saturate. During training these correlate with each class. Using corruptions
to benchmark neural network robustness is not new – Hendrycks and Dietterich
(2019), and using them as a class-informative bias yields an extremely
challenging dataset.

Not only are corruptions often nuanced, they are also destructive, meaning
that distentangling these from the underlying image is not always possible.
Blurring, elastic distortion, JPEG compression, and pixelation are all
examples non-reversible corruptions. While some (like contrast or brightness
adjustment) are easier to change, it is understandable that earlier work was
only able to achieve 31.66% test accuracy at a high bias ratio. We were able
to achieve 39.93% test accuracy at a bias ratio of 100%. While LfF can achieve
59.95% on corrupted CIFAR-10, this requires a relatively low bias ratio of
95%, once more evidencing the reliance of earlier works on bias-free training
data. We also note that the reconstructions in Figure 4 (f) are blurry,
highlighting the need for an improved encoder-decoder model.

(a) $x$: BG coloured MNIST

(b) $\hat{x_{\delta}}$: LAD reconstruction

(c) $x$: FG coloured MNIST

(d) $\hat{x_{\delta}}$: LAD reconstruction

(e) $x$: corrupted CIFAR-10

(f) $\hat{x_{\delta}}$: LAD reconstruction

Figure 4: Training data examples for (a) background coloured MNIST, (c)
foreground colorued MNIST, and (e) corrupted CIFAR-10, with corresponding LAD
reconstructions for each dataset in (b), (d), and (f), respectively.

##  6 Discussion and Conclusion

DNNs tend to focus on easy-to-learn features, should those features be
sufficiently informative of the target. In this paper we showed that this
problematic behaviour means that DNNs are ill-equipped to handle a ubiquitous
form of sample selection bias known as collider bias. The process of
collecting and curating training data can often create a scenario where test
data differs substantially from training data. When the training data contains
a confounding signal (such as lighting conditions), DNNs will generalise
poorly. We argue that it is the deep structure of neural networks, combined
with the gradient-driven learning process used that amplifies their dependence
on easy-to-learn confounding signals.

We presented LAD, a method to produce latent adversarial examples that
specifically target the easy-to-learn confounding signals in the data
manifold. Using a VQ-VAE to approximate the data manifold corresponding to
causal and confounding signals, we leverage the tendency of DNNs to latch on
to easy-to-learn features and define an appropriate adversarial walk on this
manifold. Decoding the adjusted latent manifold back to the image space yields
augmented data where confounding signals are largely mitigated against. A
classifier trained on this new data generalises better. We evidenced
substantial test accuracy gains of 76.12% on background coloured MNIST, 35.47%
on foreground coloured MNIST, and 8.27% on corrupted CIFAR-10, even when the
training data was 100% biased.

Since LAD does not require any bias-free data, we believe we are moving toward
solving the broad issue that neural networks latch on to easier-to-learn
features, and evidence this in the collider bias settings. While we focus on
constructed datasets that demonstrate effectively the problem at hand,
extending the ideas and solutions presented herein to broader notions of
dataset bias and neural network robustness is a natural progression and is
planned for future work.

#### Acknowledgements

Our work was supported in part by the EPSRC Centre for Doctoral Training in
Data Science, funded by the UK Engineering and Physical Sciences Research
Council (grant EP/L016427/1) and the University of Edinburgh. The opinions
expressed and arguments employed herein do not necessarily reflect the
official views of these funding bodies.

## References

  * Arjovsky et al. (2019) Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz.  Invariant Risk Minimization.  _arXiv e-prints_ , July 2019.
  * Arpit et al. (2017) Devansh Arpit, Stanisław Jastrzębski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S. Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, and Simon Lacoste-Julien.  A closer look at memorization in deep networks.  In _Proceedings of the International Conference on Machine Learning_ , 2017.
  * Bahng et al. (2020) Hyojin Bahng, Sanghyuk Chun, Sangdoo Yun, Jaegul Choo, and Seong Joon Oh.  Learning de-biased representations with biased representations.  In _Proceedings of the International Conference on Machine Learning_ , 2020.
  * Beutel et al. (2017) Alex Beutel, Jilin Chen, Zhe Zhao, and Ed H. Chi.  Data decisions and theoretical implications when adversarially learning fair representations.  _arXiv e-prints_ , art. arXiv:1707.00075, June 2017.
  * Bras et al. (2020) Ronan Le Bras, Swabha Swayamdipta, Chandra Bhagavatula, Rowan Zellers, Matthew E. Peters, Ashish Sabharwal, and Yejin Choi.  Adversarial filters of dataset biases.  In _Proceedings of the International Conference on Machine Learning_ , 2020.
  * Caron et al. (2018) Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Matthijs Douze.  Deep clustering for unsupervised learning of visual features.  In _Proceedings of the European Conference on Computer Vision_ , 2018.
  * Edwards and Storkey (2016) Harrison Edwards and Amos J. Storkey.  Censoring representations with an adversary.  In _Proceedings of International Conference on Learning Representations_ , 2016.
  * Engstrom et al. (2019) Logan Engstrom, Brandon Tran, Dimitris Tsipras, Ludwig Schmidt, and Aleksander Madry.  Exploring the landscape of spatial robustness.  In _International Conference on Machine Learning_ , pages 1802–1811, 2019.
  * Fawzi et al. (2016) A. Fawzi, H. Samulowitz, D. Turaga, and P. Frossard.  Adaptive data augmentation for image classification.  In _Proceedings of IEEE International Conference on Image Processing_ , 2016.
  * Geirhos et al. (2020) Robert Geirhos, Jörn-Henrik Jacobsen, Claudio Michaelis, Richard Zemel, Wieland Brendel, Matthias Bethge, and Felix A. Wichmann.  Shortcut learning in deep neural networks.  _arXiv e-prints_ , art. arXiv:2004.07780, April 2020.
  * Goel et al. (2020) Karan Goel, Albert Gu, Yixuan Li, and Christopher Ré.  Model patching: Closing the subgroup performance gap with data augmentation.  _arXiv e-prints_ , art. arXiv:2008.06775, August 2020.
  * Goodfellow et al. (2015) Ian Goodfellow, Jonathon Shlens, and Christian Szegedy.  Explaining and harnessing adversarial examples.  In _Proceedings of International Conference on Learning Representations_ , 2015.
  * Goodfellow et al. (2014) Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy.  Explaining and harnessing adversarial examples.  _arXiv preprint arXiv:1412.6572_ , 2014.
  * Gowal et al. (2020) Sven Gowal, Chongli Qin, Po-Sen Huang, Taylan Cemgil, Krishnamurthy Dvijotham, Timothy Mann, and Pushmeet Kohli.  Achieving robustness in the wild via adversarial mixing with disentangled representations.  In _Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition_ , June 2020.
  * Gulrajani and Lopez-Paz (2020) Ishaan Gulrajani and David Lopez-Paz.  In search of lost domain generalization.  _arXiv e-prints_ , art. arXiv:2007.01434, July 2020.
  * He et al. (2016) Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun.  Identity mappings in deep residual networks.  In _Proceedings of fourteenth European Conference on Computer Vision_. Springer, 2016.
  * Heckman (1979) J. J. Heckman.  Sample selection bias as a specification error.  _Econometrica_ , 47:153–162, 1979.
  * Hendrycks and Dietterich (2019) Dan Hendrycks and Thomas G. Dietterich.  Benchmarking neural network robustness to common corruptions and perturbations.  In _Proceedings of International Conference on Learning Representations_ , 2019.
  * Hendrycks et al. (2020) Dan Hendrycks, Norman Mu, Ekin D. Cubuk, Barret Zoph, Justin Gilmer, and Balaji Lakshminarayanan.  AugMix: A simple data processing method to improve robustness and uncertainty.  In _Proceedings of the International Conference on Learning Representations_ , 2020.
  * Jo and Bengio (2017) Jason Jo and Yoshua Bengio.  Measuring the tendency of CNNs to learn surface statistical regularities.  _arXiv e-prints_ , art. arXiv:1711.11561, November 2017.
  * Kanbak et al. (2018) Can Kanbak, Seyed-Mohsen Moosavi-Dezfooli, and P. Frossard.  Geometric robustness of deep networks: Analysis and improvement.  In _Proceedings of IEEE/CVF Conference on Computer Vision and Pattern Recognition_ , 2018.
  * Karras et al. (2018) Tero Karras, Samuli Laine, and Timo Aila.  A style-based generator architecture for generative adversarial networks.  In _Proceedings of Conference on Computer Vision and Pattern Recognition_ , 2018.
  * Krizhevsky et al. (2009) Alex Krizhevsky, Geoffrey Hinton, et al.  Learning multiple layers of features from tiny images.  Technical report, Citeseer, 2009.
  * Larsen et al. (2016) Anders Boesen Lindbo Larsen, Søren Kaae Sønderby, Hugo Larochelle, and Ole Winther.  Autoencoding beyond pixels using a learned similarity metric.  In _Proceedings of International conference on machine learning_ , 2016.
  * LeCun et al. (2010) Yann LeCun, Corinna Cortes, and CJ Burges.  MNIST handwritten digit database.  _ATT Labs [Online]. Available: http://yann.lecun.com/exdb/mnist_ , 2, 2010.
  * Madry et al. (2018) Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu.  Towards Deep Learning Models Resistant to Adversarial Attacks.  In _Proceedings of International Conference on Learning Representations_ , 2018.
  * McCoy et al. (2019) R. Thomas McCoy, Ellie Pavlick, and Tal Linzen.  Right for the wrong reasons: Diagnosing syntactic heuristics in natural language inference.  In _Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics_ , 2019.
  * Minderer et al. (2020) Matthias Minderer, Olivier Bachem, Neil Houlsby, and Michael Tschannen.  Automatic shortcut removal for self-supervised representation learning.  In _Proceedings of the International Conference on Machine Learning_ , 2020.
  * Nam et al. (2020) Junhyun Nam, Hyuntak Cha, Sungsoo Ahn, Jaeho Lee, and Jinwoo Shin.  Learning from failure: Training debiased classifier from biased classifier.  _arXiv e-prints_ , art. arXiv:2007.02561, July 2020.
  * Qiu et al. (2019) Haonan Qiu, Chaowei Xiao, Lei Yang, Xinchen Yan, Honglak Lee, and Bo Li.  SemanticAdv: Generating adversarial examples via attribute-conditional image editing.  In _Proceedings of European Conference on Computer Vision_ , 2019\.
  * Stachura et al. (2020) Damian Stachura, Christopher Galias, and Konrad Zolna.  Leakage-robust classifier via mask-enhanced training.  In _The Student Abstrack Track of the Thirty-Fourth AAAI Conference on Artificial Intelligence_ , 2020.
  * Storkey (2009) Amos J. Storkey.  When training and test sets are different: Characterizing learning transfer.  _Dataset Shift in Machine Learning_ , pages 3–28, 2009.
  * Stutz et al. (2019) David Stutz, Matthias Hein, and Bernt Schiele.  Disentangling adversarial robustness and generalization.  In _Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition_ , 2019.
  * Swayamdipta et al. (2020) Swabha Swayamdipta, Roy Schwartz, Nicholas Lourie, Yizhong Wang, Hannaneh Hajishirzi, Noah A. Smith, and Yejin Choi.  Dataset cartography: Mapping and diagnosing datasets with training dynamics.  In _Proceedings of the Conference on Empirical Methods in Natural Language Processing_ , 2020.
  * Szegedy et al. (2013) Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus.  Intriguing properties of neural networks.  _arXiv preprint arXiv:1312.6199_ , 2013.
  * Van Den Oord et al. (2017) Aaron Van Den Oord, Oriol Vinyals, and others.  Neural discrete representation learning.  In _Advances in Neural Information Processing Systems_ , 2017\.
  * Zhang et al. (2018) Brian Hu Zhang, Blake Lemoine, and Margaret Mitchell.  Mitigating unwanted biases with adversarial learning.  In _Proceedings of the 2018 AAAI/ACM Conference on AI, Ethics, and Society_. Association for Computing Machinery, 2018.  doi: 10.1145/3278721.3278779.