\documentclass[12pt]{report}
\usepackage{etoolbox}
%\usepackage{titlesec}
\setcounter{secnumdepth}{0}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage[margin=10pt,font={it,11pt}, labelfont=bf, labelsep= period,singlespacing]{caption}
\usepackage{natbib}
\setcitestyle{authoryear,open={(},close={)}}
% An example of defining macros
\newcommand{\rs}[1]{\mathstrut\mbox{\scriptsize\rm #1}}
\newcommand{\rr}[1]{\mbox{\rm #1}}
\setlength{\parindent}{4em}
\linespread{2.0}
%\title{Sections and subsections}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[a4paper, total={6in, 8in}]{geometry}
%%Hacking center and right align for table
%\def\cAlignHack{\rightskip\@flushglue\leftskip\@flushglue\parindent\z@\parfillskip\z@skip}
%\def\rAlignHack{\rightskip\z@skip\leftskip\@flushglue \parindent\z@\parfillskip\z@skip}
%\renewcommand{\thefootnote}{\fnsymbol{footnote}} 

\begin{document}

\begin{titlepage}
   \begin{center}
       \vspace{5mm}
       UNIVERSITY OF OKLAHOMA
    
          GRADUATE COLLEGE 
          \vspace{20mm}
      
       
     
       
       
AUTOMATIC LEAK DETECTION IN CARBON SEQUESTRATION PROJECTS
 \vspace{25mm}

         A THESIS 
        
   SUBMITTED TO THE GRADUATE FACULTY

    in partial fulfillment of the requirements for the
    
        Degree of
        
     MASTER OF SCIENCE
      \vspace{25mm}
     
          By
        
      Saurabh Sinha 
      
     Norman, Oklahoma
     
         2020
         
    \clearpage
    \thispagestyle{empty}
   \vspace{5mm}
 AUTOMATIC LEAK DETECTION IN CARBON SEQUESTRATION PROJECTS \\
          
        A THESIS APPROVED FOR THE
        
        \vspace{5 mm}

        GALLOGLY COLLEGE OF ENGINEERING
        \vspace{25 mm}
        
        BY THE COMMITTEE CONSISTING OF
        \vspace*{65 mm}
         
   \end{center}
    
\begin{flushright}
                                    Dr. Talayeh Razzaghi
                                     \hspace{0.1 mm} 
                                    
                                    Dr. Shima Mohebbi
                                     \hspace{0.1 mm} 
                                    
                                    Dr. Kurt J. Marfurt
\end{flushright}
\clearpage
\thispagestyle{empty}
\vspace*{160 mm}

\begin{center}

© Copyright by SAURABH SINHA 2020

All Rights Reserved.
\end{center}

\end{titlepage}

%\LARGE Table of Contents\vspace{15 mm}
%\justify
\cleardoublepage
\pagenumbering{roman}
\setcounter{page}{4}
\tableofcontents
\clearpage
\listoftables
\clearpage
\listoffigures
\clearpage
\section{ Acknowledgments}
As a graduate student at the University of Oklahoma from past six years, I had the opportunity to work in petroleum engineering and geophysics. As I was eager to learn about the emerging technology in the field of machine learning and data science, I decided to pursue a concurrent master in data science as well. I would like to thank my PhD guide Dr. Kurt Marfurt for his support during this period and encouraging me to pursue the data science degree and providing funding for my study in this period. 
As my work is multidisciplinary in nature, it requires expertise from both the data science and the geophysics. I would like to express my gratitude towards my committee chair Dr. Talayeh Razzaghi and Dr. Shima Mohebbi for providing me valuable inputs for this project from a data science perspective. Recently, I had an opportunity to join Los Alamos National Laboratory (LANL) in January, 2020 as an intern. The data used in this study is provided by my mentor at LANL, Dr. Lin Youzuo. I would like to wholeheartedly thank Dr. Youzuo for giving me an opportunity to work in state of the art technology available today in the field of applied machine learning in geophysics and guiding me in every aspect of the project. I would also like to thank United States Department of Energy (DOE) for providing funding for this project. 
Last but not the least, I would like to thank Dr. Rafael Lima and Yuliana Zapata for their support during this whole period as the best friends I could have ever asked for. 
\clearpage
\section{ Abstract}
\normalsize 
The international commitments for carbon capture will require a rapid increase in carbon capture and storage (CCS) projects. The key to any successful carbon sequestration project lies in the long term storage and prevention of leakage of stored carbon dioxide (CO\ensuremath{_{2}}). In addition to being a greenhouse gas, CO\ensuremath{_{2}}  leaks reaching the surface can accumulate in low-lying areas resulting in a serious health risk. Among several alternatives, some of the more promising CSS storage formations are the hundreds of thousands of depleted oil and gas reservoirs, where by definition the reservoirs had good geological seals prior to hydrocarbon extraction. With more CSS wells coming online, it is imperative to implement permanent, automated monitoring tools. In this study we applied machine learning models to automate the leakage detection process in carbon storage reservoirs using rates of supercritical (CO\ensuremath{_{2}}) injection and pressure data measured by simple pulse tests. To validate the promise of this machine learning based workflow, we implemented data from pulse tests carried out in the Cranfield reservoir, Mississippi, USA. The data consist of a series of pulse tests conducted with baseline parameters and with an artificially introduced leak. Here, we pose the leakage detection task as an anomaly detection problem where deviation from the predicted behavior indicates leaks in the reservoir. The results obtained show that different machine learning architectures such as multi-layer feed forward network, Long Short-Term Memory , convolutional neural network are able to identify leakages and can flag an early warning. These warnings can then be used by human interpreters to take remedial measures. 
\clearpage
\section{ Introduction}
\pagenumbering{arabic}
\setcounter{page}{1}
Carbon capture and storage (CCS) refers to the process of permanently capturing the CO\ensuremath{_{2}} emitted primarily by electricity generation, cement processing, and other fixed industrial assets into geological formations \citep{2}. Depleted hydrocarbon reservoirs serve as an excellent choice for CCS \citep{1,4,3} due to their higher storage capacity with available infrastructure in place. Older hydrocarbon production/injection wells can be re purposed as injection wells for the CO\ensuremath{_{2}} injection.
\par  Although complex, the physics of fluid flow in geological reservoirs is fairly well understood by petroleum engineering community. CO\ensuremath{_{2}} injection for enhanced oil recovery (EOR) projects has been used for decades in the oil industry. At atmospheric conditions, CO\ensuremath{_{2}} exits as a gas with with a density of 1.872 kg/m3. During the high pressure injection, density of CO\ensuremath{_{2}} increases causing phase changes (Figure ~\ref{fig:CO2.png}). 
Note in (Figure ~\ref{fig:CO2.png}) when the pressure and temperature exceed beyond critical point \citep{phase}, CO\ensuremath{_{2}} exists in supercritical phase which is a desirable condition.CO\ensuremath{_{2}} in supercritical state exhibits higher densities and hence more volume of CO\ensuremath{_{2}} can be injected. All CCS projects exploit this property of CO\ensuremath{_{2}} for injection. 
\par The injected CO\ensuremath{_{2}} can take a significant time to convert into stable form by either dissolution, precipitation etc. \citep{5,6,7}. Hence, key to any successful CCS project is the long term storage of the CO\ensuremath{_{2}} without leaks. Leakage, will not only negate the purpose of a CCS project, the injected CO\ensuremath{_{2}} can migrate to the surface and pose a different set of environmental problems. Leaked CO\ensuremath{_{2}} can mix with the water table and increase its acidity of the water table, it can also affect severely plant growth at surface soil levels, soil microbiology \citep{soil1,soil2}.

\begin{figure}[hbt!]
 \centering
  \includegraphics[width= 0.8\linewidth]{./Fig/CO2.png}
  \caption{CO\ensuremath{_{2}} phase behaviour. Notice at higher pressure and temperature CO2 behaves as a supercritical fluid which is often the case with CCS projects \citep{71}. }
  \label{fig:CO2.png}
\end{figure}
\begin{flushleft}

\end{flushleft}

\par The process of CO\ensuremath{_{2}} injection is not just operationally challenging but also time dependent. In a CCS project, CO\ensuremath{_{2}} is injected into pressure-depleted hydrocarbon reservoirs, increasing the reservoir pressure and hence changing the stresses in the reservoir and potentially reactivating faults in the area \citep{13,14,15}. If the faults slip, the stored CO\ensuremath{_{2}} in the reservoir may be able to migrate to the surface. 
\par The detection of  CO\ensuremath{_{2}} leakage in CCS project can be assessed via several technologies. \cite{18} and \cite{19}, measured CO\ensuremath{_{2}} concentrations in surface soils. \cite{20} found carbon isotopes in the soil served as a proxy for the CO\ensuremath{_{2}} leak, whereas \cite{21} showed that surface measurements of tracers injected with the CO\ensuremath{_{2}} can indicate leaks. Although, most of these methods are economically viable and are direct indicator of CO\ensuremath{_{2}} leak, they do not provide an early warning signal to prevent the leak during the operational stage. By the time the leak is detected, a significant amount of CO\ensuremath{_{2}} may already have reached to the surface. 
\par Two reliable and well-established field methods for continuous monitoring of subsurface properties are via  seismic monitoring and the hydrocarbon well pressure monitoring. \cite{9}, \cite{22}, \cite{23} and, \cite{24} showed the usage of seismic data in leak detection in the hydrocarbon reservoir. Three-dimensional (3D) seismic data provide a 3D image of the changes in velocities and density caused by a CO\ensuremath{_{2}} plume. A time-lapse analysis of 3D seismic can provide valuable insights on plume development and migration. Figure- ~\ref{fig:CO2_plume.png} shows one such study from the Sleipner field in the North Sea \citep{72}. Notice the "bright spots" in seismic amplitude after eight years of continuous $CO\ensuremath{_{2}}$ injection \citep{4D}.

\begin{figure}[hbt!]
 \centering
  \includegraphics[width= 0.8\linewidth]{./Fig/CO2_plume.png}
  \caption{Time lapse seismic acquired from \cite{72} showing the CO\ensuremath{_{2}} plume development on seismic amplitude in Sleipner field in the North Sea between 1994 to 2008.The corresponding density changes are recorded as "bright spots" in the amplitude data. }
  \label{fig:CO2_plume.png}
\end{figure}
\par The expert interpretation of the seismic data is expensive and time-consuming even for passive monitoring \citep{25,26,27}. Additionally, seismic data  are often band limited providing relatively low vertical resolution images, and hence an only
approximate estimate (e.g. within 50-100 m) on the spatial location of any leak.
The quality of the seismic interpretation is dependent on data acquisition, data processing, and the initial guess of the geological model itself. The data acquired from a single geophone is a measurement obtained in the form of a time series data. The migrated seismic amplitude data however, is obtained by complex processing with best guesses of geology and velocity models \citep{29,30}. The fluid substitution models used for the time-lapse analysis, pose its own set of limitations such as assumptions about the fluid properties \citep{31}. 
\par An alternative to the time-lapse seismic data monitoring is pressure data monitoring. The formation pressure is measured with a pressure gauge which is both inexpensive and easy to install. The pressure gauge is installed at the desired  target formation of a well. The gauge continuously provides high frequency, high resolution data in real time via a telemetry system \citep{32,33}. The injection of CO\ensuremath{_{2}} causes a pressure perturbation and can be induced intentionally in a process called a "well test". One such well test is a pulse test.
\par A typical pulse test consists of alternative cycles of fluid injection and well shut-in causing multiple pressure perturbations or sampling the reservoir at multiple frequencies \citep{34,35,36,37}. The pressure data are obtained at the bottom of the well and hence exhibit a high signal to noise ratio. 
\par The pulse test typically requires at least two wells. The first is an injection well at which this perturbation is induced by the harmonic injection of a fluid into the reservoir. The second is an observation well which records the response of the reservoir due to these pulses. Analyzing the pressure signal at the observation well provides various insights about the reservoir and the fluid properties such as 
reservoir connectivity, fault proximity, permeability etc.  
\cite{38}  demonstrated the efficacy of the pressure pulse test in distinguishing the pressure response of a leak versus the non-leak case in a field test in Cranfield, Mississippi, USA. Section 4 of this thesis discusses the details of the pulse test. The fact that a pulse test can distinguish between the leak and no-leak scenarios lay the foundation of this work. 
\par Analysis of pulse test by human interpreters is not an extremely complicated task. A skilled human interpreter can easily distinguish the difference between leak and non-leak responses. However, a large CCS project across multiple depleted oil fields may incorporate thousands of injection wells. Each well will be instrumented, with pulse tests being conducted every year. Continuous analysis of so many live pressure feeds can be a challenging task for human interpreters. In contrast, computers are extremely efficient
at repetitive tasks and intuitively, are best suited for this purpose.In contrast, computers are extremely efficient at repetitive tasks and intuitively, are best suited for this purpose. Combined with the fact that a pulse test can distinguish between a leak and non-leak scenarios and that process can be automated is the core of my work. 
\par The use of machine learning in CO\ensuremath{_{2}} leakage detection is not a novel idea. \cite{39} demonstrated the use of convolutional neural networks(CNN) with synthetically modeled seismic data to monitor the CO\ensuremath{_{2}} volume. \cite{40} showed the use of reservoir simulator images for a convolutional-Long Short-Term Memory (Conv-LSTM architecture). \cite{41} proposed segregating the leak and the baseline pressure response using CNN on spectral domain images. All of the above methods are either based on seismic data or two-dimensional images which either suffers from resolution issues or is computationally expensive. In many cases, the data required for simulation or the tool itself is not available at field limiting the practicality of these methods. 
\par The aim of this work is to create an early warning detection system for leakages in CCS projects using pressure data along with rate and cumulative injection volume of supercritical CO\ensuremath{_{2}}. We used currently available state-of-the-art deep learning models and tune them to suit the data. The data consists of time series data of injection rates and measured pressures from a set of pulse tests conducted at the Cranfield reservoir, Mississippi, USA. As we do not utilize any two-dimensional images or three-dimensional voxels in this study, the methodology is computationally efficient while providing state-of-the-art results. 
\par We implemented deep learning  architectures such as multi-layer feed forward (MFNN), Long Short-Term Memory (LSTM), convolutional neural networks (CNN) and a combination of CNN and LSTM, abbreviated as CONV-LSTM. The results show that if trained on a particular set of data, a machine can identify anomalous behavior from the learned data and flag it as an anomaly. Sophisticated architectures such as CNN and LSTM can learn and retain features present in typical pulse test pressure response. We also show the adaptability of the models for different pulse test as well as its limitations. The results can be achieved in a fraction of time using simple inputs but, sophisticated architectures. The final product of this analysis is an anomaly detector which can differentiate between expected versus the anomalous pressure behavior. 
\par This thesis is divided into five sections. Section one provides information about the data used in this manuscript, the problem formulation and data pre-processing for our workflow. Section two provides a basic introduction of the neural network architectures used and the tuned version used for analyses. Section three contains results from the neural network models and the discussion of these results. Section four describes the novelty of the work and the comparisons to the current state of the art. Section five presents the thesis conclusions. 

\clearpage
\section{ Background}
\begin{flushleft}
\subsection{Cranfield  site data acquisition}
\end {flushleft}
The data utilized in this study was obtained in the Cranfield reservoir, Mississippi, USA. The Cranfield reservoir is primarily a sandstone reservoir which was used for CO\ensuremath{_{2}} enhanced oil recovery project after the primary and secondary recovery \citep{38}. The CO\ensuremath{_{2}} injection for sequestration purpose started in July 2008. The pulse test used in this study was carried out in January 2015, the total injected volume into the reservoir at the time of the test was more than one million metric tons. Due to the high injection volumes continuously for seven years prior to the test, it is assumed that in-situ brine effects are negligible for any practical purposes and supercritical CO\ensuremath{_{2}} is the only in-situ fluid present in the reservoir.  
\par Figure~\ref{fig:Figure_1.png} shows the setup used in the pulse test as described by \cite{38}. Three wells are utilized in the study F1, F2, and F3. The distance between the wells is also shown in the Figure~\ref{fig:Figure_1.png}. The  CO\ensuremath{_{2}} is injected in well F1 which is the injection well, well F2 is the monitoring well, and F3 is a well that can be used to add an artificial leak by venting off CO\ensuremath{_{2}} via a surface valve to simulate a real life leakage scenario. 
\par Hereinafter, we refer as baseline, the cases on which the pulse tests are conducted without the introduction of a leak, and an alternating sequence of injection and shut-in is carried out. Two baseline tests, one of 90-minutes and one of 150-minutes, were conducted on 19th January and January 20th of 2015, respectively. Leak tests are similar to baseline tests, but with an artificial leak introduced at well F3 by opening a surface valve. Two leak tests were conducted ten days after the baseline tests, one on 30th of January 2015 and another on 31st of January 2015 with a duration of 90-minutes and 150-minutes respectively. 
\begin{figure}[hbt!]
 \centering
  \includegraphics[width= 0.8\linewidth]{./Fig/Figure_1.png}
  \caption{Schematic illustration of the wells used in this study and their configuration. F1 is the injection well, F2 is the monitoring well and F3 is the well where leak is introduced. Pressure utilized in this study is obtained from the well, F2.}
  \label{fig:Figure_1.png}
\end{figure}
Well F2 remains shut-in as an observation well during all tests and pressure data acquired at well F2 is used in our analysis. Table 1 summarizes the pulse test schedule for all four tests. Figure~\ref{fig:Figure_2.png}  shows the measured pressure recorded at well F2 during the test, along with the injection rates at well F1. We only provided the necessary details about the data for the objectives of this study. A complete description of the data acquisition is provided by \cite{38}.

\begin{table}[t]
  \begin{center}
    \begin{tabular}{c|c|c|c}
     \toprule % <-- Toprule here
     \hline
      \textbf{ Test} & \textbf{Date} & \textbf{Rate} 
      & \textbf{Pulse}  \\
      \hline
      \midrule % <-- Midrule here
      
      Baseline - 90 min & 19th Jan 2015 & 3,620 & 45\\
      Baseline - 150 min & 20th Jan 2015 & 3,620 & 75\\
      Leak - 90 min & 30th Jan 2015 & 3,620 & 45 \\
      Leak - 150 min & 31st Jan 2015& 3,620 & 75 \\
    \end{tabular}
        \caption{Injection schedule for the baseline and leak test. Pulse duration is identical in respective baseline and leak tests. All rates are measured in Bbl/D and the pulse half cycle times are in minutes.}
    \label{tab:table1}
  \end{center}
\end{table}
The pressure gauge sampling rate used in the baseline tests is one sample every two seconds i.e., a sampling rate of 0.5 samples/second. The sampling rates used in the leak tests are one sample every five seconds i.e., a sampling rate of 0.2 samples/ second. Before any analysis, we matched the sampling rates of both baseline and leak data to 1 sample/second. As very limited data is available to train the models, we used the Fourier method to re-sample the signal to 1 sample/second instead of decimating the signal \citep{42}. The data pre-processing steps are summarized in Figure- ~\ref{fig:Data_preprocessing.png}.

\begin{figure}[hbt!]
  \centering
  \includegraphics[width=.6\linewidth]{./Fig/Figure_2.png}
  \caption{Unprocessed/raw pressure data obtained from the pressure gauge installed at well F2. The rates are plotted on secondary axis. It can be observed from the image that the pressures exhibit a net upward trend due to continued injection. A detrending is required for pressure data set.}
  \label{fig:Figure_2.png}
\end{figure}
\begin{flushleft}
\subsection{Data processing} 
\end{flushleft}
\begin{figure}[hbt!]
\centering
\includegraphics[width=.8\linewidth]{./Fig/Data_preprocessing.png}
\caption{Data processing workflow for this study. The data  is de-spiked and re-sampled before modeling. }
 \label{fig:Data_preprocessing.png}
\end{figure}
Once we re-sampled the data, and both baseline and leak tests have the same sampling rates, we need to de-spike the data. The re-sampled data has 38,912 points. To de-spike the data, we used a Hann window of 21 samples and convolved the samples in the Hann window with the scaled data. 
\begin{figure}[hbt!]
\centering
\includegraphics[width=.5\linewidth]{./Fig/Figure_3.png}
\caption{150- minutes baseline test pressure response before( in green) and after( in red) detrending the data.}
 \label{fig:Figure_3.png}
\end{figure}

\begin{flushleft}
A Hann function of length L \citep{43} is defined as : 
\begin{equation}
w_0(x)\;\frac\triangle=\;\left\{\begin{array}{lc}\frac12(1+\;\cos(\frac{2\pi\;x}L))\;=\cos^{2}(\frac{\pi\;x}L),\;&\left|x\right|<\frac L2\\0,\;&\left|x\right|>\frac L2\end{array}\right. 
\end{equation}
This can then be re-sampled for a discrete signal as :
\begin{equation}
\begin{array}{l}w_{}(n)\;=\;w_0\;\left\{\begin{array}{lc}\frac12\lbrack1-\cos(\frac{2\pi\;n}N)\rbrack\;=\;\sin^{2}(\frac{\pi\;n}N)&0\leq n\leq N\end{array}\right.\\\\\end{array} 
\end {equation}
\\
where, N+1 is the length of the window. 

\par For a signal, s(t) this window can then be convolved over the signal as: 
\begin{equation}
S(t)* = s(t)*w(N+1) 
\end{equation}

where S(t)* is the smooth signal in the time domain, and H(N+1) is a Hann window of N+1 samples. 

\end {flushleft}

\par As injection rates remain the same for all tests, the rates alone cannot be used to predict the different pressures for the same rates. To overcome the issue, we created an additional feature of injected cumulative volume. This feature is then added as an input along with the injection rates to predict the given pressure response. Cumulative volume feature is nothing but the integral of the injection rates over a given period as:
\begin{equation}
\begin{array}{l}\style{}{C\;=\;\int_0^{T}q\;dt\;}\\\end{array} 
\end {equation}
where, C is the cumulative injected volume, q is the instantaneous rate and T is the time until injection is completed. We used de-spiked surface pump rates as the injection rates to compute the cumulative injection rate. 
\par Figure~\ref{fig:Figure_3.png} shows that there is a linear upward trend in the measured pressure in green and hence a detrending of the data is required. Without detrending, the machine learning models would have to extrapolate the input behavior, which is not ideal for anomaly detection tasks. The resampled and detrended data is shown in red. Notice that the number of samples are now higher and the linear upward trend is removed. As a final step for the input preparation, we used the min-max scalar from the Python 3.7 distribution Scikit-Learn library \citep{44} to rescale the inputs for modeling. 
\par Figure~\ref{fig:Figure_4.png} shows a comparison between the measured pressures in monitoring well F2 for the 90-minutes baseline and 90-minutes leak cases. The data in ~\ref{fig:Figure_4.png} shows that the pulse test is an effective method to distinguish between the leak and baseline scenarios and two pressure signals can be segregated. However, The absolute difference in pressure baseline and leak tests is minimal ~0.5 Psi. Hence, the modeling techniques for prediction requires excellent accuracy. 
\begin{figure}[hbt!]
 \centering
  \includegraphics[width=.8\linewidth]{./Fig/Figure_4.png}
  \caption{Comparison of pressure response between the leak vs. non leak 90-minutes test obtained from pressure gauge installed at well F2. It can be observed that pulse test pressure response can distinguish between the leak vs. the non -leak case.}
  \label{fig:Figure_4.png}
\end{figure}
\begin{flushleft}
\subsection{Problem formulation as anomaly detection}
\end{flushleft}
Anomaly/outlier detection in a multivariate time series data is a well-defined problem in statistics and is investigated in depth by various authors e.g., \cite{45}, \cite{46} and, \cite{47}. Simply put, an anomaly is an observation point for which the error exceeds a threshold for the given trained model. This concept can be extended from a single location to a sequence of observations. In this work, we defined anomaly using the squared error ($\varepsilon$) from the model predicted value to the actual observation. To further refine the analysis, we set thresholds on the ($\varepsilon$) to highlight the regions of anomaly. For all the analyses, the ($\varepsilon$) is defined as: 
\begin{equation}
\varepsilon = (y_{i}-{\widehat{y}})^{2}
\end {equation}
where, y\ensuremath{_{i}} is the measured value and $\widetilde{y}$ is the predicted value. 
\clearpage
\section{ Neural Network Architectures}
\begin{flushleft}
\subsection{Modeling terminology used in the study}
\end{flushleft}
For all the deep learning architectures, we used a sliding window \citep{48,49} of 1000 samples to make the future prediction. Through trial and error, we found that a window of 1000 samples can sufficiently represent the features present in the data. Smaller windows are incapable of capturing the cyclical events properly, while larger windows leave subtle inflections in the pressure data. 
\par The inputs for all models remain as: pressure measured at the monitoring well F2, injection rates obtained from injection well F1, and cumulative injection volumes which is computed from the injection rates at well F1. Hence, the  input in all cases is a three-dimensional vector of 1000 samples each and the output is one or multiple pressure data points ahead in the future. 
\par We used 150-minutes baseline and 90- minutes leak data for the analysis. The 150-minutes leak test was not included in this workflow. We implemented a total of 39,202 data points for analysis after re-sampling of the data. Out of these, 24,542 samples belong 150-minutes baseline test and 14,660 samples belong to 90-minutes leak test. For training purposes, we used 15,000 samples from 150-minutes baseline test to train the models — roughly 40\% of the data. For the test set, we used the remainder of 9,452 samples from 150-minutes baseline and all 14660 samples from leak test. These data points are separated by various color arrows showing the train, test, baseline and leak boundaries on all result plots. The color coding of the data is explained in the results section. 
\par The models are not trained on the leak test data, because the ultimate goal of our study is to determine the anomalous pressure behavior as compared to a baseline test. If the leak test was included in the analysis, the model could not distinguish between the baseline and leak test. Therefore,it would not be able to detect anomalous behavior of pressure data. In addition, we used mean squared error (MSE) as a loss metric in all models. 
\par The chronological order of the tests shown in Table 1  shows that the 90-minutes leak test follows the 150-minute baseline test. As the reservoir pressure is a dynamic property and changes with injection, we used the 150-minute baseline and 90-minutes leak in the analysis. 
\par The neural networks are intrinsically stochastic hence, we generated 20 realizations of each model to report the average training MSE and computational time. In all the architectures described below in the following sections we tested the model performance in terms of MSE and computational time to achieve best results in the least computational times. To avoid over-fitting, we used 20\% dropout in hidden layers \citep{50}. Also. we attempted to forecast multiple points in the future in a multivariate and multistep fashion, to test the ability of a model to forecast more than one sample in the future. 
Figure ~\ref{fig:Deep_learning_methods.png} shows the models and their variations included in this study. 
\begin{figure}[hbt!]
 \centering
  \includegraphics[width=.8\linewidth]{./Fig/Deep_learning_methods.png}
  \caption{Deep learning methods and their variants used in this study. A multistep forecast is added to the analysis to test the ability of the model to predict multiple samples in the future.}
  \label{fig:Deep_learning_methods.png}
\end{figure}

\begin{flushleft}
\subsection{Multilayer Feedforward Neural Network (MFNN)}
\end{flushleft}
An MFNN is a class of feed forward artificial neural network (ANN) which uses neurons as the basic computational unit \citep{51,52,53}. An artificial neuron is a computation unit consists of weighted inputs and outputs. The output signal is triggered by an activation function. One such simple computational unit is shown in Figure ~\ref{fig:MLP.PNG}. 

\par The weights on the inputs are analogous to the regression coefficients in simple linear regression. These are often initialize with random values. These weights are updated during the "learning process" of the model and are the desired model parameters. 


\begin{figure}[hbt!]
 \centering
  \includegraphics[width=.3\linewidth]{./Fig/MLP.PNG}
  \caption{A single computational unit i.e., a neuron. The inputs are biased by weights and the neuron is activated via an activation function to produce an output \citep{73}}. 
  \label{fig:MLP.PNG}
\end{figure}
\begin{flushleft}
An activation function/ transfer function governs the threshold after which the output signal is generated. We used the term activation function in the rest of this thesis. An array of activation functions have been developed over the years such as sigmoid, hyperbolic tangent, rectified linear unit (ReLU), leaky ReLU, Exponential Linear Unit ( ELU) etc. \cite{54} discussed these activation functions in detail. 
\end{flushleft}
\begin{figure}[hbt!]
 \centering
  \includegraphics[width=.8\linewidth]{./Fig/AF.png}
  \caption{Various activation functions commonly used in the deep learning architectures  \citep{75}}. 
  \label{fig:AF.png}
\end{figure}
Figure ~\ref{fig:AF.png}  show these activation functions and their activation behaviour. In this thesis, we used ReLU as the activation function. 
\par A network of such artificial neurons form a layer and modern deep learning architectures use multiple layers of these neurons to form extremely, complex and dense multi-layer models. One such network architecture is MFNN. 
The network must have an input layer that receives the inputs. One or multiple hidden layers and an ouput layer. Output layer is the layer which produces the desired prediction.  The network learns by using backpropagation algorithm \cite{55,56} based on some loss function metric e.g., MSE. 
The learning of the network is optimized by an array of available  optimizers such as stochastic gradient descent (SGD), RMSprop, Adaptive gradient (Adagrad), Adaptive moment tensor (ADAM) etc. 

\begin{figure}[hbt!]
 \centering
  \includegraphics[width=.8\linewidth]{./Fig/MFNN.png}
  \caption{ Typical MFNN architecture. A basic MFNN architecture has an input layer, a set of hidden layers and an output layer.}
  \label{fig:MFNN.png}
\end{figure}
\begin{flushleft}
After testing both the number of layers and the number of neurons per layer, we selected a MFNN model composed of three hidden layers, respectively with 20, 20, and 10 neurons with Rectified Linear Unit (ReLU) as an activation function\citep{57}. The final output is the pressure at the next time step, and hence the last layer has just one output. We used adaptive moment estimation (ADAM) \citep{58} with a learning rate of 1e-04. 
\end{flushleft}
\par To extend this idea of predicting one point forward in time, we attempted to forecast multiple points in the future to see the ability of the model to predict multiple points before the window is slid to the next set of input data. This technique is  known as multivariate, multi-point prediction. The network architecture is similar to the one in multivariate single point described above. However, there are essential differences in the data preparation of both these methodologies. 
We used the 1000 samples to predict the first one, then ten, and finally 1000 samples in the future. The results of the model are summarized in section three. The prediction is not included in the input data to predict the future samples but the input is divided into 1000 samples window and then 1, 10, 100 and 1000 samples are used for prediction forward.
\begin{flushleft}
\subsection{Long Short-Term Memory (LSTM)}
\end{flushleft}
LSTM falls under recurrent neural network architecture. Recurrent neural networks (RNN) intrinsically have a feedback loop allowing for memory retention in longer sequences of data \cite{59,60,61}. RNN family of network architectures thus, are naturally suited for time series prediction. LSTM are trained via backpropagation in time to avoid vanishing gradients which a typical RNN structure suffers from. 
\par The network consists of memory blocks instead of a single neuron which connect into sequential layers to make dense layers. The memory block is "gated" where each gate has its own activation functions. The gates decide which information to keep or discard. A typical block has three gates, namely, input gate, output gate and the forget gate. Figure ~\ref{fig:LSTM.png} shows the conceptual layout of such memory gate. The forget gate decides which information to keep/discard. The input gate updates the memory state and the output gate decides the output of that memory block. A series of gated memory blocks/cells allows the network to read sequences of data and not just single point.
\begin{figure}[hbt!]
 \centering
  \includegraphics[width=.8\linewidth]{./Fig/LSTM.png}
  \caption{ Long Short-Term Memory (LSTM) unit. The LSTM unit has four input weights (from the data to the input and three gates) and four recurrent weights (from the output to the input and the three gates). Peepholes are extra connections between the memory cell and the gates, but they do not increase the performance by much and are often omitted for simplicity ~\citep{Greff_2017}.}
  \label{fig:LSTM.png}
\end{figure}

LSTM is a state-of-the-art class of RNN which are highly effective in predicting the future response based on the past training history of some of the most complicated tasks such as language translation \citep{62}. Stacked with multiple layers of LSTM they become even more powerful \citep{63}. In our case, a simplistic LSTM has proven to be sufficient to characterize our problem.  
\par To train our model, we employed a series of 100 such units in a densely connected network with RELU as the activation function and ADAM as the optimizer, as well as a learning rate of 1e-04. Furthermore, to determine the model scalability we followed a similar methodology as in the MFNN architecture, using a window of 1000 samples to forecast one, ten, 100 and then 1000 samples.
\begin{flushleft}
\subsection{Convolutional Neural Networks (CNN)}
\end{flushleft}
A CNN architecture commonly consists of three set of layers: convolutional layers, pooling layers, and fully connected layers. A convolutional layer convolves the input with a series of filters to produce a filtered output.  The filtered result then is commonly used as input to  a pooling layer which reduces the dimensionality of the data. The output from the pooling layer is flattened and  passed to a fully connected dense layer or a series of layers \cite{64,65,66,67}. The neurons in a CNN architecture, unlike MFNN,  may not receive the inputs from all previous neurons but only from a selected "patch" from the previous layer hence reducing the chance of overfitting as compared to the MFNN.
Figure ~\ref{fig:CNN.png} shows a conceptual implementation of the CNN. 
\begin{figure}[hbt!]
 \centering
  \includegraphics[width=.8\linewidth]{./Fig/CNN.png}
  \caption{Major components of a CNN architecture  ~\citep{CNN}}
  \label{fig:CNN.png}
\end{figure}
\begin{flushleft}
The CNN model consists of a single convolutional layer with filter of size three, and RELU activation function, a max pooling layer of size two and stride two, followed by two fully connected layers comprising 50 neurons and RELU activation function. The output of the network is a single neuron that contains the pressure at a future time step. We included ADAM as the optimizer with a learning rate of 1e-04. 
\end{flushleft}
\begin{flushleft}
\subsection{Convolutional- LSTM (CONV- LSTM)}
\end{flushleft}
As discussed earlier, the merit  of LSTM lies in keeping the temporal aspect of sequence data. CNN on the other hand is a powerful architecture for extracting features in both image and sequence data. Therefore, we selected a hybrid version of CNN and LSTM for the pressure forecasting. CNN was implemented to extract complex shapes from the time series data, and LSTM to keep track of these features over longer sequences. Hybrid models are very efficient in fulfilling both tasks \citep{68}. 
\par We divided the 1000 samples window of three features into ten subsets of 100 samples, each which is fed first to the CNN for feature extraction. CNN then forwards this information to LSTM for temporal updates. To achieve this task, we used time distributed layers in the architecture \citep{70}. The CONV-LSTM model is composed of one convolutional layer with 64 filters with size three and RELU activation function, followed by a max-pooling layer, the output then is flattened and passed as input to a LSTM layer with 50 units that outputs a sequence. The final LSTM sequence is then used as input to the output layer for the prediction of the pressure data.

\clearpage
\section{Results}
\subsection{Evaluation metrics and terminology}
This section discusses the results from the various network architectures described previously. Hereinafter, the terminology used for multistep varies according to the number of samples predicted in the future. For example MFNN\_100 represents the case where 1000 samples fixed window is used to predict 100 samples in the future. The results show both 150-minutes baseline and 90-minutes leak data.

\par In a real life scenario, the models can be used for detecting anomalies on live data streams. In this case study, a real pressure behaviour with baseline and leak scenario is available. However, we need a model architecture to forecast a baseline pressure in the future to compare it with the recorded future pressures. Hence, we used a multi-step forecast. A model which can forecast 1000 samples in the future with confidence has a better scalability than a model that can only forecast 100 samples in future. 
\par We used three diagnostic plots in the model architectures. In first diagnostic plot we compared the actual versus the measured value of the pressure. The second plot consists of the training process and the corresponding MSE after every training epoch, with a total of 100 epochs for training. The third plot is the key output of the study which is point wise squared error also referred as anomaly plot throughout this section. We included different errors in the diagnostic plots for the model. To generate the anomaly plot, we computed the squared error for every sample as: 
\begin{equation}
 MSE = \frac{1}{n} \sum_{i=1}^{n} (y_{i} - \widetilde{y})^{2} 
 \end{equation}

where  MSE  is the mean squared error, y\ensuremath{_{i}} is the actual pressure measurement and $\widehat{y}$ is the predicted pressure. Higher error indicates anomaly. We filtered this error by setting all errors less than 10e-03 to zero and amplifying the errors higher than 10e-03 by a factor of 100. This is referred to as filtered error in the diagnostic plots. As smaller errors are suppressed and higher errors are amplified, it is easier for human interpreter to identify the anomalous pressure behaviour. 
The other error metric used is the mean squared error i.e., MSE. This is a metric to evaluate the machine learning models. Higher training MSE values imply a less accurate model during training. 
We made two different types of comparisons to evaluate the models: 
\par 
1. Models which are scalable i.e., models which can forecast higher number of samples with same amount of training data. These are referred by a subscript in all the relevant Figures. For example $MFNN 100$ refers to a multi-layer feed forward network where 1000 samples window is used to predict 100 samples in the future. If a fixed number of input samples are used to forecast a higher number of samples in the future, the model is expected to have higher errors. But, a model which gives unusually high errors as the number of samples in the future increases, is unstable and hence, undesirable. We used the log-loss (MSE) as a metric to evaluate if the models are scalable, and we repeated the multi-step forecasting process for 1, 10, 100 and 1000 samples for all the model architectures. 
\par 
2. Models which are the best, overall. For this criterion, we compared different model architectures. The comparison includes various observations such as : can a model sufficiently capture the sinusoidal pressure behaviour and not raise the false alarms during rising or falling pressure cycles? Can the model be trained in a reasonable time with technology available today? can the model take advantage of hardware such as graphics processing unit (GPU)? 

\par In all the Figures, the first 15,000 samples corresponding to baseline tests are used for training and rest of the samples are used for prediction. The model training ends at 15,000 samples which is highlighted by a green arrow in the figures. Baseline test ends at 24,542 samples which is highlighted by a brown arrow. Table 2 summarizes the average results  from 20 realizations of each model. 
\begin{flushleft}
\subsection{MFNN results}
\end {flushleft}
Figure~\ref{fig:model_1.png}  through Figure~\ref{fig:model_3.png} show the results from the MFNN architecture. From Figure~\ref{fig:model_1.png}  it can be noticed that the model performs exceptionally well for both training and test set and predicted pressures are very close to the actual pressure values.
\begin{figure}[hbt!]
 \centering
  \includegraphics[width=.8 \linewidth]{./Fig/model_1.png}
  \caption{MFNN results for baseline pressure and the predictions for the different models. Target pressure is shown in color green while the model outputs are shown in various colors. Green and brown arrows show the end of training and end of baseline test respectively. It is observed that the model produces excellent results for the pressure prediction  for only 15,000 samples.}
  \label{fig:model_1.png}
\end{figure}
\begin{figure}[hbt!]
 \centering
  \includegraphics[width=.8\linewidth]{./Fig/model_2.png}
  \caption{Log-Loss (MSE) with number of trained epochs for all the cases, It can be observed that as the number of predictions in the future increases, both 1 step, ten steps and 100 steps yield consistent results with losses gradually increasing towards higher number of samples forecasted. }
  \label{fig:model_2.png}
\end{figure}
\begin{figure}[hbt!]
\centering
  \includegraphics[width=.8\linewidth]{./Fig/model_3.png}
  \caption{Filtered error versus the number of samples. All errors less than 0.001 are set to zero and errors greater than 0.001 is amplified by a factor of 100. The end of training is shown by a green arrow and leak portion is shown by a brown arrow on x-axis. It can be observed that the MFNN can separate the leak and no-leak portions of the data.}
\label{fig:model_3.png}
\end{figure}

\par As the model is trained on baseline, it expects a baseline equivalent response everywhere and hence can detect the anomaly in the leak portion of the data.  This is further highlighted in Figure~\ref{fig:model_3.png} where the filtered MSE response shows the difference in predicted and actual values. 
We set all MSE below 10 e-3 to zero, and we amplified the MSE above 10 e-3 by a factor of 100. It can be observed from the filtered MSE in Figure~\ref{fig:model_3.png} that except one stem of the data, the leak and no leak portions of the data can be clearly be identified as an anomaly or not. 
\par The model is unable to capture some of the trough portions of the pressure waveform and unpredictable towards the last pumping cycle of 150 -minutes baseline test. It is essential to mention that in the final segment of the 150-minutes baseline is a pressure fall off, the surface pumps are shutting down, and hence the behavior is expected to be abnormal. Usually, with pump shut-downs, there is venting at the surface, which is essentially an induced leak.
\clearpage
\begin{flushleft}
\subsection{LSTM results}
\end{flushleft}
Figure~\ref{fig:model_4.png}  through Figure~\ref{fig:model_6.png} shows that LSTM scales better than MFNN when same window size is used to predict various points forward in time. Figure~\ref{fig:model_4.png} shows the pressure prediction from the LSTM architecture and Figure~\ref{fig:model_5.png} shows the losses for different prediction interval cases. The MSE increases gradually as more points are added but there is a clear separation between the baseline and leak data. 
\begin{figure}[hbt!]
\centering
  \includegraphics[width=.8\linewidth]{./Fig/model_4.png}
  \caption{LSTM pressure prediction. The target pressure is shown in color green and the predictions forward are shown in various colors in the legend. The end of training is shown by a green arrow while the start of leak test is shown by a yellow arrow.}
  \label{fig:model_4.png}
\end{figure}

\begin{figure}[hbt!]
\centering
  \includegraphics[width=.8\linewidth]{./Fig/model_5.png}
  \caption{LSTM log losses. It is observed that as the prediction interval increases, the net losses increase.}
  \label{fig:model_5.png}
\end{figure}
\begin{figure}[hbt!]
\centering
  \includegraphics[width=.8\linewidth]{./Fig/model_6.png}
  \caption{LSTM anomaly. We observed that the LSTM can efficiently separate the leak and non-leak data. Notice the difference in results between the MFNN and the LSTM anomaly. The anomaly is more pronounced in the case of LSTM than the MFNN anomaly.}
  \label{fig:model_6.png}
\end{figure}
 For anomaly detection, it is of utmost importance that the data are segregated instead of lower MSE values. Notice in Figure~\ref{fig:model_6.png} , which is the LSTM anomaly the drastic differences between the baseline and the leak stems of the data. It is much easier to identify the anomaly in case of LSTM as compared to MFNN. Hence, for anomaly detection, LSTM is a preferred choice over MFNN in our case.
 \begin{flushleft}
 \subsection{CNN results}
 \end {flushleft}
Figure~\ref{fig:model_7.png}  through  Figure~\ref{fig:odel_9.png} show the results from the training and the test data from the CNN architecture.  Results in Figure~\ref{fig:model_7.png}, show that the CNN architecture can capture the sinusoidal wave forms efficiently. Figure~\ref{fig:model_9.png} show that the overall MSE is higher in case of CNN as compared to LSTM, however in cases where smaller number of samples are used for future prediction, the model can distinguish between the leak and the baseline portions efficiently. CNN can also be parallelized on a graphical processing unit(GPU) and hence provide a computational edge over LSTM architecture. 
\begin{figure}[hbt!]
\centering
  \includegraphics[width=.8\linewidth]{./Fig/model_7.png}
  \caption{CNN pressure prediction. The target pressure is shown in green and the predictions are shown in different colors. The end of baseline test is shown by a green arrow. The start of the leak test is shown by a yellow arrow. Except for 1000 samples prediction, all the other cases can capture the sinusoidal waveform efficiently. The green and yellow arrows show the end of training data and beginning of leakage data respectively.}
  \label{fig:model_7.png}
\end{figure}

\begin{figure}[hbt!]
\centering
  \includegraphics[width=.8\linewidth]{./Fig/model_8.png}
  \caption{CNN training log-losses. As the number of samples foretasted in future increases, the training losses increase. For smaller number of predicted samples in the future, the CNN results are comparable to that of LSTM network.}
  \label{fig:model_8.png}
\end{figure}

\begin{figure}[hbt!]
\centering
  \includegraphics[width=.8\linewidth]{./Fig/model_9.png}
  \caption{MSE CNN anomaly. The CNN can effectively distinguish the leak and the non leak portions of the data except the CNN 1000 case (shown in light grey color). The end of training data is shown by a green arrow and start of leak is shown by the yellow arrow.  Notice the anomaly spikes after the yellow arrow which is the data corresponding to 90-minutes leak.}
  \label{fig:model_9.png}
\end{figure}
It is evident that LSTM provides overall better results than CNN however CNN is not just computationally more efficient on a GPU device but also has he ability to capture the sinusoidal waveforms efficiently. 

\begin{flushleft}
\subsection{CONV-LSTM results}
\end{flushleft}
The hybrid architecture utilizes the features of both convolutional layer and the convolutional layer can be parallized on a GPU. Hence, state-of-the-art results can be obtained faster without training for larger epochs like recurrent network/LSTM sequential updates.
We showed the results obtained from this architecture from  Figure~\ref{fig:model_10.png} to  Figure~\ref{fig:model_12.png}. From Figure~\ref{fig:model_10.png}  we observed that this hybrid architecture is able to capture the sinusoidal features of the pressure signal efficiently. Figure~\ref{fig:model_11.png} shows the log-loss MSE for this architecture with training epochs. 
\begin{figure}[hbt!]
\centering
  \includegraphics[width=.6\linewidth]{./Fig/model_10.png}
  \caption{CONV-LSTM pressure predictions. The CONV-LSTM results are comparable to LSTM. The architecture is able to capture the subtle features of the sinusoidal pressure signal.}
  \label{fig:model_10.png}
\end{figure}

\begin{figure}[hbt!]
\centering
  \includegraphics[width=.5\linewidth]{./Fig/model_11.png}
  \caption{Log loss (MSE) for the CONV- LSTM architecture. It is observed that the model converges rapidly with the least training MSE of all architectures discussed before.}
  \label{fig:model_11.png}
\end{figure}

\begin{figure}[hbt!]
\centering
  \includegraphics[width=.8\linewidth]{./Fig/model_12.png}
  \caption{The CNN-LSTM prediction and the MSE. It can be observed that the model can distinguish between the leak and non-leak portions of the data efficiently.}
  \label{fig:model_12.png}
\end{figure}

Notice from Figure~\ref{fig:model_11.png}, although similar epochs compared to any other  architecture, CONV-LSTM takes the highest amount of time for  training. However, the log loss shows that the algorithm converges  rapidly thus eliminating the need for training for higher number of epochs, giving it an advantage over other architectures. The filtered MSE anomaly shows that the architecture can differentiate between the baseline and the leak tests.

\begin{table}[t]
  \begin{center}
    \begin{tabular}{c|c|c|c}
     \toprule % <-- Toprule here
     \hline
      \textbf{ Model} & \textbf{Training MSE} & \textbf{Training epochs} & \textbf{Processor time (seconds)}  \\
      \hline
      \midrule % <-- Midrule here
      
      MFNN\_1 & 5.8 e-05 & 100 & 82 \\
      MFNN\_10 & 6.6 e-05  & 100 & 83 \\
      MFNN\_100 & 1.2 e-04  & 100 & 81 \\
      MFNN\_1000 &  2.1 e-04  & 100 & 80 \\
      LSTM\_1  &  5.5 e-05  & 100 & 328   \\
      LSTM\_10  &  1.01 e-05  & 100 & 332     \\
      LSTM\_100 &   1.4 e-05 & 100 & 334  \\
      LSTM\_1000 &  2.1 e-05  & 100 & 328    \\
      CNN\_1 & 3.5 e-05    & 100 & 226  \\
      CNN\_10 & 6.4 5e-05  & 100 & 213  \\
      CNN\_100 & 6.3 e-05   & 100 & 209 \\
      CNN\_1000 &  8.3e-05  & 100 & 193  \\
      CONV-LSTM\_1 & 1.2e-06    & 25 & 3800 \\
    \end{tabular}
        \caption{Results summary for all models used in the study.}
    \label{tab:table2}
  \end{center}
\end{table}

\clearpage
\section{ Model extension to different scenarios}
We discussed earlier in the manuscript, the dynamic nature of the hydrocarbon reservoir under CO\ensuremath{_{2}} injection. As the injection continues, the average reservoir pressure increases, and the stresses across the sealing faults change. In addition to rock properties such as porosity and permeability, that can change as function of the stress regime as well. 
\par Hence, a natural question arises: can our workflow be possibly borrowed and applied to any other pulse test? To answer this question, we included another set of data. This data set consists of: 90-minutes baseline test, 150-minutes baseline test and 90-minutes leak test. Before in all our analysis we have only utilized 150-minutes baseline test and 90-minutes leak test. 
\par This is shown in Figure~\ref{fig:Figure_17.png}. We used first 10,000 samples from the 90-minutes baseline test to train a MFNN model and is shown by the black arrow. The end of 90-minutes baseline test or start of 150-minutes baseline test is shown by a green arrow. The start of 90-minutes leak test is shown by a yellow arrow. This convention is held throughout this section. 
Using the trained model from first 10,000 samples belonging to 90- minutes baseline, we predicted the pressure behavior for both 150-minutes baseline test and the 90-minutes leak test. The results are summarized in Figure~\ref{fig:Figure_17.png} and Figure~\ref{fig:Figure_18.png}.

\begin{figure}[hbt!]
\centering
  \includegraphics[width=.8\linewidth]{./Fig/Figure_17.png}
  \caption{Pressure prediction using MFNN for: 90-minutes baseline + 150-minutes baseline + 90-minutes leak test. 10,000 samples from 90-minutes baseline test is used for training the MFNN and rest of the samples are used for prediction. The end of pressure waveform used for training is shown by a black arrow. The end of 90- minutes baseline test is shown by a green arrow and the start of the 90-minutes leak test is shown by a yellow arrow. Notice that the model prediction is worse in case of both 150-minutes baseline and 90-minutes leak tests.}
  \label{fig:Figure_17.png}
\end{figure}

\begin{figure}[hbt!]
\centering
  \includegraphics[width=.8\linewidth]{./Fig/Figure_18.png}
  \caption{Filtered MSE for the model when trained only on 90-minutes baseline data set. All MSE below 10e-03 are set to zero and all MSE above 10e-03 are amplified by a factor of 10e+02. Notice the beginning of the 150-minutes baseline test shown by the green arrow. The high MSE between the green arrow and the yellow arrow (start of 90-minutes leak) indicates an anomaly even in 150-minutes baseline case i.e. a leak. Hence, the model fails to distinguish between the 150-minutes baseline and 90-minutes leak tests. The 90-minutes baseline test is still classified as no-leak.}
  \label{fig:Figure_18.png}
\end{figure}

\par We noticed that when the model is trained only on 90-minutes baseline test, it identifies the 150-minutes baseline as well as 90-minutes leak test, both as an anomaly. MSE is higher in case of 90-minutes leak test than 150-minutes baseline test but both are much greater than the 90-minutes baseline test which the model is trained on. Hence, as expected a model can only learn from the training data distribution and will address everything else as an anomaly.
\par Now, a second question arises, can the model learn from a new data set and incorporate the additional features and reservoir behavior at different states? To answer this question, we included only one-half cycle of the 150-minute baseline test into our training in addition to 10,000 samples from 90-minutes baseline test. This is shown in Figure~\ref{fig:Figure_19.png}. The black arrow shows the 10,000 samples used for training from 90-minutes baseline test. The two cyan arrows show the section of the 150-minutes test included in training. The green and yellow arrows show the beginning of 150-minutes baseline test and 90-minutes leak test respectively.

\begin{figure}[hbt!]
\centering
  \includegraphics[width=.8\linewidth]{./Fig/Figure_19.png}
  \caption{Pressure prediction for 90-minutes baseline, 150-minutes baseline and 90-minutes leak tests. The cyan arrows show the data utilized from 150-minutes baseline test in the training process in addition to the 10,00. samples from 90-minutes baseline test. Notice that even 5,000 samples increase the pressure predictions dramatically.}
\label{fig:Figure_19.png}
\end{figure}
\par Figure~\ref{fig:Figure_19.png} and  Figure~\ref{fig:Figure_20.png} show the MFNN results on the new training data. It can be observed from the results that the model can now easily distinguish between the baseline and leak tests effectively. Thus, even if a small portion of a different data set is included in the training, the model is powerful enough to learn new features.
In a nutshell, deep learning architectures are powerful enough to learn new features quickly; however, as expected they can only make a prediction based on the data distribution of the data set used for training. Deep learning models lack intuition, unlike human interpreters. Hence, for full-scale field deployment, the models have to be trained on a particular set of test parameters.

\begin{figure}[hbt!]
\centering
 \includegraphics[width=.8\textwidth]{./Fig/Figure_20.png}
  \caption{Filtered MSE for the case in which 5,000 samples from the 150-minutes baseline test is included in the analysis. The portion of data included from the 150-minutes baseline test is shown by cyan arrows. Notice that the 90-minutes leak test is now clearly distinguished from the baseline test as compared to Figure 17 and highlighted as an anomaly.}
  \label{fig:Figure_20.png}
\end{figure}

\begin{flushleft}
\par Based on the model's capability on multi-step forecasting, a model can be used for future prediction. As the system is dynamic, once a forecast with the high degree of confidence interval has already occurred, this data must be included in the training, and the model has to be updated. As our workflow utilizes time-series data, the additional training is fast and efficient, making the model practically scalable and field-deployable.
\end {flushleft}
\clearpage
\section{ Novelty of the Study}

This work automates the process of leak detection in CCS projects using deep learning on time series data which is computationally efficient than processing two dimensional images or three dimensional voxels. We employed this methodology on experimental data obtained from Cranfield reservoir, Mississippi, USA. However, the method can be extended to live pressure feeds recorded continuously from the wells when the reservoir is on planned injection schedule. 
\par The multi step forecast in my models show promise in forecasting multiple data points in the future and hence can be used as a proxy for forecasting instead of  reservoir simulation. These forecasts then can be included in training data and model can be updated in time. This eliminates the need for multiple physics based simulation forecasts and reduce the computational cost. 
\begin{figure}[hbt!]
\centering
 \includegraphics[width=.5\textwidth]{./Fig/CNN_input_1.PNG}
  \caption{Input data preparation for the CONV-LSTM study. The data consists of both static and dynamic data for reservoir characterization \citep{CNN_1}}
  \label{fig:CNN_input_1.PNG}
\end{figure}

\begin{figure}[hbt!]
\centering
 \includegraphics[width=.8\textwidth]{./Fig/CNN_input_2.PNG}
  \caption{Workflow adopted by \cite{CNN_1}. Notice that the CONV-LSTM requires spatio-temporal analysis of two-dimensional images. }
  \label{fig:CNN_input_2.PNG}
\end{figure}
\par Figure ~\ref{fig:CNN_input_1.PNG} and Figure ~\ref{fig:CNN_input_2.PNG} shows the input data and the workflow adopted by \cite{CNN_1}. The architecture used in their study is CONV-LSTM but it utilizes two dimensional images obtained from a physics based tool such as a reservoir simulator. Prior to simulation a through reservoir characterization is necessary in their proposed workflow. The results are compared once a model is trained with the actual simulator and differences in the pressure responses between baseline and leak cases is used as an leak detection. The model also is very sensitive to the number of layers used in the modeling as well as permeability of the reservoir.Training these models are computationally inefficient. The field conditions such as injection rates change dynamically which will ultimately requires to re-train the models. 
\par Another such study was conducted by \cite{CNN_2}. The authors show that by analyzing the pressure response of the baseline versus the leak well in frequency domain the two responses can be distinguished. This methodology requires computing the DTFT from the pressure response continuously and then analyzing the results. The automation of the spectral responses will require not just computing the DTFT but also using different machine learning architectures to distinguish them on two dimensional images thus adding computational cost. 

\clearpage
\section{ Conclusions}
In this work, we discussed the applications of deep learning architectures for leakage detection in carbon sequestration projects. In our findings, MFNN architecture performs excellent for training and test data sets but struggles to clearly distinguish between baseline and leak test as prediction in time interval increases. 
When it comes to predicting the future response, the LSTM architecture performs the best in our results overall, but the convolutional neural network (CNN) makes an excellent case for capturing the sinusoidal waveform like features in our dataset. CNN also can be parallelized on a GPU device, giving a computational advantage over LSTM which is processed sequentially.
The hybrid architecture of CNN and LSTM, i.e., CONV-LSTM, provides the best of both worlds in terms of leak identification and computational times. However, computational times can be a limitation on this architecture. 
All machine learning algorithms, including deep learning architectures, learn from training data, and CCS are a dynamic system affected by complex geology and operational parameters. However, we showed that deep learning architectures can be extremely useful for an automated early warning system for leak detection in CCS projects which can then be investigated with conventional engineering methods by human interpreters. 

\onecolumn

\bibliographystyle{seg}  % style file is seg.bst
\bibliography{example.bib}




\end{document}