Ultra-Wideband Wireless Capsule Endoscope Localization Based on a Hybrid One-Shot Learning and Trilateration Method

Wireless capsule endoscopy (WCE) is a minimally invasive procedure that allows for the examination of the gastrointestinal tract using a small, swallowable capsule equipped with a camera. Accurate localization of wireless capsule endoscopes within the gastrointestinal (GI) tract is pivotal for effective medical interventions. We propose a novel hybrid localization method, combining one-shot learning and trilateration, addressing challenges in the complex in-body wireless channel. Results indicate improved accuracy, surpassing traditional methods. Using a modified Laura model with increased organ sizes, a shift to a 4-zone configuration reveals altered electromagnetic interactions in the GI tract. This modification allows us to simulate scenarios involving larger individuals, providing insights into the adaptability of our proposed technique to diverse anatomical conditions. Despite the shift, our method excels, showing adaptability with superior performance in 4 and 5 zones across diverse locations. Sensitivity to environmental conditions is emphasized, impacted by factors like organ size. Similarity in results between 4 and 5 zones underscores adaptability, extending to $45^{o}$ and $90^{o}$ scenarios. In summary, our hybrid approach represents a promising advancement, enhancing accuracy for wireless capsule endoscope localization in varied GI tract environments.


I. INTRODUCTION
Location-based services have become increasingly prevalent in various industries and daily life, finding applications in asset tracking [1], [2], [3], intruder detection [4], [5], and wireless capsule endoscope localization [6], [7], [8].These services rely on wireless localization methods, which can be broadly categorized into range-based and range-free The associate editor coordinating the review of this manuscript and approving it for publication was Nuno M. Garcia .approaches.Range-based methods, such as trilateration and triangulation, utilize geometric interpretations, while range-free methods, like fingerprinting, rely on pattern matching.Traditional diagnosis of the gastrointestinal (GI) tract involves inserting a long, flexible tube into the patient's body through oral or rectal openings.This method has two main downsides: limited access to the entire GI tract and discomfort faced by the patient [9].
Wireless capsule endoscopy (WCE) presents a noninvasive, portable alternative for examining the gastrointestinal tract.It employs a small capsule equipped with a camera that wirelessly transmits images to an external receiver.Accurate location information is crucial for successful follow-up treatment methods, including surgical procedures and targeted drug delivery.Precise positioning of the capsule is vital for both diagnosis and treatment.Radio frequency (RF)-based localization, due to its cost-effectiveness and utilization in data communications, is widely preferred.However, RF-based localization within the body is challenging due to the complex, multipath nature of the in-body wireless channel.Deep learning, a machine learning technique capable of learning the relationship between measured signals and the target's location, has the potential to improve the accuracy of wireless localization.Nevertheless, the use of deep learning in wireless in-body capsule endoscope localization remains largely unexplored.
In this paper, we contribute by investigating the use of deep learning for WCE localization.We propose a novel hybrid one-shot learning/trilateration method that combines the strengths of range-based and range-free localization techniques.Our method leverages the benefits of trilateration, a commonly used range-based method, while also incorporating elements of one-shot learning to enhance accuracy.Through experiments, we demonstrate that the proposed method yields a lower average distance error in all capsule locations, indicating its potential to improve the precision of WCE localization.Specifically, our results show that employing zone-specific path loss parameters in trilateration leads to better performance compared to conventional trilateration methods.Additionally, we find that antenna selection plays a crucial role in enhancing localization accuracy, as careful antenna selection can reduce the maximum distance error by 114.56 mm.Overall, our work contributes to the field by demonstrating the efficacy of deep learning in WCE localization and presenting a promising hybrid approach that combines the advantages of different localization techniques.
The paper is organized as follows.In Section I, we provide an overview of WCE and a review of the existing relevant localization methods.In Section II, we present our proposed hybrid one-shot learning/trilateration localization method.In Section III, we discuss the experiments and results of the proposed method.Finally, in Section IV, we conclude the study and suggest future directions for research.

A. RELATED WORKS
In this literature review, we provide an overview of the WCE localization, including a discussion of the channel models used for in-body wireless localization.WCE serves as a non-invasive and portable diagnostic method for the gastrointestinal tract.In this technique, a capsule, equipped with cameras, is ingested, and the captured data is wirelessly transmitted to an external receiver for processing.Ensuring accurate capsule positioning is crucial for precise diagnosis and treatment.Various methods, such as image processing, magnetic sensing, and RF sensing, are employed for capsule localization.Among these, RF sensing is favored for its cost-effectiveness in hardware and widespread utilization in data communication [10].The data collected by the capsule's cameras is transmitted wirelessly using RF sensing, providing a reliable and efficient means of transmitting information over short distances without the need for complex and expensive hardware.This enables seamless communication between the capsule and the external receiver, ensuring that the diagnostic data is transmitted in real-time for prompt medical analysis.
WCE has become a favorable method for the diagnosis of the human GI tract because it is a non-invasive, portable, and highly accurate procedure [11].In traditional endoscopy, a tube has to be inserted into the patient's body, which is an uncomfortable process.In WCE, the patient is only required to swallow a tiny capsule, which can capture images of the GI tract and wirelessly transmit the data to external receiver for further processing.
To execute RF-based WCE localization, two types of devices are necessary: the body-mounted or wearable onbody antenna, which is physically attached to and worn by the user, and the in-body capsule [19].RF based WCE localization methods often borrow techniques from wireless indoor localization.These methods can be broadly classified into range-based and range-free approaches.Range-based techniques, such as trilateration and triangulation, rely on geometric interpretations, while range-free methods, such as fingerprinting, utilize pattern matching for localization [20], [21], [22].
Fingerprinting is a well-established technique for localization, but it relies on a database of reference fingerprints or a pre-existing radio map.Collecting this data can be challenging, particularly in the complex environment of the GI tract.Still, there are some attempts that are based on fingerprinting.For example, [19] proposed a simple received signal strength (RSS) fingerprinting for WCE localization.
In their work, 4 on-body antennas are placed on the body.During the training phase, the RSS values from four on-body antennas and the corresponding capsule location are recorded in a database.In the online phase, the real-time RSS values are compared to those in the database to find the best match.The authors suggested that using data from more training locations can improve accuracy, but this can be difficult to achieve in the complex environment of the GI tract.
Range-free localization methods, such as fingerprinting, tend to perform well in non-line-of-sight (NLOS) environments.However, there are several challenges to consider when using these methods for in-body localization.First, a large number of training data points are needed for high accuracy, but it may not be practical or possible to generate a comprehensive radio map of the GI tract.Second, the anatomy of the GI tract varies from person to person, meaning that a separate radio map would be needed for each individual.As a result, many WCE localization methods rely on rangebased techniques.
For the range-based approach, the measured RSS has to be converted into range information.Typically, the log-distance path loss model is used in free-space setting.However, the authors in [23] suggested that the log-distance model is not a good fit for in-body environment, and proposed a power law function path loss model, which is described by where L(d) is the measured path loss at distance d from the skin, L 0 is the path loss at the reference distance d 0 , a is a fitting constant, n is the path loss exponent, and N (µ, σ ) is the Gaussian noise with mean µ and standard deviation σ .Another work by [24] proposed another path loss model, a slightly modified version of the model in Equation (1), which is described by where m is the gradient fitting constant.A more recent work by [18] uses a simple trilateration based on the channel frequency response (CFR) measurements.The measured CFR can be used to derive the path loss, and its corresponding range as where L is the path loss, and H f is the CFR, which represents the ratio between the power received at the on-body antenna and the power transmitted by the in-body capsule antenna.
To relate path loss to range, we use where d is the range between the capsule and the on-body antenna, L 0 is the path loss at the reference distance d 0 , and γ is the average path loss exponent.From Equation (4), the estimated range d est is Based on the estimated range information, the capsule is located using the linear LS method, similar to the one presented in the wireless indoor localization.The authors in [25] made an extension of this work by considering a threelayer (skin, fat, and muscle) phantom in their experiment.The same localization method is used.Based on the previous works, we can see that there are some challenges for the current WCE localization methods.For the trilateration methods, LOS path is needed for accurate positioning; however, the in-body channel is characterized by severe multipath.For the fingerprinting methods, generating a dense radio map of the GI tract is impractical if not impossible.In conclusion, the use of deep learning for WCE localization and the development of hybrid methods that combine the advantages of different localization techniques are promising avenues for future research in this field.

B. OUR MAIN CONTRIBUTION
In this study, we propose a novel hybrid WCE localization method that combines the trilateration method with a fingerprinting method to enhance localization accuracy.Our approach utilizes channel data obtained through electromagnetic simulations that utilize anatomically realistic voxel models, with a range of capsule locations that mimic various propagation environments within the human intestinal region, as described in [26].Our study is the most extensive examination of WCE localization to date, with the inclusion of capsule locations in a diverse range of propagation environments, not seen in previous studies.
Unlike previous methods, our approach utilizes a zone-specific path loss parameter in the trilateration process, which takes into account the varying tissue types and thicknesses found in the gastrointestinal tract.We also employ one-shot learning, implemented with a Siamese neural network [27], [28] to create a classification model for coarse-level zone identification using the fingerprinting method.This is the first study to propose such a hybrid method for WCE localization.After the zone is determined, trilateration using zone-specific parameters is used to determine the fine-level capsule's location.By generating a radio map in terms of zones instead of dense location points, the burden of data collection is greatly reduced.Additionally, antenna selection plays an important role in improving localization accuracy, as it can significantly reduce the maximum distance error.

II. PROPOSED METHOD
In this study, our focus lies in exploring the application of ultra-wideband (UWB) technology in WCE [29].UWB, a wireless communication technology, stands out for its ability to transmit signals across a wide frequency band, encompassing several gigahertz [29].Unlike conventional narrowband systems, UWB employs a significantly broader spectrum, enabling the transmission of short pulses with low power spectral density.This unique characteristic of UWB empowers us with advantages such as high data rates, precise time-domain positioning, and resilience against multipath fading [10], [29].
UWB-based transmission brings forth numerous benefits within the realm of WCE.Firstly, its high data rates facilitate the efficient transmission of substantial volumes of data, including high-resolution images and video streams captured by the wireless capsule.This capability enhances the detailed visualization and examination of the gastrointestinal (GI) tract, leading to more accurate diagnoses and effective treatment planning [26].
Although UWB offers unique advantages it has challenges in the context of WCE.One of the primary challenges is the high propagation loss experienced by UWB signals when propagating through tissues.This loss can significantly degrade the signal strength and quality, impacting the reliability of communication between the in-body and onbody devices [26].
To address this challenge, we propose employing directional on-body antennas that focus radiation toward the body while meeting specific absorption ratio (SAR) criteria-measuring the rate at which the human body absorbs electromagnetic energy in radio-frequency fields, with SAR limits set by regulatory bodies to maintain safe exposure levels [26], [30].These antennas are engineered with a precise radiation pattern, directing electromagnetic waves primarily to the user's body and minimizing energy dispersion into surrounding space.
The antenna engineering involves meticulous consideration of elements and their arrangement, configuring them to concentrate emitted radio-frequency signals within a defined spatial region, ensuring efficient absorption by the user's body and alignment with SAR criteria.Additionally, the design may incorporate beamforming techniques for dynamic adjustment of the radiation pattern based on the user's position and orientation, optimizing energy transfer and maintaining SAR levels within safety limits, irrespective of the user's movement.
Moreover, directional on-body antennas may include shielding elements to limit radiation in undesired directions, preventing excess exposure to individuals nearby and enhancing precision in maintaining SAR compliance.
In summary, the utilization of directional on-body antennas combines careful antenna design, beamforming technologies, and shielding elements.These elements work together to focus emitted radiation toward the user's body, consistently meeting SAR safe levels and addressing the need for a more detailed demonstration in our discussion.
Generally, in environments with severe non-line-ofsight (NLOS) conditions, localization methods based on fingerprinting can achieve higher accuracy compared to trilateration, provided that sufficient training samples are available.However, in the in-body environment, generating a detailed radio map of the GI tract proves impractical, if not impossible.As a result, most previous works in this field rely on trilateration as the primary localization method.
The proposed method strategically combines trilateration and fingerprinting methodologies to enhance localization accuracy within the GI tract.Central to this innovation is the recognition of dynamic path loss parameters, describing radio signal attenuation across diverse tissue types and thicknesses within the GI tract.These parameters exhibit variations across the tract, prompting the subdivision of the GI tract into distinct zones, each characterized by a unique set of path loss parameters.This zoning optimizes the application of trilateration, contributing to heightened precision in localization.Importantly, this approach efficiently addresses challenges in data collection by adopting a zone-based radio map, reducing the overall burden while maintaining localization accuracy.
The trilateration process, a core element of this localization method, employs sophisticated mathematical techniques to precisely determine the wireless capsule's location within the GI tract.This is especially critical for medical applications where accurate positioning is crucial.Fundamentally based on triangulation principles extended to three-dimensional spaces, trilateration considers distances between the capsule and known reference points, typically acquired through received radio signals.These distances, termed ranges, define spheres centered around each reference point, where the radii correspond to measured distances.
In an ideal scenario with three reference points, the intersection of these spheres indicates potential capsule locations.However, real-world complexities introduce measurement errors and uncertainties, necessitating trilateration algorithms, like the least squares method.These algorithms compute the optimal capsule position by minimizing errors associated with the intersection points.
Mathematically, the trilateration algorithm solves a system of nonlinear equations, where each equation represents the equation of a sphere in three-dimensional space.The objective is to find capsule coordinates (x, y, z) satisfying all these equations simultaneously.These equations take the form of the general sphere equation as where (x i , y i , z i ) are the known coordinates of the i-th reference point and r i is the measured distance between the capsule and the i-th reference point.
The trilateration algorithm follows an iterative refinement process, continually enhancing the accuracy of estimating the wireless capsule's coordinates within the intricate three-dimensional environment of the gastrointestinal tract.Initially, it derives an estimate based on the intersection of spheres formed by measured distances from the capsule to known reference points, referred to as ranges.These ranges are encapsulated in a system of equations, with each equation representing the sphere's equation and characterizing the relationship between the capsule and a specific reference point.To optimize this process, the algorithm formulates an objective function using techniques like the least squares method, aiming to minimize the error between computed and measured distances.Through successive iterations, the algorithm dynamically adjusts the capsule's coordinates, progressively refining its estimates.This iterative refinement persists until a predefined convergence criterion is met, signaling the achievement of an optimal solution where computed distances align closely with measured distances.The resulting estimates for the capsule's coordinates offer precise localization within the three-dimensional complexity of the gastrointestinal tract.This meticulous refinement continues until the algorithm reaches the optimal solution, providing accurate and precise localization crucial for medical diagnostic applications.
The proposed method operates through a two-phase process flow, outlined in Figure 1.The training phase comprises four interconnected modules: data collection (DC), zone formulation (ZF), zone classification (ZC), and zone parameterization (ZP), collaboratively initializing the localization process.In the DC module, CFRs are collected from various training locations.Subsequently, the ZF module categorizes these locations into distinct zones based on the collected CFRs.The ZP and ZC modules then extract path loss parameters and construct a zone classification model, respectively.
During the training phase, the capsule is strategically positioned at multiple reference locations, and the CFR is measured by on-body antennas.Utilizing simulations conducted in the Dassault Simulia CST Studio Suite, the Zone Formulation module delineates the reference locations into different zones.Simultaneously, the Zone Classification module generates a one-shot learning model to classify new CFRs into these zones.Meanwhile, the Zone Parameterization module calculates the required parameters for trilateration in each zone and stores them in a lookup table.
Transitioning to the testing phase, real-time CFR values (H (f )) are input into the Zone Classification module.Once the zone is identified, the H (f ) values and corresponding zone-specific parameters from the lookup table are utilized in the Location Estimation module to execute trilateration.Detailed operations of each module are elucidated below.

A. DATA COLLECTION
Quantifying the efficiency of power transmission between antennas often relies on the S21 parameter, which represents the ratio of output power to input power at the receiving antenna.In the case of on-body antennas, the received power (P r ) can be expressed as a function of the transmitted power (P t ) and the S21 parameter.The magnitude squared of the S21 parameter (|S21| 2 ) reflects the power transfer efficiency between the antennas, and its calculation is mathematically related to the complex reflection coefficient ( ) of the antenna system, where |S21| = |1 − |.The reflection coefficient ( ) characterizes the proportion of incident power that is reflected by the antenna system.
The S21 parameter's relationship with frequency is established indirectly through the antenna's impedance and radiation pattern.Impedance matching between the antenna and the transmission line or medium impacts the reflection coefficient ( ), thereby influencing the S21 parameter and power transmission efficiency.In contrast, the CFR (H (f )) serves to analyze the frequency-dependent behavior of the communication channel itself, encompassing phenomena such as attenuation, amplification, fading, and distortion effects.In our study, the CFR assumes a significant role and is extensively employed to understand the channel's characteristics.
While both the S21 parameter and the CFR are linked to the frequency response of a system, they serve distinct purposes.The S21 parameter focuses on evaluating the efficiency of power transmission between antennas, taking into account impedance matching and the reflection coefficient.On the other hand, the CFR provides insights into the frequency-dependent characteristics of the communication channel, capturing various effects that influence signal propagation.Consequently, our research heavily relies on the CFR to comprehend and analyze the channel's behavior, enabling informed decision-making regarding the design and implementation of our wireless communication system, particularly for machine learning-based WCE localization.
Regarding the specific transmit power of a WCE system, it is contingent upon factors such as design, implementation, and regulatory compliance requirements.Determining the appropriate transmit power necessitates careful consideration during the system's design phase to ensure compliance with SAR limits imposed by regulatory bodies.However, the precise transmit power value cannot be provided without 29702 VOLUME 12, 2024 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
comprehensive details about the system and applicable compliance standards.Compliance with SAR limits specified by regulatory authorities in the respective regions of operation, such as the Federal Communications Commission (FCC) in the United States or the International Commission on Non-Ionizing Radiation Protection (ICNIRP) guidelines in the United Kingdom and European Union, is paramount.
In our study, the Data Collection module captures the CFR during both the training and testing phases.The CFR is instrumental in locating the capsule, as it forms the basis for computing path loss parameters for trilateration and serves as the complete fingerprint in our hybrid trilateration and fingerprint matching approach.Functioning as a transmitter, the capsule interacts with body-mounted or wearable on-body antennas acting as receivers.Considering the presence of N on-body antennas, we collect H f values as an N × L matrix, denoted as H f , where L corresponds to the length of an H f measurement.

B. ZONE FORMULATION
Zone Formulation partitions the reference locations into zones based on the measured CFRs.Let us assume that the CFRs are initially collected by placing the capsule at M reference locations using N on-body antennas.Then the m th reference location can be characterized by a vector of path losses L m as where L m,n is the path loss between the m th reference location and the n th on-body antenna, which is defined as where H m,n (f ) is the CFR between the m th reference location and the n th on-body antenna.
Based on the vectors L m , for m ∈ {1, . . ., M }, the reference locations are partitioned into K zones using k-means clustering algorithm, such that the square distances between the k th zone members and the centroid µ (k) are minimized as where r m indicates whether the m th reference location is a member of the k th zone.The constraints are given so that a reference location can only be assigned to one zone.

C. ZONE PARAMETERIZATION
After the zones and their members are defined, a lookup table consisting of the zone identification number and the corresponding zone parameters is generated.For any k th zone, let n (k) be the path loss exponent, d (0) 0 be the smallest distance between the members and the on-body antennas, and L (k) 0 be the path loss experienced at d 0 .To obtain the parameters, the log-distance propagation model, as defined in Equation (13), is fitted to the data of the zone members.
where L is the path loss at an arbitrary distance d.In addition to zone k = 1, . . ., K , we define zone k = 0, where the parameters are computed using the data over all reference locations.Finally, the lookup table is created in the format shown in Table 1.Here 1 M is an 1 × M vector all of ones.During training, the SNN is exposed to pairs of input samples representing distinct reference locations within the gastrointestinal tract.The network learns to measure the similarity or dissimilarity between these pairs, with shared weights facilitating the transformation of inputs into the same lower-dimensional space.The iterative training refines the model over multiple epochs, minimizing the gap between predicted and actual similarities.
Once trained, the SNN undergoes a rigorous testing phase where real-time CFR values are input to the Zone Classification module.The SNN classifies these CFR values into specific zones within the gastrointestinal tract, a crucial step for subsequent localization using trilateration.The effectiveness of the SNN is evaluated based on its accurate classification of CFR values into the correct zones.The zone-specific parameters computed during training are stored in a lookup table.In the testing phase, when the SNN identifies the zone, these zone-specific parameters are retrieved for the trilateration process.The integration of the deep-learning-based zone classification model with trilateration ensures accurate localization within the identified zone.Overall, one-shot learning with SNN offers a robust solution for scenarios where acquiring extensive training data is impractical, addressing challenges specific to WCE.
The SNN consists of two identical subnetworks, where the weights and parameters are shared among the two.In contrast to a conventional classification model, where the output is the predicted class, the SNN model's output is a similarity measure between the input pairs.The convolutional layers are employed to convert the inputs into a lower-dimension space.Notably, the weights are shared between the two convolutional layers, ensuring both inputs are transformed into the same space, allowing their similarity to be accurately compared.
To classify CFRs into zones, the input CFR H i (f ) is paired with all the CFRs at the reference locations H m (f ), m = 1, . . ., M .The outputs are combined to create an M ×1 vector s = [s 1 , s 2 , . . ., s M ] ⊤ , where each element s m represents the similarity measure between the inputs H i (f ) and H m (f ).Subsequently, a score vector c = [c 1 , c 2 , . . ., c M ] ⊤ is generated by comparing s m with a threshold t s , such that Finally, the scores are summed among the zone members.The zone with the highest counts is selected, and its corresponding parameters in the lookup table, along with the input H i (f ), are passed to the Location Estimation module.However, if the scores are zero for all zones, then the parameters of the zone k = 0 are used.

E. LOCATION ESTIMATION
In this module, the capsule's location is determined.From the input CFRs, and parameters from the lookup table, an estimated distance between the capsule and each on-body antenna dn is calculated from where L n is the path loss with respect to the n th on-body antenna.
To determine the capsule's location, nonlinear least square is performed to minimize the sum of square errors, i.e., min x,y,z n∈N s where such that d n and dn are the true and estimated distance between the n th on-body antenna and the capsule, and (x, y, z) and (x n , y n , z n ) are the coordinates of the capsule and the n th on-body antenna, and N s is a set of on-body antennas used in the calculation, with |N s | = N s .Here N s consists of top N s on-body antennas with lowest path loss values.

III. SIMULATIONS
In our simulations, we employ Dassault Simulia CST Studio Suite to model the CFR.This software utilizes a sophisticated human model named Laura, renowned for its high fidelity and exceptional representation of voxel models in the abdomen and intestinal areas.Voxel models, in this context, are three-dimensional representations of biological tissues, where each voxel (volume pixel) corresponds to a small, distinct unit.Laura is distinguished among CST's voxel models due to its diverse tissue constitution, anatomical variety, and precise depiction of tissue thickness within the abdominal and intestinal regions.Simulating these intricate voxel models requires substantial computational resources in terms of processing power and memory capacity.Dassault Simulia CST Studio Suite mandates a computer system with robust specifications.We utilize a large number of mesh cells, approximately 333,000,000, to model the torso of Laura-voxel, on-body antennas, and the capsule model.To handle such a large number of mesh cells, we employ parallel processing on several cluster nodes, consisting of Intel Xeon E5-2640 v4 CPUs.Despite efficient parallel processing, the simulation time for the implant model varied between 1 and 6 days, depending on the computational load on the server computers.These requirements are crucial to handle the intricate calculations involved in simulating electromagnetic interactions within the human body, ensuring accuracy and reliability in the results obtained from the simulations.
The resolution of Laura model is 1.88 mm × 1.88 mm × 1.88 mm.The initial evaluations also involve the use of other CST models, namely Hugo, Donna, and Emma voxel models.However, these models have a significantly thicker subcutaneous fat layer.Unfortunately, they cannot be used for capsule endoscopy evaluations due to various restrictions.These restrictions include an inadequate or unrealistic shaped muscle layer, inadequate skin layer, and challenging hand position.Some of these limitations have already been discussed in the previous publication [31].In order to overcome the limitations of the CST's other voxel models, we have made modifications to the Laura voxel model by scaling its size dimensions by a factor of 1.25.This modification provides valuable insights into the success of localization in a larger individual.
The details of the antennas, antenna locations and the studied voxel models are summarized in the following subsections.

A. ANTENNAS 1) ON-BODY ANTENNA
In this study, we utilize a directional on-body antenna specifically designed for in-body communications within the low-band UWB frequency range from 3.75 to 4.35 GHz.This antenna adheres to the IEEE 802.15.6 wireless body area networks (WBAN) standard, as described in [26].Figure 3a illustrates the structure of the antenna, featuring a cavity (highlighted in grey) to enhance its directivity towards the body.This antenna, originally introduced in [30], has been extensively employed in various in-body channel studies, including [26].The realized gains of the on-body antenna, when positioned on the body, are presented in Figures 3b-d for frequencies of 3.75 GHz, 4 GHz, and 4.25 GHz, which represent the start, center, and end frequencies of the range of interest, respectively.

2) CAPSULE ANTENNA
In this study, a simplified capsule model is utilized, incorporating an omni-directional dipole antenna embedded within a plastic capsule shell.The dimensions of the capsule shell closely resemble those of commercially available capsules [32], measuring 11 mm × 25 mm. Figure 4a depicts the design of the dipole antenna, while Figure 4b showcases the capsule shell.The dipole antenna is specifically designed to operate at the central frequency of 4 GHz within the intestine.Further details regarding the capsule model can be FIGURE 3. The on-body antenna and its realized gains [26].
found in [26].Additionally, Figure 5 presents the simulated reflection coefficients (S11) for both the on-body antenna and the capsule antenna.The S11 parameter for the on-body antenna is obtained by locating it 4 mm away from the skin on the voxel model's abdomen.This gap improves the antenna's radiation efficiency compared to direct attachment to the skin.As for the capsule antenna, it is positioned within the capsule model and placed inside the small intestine of the voxel model, with the S11 parameter simulated accordingly [26].

B. HUMAN VOXEL MODELS WITH ON-BODY ANTENNA LOCATIONS AND CAPSULE LOCATIONS
The studied Laura model provides a detailed representation of the human body, including various organs and tissues.
Regarding the parameters specific to the intestine, such as its dielectric properties or conductivity, it is essential to consult relevant literature or specific models used within the simulation software.The information related to the parameters of the intestine can vary depending on the specific context, simulation setup, or desired level of accuracy.Some  Antenna reflection coefficients for on-body antenna (as located on the voxel) and capsule antenna (as located inside the voxel's small intestine) [26], [30].
common parameters that can be considered for modeling the intestine include: • Dielectric properties: Dielectric properties describe the ability of a material to store and transmit electrical energy.These properties are often represented by the relative permittivity (ϵ r ) and the electrical conductivity (σ ) of the tissue.The dielectric properties of the intestine can vary depending on factors such as tissue type,

1) MODEL MODIFICATION: SCALING THE LAURA MODEL FOR VARIED ORGAN SIZES
To further elucidate the rationale behind the modification of the Laura model, it is imperative to consider the diversity in human anatomy, particularly the substantial variations in organ sizes among individuals.By scaling up the Laura model's organ dimensions, we aimed to create a more representative simulation of larger anatomies encountered in real-world scenarios.This adjustment allows us to explore the impact of varying organ sizes on the performance of our hybrid localization method, providing valuable insights into the adaptability of the proposed technique across a spectrum of anatomical conditions.In essence, this modification serves as a strategic step toward ensuring the robustness and generalizability of our approach, reinforcing the credibility of our findings in the context of WCE in diverse gastrointestinal environments.
The parameters specific to the intestine, such as its dielectric properties or conductivity and the sizes of the organs, of the original Laura model and the modified Laura model are summarized in Table 2.
We use 7 on-body antennas as the anchors, as shown in Figure 6.Their locations are listed in Table 3.Our study focused on the meticulous selection of on-body antennas, strategically positioned to address two pivotal aspects: wireless communication and localization.
29706 VOLUME 12, 2024 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.To ensure wireless communication within the WCE system, we strategically placed multiple on-body antennas, meticulously chosen to optimize signal coverage and alleviate issues such as signal loss and fading.This careful selection significantly enhances communication reliability, thereby improving the data transmission between the WCE device and its external receiver.
The deliberate choice of specific on-body antenna locations is informed by the dual objective of addressing both communication and localization requirements in the WCE system.The chosen combination of antennas is intricately designed to provide comprehensive signal coverage over the target area of interest.This design not only boosts communication reliability but also facilitates accurate localization within the gastrointestinal tract.The strategic configuration leverages the diversity of signal measurements, enabling the use of localization algorithms for a precise estimation of the WCE device's position and orientation.
The position of the on-body antennas is determined by maximizing coverage over the entire intestinal area and maximizing the potential to exploit fat as a propagation channel between the capsule and on-body antennas.Therefore, the on-body antennas are located as much as possible in areas where abdominal muscle tissue is less thick, ensuring that the strongest lobe of the on-body antennas towards the body is on tendinous intersections.This location strategy is grounded in our previous studies, namely: [33], [34], and [35].
Accurate localization of the WCE device within the gastrointestinal tract is vital for effective diagnosis.By deploying a combination of antennas across different positions, we harnessed signal diversity and advanced localization algorithms.This improved accuracy in determining the WCE device's position and orientation.The training data are collected by placing the capsule in 6 locations, as shown in Figure 7.The different locations are identified by their relative positions: far left (FL), far right (FR), near left (NL), near right (NR), and colon location A (CA).Testing data has been collected from the previous 5 locations, as well as 4 additional locations situated in the middle, as shown in Figure 7. Figure 8 shows these additional locations, which are identified as MI00, MI05, MI10, and MI15, with ''MI'' standing for middle, and the suffix numbers representing the distance from the middle.A summary of the training and testing data is presented in Table 4.
At each location, the CFR is measured by the 7 on-body antennas, then the input sample is created by combining the CFR measurements together to create a dataset.
An input sample for the SNN training and testing is formed by combining the CFR measurements from the 7 on-body antennas.The result is a feature with the dimension equal to 101×7, where 101 is the number of the CFR data points from 3.75 to GHz frequency range, and 7 is the number of the on-body antennas.
In our study, we also rotate the capsule and maintain specific angles (0, 45, and 90 degrees ( o )), a virtual control mechanism is employed within the simulation environment provided by the CST software.This virtual manipulation technique allows us to precisely adjust the orientation of the capsule.Additionally, we use virtual fixtures to ensure that the capsule remains in the desired positions throughout the simulation.It is important to note that this manipulation is performed within the simulation software and not on a physical capsule device.
To train the SNN model, exhaustive pairs of all the training locations are used.If the pair is generated with the data from the same location, e.g., (FL, 0 o ) and (FL, 45 o ), the similarity score is set to 1; however, if the pair is generated with the data from different locations, the similarity score is set to 0.
In the testing phase, the testing data is paired with all the data from the training locations.The output similarity scores of all pairs are stacked to generate the vector s in Equation (14).The threshold t s = 0.55 is applied to the vector s to generate the score vector c.
The performance of the proposed method is measured in terms of distance error, d e , which is defined as where x, y, z and x, ỹ, z are the true and estimated x, y, z coordinates of the capsule, respectively.

IV. RESULTS AND DISCUSSION
In this section, we present the results of our proposed hybrid WCE localization method using the modified Laura human voxel model.We investigate two key aspects of the method: the effects of the number of zones (k) and the impact of antenna selection on localization accuracy.We also compare our results with the traditional trilateration method to highlight the improvements achieved by our approach.

A. EFFECTS OF NUMBER OF ZONES K
We systematically varied the number of zones k from 1 to 4 and carefully examined the associated distance errors.Here k = 1 represents the traditional trilateration method, where all training locations are in the same zone, and the path loss exponent n is computed from all the training locations.The distance error when the capsule is rotated by 0 o , 45 o , and 90 o are plotted in Figures.9 -11, respectively.The vertical bars indicate the minimum and the maximum distance errors, and the circle marker on the vertical bar indicates the mean distance error, respectively.In Figure 9, as we increase the number of zones k, the mean distance error consistently decreases.Using the traditional trilateration method, the mean distance error starts at 39.42 mm.When we set k to 2, the error decreases to 33.04 mm, reaching its lowest point of 26.44 mm at k = 3.At k = 4, the error slightly increases to 26.51 mm.Comparatively, the traditional trilateration method exhibits minimum and maximum errors at 18.96 mm and 57.52 mm, while our approach achieves errors ranging from 18.96 mm to 55.37 mm for k = 2, 7.48 mm to 51.56 mm for k = 3, and 7.48 mm to 51.56 mm for k = 4.These results underscore the effectiveness of our proposed method in consistently reducing mean distance errors with increasing zones (k).Notably, our method achieves a remarkable mean distance error of 26.44 mm at k = 3, outperforming the traditional trilateration method's mean distance error of 39.42 mm.Regarding the implications of distance errors, it is evident that the mean distance error exhibits a decreasing trend as the number of zones increases from 1 to 3, signifying enhanced localization accuracy.This improvement can be attributed to the method's adaptability to a more nuanced analysis with additional zones, resulting in a more accurate estimation of the capsule's position.However, a subtle increase in mean distance error from 26.44 mm to 26.51 mm when moving from k = 3 to k = 4 warrants careful consideration.
The marginal elevation in error observed during the shift from k = 3 to k = 4 can be ascribed to multiple contributing factors.One reason is that it becomes a bit more complicated when we add another zone.With more zones, the way we figure out the capsule's location has to deal with a larger amount of information.This can make things a bit trickier and might lead to some extra uncertainties and mistakes in the estimation process.So, in simple terms, having more zones at k = 4 makes the job a little more complex, causing a tiny increase in errors compared to when we have only k = 3.
Moreover, the rise in error observed when transitioning from k = 3 to k = 4 may be attributed to distinct characteristics inherent in the GI tract environment.This increase could be influenced by factors such as tissue properties, signal attenuation, or measurement noise, all of which may impart diverse effects on the accuracy of trilateration-based localization.These environmental factors become increasingly pronounced and complex as the number of zones expands.The additional zone introduces more intricacies into the localization process, where the algorithm must contend with an augmented set of measurements, potentially leading to heightened uncertainties and errors in the estimation procedure.In essence, the interaction between the number of zones and the unique attributes of the GI tract environment plays a pivotal role in shaping the observed increase in error during the transition from k = 3 to k = 4.
Despite the slight increase in error for k = 4 compared to k = 3, it is important to highlight that our proposed method still outperforms the traditional trilateration method, which yields a mean distance error of 39.42 mm.Our achieved mean distance errors of 26.44 mm for k = 3 and 26.51 mm for k = 4 demonstrate the effectiveness of our approach in improving localization accuracy in comparison.
Figures 10 and 11 share the same trend as Figure 9, where the mean distance error decreases as the number of zone k increases, and slightly increases when k = 4.For the capsule's rotation of 45 o and 90 o , the minimum distance error of the proposed method can be as low as 5.61 mm and 16.21 mm, whereas they are 21.51 mm and 21.70 mm for the existing method.

B. EFFECTS OF ANTENNA SELECTION
We compare the distance error when all antennas and only the top 4 antennas with the lowest path loss values are used in the calculation.The results are plotted in Figure 12.
Figure 12 shows a comparison of distance error in mm when the number of antennas used to perform trilateration is set to 4 and 7.Here the number of zones is set to 3 for all cases.The results are displayed in 3 sections, where the first one is the case where the capsule's orientation is at 0 o , and the other two are when the capsule's rotations are at 45 o and 90 o .Our study found that using 4 antennas resulted in lower mean and maximum distance errors compared to using 7 antennas.Trilateration based on 4 on-body antennas also offered the lower minimum distance error, except when the capsule was at a 90 o rotation.In this case, the error obtained from 4 onbody antennas was slightly higher than 7 on-body antennas, with a difference of 1.93 mm.This can be attributed to the fact that while 7 antennas are used for comprehensive coverage throughout the entire intestinal tract, only the 4 antennas with the strongest received power are used for calculations.These 4 antennas are chosen from the 7 based on received power.Our experiment comparing the use of 4 antennas versus 7 antennas found that the accuracy was greater when using 4 antennas.This is different from indoor localization, where more data from anchors can improve accuracy.The multipath in the in-body channel is much worse than in indoor environments, so using more antennas may not be beneficial as data from antennas with weaker received powers is likely to be inaccurate.Therefore, our finding showed that it is more effective to exclude data from these antennas in calculations.
For realistic human model, partitioning the GI tract into zones, and using the zone-specific parameters in the localization can significantly improve the accuracy when compared with the traditional trilateration method.Of course, if more training data are available, the extracted parameters would be a better representation of the actual environment, and the accuracy can be further improved.
The choice of antenna plays a crucial role in data collection.In environments with line-of-sight paths, utilizing multiple antennas can improve the accuracy of the data.In non-line-of-sight situations, however, the increased loss of signal strength may not necessarily indicate a greater physical distance from the on-body antenna, as it could also be caused by interference from multiple reflections and absorption by the body's tissues.
The findings validate the effectiveness of our proposed method in the context of realistic human models and underline the importance of incorporating zone-specific parameters and optimizing antenna selection to enhance localization accuracy during wireless capsule endoscopy.
In the following subsection, we further evaluate our proposed method and discuss its performance using the modified Laura model.

C. EVALUATION OF THE PROPOSED HYBRID WIRELESS CAPSULE ENDOSCOPY (WCE) LOCALIZATION METHOD USING THE MODIFIED LAURA MODEL
When assessing the trained classifier model using the modified Laura model with increased organ sizes, we observe a significant shift in the optimal number of zones to 4 (k = 4), as depicted in Figure 13.While maintaining an overall excellent performance that surpasses the traditional trilateration method, this shift suggests potential alterations in electromagnetic interactions within the GI tract due to modified organ sizes, influencing the optimal zone configuration for accurate localization.
It is noteworthy that, across various locations, the results reveal that both 4 and 5 zones exhibit superior and comparable performance.This finding underscores the adaptability of the approach, acknowledging variations across different locations.
Furthermore, it is crucial to recognize the complexity of electromagnetic interactions within the body, influenced by factors such as changes in organ size, tissue properties, and signal propagation, introducing variations in interaction patterns that impact localization accuracy.
In summary, the transition from 3 zones to the optimal configuration of 4 or 5 zones can be attributed to the modified characteristics of the GI tract environment resulting from changes in organ sizes.This underscores the method's sensitivity to environmental conditions and highlights the importance of adapting the approach.The observed similarity in results between 4 and 5 zones underscores the adaptability of the approach, acknowledging variations across different locations.It is worth noting that similar trends were observed for 45 o and 90 o scenarios, and for brevity, those results are not presented here.

D. SIMULATION REALISM AND RELEVANCE TO ACTUAL CAPSULE ENDOSCOPY PROCEDURES
In our study, the simulated results play a crucial role in providing insights into the challenges and dynamics inherent in actual capsule endoscopy procedures.While we acknowledge the inherent limitations of simulations in fully capturing the complexity of real-world scenarios, they serve as a valuable tool to assess the performance and feasibility of our proposed methodology in a controlled environment.
The challenges encountered in WCE, such as variations in path loss, shadowing, and fading due to the mobility of the capsule within the GI tract, are intricately simulated in our study.By utilizing the Dassault Simulia CST Studio Suite and realistic voxel models like Laura or the modified version, we aim to replicate the realistic conditions of the wireless channel within the abdomen and intestinal areas.This ensures that our simulation results are grounded in the known characteristics of the GI tract environment.
While direct empirical comparisons may not be feasible at this stage, our commitment is to provide a detailed and comprehensive narrative that effectively bridges the simulated outcomes with the expectations based on the existing understanding of wireless channel characteristics within the gastrointestinal tract.We will delve into the intricacies of our simulation settings, discussing how they align with the anticipated challenges and dynamics encountered during actual capsule endoscopy procedures.

E. LIMITATIONS OF THE PROPOSED METHODOLOGY
While our proposed hybrid WCE localization method demonstrates promising results, certain limitations should be acknowledged.The shift in the optimal number of zones, observed from 3 to 4 or 5, is attributed to the modified characteristics of the GI tract environment resulting from changes in organ sizes.This sensitivity to environmental conditions emphasizes the need for adaptability.Furthermore, the similarity in performance between 4 and 5 zones across various locations highlights the method's adaptability but warrants further investigation into the precise impact of zone configuration.Additionally, our study relies on simulated results, and though they provide valuable insights, empirical validations and clinical trials will be essential to confirm the methodology's effectiveness in real-world scenarios.

V. CONCLUSION
In conclusion, our novel hybrid WCE localization method demonstrates a superior performance compared to the conventional trilateration technique, underscoring a significant stride in accuracy.Of particular significance is the pivotal role of antenna selection, substantively contributing to a noteworthy maximum distance error reduction of 114.56 mm.Our comprehensive experimentation highlights the optimal number of zones K as 3, acknowledging potential variations contingent on the dataset.The intricacies governing achievable localization accuracy are intricately linked to factors such as the capsule's spatial coordinates, proximity to on-body antennas, and the distinctive patterns of these antennas.
Moreover, our localization method, incorporating insights from the modified Laura model featuring enlarged organ sizes, reveals a marked shift to an optimal configuration of 4 zones.This shift signifies nuanced alterations in electromagnetic interactions within the GI tract.Impressively, notwithstanding this adjustment, our approach consistently outperforms the traditional trilateration method, affirming its robust performance.
The adaptability inherent in our methodology is evident as both 4 and 5 zones exhibit superior and comparable performance across diverse locations, including scenarios at 45 o and 90 o .This adaptability, underscored by the observed consistency in results, attests to the method's resilience.Our emphasis on the method's sensitivity to environmental conditions, particularly influenced by organ size and tissue properties, accentuates its capacity to adapt and excel in varied settings, significantly influencing localization accuracy.
In summary, our hybrid approach, informed by insights from the modified Laura model, stands as a noteworthy advancement in wireless capsule endoscope localization.By presenting potential enhancements in accuracy across diverse GI tract environments, this study contributes substantively to the progressive landscape of medical interventions, providing a more precise and adaptable methodology for capsule localization.
In future investigations, we plan to conduct experiments using physical phantoms developed to model different body constitutions.Additionally, our close collaboration with Oulu University Hospital will facilitate the implementation of our method in patients during the subsequent phases, particularly as we progress towards the clinical trial stage.Our exploration will extend to techniques such as electromagnetic field mapping or 3D reconstruction, offering promising avenues for enhancement.These additional techniques not only contribute to a more comprehensive understanding of signal behavior within the gastrointestinal tract but also address computational complexity challenges associated with realtime localization.
For instance, electromagnetic field mapping can provide detailed insights into the spatial distribution of electromagnetic signals, aiding in refining our hybrid localization method.Advanced 3D reconstruction techniques, such as structure-from-motion or multi-view stereo, promise improved visualization of the capsule's position while also considering computational efficiency.
To further optimize our localization method, we will explore the integration of machine learning algorithms, sensor fusion, and analysis of wireless signal strength.These strategies, coupled with edge computing, can enhance real-time data processing and contribute to the overall accuracy of the system.
Moreover, incorporating realistic tissue models and addressing localization in dynamic environments are crucial aspects of our future investigations.These endeavors will not only contribute to a more robust validation but also ensure the adaptability and precision of our method across diverse conditions, emphasizing its potential applicability in realworld scenarios.

CONFLICT OF INTEREST STATEMENT
''Authors declare that there is no conflict of interest.''

FIGURE 1 .
FIGURE 1. Process flow of the proposed method.

FIGURE 5 .
FIGURE 5. Antenna reflection coefficients for on-body antenna (as located on the voxel) and capsule antenna (as located inside the voxel's small intestine)[26],[30].

TABLE 4 .
Training and testing data setup.

FIGURE 9 .
FIGURE 9. Comparison of the distance errors when number of zones k = 1, 2, 3, and 4, and the capsule is at 0 o rotation.

FIGURE 10 .
FIGURE 10.Comparison of the distance errors when number of zones k = 1, 2, 3, and 4, and the capsule is at 45 o rotation.

FIGURE 11 .
FIGURE 11.Comparison of the distance errors when number of zones k = 1, 2, 3, and 4, and the capsule is at 90 o rotation.

FIGURE 12 .
FIGURE 12.Comparison of the distance errors when number of antennas is 4 and 7 when the capsule is at 0 o , 45 o , and 90 o rotation.

FIGURE 13 .
FIGURE 13.Comparison of the distance errors when number of zones k = 1, 2, 3, 4, and 5, and the capsule is at 0 o rotation for the modified Laura model.

TABLE 1 .
Zone parameters lookup table.