# Lung Diseases Image Segmentation using Faster R-CNNs

Mihir Jain  1  1Stevens Institute of Technology
<EMAIL_ADDRESS>
††journal: opticajournal††articletype: Research Article

Lung diseases are the number one cause of child mortality across the
developing world, about half of the global pneumonia deaths occur in India
370k according to Indian academy of pediatrics and national Health profile
2016. Timely diagnosis could significantly reduce the mortality level. This
paper uses a low density neural network structure to avoid topological lag
which comes with network depth and breadth. The neural network integrates the
parameters into a feature pyramid network, extracting data to avoid losses.
Softening Non maximal suppression is applied on regional proposals created by
RPN. All function information is filtered and a model to achieve a high level
of detection is obtained. For performance evaluation the trained model is
validated with randomly chest x-ray images taken from the same data set, we
then compute the confusion matrix to obtain the accuracy, precision,
sensitivity, specificity values. All the loss functions involved in training
and testing model is shown by total loss. The loss function decreases when the
training is longer. The regional proposal loss gives the performance of the
model during the training phase and determines the quality of the regional
proposals. The classification loss demonstrated the loss function during the
classification phase and determines the quality of classification.

##  1 Introduction and Motivation

According to Indian Academy of Pediatrics and National Health Profile 2016,
[1] Fifty percent of pneumonia deaths occur in India which means approximately
370k children die of pneumonia annually in India. Moreover Pneumonia is the
number one killer of children causing 18% of all child mortality in the world.
This harsh number is still minuscule compared to mortality due to other chest
lung diseases. Timely diagnosis and treatment could reduce the mortality
level. The conventional X-ray images are slow[2] making human evaluation
inept. Computer aided diagnosis can enhance productivity and lead to timely
treatment potentially saving millions of lives. The size, shape and position
of pneumonia can vary greatly[3]. The outline is very vague and blurry which
leads to great difficulty for detection and enhancing the accuracy of
detection is a major research problem. At present detection algorithms include
two stage region detectors and object classification such as Faster R-CNN [4]
and one stage region detectors and object classification such as YOLO [5] and
SSD [6]. In latter object classification and bounding box regression are done
directly without using pre generated region proposals. While in two stage
detectors there is generation of region proposals and then object
classification for each region proposal. Though faster than two stage
detectors one stage detectors are less accurate. Treatment and Diagnosis needs
high accuracy and thus two stage detectors and classifiers have advantage.
However, there are still problems with the present image classification models
such as Xception [7] and VGG [8]. They need a large network depth leading to
prolonged training time and large downsampling that leads to the target
position and semantic information being lost.

###  1.1 Project Statement

Object Detection is one of the most promising fields to expand global
healthcare services especially in lower income countries. Automated algorithms
and tools have the potential to support workflow, improve efficiency, and
reduce errors. The Aim of this paper is to address common classification
problem

The ideal aim would be to assess images using a deep learning feature map,
since such a map has a big receptive field which makes the size of the region
in the input that produces the feature anchor also large . However, with deep
maps, it reduces the object-edge resolution, which reduces the assessment
accuracy of the regression curve. So after continuous downsampling in such
maps, the semantic features of the targets which are small disappear in the
layers; the large target is also partially lost, and the edge will move, which
is not favorable for accurate detection of the target. Conventionally, to
optimize a network, such as X-Ception, is to extend the width or depth [9],
but this method creates huge numbers of parameters, which leads to high
variance in the model, and needs large amounts of data to train.

###  1.2 Organisation of Report

This paper uses a low density neural network structure to avoid topological
lag which comes with network depth and breadth. The neural network integrates
the parameters into a [FPN] feature pyramid network [10], extracting data to
avoid losses. Softening-Non maximal suppression [S-NMS] [11] is applied on
regional proposals created by RPN. all functional information is filtered and
a model to achieve high level detection is obtained. This paper uses Faster
RCNN using ResNet.

##  2 Background Material

###  2.1 Conceptual Overview

The reason why one cannot proceed with object detection by making a neural
network (convolutional) followed by a layer is that the length of the output
layer is not fixed as the number of occurrences of the object of interest cant
be fixed. One might think to take different regions of interest and then
filter the presence of objects within those regions. The problem with this
approach is that objects of interest could have different aspect ratios and
different locations within the image. Hence a huge number of regions and this
could computationally blow up. Thus arises the need for algorithms like R-CNN,
YOLO, SSD. Conventionally object detection models used 3 steps. The first step
involved generating large number of region proposals. Region proposals are
basically the useful part of image which might have the objects to be detected
in them. Algorithms such as selective search and EdgeBoxes generate region
proposals. Then from each of these region proposals a feature vector is
extracted using image descriptors such as histogram of object gradients. This
feature vector is critical for the model to work correctly these vectors
should decribe an object even if it varies in scale or transition. The feature
vector then gives region proposals to the object classes. But as the object
classes increase the complexity for such models vary greatly with classes.
After feature extraction the method which is used for classifying the region
proposals are like support vector machine.

###  2.2 YOLO

YOLO (You only look once) was proposed by Redmon in 2016. As stated in the
original proposal [5] “Compared to other region proposal classification
networks (fast RCNN) which perform detection on various region proposals and
thus end up performing prediction multiple times for various regions in a
image, Yolo architecture is more like CNN (convolutional neural network) and
passes the image (nxn) once through and output is (mxm) prediction. This the
architecture is splitting the input image in mxm grid and for each grid
generation 2 bounding boxes and class probabilities for those bounding boxes”
The Biggest advantage of the model is speed (45 frames per second) and an even
faster version 155 fps which is less accurate due to smaller architecture. But
YOLO imposes strong constraints on bounding box predictions as it treats them
as a regression problem . This limits the number of small objects that a model
can predict. Thus the model struggles with small objects that appear in groups
and thus accuracy is low.

###  2.3 SSD

SSD (Single Shot Detection) was proposed by Liu [6] takes only one multiscale
feature map to detect independently, It is significantly faster in speed and
accuracy object detection. The comparison between speed and accuracy of
different object detection models on VOC2007 [12]

SDD300 : 59 FPS with mAP 74.3% SSD500 : 22FPS with mAP 76.9% Faster RCNN : 7
FPS with mAP 73.4% YOLO : 45 FPS with mAP 63.4%

SSD has a base VGG-16 network followed by multibox layers. The high speed and
accuracy is because it eliminates the bounding box proposals like one used in
R-CNN and filters with different sizes, and aspect ratio for object detection.
The spatial resolution is reduced which makes it unable to locate small
targets reducing accuracy.

###  2.4 Region Proposals

Region Proposals or Region of Interests on given an input image find all the
possible places where the object can be located. The output given is a list of
bounding boxes of likely positions of the objects.

###  2.5 RoI Polling

RoI pooling is a layer neural network used for object detection. It achieves
speedup for both training and inference while maintaining high accuracy.
Consider we need to perform RoI pooling on the map below for one region of
interest and an output of size 2x2.Also say we have a region proposal (x,y,h,w
coordinates).By dividing into 2x2 size.Note that the size of RoI need not be
perfectly divisible by number of pooling sections The max values are also the
output from RoI pooling layer.

###  2.6 RCNN

R-CNN was proposed by Girschick in 2014 [13] to solve the problem of selecting
a high number of regions. He proposed a method to selectively approach search
to extract only regions from the image which are data giving instead of going
through all the regions. This improved the speed of training and the accuracy
on VOC2010 dataset the mAP from 35.1% to 53.7%. Compared to conventional model
the R-CNN model can detect 80 different types of objects in images extracting
features on the basis of convolutional neural network. Other than this
everything is same from the traditional model. RCNN contatins 3 steps. The
first module generates 2k region proposals using selective search algorithm.
Then after augmentation the second module extracts feature vector of each
region proposal proportional to length of 4,096. The third module uses a pre-
trained SVM algorithm to classify region proposal as either one of the object
classes or the background.

The issue with R-CNN is that it still takes a huge time to train the model
network as one has to classify region proposals on each image. Also it can’t
be implemented in real time. The selective search approach is a fixed
algorithm and therefore no learning happens at the stage which could lead to
bad candidate region proposals.

###  2.7 Fast RCNN

This is an object detector which was also developed by Girshick, It overcomes
some of the issues of R-CNN. \- He Proposed a new layer called ROI pooling
that extracts equal-length feature vector from all region of interests (i.e.
proposals) in the same image. \- Compared to R-CNN which has multiple steps,
Fast R-CNN builds the network in a single step. \- Fast R-CNN shares
convolutional layer calculations across all region of interests rather than
doing calculations for each of proposal singularly. Using the ROI Pooling
layer making the Fast R-CNN faster than R-CNN. The feature map from the last
convolutional layer is fed to an ROI Pooling layer. The reason is to extract a
fixed length feature from each ROI. ROI Pooling works by splitting each region
proposal into a grid of cells. The max pooling operation is applied to each
grid cell to return a single value. After which the extracted feature vector
is passed to some neural layers. The output of which is splitted in 2 branches
softmax layer to predict the scores and FC (neural network) layer to predict
the bounding boxes for detected object.

Figure 1: Fast RCNN Architecture

This leads to decrease in time consumption as fast rcnn shares the
computationals across proposals while rcnn computes for each proposal. Rcnn
also takes one single RoI from input image which if say model need 256
proposals it would take from 256 images while the fast rcnn could potentially
take 256 RoI from 4 images about 64 per image leading to a reduced time span.
Though using multiple layers on the same image reduces the accuracy of the
model as all regions start to correlate. Even though fast rcnn is better
compared to rcnn on time it has its problems as it depends on selective search
to generate region proposals which cannot be customized for a specific object
detection dataset.

###  2.8 Faster RCNN

Selective search [14] is a slow and time consuming process to overcome which
in 2015 Ren [4] came up with the Faster R-CNN model, an object detection
algorithm that doesn’t need to search and lets the network learn the region
proposal.It is an extension of Fast R-CNN due to region propsoal network RPN
Region proposal network is a convolutional neural network that generates
proposals with various augmentations. It tells the model network for where to
look.

Instead of using various images at different shape or sizes the paper
introduced anchor boxes. An anchor box is a reference box of specific scale
and ratio. Multiple reference boxes leads to multiple share and sizes for
binary region. Each region is then mapped to reference anchor box for
detecting at different scales. The computations are shared across the RPN and
Fast-RCNN proposed above to reduce the computational time. The architecture of
Faster R-CNN :- consists of two parts RPN : For detecting region proposals &
Fast R-CNN for object detection in the proposed regions.

It works as follows RPN generates region proposals. Then from all region
proposals a fixed length feature vector is extracted using RoI Pooling layer.
Then extracted features are classified using Fast r-cnn. Then class scores of
detected objects in addition to their boxes are returned. Both r-cnn models
before faster rcnn depend on selective search algorithms to generate region
proposals. Each proposal is fed to a pre trained CNN while faster rcnn uses
region proposals network to produce region proposals.Thus region proposals are
produced using a network which means they can be trained for specific tasks in
object detection. Also as they are trained now the model can be used on
customised dataset which produces better proposals than selective search or
EdgeBoxes.By sharing convolutional layers, the RPN is merged with Fast-rcnn to
a single unified network to do training only once. RPN works on the output
feature map of the convolution layer shared with the Fast-rcnn a sliding
window passes over each of the feature map that leads to generation of region
proposal. Each proposal is characterized by score given by a reference box
called the anchor box. The anchor box has two parameters Scale and aspect
ratio.

k regions are produced from each region proposal where k regions varies in
scale or size. As anchor boxes vary in different sizes and scale they are able
to get a non changing scale object detector as a single image at a single
scale is used. Multi scale anchor boxes are to the benefit of the model. From
region proposal a feature vector is extracted and fed to two layers. The first
is a binary classification that generates object score for each proposal and
second returns the bounding box of region. First layer has two outputs whether
the region is object that had to be detected or the background. The layer
outputs two elements if the first is 1 and second is 0 then region is
classified as background wherelse if the first is 0 and second is 1 it is the
object. For RPN training each anchor is also given a score based on IoU which
is later discussed is the ratio of intersection of area between the anchor box
and ground truth to the union of the same boxes. IoU increases as the boxes
come closer to each other. The image is used as an input to a network which
outputs a convolutional feature map. Instead of relying on a selective search
algorithm on the feature map for identifying the region proposals, a separate
network is used to predict the region proposals. Faster R-CNN is faster and
can even be used for real-time object detection.

###  2.9 Pneumonia Detection Works

Many researchers have sought to detect pneumonia in the recent past. Abiyev
and Ma’ aitah [15] applied a CNN on the chest x-ray in comparison to RNN the
convolutional neural network gets higher accuracy but has a longer training
time. Guendel [16] proposed to use the DenseNet for the detection on chest
x-ray dataset. Abiyev and Ma’ aitah [15] extracted the features from the
layers of CNN and explored them like GIST on more than 600 radiographs. As
covid pandemic engulfed the world in 2020 Wang and Wong [17] proposed COVID-
Net which is a deep CNN specialized for detection of covid-19 cases from chest
x-ray (CXR) images. Ozturk [18] proposed an automatic detection using raw
chest X-ray images; this model is used to provide accurate diagnostics for
binary classification (COVID vs. no findings) and multiclass classification
(COVID vs. no findings vs. pneumonia).

##  3 Methodology

In this part, I would introduce in detail our proposed model method, including
data processing, architecture and enhancement effect used of soft non maxial
suppression.

###  3.1 Dataset

The dataset [19] for chest x-ray images and metadata is provided by National
institute of health and clinical research through kaggle. This dataset
contains images from 27864 unique patients. Each image is labelled with three
classes. The case for lung complications is when the lungs are replaced by
something other than air like bacteria, fluids, cells. This causes lung
opacities to differ which is why xray beams are used as such contingent lungs
opacity greater than normal because lung tissue is not healthy. Normal class
had images of perfectly healthy lungs without any pathological diseases found
in cxr. The third class in the dataset lung opacity had images of lungs with
clouds associated with diseases such as pneumonia. This region of lung opacity
is labelled with bounding boxes. An image can have multiple such boxes If more
than one area is detected with more opacity by object detection model. The
middle class are of patients with more opaque lungs but no lung contingencies.

Table 1: Distribution Of Classes in the dataset
---
CLASS | Pathogens (1) | None (0)
Lung Opacity | 1 | 9555
Not Normal / No Opacity | 0 | 11821
Normal | 0 | 8851
Table 1: Distribution Of Classes in the Dataset

###  3.2 Evaluation Metrics

The model is evaluated on the mean average precision at different
intersections over union IoU thresholds. The IoU of a set of predicted
bounding boxes and ground truth boxes are given by

IoU(A,B) = $\frac{A\cap B}{A\cup B}$

The metric over a range of IoU thresholds at each point calculating an average
precision value. At a threshold of 0.5 a object detected is considered a hit
if its IoU with a ground truth object is greater than 0.5. At each threshold
value t a precision value is calculated based on the number of True positives
(TP), False negatives (FN) and false positives arising from model compared
with testing truth object

A true positive is counted when a single predicted object matches a ground
truth with an IoU above threshold. A false positive is when model predicted
object had no associated truth object. A false negative is when a testing
object has no associated predicted object. When no ground truth objects
testing at all for an image, any number of false positives will result in the
image receiving a score of zero and will be included in mean average
precision. The average precision of a single image is calculated as the mean
of precision value at each of IoU threshold.

mAP(p,t) =
$\frac{1}{\lvert\text{thresholds}\rvert}\sum_{t}\frac{TP(t)}{TP(t)+FP(t)+FN(t)}$

In this model we are using confidence level for each of bounding boxes.
Bounding boxes will be used to evaluate in order of the confidence levels in
the said process. That is the bounding boxes with higher confidence will be
checked first against testing solution which determines what boxes considered
are true and false positives. None of the edge cases are known to exist in the
data set. Lastly the score returned by the competition metric is the mean
taken over the individual average precision of each image in test dataset.

###  3.3 Model

Figure 2: Model

To avoid test time augmentations which would require high graphical usage and
pseudolabelling which is not possible and feasible in practice. To reduce the
memory footprint and time of inference. I propose a faster rcnn model
utilizing a Resnet encoder which is pertained on TensorFlow ImageNet. Also
because Soft-NMS [23] improves the performance of detection model I have
precoded the soft-nms algorithm. Faster RCNN is used for object detection
while ResNet is the architecture which performs feature extraction for the
model. Faster RCNN defines label for each input, defines how the features [24]
are used and label to perform supervised learning, defines the loss function
and optimiser and defines training and testing pipeline. While resnet performs
how we will extract the feature [25]. After having saved the checkpoints for
the trained model we call the model with argument = generatePredictions with
the path to model checkpoint and generate predictions for test images.

##  4 Implementation

###  4.1 Model Building

The faster rcnn model is implemented on cloud pytorch with resnet
architecture. The input to the model is a list of tensors of c-color h-height
w-width for each image and in range 0-1. Different images have different sizes
The model behaviour changes depending on if it is training or in evaluation.
During training the model expects both the input tensors as well as targets
containing the boxes which are the ground-truth boxes and labels for each of
these ground truth boxes. The model returns a Dict[Tensor] during tensors
containing the classification and regression losses for the regional proposal
network and R-CNN. During inference the model requires only the input tensors
and returns processesed predicted results as List[Dict[Tensor]], one for each
input image. FasterRCNN needs following arguments as inputs \- a backbone
network which is used to compute the features for the model. The backbone
should have a at least an attribute which fives the number of output that each
feature map has. The backbone returns a single Tensor. \- number of output
classes for the model. If boxPredictor is specified then number of classes are
none. \- Min and max size of the image to be rescaled before feeding it to the
backbone. \- ImageMean the values used for input normalisation. Should be the
mean values of dataset on which the backbone has been trained on.

Mean average precision at differnet intersection over union (IoU) threshold is
calculated. Images with no ground truth bounding boxes are not included in the
map score unless there is a false positive detection. None is returned if both
are empty, don’t count the image in final evaluation. True Positive (TP) tp =
tp+1 if matched = True is counted when bt (boxes_true) are matched. False
Negative (FN) is when the truth box bt has no match then it is calculated as
FN fn = fn+1 False Positive (FP) is the box predicted that is not matched by
any truth boxes fp = len(boxes_pred) – len (matched_bt) m = tp/ (tp+fn+fp).
map total += m the score for the mAP is given by map_total/len (thresholds) \-
Images with empty boxes are added to model for contributing to optimisation
and loss calculation \- Original RetinaNet implementation in pytorch [20]
ignored images with no boxes while this model has added them to get better
loss calculation and optimisation. \- the small anchors output is added to
handle smaller boxes \- to reduce overfitting dropout was added to
classification to achieve regularisation and optimal classification result at
same epoch.

The base model preparation part is not that comparatively quicker as PyTorch
already provides a Faster RCNN ResNet50 FPN model with also preTrained
implementations so to save time and computing power, we need to: Load that
model and its comparitive models for results. Append the model for our input
and output needs. Modify the base model heads with the number of classes
according to our dataset.

###  4.2 Model Training

Training dataset included data for 27864 and used data for 1000 participants
for testing set. The range of pretrained pytorch imagenet basemodel dataset
was used to pretrain our model. Without which the model worked on regression
but failed on classification. As training dataset was reasonably balanced
there was no need to extra balance. For learning rate used the
ReduceLRonPlateu with patience of 4 and decrease factor of 0.2. Entire image
classification loss and boxes classification were combined to get as total
loss. Figure 8 shows Model Comparision Shows validation losses for a range of
various backbones. The SE-Type nets demonstrated optimal performance with
resnext101 showing the best results and resnet50 being slightly worse.
Different architecture were compared with our architecture PNASNet, NASNet,
Inception, SE_ResNet, Xception and ResNet. There were significant tradeoff
between the speed and complexity and accuracy also parameteres. ResNet
demonstration between accuracy and complexity was optimal. VGG nets did not
provide accuracy on dataset while SeNet and NasNet had the longest training
time period.

Figure 3: Model Training

The Training configuration file contains \- Number of epochs to train for. \-
Computation method used for training as the CPU is slow for Faster-RCNN we
need GPU alternatively can use collaboratory by google for object detection in
general. \- The batch size used for training \- The dimensions for
augmentation we need to resize the images too.

###  4.3 Model Learning

For removal of parameters we trained the model with fixed augmentations and
without classification outputs. Result was improved when making the model
predict other related functions other than only output of regression based
model. Without pretraining the model took much longer for the validation loss
to converge pretained in cloud imagenet and dropouts of 0.5 and 0.75 showed
the best results on dataset

Figure 4: Model Learning

###  4.4 Dataset Image Preprocessing

The dataset was scaled to 512x512 pixels and the 256 pixels gave
unsatisfactory results. The original images were 2000x2000 pixels hence was
not practical being heavier to train the dataset. So deployed following
augmentations rotations, shift , horizontal flip. Without enough augmentation
the model was overfitted as validation stopped improving on increasing the
training. Heavy augmentation led the model to show better validation loss and
mAP results. The grayscale is different for the images and low brightness
contrast of cxr leads to higher validation losses as it makes harder to locate
the lesion [21] and hence the model proposed in this paper used clahe
algorithm [22] to equal the gray scale of our dataset.

###  4.5 Result And Analysis

The deep learning model is used to perform and detect lung contingencies in
chest xray images dataset. Faster RCNN + ResNet was trained for 15 epochs. The
Resnet model was compared with Xception, PNASNet And Inception and showed
considerably greater accuracy and specifity for the same dataset used in
comparision.

Method | AC | SP | PR | RC | F1
---|---|---|---|---|---
Xception | 93.16% | 89.03% | 94.63% | 87.26% | 94.5%
Resnet | 95.28% | 96.36% | 96.6% | 97.32% | 96.93%
PNASNet | 94.35% | 91.79% | 96.48% | 89.35% | 95.74%
Inception | 95.23% | 92.64% | 94.35% | 87.62% | 97.63%
Table 2: Performance Metrics by Method

Accuracy, Specificity, Precision, Recall were compared for comparable
architecutres as well as the method used in the paper. The faster rcnn model
was trained to classify the cxr dataset.

For evaluation of the validity of the model 5 fold cross validation was
performed with first fold used to test and remaining used to train the model.
Then performance as a binary classification problem. Performance change in
resnet on each fold cross validation shown in table 3

Fold Number | AC | SP | PR | RC | F1
---|---|---|---|---|---
Fold-1 | 97.55% | 97.10% | 98.0% | 97.12% | 97.55%
Fold-2 | 98.0% | 96.23% | 97.0% | 98.97% | 97.97%
Fold-3 | 97.7% | 97.4% | 99.1% | 97.46% | 98.71%
Fold-4 | 93.75% | 96.50% | 91.0% | 96.92% | 93.57%
Fold-5 | 95.9% | 96.80% | 97.0% | 96.8% | 96.89%
Average | 95.28% | 96.36% | 96.60% | 97.32% | 96.93%
Table 3: Performance Metrics for Folds

The Researched FasterRCNN – ResNet Model showcased 95.28specificity.

##  5 Conclusion and Future Scope

###  5.1 Conclusions

In this paper, faster rcnn model algorithm was used based on resnet
architecture. A number of changes were implemented to improve the accuracy of
the model. Also the architecture was compared with similar models to verify
the showcased loss validation results. Heavy augmentation in particular was
applied the dataset. Several checkpoints were utilised in the model to create
a generalise paper. Improvements were made using the said approaches as shown
in the validation loss results. The model did not involve end user processing
and augmentation, gives a good arrangement between accuracy and speed
considering the resources of dataset.

###  5.2 Future Scope

The paper can be compared with other deep learning technologies such as YOLO,
SSN and even add to that different types of CNN like RCNN , Mask RCNN, Fast
RCNN \- Different architectures can be used to increase the comparision and
verify the paper results. Even a combination of architectures can be combined
to create a newer architecture which would change the paper labelled tradeoff
between the accuracy and dataset limitation \- The model needs to be trained
largerly on a localised GPU for a bigger dataset to verify that the projected
data holds true in further experiments. \- The aspects to solve in further
studies involves increasing the learning dataset which would need labelling
done manually by a medical professional and verified by another medical
professional to mitigate any human errors.

##  6 Backmatter

Acknowledgments I would like to express my special thanks of gratitude to my
project advisor, Dr. Narendra Singh Yadav, for their able guidance and
support. Their help, suggestions, and encouragement greatly contributed to the
completion of my report.

I would also like to thank Manipal University and the Department of
Information Technology for providing me with all the facilities required for
this project.

Data Availability Statement The dataset [19] containing chest X-ray images and
metadata is provided by the National Institute of Health and Clinical Research
through Kaggle.

Data Availability Data underlying the results presented in this paper are
available in Dataset 1.

[1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 23, 24, 25, 26]

## References

  * [1] J. Gothankar _et al._ , “Reported incidence and risk factors of childhood pneumonia in india: a community-based cross-sectional study,” BMC Public Health 18, 1111 (2018).
  * [2] P. Rajpurkar, J. Irvin, K. Zhu _et al._ , “Chexnet: radiologist-level pneumonia detection on chest x-rays with deep learning,” (2017).
  * [3] R. H. Kallet, “The vexing problem of ventilator-associated pneumonia: observations on pathophysiology, public policy, and clinical science,” Respiratory Care 60, 1495–1508 (2015).
  * [4] S. Ren, K. He, R. Girshick, and J. Sun, “Faster r-cnn: towards real-time object detection with region proposal networks,” in _Advances in Neural Information Processing Systems,_ (2015), p. 91–99.
  * [5] J. Redmon, S. Divvala, R. Girshick, and A. Farhadi, “You only look once: unified, real-time object detection,” in _Proceedings of the IEEE conference on computer vision and pattern recognition,_ (2016), p. 779–788.
  * [6] W. Liu, D. Anguelov, D. Erhan _et al._ , “Ssd: single shot multibox detector,” in _European conference on computer vision,_ (2016), p. 21–37.
  * [7] F. Chollet, “Proceedings of the ieee conference on computer vision and pattern recognition (cvpr),” (2017), pp. 1251–1258.
  * [8] S. Liu and W. Deng, “Very deep convolutional neural network based image classification using small training sample size,” in _2015 3rd IAPR Asian Conference on Pattern Recognition (ACPR),_ (2015), pp. 730–734.
  * [9] R. Girshick, “Fast r-cnn,” in _2015 IEEE International Conference on Computer Vision (ICCV),_ (2015), pp. 1440–1448.
  * [10] J. Uijlings, K. van de Sande, T. Gevers, and A. Smeulders, “Selective search for object recognition,” International Journal of Computer Vision (2013).
  * [11] L. Wang and A. Wong, “Covid-net: a tailored deep convolutional neural network design for detection of covid-19 cases from chest x-ray images,” (2020).
  * [12] Y. Henon, “Retinanet,” github.com/yhenon/pytorch-retinanet (2018).
  * [13] C. F. Kuo and H. C. Wu, “Gaussian probability bi-histogram equalization for enhancement of pathological features in medical images,” International Journal of Imaging Systems and Technology 29, 132–145 (2019).
  * [14] G. Yadav, S. Maheshwari, and A. Agarwal, “Contrast limited adaptive histogram equalization based enhancement for real-time video system,” in _2014 International Conference on Advances in Computing, Communications and Informatics (ICACCI),_ (2014), pp. 2392–2397.
  * [15] C. Szegedy, W. Liu, Y. Jia _et al._ , “Going deeper with convolutions,” in _Proceedings of the IEEE conference on computer vision and pattern recognition,_ (Boston, America, 2015), p. 1–9.
  * [16] M. Bergtholdt, J. Kappes, and C. Schnörr, “Learning of graphical models and efficient inference for object class recognition,” in _Proceedings of the annual symposium of the German association for pattern recognition (DAGM06),_ (2006), pp. 273–283.
  * [17] R. H. Abiyev and M. K. Ma’aitah, “Deep convolutional neural networks for chest diseases detection,” Journal of Healthcare Engineering 2018, 12 pages (2018).
  * [18] T. Ozturk, M. Talo, E. A. Yildirim, _et al._ , “Automated detection of covid-19 cases using deep neural networks with x-ray images,” Computers in Biology and Medicine p. 103792 (2020).
  * [19] N. Bodla, B. Singh, R. Chellappa, and L. S. Davis, “Soft-nms–improving object detection with one line of code,” in _Proceedings of the IEEE international conference on computer vision,_ (Venice, Italy, 2017), p. 5561–5569.
  * [20] T.-Y. Lin, P. Dollár, R. Girshick _et al._ , “Feature pyramid networks for object detection,” in _Proceedings of the IEEE conference on computer vision and pattern recognition,_ (Hawaii, America, 2017), p. 2117–2125.
  * [21] N. Bodla, B. Singh, R. Chellappa, and L. S. Davis, “Soft-nms–improving object detection with one line of code,” in _Proceedings of the IEEE international conference on computer vision,_ (Venice, Italy, 2017), p. 5561–5569.
  * [22] S. Guendel, S. Grbic, B. Georgescu _et al._ , “Learning to recognize abnormalities in chest x-rays with location-aware dense networks,” in _Iberoamerican Congress on Pattern Recognition,_ (Springer, 2018), p. 757–765.
  * [23] X. Wang, Y. Peng, L. Lu, _et al._ , “Chestx-ray8: Hospital-scale chest x-ray database and benchmarks on weakly-supervised classification and localization of common thorax diseases,” in _IEEE CVPR,_ (2017).
  * [24] S. Yao, Y. Chen, X. Tian, and R. Jiang, “Pneumonia detection using an improved algorithm based on faster r-cnn,” Computational and Mathematical Methods in Medicine 2021.
  * [25] T. Gabruseva, D. Poplavskiy, and A. A. Kalinin, “Deep learning for automatic pneumonia detection,” (2020).
  * [26] L. Du, R. Zhang, and X. Wang, “Overview of two-stage object detection algorithms,” Journal of Physics: Conference Series 1544, 012033 (2020).


Case Study of Decoherence Times of Transmon Qubit

H. Zarrabi 1, S. Hajihosseini 2, M. Fardmanesh 2, S.I. Mirzaei 1,*

1 Department of Condensed Matter Physics, Faculty of Basic Sciences, Tarbiat
Modares University, Tehran, Iran
2 Department of Electrical Engineering, Sharif University of Technology,
Tehran, Iran
*<EMAIL_ADDRESS>
## Abstract

In the past two decades, one of the fascinating subjects in quantum physics
has been quantum bits (qubits). Thanks to the superposition principle, the
qubits can perform many calculations simultaneously, which will significantly
increase the speed and capacity of the calculations. The time when a qubit
lives in an excited state is called “Decoherence time.” The decoherence time
varies considerably depending on the qubit type and materials. Today, short
decoherence times are one of the bottlenecks in implementing quantum computers
based on superconducting qubits. In this research, the topology of the
transmon qubit is investigated, and the decoherence time caused by noise,
flux, and critical current noise is calculated by numerical method.

## Introduction

To date, different qubit types have been introduced regarding working
principles. One of the most popular of them is superconducting qubits. The
Cooper pair box was the first charge qubit based on superconductivity.[1] Due
to its high sensitivity to charge noise, it was replaced by transmon qubit,
which was introduced by Jens Koch et al. [2] in 2008. The transmon qubit
circuit consists of a SQUID (two parallel Josephson junctions) and a shunted
capacitor, as shown in Figure 1. The parallel capacitor $(C_{g})$ is much
larger than the previous qubits. By adding a SQUID, which will reduce the
coherence time by penetrating the flux noise in the loop, and increasing
$E_{J}/Ec$, the key reason, the decoherence time could be improved by also
incorporating an SQIUD and increasing $C_{g}$ in the circuit. Decoherence time
is affected by the interaction of a qubit with the environment, which causes
disturbances and collapse of superpositions and excitations to the ground
state. Low decoherence time leads to errors in quantum information processing.
The decay of the superposition of states is a limitation to performing complex
quantum algorithms. On the other hand, there must be loose interactions
between a qubit and its environment to read quantum data. Quantum decoherence
is usually characterized by measuring two times: $T_{1}$ (relaxation time) and
$T_{2}$ (dephasing time). Although in the new qubit, the sensitivity to charge
noise is reduced, however; the flux sensitivity of the transmon qubit
increases compared to the Cooper pair box qubit.

Figure 1: Schematic of the transmon qubit [3]

## Decoherence time

Different parameters need to be considered, such as anharmonicity ($\alpha$)
and decoherence time, when investigating the performance of the
superconducting qubits. The time it takes for the coherence of the quantum
state to be lost is called decoherence time. After decoherence time, the qubit
can no longer continue its operation and it stops functioning correctly.

### Dephasing time ($T_{2}$)

Each state has an energy level, and the energy of a quantum transition between
two energy levels is called transition energy. If environmental noises, such
as charge noise, flux noise, or critical current noise, cause a change in the
transition energy, dephasing occurs. When the noises coupled to the qubit and
change the transition energy for the first two states of the system
($E_{01}$), dephasing time could be defined according to equation 1 .[2]

$T_{2}(\lambda)\approx\frac{\hbar}{A}\left|\frac{\partial
E_{01}}{\partial\lambda}\right|^{-1}$ (1)

Where $\lambda$ could be a charge, flux, or critical current source noise,
$\hbar$ is the reduced Planck constant. $A$ is the amplitude of
$1\textfractionsolidus f$ noise and has different values depending on the type
of noise, as mentioned in Table 1. The transition energies can be derived by
utilizing the Hamiltonian of the transmon qubit.[2]

$\hat{H}=4E_{c}(\hat{n}-n_{g})^{2}-E_{J\Sigma}\cos\left(\pi\phi_{\text{ext}}\right)\left[\cos\hat{\varphi}+d\tan\left(\pi\phi_{\text{ext}}\right)\sin\hat{\varphi}\right]$
(2)

Where ${\phi}/{\phi_{0}}=\phi_{\text{ext}}$, $E_{J\Sigma}$ is the sum of the
two Josephson energies, which is dependent on the critical current, $E_{c}$ is
the charging energy, which is dependent on the inverse of the total
capacitance, and $d$ is the asymmetry coefficient of the Josephson junctions.
Based on fabrication techniques, junction parameters could be different, with
assumed junction asymmetries up to 10%.[2]

Dephasing | Noise Source
---|---
Charge | $A=10^{-4}-10^{-3}\,e$
Flux | $A=10^{-6}-10^{-5}\,\Phi_{0}$
Critical Current | $A=10^{-7}-10^{-6}\,I_{c}$
Table 1: Different values of the amplitude of $1/f$ noise based on charge,
flux, and critical current noise.[2]

The second method of explaining the dephasing time is utilizing the Bloch
sphere. If there is a coupling between environmental noises and the qubit
along the $\hat{z}$ axis, dephasing occurs. The $\hat{z}$ axis represents the
energy gap of the qubit. We expect an ideal qubit to have energy levels as
constant as possible with respect to the noise $\lambda$. In Figure 2, you see
the dephasing process, which includes the relaxation with a rate of
$\Gamma_{1}/2$ and pure dephasing with a rate of $\Gamma_{\phi}$.

Figure 2: Dephasing time definition by Bloch sphere.[4]

In Figure 2, First of all, environmental noise affects the $\hat{z}$ axis and
causes randomization of the phase of the qubit state, where the duration of
this event is called the pure dephasing time ($T_{\phi}$). Then, by coupling
between noise and the qubit along the two axes $\hat{x}$ and $\hat{y}$, it
moves the state vector to a random position in the Bloch sphere. According to
Figure 2, this phenomenon occurs at the rate of $\Gamma_{1}/2$, and the term
$1/2T_{1}$ appears. In this way, equation 3 describes the dephasing phenomenon
with the help of the dephasing rate $\Gamma_{2}$.

$\Gamma_{2}=\frac{\Gamma_{1}}{2}+\Gamma_{\phi}=\frac{1}{T_{2}}=\frac{1}{2T_{1}}+\frac{1}{T_{\phi}}$
(3)

Concerning equation 1, $d=10\%$, $E_{J}=20\,\text{GHz}$, and
$E_{c}=0.35\,\text{GHz}$ are assumed. The dephasing time of the transmon qubit
caused by the charge, flux, and critical current noises calculated by Jens
Koch et al., and the calculation values in the Quantum Toolbox in Python [5]
are shown in Table 2.[2]

| Calculated by Jens Koch et al. | Calculation values in QuTiP
---|---|---
Charge noise |  $\approx 8$ $s$ |  $8.667$ $s$
Flux noise |  $\approx 1$ $\mu s$ |  $1.311$ $\mu s$
Critical current noise |  $\approx 35$ $\mu s$ |  $32.104$ $\mu s$
Table 2: A comparison of the approximate values of the dephasing time
($T_{2}$) reported for the transmon qubit by Jens Koch et al. [2] and values
calculated in Python’s Quantum Toolbox (QuTiP) [5].

In addition, with the help of Quantum Toolbox in Python and using equation 1,
we can plot the diagram of dephasing times caused by all three noises based on
different ${E_{J}}/{E_{c}}$, as shown in Figures 3 and 4.
(a) (b)

Figure 3: The diagram of dephasing time due to (a) charge noise ($T_{2}^{Q}$)
and (b) flux noise ($T_{2}^{\phi}$) in terms of ${E_{J}}/{E_{c}}$.

By comparing Figure 3(a) with the graph in ref.[2], one can verify the
numerical results and see that the error percentage of this drawn graph on all
${E_{J}}/{E_{c}}$ ratios is always less than 0.8%.

(a) (b)

Figure 4: (a) Comparing the calculated results by numerical method with the
results in ref [2].
(b) Error percentage in terms of ${E_{J}}/{E_{c}}$.

In Figure 3, increasing the ${E_{J}}/{E_{c}}$ ratio, the dephasing time due to
charge noise ($T_{2}^{Q}$) increases exponentially while the dephasing time
due to flux noise ($T_{2}^{\phi}$) decreases. The reason for this behavior is
evident in equations 4 and 5. [2]

$T_{2}^{Q}\propto e^{\sqrt{\frac{E_{J\Sigma}}{E_{c}}}}$ (4)
$T_{2}^{\phi}\propto\left(2E_{c}E_{J\Sigma}\right)^{-\frac{1}{2}}$ (5)

Regardless of the circuit topology, it is impossible to reduce the qubit
sensitivity of charge and flux noise ratio simultaneously. This issue is one
of the serious challenges nowadays.

Figure 5: The diagram of dephasing time changes due to critical current noise
in terms of ${E_{J}}/{E_{c}}$.

Another source of noise at low frequencies is Josephson’s energy fluctuations.
The source of critical current noise is the tunnel junction. Figure 5 shows
the changes in the duration of the dephasing due to the critical current noise
with the increase of the ${E_{J}}/{E_{c}}$ ratio. According to equation 6, the
dephasing time caused by the critical current noise is proportional to the
inverse root of the critical current, which could be derived from equation 1.

$T_{2}^{I_{c}}\propto\frac{\sqrt{I_{c}}}{I_{c}}=\frac{1}{\sqrt{I_{c}}}$ (6)

As a result, by increasing of $I_{c}$ (or ${E_{J}}/{E_{c}}$ ratio), we expect
the dephasing time caused by the critical current noise to decrease, as shown
in Figure 5. The solid blue line in Figure 5 is drawn based on the calculation
results. The two red and green dotted lines are the result of the theoretical
results of the Transmon and Cooper couple box regimes. [2]

## Conclusion

Up to now, many attempts have been made to increase the dephasing and
relaxation times by changing the topology of superconducting circuits.
Optimizing the quantum circuits and preserving their valuable properties can
create a new qubit with much better performance. To increase the dephasing
time, it is necessary to increase all three dephasing times because, in
reality, all the environmental noises are simultaneously coupled with the
qubit.
Numerical simulations were conducted using Quantum Toolbox in Python [5]to
study the behavior of the $T_{2}$ dephasing time for various noise sources
based on the $E_{J}/E_{C}$ ratio in both the Cooper pair box and transmon
regimes. Employing equations from reference [2], the effects of different
noise sources were examined. The simulation results demonstrated how the
dephasing time responded to changing noise sources, with particular emphasis
on critical current noise. The analysis suggests that an increase in $I_{c}$
(or $E_{J}/E_{C}$ ratio) may lead to a reduction in the dephasing time
attributed to critical current noise. This trend aligns with theoretical
expectations and highlights the intricate relationship between noise sources
and qubit performance.

## References

  * 1. Y. Nakamura, Yu. A. Pashkin, J. S. Tsai, “Coherent control of macroscopic quantum states in a single-Cooper-pair box”
  * 2. Jens Koch, Terri M. Yu, Jay Gambetta, A. A. Houck, D. I. Schuster, J. Majer, Alexandre Blais, M. H. Devoret, S. M. Girvin, and R. J. Schoelkopf, “Charge insensitive qubit design derived from the Cooper pair box”,2007)
  * 3. J. Goetz, R. Gross, and G. Rempe, “The Interplay of Superconducting Quantum Circuits and Propagating Microwave States”, 2017
  * 4. Philip Krantz, Morten Kjaergaard, Fei Yan, Terry P. Orlando, Simon Gustavsson, William D. Oliver “A Quantum Engineer’s Guide to Superconducting Qubits”, 2019
  * 5. J.R. Johansson and P.D. Nation and Franco Nori “QuTiP 2: A Python framework for the dynamics of open quantum systems”, 2013