A Novel Algorithm for Scenario Recognition Based on MEMS Sensors of Smartphone

The scenario is very important to smartphone-based pedestrian positioning services. The smartphone is equipped with MEMS(Micro Electro Mechanical System) sensors, which have low accuracy. Now, the methods for scenario recognition are mainly machine-learning methods. The recognition rate of a single method is not high. Multi-model fusion can improve recognition accuracy, but it needs to collect many samples, the computational cost is high, and it is heavily dependent on feature selection. Therefore, we designed the DT-BP(decision tree-Bayesian probability) scenario recognition algorithm by introducing the Bayesian state transition model based on experience design in the decision tree. The decision-tree rules and state transition probability assignment methods were respectively designed for smartphone mode and motion mode. We carried out experiments for each scenario and compared them with the methods in the references. The results showed that the method proposed in this paper has a high recognition accuracy, which is equivalent to the accuracy of multi-model machine learning, but it is simpler, easier to implement, requires less computation, and requires fewer samples.


Introduction
With the rapid development of Micro Electro Mechanical System(MEMS)sensors, the smartphone is equipped with an inertial measurement unit (IMU), barometer and magnetometer, which provide new and cheap approaches to smartphone-based pedestrian positioning services. Now, it has penetrated all aspects of people's lives. However, because of the complex scenarios faced by the smartphone, obtaining a high-precision position based on the smartphone is still a challenge. The complex scenarios include the diversity of smartphone carrying modes, pedestrian movement modes, and the accuracy limitations of smartphone built-in sensing, which are all factors that affect the accuracy of pedestrian positioning. Contextual information is very important to the positioning system. It not only affects the types of available signals, but also provides more information for positioning, and provides an important basis for positioning methods, the selection of fusion algorithms, and failure detection. Therefore, it is necessary to identify different scenarios and choose different coping strategies for different scenarios to obtain high-precision pedestrian positioning results.
At present, pedestrian motion mode recognition is mainly divided into two research directions: one is based on image processing technology, which converts the input image or video into feature vectors, and then recognizes the motion mode [1,2]. However, it is easily infringes on personal privacy and relies heavily on light conditions [3]. The other is based on various sensors, such as accelerometers, gyroscopes, gravimeters, barometers, etc., that collect sensor data, extract various features, and classifying features. Then, various methods are used to recognize the movement pattern. Machine learning methods are mostly used for motion pattern recognition based on sensors, such as support vector machine (SVM) [4], k-nearest neighbor algorithm (KNN) [3], Gaussian naive Bayes (GNB), Micromachines 2022, 13, 1865 2 of 14 and artificial neural network (ANN). The average recognition success rate can reach more than 80%. For example, Sun Bingyi et al. [5] proposed a behavior recognition method based on the SC-HMM algorithm, which can classify up and down stairs and elevators with a classification accuracy of more than 80%. Jin-Shyan Lee et al. [6] proposed a thresholdbased classification algorithm for carrying phone mode with an acceleration value, which is very simple and easy to achieve. Qinglin Tian et al. [7] proposed a finite state machine (FSM) to classify the smartphone mode with a classification accuracy of more than 89%.
Other scholars have tried to combine different models to improve recognition performance. Liu Bin et al. [8] combined four typical methods: k-nearest neighbor algorithm, support vector machine, naive Bayesian network, and the AdaBoost algorithm based on a naive Bayesian network to create a human activity recognition model. The optimal human activity recognition model was obtained through model decision-making, and the accuracy reached 92%. Using support vector machine (SVM) and decision tree (DT), any combination of motion state and mobile phone postures could be successfully identified [9] with an average success rate of 92.4%. Other scholars combined convolutional neural network (CNN) and long-term and short-term memory (LSTM) network to recognize walking, sitting, and lying behaviors for wearable (tied-to-the-waist) devices, with a success rate of over 96% [10,11]. In addition, some scholars used other methods to realize motion pattern recognition, such as the implicit Markov model [12,13], the sensor data interception method based on last bit matching [14], and the voting method [15]. Some scholars have also studied the influence of window length on human motion pattern recognition, to choose the optimal window length [16,17].
Ichikawa et al. [18] studied the ways people like to use mobile phones. The common locations of mobile phones are trouser pockets, clothing pockets, hand-held and so on. Scholars have explored various methods to identify the common locations, that is, to identify the location of the mobile phone. Yang et al. [19] proposed PACP (Parameters Adjustment-Corresponding-to-smartphone position), a method that is independent of the smartphone mode. It uses the SVM (support vector machine) model to identify the smartphone mode with an accuracy rate of 91%. Deng et al. [20] proposed to recognize the location of mobile phones based on accelerometer features, and tested the recognition results based on SVM, Bayesian network, and random forest. Noy et al. [21] used KNN, decision tree, and XGBoost to test and compare, and showed that XGBoost has the best recognition success rate. Wang [22] proposed a recognition method of the superimposed model, which combines the six models of AdaBoost, DT, KNN, LightGBM, SVM, and XGBoost to realize the location recognition of smartphones, and the recognition accuracy can reach 98.37%.
In general, the methods for scenarios recognition mainly focus on machine learning methods, such as SVM, CNN, KNN, etc. These methods have a low recognition accuracy rate when recognizing based on raw data, and when recognizing based on sensor features, they have a strong dependence on feature selection. The fusion of multiple models can improve the recognition accuracy, increasing the complexity of calculations and requiring a large number of samples. In addition, the calculation cost is large, and the choice of features is heavily dependent.
To solve this problem, we designed a DT-BP (decision tree-Bayesian probability) scenarios recognition algorithm by using a single model decision tree and a Bayesian state transition model, which aims at motion mode and smartphone mode. This method is more simplified, less computationally expensive, and less computationally complex, and can obtain the same recognition accuracy as the multi-model machine learning method. The contributions of this study are as follows:

•
We designed a decoupling analysis method to analyze the relationship between e different kinds of scenario, so as determine the identification order. As the interactions of different scenario are categorised, adverse effects on scenario recognition occur. Therefore, a decoupling relationship analysis method was designed to decouple different scenario categories and determine the sequence of scenario type identification; • We designed a DT-BP (decision tree-Bayesian probability) scenario recognition algorithm by using a single model decision tree and a Bayesian state transition model, which aimed at motion mode and smartphone mode. This method is more simplified, less computationally expensive, and less computationally complex, and can obtain the same recognition accuracy as the multi-model machine learning method; • We designed the corresponding decision tree criteria and probability allocation method for smartphone mode and motion mode. We carried out experiments for each scenario and compared them with the methods in the references.
The rest of this paper is organized as follows: Section 2 introduces the presented algorithm, including decoupling analysis, feature extraction and scenario recognition algorithm. Section 3 shows the experimental setup, results and discussion. And finally, Section 4 concludes the paper.

Decoupling Analysis of Scenario Category
It is necessary to analyze the decoupling relationship of different scenario categories to determine their independence and correlation. For example, if there are nk motion modes, mk smartphone modes, there are nk × mk kinds of situations in any combination of the two kinds of contexts. It is too complicated and redundant to identify all the combined scenarios. And as the interaction of different scenario is categorized, adverse effects on scenario recognition occur. Therefore, a decoupling relationship analysis method was designed to decouple different scenario categories and determine the sequences of scenario type recognition.
The decoupling of smartphone modes and motion modes needs to be analyzed in three parts:

•
The correlation coefficient of the same motion mode in different smartphone modes; • The correlation coefficient of different motion modes in the same smartphone mode; • The correlation coefficient between different smartphone modes and different motion modes.
We used Pearson's correlation coefficient to analyze the decoupling of the data. The calculation formula of the correlation coefficient is as follows: where r is the correlation coefficient, n is the length of the data, x i , y i which are two different time series.
As the data sampling length in different situation is different and the data contains the periodic behavior of pedestrian movement, it was necessary to establish a time-lag series [23]. The sequence (X, Y) = {(x i , y i ), i = 1, 2, . . . , n}, after moving forward and backward by m sampling points is: If the time-shift sequence is correlated, it must exist m 0 (1 ≤ |m 0 | ≤ n, |m 0 | ∈ N + ) to maximize the correlation coefficient of (X t , Y t+m 0 ).
To decouple different scenario categories, the following analysis method was used: (1) To avoid dependence on feature selection, raw data were selected for data analysis; To ensure a full analysis of different scenario categories, it was necessary to exclude other factors as far as possible, such as pedestrian differences, smartphone brand differences, etc. Therefore, the window length n shall meet the pedestrian movement cycle, generally 0.5-1.2 s. The calculation method of window length n is as follows: where T n is the window period, generally bigger than 2 s. ∆t is the sampling period, which depends on smartphone's brand and model. [] means round numbers.
(2) To ensure the integrity of pedestrian motion cycle, the forward and backward sampling points m should be selected as: (3) To ensure the analysis is not disturbed by abnormal data, the sliding window is used to calculate the correlation coefficient r, which is = r i (i = 1, 2, . . . , k), k = [N/n], and N is the sampling length of data. The decoupling analysis correlation coefficient is (4) To analyze the decoupling correlation different scenario categories, we set r x i,j , y u,v = r. Where i and u represent the smartphone mode, j and v represent the motion mode. y u,v and y u,v are two kinds of scenario. To obtain the analysis result we needed to analyze three situations as follows: The test results are shown in Table 1, which gives the correlation calculation results of a total of nine scenarios composed of three motion modes and three smartphone modes. The raw data include GNSS sensor, accelerometer, gyroscope, magnetometer, barometer, and Bluetooth. According to the test results in Table 1, the decoupling correlation can be summarized as follows: Micromachines 2022, 13, 1865

of 14
From Formula (7) we know that the correlation between different motion modes has a certain correlation under the same smartphone mode. In the case of different smartphone modes, the correlation of the same motion mode is greater than 0.5. The correlation between different smartphone modes and different motion modes was very low, and less than 0.3. So, smartphone modes have little influence on motion mode recognition. On the contrary, motion modes have a great influence on smartphone mode recognition.
According to the above analysis, during scenario recognition, we can recognize the motion mode first. And when this is determined, the smartphone mode is recognized secondly.

Feature Extraction
In this paper, we extracted features from different sensor data in both the time domain and frequency domain, respectively. The time-domain refers to the extraction of the mathematical-statistical characteristics of the sensor measurement data in a certain window length, such as variance, mean, amplitude, etc. The frequency domain refers to the calculation of the Fourier transform and frequency domain entropy of the sensor measurement data in a certain window length. Then, the features in the frequency domain were extracted, such as dominant frequency, energy, frequency difference, etc.
As shown in Table 2, the time-domain features extracted from active sensors were used in this paper. Where n 1 , n 2 , n 3 , n 4 , n 5 , n 6 is the length of the data window, x i , y i , z i is the sampling data, x is the mean value, i,j,k are the times at different sampling points, s k is the value that the data in the window length n 4 is greater and smaller than the threshold value thre zero , thre −zero . Table 2. Feature extraction in time domain and frequency domain [24].

Feature Definition
First-order norm . . , n 1 Difference of Peaks and Wave a mm = a max − a min Mean The height gradient value [25,26] is calculated by the raw data of barometer as: where t is the temperature, and the unit is • C. p 0 is the reference air pressure and p is the output of the barometer.

Design of Scenario Recognition Algorithm Based on DT-BP
The decision tree (DT) establishes the nodes by exploring the high-value data features in the overall data and constructs the branches of the tree according to the required research contents. With repeatedly establishing the branch nodes, the classification results and decision set contents are displayed with the tree structure [27,28]. The decision tree has the advantages of low computational complexity and is insensitive to missing content in the middle. It can handle irrelevant feature data [29]. Decision trees also have shortcomings, such as low detection accuracy and the work needed for the preprocessing of time-sequential data. In the actual environment, due to the complexity of the environment, the different interference, the performance of different devices, the error accumulation of the sensor itself, etc., the error in the identification process is so relatively large that the usability is not high. To deal with this problem, we designed a context recognition method based on the decision tree and Bayesian state transition probability (decision tree-Bayesian probability, DT-BP).
Bayes theory is a common method in model decision-making. The basic idea is to know the conditional probability density parameter expression and a priori probability, convert the formula into a posteriori probability, and finally use a posteriori probability for decision classification.
If P(A) is a priori probability or edge probability of A. the conditional probability of A after the occurrence of B is P(A|B ), which is called the posterior probability of A. P(B|A ) is the conditional probability of B after the occurrence of A, which is called the posterior probability of B. P(B) is the prior probability of B [30]. Then For the situation recognition in this paper, we suppose T i as the situation category, and T i ∈ Γ(b 1 , b 2 , . . . , b u ). Where U is the number of situations. We assume S f as the feature quantity set, and S f = {a 1 , a 2 , . . . , a V }. Where V is the number of features. If the features of S f all belong to T i , the probability is P T i S f . When it is satisfied P T k S f = max i=1,··· ,K P T i S f , it is considered S f ∈ T k , which means the recognition is successful.
Therefore, we only need to calculate P T i S f to recognize context. The Formula (9) is changed to: To obtain the conditional probability of the scenario T i , we need to calculate P S f , P(T i ) and P S f |T i . The principle of probability allocation in this article: the number of features quantities is V, and the probability of each feature quantity is the same, which means P S f is a constant. So P T i S f is the largest when P(T i )P S f |T i is the largest. That is where P(T i ) is the state probability. Its value at the current moment is related to the number of scenarios to be detected and the probability of the previous moment. It is independently designed according to different scenario categories and the number of scenarios U. P S f |T i is the conditional probability of the feature vector S f , which is obtained from DT rules. The obtaining algorithm designed in this paper is as follows: where K i represents the number of features related to the category T i . c j is the judgment value of each feature. If the judgment condition is met, it is c j = 1, otherwise is c j = 0.

Recognition of Smartphone Mode Based on DT-BP (1) Algorithm design based on decision tree
To realize the recognition of different smartphone modes, it is necessary to detect the transformation process between different smartphone modes, which determines whether the smartphone mode is transforming or fixed. When it is in the fixed position, the different smartphone mode is determined. There are two parts of mobile phone location recognition: transformation recognition and current location recognition. In this paper, we took six common smartphone modes [18] as examples to design the specific decision tree, including texting, calling, pants front pocket, clothes pocket, pants back pocket and hand swing, as shown in Figure 1.
where i K represents the number of features related to the category i T . j c is the judgment value of each feature. If the judgment condition is met, it is 1 j c = , otherwise is 0 j c = .

Recognition of Smartphone Mode Based on DT-BP
(1) Algorithm design based on decision tree To realize the recognition of different smartphone modes, it is necessary to detect the transformation process between different smartphone modes, which determines whether the smartphone mode is transforming or fixed. When it is in the fixed position, the different smartphone mode is determined. There are two parts of mobile phone location recognition: transformation recognition and current location recognition. In this paper, we took six common smartphone modes [18] as examples to design the specific decision tree, including texting, calling, pants front pocket, clothes pocket, pants back pocket and hand swing, as shown in Figure 1. According to the data characteristic analysis and feature analysis, the variance of the first-order norm of acceleration was used as the criterion for judging the position change of the mobile phone. The first-level decision criterion for the decision tree is: According to the data characteristic analysis and feature analysis, the variance of the first-order norm of acceleration was used as the criterion for judging the position change of the mobile phone. The first-level decision criterion for the decision tree is: i f var(ax) > Thre&var(ay) > Thre&var(az) > Thre, changing = 1 others, changing = 0 (13) where Thre is the threshold. When changing = 1, the location is changing, otherwise it is not. When the position is fixed, it is necessary to determine whether there is periodic oscillation, which means there are other periodic motions besides walking and swinging with the pedestrian. We use the second main frequency amplitude of the acceleration amplitude to determine it. The second-level decision criterion of the decision tree is: where Thre m f 2 is the threshold. When per = 1, the position of the mobile phone has periodic movement, otherwise it is not. If the smartphone location with periodic movement, the judgment criterion is as follows: where Thre m f is the threshold. When swpp = 1, the position is pants pocket(pp), otherwise it is swinging. As the features of the front pants pocket(fpp) and back pants pocket(bpp) is similar, there is a new branch for them, and the decision criterion is: where M is the window length, Thre qh is the threshold.
(2) Probabilistic design based on DT-BP method According to the design of the DT-BP method, we needed to design P(T i ) and P S f |T i to calculate the probability distribution principle. The number of scenarios U is 7, including 6 smartphone positions and the change process. P(T i ) is designed as shown in Table 3. According to the design of the decision tree, the number of features V is 10. The design of K i in Formula (12) is as follows in Table 4.

Recognition of Motion Mode Based on DT-BP
(1) Design of motion mode recognition algorithm based on decision tree In this paper, the recognition algorithm is designed by taking the motion modes of static, walking, turning, going upstairs and downstairs, escalator, and elevator as examples. According to the analysis of the extracted features, the dynamic and static are distinguished by the acceleration variance. We used positive and negative zero-crossing rates of acceleration air pressure gradients as the features of static, elevator and escalator recognition. Dynamic motion includes walking on the ground, going upstairs, going downstairs and turning. Walking, turning, going upstairs and downstairs are coupled movements, that is, turning and going up and down stairs also have walking movements. Therefore, the main work was to distinguish turning and going up and down stairs from walking. The amplitude of angular velocity is used to recognize turning. We used the auto-correlation coefficient, Fourier dominant frequency, and elevation gradient to recognize going up and down stairs and walking, as shown in Figure 2. nition. Dynamic motion includes walking on the ground, going upstairs, going downstairs and turning. Walking, turning, going upstairs and downstairs are coupled movements, that is, turning and going up and down stairs also have walking movements. Therefore, the main work was to distinguish turning and going up and down stairs from walking. The amplitude of angular velocity is used to recognize turning. We used the auto-correlation coefficient, Fourier dominant frequency, and elevation gradient to recognize going up and down stairs and walking, as shown in Figure 2. When it is static, it is necessary to distinguish between static and elevator and escalator. We use the zero-crossing rate of acceleration amplitude as judgment, and the judgment criterion is:   The process of motion mode recognition based on the decision tree method is as follows: (a) If var(a) is greater than the threshold Thre a , it is considered dynamic, otherwise, it is static. (b) When it is static, it is necessary to distinguish between static and elevator and escalator.
We use the zero-crossing rate of acceleration amplitude as judgment, and the judgment criterion is: where a k = svm a − g, svm a is the amplitude of acceleration and g is the acceleration of gravity. p + (a k ) and p − (a k ) is the positive and negative zero-crossing rate. Thre +el and Thre −el are the zero-crossing judgment threshold. If f lag el = 0, it is going up or down elevator. (c) When the motion is the elevator, we judge whether going up or down. If f lag el = 1 and the previous state is not the elevator, the state is going up elevator. If f lag el = 1 and the previous state is the elevator, the state is going down elevator. If f lag el = −1 and the previous state is not the elevator, the state is going down elevator. If f lag el = −1 and the previous state is the elevator, the state is going up elevator. (d) If f lag el = 0, it is further recognized whether it is an escalator, and the recognition criteria are as follows: where dbro is the pressure gradient, p + (dbro) and p − (dbro) are the positive and negative zero-crossing rates of the pressure gradient. Thre +es and Thre −es are the thresholds. When f lag es = 0, it is the static state. If f lag es = 1, the escalator is going up. If f lag es = −1, it is the elevator is going down. (e) When pedestrians are in a dynamic state, we mainly distinguish turning, stairs, and walking. The angular velocity amplitude is used to recognize turning. When svm w > Thre w , it is turning. (f) We use the auto-correlation coefficient and Fourier transform to distinguish stairs and walking. The auto-correlation coefficient at the offset k = 2 and k = 4 as the judgment value, and the main frequency of the Fourier transform as the judgment condition. The criterion is as follows: where R a (2) is the correlation coefficient of the acceleration amplitude offset k = 2. F a represents the main frequency of the Fourier transform. Thre f a is the main frequency judgment threshold. If f lag st = 1, it is up and downstairs, otherwise it is walking on level ground. (g) When pedestrians are going up and down the stairs, we use the height gradient value to make judgments. The criterion is as follows: where Thre h and Thre −h are the judgment thresholds of the height gradient. If f lag h = 1, it is going up the stairs. If f lag h = −1, it is going down the stairs.
(2) Probabilistic design based on DT-BP method For the nine motion modes in the above example, the probability P(T i ) of each state in the DT-BP method is determined according to the previous state. The transition probability between each motion mode is shown in Table 5. According to Figure 2 and the decision tree rules, the number of features V is 12, as shown in Table 6 for the design K i in Formula (12).

Experimental Setup
To understand the effectiveness and limitations of our proposed Scenario recognition algorithm, we conducted an implementation on Android to collect data. During the experiment, we collected data using an Android smartphone (Huawei mate 8, whose parameters are shown in Table 7), which was equipped with a three-axis accelerometer and a three-axis gyroscope. We evaluated the proposed method in six common smartphone modes (texting, calling, pants front pocket, clothes pocket, pants back pocket and hand swing) and nine natural motion modes (static, walking, turning, upstairs and downstairs, up escalator, down escalator, up elevator and down elevator). The threshold of smartphone mode and motion mode in the experimental are shown in Table 8. We compared the proposed algorithm with state-of-the-art algorithms.

Experimental Results of Smartphone Mode Recognition
To test the algorithm of smartphone mode recognition, we collect text, calling, front pants pocket, back pants pocket, clothes pocket, and hand-held positions, respectively. There was a total of 9901 epoch data, including 568 epoch data in the changing, 2691 epoch data in texting, 1236 epoch data in calling, 2095 epoch data in the front pants pocket 1512 epochs in the back pants pockets, 1561 epochs in clothes pocket and 238 epochs in swing.
The accuracy of smartphone mode recognition is shown in Table 9. The recognition accuracy was calculated with the following formula: where Num reco is the number of epochs where the state recognition result is the same as the state to be recognized. Num true is the actual number of epochs in the state to be recognized. The results were similar to Table 9 in many tests. The average recognition accuracy was 99.06%, the lowest accuracy was 96.48%, and the recognition accuracy of all positions was greater than 96%. The main reason is that the smartphone mode changing was followed by various fixed smartphone modes. The error of various smartphone modes will be reflected in the smartphone mode changing. The comparison of the recognition accuracy of the algorithm in this paper with other different algorithms [20,31] is shown in Table 10. From the table, the random forest has the highest accuracy when texting and calling. DT-BP has the highest success rate in hand-held. The average accuracy in this paper is slightly higher by 0.5%. Compared with other methods based on machine learning, the DT-BP proposed in this paper has a slightly higher recognition accuracy, and takes 0.51 s in total, while the random forest takes 8.34 s.
The algorithm in this paper greatly reduces the operation time and ensures the recognition success rate.

Experimental Results of Motion Mode Recognition
We collected static, walking, up and down stairs, elevator up and down, and escalator up and down data, respectively, to test DT-BP. There was a total of 6789 epoch data, including 3239 epochs in static, 2005 epochs in walking, 173 epochs in up the stairs, 165 epochs in down the stairs, 317 epochs in up the elevator, 319 epochs in down the elevator, 145 epochs in up the escalator, and 426 epochs in down the escalator. The recognition accuracy was calculated by the Equation (22).
The accuracy of motion recognition is shown in Table 11, which was similar to many tests. The average recognition accuracy of DT-BP was 97.3%, and the lowest was 88.73%, which is down escalator. The main reason is that there is a parallel stage of the escalator when getting on the escalator and preparing to get off the escalator. During this period, the speed is uniform. It is difficult to recognize as the speed is submerged in the noise of acceleration. The accuracy of the elevator going up and down and turning is the highest, mainly because the acceleration change characteristics are obvious in these states. Since the intermediate transition state of each motion process is static, it will be considered static when detecting errors in the other eight states. Therefore, there will be more states of detecting errors at rest.  To further analyze DT-BP proposed in this paper, it is compared with other algorithms [9,10,[32][33][34], as shown in Figure 3. The recognition accuracy using a single machine learning model was relatively lower. For example, SVM and KNN are both more than 80%. The recognition success rate using multiple models will significantly improve with increases in algorithm complexity and calculation cost. The accuracy of DT-BP is the same as the method of machine learning using multiple models, and the computational complexity and computational cost are significantly reduced. To further analyze DT-BP proposed in this paper, it is compared with other algorithms [9,10,[32][33][34], as shown in Figure 3. The recognition accuracy using a single machine learning model was relatively lower. For example, SVM and KNN are both more than 80%. The recognition success rate using multiple models will significantly improve with increases in algorithm complexity and calculation cost. The accuracy of DT-BP is the same as the method of machine learning using multiple models, and the computational complexity and computational cost are significantly reduced.

Conclusions
At present, the methods for scenario recognition are mainly machine-learning methods. The recognition accuracy of a single model is not high. Multi-model fusion can improve recognition accuracy. However, the computational cost is high, and it is heavily dependent on feature selection. We mainly focused on two types of contexts: sports mode, and mobile phone location to design a DT-BP recognition algorithm by introducing the Bayesian state transition model based on experience design into the decision tree. It is more simplified and easier to implement and has less computation and lower computational complexity. In addition, it can obtain the same recognition accuracy as the multimodel machine learning method.

Conclusions
At present, the methods for scenario recognition are mainly machine-learning methods. The recognition accuracy of a single model is not high. Multi-model fusion can improve recognition accuracy. However, the computational cost is high, and it is heavily dependent on feature selection. We mainly focused on two types of contexts: sports mode, and mobile phone location to design a DT-BP recognition algorithm by introducing the Bayesian state transition model based on experience design into the decision tree. It is more simplified and easier to implement and has less computation and lower computational complexity. In addition, it can obtain the same recognition accuracy as the multi-model machine learning method.