Further author information:
John B. Sigman, E-mail<EMAIL_ADDRESS>
# Background Adaptive Faster R-CNN for Semi-Supervised Convolutional Object
Detection of Threats in X-Ray Images

John B. Sigman  Gregory P. Spell  Kevin J Liang  and Lawrence Carin Duke
University  Durham  NC 27708  United States of America

###### Abstract

Recently, progress has been made in the supervised training of Convolutional
Object Detectors (e.g. Faster R-CNN) for threat recognition in carry-on
luggage using X-ray images. This is part of the Transportation Security
Administration’s (TSA’s) mission to ensure safety for air travelers in the
United States. Collecting more data reliably improves performance for this
class of deep algorithm, but requires time and money to produce training data
with threats staged in realistic contexts. In contrast to these hand-collected
data containing threats, data from the real-world, known as the Stream-of-
Commerce (SOC), can be collected quickly with minimal cost; while technically
unlabeled, in this work we make a practical assumption that these are without
threat objects. Because of these data constraints, we will use both labeled
and unlabeled sources of data for the automatic threat recognition problem. In
this paper, we present a semi-supervised approach for this problem which we
call Background Adaptive Faster R-CNN. This approach is a training method for
two-stage object detectors which uses Domain Adaptation methods from the field
of deep learning. The data sources described earlier are considered two
“domains”: one a hand-collected data domain of images with threats, and the
other a real-world domain of images assumed without threats. Two domain
discriminators, one for discriminating object proposals and one for image
features, are adversarially trained to prevent encoding domain-specific
information. Penalizing this encoding is important because otherwise the
Convolutional Neural Network (CNN) can learn to distinguish images from the
two sources based on superficial characteristics, and minimize a purely
supervised loss function without improving its ability to recognize objects.
For the hand-collected data, only object proposals and image features
completely outside of areas corresponding to ground truth object bounding
boxes (background) are used. The losses for these domain-adaptive
discriminators are added to the Faster R-CNN losses of images from both
domains. This technique enables threat recognition based on examples from the
labeled data, and can reduce false alarm rates by matching the statistics of
extracted features on the hand-collected backgrounds to that of the real world
data. Performance improvements are demonstrated on two independently-collected
datasets of labeled threats.

###### keywords:

Deep Learning, Threat Recognition, Security Screening, Convolutional Neural
Networks, Machine Learning, Computer Vision, Object Detection

AUC

    area under the curve
BA Faster R-CNN

    Background Adaptive Faster R-CNN
CNN

    Convolutional Neural Network
UDA

    Unsupervised Domain Adaptation
Faster R-CNN

    Faster Regions with Convolutional Neural Networks
IOU

    Intersection Over Union
LAGs

    liquids, aerosols, and gels
GRL

    Gradient Reversal Layer
mAP

    mean Average Precision
ROC

    Receiver Operating Characteristic
DANN

    Domain Adaptive Neural Network
SOC

    Stream-of-Commerce
ROI

    Region of Interest
TIP

    threat image projection
TSA

    Transportation Security Administration
AP

    Average Precision
$T_{p}$

    True Positive
$F_{p}$

    False Positive
$F_{n}$

    False Negative

##  1 Introduction

Personal baggage security checkpoints consist of X-ray scanners and human
operators, and their purpose is to prevent harm by capturing threatening
objects and weapons. Modern X-ray scanner systems use sophisticated technology
to construct internal views of bags or belongings, but these systems are still
reliant on human operators to identify and locate threats. Bags can be highly
cluttered environments, and owing to the transmissive nature of X-ray sensing,
objects layer on top of each other in views. Some examples of threat objects
in bags can be seen in Figure 1. Operators must be vigilant to catch all of a
diverse, constantly evolving, but relatively rare set of prohibited items; all
while maintaining high passenger throughput. In order to reduce the cognitive
load on these human threat screeners, we seek automated solutions for threat
screening.

(a)

(b)

(c)

(d)

Figure 1: Sample detections from mixed datasets of (1(a)) knife, (1(b)) gun,
(1(c)) blunt, and (1(d)) liquids, aerosols, and gels (LAGs) threats. Images
scanned with a laboratory prototype not in TSA configuration.

In the field of computer vision, identifying and localizing objects in a scene
is called object detection. Recently, convolutional neural networks (CNNs) [1]
have resulted in major improvements in performance, with many modern object
detection models [2, 3, 4, 5, 6] utilizing CNNs as a key component. Given
their excellent performance on benchmark datasets such as Cityscapes [7] and
MS COCO [8], these models are now being considered for certain real world
settings, including baggage screening at airport checkpoints. However, the
baggage scan images are different from the kinds of images in common object
detection benchmarks. In particular, while common benchmark datasets are
constructed to have a high number of object instances per image, threat items
at checkpoints occur comparably infrequently. For example, the United States
Transportation Security Administration (TSA) caught 4,432 firearms in carry-on
baggage at US airport checkpoints in 2019, but against a backdrop of a billion
passengers [9].

This paper concerns an application of convolutional object detection using
unlabeled imagery to improve threat detection in X-ray images. Unlike the
expensive staging, imaging, and labeling of threat data, real-world scans can
be readily and cheaply collected from functioning airport checkpoints. These
real-world data are referred to as the Stream-of-Commerce (SOC). Modern deep
neural network techniques are extremely data hungry, showing log-linear
improvements with dataset size, i.e. roughly linear performance increases with
exponentially increasing numbers of examples [10]. A technique which could
train with these vast quantities of unlabeled images to improve threat
detection is therefore highly valuable. Using such images would not be
intended to improve recall (otherwise known as probability of detection).
Instead, by exposing the model during training to a broader variety of real-
world backgrounds we could reduce false alarm rates. However, strictly
supervised use of unlabeled imagery as negative examples (the SOC) contains
risks. Distinguishing patterns in the data (images) between the SOC and the
labeled dataset could be discovered by a sufficiently flexible neural network,
resulting in brittle predictions due to the difference in object occurrences
between these two sets. In our case, this means that, if used naïvely, the
network can recognize domain differences between hand-labeled data and SOC
data. Once the model has learned to distinguish the domains, it can encode
that images from the SOC all contain no objects and suppress detections,
undermining the goal of real-world threat detection. In order to overcome this
capacity of a Convolutional Neural Network (CNN) to distinguish domains, we
will use techniques from domain adaptation [11, 12].

In this paper, our contribution is to demonstrate the real-world use of a
variant of Domain Adaptive Faster R-CNN [13] that accounts for target shift
between the image domains. Our Background Adaptive Faster R-CNN makes a strong
assumption about the prior probability of targets in the target domain,
particularly that images from this domain have no foreground (threat) objects.
First we will give a brief introduction to Unsupervised Domain Adaptation
(UDA) and its use in object detection. Then, we will describe some related
works in the field of automatic threat detection in X-ray images, focusing on
recent work in modern deep convolutional approaches. Next, we will describe
how our method is used to enable learning from the threatless real-world data
(the SOC). In the results section, we will show some improvements in
performance using our technique to a baseline Faster Regions with
Convolutional Neural Networks (Faster R-CNN) [5] approach. These positive
results demonstrate successful use of the SOC data and hold great promise for
future applications of automatic threat recognition to airport security
checkpoints.

##  2 Background

In this section, we will describe the concepts and theory from recent works of
machine learning which are applied in Background Adaptive Faster R-CNN (BA
Faster R-CNN). Specifically, we will introduce the concepts of adversarial
training, target shift, and covariate shift from the UDA literature.

###  2.1 Unsupervised Domain Adaptation

In the most basic formulation of adversarial domain adaptation [11, 14], we
have access to a labeled dataset $\mathcal{D}^{S}$ from a source domain and an
unlabeled dataset $\mathcal{D}^{T}$ from a target domain, and we wish to train
a classifier that performs well on test data from the target domain without
using any labels from $\mathcal{D}^{T}$. We will consider two types of shifts
between data domains, defining them now as they pertain to image
classification [12, 15]. First, target shift refers to unequal label prior
probabilities between two distributions, $p(y)\neq p^{\prime}(y)$. The other
type is covariate shift, which refers to a difference between the conditional
distributions of an image given its class category: $p(x|y)\neq
p^{\prime}(x|y)$. One way to improve performance on the target dataset is to
train a domain-invariant classifier through matching the marginal distribution
of features extracted from the data $x$ of either dataset $\mathcal{D}^{T}$ or
$\mathcal{D}^{S}$. The marginal distribution of features, and not a class-
specific conditional feature distribution, is used because it only requires
the data and not the labels. Domain Adaptive Neural Network (DANN) [11]
introduced a method for learning domain-invariant features by using an
adversarial loss via domain discriminator. If the marginal distribution of
features $h$ extracted from target data are referred to by $p^{T}(h)$, and the
marginal distribution of features extracted from source data are $p^{S}(h)$,
then the domain-invariant features are achieved when:

$\displaystyle p^{S}(h)=p^{T}(h)$ (1)

Because these features depend on learnable parameters in a CNN, stating that
probability distributions are equal is not a static description of the data,
but implies the matching of these distribution by learning a suitable feature
extractor using adversarial training [13, 11, 14]. As shown previously [12],
if the prior probabilities of the target domain classes were known,
$p^{T}(y)$, then an adapted feature extractor for the target domain can be
learned by matching the distributions:

$\displaystyle p^{T}(h)=q^{S}(h)=\sum_{c}p^{S}(h|y=c)p^{T}(y=c)$ (2)

Where $c$ is one of the classes in $\mathcal{D}^{T}$ or $\mathcal{D}^{S}$, and
$q^{S}$ is a model distribution which is the class-conditional weighted
average of source features, weighted according to their incidence in the
target domain. This is not done under normal conditions because unsupervised
domain adaptation implies that we do not have $p^{T}(y=c)$.

###  2.2 Unsupervised Domain Adaptation in Object Detection

These concepts were extended to object detection in a self-driving car setting
[13] by matching the distributions of CNN features of the overall images and
the proposed objects, demonstrating that an object detection model trained on
mostly clear weather day images can still perform well on night, foggy, or
inclement weather settings. As in DANN, the method assumed that only marginal
feature distributions needed to be matched to produce domain-invariant
features. In this case, this was a safe assumption, because the target dataset
of cloudy images was synthetically produced by transforming the source dataset
of sunny images, guaranteeing equal likelihood of object occurrences in images
from both sets. This simple treatment of the object occurrences in the two
data sources will not work for threat recognition in X-ray images. An
individual image from the SOC has a low prior probability of containing a
threat while labeled data were all staged with threats.

##  3 Related Works

This paper describes an application of recent developments in computer vision
to the problem of automated threat detection in luggage, but this problem has
been studied for many years. Early work using machine learning for X-ray image
classification relied on hand-crafted features such as Difference of Gaussians
(DoG) and scale-invariant feature transform (SIFT) [16]. These hand-crafted
features were then fed to a traditional classifier such as a Support Vector
Machine (SVM) [17], leveraging an approach known as Bag-of-Visual-Words [18,
19, 20, 21, 22].

The first application of deep learning algorithms to images of X-ray baggage
involved manually cropping regions of x-ray images and classifying the crops
according to different categories of firearms and knives, as well as classes
of camera and laptop [23]. This was accomplished via transfer learning, in
which a pre-trained CNN was fine-tuned for the specific datasets of X-ray
baggage. Deep object detection algorithms have also been investigated for use
in X-ray baggage scans [24, 25, 26, 27]. In these investigations, a range of
CNN feature extractors have been examined, including VGG [28], Inception V2
[29], and ResNet [30]. Furthermore, a variety of CNN-based detection
algorithms are adapted for X-ray baggage: Faster R-CNN [5], R-FCN [31], and
YOLOv2 [32]. We encourage readers to see a recent survey [33] for a more
thorough overview of these efforts. A subset of these works [26, 27]
specifically sought to incorporate deep learning techniques into the security
systems used by the Transportation Security Administration (TSA) at U.S.
airport checkpoints. In many settings, acquiring unlabeled data is
significantly easier than labeled data. For X-Ray baggage scanner threat
detection settings, this is especially the case, as acquiring labeled data
often also requires assembling the threat-containing bags and scanning them.
Thus, semi-supervised approaches have drawn considerable interest as an
efficient way to leverage more data. Another approach is threat image
projection (TIP), which digitally adds threat objects into a bag using various
synthetic methods [34], this is possible here due to the transmissive nature
of X-ray, .

##  4 Methods

###  4.1 Data

Consider two data-generating processes $p^{\textrm{SOC}}(x,y)$ and
$p^{\textrm{HC}}(x,y)$, which model the appearance of objects,
$y=\\{(c,b)\\}$, in an image $x$. In this notation, the set $y$ contains
objects described by $c$, a categorical random variable indicating class, and
$b\in\mathbb{R}^{4}$ describing the coordinates of the object’s bounding box.
Let $\mathcal{D}^{\textrm{SOC}}$ be the set of data samples from
$p^{\textrm{SOC}}(x,y)$, and let $\mathcal{D}^{\textrm{HC}}$ be the set of
data samples from $p^{\textrm{HC}}(x,y)$. Data from $p^{\textrm{SOC}}(x,y)$
are our Stream-of-Commerce (SOC) data, gathered from checkpoints, and are the
target domain. Data from $p^{\textrm{HC}}(x,y)$ are our “Hand-Collected”
source domain data, which were collected by subcontractors staging threats in
realistic context during TSA Contract HSTS04-16-C-CT7020 [26, 27].

By design, $p^{\textrm{SOC}}$ and $p^{\textrm{HC}}$ have a target shift
between them. Namely, $p^{\textrm{SOC}}$ contains little to no threat objects,
$p^{SOC}(|y|>0)=0$, and every image in $p^{\textrm{HC}}$ contains a threat
object, $p^{HC}(|y|>0)=1$. We can make the following statements of target
shift (Equation 3) and covariate shift (Equation 4):

$\displaystyle p^{\textrm{SOC}}(y)$ $\displaystyle\neq p^{\textrm{HC}}(y)$ (3)
$\displaystyle p^{\textrm{SOC}}(x|y)$ $\displaystyle\neq p^{\textrm{HC}}(x|y)$
(4)

We seek a method for learning an object detection model which addresses these
disparities to more effectively find threats in the target domain.

###  4.2 Supervised Auxiliary Negative Training

A naïve way to learn from the objectless images is to treat them identically
as the labeled examples in the training set. This implicitly treats all
regions of the SOC images as background [35], and tends to not work in
practice. First, if the number of labeled images is small, adding too many
unlabeled images dilutes the dataset, resulting in a large class imbalance
that may drown out the learning signal for positive samples. Down-weighting
negative samples emphasizes the learning signal for the actual objects of
interest, but also reduces the value of the unlabeled set. Hard negative
mining, or the focal loss [36] focus learning on the hardest background
examples, but makes the assumption that the unlabeled data is from the same
distribution as labeled dataset.

In this specific case, $\mathcal{D}^{\textrm{SOC}}$ and
$\mathcal{D}^{\textrm{HC}}$ have some inherent differences which we cast as
covariate shift. We hypothesize that these differences could include but not
be limited to: idiosyncratic reconstruction noise on the periphery of images,
signatures from the individual laboratory prototypes used to stage threat
data, or effects from the close queuing of bags in scans which occurs in the
real world and not in staged data collections. While these might not seem like
meaningful differences, a sufficiently expressive feature extractor can pick
up on these discrepancies and rapidly learn to suppress any detections in SOC
images. While this reduces false positives, it could reduce the model’s
effectiveness when detecting threats in the real world, because it was only
ever shown real-world data without threats.

We have conducted this experiment and have observed empirically that the
Faster R-CNN model is able to shatter metrics on the train and test SOC
images. That is, while having some level of expected generalization error when
evaluated on the test set of hand-labeled data, the model can predict without
any false alarms across the test set of SOC data. These domain-dependent
differences between the hand-collected data and the SOC are not a problem when
the object detection model is trained with only labeled data, possibly only
slightly increasing generalization error. However, they could be catastrophic
if the model is allowed to learn to discriminate domains, which occurs when
using supervised learning on negative examples from the SOC.

###  4.3 Adversarial Training and Background Matching

(a)

(b)

(c)

Figure 2: Conceptual diagram included to demonstrate the intuition of this
approach for anomaly/threat detection. (2(a)) Separation of threats and
background when training with labeled data. (2(b)) Application of the
supervised learned threat detector when applied to heterogenous real-world
data. The set of “Real World Cluttering Objects” crosses over the decision
boundary to imply increased false alarm rates in the real world. (2(c)) Using
adversarial training for the feature extractor to match the statistics of the
backgrounds with the real-world data decreases false alarms while still
learning robust features.

Our proposed method, Background Adaptive Faster R-CNN (BA Faster R-CNN), is a
training procedure applied to the Faster R-CNN model [5], which selectively
applies the unsupervised domain adaptive Faster R-CNN [13] losses. Its
intended use is in an anomaly/threat detection situation, with two separate
datasets, such as $\mathcal{D}^{\textrm{HC}}$ and
$\mathcal{D}^{\textrm{SOC}}$. Images from both sets train the Faster R-CNN
loss for threat detection, and images from both are used simultaneously in
adversarial domain adaptation. The method exposes the model to a wider variety
of backgrounds than those in $\mathcal{D}^{\textrm{HC}}$ and through
adversarial distribution matching, the CNN has barriers preventing it from
encoding which dataset each object proposal comes from based on image
signatures unrelated to the objects in a bag. A conceptual diagram is shown in
Figure 2.

We will borrow previous notation [13] to describe probability distributions of
features which are part of the Faster R-CNN algorithm. $p(B,I)$ is a marginal
probability distribution of features extracted from feature map pixels $I$
within bounding box $B$. $p(I)$ is a marginal probability distribution of the
extracted feature map pixel, when each pixel is treated as an independent
observation.

Extending previous work [13], we address a particular case of target shift
between domains in addition to covariate shift. As described in Equation 2, if
we know the prior probability of labels in the target domain, we can perform
adversarial domain adaptation by matching target features with class-
conditional source features, weighted according to their incidence in the
target domain. This requires matching the model distributions $q(B,I)$ and
$q(I)$ to their respective distribution of features in the target
$p^{SOC}(B,I)$ and $p^{SOC}(I)$:

$\displaystyle p^{SOC}(B,I)=q(B,I)$
$\displaystyle=\sum_{c}{p^{HC}(B,I|c)p^{SOC}(c)}$ (5) $\displaystyle
p^{SOC}(I)=q(I)$ $\displaystyle=\sum_{c}{p^{HC}(I|c)p^{SOC}(c)}$ (6)

The class-conditional distributions of instance features $p(B,I|c)$ and image
features $p(I|c)$ refer to features corresponding to the locations of ground
truth classes $c$, which can be one of many threat classes or background.
Under the assumption of no threats in the SOC, the class prior probability is
one for background and zero for any foreground class.

$\displaystyle p^{SOC}(c)=\begin{cases}1\quad&c=\textrm{background}\\\
0\quad&\textrm{otherwise}\end{cases}$ (7)

Substituting Equation 7 into Equations 5 and 6 gives:

$\displaystyle p^{SOC}(B,I)$ $\displaystyle=p^{HC}(B,I|c=\textrm{background})$
(8) $\displaystyle p^{SOC}(I)$ $\displaystyle=p^{HC}(I|c=\textrm{background})$
(9)

Despite a target shift between the two domains, we can still build from
previous techniques [13] so long as we only match the background portions of
the hand-collected data to the SOC. We achieve background instance matching
(Equation 8) by first obtaining candidate object proposals in the standard way
via Faster R-CNN. For object proposals from $\mathcal{D}^{\textrm{HC}}$, we
designate as background any proposal for which the Intersection Over Union
(IOU) with a ground truth threat object is below a certain threshold (in our
experiments, 0.01). These background proposals are fed to an adversarial
domain discriminator for object instances, along with all proposals made from
$\mathcal{D}^{\textrm{SOC}}$.

For background image matching (Equation 9), we first anti-crop the features of
images from $\mathcal{D}^{\textrm{HC}}$ according to the ground truth boxes of
threats. These feature maps, which have been masked in pixels corresponding to
ground truth box locations, are used to train the adversarial pixel domain
discriminator, alongside all of the feature map pixels from
$\mathcal{D}^{\textrm{SOC}}$. A third domain adaptation loss, a consistency
regularization [13], enforces that the two domain classifiers predict the same
domain. This loss is implemented as the $\ell_{2}$ distance between the domain
classifier outputs for an image.

##  5 Results

In this section we give results for the application of BA Faster R-CNN to
images of threats in baggage. These results are not meant to be compared
across datasets, only within them. While each scan of a single bag produces
multiple views (each an image), we calculate precision/recall scores and mean
Average Precision (mAP) on a single-image basis, deliberately excluding the
sizable impact that multiple views of a threat per bag has on detection rates
for simplicity. This impact is outside the scope of our paper; our purpose is
to indicate results of applying BA Faster R-CNN to the problem of threat
detection in carry-on luggage. While we show here some improvements in
precision and recall of using BA Faster R-CNN on the labeled data collected in
TSA Contract HSTS04-16-C-CT7020, its real purpose is to improve generalization
performance when tested on held-out images from the SOC. Due to national
security concerns and data sensitivity, we omit these results.

###  5.1 Datasets

Results in Section 5 were trained with datasets of over 6,000 labeled images
for Dataset A and over 19,000 labeled images for Dataset B. A training set of
over 35,000 SOC images were used for Dataset A and over 70,000 SOC images were
used for Dataset B. Performance was evaluated with over 1,100 labeled images
from each set, and 500 SOC images from each set were used as a representative
sample to estimate false alarm rates.

###  5.2 Labeled Data Performance

For our performance metrics, we will show improvements in the precision/recall
metric on a held out labeled set of images from two different vendors, Dataset
A and Dataset B. For our experiments, we used the Tensorflow Object Detection
implementation [37], which we extended for X-ray images and object detection
domain-adaptive components. All experiments were conducted with ResNet101 [30]
as the feature extractor and Faster R-CNN [5] as the meta-architecture. For
all experiments, we use domain adaptive loss weighting [13] $\lambda=0.1$ and
Gradient Reversal Layer (GRL) weight [13, 11] 0.1.

We ran three different experiments on each dataset. First, we trained a
supervised Faster R-CNN baseline. Then, we included only the instance loss
component, which matches feature distributions of extracted proposals as in
Equation 8. Finally, we trained a model using instance losses and image
losses. Image losses are used to match the extracted feature pixel
distributions, as in Equation 8. When both image and instance losses are used,
we also include the consistency loss [13].

####  5.2.1 Dataset A

Dataset A saw performance increases for nearly all labeled data classes when
evaluated on the held-out set. These precision/recall metrics are graphed in
Figure 3, and summarized in Table 1. Average Precision (AP) on Knives data was
only improved by using all three loss terms, while AP was the best for the
LAGs class when used with supervised learning.

Figure 3: Precision/Recall for Dataset A, treating all views as independent
images. The solid lines correspond to the purely Supervised model, and the
dashed lines correspond to Semi-Supervised use of BA Faster R-CNN when all
three domain-adaptive loss terms are applied. These results are summarized in
Table 1

| Loss term | Threat Class
---|---|---
Model Version | Instance | Image | Consistency | Knives | Blunts | Guns | LAGs
Faster R-CNN, Figure 3: (—) |  |  |  | 0.832 | 0.989 | 0.931 | 0.980
+Match instances | ✓ |  |  | 0.829 | 0.989 | 0.948 | 0.978
+Match instances and images, Figure 3: (– –) | ✓ | ✓ | ✓ | 0.839 | 0.992 | 0.955 | 0.978

Table 1: Tabulated APs on labeled data from Dataset A.

####  5.2.2 Dataset B

Figure 4 shows precision/recall curves for the labeled held-out set from
Dataset B. There was an increase in the mAP metric for all labeled data
classes using background domain adaptation. Guns and LAGs did slightly worse
using all three domain-adaptive losses than when only applied to instance
losses.

Figure 4: Precision/Recall for Dataset B, treating all views as independent
images. The solid lines correspond to the purely Supervised model, and the
dashed lines correspond to Semi-Supervised use of BA Faster R-CNN when all
three domain-adaptive loss terms are applied. These results are summarized in
Table 2

| Loss term | Threat Class
---|---|---
Model Version | Instance | Image | Consistency | Knives | Blunts | Guns | LAGs
Faster R-CNN, Figure 4: (—) |  |  |  | 0.894 | 0.977 | 0.985 | 0.936
+Match instances | ✓ |  |  | 0.908 | 0.980 | 0.987 | 0.956
+Match instances and images, Figure 4: (– –) | ✓ | ✓ | ✓ | 0.914 | 0.982 | 0.986 | 0.951

Table 2: Tabulated APs on labeled data from Dataset B.

##  6 Concluding Remarks

This paper describes Background Adaptive Faster R-CNN, a technique for using
real-world unlabeled data to improve threat detection in X-ray images. As in a
typical Unsupervised Domain Adaptation (UDA) setup, two datasets are used. The
first of these is a source dataset, which is small and contains labeled
examples of objects. The second dataset is our target domain, and contains
many more images without labels. By matching the class conditional feature
distributions of the background in the labeled data to the marginal
distribution in the unlabeled data, we can use UDA techniques despite target
shift between the two datasets.

This technique was required in order to use large quantities of real-world
data because of the well-known tendency of deep convolutional feature
extractors to learn brittle features if these are enough to separate the
training data. In our case, this meant that with supervised use of large
quantities of real-world SOC data, then the feature extractor need only
recognize that the image was from the SOC to achieve low losses. Instead, we
penalize the encoding of domain-specific information via two adversarial
domain discriminators, which require the model learn from cluttering objects
in the SOC.

We demonstrate BA Faster R-CNN on two independently-collected datasets. In
this application, the target threat classes are guns, knives, blunt objects,
and liquid, aerosols, or gels. For the X-ray baggage datasets that we examine,
we find that BA Faster R-CNN succeeds in improving precision/recall
performance for most threat classes in the labeled portion of the dataset. It
is possible for BA Faster R-CNN to reduce false alarm rates in the real world,
but we omit such results here.

### Acknowledgments

This work was funded by the Transportation Security Administration (TSA) under
Contract #HSTS04-16-C-CT7020 We thank our sponsors in the Department of
Homeland Security as well as our collaborators in the X-ray sensing industry.

## References

  * [1] Y. Lecun, B. Boser, J. Denker, D. Henderson, R. E. Howard, W. Hubbard, and L. D. Jackel, “Backpropagation Applied to Handwritten Zip Code Recognition,” Neural Computation , 1989.
  * [2] R. Girshick, J. Donahue, T. Darrell, and J. Malik, “Rich feature hierarchies for accurate object detection and semantic segmentation,” Conference on Computer Vision and Pattern Recognition , 2014.
  * [3] R. Girshick, “Fast R-CNN,” International Conference on Computer Vision , 2015.
  * [4] W. Liu, D. Anguelov, D. Erhan, C. Szegedy, S. Reed, C.-Y. Fu, and A. C. Berg, “SSD: Single Shot MultiBox Detector,” European Conference on Computer Vision , 2016.
  * [5] S. Ren, K. He, R. Girshick, and J. Sun, “Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks,” Advances in Neural Information Processing Systems , 2015.
  * [6] J. Redmon, S. Divvala, R. Girshick, and A. Farhadi, “You Only Look Once: Unified, Real-Time Object Detection,” Conference on Computer Vision and Pattern Recognition , 2016.
  * [7] M. Cordts, M. Omran, S. Ramos, T. Rehfeld, M. Enzweiler, R. Benenson, U. Franke, S. Roth, and B. Schiele, “The Cityscapes Dataset for Semantic Urban Scene Understanding,” Conference on Computer Vision and Pattern Recognition , 2016.
  * [8] T.-Y. Lin, M. Maire, S. Belongie, L. Bourdev, R. Girshick, J. Hays, P. Perona, D. Ramanan, C. L. Zitnick, and P. Dolí, “Microsoft COCO: Common Objects in Context,” European Conference on Computer Vision , 2014.
  * [9] “TSA Year in Review: 2019,” https://www.tsa.gov/blog/2020/01/15/tsa-year-review-2019 , 2020.
  * [10] C. Sun, A. Shrivastava, S. Singh, and A. Gupta, “Revisiting Unreasonable Effectiveness of Data in Deep Learning Era,” International Conference on Computer Vision , 2017.
  * [11] Y. Ganin, E. Ustinova, H. Ajakan, P. Germain, H. Larochelle, F. Laviolette, M. Marchand, and V. Lempitsky, “Domain-Adversarial Training of Neural Networks,” Journal of Machine Learning Research , 2015.
  * [12] Y. Li, S. Dai, L. Carin, and D. Carlson, “On Target Shift in Adversarial Domain Adaptation,” AISTATS , 2019.
  * [13] Y. Chen, W. Li, C. Sakaridis, D. Dai, and L. V. Gool, “Domain Adaptive Faster R-CNN for Object Detection in the Wild,” Conference on Computer Vision and Pattern Recognition , 2018.
  * [14] I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio, “Generative Adversarial Networks,” Advances In Neural Information Processing Systems , 2014.
  * [15] I. Redko, N. Courty, R. Flamary, and D. Tuia, “Optimal transport for multi-source domain adaptation under target shift,” arXiv preprint arXiv:1803.04899 , 2018.
  * [16] D. G. Lowe, “Object Recognition from Local Scale-Invariant Features,” in In Proceedings of the International Conference on Computer Vision (ICCV), 99(2), pp. 1150–1157, 1999.
  * [17] C. Cortes and V. Vapnik, “Support-vector networks,” Machine learning 20(3), pp. 273–297, 1995.
  * [18] M. Baştan, M. R. Yousefi, and T. M. Breuel, “Visual Words on Baggage X-Ray Images,” Computer Analysis of Images and Patterns. , pp. 360–368, 2011.
  * [19] M. Bastan, W. Byeon, and T. Breuel, “Object Recognition in Multi-View Dual Energy X-ray Images,” in In Proceedings of the British Machine Vision Conference (BMVC), January 2013.
  * [20] D. Turcsany, A. Mouton, and T. P. Breckon, “Improving Feature-Based Object Recognition for X-Ray Baggage Security Screening Using Primed Visual Words,” in In Proceedings of the IEEE International Conference on Industrial Technology (ICIT), February 2013.
  * [21] D. Mery, E. Svec, and M. Arias, “Object Recognition in Baggage Inspection Using Adaptive Sparse Representations of X-ray Images,” Image and Video Technology , pp. 709–720, 2016.
  * [22] M. E. Kundegorski, S. Akçay, M. Devereux, A. Mouton, and T. P. Breckon, “On Using Feature Descriptors as Visual Words for Object Detection within X-ray Baggage Security Screening,” in In Proceedings of the International Conference on Imaging for Crime Detection and Prevention (ICDP), November 2016.
  * [23] S. Akçay, M. E. Kundegorski, M. Devereux, and T. P. Breckon, “Transfer Learning Using Convolutional Neural Networks for Object Classification within X-ray Baggage Security Imagery,” in In Proceedings of the IEEE International Conference on Image Processing (ICIP), September 2016.
  * [24] S. Akcay and T. P. Breckon, “An Evaluation of Region Based Object Detection Strategies within X-ray Baggage Security Imagery,” in In Proceedings of the IEEE International Conference on Image Processing (ICIP), September 2017\.
  * [25] S. Akcay, M. E. Kundegorski, C. G. Willcocks, and T. P. Breckon, “Using Deep Convolutional Neural Network Architectures for Object Classification and Detection within X-ray Baggage Security Imagery,” IEEE Trans. Info. Forens. Sec. 13(9), pp. 2203–2215, 2018.  doi: 10.1109/TIFS.2018.2812196.
  * [26] K. J. Liang, G. Heilmann, C. Gregory, S. Diallo, D. Carlson, G. Spell, J. Sigman, K. Roe, and L. Carin, “Automatic Threat Recognition of Prohibited Items at Aviation Checkpoints with X-Ray Imaging: a Deep Learning Approach,” Proc SPIE, Anomaly Detection and Imaging with X-Rays (ADIX) III , 2018.
  * [27] K. J. Liang, J. B. Sigman, G. P. Spell, D. Strellis, W. Chang, F. Liu, T. Mehta, and L. Carin, “Toward Automatic Threat Recognition for Airport X-ray Baggage Screening with Deep Convolutional Object Detection,” arXiv preprint arXiv:1912.06329 , 2019.
  * [28] K. Simonyan and A. Zisserman, “Very Deep Convolutional Networks for Large-Scale Image Recognition,” in In Proceedings of the International Conference on Learning Representations (ICLR), May 2015.
  * [29] S. Ioffe and C. Szegedy, “Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift,” in In Proccedings of the International Conference on Machine Learning (ICML), 2015.
  * [30] K. He, X. Zhang, S. Ren, and J. Sun, “Deep Residual Learning for Image Recognition,” in In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016.
  * [31] J. Dai, Y. Li, K. He, and J. Sun, “R-FCN: Object Detection via Region-based Fully Convolutional Networks,” Advances In Neural Information Processing Systems , 2016.
  * [32] J. Redmon and A. Farhadi, “YOLO9000: Better, Faster, Stronger,” Conference on Computer Vision and Pattern Recognition , 2017.
  * [33] S. Akcay and T. Breckon, “Towards Automatic Threat Detection: A Survey of Advances of Deep Learning within X-ray Security Imaging,” arXiv preprint arXiv:2001.01293 , 2020.
  * [34] N. Bhowmik, Q. Wang, Y. F. A. Gaus, M. Szarek, and T. P. Breckon, “The Good, the Bad and the Ugly: Evaluating Convolutional Neural Networks for Prohibited Item Detection Using Real and Synthetically Composited X-ray Imagery,” arXiv preprint arXiv:1909.11508 , 2019.
  * [35] Y. Yang, K. J. Liang, and L. Carin, “Object detection as a positive-unlabeled problem,” arXiv preprint arXiv:2002.04672 , 2020.
  * [36] T.-Y. Lin, P. Goyal, R. Girshick, K. He, and P. Dollár, “Focal Loss for Dense Object Detection,” International Conference on Computer Vision , 2017.
  * [37] J. Huang, V. Rathod, C. Sun, M. Zhu, A. Korattikara, A. Fathi, I. Fischer, Z. Wojna, Y. Song, S. Guadarrama, and K. Murphy, “Speed/accuracy trade-offs for modern convolutional object detectors,” Conference on Computer Vision and Pattern Recognition , 2017.

  *[LAGs]: liquids, aerosols, and gels
  *[SOC]: Stream-of-Commerce
  *[CNN]: Convolutional Neural Network
  *[UDA]: Unsupervised Domain Adaptation
  *[Faster R-CNN]: Faster Regions with Convolutional Neural Networks
  *[BA Faster R-CNN]: Background Adaptive Faster R-CNN
  *[DANN]: Domain Adaptive Neural Network
  *[TSA]: Transportation Security Administration
  *[TIP]: threat image projection
  *[IOU]: Intersection Over Union
  *[mAP]: mean Average Precision
  *[GRL]: Gradient Reversal Layer
  *[AP]: Average Precision
  *[APs]: Average Precision


11institutetext: College of Computing & Informatics, Drexel University,
Philadelphia PA 19104, USA
11email<EMAIL_ADDRESS>
# Explainable AI for Fair Sepsis Mortality Predictive Model††thanks: This
manuscript has been accepted to the 22nd International Conference on
Artificial Intelligence in Medicine (AIME’24).

Chia-Hsuan Chang Both authors contributed equally. 0000-0001-9116-8244
Xiaoyang Wang††footnotemark:  0000-0002-8471-4670 Christopher C. Yang
0000-0001-5463-6926

###### Abstract

Artificial intelligence supports healthcare professionals with predictive
modeling, greatly transforming clinical decision-making. This study addresses
the crucial need for fairness and explainability in AI applications within
healthcare to ensure equitable outcomes across diverse patient demographics.
By focusing on the predictive modeling of sepsis-related mortality, we propose
a method that learns a performance-optimized predictive model and then employs
the transfer learning process to produce a model with better fairness. Our
method also introduces a novel permutation-based feature importance algorithm
aiming at elucidating the contribution of each feature in enhancing fairness
on predictions. Unlike existing explainability methods concentrating on
explaining feature contribution to predictive performance, our proposed method
uniquely bridges the gap in understanding how each feature contributes to
fairness. This advancement is pivotal, given sepsis’s significant mortality
rate and its role in one-third of hospital deaths. Our method not only aids in
identifying and mitigating biases within the predictive model but also fosters
trust among healthcare stakeholders by improving the transparency and fairness
of model predictions, thereby contributing to more equitable and trustworthy
healthcare delivery.

###### Keywords:

Fairness Explainable artificial intelligence MIMIC-IV Sepsis mortality
prediction.

##  1 Introduction

Artificial intelligence (AI) has the potential to revolutionize clinical
decision-making by providing support to clinicians. Predictive modeling, a
common AI technique, automates and accelerates various healthcare tasks, such
as readmission, mortality, and disease recognition. However, it is crucial to
prioritize fairness in these algorithms to ensure that the benefits of AI
decision-making are distributed equitably across diverse patient populations.
This helps to minimize the risk of perpetuating biases and inequalities in
healthcare outcomes. Additionally, explainable AI (XAI) is one of the
promising research topics in healthcare informatics [5]. XAI explains the
model’s prediction, assisting clinicians and practitioners in gaining insights
from data rather than mindlessly following the prediction outcomes [13].
Enhancing fairness and explainability gains more trust from the users [1, 14]
and is a key element of trustworthy AI designed for the healthcare system [5].

While various XAI techniques, such as SHapley Additive exPlanations (SHAP)
[8], are available to explain the contribution of features to predictive
performance, there remains a gap in explaining feature contributions to
fairness enhancement. Understanding how specific features impact fairness is
crucial, as this can help identify areas where biases may exist within the
model and enable targeted interventions to mitigate these disparities.
Therefore, exploring methods that provide explainability and facilitate the
evaluation on fairness enhancement within clinical predictive models is
essential.

Sepsis is one of the foremost life-threatening medical emergencies encountered
by critically ill patients in the United States, arising as a complex syndrome
that epitomizes the intricate interplay among the infecting microorganism, and
the host’s immune and coagulation responses. Annually, sepsis afflicts over
1.7 million adults in the United States, leading to a stark mortality rate
wherein more than 350,000 of these individuals succumb during their hospital
stay or are transitioned to hospice care [4]. Remarkably, sepsis is implicated
in one out of every three hospital fatalities, underscoring its critical
impact on healthcare outcomes. Given the pressing need to enhance clinical
decision-making in the management of sepsis—a condition with profound
implications for patient mortality—this study proposes a method, which
integrates the principles of fairness and explainability into machine learning
models tailored for sepsis mortality predictions.

The contributions of our proposed method are twofold: (1) we learn a fair
sepsis mortality predictive model for different races from a performance-
optimized predictive model by applying transfer learning, and (2) we introduce
a novel permutation-based feature importance algorithm. Our method not only
enables a nuanced understanding of how each individual feature contributes to
enhancing fairness across different races but also provides healthcare
practitioners with new insights and assistance. As far as we know, this is the
first attempt to explain how features contribute to improving fairness. In our
research, we extend the conventional focus on bias mitigation within
predictive models to encompass a detailed examination of the relationship
between features and fairness. By doing so, we bridge the realms of model
explainability and fairness. Our findings contribute to the improvement of
clinical outcomes, the reinforcement of ethical standards in healthcare AI,
and the promotion of trust and transparency among medical professionals and
patients alike.

##  2 Related Work

The process of explaining the rationale behind predictive modeling is crucial
in ensuring fairness in human judgment [14]. AI-generated explanations can
help identify factors that contribute to unfair outcomes. Both fairness and
explanation are crucial aspects of creating trustworthy and responsible AI,
and research shows that they are positively associated with user trust in
scenarios where AI is used to make decisions [1]. However, the current
approaches, LIME [9] and SHAP [8], only explain the contribution of features
to predictive performance. As far as we know, no study yet proposes a method
for explaining the contribution of features to fairness.

Currently, the researchers have devoted considerable efforts toward developing
predictive models for sepsis mortality. Bao et al. [2] and Taylor et al. [10]
explored a diverse array of models and features with the aim of identifying
the model that exhibits optimal performance in predicting sepsis-related
mortality and implemented feature importance analysis that elucidates the
influence of individual features on the overall prediction performance. Wang
et al. [12] have elucidated that disparities rooted in social determinants
among groups of sepsis patients by various currently available diagnostic
criteria and the efficacy of risk prediction models for sepsis is notably
diminished when a universally trained model is indiscriminately applied across
different subpopulations. However, these endeavors have predominantly aimed at
enhancing prediction accuracy and have not conducted a thorough and precise
analysis of explainability and fairness, leading to a situation where the
predictive results, though accurate, may lack transparency and equitable
consideration across diverse patient demographics.

##  3 Materials and Methods

###  3.1 Dataset Preparation

Our study focused on the critical task of predicting mortality among sepsis
patients. The dataset we used is extracted from the MIMIC-IV database, which
encompasses comprehensive medical records and demographic information of
individuals diagnosed with sepsis. The Medical Information Mart for Intensive
Care IV(MIMIC-IV) dataset [7] is a comprehensive collection of critical care
records, detailing patient admissions to the Intensive Care Units (ICU) at
Beth Israel Deaconess Medical Center. We preprocessed the dataset to make the
experimental result reasonable and robust. In this study we measured the
fairness by considering the predictive performance difference between races,
so we removed the samples without a definitive race record and transformed the
categorical race variable into a binary format: White vs Non-White. To avoid
potential timely treatment bias, for multiple-time medical measurement
records, we used the average of the first 24-hour records after the first ICU
admission. To eliminate the extreme cases, the patient record exhibiting a
value for at least one feature that fell outside the interpercentile range of
[2%, 98%] for the total population was removed. Therefore, the remaining
features are Age, Gender, Race, Temperature, Weight, Heart Rate, Glucose,
Systolic Blood Pressure(SBP), Diastolic Blood Pressure(DBP), SpO2, Respiratory
rate, Renal Replacement Therapy (RRT), Sequential Organ Failure Assessment
(SOFA), Charlson Comorbidity Index (CCI), and APACHE-III score. The target
label is the death of the patient, positive means the patient died, otherwise
the patient survived. Table 1 presents the descriptive statistics of the
dataset employed in our study, offering the detailed distribution of target
variables.

Table 1: The MIMIC-IV Dataset Distribution Characteristic |  | Overall
---
(N = 9,349)
| Neg. Class
---
(N = 7,806)
| Pos. Class
---
(N = 1,543)
Race |  |  |
White | 7,797 (83.4%) | 6,546 (83.9%) | 1,251 (81.1%)
Non-White | 1,552 (16.6%) | 1,260 (16.1%) | 292 (18.9%)

###  3.2 Predictive Model and Fair Model

Fig. 1 illustrates the process to obtain performance-optimized predictive
model and fair model, detailed as follows.

Figure 1: The proposed transfer learning process for performance-optimized and
fair model

Given the dataset $X\in\mathbb{R}^{n\times m}$, we train a logistic regression
model as the mortality predictive model $g_{\theta^{lg}}$, where $n$ is the
number of septic patients and $m$ is the number of features. We optimize
feature weights $\theta^{lg}\in\mathbb{R}^{m}$ to minimize the binary cross-
entropy between ground truths and predictions:

$J^{lg}(X,Y;\theta)=-\sum^{n}_{i=1}[Y_{i}log(g_{\theta}(X_{i}))+(1-Y_{i})log(1-g_{\theta}(X_{i}))],$
(1)

where ground truth $Y\in\mathbb{R}^{n}$ is al a list of dichotomous values,
and $Y_{i}$ indicates whether the patient $i$ is dead (1) or not (0), and
$g_{\theta}(X_{i})$ is a outcome prediction to patient $i$. By minimizing Eq.
1, the resultant model, $g_{\theta^{lg}}$, is only performance-optimized for
predictive performance. To make it generate the fair prediction for different
races, we implement a transfer learning process that initializes a fair model
by transferring weights $\theta^{lg}$ as fair model’s initial weights
$g_{\theta^{fair}=\theta^{lg}}$. The idea behind the weight transferring is
that fair model inherits the pre-learned capabilities, ensuring its predictive
ability is close to $g_{\theta^{lg}}$. Furthermore, we design a different
optimization goal for fair model to make its predictions become fair across
races. Specifically, we optimize the fair model for minimizing the Equalized
Odds Disparity (EOD) between races. EOD is a comprehensive fairness
measurement [6], denoted $\mathcal{E}$, that sums the square difference in
true positive rate (TPR) and false positive rate (FPR) between races:

$\displaystyle\mathcal{E}(g_{\theta}(X),Y,Z)$
$\displaystyle=TPR_{Diff}+FPR_{Diff}$ (2) $\displaystyle TPR_{Diff}$
$\displaystyle=(Pr(g_{\theta}(X)=1|Y=1,Z=1)-Pr(g_{\theta}(X)=1|Y=1,Z=0))^{2}$
$\displaystyle FPR_{Diff}$
$\displaystyle=(Pr(g_{\theta}(X)=1|Y=0,Z=1)-Pr(g_{\theta}(X)=1|Y=0,Z=0))^{2}$

where $Z=1$ for White and $Z=0$ for Non-White, respectively. To prevent losing
the predictive performance, we add a regularization term $\Omega$, allowing
overall TPR performance reached by performance-optimized predictive model
$g_{\theta^{lg}}$ be changed in a small range:
$\Omega(X,Y;\theta)=TPR-\epsilon<TPR<TPR+\epsilon$, where
$TPR=Pr(g_{\theta}(X)=1|Y=1)$. As a result, the loss function turns out to be:

$J^{fair}(X,Y,Z;\theta)=\mathcal{E}(g_{\theta}(X),Y,Z)+\Omega(X,Y;\theta),$
(3)

we treat the optimized weights $\theta^{fair}$ as the final weights for the
fair model, $g_{\theta^{fair}}$.

###  3.3 Permutation Fairness Importance Algorithm

Permutation-based feature importance method [3] was developed to quantify how
each feature contributes to the predictive performance, but it does not
measure how the features contribute to fairness when a fair model is compared
with a base model.

To quantify the influence of each feature on the fairness improvement, we
first define the fairness improvement, which calculates the difference of EOD
performance ($\mathcal{E}$, Eq. 2) between $g_{\theta^{lg}}$ and
$g_{\theta^{fair}}$:

$\mathcal{F}(X,Y,Z,g_{\theta^{lg}},g_{\theta^{fair}})=\mathcal{E}(g_{\theta^{fair}}(X),Y,Z)-\mathcal{E}(g_{\theta^{lg}}(X),Y,Z)$
(4)

Note that the smaller EOD, the smaller the difference in predictive
performance between different races. In our experimental results, we observe
that fair model $g_{\theta^{fair}}$ always has a smaller EOD than performance-
optimized model $g_{\theta^{lg}}$. Therefore, the more negative
$\mathcal{F}(\cdot)$ suggests more fairness improvements achieved by the fair
model $g_{\theta^{fair}}$.

To quantify the contribution of each feature $i$ on the fairness improvement,
we extend the permutation-based feature importance algorithm and propose the
Algorithm 1. Specifically, we define a $permute$ function which randomly
shuffles the values for the feature $i$ (i.e., column $i$ in $X$) and keeps
the values of the other features unchanged. Since the $permute$ function
involves randomness, we reiterate it on the feature $i$ for $J$ times,
resulting in $J$ different permuted $\tilde{X}^{j},j\in[1,...,J]$ (line
$3-4$). We then calculate the influence of the feature $i$ on fairness
improvement, denoted $\delta_{i}$, by averaging
$\mathcal{F}(\tilde{X}^{j},Y,Z,g_{\theta^{lg}},g_{\theta^{fair}})$ over $J$
permuted inputs (line $5$). The larger magnitude of $\delta_{i}$ suggests that
feature $i$ contributes more to the fairness improvement, also demonstrating
its importance on fairness.

Require : Dataset $X$, ground truths $Y$, race indicators $Z$, performance-
optimized predictive model $g_{\theta^{lg}}$, and fair predictive model
$g_{\theta^{fair}}$

1

2initialize empty list of importance score $\delta$

3for  _each feature $i$ (column of $X$)_ do

4 for  _each repetition $j\in 1,...,J$_ do

5 $\tilde{X}^{j}=permute(X[:,i])$

6
$\delta_{i}=\frac{1}{J}\sum^{J}_{j=1}\mathcal{F}(\tilde{X}^{j},Y,Z,g_{\theta^{lg}},g_{\theta^{fair}})$

return $\delta$

Algorithm 1 Permutation Fairness Importance Algorithm

###  3.4 Evaluation Setup

We employed the 5-fold cross-validation approach, and in each fold we
conducted feature permutation 100 ($J=100$) times to ensure the robustness of
our findings. For the evaluation of model performance and fairness, we
utilized a comprehensive suite of metrics including the Area Under the
Receiver Operating Characteristic curve (AUC), Accuracy (ACC), group
differences in TPR (TPR diff) and FPR (FPR diff), and the EOD. To choose the
classification threshold for $g_{\theta^{lg}}$ and $g_{\theta^{fair}}$, we
adopted the “The Closest to (0,1) Criteria (ER)”, which selects the threshold
that minimizes the Euclidean distance between ROC curve and the ideal point of
(0,1) on the ROC space [11]. Based on these settings, our result analysis
comprises several pivotal elements: Firstly, the feature importance is
assessed using SHAP and we analyze the coefficient changes between
$\theta^{lg}$ and $\theta^{fair}$, which provides the detailed changes of each
feature from the performance-optimized model to fair model. Furthermore, our
analysis extends to examining the differential fluctuations in EOD across
different races with feature permutation, identifying the extent to which
specific features contribute to the model fairness.

##  4 Results and Discussions

Fair model has better fairness performance than performance-optimized
predictive model while having a decreased predictive performance. Table 2
reports predictive and fairness performance comparison between performance-
optimized predictive model $g_{\theta^{lg}}$ and fair model
$g_{\theta^{fair}}$. The fair model has smaller TPR and FPR differences across
demographic groups, leading to a smaller EOD compared with the performance-
optimized predictive model. We observe that for fair model both predictive
performances, including AUC and Accuracy, drop for exchange the fairness
improvement.

Table 2: Predictive and fairness performance comparison

| AUC | ACC | $TPR_{Diff}$ | $FPR_{Diff}$ | EOD ($\mathcal{E}$)
---|---|---|---|---|---
$g_{\theta^{lg}}(X)$ | 0.746 | 0.675 | 0.071 | 0.064 | 0.068
$g_{\theta^{fair}}(X)$ | 0.723 | 0.637 | 0.002 | 0.015 | 0.008

What are the important predictive variables for performance-optimized
predictive model and fair model? Fig. 2 reports SHAP values and feature
importance rankings for performance-optimized predictive model (upper two
subplots) and fair model (lower two subplots). We notice that two most
important variables, including aspiii and charlson comorbidity index, remain
the same between two models while the importance of few variables change
significantly. For example: (1) age and spo2 contribute more in fair model
than in performance-optimized predictive model, and (2) fair model depends
more on sbp than dbp; on the contrary, performance-optimized predictive model
relies more on dbp than sbp in prediction. These observations suggest that
when optimizing performance-optimized predictive model for better fairness
performance, the model will alter its reliance on the features, resulting in
changes of feature importance.

Figure 2: The SHAP values and importance for performance-optimized predictive
model (two upper subplots) and fair model (two lower subplots).

What are the important features that influence the fairness? SHAP values only
tell us how each feature of the model contributes to predictive performance.
Based on our proposed algorithm (Algorithm 1), Fig. 3(a) shows how each
feature contributes to the EOD difference. The feature of the more negative
EOD difference suggests it has a higher influence on reducing the prediction
disparity between races (Whites and Non-Whites). We observe that there are
four sets of features grouped by the value gaps. For features having EOD
Difference $<-0.06$, the first feature set has the two most influential
variables on fairness performance. They are temperature (rank 10) and sofa
(rank 7) with an average rank of 8.50, where rank is referred their SHAP
importance rankings in the lower-right subplot of Fig. 2. For those having EOD
Difference between $[-0.05,-0.06]$, the second set has gender (rank 8),
glucose (rank 11), rrt (rank 15), and sbp (rank 9) with average rank 10.75.
The third feature set, EOD Difference falls between $[-0.04,-0.05]$, consists
of spo2 (rank 6), race (rank 13), and heart_rate (rank 11), and resp_rate
(rank 4) with average rank 8.50. The last set contains the least influential
variables for fairness performance because their EOD differences are $>-0.03$.
They are weight_admit (rank 5), dbp (rank 13), age (rank 3), charlson
comorbidity index (rank 1), and aspiii (rank 2) with average rank 4.80. Our
rank analysis suggests that the most influential variables for the fairness
performance (i.e., the first feature set) are not the variables that highly
contribute to the predictive performance; on the contrary, those least
influential variables for fairness performance (i.e., the last feature set)
are the variables that mostly contribute to the predictive performance.

To further explore this correlation, Fig. 3(b) shows the changes of feature
coefficient between performance-optimized predictive model (red;
$\theta^{lg}$) and fair model (green; $\theta^{fair}$). We notice that both
temperature and sofa have the most impact on EOD difference but have very
little coefficient changes. Race is the sensitive attribute; however, the
coefficient for race is only changed to a small extent and is very close to 0.
Moreover, fair model stresses more weights on those least influential
variables (e.g., aspiii, charlson comorbidity index, and age), which also
reflects why those least influential variables are the most contributed
predictive variables identified using SHAP (two lower subplots in Fig. 2). The
reason for this may be because we add a performance regularization when
optimizing the performance-optimized predictive model into fair model; under
this given condition, altering the coefficient on important predictive
variables will decrease the performance, so in order to reduce the EOD the
other variables are the choices during the optimization. This observation
aligns with our aforementioned observations, where features with less
influence on prediction performance contribute more to improving fairness.

(a) Features vs EOD Differences

(b) Coefficients Changes

Figure 3: Comparison of fairness contribution (left subplot) and coefficients
change (right subplot) of each feature.

##  5 Conclusion and Future Work

In this study, we employ the transfer learning technique to optimize a
performance-optimized model for the prediction of sepsis mortality, aiming to
achieve fairness in the model’s predictions. Crucially, we introduce a novel
permutation-based algorithm designed to elucidate the role of each individual
feature in contributing to the fairness of the model. Through a detailed
analysis of feature importance and the differential impact of feature
permutation on the model’s fairness, this approach enables us to effectively
bridge the observed gap between model interpretability and fairness. Our
findings reveal an under-investigated yet significant relationship between
feature importance and the enhancement of model fairness: the more a feature
contributes to the predictive performance, the less the feature contributes to
improving fairness.

####  5.0.1 Acknowledgement.

This work was supported in part by the National Science Foundation under the
Grants IIS-1741306 and IIS-2235548, and by the Department of Defense under the
Grant DoD W91XWH-05-1-023. This material is based upon work supported by
(while serving at) the National Science Foundation. Any opinions, findings,
and conclusions or recommendations expressed in this material are those of the
author(s) and do not necessarily reflect the views of the National Science
Foundation.

## References

  * [1] Angerschmid, A., Theuermann, K., Holzinger, A., Chen, F., Zhou, J.: Effects of Fairness and Explanation on Trust in Ethical AI. In: Machine Learning and Knowledge Extraction. pp. 51–67. Lecture Notes in Computer Science, Cham (2022)
  * [2] Bao, C., Deng, F., Zhao, S.: Machine-learning models for prediction of sepsis patients mortality. Medicina Intensiva (English Edition) 47(6), 315–325 (2023)
  * [3] Breiman, L.: Random Forests. Machine Learning 45(1), 5–32 (2001)
  * [4] CDC: Sepsis Is The Body’s Extreme Response To An Infection. (2023)
  * [5] Combi, C., Facelli, J.C., Haddawy, P., Holmes, J.H., Koch, S., Liu, H., Meyer, J., Peleg, M., Pozzi, G., Stiglic, G., Veltri, P., Yang, C.C.: The IHI Rochester Report 2022 on Healthcare Informatics Research: Resuming After the CoViD-19. Journal of Healthcare Informatics Research 7(2), 169–202 (2023)
  * [6] Hardt, M., Price, E., Srebro, N.: Equality of opportunity in supervised learning. In: Proceedings of the 30th International Conference on Neural Information Processing Systems. pp. 3323–3331 (2016)
  * [7] Johnson, A., Bulgarelli, L., Pollard, T., Horng, S., Celi, L.A., Mark, R.: MIMIC-IV. https://doi.org/10.13026/6MM1-EK67
  * [8] Lundberg, S.M., Lee, S.I.: A unified approach to interpreting model predictions. In: Proceedings of the 31st International Conference on Neural Information Processing Systems. pp. 4768–4777 (2017)
  * [9] Ribeiro, M., Singh, S., Guestrin, C.: “Why Should I Trust You?”: Explaining the Predictions of Any Classifier. In: Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Demonstrations. pp. 97–101 (2016)
  * [10] Taylor, R.A., Pare, J.R., Venkatesh, A.K., Mowafi, H., Melnick, E.R., Fleischman, W., Hall, M.K.: Prediction of In-hospital Mortality in Emergency Department Patients With Sepsis: A Local Big Data–Driven, Machine Learning Approach. Academic Emergency Medicine 23(3), 269–278 (2016)
  * [11] Unal, I.: Defining an Optimal Cut-Point Value in ROC Analysis: An Alternative Approach. Computational and Mathematical Methods in Medicine 2017, 3762651 (2017)
  * [12] Wang, H., Li, Y., Naidech, A., Luo, Y.: Comparison between machine learning methods for mortality prediction for sepsis patients with different social determinants. BMC Medical Informatics and Decision Making 22(S2), 156 (2022)
  * [13] Yang, C.C.: Explainable Artificial Intelligence for Predictive Modeling in Healthcare. Journal of Healthcare Informatics Research 6(2), 228 (Jun 2022)
  * [14] Zhou, J., Chen, F., Holzinger, A.: Towards Explainability for AI Fairness. In: xxAI - Beyond Explainable AI: International Workshop, Held in Conjunction with ICML, pp. 375–386. Cham (2022)


# Discrepancy estimates related to the fractional parts of $b^{n}/n$.

Martin Lind<EMAIL_ADDRESS>Dept. of Mathematics and Computer Science,
Karlstad University,Universitetsgatan 2, Karlstad, 65188, Sweden

###### Abstract

We prove a discrepancy estimate related to the sequence of fractional parts of
$b^{n}/n$. This improves an earlier result of Cilleruelo et al.

###### keywords:

fractional parts, discrepancy, uniform distribution

###### pacs:

[

MSC Classification]11K38, 11B05

##  1 Introduction

Let $b\in\mathbb{N},b\geq 2$. In 2013, Cilleruelo et al. [1] proved that

$\left\\{\frac{b^{n}\pmod{n}}{n}:n\in\mathbb{N}\right\\}$ (1)

is dense in $[0,1]$. (See also [3] for a number of interesting related
results.)

For $A\subset\mathbb{N}$, we set

$\mathcal{S}_{b}(A)=\left\\{\frac{b^{n}\pmod{n}}{n}:n\in A\right\\}.$

Note in particular that the set (1) is simply $\mathcal{S}_{b}(\mathbb{N})$.
Let $\mathbb{P}=\\{2,3,\ldots\\}$ denote the prime numbers and set

$\mathcal{A}=\left\\{pq:p,q\in\mathbb{P},p>b^{q}\right\\}.$

The main result of [1] is an estimate of the discrepancy of
$\mathcal{S}_{b}(\mathcal{A})$. Denote $\mathcal{A}_{N}=\mathcal{A}\cap[1,N]$,
then

$D(\mathcal{S}_{b}(\mathcal{A}_{N}))=\mathcal{O}\left(\frac{\log\log\log\log(N)}{\log\log\log(N)}\right).$
(2)

where $D(\mathcal{S}_{b}(\mathcal{A}_{N}))$ denotes the _discrepancy_ of
$\mathcal{S}_{b}(\mathcal{A}_{N})$ (see Section 2 below). In particular, it
follows from (2) that $\mathcal{S}_{b}(\mathcal{A})$ is uniformly distributed
modulo 1 and this implies the density of $\mathcal{S}_{b}(\mathcal{A})$ in
$[0,1]$.

Unaware of the work [1], the author studied properties of
$\mathcal{S}_{b}(\mathcal{A})$ from a different point of view in [5]. When
informed of the paper [1], we found that some observations from [5] could be
used to improve on (2). The main result of this note is the following.

######  Theorem 1.

There holds

$D(\mathcal{S}_{b}(\mathcal{A}_{N}))=\mathcal{O}\left(\frac{1}{\log\log\log(N)}\right).$
(3)

The improvement (3) is not due to any sharper number-theoretic inequalities.
In fact, we use the same estimates as in [1]. Rather, we employ a different
strategy to estimate the discrepancy. Instead of using the Erdős-Turán
inequality and exponential sums as in [1], we use a sort of triangle
inequality (Lemma 3) to decompose $\mathcal{S}_{b}(\mathcal{A}_{N})$ into
well-structured subsequences. By combining a number of basic facts about
discrepancy with some observations from [5] (Proposition 5 in particular) and
a variant of the Siegel-Walfisz theorem, we obtain in Lemma 7 an estimate of
the discrepancy of each subsequence and these estimates allow us to establish
Theorem 1. In connection with this, we mention our previous work [4] where a
similar strategy based on Lemma 3 was used to find optimal discrepancy decay
rates.

##  2 Auxiliary results

###  2.1 Discrepancy

For a finite set $A$, we denote by $|A|$ the cardinality of $A$. Let
$S=\\{x_{1},x_{2},\ldots,x_{M}\\}\subset[0,1]$ be a finite sequence. The
_extreme discrepancy_ of $S$ is defined by

$D(S)=\sup_{J\subseteq[0,1]}\left|\frac{A_{S}(J)}{M}-\lambda(J)\right|,$

where $A_{S}(J)=|\\{n:x_{n}\in J\\}|$ and $\lambda$ is the linear Lebesgue
measure. Similarly, the _star discrepancy_ of $S$ is defined by

$D^{*}(S)=\sup_{r>0}\left|\frac{A_{S}([0,r])}{M}-r\right|.$

It is well-known (see e.g. [2], Chapter 3) that

$D^{*}(S)\leq D(S)\leq 2D^{*}(S),$

hence it is sufficient to only consider $D^{*}(S)$.

######  Lemma 2.

Let $R\in\mathbb{N}$ and $S=\\{x_{1},x_{2},\ldots,x_{M}\\}$ be a finite
sequence such that the elements of $S$ only attain values in the set
$\\{k/R:k=0,1,\ldots,R-1\\}$. Assume that

$|\\{n:x_{n}=k/R\\}|=\alpha_{k}M+\epsilon_{k}$

where $\alpha_{k}\geq 0~{}~{}(k=0,1,\ldots,R-1)$,
$\alpha_{1}=\alpha_{2}=\ldots=\alpha_{R-1}$ and

$\sum_{k=0}^{R-1}\alpha_{k}=1.$

Then there exists an absolute constant $C>0$ such that

$MD^{*}(S)\leq\max\left\\{\alpha_{0}M,\frac{M}{R}\right\\}+\sum_{k=0}^{R-1}|\epsilon_{k}|.$

###### Proof.

Take any $J_{r}=[0,r]$ and let $j=\lfloor rR\rfloor$, so that
$M\mu(J_{r})=jM/R+M\delta$ for some $\delta\in[0,1/R]$. We have

$A_{S}(J_{r})=M\sum_{k=0}^{j}\alpha_{k}+\sum_{k=0}^{j}\epsilon_{k}$

so

$\left|A_{S}(J_{r})-M\mu(J_{r})\right|\leq\left|M\alpha_{0}+M\sum_{k=1}^{j}\left(\alpha_{k}-\frac{1}{R}\right)-M\delta\right|+\sum_{k=1}^{j}|\epsilon_{k}|$

The first term of the expression at the right-hand side above is either
increasing or decreasing in $\delta$, hence we have

$MD^{*}(S)\leq\max_{j=0,\ldots,R-1}\left|M\alpha_{0}+M\sum_{k=1}^{j}\left(\alpha_{k}-\frac{1}{R}\right)\right|+\sum_{j=0}^{R-1}|\epsilon_{k}|$

where $j=0$ means that the sum is 0. The maximum of the first term is attained
either at $k=0$ or $k=R-1$, since the terms of the sum have the same sign (due
to the fact that $\alpha_{1}=\ldots=\alpha_{R-1}$. Further,
$\alpha_{0}+(R-1)\alpha_{1}=1$ so

$\displaystyle\max_{j=0,\ldots,R-1}\left|M\alpha_{0}+M\sum_{k=1}^{j}\left(\alpha_{k}-\frac{1}{R}\right)\right|$
$\displaystyle=$
$\displaystyle\max\left\\{M\alpha_{0},\left|M\alpha_{0}+M\sum_{k=1}^{R-1}\left(\alpha_{k}-\frac{1}{R}\right)\right|\right\\}$
$\displaystyle=$
$\displaystyle\max\left\\{M\alpha_{0},\left|M-\frac{M(R-1)}{R}\right|\right\\}$
$\displaystyle=$ $\displaystyle\max\left\\{M\alpha_{0},\frac{M}{R}\right\\}$

Consequently,

$MD^{*}(S)\leq\max\left\\{M\alpha_{0},\frac{M}{R}\right\\}+\sum_{k=0}^{R-1}|\epsilon_{k}|.$

∎

######  Lemma 3 ([2], Chapter 3).

Assume that $S=\cup_{j}S_{j}$ where $S_{i}\cap S_{j}=\emptyset$. Denote
$M_{j}=|S_{j}|$ and $M=|S|=\sum_{j}M_{j}$. Then

$MD^{*}(S)\leq\sum_{j=1}^{K}M_{j}D^{*}(S_{j}).$

######  Lemma 4 ([6], Chapter 4).

Let $S^{\prime}=\\{x_{1},x_{2},\ldots,x_{M}\\}$ and
$S^{\prime\prime}=\\{y_{1},y_{2},\ldots,y_{M}\\}$ such that

$|x_{j}-y_{j}|\leq\epsilon$

for $j=1,2,\ldots,M$. Then

$|D^{*}(S^{\prime})-D^{*}(S^{\prime\prime})|<\epsilon.$

###  2.2 Primes in arithmetic progressions

Denote

$Z_{k}=\\{r\in\mathbb{Z}^{*}_{q(q-1)}:b^{r}\equiv kr+b\pmod{q}\\}.$

For any $p\in\mathbb{P}$ with $p>b^{q}$ and $p\equiv r\pmod{q(q-1)}$ for some
$r\in Z_{k}$, there holds

$\left|\frac{b^{pq}\pmod{pq}}{pq}-\frac{k}{q}\right|<\frac{1}{q},$ (4)

see [5].

Let ${\rm ord}_{q}(b)=|\langle b\rangle|$ where $\langle b\rangle$ is the
subgroup of $\mathbb{Z}^{*}_{q}$ generated by $b$. In [5], we proved the
following proposition.

######  Proposition 5.

For $q\in\mathbb{P}$ there holds

$|Z_{k}|=\varphi(q-1)-m_{b}(q)\quad(k=1,2,\ldots,q-1),$

and

$|Z_{0}|=(q-1)m_{b}(q)$

where

$m_{b}(q)=|\\{r\in\mathbb{Z}^{*}_{q-1}:r\equiv 1\pmod{{\rm ord}_{q}(b)}\\}|.$

We shall need to estimate the number of primes in certain arithmetic
progressions. Denote

$\pi(N;q(q-1),r)=|\\{p\in\mathbb{P}:p\leq N,p\equiv r\pmod{q(q-1)}\\}.$

We use the following consequence of the Siegel-Walfisz theorem (see [1] and
the reference given there):

$\pi(N;q(q-1),r)=\frac{\pi(N)}{\varphi(q(q-1))}+\mathcal{O}\left(\frac{N}{(\log(N))^{A}}\right)$
(5)

for any $A>0$ and $N\geq 2$. (The implied constant in (5) depends on $A$.)
Here, $\pi(N)$ is the prime counting function. In particular, there is
asymptotically the same amount of primes in the progression $r+nq(q-1)$ for
each $r\in\mathbb{Z}^{*}_{q(q-1)}$. More precisely, (5) and Proposition 5
imply that

$\displaystyle|\\{p\in\mathbb{P}:p\leq N,\exists r\in Z_{k}\text{ such that
}p\equiv r\pmod{q(q-1)}\\}|=$
$\displaystyle=\frac{|Z_{k}|}{\varphi(q(q-1))}\pi(N)+\mathcal{O}\left(\frac{N|Z_{k}|}{(\log(N))^{A}}\right)$

##  3 Proof of Theorem 1

Denote

$F_{q,N}=\\{p\in\mathbb{P}:b^{q}<p\leq
N/q\\}\quad\text{and}\quad\mathcal{F}_{q,N}=\\{pq:p\in F_{q,N}\\},$

then

$\mathcal{A}_{N}=\bigcup_{q\in\mathbb{P}}\mathcal{F}_{q,N}.$

(Note that $F_{q,N}=\emptyset$ for $q$ sufficiently large.) Define

$F_{k}=\\{p\in F_{q,N}:\exists r\in Z_{k}\text{ such that }p\equiv
r\pmod{q(q-1)}\\}.$

for $k=0,1,\ldots,q-1$.

######  Lemma 6.

For each $k\in\\{0,1,\ldots,q-1\\}$, there holds

$|F_{k}|=\frac{|Z_{k}|}{\varphi(q(q-1))}|F_{q,N}|+\epsilon_{k}$

where

$\sum_{k=0}^{q-1}|\epsilon_{k}|\leq\frac{CN}{q^{2}\log(N)}.$

###### Proof.

Observe that

$|F_{k}|=|Z_{k}|\left(\pi(N;q(q-1),r)-\pi(b^{q},q(q-1),r)\right).$

Taking $A=4$ in (5), we obtain

$\displaystyle|F_{k}|$ $\displaystyle=$
$\displaystyle\frac{|Z_{k}|}{\varphi(q(q-1))}\left(\pi(N/q)-\pi(b^{q})\right)+\epsilon_{k}$
$\displaystyle=$
$\displaystyle\frac{|Z_{k}|}{\varphi(q(q-1))}|F_{q,N}|+\epsilon_{k},$

where

$\displaystyle|\epsilon_{k}|$ $\displaystyle\leq$ $\displaystyle
C|Z_{k}|\left(\frac{N}{q(\log(N/q))^{4}}+\frac{b^{q}}{q^{4}}\right)\leq
2C|Z_{k}|\frac{N}{q(\log(N/q))^{4}}$

since $x\mapsto x/(\log(x))^{4}$ is increasing. Note that

$\sum_{k=0}^{q-1}|\epsilon_{k}|\leq\frac{2CN}{q(\log(N/q))^{4}}\sum_{k=0}^{q-1}|Z_{k}|=\frac{2CN}{q(\log(N/q))^{4}}\varphi(q(q-1))\leq\frac{2CNq^{2}}{q(\log(N/q))^{4}}$

Since $b^{q}<N/q$, we have $q\leq\log(N/q)$. Furthermore, $q^{2}<qb^{q}<N$, so
$N/q>\sqrt{N}$. Consequently,

$\frac{1}{\log(N/q)}\leq\frac{1}{q}\quad\text{and}\quad\frac{\log(N)}{2}\leq\log(N/q)\leq\log(N)$

and therefore

$\sum_{k=0}^{q-1}|\epsilon_{k}|\leq\frac{2CNq^{2}}{q(\log(N/q))^{4}}\leq\frac{4CN}{q^{2}\log(N)}.$

∎

Denote by

$n(q,N)=|F_{q,N}|$

######  Lemma 7.

There exists an absolute constant $C$ such that for any $q\in\mathbb{P}$,
$N>b^{q}$, there holds

$n(q,N)D^{*}(\mathcal{S}_{b}(\mathcal{F}_{q,N}))\leq
C\left(\frac{\log\log(q)}{\log(q)}n(q,N)+\frac{N}{q^{2}\log(N)}\right).$ (6)

###### Proof.

By (4), for any $p>b^{q}$ there is a $k\in\\{0,1,\ldots,q-1\\}$ such that

$\left|\frac{b^{pq}\pmod{pq}}{pq}-\frac{k}{q}\right|<\frac{1}{q}$ (7)

holds. Furthermore, for a specific $k$ the estimate (7) holds if and only if
$p\equiv r\pmod{q(q-1)}$ where $r\in Z_{k}$.

For $p\in F_{q,N}$ we define $a_{p}=k/q$ if $p\in F_{k}$. Set
$S^{\prime}=\\{a_{p}:p\in F_{q,N}\\}$. Then $|S^{\prime}|=|F_{q,N}|$ and

$\left|\frac{b^{pq}\pmod{pq}}{pq}-a_{p}\right|<\frac{1}{q}$

for each $p\in F_{q,N}$. By Lemma 4, there holds

$D^{*}(S^{\prime})-\frac{1}{q}<D^{*}(\mathcal{S}_{b}(\mathcal{F}_{q,N})<D^{*}(S^{\prime})+\frac{1}{q}$
(8)

We shall now use Lemma 2 compute $D^{*}(S^{\prime})$. Set
$\alpha_{k}=|Z_{k}|/\varphi(q(q-1))$, so $\sum\alpha_{k}=1$ and this, together
with Lemma 6, implies that we may apply Lemma 2 to conclude

$n(q,N)D^{*}(S^{\prime})\leq\max\left\\{\frac{|Z_{0}|n(q,N)}{\varphi(q(q-1))},\frac{n(q,N)}{q}\right\\}+\frac{CN}{q^{2}\log(N)}$

Further, we have

$\frac{|Z_{0}|}{\varphi(q(q-1))}=\frac{(q-1)m_{b}(q)}{(q-1)\varphi(q-1)}=\frac{|\mathcal{N}|}{\varphi(q-1)}.$

Clearly,

$|\mathcal{N}|\leq\frac{q-1}{{\rm ord}_{q}(b)}$

and it is well-known that

$\varphi(q-1)\geq\frac{C(q-1)}{\log\log(q-1)}$

Taking into consideration ${\rm ord}_{q}(b)\geq C\log(q)$, we get

$\displaystyle n(q,N)D^{*}(S^{\prime})$ $\displaystyle\leq$
$\displaystyle\max\left\\{\frac{Cn(q,N)\log\log(q)}{\log(q)},\frac{n(q,N)}{q}\right\\}+\frac{CN}{q^{2}\log(N)}$
(9) $\displaystyle=$
$\displaystyle\frac{Cn(q,N)\log\log(q)}{\log(q)}+\frac{CN}{q^{2}\log(N)}$

By (8) and (9), we get

$n(q,N)D^{*}(\mathcal{S}_{b}(\mathcal{F}_{q,N})\leq\frac{Cn(q,N)\log\log(q)}{\log(q)}+\frac{CN}{q^{2}\log(N)},$

concluding the proof of (6).

∎

###### Proof of Theorem 1.

Fix $N>N_{0}$ and set $M=|\mathcal{A}_{N}|$, it was shown in [1] that

$M\sim\frac{N\log\log\log(N)}{\log(N)}.$ (10)

(We write $A\sim B$ if $c_{1}A\leq B\leq c_{2}A$ for absolute constants
$c_{1},c_{2}$.) Using Lemma 3 and Lemma 7, we obtain

$\displaystyle MD^{*}(\mathcal{S}_{b}(\mathcal{A}_{N}))$ $\displaystyle\leq$
$\displaystyle\sum_{q\in\mathbb{P}}n(q,N)D^{*}(\mathcal{S}_{b}(\mathcal{F}_{q,N}))$
(11) $\displaystyle\leq$ $\displaystyle
C\sum_{q\in\mathbb{P}}\left(\frac{\log\log(q)}{\log(q)}n(q,N)+\frac{N}{q^{2}\log(N)}\right),$

where $n(q,N)=0$ if $F_{q,N}=\emptyset$. By the prime number theorem

$n(q,N)\leq\pi(N/q)=\frac{N}{q\log(N/q)}+\mathcal{O}\left(\frac{N}{q(\log(N/q))^{2}}\right)$
(12)

Using (11), (12) and the fact that $\log(N)/2\leq\log(N/q)\leq\log(N)$ for
every $q\in\mathbb{P}$ with $n(q,N)>0$, we get

$\displaystyle MD^{*}(\mathcal{S}_{b}(\mathcal{A}_{N}))$ $\displaystyle\leq$
$\displaystyle\frac{CN}{\log(N)}\sum_{q\in\mathbb{P}}\left(\frac{\log\log(q)}{q\log(q)}\left(1+\mathcal{O}\left(\frac{1}{\log(N)}\right)\right)+\frac{1}{q^{2}}\right).$
(13)

Since the series $\sum_{q\in\mathbb{P}}\log\log(q)/(q\log(q))$ and
$\sum_{q\in\mathbb{P}}1/q^{2}$ both are convergent, it follows from (13) that

$MD^{*}(\mathcal{S}_{b}(\mathcal{A}_{N}))\leq\frac{CN}{\log(N)}\sum_{q\in\mathbb{P}}\left(\frac{\log\log(q)}{q\log(q)}+\frac{1}{q^{2}}\right)\leq\frac{CN}{\log(N)}.$
(14)

From (14) and (10), we have

$D^{*}(\mathcal{S}_{b}(\mathcal{A}_{N}))=\mathcal{O}\left(\frac{1}{\log\log\log(N)}\right).$

∎

Acknowledgements The author is grateful to Professor A. Dubickas (Vilnius) for
pointing out the references [1, 3].

## References

  * [1] J. Cilleruelo, A. Kumchev, F. Luca, J. Rué and I. E. Shparlinski, "On the fractional parts of $a^{n}/n$", Bull. London Math. Soc. 45 (2013), 249-256
  * [2] J. Dick and F. Pillichshammer, Digital Nets and Sequences: Discrepancy Theory and Quasi-Monte-Carlo Integration, Cambridge University Press, 2010
  * [3] A. Dubickas, "Density of some special sequences modulo 1", Mathematics 11 (2023), 1727
  * [4] M. Lind, "A sharp estimate of the discrepancy of a concatenation sequence of inversive pseudorandom numbers with consecutive primes", Int. J. Number Theory 18 (2022), 1409-1416
  * [5] M. Lind, "Some remarks related to the density of $\\{b^{n}\pmod{n}/n:n\in\mathbb{N}\\}$", preprint 2023, arXiv:2308.14354 [NT]
  * [6] H. Niederreiter and A. Winterhof, Applied Number Theory Springer, 2015.