% Chapter 2

\chapter{Challenges in WCE Localization} % Main chapter title

\label{Chapter2} % For referencing the chapter elsewhere, use \ref{Chapter1} 

\lhead{Chapter 2. \emph{Challenges in WCE Localization}} % This is for the header on each page - perhaps a shortened title

%----------------------------------------------------------------------------------------

The wireless localization industry was initiated by Global Positioning System (GPS) for outdoor navigation in early 1970s and later evolved into Indoor Positioning System (IPS) in 1990s 
\cite{ pahlavan2002indoor, pahlavan2006indoor, kanaan2004algorithm, alavi2006using, alsindi2007analysis, alsindi2007empirical, heidari2008markov, pahlavan2010taking}. Soon after, with the release of Body Area Network (BAN) IEEE 802.15.6 standard and arising of implantable micro-robots, the future trend of this localization technique is moving inside the human body \cite{pahlavan2012rf, he2013cyber, he2013testbed, geng2013modeling}. The first major application for this localization technology is the wireless capsule endoscopy 
\cite{costamagna2002prospective, pahlavan2012challenges, hu2005efficient, hu2006efficient, bao2013emulation}. While physicians can receive clear images of the interior of the digestive system using this device, they have little idea of the exact location of the capsule when an abnormality is found by the video source. To localize intestinal abnormalities, physicians have to administrate successive radiological, endoscopic or surgical operations, which are invasive and potentially harmful to patient's health. If we could use the RF signal radiated from the capsule (transmitting images to the body mounted receiver) to locate these devices, not only can physicians diagnose the medical diseases, but they can also learn where the diseases are located. However, finding a realistic RF localization solution for the endoscopic capsule is a very challenging task.  In this chapter, we review the existing localization techniques, especially the RF localization techniques, discuss their limitations and address challenges in localization system design for inside human body.

\section{Wireless Capsule Endoscopy (WCE)}

Wireless Capsule Endoscopy (WCE) is a pill-shaped device which consists of a short focal length CMOS camera, light source, battery and radio transmitter \cite{li2012wireless, pan2011swallowable} as shown in Figure~\ref{fig:WCEarch}. After the endoscopic capsule is swallowed by a patient, this miniature device begins to work and record images at least 2 frames per second while moving along the GI tract. At the same time, images are sent out wirelessly to a data recorder attached to the patient's waist. The whole process takes about 8 h, then all the image data are downloaded into a work station and physicians could inspect the whole video and diagnosis diseases in the GI tract. Being such an innovative technique without cable connection, WCE offers a patient-friendly, non-invasive and painless investigation of the entire GI tract, especially the small intestine, where other conventional endoscopic instrument can barely reach. Up to now, WCE has been used to detect the following diseases: small intestinal blooding, Crohn disease, ulcer, tumors, vascular lesions and colon cancers \cite{adler2003wireless, ge2004capsule, lee2004diagnosis}. 

A typical capsule endoscopy system consists of 3 components shown in Figure ~\ref{fig:WCE} \cite{pan2011swallowable, li2012wireless}: 

\begin{enumerate}

  \item A wireless capsule endoscope
  
  All capsule endoscopes have similar components: a disposable plastic capsule, a complementary metal oxide semiconductor or high-resolution charge-coupled device image capture system, a compact lens, white-light emitting diode illumination sources, and an internal battery source. 
  
  \item A sensing system with sensing pads or a sensing belt to attach to the patient, a data recorder, and a battery pack.
  
  The mode of data transmission is either via ultra-high frequency band radio telemetry (PillCam, EndoCapsule) or human body communications (MiroCam). The latter technology uses the capsule itself to generate an electrical field that uses human tissue as the conductor for data transmission. Currently PillCam SB2 and MiroCam are available with extended battery life, which may be beneficial in patients with delayed small-bowel transit.
  
  \item A personal computer workstation with proprietary software for image review and interpretation.
  
  Major visualization systems are RAPID Reader from Given Imaging, WS-1 EndoCapsule from Olympus America and MiroView from IntroMedic.
  
\end{enumerate}

 Specifications of each individual WCE system are outlined in Table ~\ref{table:WCEinfo}.

\clearpage

\begin{figure}[h]
\centering
\includegraphics[width=0.85 \textwidth]{./Figures/WCEarch.eps}
\caption{The architecture of WCE \cite{pan2011swallowable}}
\label{fig:WCEarch}
\end{figure}

\begin{figure}[h]
\centering
\includegraphics[width=0.95 \textwidth]{./Figures/WCE.eps}
\caption{Wireless Capsule Endoscopy}
\label{fig:WCE}
\end{figure}

\clearpage

\begin{sidewaystable}
\caption{FDA-approved wireless capsule systems and specifications}
\begin{tabular}{ p{4cm} p{3cm} p{2cm} p{2cm} p{2cm} p{3cm} p{3cm}}
\hline
WCE company                      & Size, mm      & Weight & View angle & Frame rate & Battery life  & Resolution       \\
\hline
\hline
EndoCapsule \\ Olympus America   & $11\times26$  & 3.5 g      & $145^o$  & 2 /sec         &  8 hours      & $512\times512$   \\
PillCam SB2 \\ Given Imaging     & $11\times26$  & 2.8 g      & $156^o$  & 2 /sec          &  8 hours      & $256\times256$   \\
PillCam SB3 \\ Given Imaging     & $11\times26$  & 2.8 g      & $156^o$  & 2-6/sec        &  12 hours     & $320\times320$   \\
PillCam SB2EX \\ Given Imaging   & $11\times26$  & 3.3 g      & $156^o$  & 2 /sec          &  12 hours     & $256\times256$   \\
MiroCam \\ Intromedic Co Ltd     & $11\times26$  & 3.3 g      & $170^o$  & 3 /sec          &  11 hours     & $320\times320$   \\
\hline
\end{tabular}
\label{table:WCEinfo}
\end{sidewaystable}

\clearpage

\section{Literature Review}

WCE provides a noninvasive way to inspect the entire small intestine. As a critical component of capsule endoscopic examination, physicians need to know the precise position of the endoscopic capsule in order to identify the position of intestinal disease after it is found by the video source \cite{faigel2008capsule, kusuda2005further, ciuti2011capsule}. The follow up therapeutic operations and effect of drug administration are heavily dependent on the accuracy of capsule's position information \cite{chandra2013localization}. Therefore, having a precise and reliable localization system plays an important role in enhancing the benefits of WCE. During the past few years, many attempts have been made to develop accurate and reliable localization systems for the WCE. A good review of existing localization techniques is given in \cite{than2012review}. These technologies can be divided into those using magnetic field \cite{salerno2012discrete, hu2005efficient, carpi2007controlled, carpi2011magnetically, wang2006localization} or inertial systems \cite{ciuti2010robotic}, using image processing techniques \cite{liu2009capsule} and techniques using RF signals \cite{ye2012accuracy, pahlavan2012rf, pourhomayoun2013accurate, arab2013investigation}. 

In magnetic sensing based techniques, a magnet is inserted into the WCE and the WCE is located by measuring the magnetic field \cite{atuegwu2008volumetric, gao2010design}. This technique increases the weight and size of the WCE and the magnetic field of the WCE used for localization will be interfered by the external magnetic fields used for other applications such as the Magnetic Resonance Imaging (MRI) systems. One can also insert radiation opaque material into the WCE and trace the location of the WCE using X-ray or Computed Tomography (CT) scan. Continuous imaging using X-ray or CT scan is very expensive and it bears the health risks for the patient \cite{than2012review, weitschies1994magnetic}. 

In \cite{ciuti2010robotic}, Ciuti and his colleagues magnetic inertial sensing based localization system. They inserted a three-axis accelerometer LIS331DL into the capsule. the This inertial sensing not only provides the approximate location and orientation of the capsule in digestive tract, but also provides feedback to the actuation system to preserve a reliable magnetic link between the external permanent magnet and the capsule. However, it would be difficult to make a compact capsular mechanism to be swallowable with the integration of such a inertial sensing subsystem and four cylindrical magnets. Also, this localization technique only offers rough spatial information (an average error of 3 cm) without data in a vertical direction. 

Besides the magnetic field based and inertial sensing based techniques, using computer vision based technique for localization the WCE is being investigated \cite{liu2009capsule, bao2013video, iakovidis2013capsule, duda2007vq, bulat2007data}. Because the capsule endoscope changes position and direction very slow, some identical areas exist in the successive two endoscopic images, so we can find the correspondent point pairs in these two images. Using the image correspondences, we can determine the motion (rotation and translation) parameters of capsule endoscope with an appropriate algorithm. This approach can be a complementary method for improving the magnetic localization and orientation method.

Using the RF signal used for image transmissions for the WCE to also locate the capsule offers a natural and low cost solution that does not add to the capsule extra complexity and payload 
\cite{pahlavan2012rf, fischer2001localization, fischer2004capsule, shah2006development, wang2009novel, zhang2010design}. Therefore, it has been chosen for use with the smartpill capsule in USA and the M2A capsule in Israel. RF signal has been widely used for locating an object in both outdoor and indoor environments with the accuracy achieved up to hundreds of millimeters \cite{yu2009ground}. Nevertheless, applying radio frequency in the task of tracking an object when it moves inside a special environment, such as the GI tract, is a challenge. This is because high-frequency signals suffer significant attenuation at different levels when they pass through different living tissues, whereas low-frequency signals due to their long wavelengths are not able to deliver the desired precision of several millimeters. The most commonly used RF techniques are Received Signal Strength (RSS) and Time of Arrival (ToA). In the following sections, we will explain the principle of using RF signal for localization and address their limitations and challenges when applied inside human body.       


%----------------------------------------------------------------------------------------

\section{RF Localization Techniques}

RF localization science and technology started with the Global Positioning Systems (GPS) for outdoor areas 
\cite{pandey2006survey, pahlavan2009networking, pahlavan2013principles, bulusu2000gps, chan2006time}, then it transformed into wireless indoor geolocation \cite{pahlavan2002indoor, pahlavan2006indoor, pahlavan2000overview}. The next step in the evolution of this science is the transformation into RF localization inside the human body. A commonly used RF localization infrastructure is to attach many calibrated external RF sensors to the anterior abdominal wall of the human body to detect the RF signal emitted by the wireless capsule as shown in Figure ~\ref{fig:RFlocalizationSystem}. By interpreting the character of the received signal (RSS or ToA) into distance between the capsule and body mounted sensor array, position of the capsule can be estimated by pattern matching algorithms such as least square algorithm and maximum likelihood algorithm \cite{pourhomayoun2013accurate, salerno2012discrete}. However, RF localization of micro-robots inside humans is not trivial. Compared to outdoor and indoor environments, the inside of the human body is a complex environment making engineering design and visualization a formidable task \cite{fisher2012new}. The inside of the human body is an extremely complex medium for RF propagation because it is a non-homogeneous liquid-like environment with irregularly shaped boundaries and severe path-loss. Things become more complex when it comes inside human body since the road map for the movements of the micro-robot is blurry and the body mounted sensors used as references for localization are also in motion. More importantly, reliable designs need testing the hardware implementation, but we cannot easily test devices inside the human bodies. Therefore, existing RF localization systems sometimes end up providing discontinuous and scattered estimations with large errors.


\begin{figure}[h]
\centering
\includegraphics[width=0.85 \textwidth]{./Figures/RFlocalizationSystem.eps}
\caption{A typical RF localization system}
\label{fig:RFlocalizationSystem}
\end{figure}

\subsection{RSS based techniques}

The name of ``wireless'' capsule endoscope indicates its capability to transmit the images by RF signal. The transmitter embedded inside the capsule sends endoscopic images, which are captured during its travel along the GI tract, to several receivers placed uniformly on the exterior of the patient abdomen as shown in Figure ~\ref{fig:RFlocalization}. Taking advantage of this integrated function, people can measure the strength of the received RF signals at each sensor and use each sensor as a reference node to localize the capsule (mobile node). The tracking algorithm is based on the observation that the closer the receiver is to the transmitter, the stronger signal it catches. The relationship between the RSS reading and the distance from the transmitter to the receiver can be expressed by a pathloss model as given below \cite{arshak2007adaptive, fischer2001localization, fischer2004capsule, sayrafian2009statistical}:

\begin{equation} \label{eq:pathloss}
RSS(d) = P_t-PL(d_0)-10\alpha log_{10}\frac{d}{d_0}+S (d>d_0)
\end{equation}
where $d$ is the distance between transmitter and receiver, $PT$ is the transmit power, $PL(d_0)$ is the path loss for a reference distance $d_0$ (i.e. 50 mm), $\alpha$ is the path loss gradient which is determined by the propagation environment. For example, in free space, $\alpha$ equals to 2. Since the human body tissue strongly absorbs RF signal, a much higher value for the path loss gradient is expected for inside human body. $S$ is a Gaussian random variable caused by shadow fading. From Eq.~\ref{eq:pathloss}, the distances between the capsule and each of the sensors can be roughly estimated by the RSS readings. Then, the capsule's location can be calculated using trilateration method. 

A propagation attenuation model plays a vital role in the RSS technique. In order to reduce the positioning error, it's necessary to develop an appropriate implant to body surface path loss model. The parameters of one of the most cited signal attenuation model developed by National Institute of Standards and Technology (NIST) at MICS band are summarized in Table ~\ref{table:NISTtable}.

\begin{table}
\centering
\caption{Parameters for the statistical implant to body surface pathloss model}
\begin{tabular}{ p{4cm} p{2cm} p{2cm} p{2cm} }
\hline
Implant to body surface          & $LP(d_0)$ dB      & $\alpha$ & $\sigma_{dB}$        \\
\hline
\hline
Deep tissue                      & 47.14             & 4.26     & 7.85                 \\
Near surface                     & 49.81             & 4.22     & 6.81                 \\
\hline
\end{tabular}
\label{table:NISTtable}
\end{table}


The empirical model mentioned previously is not accurate enough for the complex environment of the GI tract.  The model was developed by National Institute of Standards and Technology (NIST) at MICS band. 

Instead of using a signal propagation model, another RSS based localization scheme is called ``finger printing'' technique \cite{shah2006development}. The way of finger printing technique works is to create a lookup table for position estimation first. Offline measurement survey needs to be done in advance, in which at each position of the capsule, both the corresponding signal strength measured by each of the sensors and its position data were recorded into the table. During the experiment, online data were compared with the data stored in the lookup table to find the closest match and thus to select the most appropriate position. However, since we don't have a map of inside the body to do the survey and people are different in term of body shape, this method doesn't have too much practical value. 


\subsection{ToA based techniques}


For RF based localization, a widely known benefit of ToA based techniques is their high accuracy compared to RSS based techniques \cite{he2012modeling, geng2013modeling}. The ToA based technique relies on measurements of travel time of signals between the known reference nodes and unknown mobile node. Ranging distance is calculated by multiplying the propagation velocity of RF signal and the measured ToA value \cite{geng2013empirical, geng2013modeling}.


\begin{equation} \label{eq:TOAeq}
d_i=c\times\tau_i
\end{equation}

However, since the human body is formed of tissues with different characteristics of conductivity and relative permittivity, the RF signal propagates with various speed through different organs \cite{geng2013modeling2}. These variations in the speed are the dominant source of error for the ToA-based RF localization inside the human body. Also, in near-field application, time-based methods are difficult because radio waves travel with a very high speed ($3\times10^8m/s$); thus, an extremely strict time synchronization of less than 1 ns is required in order to obtain the position resolution of 0.3 m. 
Another geometric location method, time difference of arrival (TDoA), does not have these disadvantages. All it needs is a transmission that has a recognizable unambiguous starting point. The data used in the location calculations is the time difference in the reception of that starting point at the several reference nodes, and not the actual time of flight of the signal from the target to the fixed sensors. But in order to have sufficient data to find the mobile's coordinates, TDoA requires one more reference node than ToA.


%Figure ~\ref{fig:TDOA}  shows the geometric layout for TDOA in two dimensions.
%
%
%\begin{figure}[hb]
%\centering
%\includegraphics[width=0.8\textwidth]{./Figures/TDOA.eps}
%\caption{Time difference of arrival hyperbolic curves}
%\label{fig:TDOA}
%\end{figure}


%\subsection{AoA based techniques}
%
%Directional antennas can be used at two or more fixed terminals to find target location when the coordinates of the terminals are known relative to a reference point. The geometric procedure for calculation location is called triangulation. An advantage of this method is that target direction can be found without any time synchronization or restrictions of modulation type or protocol of the transmitted signals. Figure ~\ref{fig:AOA} shows a mobile transmitting target T and two fixed stations F1 and F2 with directional antennas. The coordinates of $F_1$ and $F_2$ are known and the angles of arrival, $\theta_1$ and $\theta_2$ of the signal referenced clockwise from north are measured. With the origin at $F_1$ the coordinates of $T$ are:
%
%\begin{equation} \label{eq:AOAy}
%y = \frac{y_2\tan(\theta_2)-x_2}{\tan(\theta_2)-\tan(\theta_1)}
%\end{equation}
%
%\begin{equation} \label{eq:AOAx}
%x = y \tan(\theta_1)
%\end{equation}
%
%\begin{figure}[hb]
%\centering
%\includegraphics[width=0.8\textwidth]{./Figures/AOA.eps}
%\caption{Angle of arrival}
%\label{fig:AOA}
%\end{figure}


%----------------------------------------------------------------------------------------

\subsection{Localization Algorithms}

In every ranging based localization, the position of the mobile node is determined as the intersection of the spheres \cite{fuller2009tutorial}, of which centers are the coordinates of the reference nodes and radius are the ranging distance $m_i$ between the reference nodes $\begin{bmatrix}x_i & y_i & z_i\end{bmatrix}^{T}$ and the target node $\begin{bmatrix}x & y & z\end{bmatrix}^{T}$, where

\begin{equation} \label{eq:ranging1}
m_i^2 = (x-x_i)^2+(y-y_i)^2+(z-z_i)^2
\end{equation} 

Since inside the human body is an non-homogeneous environment, there is difference between the true distance and the ranging distance using ToA. Therefore, the spheres do not always intersect at one single point. The goal of the localization algorithm is to find out the best estimation of the target's actual position based on the noisy measurements. Two most commonly used optimal estimation algorithms are least square algorithm and maximum likelihood algorithm. In the following subsections, we 

\subsubsection{least square algorithm }

In least square (LS) algorithm \cite{ccamlica2013implant, shen2008performance}, at least three reference nodes are needed to solve the least square problem. Substituting 

\begin{equation} \label{eq:ranging2}
x^\prime=x-x_1 \;\;\;\;  y^\prime=y-y_1 \;\;\;\;  z^\prime=z-z_1
\end{equation} 
and

\begin{equation} \label{eq:ranging3}
{x^\prime}_i=x_i-x_1 \;\;\;\;\;\;(i=2,3)
\end{equation} 

into Eq.~\ref{eq:ranging1} and subtracting the first one ($i=1$) successively from it for $i=2,3$ results in an equation set in the matrix form as

%\begin{equation} \label{eq:ranging4}
%\begin{bmatrix}
%x^\prime_2 & y^\prime_2 & z^\prime_2\\ 
%x^\prime_3 & y^\prime_3 & z^\prime_3
%\end{bmatrix}\begin{bmatrix}
%x^\prime\\ y^\prime \\ z^\prime
%\end{bmatrix}=\frac{1}{2}\begin{bmatrix}
%m^2_1-m^2_2+x^\prime_2 + y^\prime_2 + z^\prime_2\\ 
%m^2_1-m^2_3+x^\prime_3 + y^\prime_3 + z^\prime_3
%\end{bmatrix}
%\end{equation} 

\begin{equation} \label{eq:ranging4}
\begin{bmatrix}
x_2-x_1 & y_2-y_1 & z_2-z_1\\ 
x_3-x_1 & y_3-y_1 & z_3-z_1\\
&...&\\
x_n-x_1 & y_n-y_1 & z_n-z_1
\end{bmatrix}\begin{bmatrix}
x\\ y \\ z
\end{bmatrix}=\frac{1}{2}\begin{bmatrix}
m^2_1-m^2_2+k_2-k_1\\ 
m^2_1-m^2_3+k_3-k_1\\
...\\
m^2_1-m^2_n+k_n-k_1
\end{bmatrix}
\end{equation}
where

\begin{equation} \label{eq:ranging5}
k_i=x^2_i+y^2_i+z^2_i
\end{equation} 
it can be denoted as

\begin{equation} \label{eq:ranging6}
2\boldsymbol{At=b}
\end{equation} 
where

\begin{equation} \label{eq:ranging7}
\boldsymbol{t}=\begin{bmatrix}x & y & z\end{bmatrix}^{T}
\end{equation} 


\begin{equation} \label{eq:ranging8}
\boldsymbol{A}=\begin{bmatrix}
x_2-x_1 & y_2-y_1 & z_2-z_1\\ 
x_3-x_1 & y_3-y_1 & z_3-z_1\\
&...&\\
x_n-x_1 & y_n-y_1 & z_n-z_1
\end{bmatrix}
\end{equation} 

\begin{equation} \label{eq:ranging9}
\boldsymbol{b}=\begin{bmatrix}
m^2_1-m^2_2+k_2-k_1\\ 
m^2_1-m^2_3+k_3-k_1\\
...\\
m^2_1-m^2_n+k_n-k_1
\end{bmatrix}
\end{equation} 

The solution can be obtained by using the least square method \cite{shen2008performance,cheung2004least}:

\begin{equation} 
\boldsymbol{t}=\frac{1}{2}(\boldsymbol{A^TA})^{-1}\boldsymbol{A^Tb}
\end{equation} 

\subsubsection{maximum likelihood algorithm }

This section talks about how to using maximum likelihood (ML) algorithm \cite{ziskind1988maximum, chen2002maximum} to do the localization. Assume the RSS measurements intensity for each sensor is 

\begin{equation} \label{eq:maxlike}
R_i=\gamma_i\sum_{k=1}^{K}\frac{C_k}{|\rho_k-r_i |^\alpha}+\omega_i
\end{equation} 
where $R_i$ is the t-th sample: $\gamma_i$ is gain factor, $C_k$ is intensity of the k-th contaminant source, $\rho_k$ is the position of the k-th source, $r_i$ is the position of the mobile node, $\omega_i$ is the background noise.

Eq.~\ref{eq:maxlike} can be also expressed as

\begin{equation} \label{eq:maxlike}
R_i = \gamma_i\frac{C}{m^2_i}+\omega_i
\end{equation} 
where $m_i$ is shown in Eq.~\ref{eq:ranging1}, which is the Euclidean distance between the mobile node and sensor nodes.

Setting $\xi_i=(\omega_i-\mu_i)/\sigma_i \sim  N(0,1)$, $\frac{(R_i-\mu_i)}{sigma_i}\sim N(\frac{\gamma_i}{\sigma_i}\frac{C}{m^2_i},1)$, we can define the following matrix notation:

\begin{equation} 
\boldsymbol{Z} = \begin{bmatrix}\frac{(R_1-\mu_1)}{\sigma_1}, \frac{(R_2-\mu_2)}{\sigma_2}...\frac{(R_N-\mu_N)}{\sigma_N}
\end{bmatrix}^T
\end{equation} 

\begin{equation} 
\boldsymbol{G} = diag\begin{bmatrix}\frac{\gamma_1}{\sigma_1}, \frac{\gamma_2}{\sigma_2}...\frac{\gamma_N}{\sigma_N}
\end{bmatrix}
\end{equation} 

\begin{equation} 
\boldsymbol{D} = \begin{bmatrix}\frac{1}{m^2_1}, \frac{1}{m^2_2}...\frac{1}{m^2_N}
\end{bmatrix}^T
\end{equation} 

\begin{equation} 
\boldsymbol{\xi}=\begin{bmatrix}\xi_1,\xi_2 ... \xi_N\end{bmatrix}^T
\end{equation} 

We use MLE method to estimate the location. The joint probability density function can be expressed as: 

\begin{equation} 
f(Z|\theta)= (2\pi)^{N/2}exp\begin{Bmatrix}-\frac{1}{2}(Z-GDC)^T(Z-GDC) \end{Bmatrix}
\end{equation} 
its log likelihood function is:

\begin{equation} 
L(\theta)\sim -\frac{1}{2}\sum_{i=1}^{N}\left \| Z_i-\gamma_i\frac{C}{m^2_i} \right \| = -\frac{1}{2}\sum_{i=1}^{N}\left \| \frac{R_i-\mu_i}{\sigma_i}-\gamma_i\frac{C}{m^2_i} \right \|
\end{equation} 

where the $\theta$ is the estimated mobile position. Thus, we can get the maximum likely mobile position by minimizing this function \cite{kuang2006maximum}.  

\subsection{Cramer Rao Lower Bound (CRLB)}

Cramer-Rao lower bound (CRLB), named in honor of Harald Cramer \cite{cramer1999mathematical} and Calyampudi Radhakrishna Rao \cite{rao1995linear} who were among the first to derive it, expresses a lower bound on the variance of estimators of a deterministic parameter. In the localization literature \cite{patwari2003relative, patwari2005locating}, CRLB defines the lower bound on the precision of a localization that one algorithm can reach. To calculate the CRLB for localization inside human body, we define a performance evaluation scenario and models for the behavior of the localization metrics mentioned above, the RSS and TOA, for RF signaling in between the GI tract and the body-mounted sensors used for localization. In this section, we introduce a general scenario for comparative performance evaluation of RSS and ToA based localization for capsule endoscopy application. The scenario is designed to reflect the performance in different organs, the path of movement of the WCE inside the small intestine, and the number and pattern of installation of body mounted sensors on the torso. Since the received signal on the body-mounted sensors is distorted with the multipath receptions caused by the refraction at the boundary of organs and tissues inside the human body, models for behavior of the RSS and TOA are fairly complicated. 


\begin{figure}[h]
\centering
\includegraphics[width=0.95 \textwidth]{./Figures/bound.eps}
\caption{A typical 3D pattern of body mounted sensors used as reference points of the performance evaluation scenario for localization of the WCE}
\label{fig:bound}
\end{figure}


Consider the WCE whose location is being indexed as 1 and $m$ body mounted receiver sensors denoted with indexes $2 ... m+1$ as shown in Figure~\ref{fig:bound}. Each receiver sensor $i$ is capable of measuring the ToA $\tau_i$ or RSS $r_i$ from the WCE. The observation vector is $X=|\tau_2... \tau_{m+1}|$ for the ToA case or $X=|r_2... r_{m+1}|$ for the RSS. Assume the localization coordinate of the WCE is $\theta_1=[x_1,y_1,z_1]$, then our objective here is to estimate the location of the WCE $\hat{\theta}_1$. The $\tau_i$ observation are modeled as normal random variables $f_{\tau_i|\theta_1,\theta_i} ~ N(d_{i,1}|\bar{v},{\sigma^2}_T)$, where $d_{i,1}$ is the distance between the WCE and receiver sensor $i$. $\bar{v}$ is the average propagation speed of the RF signal inside the human GI tract, and $\sigma_T$ is the parameter describing the ToA ranging error caused by human tissue non-homogeneity. The $r_i$ measurements are log-normally distributed $f_{r_{i}dB|\theta_1,\theta_i}~N(P_r(dB),{\sigma^2}_{sh})$, with $P_r(dB)=P_0(dB)-10\alpha log10(d_{1,i})$. $P_0(dB)$ is the RSS at the reference distance from the WCE. $\alpha$ is the pathloss gradient and ${\sigma^2}_{sh}$ is the variance of the log normal shadowing.

The CRLB of $\hat{\theta}_1$ is $cov(\hat{\theta}_1)\geqslant I({\theta}_1)^{-1}$ is the Fisher information matrix (FIM)

\begin{equation} 
I_{\theta_1}=-E\triangledown_{\theta_1}(\triangledown_{\theta_1}ln\iota(X|\theta_1,\theta)) =\begin{bmatrix}
I_{xx} & I_{xy} & I_{xz}\\ 
I_{xy} & I_{yy} & I_{yz}\\ 
I_{xz} & I_{yz} & I_{zz}
\end{bmatrix} 
\end{equation} 


where $\iota(X|\theta_1,\theta)$ is the logarithm of the joint conditional probability density function:

\begin{equation} 
 \iota(X|\theta_1,\theta)=\sum_{i=2}^{m+1}log f_{\tau_1|\theta_1,\theta_i}\;\;\;(for\; ToA)
\end{equation} 

\begin{equation} 
 \iota(X|\theta_1,\theta)=\sum_{i=2}^{m+1}log f_{r_1|\theta_1,\theta_i}\;\;\;(for\; RSS)
\end{equation} 

and 

\begin{equation} 
I_{xx}=-\sum_{m+1}^{i=2}E[\frac{\partial^2logf_{\tau_i|\theta_1,\theta_i} }{\partial^2x^2_1}] \;\;\;(for\; ToA)
\end{equation} 

\begin{equation} 
I_{xx}=-\sum_{m+1}^{i=2}E[\frac{\partial^2logf_{r_i|\theta_1,\theta_i} }{\partial^2x^2_1}] \;\;\;(for\; RSS)
\end{equation} 

Similar expressions can be extend to $I_{yy},I_{zz},I_{xy},I_{xz}$ and $I_{yz}$. The CRLB on the variance of the ToA/RSS location estimation is 


$$\sigma^2_1=tr\left \{ cov_{\theta}(\hat{x}_1,\hat{y}_1,\hat{z}_1) \right \} $$
$$\hspace{8mm} = min\;tr(cov(\hat{\theta}_1))=tr(I(\theta_1)^{-1})$$
\begin{equation}
\hspace{8mm} = (-I_{xx}(I_{yy}+I_{zz}) + I_{xy}I_{xy} + I_{xz}I_{xz} ... \\/ (-I_{xx}I_{yy}I_{zz} + I_{xx}I_{yz}I_{yz} ... + I_{xz}I_{yy}I_{zz}) )
\end{equation}


\section{Challenges of Localization inside Small Intestine}

There are a number of fundamental multi-disciplinary scientific and technological challenges facing the RF localization of the WCEs inside the human body. To design an accurate localization system for inside human body we need to consider the following \cite{pahlavan2012rf}:

\begin{itemize}

  \item Modeling of the Movements of WCE Inside the GI Tract

The first challenge for meaningful analysis of RF localization inside the human body is to use clinical databases and clinical procedures performed by GI specialist, to model the movements of the endoscopy capsule inside the GI tract \cite{spyrou2014video}. Previously acquired and stored databases of patients with approximately 55,000 images per patient could be examined for detection of landmarks or fixed points such as the pylorus and the ileocecal valve \cite{cave2007multi, hu2005efficient}. Using the location of these landmarks, the number of images that observes the landmark, and the fact that the images are taken at a rate of two frames /sec (recently released WCE can take up to six frames / sec), we should design a model for the movements of the capsule in the GI tract to be mapped into the hardware and visualization platform. In the future, inertial sensing units that are small enough to be embedded in a pill size device could be used to provide real time information about pitch and roll angles of the endoscopic capsule. This information could be used to enhance the movement model provided by examining the images reported by the capsule. The improved model for the movements of the WCE using inertial sensors would enhance the RF localization result. The feedback controlled inertial sensors have been already used to monitor the robotic end luminal system using magnetic field to efficiently perform diagnostic and surgical medical procedures \cite{ciuti2010robotic}. 
   
  \item In every localization technique, map always plays a very important role in terms of refining the localization results \cite{fu2013heterogeneous, zheng2012performance}. Existing literature \cite{pahlavan2011principles} reported that a clear street map is able to reduce the GPS localization error from tens of meters to several meters in the urban area. In case of the localization inside human body, ``map'' is even more important since everything goes through the GI tract follows the same route. Knowing a clear pattern of the intestinal tract will greatly enhance the localization accuracy. Therefore, tracing the path of intestinal tract is essential to the accurate capsule localization. 


  \item Modeling of the Wideband RF Propagation from Inside the Human Body

The second challenge is to model the wideband characterization of the RF propagation channel between an endoscopy capsule and body-mounted sensors \cite{fort2006ultra, ryckaert2004channel, fort2006ultra}. We could use measurements inside phantoms and on the human subject's body surface to calibrate existing software simulation tools for direct solution of Maxwell’s equations inside the human body. We then could use the software to determine the waveforms observed by a body-mounted sensor used as a reference point for localization or another endoscopy capsule inside the tract that could be used for cooperative localization purposes. Finally, it should be possible to design models for the temporal and spatial features of these waveforms (that are extracted for localization techniques) as capsules travel along the GI tract, to be used by the CPS for performance evaluation and visualization .

  \item Design of Complicated Algorithms for Localization inside the GI Tract 

The third challenge would be the design and comparative performance evaluation of alternative localization algorithms and discovery of methods for visualization of the results. For this part one needs to consider the use of channel models for spatial and temporal variation of the signal, the model for the track of physical movement of the capsule inside digestive system, and landmarks detected from video frames of the endoscopy capsule camera \cite{guanqunsvm, bao2013emulation, baomodeling, bao2013video}. In addition to the RF localization features, we may expect that these algorithms could exploit the knowledge of pattern of movements and the visual data observed by the camera inside the tract. The Cramer-Rao lower bound (CRLB) for the performance of basic RSS and ToA based localization algorithms for capsule endoscopy are already available in the literature \cite{pandey2006survey}. We can use these bounds as a guideline for the expected performance of the designed algorithms \cite{ye2011accuracy}.

  \item Security and Reliability Issues

One last challenge in RF localization for WCEs would be to examine and where possible quantify the security, reliability, and privacy of implantable WCEs in human bodies. Here, there is an impending need to understand and analyze radio propagation of signals from WCEs outside the human body at larger distances where they may (a) cause interference (accidental or malicious) to the localization of WCEs and or devices inside a human body (b) recovered by more powerful devices towards identifying existence of such WCEs in specific patients. The former impacts the reliability of localization of the WCEs inside the human body while the latter impacts the privacy of patients and the medical procedures that may be conducted on the patients. 

\end{itemize}

In the following chapters, we are going to elaborate how we meet these challenges. 




%----------------------------------------------------------------------------------------

