# Knowledge-Based Convolutional Neural Network for the Simulation and
Prediction of Two-Phase Darcy Flows

Zakaria Elabid1, Daniel Busby2, Abdenour Hadid1 1 Sorbonne Center for
Artificial Intelligence, Sorbonne University Abu Dhabi, UAE
2 TotalEnergies, France

###### Abstract

Physics-informed neural networks (PINNs) have gained significant prominence as
a powerful tool in the field of scientific computing and simulations. Their
ability to seamlessly integrate physical principles into deep learning
architectures has revolutionized the approaches to solving complex problems in
physics and engineering. However, a persistent challenge faced by mainstream
PINNs lies in their handling of discontinuous input data, leading to
inaccuracies in predictions. This study addresses these challenges by
incorporating the discretized forms of the governing equations into the PINN
framework. We propose to combine the power of neural networks with the
dynamics imposed by the discretized differential equations. By discretizing
the governing equations, the PINN learns to account for the discontinuities
and accurately capture the underlying relationships between inputs and
outputs, improving the accuracy compared to traditional interpolation
techniques. Moreover, by leveraging the power of neural networks, the
computational cost associated with numerical simulations is substantially
reduced. We evaluate our model on a large-scale dataset for the prediction of
pressure and saturation fields demonstrating high accuracies compared to non-
physically aware models.

###### Index Terms:

Physics-informed neural networks, knowledge based learning, reservoir
engineering, deep learning, porous media.

##  I Introduction

Physics-informed neural networks (PINNs) [1, 2] have gained prominence due to
their unique capabilities in modeling and predicting complex physical
phenomena. One of the primary advantages of PINNs is their ability to
seamlessly integrate the governing equations into the neural network
architecture. A substantial challenge in applying PINNs to real-life dynamics
applications lies in dealing with discontinuities and sharp gradients [3],
often prevalent in hydrology and reservoir problems [4].

In fluid dynamics problems [5], predicting pressure and saturation
traditionally relies on numerical simulations [6]. These simulations employ
complex mathematical models and computational techniques to approximate the
behavior of fluids. While numerical simulations have been a cornerstone of
fluid dynamics research, they do come with limitations. First, they often
require substantial computational resources, making them computationally
expensive for high-resolution simulations or real-time applications. Second,
they demand a wealth of input data and, in many cases, idealized assumptions
that may not fully capture the intricacies of real-world porous media [7, 8].
Numerical simulations can struggle to handle discontinuities or sharp
gradients in reservoir properties, and they may lack the flexibility to adapt
to varying conditions and data scarcity. Additionally, the demand for
extensive training data for deep neural networks can pose limitations in many
porous media applications. Acquiring large datasets can be costly and time-
intensive, necessitating strategies to overcome data scarcity while
maintaining model accuracy. Moreover, the computational overhead associated
with training deep neural networks, particularly for high-resolution
simulations, presents a challenge, and renders the application of conventional
neural networks methodologies highly impracticable. While these shortcomings
have spurred the exploration of alternative approaches like physics-informed
neural networks (PINNs) to address these challenges and enhance the accuracy
and efficiency of fluid flow predictions in porous media[9], the abrupt
changes in physical properties being pivotal for characterizing reservoir
behavior made it imperative to develop techniques that enable PINNs to handle
such discontinuities effectively [10, 11].

To overcome the shortcomings of the aforementioned techniques, we present a
novel approach using discretized equations within the PINN to solve the two-
phase flow problem in porous media. Our contributions in this paper are
described as follows:

  * •

We build a physically aware generalizable framework called KED (Knowledge
based encoder-decoder) where the network trains on observed data and the
physical equations governing it to solve the problem of two-phase flow in a
porous media.

  * •

We compute the discrete spatio-temporal derivatives of the inputs and outputs
to account for the discontinuity in the modeled data when enforcing the
dynamics in the network.

  * •

We evaluate our model on a large-scale dataset and demonstrate high accuracies
of predictions compared to non physically aware models.

##  II Preliminaries

This section discusses some necessary mathematical prelim- inaries on the two-
phase flow problem.

###  II-A Darcy’s Law and Mass Conservation Equations

Darcy’s law [12] relates the fluid velocity to the pressure gradient in porous
media and is fundamental to describing the flow of both oil and water through
the porous medium. For fluid phase l, it can be expressed as:

$q_{l}=-k\cdot\nabla P_{l}$ (1)

Where: $q_{l}$ is the volumetric flow rate of fluid (water or oil), k is the
permeability of the porous medium and $\nabla P_{l}$ is the pressure gradient
of the fluid phase

For each fluid phase (oil and water), mass conservation equations describe how
the fluid mass is distributed within the porous medium. These equations are
typically expressed as:

$\frac{\partial(\phi S_{l}\rho_{l})}{\partial
t}+\nabla\cdot(\rho_{l}\mathbf{q}_{l})=Q_{l}$ (2)

Here, $\phi$ is porosity of the porous medium, $S_{l}$ is the saturation of
fluid, $\rho_{l}$ is the density of fluid, $q_{l}$ is flux rate of fluid,
$Q_{l}$ is sink term for fluid.

Solving these equations simultaneously in a porous medium with appropriate
boundary conditions and initial conditions allows for the prediction of how
oil and water distribute and flow through the porous media over time.

$\displaystyle N={}$
$\displaystyle(\rho_{l}\frac{Kk_{rl}}{\mu_{l}})_{\begin{subarray}{c}i+\frac{1}{2}\\\
j,k\end{subarray}}\frac{\hat{P}_{li+1,j,k}^{n+1}-\hat{P}_{li,j,k}^{n+1}}{dx^{2}}-(\rho_{l}\frac{Kk_{rl}}{\mu_{l}})_{\begin{subarray}{c}i-\frac{1}{2}\\\
j,k\end{subarray}}\frac{\hat{P}_{li,j,k}^{n+1}-\hat{P}_{li-1,j,k}^{n+1}}{dx^{2}}+\rho_{l}(\frac{Kk_{rl}}{\mu_{l}})_{\begin{subarray}{c}i,j+\frac{1}{2}\\\
k\end{subarray}}\frac{\hat{P}_{li,j+1,k}^{n+1}-\hat{P}_{li,j,k}^{n+1}}{dy^{2}}$
(4)
$\displaystyle-(\rho_{l}\frac{Kk_{rl}}{\mu_{l}})_{\begin{subarray}{c}i,j-\frac{1}{2}\\\
k\end{subarray}}\frac{\hat{P}_{li,j,k}^{n+1}-\hat{P}_{li,j-1,k}^{n+1}}{dy^{2}}+(\rho_{l}\frac{Kk_{rl}}{\mu_{l}})_{\begin{subarray}{c}i,j\\\
k+\frac{1}{2}\end{subarray}}\frac{\hat{P}_{li,j,k+1}^{n+1}-\hat{P}_{li,j,k}^{n+1}}{dz^{2}}-\left(\rho_{l}\frac{Kk_{rl}}{\mu_{l}}\right)_{\begin{subarray}{c}i,j\\\
k-\frac{1}{2}\end{subarray}}\frac{\hat{P}_{li,j,k}^{n+1}-\hat{P}_{li,j,k-1}^{n+1}}{dz^{2}}$
$\displaystyle+q_{li,j,k}-\phi_{i,j,k}C_{l}\hat{S}_{li,j,k}\rho_{l}\frac{\hat{P}_{li,j,k}^{n+1}-\hat{P}_{li,j,k}^{n}}{dt}-\phi_{i,j,k}\rho_{l}\frac{\hat{S}_{li,j,k}^{n+1}-\hat{S}_{li,j,k}^{n}}{dt}=0$

##  III Proposed Method

We consider a 3D two-phase flow problem in a porous media. The governing
equations write:

$\displaystyle\frac{\partial}{\partial
x}\left(\rho_{l}\frac{k_{x}k_{rl}}{\mu_{l}}\frac{\partial P_{l}}{\partial
x}\right)+\frac{\partial}{\partial
y}\left(\rho_{l}\frac{k_{y}k_{rl}}{\mu_{l}}\frac{\partial P_{l}}{\partial
y}\right)+$ (3) $\displaystyle\frac{\partial}{\partial
z}\left(\rho_{l}\frac{k_{z}k_{rl}}{\mu_{l}}\frac{\partial P_{l}}{\partial
z}\right)+q_{l}=\phi C_{l}S_{l}\rho_{l}\frac{\partial P_{l}}{\partial
t}+\phi\rho_{l}\frac{\partial S_{l}}{\partial t}$

Where: l is the fluid phase (oil or water), parameters $C,\rho,\mu,\phi,k_{r}$
are known for each phase, $k_{x}=k_{y}=k_{z}=K$ is the input, and P and S are
the pressure and the saturation.

From the differential equation, we simulate an experiment using a built-in
simulation tool to generate 3D instances of permeability K (input) and their
corresponding pressure maps P and saturation maps S.

We solve the discrete form of equation 3 by using Finite Differences method
[13] which we will be using as the governing equation of our proposed PINN
framework.

The previous equations can be rewritten into equation 4 for steps $i,j,k$ in
space corresponding to the grid positions and n in time. $dt,dx,dy,dz$ are the
lengths of the time step and spacial steps in directions x,y and z
respectively. The notation $i+\frac{1}{2}$ and $i-\frac{1}{2}$ corresponds to
the harmonic mean. It’s given for i (and similarly for j and k) by the
expression:

$k_{i+\frac{1}{2}\\\
j,k}=\frac{2k_{i,j,k}k_{i+1,j,k}}{k_{i,j,k}+k_{i+1,j,k}};k_{i-\frac{1}{2}\\\
j,k}=\frac{2k_{i,j,k}k_{i-1,j,k}}{k_{i,j,k}+k_{i-1,j,k}}$

Our model consists of two identical encoder-decoder networks one to predict
pressure maps and the other to predict saturation maps. We train our model in
two different manners:

####  III-1 Supervised Learning

The model predicts pressure and saturation maps from permeability fields K and
timesteps input t. The resulting maps are then compared to the real maps using
prediction metrics such as MAE or MSE:

$L_{P}=MSE(P_{predicted},P_{real})$

$L_{S}=MSE(S_{predicted},S_{real})$

####  III-2 Knowledge-Based Learning

To compute the discrete derivatives from equation 4, we consider that the
values of $P(x,y,z,t),S(x,y,z,t)$ represent the output corresponding to inputs
$K(x,y,z)$ and $t$, while $P(x+dx,y,z,t),S(x+dx,y,z,t)$ correspond to
$K(x+dx,y,z)$ and $t$, and $P(x,y,z,t+dt),S(x,y,z,t+dt)$ correspond to
$K(x,y,z)$ and $t+dt$, and so forth.

We train our networks in a semi-supervised [14] manner by satisfying the
underlying physics in equation 4 for every gridcell $i,j,k$ and every timestep
t of the duration of the simulation.

The corresponding physics loss writes:

$L_{phy}=\sum_{t=0}^{t_{n}}\sum_{i=1}^{N_{x}/dx}\sum_{j=1}^{N_{y}/dy}\sum_{k=1}^{N_{z}/dz}N(i,j,k,K,t)$
(3)

where N is the differential operator described by equation 4 and
$N_{x},N_{y},N_{z}$ is the length of the grid blocks in the directions $x,y,z$
each block of dimensions $dx,dy,dz$.

An algorithmic version of the suggested model is presented in Algorithm 1.

### U-Net Encoder Decoder

U-Net architecture is an encoder-decoder structure, characterized by a
contracting path to capture context and a symmetry enabling precise
localization. It is especially adept at handling multi-dimensional subsurface
flow data. The U-Net architecture learns effectively complex mappings from
input 3D permeability to predict the dynamic evolution of the output pressure
and saturation maps. For our method, we use a simple U-Net composed of 4
convolutional layers with a kernel of 3 and a stride of 1 for the encoder, a
linear layer with 100 neurons and 4 deconvolution layers with a kernel of 3
and stride of 1 for the decoder. Encoder and decoder layers are linked through
skip-connections to preserve local physical properties.

Algorithm 1 Knowledge-Based Encoder-Decoder (KED)

Data: X = Permeability Field $K(x,y,z)$, Virtual Permeability field
$K_{v}(x,y,z)$, Time Matrix $[t_{1},...,t_{n}]$

Networks: Net1 and Net2 are identical encoder-decoders

Result: Y = Pressure field $P(x,y,z,t)$, Saturation field $S(x,y,z,t)$

Initialize networks’ parameters: (weights and biases)

while  _$epoch <max\\_epochs$ or Termination Condition_ do

Load pretrained network state (weights, biases) Compute
$P(t)=Net1(k,t)$,$S(t)=Net2(k,t)$ Calculate the loss
$L_{P}=MSE(P_{predicted},P_{real})$ Calculate the loss
$L_{S}=MSE(S_{predicted},S_{real})$ Backpropagate
$\lambda_{p}L_{P}+\lambda_{s}L_{S}$ (using ADAM optimizer)
$\lambda_{p},\lambda_{s}$ being tuning parameters chosen by cross-validation

end while

Load network state while  _$epoch <max\\_epochs$ or Termination Condition_ do

Compute $P_{v}(t)=Net1(k_{v},t)$, $S_{v}(t)=Net2(k_{v},t)$ Compute
$P_{v}(t+dt)=Net1(k_{v},t+dt)$, $S_{v}(t+dt)=Net2(k_{v},t+dt)$ Calculate the
loss $L_{phy}$ from Equation (4) using the discrete forms
$P_{v}(t),P_{v}(t+dt),S_{v}(t),S_{v}(t+dt),k_{v},t,dt$ to compute the discrete
derivatives $\forall t$; Backpropagate $\lambda_{phy}L_{phy}$ (using ADAM
optimizer) $\lambda_{phy}$ being a tuning parameter chosen by cross-validation

end while

##  IV Experimental Analysis

Figure 1: Permeability map with sand and mud facies

A. Dataset

We evaluate our KED approach on a large dataset containing 2923 realizations
of permability K fields corresponding to two facies (as can be seen in Figure
1): sand and mud. For the sand phase (yellow), K=2000md and for the mud phase
(purple), K=20md. Similarly, the porosity $\phi=0.25$ for the sand and
$\phi=0.1$ for the mud. The dataset contains 40m x 40m x 20m grid blocks -
each block being of dimensions dx = 20, dy = 20, dz = 2 [15]. The simulation
is done over 21 timesteps of 50 days each. For this problem, the set values of
parameters are $C=9.10^{-5}$, $\rho_{water}=1838Kg/m^{3}$,
$\rho_{oil}=787Kg/m^{3}$, $\mu_{water}=0.31cp$, $\mu_{oil}=1.14cp$.

For simplification, the problem considers that both water and oil undergo
similar pressure levels $P_{o}=P_{w}=P$ and that oil and water saturations are
complementary i.e $S_{o}=1-S_{w}$ which means that there can only be oil or
water in the reservoir and the presence of any other fluid is negligible.
Additionally, the relative permeability $k_{r}$ ($k_{ro}$ for oil and $k_{rw}$
for water) can be expressed as a function of water saturation $S_{w}$ [16]:

$k_{ro}\left(S_{w}\right)=k_{o}\left(\frac{1-S_{w}-S_{c}}{1-2S_{c}}\right)^{a};k_{rw}\left(S_{w}\right)=k_{w}\left(\frac{S_{w}-S_{c}}{1-2S_{c}}\right)^{a}$

Where: $a=2$, $S_{c}$ = 0.1, $k_{o}$ =1 and $k_{w}$ = 0.8

The data is publicly available at [17].

###  IV-B Performance measures

To evaluate our approach, we consider two metrics commonly used in prediction
models. A better model corresponds to lower values of these metrics : (a) Mean
Absolute Error (MAE) and (b) Mean Squared Error (MSE). Nonetheless, in cases
of a homogeneous noise free input data, these metrics are bound to be low even
at worst case scenario. Therefore, to assess the performance of the network in
capturing the underlying physics of the problem, we consider an additional
physically relevant metric. This metric corresponds to the amount of oil
production of the reservoir throughout the simulation process in each
production well. This metric can be computed using Peaceman equation[18] :

$q_{w}=\frac{2\pi kdz}{ln(\frac{r_{0}}{r_{w}})}\frac{k_{r}\rho}{\mu}(P-bhp)$
(4)

where $r_{0}=0.14\sqrt{dx^{2}+dy^{2}}$, $r_{w}=0.1$ and $bhp$ is the bottom
hole pressure fixed at 310 bar for our experiment.

###  IV-C Implementation of the proposed framework

Data is acquired through numerical simulation of physical equations in Section
II-A using AD-GPRS simulator [19]. The code is written in pytorch workflow. We
train two identical encoders-decoders with skip-connections in a supervised
manner on realizations of permeability. We preprocess the permeability into a
matrix containing the timesteps as well. We feed the batch to the $1^{st}$
network to output the 3D pressure field in time P(x,y,z,t) and the $2^{nd}$
network to output the 3D saturation field in time S(x,y,z,t). We use MSE as a
loss for the backpropagation. After loading the network state [20], we train
our network in a semi-supervised manner where from additional realizations of
permeability k, which we call virtual permeability in Algorithm 1 to mitigate
potential ambiguity with the realizations used in supervised training, we
compute the pressure and saturation fields and their discrete derivatives as
described by Equation 4. The feedback mechanism consists on minimising the
observed loss (identical to pre-training) and physical loss as expressed in
Equation 3. The total loss can be expressed as $L_{total}=L_{data}+\lambda
L_{physical}$ where $\lambda=0.1$

###  IV-D Visualization of 2D pressure and saturation fields

Figure 2 displays the 2D predictions of pressure saturation maps at specific
depths using both our approach (middle) and the same encoder-decoder model
without the inclusion of dynamics (right). We can notice that our network
manages to make accurate and physically consistent predictions compared to the
baseline non-physically aware model. The shortcomings of non-physics models
are particularly apparent in saturation maps where oil appears flow at higher
rates in the baseline prediction compared to the reference, potentially
leading to inconsistencies in the well drilling process. This shortcoming is
avoided with our knowledge-based model that manages to properly captures the
feature maps of pressure and satutration due to its awareness of the
discontinuities of the dynamics.

###  IV-E Production values

The production values are computed using Equation 4. In this simulation, there
are 4 producing wells. The oil production of the wells is depicted in Figure
3. Based on the results obtained, the physically based encoder-decoder manages
to predict production values closer to the real ones in addition to exhibiting
the same behaviour as the reference production curve for all 4 wells at all
timestamps. The disparity is particularly apparent in this example at well 1
where the non-physically aware baseline model is uncapable of mimicking the
evolution curve of the groundtruth production, as well as the initial
conditions where it exhibits unwanted behaviour, potentially related to the
discontinuities in the system and practically leading to unquantifiable
uncertainty in real life applications. The power of our physically-aware model
can be further seen in crossplot of Figure 4 where we score closer production
values to the real production.

c

Figure 2: Comparison between reference (left), KED (middle) and non-physics
prediction baseline (right) of 2D Pressure maps (top) and saturation maps
(bottom) Figure 3: Comparison of oil production in production wells between
reference (orange), baseline (blue) and our approach (green) Figure 4:
Crossplot of the real oil production and the predicted oil production levels
using our approach on 500 test samples

##  V Conclusion

In this paper, we presented a novel approach to physics-informed machine
learning by combining physical knowledge in the form of discrete differential
equations and observable knowledge from the data to solve two-phase flow
problem in porous media. The proposed model takes a semi supervised approch in
which it learns partially from the data, the discrete form of the dynamics to
penalize the loss in addition to prior knowledge gained in supervised pre-
training. We built our model under the assumption that the continuity of the
derivatives in classic PINNs can overlap with the discontinuity of the
reservoir grids. This hypothesis holds strong when comparing the performance
of our network to baseline models. An interesting perspective is to try the
proposed KED model with different architectures such as Generative Adversarial
Networks (GAN) [21] to further see the impact of physical knowledge on a
network renowned for modelling and forecasting complex 3D feature maps. To
support the principle of reproducible research and to allow a fair comparison,
the source code of this work will be made available at a later date.

## ACKNOWLEDGMENT

The support of TotalEnergies is fully acknowledged. Zakaria ELabid (PhD
Student) and Abdenour Hadid (Professor, Industry Chair at SCAI Center of Abu
Dhabi) are funded by TotalEnergies collaboration agreement with Sorbonne
University Abu Dhabi.

## References

  * [1] M. Raissi, P. Perdikaris, and G. E. Karniadakis, “Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations,” _Journal of Computational physics_ , vol. 378, pp. 686–707, 2019.
  * [2] G. E. Karniadakis, I. G. Kevrekidis, L. Lu, P. Perdikaris, S. Wang, and L. Yang, “Physics-informed machine learning,” _Nature Reviews Physics_ , vol. 3, no. 6, 2021.
  * [3] R. Rodriguez-Torrado, P. Ruiz, L. Cueto-Felgueroso, M. C. Green, T. Friesen, S. Matringe, and J. Togelius, “Physics-informed attention-based neural network for hyperbolic partial differential equations: application to the buckley–leverett problem,” _Scientific reports_ , vol. 12, no. 1, p. 7557, 2022.
  * [4] L. P. Dake, _Fundamentals of reservoir engineering_. Elsevier, 1983.
  * [5] S. Liu and J. H. Masliyah, “Single fluid flow in porous media,” _Chemical Engineering Communications_ , vol. 148, no. 1, pp. 653–732, 1996\.
  * [6] V. Shabro, C. Torres-Verdín, F. Javadpour, and K. Sepehrnoori, “Finite-difference approximation for fluid-flow simulation and calculation of permeability in porous media,” _Transport in porous media_ , vol. 94, pp. 775–793, 2012.
  * [7] M. Tang, Y. Liu, and L. J. Durlofsky, “Deep-learning-based surrogate flow modeling and geological parameterization for data assimilation in 3d subsurface flow,” _Computer Methods in Applied Mechanics and Engineering_ , vol. 376, p. 113636, 2021.
  * [8] A. e. a. Yewgat, “Imex-aunet: Deep learning proxy for multi-phase subsurface flow,” _ACM International Conference on Information and Knowledge Management, Atlanta, Georgia, USA_ , 2022.
  * [9] Z. Zhang, “A physics-informed deep convolutional neural network for simulating and predicting transient darcy flows in heterogeneous reservoirs without labeled data,” _Journal of Petroleum Science and Engineering_ , vol. 211, p. 110179, 2022.
  * [10] R. Xu, D. Zhang, and N. Wang, “Uncertainty quantification and inverse modeling for subsurface flow in 3d heterogeneous formations using a theory-guided convolutional encoder-decoder network,” _Journal of Hydrology_ , vol. 613, p. 128321, 2022.
  * [11] Z. Elabid, T. Chakraborty, and A. Hadid, “Knowledge-based deep learning for modeling chaotic systems,” in _2022 21st IEEE International Conference on Machine Learning and Applications (ICMLA)_. IEEE, 2022, pp. 1203–1209.
  * [12] S. Whitaker, “Flow in porous media i: A theoretical derivation of darcy’s law,” _Transport in porous media_ , vol. 1, pp. 3–25, 1986.
  * [13] T. Narasimhan and P. Witherspoon, “An integrated finite difference method for analyzing fluid flow in porous media,” _Water Resources Research_ , vol. 12, no. 1, pp. 57–64, 1976.
  * [14] X. J. Zhu, “Semi-supervised learning literature survey,” 2005.
  * [15] M. Tang, Y. Liu, and L. J. Durlofsky, “A deep-learning-based surrogate model for data assimilation in dynamic subsurface flow problems,” _Journal of Computational Physics_ , vol. 413, p. 109456, 2020.
  * [16] J. Stankovich and D. Lockington, “Brooks-corey and van genuchten soil-water-retention models,” _Journal of Irrigation and drainage Engineering_ , vol. 121, no. 1, pp. 1–7, 1995.
  * [17] “3D simulated data of two phase flow in a porous media,” Stanford University, Accessed September 2023. [Online]. Available: https://drive.google.com/drive/folders/1_Zs9txwZIVKy_QRwZL-D3O0R8Cl71tA-?usp=sharing
  * [18] D. W. Peaceman, _Fundamentals of numerical reservoir simulation_. Elsevier, 2000.
  * [19] AD-GPRS, “Automatic differentiation general purpose research simulator (ad-gprs),” 2018.
  * [20] L. Torrey and J. Shavlik, “Transfer learning,” in _Handbook of research on machine learning applications and trends: algorithms, methods, and techniques_. IGI global, 2010, pp. 242–264.
  * [21] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio, “Generative adversarial nets,” _Advances in neural information processing systems_ , vol. 27, 2014.


# Detection of Covid-19 From Chest X-ray Images Using Artificial Intelligence:
An Early Review

Muhammad Ilyas  e-mail<EMAIL_ADDRESS>Hina Rehman  UOM,
Biotechnology, Malakand, France  Amine Nait-ali  UOM, Biotechnology, Malakand,
France

###### Abstract

In 2019, the entire world is facing a situation of health emergency due to a
newly emerged coronavirus (COVID-19). Almost 196 countries are affected by
covid-19, while USA, Italy, China, Spain, Iran, and France have the maximum
active cases of COVID-19. The issues, medical and healthcare departments are
facing in delay of detecting the COVID-19. Several artificial intelligence
based system are designed for the automatic detection of COVID-19 using chest
x-rays. In this article we will discuss the different approaches used for the
detection of COVID-19 and the challenges we are facing. It is mandatory to
develop an automatic detection system to prevent the transfer of the virus
through contact. Several deep learning architecture are deployed for the
detection of COVID-19 such as ResNet, Inception, Googlenet etc. All these
approaches are detecting the subjects suffering with pneumonia while its hard
to decide whether the pneumonia is caused by COVID-19 or due to any other
bacterial or fungal attack.

##  1 introduction

In December 2019, COVID-19 pandemic emerged in wuhan china. It became a global
health problem in a very short time because of it contact-transferred
behaviours [1, 2]. COVID-19 is caused by a virus known as Severe Acute
Respiratory Syndrome Coronavirus 2 or also SARS-Cov-2 [3]. A large family of
these virus are causing different kind diseases such as cold, Middle East
Respiratory Syndrome and Severe Acute Respiratory Syndrome. The new addition
to coronavirus family COVID-19 is discovered in 2019, which has never been
detected in humans. COVID-19 is known as zoonotic disease because it is
transferred from animal to human such as bat [4], similar to SARS-CoV virus
which is contaminated through cat and MERS-CoV from dromedary [5]. It is
presumed that respiratory transmission and physical contact is cause to spread
COVID-19 rapidly. According to world economic forum , people with no symptoms
or mild symptoms are the main reason of spreading the epidemic. one our of
four subject shows no symptoms of COVID-19, although he/she is suffering with
the disease [6].

Nearly 82% of the total infected subjects shows mild or no symptoms and the
remaining are in critical conditions [7]. Approximately 1,359,010 cases have
been registered and 75,901 of them died and 293,454 were recovered till 7th
April 2010. In the current status of infected subjects the statistics provides
the probability that 95% has the chances of recovery and 5% is the mortality
rate as shown in figure 2 [8].

Dyspnea, fever and cough are symptoms of the infection while in more critical
situation, this infection can lead to pneumonia, septic shock, SARS, organ
failure and death [4]. Comparative studies shows that the infection is widely
spread in men as compare to women due to higher exposure and no deaths are
reported in the children’s in age range of 0-9 years [7, 8]. Respiratory
problems spread faster in the subjects having pneumonia caused by COVID-19 as
compared to healthy subjects [9].

In the developing countries, the pandemic spread very rapidly even after
taking the precautionary measure as shown in figure 1. From march 19 till 31st
march the number of infected subjects increased exponentially and the demand
for intensive care units is increased in parallel [8].

Figure 1: Daily cases of COVID-19 Figure 2: Death and recovery rate of
COVID-19

The Chinese government publish the updated guidelines, COVID-19 could be
diagnosed by gene sequencing through blood samples and Reverse Transcriptor
Polymerase Chain Reaction (RT-PCR) is a specific indicator. The process gene
sequencing using RT-PCR is time consuming and the subject should be
hospitalized immediately.

Thus considering the fact, the subjects tested positive with COVID-19 may have
pneumonia and can easily be indicated by using automatic system for detection
of COVID-19, and the concern department should consider immediate isolation
and treatment for the subjects. A subject with critical stage, should suffered
with a permanent lungs damage, if not died. According to world healthy
organization, COVID-19 creates holes in the lungs similar to SARS which is not
recoverable [4]

For detection of pneumonia the technique of computed tomography of the chest
is also useful. Artificial Intelligence based system for automatic detection
of COVID-19 can be helpful in monitoring, quantifying and distinguish a
contact free subjective communication. A deep learning technique is also
developed for extraction of graphical characteristics of COVID-19 from CT
images to provide quick and precise diagnosis as compared to pathogenic
testing and save the critical time [10].

COVID-19 belongs to the same family of SARS-CoV and MERS-CoV, Scientific
evidence supports the possibility to detect SARS-CoV and MERS-CoV using chest
x-ray and CT images. Researchers have used the techniques of features
extraction and data mining to identify the pneumonia caused by MERS-CoV and
SARS-CoV [11].

X-ray machines are normally used to scan the body for detection of fractured
bones, tumors, pneumonia, and lungs infections while CT scanning is a Little
advanced and more sophisticated system to examine different body part, tissues
and organs more clearly. Using x-ray images is a bit cheap and easier way as
compared to CT. While wrong detection may lead epidemic worst than expected
[12].

In this article, we will discuss the existing artificial intelligence based
system for the detection of COVID-19 and the challenges these systems are
facing.

##  2 Results

Considering the challenges related to pandemic COVID-19, Artificial
Intelligence (AI) can provide sophisticated solutions. The human knowledge,
intelligence, and creativity along with the updated technology, its possible
to beat the problems.

The COVID-19 challenges are somehow exposing the drawback related to AI. The
existing form of AI, in the form of machine learning and deep learning is
trying to identify different pattern in the training databases. AI can provide
sufficient results just in case having enough data for training and testing
different systems with several approaches.

Figure 3: Schematic representation of pre-trained models for the prediction of
COVID-19 patients and normal

In table 1, the comparison of different deep learning have evaluated on
several databases [18, 19, 20]. Ali et al. [13] have used a dataset of nearly
100 subject [18], among them 50 x-ray images subjects were tested positive
with COVID-19 and 50 x-ray images of normal subjects as shown in figure 5 and
figure 4 respectively. They tried several deep learning approaches such as
ResNet50, InceptionV3 and InceptionResNetV2 as shown in figure 3. Furthermore,
ResNet50 model shows the highest accuracy of 98% for the proposed dataset
while InceptionV3 and Inception-ResNetV2 show 97% and 87% respectively.
Prabira et al. [14] used Support vector Machine (SVM) with different deep
learning architecture (AlexNet, DenseNet201, GoogleNet, Inceptionv3, ResNet18,
ResNet50, ResNet101 , VGG16, VGG19, XceptionNet and Inceptionresnetv2). They
used a dataset of x-ray images consists of 50 images (25 subjects infected
with COVID-19 and 25 subjects normal subjects). Among all the different
architecture ResNet50 with 1000 feature vectors, gives the highest
classification accuracy of 95%. Jianpenget et al. [15], used deep anamoly
detection model for detection of COVID-19. The database used for testing and
traing consist of 100 x-ray images (70 subjects infected with COVID-19 while
30 normal subjects) [18]. While they trained the system with 1431 chest x-ray
having pneumonia to enhance the performance of the model to detect COVID-19.
For the proposed model, the highest classification rate was achieved nearly
96%. Ezz et al. [16] used several deep learning architecture such as Visual
Geometry Group Network (VGG), DenseNet, ResNetV2 etc. The dataset used is also
limited to 50 images ( 25 infected subjects and 25 normal subjects). The deep
neural network architecture used are able to identify the normalized
intensities of the chest x-ray images for further classification. VGG19 and
Dense Convolutions Networks shows similar accuracy for classification
performance of 91%. Ioannis et al. [17] also presented similar approaches
based on deep learning for detection of COVID-19. A database of nearly 728
x-ray images (224 positive subject with COVID-19 and 504 normal subject) [20]
are consider for training and testing purposes. They used the technique of
transfer learning and achieved the classification accuracy of nearly 98% using
VGG19 deep learning architecture.

Figure 4: Representative chest X-ray images of normal Figure 5: Representative chest X-ray images of COVID-19 patients Reference | Model | Database size | Accuracy
---|---|---|---
[13] | InceptionV3 | 50 infected and 50 normal [18] | 96%
ResNet50 | 98%
InceptionV2 | 80%
[14] | AlexNet | 25 infected 25 normal [19] | 93%
DenseNet201 | 93%
GoogleNet | 91%
InceptionV3 | 91%
ResNet18 | 91%
ResNet50 | 95%
ResNet101 | 89%
VGG16 | 92%
XceptionNet | 93%
InceptionNetV2 | 93%
[15] | ResNet Deep Anamoly detection model | 70 infected and 30 normal [18] | 96%
[16] | VGG | 25 infected and 25 normal [19] | 90%
DenseNet201 | 90%
ResNetV2 | 70%
Inception | 50%
InceptionResNetV2 | 80%
Xception | 80%
MobileNetV2 | 60%
[17] | VGG19 | 224 infected 504 normal [20] | 98%
MobileNet | 97%
Inception | 86%
Xception | 85%
InceptionResNet | 84%
Table 1: Performance evaluation of different deep learning architectures

##  3 Discussion

In the existing AI techniques, all the approaches are detecting pneumonia
caused by COVID-19 by using chest X-ray images database [18, 19, 20]. Among
the challenges AI is facing concerning the detection of pneumonia is "how the
system realize that the pneumonia detection in the chest x-ray is caused by
COVID-19", such that pneumonia can be caused by many other viruses, Bactria’s
and by fungus attack. In common practice, all the researcher agrees to problem
while "the majority of deaths from COVID-19 are owing to pneumonia in the
lungs of vulnerable patients,” said Dr. Tom Naunton Morgan, chief medical
officer at behold.ai. “Pneumonia is a potentially life-threatening condition
caused by several pathogens including, directly or indirectly, COVID-19
infection". The algorithms are trained to detect pneumonia in real time.

The common type of pneumonia occurs outside of the health care centres or
hospitals. The common reason of pneumonia is bacteria in most of the cases
which is known as streptococcus. It occurs by itself and the symptoms are cold
and flu and it can effect some portion of the lung, that condition is known as
lobar pneumonia. There is also walking pneumonia which is not severe and do
not requires any best rest. Fungal pneumonia is considered among the fatal
infections that can cause death. It subjects with weak immune system may
suffer alot with fungal pneumonia, and it is caused from absorbing organism.
Soil and bird dropping is also a source of causes of the proposed fungal
pneumonia. Viruses also causes pneumonia such SARS-Cov, MERS-CoV and newly
emerged COVID-19. Some of the viruses that cause colds and the flu which leads
to cause pneumonia. The most common causes of pneumonia are different kind of
viruses which is absorb from different kind of animals. The reason to discuss
these different kinds pneumonia and it causes is to justify the challenges to
different different all them by using a strong AI system.

AI can help the community in different areas such as early warnings and
alerts, diagnosis and prognosis, tracking and prediction, treatments, and
cures, data dashboards, and social control.

The blueDot [22] a canadian AI model proved its mettle, and collected so much
fame. According to the AI model, the user were informed about the outbreak on
31 December 2019 before World Health Organization (WHO) announced on 9th
January 2020. Some researchers worked with BlueDot and published an article in
Journal of Travel Medicine in January 2020 [21]. They mentioned that the virus
will be spread in 20 different cities in the world from Wuhan china by
travelers. BlueDot was exaggerated as well underrated by several forums,
although its a powerful AI tool. The second AI based model is Healthmap [23],
which also gave an early alarm back on 31 December 2019 at Boston Children’s
Hospital in United States of America and a scientist also predicted a
significant outbreak of the COVID-19 after 30 minutes. Although the AI model
responded faster than human.

The precise detection with short computation time can save many lives. It can
also control the spreading and generation of the disease through a well
trained model. Scientists working with UN Global Pulse, reviewed several AI
based application for the detection of COVID-19. The mentioned that the both
x-ray and Computed Tomography (CT) scans can be used for the detection of
COVID-19 based on AI models. Researchers also proposed the idea of using a
mobile phone to scan CT images for the detection of COVID-19 [24].

For prediction and tracking purposes AI can also provide sufficient support
such that in which manner that pandemic related to COVID-19 will be spread and
in how much time. Following the previous pandemic in 2015, for Zika-virus a AI
based system is developed to predict the spread of the disease [25]. These
existing model can be utilized for COVID-19 such that the system should be re-
trained with data related to COVID-19. The algorithm trained for the
prediction of seasonal flu can also be re-trained with new data from COVID-19
[26]. For deep learning architecture we need a huge among of training data. In
the state-of-the-art approaches, the databases used are very small. We cannot
rely on the performance of a system which is train with 50-100 images with
only one specific kind of pneumonia caused due to COVID-19. A big database of
chest x-ray images, is required with different types of pneumonia in order to
enhance the performance of the AI based system for the detection of COVID-19.

AI is contributing long before the COVID-19 outbreak in discovery of
potentially emerging drugs. Considering the outbreak of COVID-19, several
research lab indicated the need of AI to search the vaccine for the treatment.
Scientist believe that the use of AI model can accelerate the process of
searching cure and vaccine for COVID-19 such that The structure of the protein
of COVID-19 was predicted by Google’s DeepMind and it can provide useful
information for the discovery of the vaccine. It also mention on the webpage
of DeepMind that “we emphasize that these structure predictions have not been
experimentally verified. We can’t be certain of the accuracy of the structures
we are providing [27].”

The data dashboard is providing a sophisticated visualized information about
the details of spreading of COVID-19. MIT technologies provided several lists
to the AI based dashboard for tracking and forecasting the outbreak of
COVID-19 such that HealthMap [28], NextTrain [29], Upcode [30] are included.
All these dashboards provide a global view of COVID-19 outbreak in all the
countries.

Lock-down and social distancing are considered the preliminary and basic
precautionary measures by healthcare department. AI can be used to control the
scanning of people in crowded or potentially effected area such that in the
railway station in china infrared camera have been used to detect the human
body temperature for the prediction of fever against COVID-19 [31].

AI has been, and can further be used, to manage the pandemic by scanning
public spaces for people potentially infected, and by enforcing social
distancing and lockdown measures. For example, as described in the South China
Morning Post, “At airports and train stations across China, infrared cameras
are used to scan crowds for high temperatures. They are sometimes used with a
facial recognition system, which can pinpoint the individual with a high
temperature and whether he or she is wearing a surgical mask”.

##  4 Conclusion

The proposed AI based approaches in the literature for detection of COVID-19
shows promising results such VGG19 with 98% of accuracy, ResNET with 96%,
ResNet50 with 95% of accuracy, and InceptionV3 with 96%. The databases used in
most of cases is about 50-100 x-ray images both infected subject with COVID-19
and normal subjects too. All the proposed approaches used a binary
classification techniques, while pneumonia has several other causes too.

To conclude the existing work, it is hard to fight COVID-19 because of its
mysterious behaviour, and unknown biological origin. We can try the
precautionary measures and lesson learned from other public health outbreaks
such as SARS-CoV and MERS-CoV. The awareness about wearing masks, social
distancing, isolation, hygiene and quarantine can reduce the chances of
spreading pandemic. Convalescent plasma is also considered as a potential
therapy for COVID-19.

The future challenges for AI related to the detection of COVID-19 is: training
and testing different deep learning architectures with huge databases with all
kind of chest x-ray images infected by different kinds of pneumonia. A multi-
classification techniques is required with a data for more precise detection
of COVID-19.

## References

  * [1] Roosa, K., Lee, Y., Luo, R., Kirpich, A., Rothenberg, R., Hyman, J. M., Yan, P., and Chowell, G. Real-time forecasts of the COVID-19 epidemic in China from February 5th to February 24th, 2020. Infectious Disease Modelling, 5 : 256-263, 2020.
  * [2] Yan, L., Zhang, H. T., Xiao, Y., Wang, M., Guo, Y., Sun, C., Tang, X., Jing, L., Li, S., Zhang, M., Xiao, Y., Cao, H., Chen, Y., Ren, T., Jin, J., Wang, F., Xiao, Y., Huang, S., Tan, X., Huang, N., Jiao, B., Zhang, Y., Luo, A., Cao, Z., Xu, H., and Yuan, Y. Prediction of criticality in patients with severe Covid-19 infection using three clinical features: a machine learning-based prognostic model with clinical data in Wuhan. medRxiv preprint doi: https://doi.org/10.1101/2020.02.27.20028027, 1-18, 2020.
  * [3] Stoecklin, S. B., Rolland, P., Silue, Y., Mailles, A., Campese, C., Simondon, A., Mechain, M., Meurice, L., Nguyen, M., Bassi C., Yamani, E., Behillil, S., Ismael,S., Nguyen, D., Malvy, D., Lescure, F. X., Georges, S., Lazarus, C., Tabaï, A., Stempfelet, M., Enouf, V., Coignard, B., Levy-Bruhl, D. and Team, I. First cases of coronavirus disease 2019 (COVID-19) in France: surveillance, investigations and control measures, January 2020. Eurosurveillance, 25(6) :2000094, 2020
  * [4] https://www.who.int/health-topics/coronavirus [Last visit 01.04.2020].
  * [5] Huang, C., Wang, Y., Li, X., Ren, L., Zhao, J., Hu, Y., Zhang, L., Fan, G., Xu, J., Gu, X., Cheng, Z., Yu, T., Xia, J., Wei, Y., Wu, W., Xie, X., Yin, W., Li, H., Liu, M., Xiao, Y., Gao, H., Guo, L., Xie, J., Wang, G., Jiang, R., Gao, Z., Jin Q., Wang, J., and Cao, B. Clinical features of patients infected with 2019 novel coronavirus in Wuhan, China. The Lancet, 395(10223): 497-506, 2020.
  * [6] https://www.weforum.org/agenda/2020/03/people-with-mild-or-no-symptoms-could-be-spreading-covid-19/ [Last visited 01/04/2020]
  * [7] https://www.nationalgeographic.com/science/2020/02/here-is-what-coronavirus-does-tothe-body/ [Last visited 01/04/2020]
  * [8] https://www.worldometers.info/coronavirus/ [Last visited 01/04/2020]
  * [9] Wang, Y., Hu, M., Li, Q., Zhang, X. P., Zhai, G., and Yao, N. Abnormal respiratory patterns classifier may contribute to large-scale screening of people infected with COVID-19 in an accurate and unobtrusive manner. arXiv preprint arXiv : 2002.05534, 1-6, 2020.
  * [10] Wang, S., Kang, B., Ma, J., Zeng, X., Xiao, M., Guo, J., Cai, M., Yang, J., Li, Y., Meng, X., and Xu, B. A deep learning algorithm using CT images to screen for Corona Virus Disease (COVID-19). medRxiv preprint doi: https://doi.org/10.1101/2020.02.14.20023028, 1-26, 2020.
  * [11] Xie, X., Li, X., Wan, S., and Gong, Y. Mining X-ray images of SARS patients. Data Mining: Theory, Methodology, Techniques, and Applications, Williams, Graham J., Simoff, Simeon J. (Eds.), pp. 282-294, ISBN: 3540325476 , Springer-Verlag, Berlin, Heidelberg, 2006.
  * [12] https://biodifferences.com/difference-between-x-ray-and-ct-scan.html
  * [13] Narin, A., Kaya, C., Pamuk, Z. (2020). Automatic Detection of Coronavirus Disease (COVID-19) Using X-ray Images and Deep Convolutional Neural Networks. arXiv preprint arXiv:2003.10849.
  * [14] Sethy, P. K., Behera, S. K. (2020). Detection of coronavirus Disease (COVID-19) based on Deep Features.
  * [15] Zhang, J., Xie, Y., Li, Y., Shen, C., Xia, Y. (2020). COVID-19 Screening on Chest X-ray Images Using Deep Learning based Anomaly Detection. arXiv preprint arXiv:2003.12338.
  * [16] Hemdan, E. E. D., Shouman, M. A., Karar, M. E. (2020). COVIDX-Net: A Framework of Deep Learning Classifiers to Diagnose COVID-19 in X-Ray Images. arXiv preprint arXiv:2003.11055.
  * [17] Apostolopoulos, I. D., Bessiana, T. (2020). Covid-19: Automatic detection from X-Ray images utilizing Transfer Learning with Convolutional Neural Networks. arXiv preprint arXiv:2003.11617.
  * [18] https://github.com/ieee8023/covid-chestxray-dataset
  * [19] Chest X-Ray Images (Pneumonia) https://www.kaggle.com/paultimothymooney/chest-xray-pneumonia
  * [20] https://github.com/ieee8023/covid-chestxray-dataset
  * [21] Bogoch, I. I., Watts, A., Thomas-Bachli, A., Huber, C., Kraemer, M. U., Khan, K. (2020). Pneumonia of Unknown Etiology in Wuhan, China: Potential for International Spread Via Commercial Air Travel. Journal of Travel Medicine.
  * [22] https://bluedot.global/ [last visited 07/04/2020]
  * [23] http://www.diseasedaily.org/about [last visited 07/04/2020]
  * [24] Maghdid, H. S., Ghafoor, K. Z., Sadiq, A. S., Curran, K., Rabie, K. (2020). A novel ai-enabled framework to diagnose coronavirus covid 19 using smartphone embedded sensors: Design study. arXiv preprint arXiv:2003.07434.
  * [25] Akhtar, M., Kraemer, M. U., Gardner, L. M. (2019). A dynamic neural network model for predicting risk of Zika in real time. BMC medicine, 17(1), 171.
  * [26] https://www.technologyreview.com/s/615360/cdc-cmu-forecasts-coronavirus-spread/ [last visited 07/04/2020]
  * [27] https://deepmind.com/research/open-source/computational-predictions-of-protein-structures-associated-with-COVID-19 [last visited 07/04/2020]
  * [28] https://www.healthmap.org/covid-19/?mod=article_inline [last visited 07/04/2020]
  * [29] https://nextstrain.org/ncov [last visited 07/04/2020]
  * [30] https://www.againstcovid19.com/singapore/dashboard [last visited 07/04/2020]
  * [31] https://www.scmp.com/comment/opinion/article/3075553/time-coronavirus-chinas-investment-ai-paying-big-way [last visited 07/04/2020]