# A Fast Indoor/Outdoor Transition Detection Algorithm Based on Machine Learning
## 1 Introduction  
Indoor/outdoor (IO) context sensing plays a vital role for numerous applications, for example, human localization and tracking [1; 2; 3; 4; 5], activity recognition [6; 7] and transportation mode [8; 9; 10], power management and medical care [11]. For seamless positioning and navigation [12; 13], IO detection is a bridge between indoor and outdoor localization. To improve positioning accuracy and reduce power consumption, multi-source fusion positioning system triggers specific positioning and fusion strategies according to the results of IO detection. Smartphones automatically adjust screen brightness according to the IO status and environment condition (e.g., time, weather). The IO status provides personalized service such as adaptively adjusting the device volume. According to World Bank statistics, the number of current smartphone users is 4.57 billion, and this is expected to grow to 4.78 billion by 2020 [14]. Recently smartphones are equipped with a variety of sensors as well as powerful processor and storage capabilities. The smartphone-based IO detection mainly benefits from the extensive use of smartphones--consumers always carry smartphones. To provide context-aware information, a lot of previous methods focused on IO detection in a variety of environments have done. The methods are classified into two categories: fixed detection rules or thresholds-based techniques, and machine learning-based techniques. The first category uses fixed detection rules and thresholds such as a sensor reading above a certain value are considered a state. [PERSON] et al. [15] and IODetector [16] leveraged smartphone built-in sensors including proximity, light sensor, accelerometer, magnetometer, and cell tower RSS to distinguish between outdoor, semi-outdoor and indoor environments. These were two similar related works, as they utilized hard thresholds in light detector, cellular detector and magnetism detector, and then fused the detection results of each sub-module by Hidden Markov Model (HMM) [17], and achieved a recognition accuracy of above 88% and 92%, respectively, in their campus and city areas. Both mentioned the above algorithm depends on the measurements of a large number of visible neighbor cellular towers. However, most current smartphones do not support recording measurements from all neighboring cellular towers. [PERSON] et al. [18] presented an IO detection technique that leveraged the low power iBeacon technology to discriminate between semi-outdoor and indoor environments. Their test environment is the beacon placement environment on campus and the recognition accuracy reached 96.2%. [PERSON] et al. [19] presented a lightweight IO detection based on Wi-Fi RSS signals and a light sensor. The Wi-Fi sub-detector utilized AdaBoost [20] and the light sensor module utilized the threshold to detect the environment separately, and then a semi- conditional random field (CRF) algorithm was used to aggregate the Wi-Fi and light sensor results. The evaluation results showed that the IOS detector can achieve over 96% accuracy in the FIT Building at Tsinghua University, Xidan Street, and CETC office building environments. SatProbe [21] only used the number of GPS visible satellites as a more direct indicator of IO status. They collected 79 segments of raw GPS traces, with 2595 randomly sampled points for detection test and the overall detection accuracy of SatProbe is 85.6%. [PERSON] et al. [22] extracted the number of visible satellites that CNR more than 25 dB-Hz and the sum of all visible satellites CNR that more than 25 db-Hz based on the availability and strength of GNSS signals (GPS and GLONASS) as features. Then, a Hidden Markov Model was used to infer the current environment types (indoor, intermediate and outdoor) according to those extracted features and the proposed environmental context detection method is tested in the city of London as a whole, achieving an overall 88.2% accuracy. Meanwhile, GNSS signals received from GNSS receivers had also been used for IO detection [23].