Performance Optimization of a Differential Method for Localization of Capsule Endoscopes

Although capsule endoscopy is already used for diagnosis of the gastrointestinal tract, a method to precisely localize the capsules, important for accurate diagnosis, is lacking. Static magnetic localization is a promising solution for that purpose. In this paper, the simulation of a differential static magnetic localization system with dynamic geomagnetic compensation was optimized. First, a convergence-test for the position and orientation errors as a function of the dimension of the computational domain was conducted. Subsequently, the diameter-to-length ratio of a permanent magnet was varied and the corresponding position and orientation errors, as well as the mean magnetic flux density measured at the sensor positions, were compared. The results revealed that for a computational domain radius of 800 mm, the position and orientation errors converged to less than 0.1 mm and 0.1°, respectively. The position and orientation errors were also of that order, even with the smallest permanent magnet employed in the study. Furthermore, the mean magnetic flux density measured at the sensors of the proposed magnetic localization system would be detectable using state-of-the-art magnetometers. It is concluded that the differential localization method is also feasible for small permanent magnets, which is especially important considering the limited space within endoscopy capsules.


Introduction
Wireless capsule endoscopy (WCE) is a promising medical application and a potential alternative to conventional endoscopy. A small capsule with an integrated camera for recording a video is swallowed by a patient allowing gastrointestinal diagnosis. It is of particular interest for doctors that a certain video frame is correlated to the precise location of the capsule within the gastrointestinal tract. Static magnetic localization is well-established for that purpose, herein a permanent magnet is embedded in a capsule and the generated magnetic field is sensed by sensors around the abdomen of a patient. The position and orientation can be reconstructed from the measured flux density by solving the inverse problem and utilizing the standard magnetic dipole model. [1] The geomagnetic flux density interferes with the measured flux density of the sensors, leading to large localization errors if no geomagnetic compensation method is applied [2]. One simple compensation method is sensor calibration, which is only valid for a static localization system, therefore, the method is only suitable as long as no rotation of the system relative to the geomagnetic flux density is conducted [3]. This is especially critical since diagnosis with capsule endoscopy takes about 8-12 h. In [4,5], dynamic approaches for geomagnetic compensation in the context of localization of capsule endoscopes were proposed. However, in [4], the localization performance was dependent on the different rotations of the localization setup. Moreover, in [5], an inertial sensor was applied for geomagnetic compensation, but only short measurement scenarios were evaluated, hence the drift effect of the inertial sensors was reduced. In our previous work [2], we proposed a differential static magnetic localization method with dynamic geomagnetic compensation. Although position P err and orientation O err errors were constant for various rotations of a subject, the localization performance was not stable for different orientations of the magnet. Moreover, the size of the magnet was not optimized for the limited space within state-of-the-art capsules.
In this paper, simulations using the differential static magnetic localization method were optimized. The diameter-to-length ratio of the simulated permanent magnet was varied and the resulting P err and O err were compared. Moreover, the mean measured flux density for the proposed localization system was evaluated for each magnet size and compared to the detectivity of a state-of-the-art magnetometer.

Static Magnetic Localization
Static magnetic localization of capsule endoscopes is well-established in the literature [1,3]. A small permanent magnet, which generates a static magnetic flux density B, is embedded in a capsule ( Figure 1). The magnetic flux density B of a cylindrical permanent magnet at an observer-point P i = (x i , y i , z i ) can be approximated by an analytical expression, namely the standard magnetic dipole model [6]: where µ 0 = 4π × 10 −7 Vs/Am is the magnetic permeability in vacuum, µ r the relative permeability of the surrounding medium, M 0 the axial magnetization of the magnet in ampere per meter, respectively. The length and radius of the magnet are expressed by l and k, respectively. Moreover, the orientation of the magnet is given by #» H 0 = (m, n, p), the center of the magnet by (a, b, c) and the Euclidean distance from the center of the magnet to an observer-point P i by R i , respectively. The dipole model is valid as long as the distance from the magnet is much larger than the geometry of the magnet.
The localization of a capsule is a classical mathematical problem with six unknowns and, therefore, at least six equations have to be derived. By arranging N sensors around the abdomen of a patient at known points P i for each sensor the estimated components of #» B i are determined. By applying Equation (1) for each P i , the analytical values of #» B i are derived. To reconstruct the position and orientation of the magnet, the respective estimated and analytic values of #» B i are subtracted for each P i . Thereby, an N · 3 × 6 equation system results, which can be solved by minimizing the error function according to (a, b, c, m, n, p) by using the Levenberg-Marquardt (LM) method [7,8].
The magnetic flux density generated by a permanent magnet with respect to the distance R decays approx. 1/R 3 . Therefore, the magnetic flux density of a magnet applied for WCE is of the same order as the geomagnetic flux density at the body surface of a patient [9]. Due to this interference, the localization performance suffers significantly when applying the standard static magnetic localization method.

Differential Static Magnetic Localization
A differential geomagnetic compensation method for the static magnetic localization of capsule endoscopes that is capable of dynamic scenarios like a rotating sensor setup was proposed and evaluated in detail in our previous work [2]. It is based on the assumption that for the relatively small size of an abdomen, the geomagnetic flux density is a homogeneous field. For this purpose, three stable rings were arranged around the abdomen, each of which had four sensors attached. The sensors mounted on the rings were grouped in sensor pairs, consisting of two opposite sensors, which were equally orientated ( Figure 2). The measured value at the ith sensor consists of the magnetic flux density generated by the magnet #» B magnet,i and the superimposed geomagnetic flux density #» B geo . By subtracting the analytic magnetic flux density #» B analytic,i from the measured value, a non-linear equation for each sensor is derived. Subtracting the equations of two sensors corresponding to a pair cancels the homogeneous geomagnetic flux density. Therefore, the resulting P err and O err are independent of different rotations of the whole localization setup in the presence of the geomagnetic flux density. The further processing steps are equal to the standard static magnetic localization method.

Simulation Localization Setup
All simulations were conducted in COMSOL Multiphysics with a computational domain equal to a sphere with radius b. The whole domain was set to air, which is valid for static magnetic fields [10]. As a boundary condition, magnetic insulation ( #» n · #» B = 0) was applied. The 12 sensors were mounted on three stable elliptical rings (40 cm× 33 cm), that were each separated by 10 cm (Figure 3). The origin of the coordinate system was in the center of the middle ring. To analyze the localization accuracy, the magnet was set at position (60, 60, 60) mm and for each evaluation, four different orientations of the magnet were applied (x-, y-, zand 1 √ 3 (1, 1, 1) -orientation). Moreover, the geomagnetic flux density according to Erlangen, Germany (20, −1, −45) µT were applied [11]. The permanent magnet was of neodymium-iron-boron (NdFeB) with grade N52 with an axial magnetization M 0 of 1160 kA/m. The length and diameter of the magnet were both 10 mm.

Optimization of Computational Domain Size
The results in [2] showed that the localization performance varied for different orientations of the magnet. However, the reason for that is unclear. Therefore, in this study, a convergence-test of the root-mean-square (RMS) position and orientation errors concerning the radius of the computational domain b was conducted.

Variation of the Magnet Size
The impact of different diameter-to-length ratios R on P err and O err was investigated. The diameter of the magnet was constant at 10 mm while its length was varied. One reason to exploring the effect of magnet size is that the space within an endoscopy capsule is limited and therefore, the magnet should be as small as possible. Furthermore, according to [12], the magnetic dipole model best describes the magnetic flux density of a cylindrical magnet, when R = √ 4/3. This was investigated by applying different diameter-to-length ratios and comparing the corresponding P err and O err . Furthermore, the mean value of the measured flux density at the 12 sensors was investigated. Thus, a trade-off between accuracy and magnet dimension was made by considering the detectivity of state-of-the-art magnetometers.

Results for Optimization of the Computational Domain
In our previous work [2], the mean P err and O err were 0.95 mm and 0.58°, respectively, but their margins of error varied significantly with magnet orientation. The radius of the sphere had been set to 400 mm. By increasing the radius b of the computational domain to 800 mm, the mean P err and O err were significantly reduced to less than 0.1 mm and 0.1°, respectively. Additionally, the impact of different magnet orientations was significantly reduced since the standard deviation (STD) for the position and orientation errors was approx. 0.05 mm and 0.02°, respectively ( Table 1). The enhanced localization performance can be explained by the larger distance from the magnet to the boundary condition, which disturbs the magnetic flux density generated by the magnet. These simulation-based results are significantly better than state-of-the-art dynamic geomagnetic compensation methods for capsule endoscopy [4,5].  Table 1 shows the mean P err and O err with respect to the diameter-to-length ratio R. Table 1. Position P err and orientation O err errors and their mean value and STD using the differential method with different orientations of the magnet for five different diameter-to-length ratios R. The mean value of the magnetic flux density ∅|B| with respect to the 12 sensors is also shown. Moreover, for each R, the corresponding mean value of the measured magnetic flux density ∅|B| at the 12 sensors is given. The worst localization performance was achieved with the longest magnet (R = 0.5). Moreover, it was observed that the orientation error decreased when the length of the magnet was reduced. Therefore, the smallest orientation error with 0.01°occurred with the shortest magnet of length 2 mm. For a ratio of √ 4/3, the dipole model exhibits the best fit to the magnetic flux density of a permanent magnet, however, the P err and O err were approx. equal with the errors by applying a ratio of 1. These two ratios yielded the best localization performance among those evaluated. Overall, the ratio proposed in [12], did not significantly improve the localization method. The results revealed that even for the shortest magnet (R = 5), P err and O err were acceptable, approx. 0.1 mm and 0.02°, respectively.

Diameter-to-Length Ratio
Moreover, Table 1 reveals that the mean measured flux density at the sensors is smallest for the shortest magnet. However, by considering the detectivity of state-of-the-art magnetometers like the LSM303DLHC, which is in the range of nT/ √ Hz [13], even a short magnet with a diameter of 10 mm and length of 2 mm seems feasible.

Conclusions
The objectives of this work were to investigate the impact of different-sized magnets on our previously proposed differential static magnetic localization method with dynamic geomagnetic compensation and to further optimize its localization performance. By increasing the radius of the computational domain, the mean position and orientation errors were significantly reduced to less than 0.1 mm and 0.1°, respectively, and the impact of different orientations of the magnet on the position and orientation errors was significantly reduced. Moreover, the results revealed that even for a 2 mm short magnet the position and orientation errors were sufficiently small, and its generated magnetic flux density sufficiently large to be detectable at the sensor positions of the proposed localization system using state-of-the-art magnetometers. In the future, results of simulations will be validated by means of experiments.