You are on page 1of 4

30th Annual International IEEE EMBS Conference

Vancouver, British Columbia, Canada, August 20-24, 2008

An Improved Magnetic Localization and Orientation


Algorithm for Wireless Capsule Endoscope
Chao Hu1, Wanan Yang1, Dongmei Chen1, Max Q.-H. Meng1,2, Houde Dai1
1
Chinese Academy of Sciences/The Chinese University of Hong Kong Shenzhen Institute of Advanced Integration Technology
Shenzhen Institute of Advanced Technology, Shenzhen, 518067, China
2
Department of Electronic Engineering, The Chinese University of Hongkong, Shatin, Hong Kong
{chao.hu, wa.yang, dm.chen, hd.dai}@siat.ac.cn; max@ee.cuhk.edu.hk

Abstract - In this paper, we propose a novel localization As shown in fig.1, a small circular permanent magnet
algorithm for tracking a magnet inside the capsule is included in the capsule. This magnet generates a
endoscope by 3-axis magnetic sensors array. In the magnetic field around the human body. A magnetic
algorithm, we first use an improved linear algorithm to sensor array is arranged out of the human body and
obtain the localization parameters by finding the detects the magnetic field. Since the magnet’s magnetic
eigenvector corresponding to the minimum eigenvalue of field can be defined by a mathematic model, we can
the objective matrix. These parameters are used as the compute the magnet’s position and orientation by using
initial guess of the localization parameters in the the sensor data and an appropriate algorithm [5~7].
nonlinear localization algorithm, and the nonlinear In our previous work, we proposed a nonlinear
algorithm searches for more appropriate parameters algorithm [9] and a linear algorithm [8]. Both the algorithms
that can minimize the objective error function. As the have been applied in the real localization system [10]. Based
results, we obtain more robust and accurate localization on the experiments in this system, we find that each of the
results than those by using linear algorithm only. algorithms has its advantages and shortages. The nonlinear
Nevertheless, the time efficiency of the nonlinear algorithm uses the nonlinear optimization (Levenberg-
algorithm is enhanced. The real experimental data show Marquart) approach, and has higher accuracy and stability,
that the average localization accuracy is about 2mm and but the time efficiency is lower and might fail to give
the average orientation accuracy is about 1.6o when the correct global solution sometimes because there are many
magnet moves within the sensing area of 240mm local minima. The linear algorithm uses matrix computation,
×240mm square. so it can be more easily realized and has faster speed, but it
has the singularity problem, and its accuracy is not always
Index Item –magnetic localization and orientation; linear in high level. Therefore, we propose a novel algorithm, in
and nonlinear algorithm; magnetic sensor array. which an improved linear algorithm is first used to find the
I. INTRODUCTION localization parameters, and it is realized by finding the
eigenvector corresponding to the minimum eigenvalue of
The wireless capsule endoscope was invented in 2000 the objective matrix. Then, the nonlinear algorithm is
[1], which makes it possible for doctor to inspect the applied for further computation by using the initial
patient’s entire gastrointestinal (GI) tract without causing parameters obtained from the linear algorithm. This
much pain. This technique has caught the sights of many approach can provide not only the good localization
research organizations, and some new types of the capsule accuracy, but also the satisfactory execution speed.
endoscope have been proposed since then [2~4]. However, The organization of this paper is as follows. In section
the current capsule endoscope can not be accurately located II we introduce the magnet’s magnetic field. In section III
when it moves in the gastrointestinal (GI) tract, which we discuss the linear localization algorithm. In section IV
makes it difficult for doctors to determine where to apply we propose the improved nonlinear localization algorithm.
further medical operation. To address this problem, we have In section V, we present the experimental results, followed
built a magnetic localization system for the capsule by the conclusion in session V.
endoscope [8~10].
II. MAGNET’S MAGNETIC FIELD
The magnetic flux density at a spatial point created by
Magnetic Sensor Array
a permanent magnet can be represented by the following
Magnet equation
GI Tract v v v 3( H 0 × Pl ) Pl H 0
B l = B lx v x + B ly v y + B lz v z = BT ( - 3)
Capsule R l5 Rl (1)
Fig.1 Localization System Scheme for Capsule Endoscope
(l = 1,2,3L N )
Where, the magnet’s position is represented by (a, b, c )T and
This project is supported by Chinese National High Technology Research
(863) Funds (2007AA01Z308) awarded to Chao Hu, and by RGC
Competitive Earmarked Research Grant #CUHK4213/04E of the Hong
Pl = (xl - a, y l - b, z l - c ) , Rl = (xl - a)2 + ( yl - b)2 + (zl - c)2 .
T
Kong government awarded to Max Meng.

978-1-4244-1815-2/08/$25.00 ©2008 IEEE. 2055

Authorized licensed use limited to: Hong Kong University of Science and Technology. Downloaded on October 21,2021 at 00:26:00 UTC from IEEE Xplore. Restrictions apply.
the magnet’s orientation is represented by H 0 = (m, n, p ) . This is a 6-order equation, and now we need to use 6 (or
T

more) sensors to solve for 6 parameters in the column vector.


The flux intensity is invariant to the rotation of the circular
In real system, the magnetic flux is detected by magnetic
magnet along its central axis. Hence the magnet’s
sensors, and some types of noise exist in the acquired data,
orientation H0 is in two dimensions, in other words, the
which cause the error in the solution. To obtain more
length of vector (m, n, p )T can be any fixed value. Therefore accurate results, more sensors are preferable.
we add following constraint for (m, n, p ) : Assuming that there are N sensors, and from (3), we
T
have
m2 + n2 + p 2 = 1 (2) MBV = 0 (4)
As shown in Fig.2, suppose that there are N sensors, where M B is the objective matrix:
with l-th sensor located at (xl , y l , z l )T , 1 ≤ l ≤ N. The æ B1x B1y B1z B1z y1 - B1y z1 B1xz1 - B1z x1 B1y x1 - B1x y1 ö
ç ÷
vectors connecting the l-th sensor to the magnet can then be ç B2x B2 y B2z B2z y2 - B2 y z2 B2xz2 - B2z x2 B2 y x2 - B2x y2 ÷
MB = ç ÷
represented by Pl = ( xl - a, yl - b, z l - c )T . ç
M M M M M M
÷
ç BN x BN y BN z BN z yN - BN yzN BN xzN - BN z xl BN y xN - BN x yN ÷
z è ø
H0 (m, n, p) (N >=6); and
(a, b, c)
V = [bp - cn cm- ap an- bm m n p]T .
Because noise exists in the sensor data, the solutions are not
Pl unique when N>=6 and. Here, we use the least square error
x (xl , yl ,zl ) algorithm to address this problem, and this is to find the
y solution of (4) by minimize the square error:
Fig. 2 Coordinate system for localization and orientation
e = V T M BT M BV (5)
Here, we can measure the orthogonal magnetic It has been proved that there are 6 eigenvalues of real
components Blx, Bly, and Blz by 3-axis magnetic sensors, symmetrical matrix M BT M B , and the least e corresponds
and (xl , y l , z l )T , the positions of the sensors are known in to the least eigenvalue; while the solution of V is the
advance. Therefore, we need to find an algorithm to solve eigenvector corresponding to the least eigenvalue of M BT M B .
the 6 parameters of the magnet’s position (a , b , c )T and Thus, we find the solution V to be the eigenvector of
orientation (m , n , p )T . M BT M B corresponding to the least eigenvalue.
After getting the solution vector V, then we get
III. IMPROVED LINEAR LOCALIZAION ALGPRITHM
V T = [t1 t 2 t 3 t 4 t 5 t 6 ]T
As presented in paper [8], from (1), we have
= [(bp - cn) (cm - ap) (an - bm) m n p]T
( B l ´ P l ) × H 0 = 0 , l = (1, 2, ... N). That is
So we obtain the orientation parameters (m, n, p). Now we
æ B lx ö æ xl - a ö æ m ö
ç ÷ ç ÷ ç ÷ need to find the position parameters (a, b, c). Because the
ç B ly ÷ ´ ç yl - b ÷ × ç n ÷ = 0 coefficient matrix of (a, b, c) in (t1, t2, t3) is singular, we can
çB ÷ çz -c÷ ç p÷
è lz ø è l ø è ø not solve for (a, b, c) directly from (t1, t2, t3), and there are
Above equation can be rearranged as only 2 independent equations and need to find another
éb - cn' ù independent equation.
êcm '- a ú
ê ú Choose one non-zero element of m, n, p, for
[ B lx , B ly , B lz , ( B lz y l - B ly z l ) , ( B lx z l - B lz x l )] ê an' - bm 'ú = B lx y l - B ly x l example, p ¹ 0 , then a and b can be represented by
ê ú
êm' ú b = (t1 + cn) / p (6)
ên' ú
ë û
a = (cm - t 2 ) / p (7)
where m' = m p , n' = n p . This is 5-order equation, and we
From the original magnetic model (1), we have:
can use 5 sensors to get 5 equations, such that the 5
components of the column vectors can be solved. Then, the 3[m(xl - a) + n( yl - b) + p(zl - c)] × (xl - a) m
Blx = BT { - } (8)
localization and orientation parameters (a, b, c, m, n, p ) can Rl5 Rl3
be also solved. However, this equation has the singularity 3[ m( xl - a) + n( yl - b) + p( zl - c)] × ( yl - b) n (9)
Bly = BT { - 3}
problem when p is close to zero, which brings about large Rl5 Rl
error. So, we adopt following steps to improve it. 3[m( xl - a ) + n( yl - b) + p( zl - c )] × ( zl - c) p (10)
First, we change the above 5-order equation as: Blz = BT { - 3}
Rl5 Rl
é bp - cn ù
ê cm - ap ú Dividing (8) and (9) with (10), we get
ê ú
ê an - bm ú
[B lx Bly Blz Blz yl - Bly z l Blx z l - Blz xl ]
Bly xl - Blx yl ê ú=0 (3) Blx {3[ m ( xl - a ) + n ( y l - b ) + p ( z l - c )] × ( z l - c ) - Rl2 p}
ê m ú
ê n ú = B lz {3[ m ( xl - a ) + n ( y l - b ) + p ( z l - c )] × ( x l - a ) - Rl2 m}
ê ú
êë p úû (l = 1, 2,…N) (11)

2056

Authorized licensed use limited to: Hong Kong University of Science and Technology. Downloaded on October 21,2021 at 00:26:00 UTC from IEEE Xplore. Restrictions apply.
é3[m(xl - a) + n( yl - b) + p(zl - c)].(xl - a) m ùü
2
Bly {3[m(x l - a) + n(y l - b) + p(z l - c)] × (z l - c) - Rl2 p} N
ì
Ex = å íBlx - BT ê
î ë R5l
- 3 úý
R l ûþ
(16)
= B lz {3[m(x l - a) + n(y l - b) + p(z l - c)] × (y l - b) - R l2 n} l =1

é3[m(xl - a) + n(yl - b) + p(zl - c)].(yl - b) n ùü


2
(l = 1, 2,…N) (12) N
ì (17)
Ey = åíBly - BT ê - 3 úý
Substitute (6), (7) into (11), (12), we find two 2-order l =1 î ë R5l R l ûþ
equations with one unknown parameter c:
é 3[m( xl - a) + n( yl - b) + p( zl - c)].( zl - c)
N 2
ì p ùü (18)
k 21c 2 + k1l c + k 0l = 0 Ez = å íBlz - BT ê
l =1 î ë Rl5
- 3 úý
R l ûþ
) ) ) (l = 1,2,…N) (13)
k 21c 2 + k1l c + k 0l = 0 The total objective error is defined as
) ) ) E = Ex + Ey + Ez (19)
Where k 2l , k1l , k 0l , k 2 l , k1l , k 0l are functions of known
Therefore, we determine a solution that can minimize E,
parameters [t1 t2 t 3 ]T , (m, n, p )T , sensor position as given by (16)-(19). The equations (16), (17), and (18) are
(xl , yl , zl )T , ( )
and measurable data Blx , Bly , Blz . Because high-order nonlinear equations, and we should select an
appropriate nonlinear algorithm to solve them. Following
there are 2l equations, we also apply the least square error factors should be considered when choose the algorithm:
method by defining (1) It should have high accuracy and robustness.
N ) ) ) (2) It should have large tolerance of the initial guess of the
E= å
[(k 2 l c 2 + k1l c + k 0 l ) 2 + (k 2 l c 2 + k1l c + k 0l ) 2 ]
l =1
parameters, because if initial parameters are with large error,
the algorithm may fail to give global minimization solution.
(l = 1,2,…N) (14)
(3) It should have better time efficiency for real time
¶E N ) N ) )
= 2[ 2(å k 22l + k 22l ) c 3 + 3[ å ( k 2 l k1l + k 2 l k1l )]c 2 tracking.
¶c i =1 i =1
There are many nonlinear optimization algorithms could
be used. Through the trials, we find that the Levenberg-
N ) ) ) N ) )
+ å ( k12l + 2k 2 l k 0 l + k12l + 2 k 2 l k 0 l ) + å ( k1l k 0 l + k1l k 0 l )] Marquart method is a good choice [9], and the localization
i =1 i =1 accuracy is higher than that in linear algorithm. However,
the algorithm still has a few chances to fail to give correct
(l = 1,2,…N) (15) solutions, and sometimes, the execution time is a little long.
To address these problems, we propose a novel
Let ¶ E = 0 , we can obtain 3 roots for c. If there is only algorithm combining the linear and nonlinear algorithms.
¶c
one real root, we choose this real root as c. When there are 3 There, the linear algorithm is first used to find the
real roots, substitute the 3 real roots into (14), and choose localization parameters, and then the nonlinear algorithm is
the one that has the least error E. Once c is determined, we applied for further computation by using the initial
can compute a and b by using (6) and (7). parameters obtained from the linear algorithm. As the
In the algorithm, the dimension of M B is l*6 ( l≥6 ), results, the system has both the satisfactory localization
accuracy and time efficiency.
while V is calculated by 6*6 dimensional matrix M BT M B , so
sensors number l could be any number equivalent to or V. EXPERIMENT AND RESULTS
larger than 6. The more is the sensors, the higher the Experiments are carried out in a normally unshielded
localization accuracy. In real application, we should environment, and there is the influence of ambient magnetic
determine the sensor number by the objective accuracy. field. The localization system consists of sixteen 3-axis
magnetic sensors, and the sensor data are processed by
IV. IMPROVED NONLEAR LOCALIZATION ALGORITHM VC++ program in a PC computer. The computer completes
Equations (8), (9), and (10) show the relationship the localization and orientation algorithm and the
between magnetic flux intensities at l-th sensor position and localization results are shown in 3D mode on the displayer.
the magnet’s position and orientation. We can measure three To compare the linear algorithm with the improved
magnetic intensities Blx , Bly , and Blz by a 3-axis magnetic nonlinear algorithm, we first test some spatial target points
sensor. For N sensors, we obtain 3×N measured flux using the linear algorithm, the localization errors are shown
intensity values. Therefore, with two 3-axis magnetic in Fig.3. Then we detect these same points using nonlinear
sensors, the six parameters of the magnet location and algorithm in which initial guess is the solution of the linear
orientation could be calculated by solving nonlinear algorithm, and the localization errors are shown in Fig.4. In
equations (8), (9), (10) and (2). Fig.3 and Fig.4, the red curve, green curve and blue curve
Although 5 sensors is the minimum to solve the 5 represent position component errors of a, b, and c. The
unknown Localization/orientation parameters, more sensors comparisons of the total position errors are shown in Fig.5
can be applied to get higher localization/Orientation and Fig.6. From these figures, we observe that the
accuracy. When there are more than 5 sensors, the solution localization accuracy in improved nonlinear algorithm is
is not unique (in the presence of noise), and we try to obtain much better than that in linear algorithm; more important
a solution that minimizes an objective error function. Here, is that the nonlinear algorithm has more convergent
we define error functions as follows: localization and orientation results than the linear algorithm,

2057

Authorized licensed use limited to: Hong Kong University of Science and Technology. Downloaded on October 21,2021 at 00:26:00 UTC from IEEE Xplore. Restrictions apply.
and thus having higher stability. Table I. Average Localization and Orientation Errors
Table I shows the average localization and orientation Linear algorithm Nonlinear algorithm
errors via the linear and the improved nonlinear algorithms.
a(mm) 2.0250 1.8333
We observe that the localization accuracy in improved
nonlinear algorithm is 2.07 mm, which is much better that b(mm) 1.8583 0.5250
(3.72mm) in linear algorithm. c(mm) 2.4917 0.7417
Localization 3.72 2.07
Error(mm)
m 0.0233 0.0167
n 0 0
p 0.0225 0.0225

VI CONCLUSIONS
In this paper, a novel localization algorithm is proposed.
It is realized by the nonlinear optimization approach, which
uses the initial guess of parameters from the results of the
Fig.3 Position errors using linear algorithm
linear localization algorithm. As the results, not only the
accuracy and stability in the improved nonlinear algorithm
are improved significantly, but also it overcomes the
problem that the nonlinear algorithm may fail to give
correct global solution. Nevertheless, the searching time
efficiency is improved. Real experimental results show that
this algorithm works better and the localization system
becomes more robust.

REFERENCES
[1] Gavriel Iddan, Gavriel Meron, Arkady Glukhovsky, and Paul Swain,
“Wireless Capsule Endoscopy”, Nature, Vol. 405, No. 6785, p.417, May,
2000.
[2] NORIKA3, RF Co., Ltd. T/A RF SYSTEM lab.
Fig.4 Position errors using nonlinear algorithm http://www.rfnorika.com/e_system/e_system_001.html.
[3] Olympus Medical Systems Corporation, "Development of Capsule
Endoscope and Peripheral Technologies for further Expansion and
Progress in Endoscope Applications",
http://www.olympus.co.jp/en/news/2004b/nr041130capsle.cfm.
[4] Max Q.-H. Meng, Tao Mei, Jiexin Pu, Chao Hu, Xiaona Wang, and
Yawen Chan, “Wireless Robotic Capsule Endoscopy: State-of-the-Art
and Challenges”, Proceedings of the 5th World Congress on Intelligent
Control and Automation. Vol.6, June 15-19, 2004, pp.5561~5565.
[5] Werner Weitschiles, Roman Kotitz, DinoCordini, and Lutz Trahms.
“High-Resolution Monitoring of the Gastro-intestinal Transit of a
Magnetic Marked Capsule”. Journal of Pharmaceutical Sciences, Vol.86,
No.1, 1997, pp.1218 ~1222.
[6] V. Schlageter, P.-A. Besse, R.S. Popovic, and P. Kucera, “Tracking
system with five degrees of freedom using 2D-array of Hall sensors and
a permanent magnet”, Sensors and Actuators A 92 (2001), pp.37~42.
Fig.5 Position errors using linear and nonlinear algorithms [7] N. Mani Prakash, and Francis A. Spelman, “Localization of a magnetic
marker for GI motility studies: an in vitro feasibility study”,
Proceedings of the 19th annual international conference of the IEEE
Engineering in Medicine and Biology Society, Oct.30-Nov.2, 1997,
Chicago, IL. USA, pp.2394~239.
[8] Chao Hu, Max Q.-H. Meng, Mrinal Mandal. “A Linear Algorithm for
Tracing Magnet’s Position and Orientation by using 3-Axis Magnetic
Sensors,” IEEE Transaction on Magnetics, Vol.43, N0.12,
pp.4096~4101, December 2007.
[9] Chao Hu, Max Q.- H. Meng, and Mrinal Mandal, “Efficient Magnetic
Localization and Orientation Technique for Capsule Endoscopy”.
International Journal of Information Acquisition. 2(1):23~36, 2005.
[10] Chao Hu, Max Q.-H. Meng, Mrinal Mandal, Xiaona Wang, “3-Axis
Magnetic Sensor Array System for Tracking Magnet’s Position and
Orientation”, Sixth World Congress on Intelligent Control and
Automation, June 20~24, 2006, Dalian, China, pp.5304~5308.
Fig.6 Orientation errors using linear and nonlinear algorithms

2058

Authorized licensed use limited to: Hong Kong University of Science and Technology. Downloaded on October 21,2021 at 00:26:00 UTC from IEEE Xplore. Restrictions apply.

You might also like