# Recurrent Neural Network-Based Hybrid Localization for Worker Tracking in an Offshore Environment
## 3 Materials and Methods
### Structure of RHLS  
Figure 2 shows the structure of the RHLS method. When user tracking is in progress, the user's smartphone periodically scans the Wi-Fi signal through the built-in module. At the same time, geomagnetic and acceleration sensors also periodically collect data. RHLS uses pedestrian dead reckoning (PDR) for continuous positioning, which provides the values of geomagnetic, acceleration, and gyroscope sensors to the PDR module to calculate step detection, stride length, and direction of movement, respectively. The calculated values are provided to the recurrent network-based positioning module along with Wi-Fi signal data and geomagnetic sensor values. The positioning module calculates the positioning result based on the received sensor values. The positioning server in Figure 2 is located offshore. Owing to the nature of a ship, unlike on land, it is difficult to provide an internet environment continuously. Therefore, communication between modules is performed using the onboard network of the ship. However, the location server is not necessarily separated from the user device. That is, it may be embedded in the user's device depending on the implementation. Figure 1: Positioning time of each sensor over time (geomagnetic data have an approximately 100-ms positioning period, with other sensors exceeding this speed). RHLS provides geomagnetic, accelerometer, and gyroscope data to the positioning module, but sensors can also be used or removed depending on the implementer's choice. The wireless signal is not limited to Wi-Fi, and a wireless signal capable of deriving an absolute position, such as Bluetooth, can be added. On the other hand, in RHLS, the module that scans the radio signal and the module that reads sensor data operate independently of each other. When the Wi-Fi signal is scanned or the PDR module detects a step, RHLS immediately passes the collected geomagnetic values to the recurrent network positioning module. Geomagnetic data appear as values along three axes, \(x\), \(y\), and \(z\), according to rules set inside the device. Most smartphone geomagnetic modules are designed to have this structure. The three-axis value measured by the geomagnetic sensor indicates a vector relative to magnetic north. When the pose of the smartphone changes, the value of each axis changes. In other words, if the three axes continuously change when performing absolute positioning, the ambiguity becomes worse. Therefore, the proposed method includes a process of converting the magnetic field vector into a pose-independent value based on the theory below. There are three types of values that can be calculated from magnetic field vectors: magnetic intensity, magnetic inclination, and magnetic declination. In Figure 3, the only axis clearly shown is the one that points to the ceiling from the center of Earth, and the surface is perpendicular to this axis. The magnitude of the magnetic field strength is calculated using the Euclidean norm of the magnet vector. That is, the strength of the magnetic field is constant depending on the location, regardless of the pose. The degree to which the magnetic field vector sinks toward the surface is called the magnetic inclination. To find this value, the angle between the gravity vector and the magnetic field vector is calculated, before subtracting \(90^{\circ}\). This value is also not affected by pose. The gravity vector can be calculated by any smartphone with a built-in accelerometer, and it can be determined relatively accurately using the built-in gyroscope. Finally, the magnetic declination means the angle between the vector generated when the magnetic field vector is projected onto the surface and the vector pointing true north. However, because there is no way to know true north using an internal sensor, this value cannot be used. Therefore, in RHLS, magnet vectors, which can use vector values regardless of poses and magnetic inclination values, are used for positioning. Figure 2: Structure of the proposed method.