• 沒有找到結果。

Training phase is to obtain the features of human behaviors in advance for further detection. We call the features of human behaviors training pattern. After we obtain the training patterns, we add them into the training pattern database. Training pattern database is a database containing the training patterns obtained from the training process. These data represents the behaviors and will be used for matching in online phase. We have two steps in this process: data filtering and training pattern formation. Firstly, data filtering is to do filtering in order to reduce noise, such as low pass filter. Then, we will obtain and segment the measurements into the feature of human behaviors from observation. Finally, we form a training pattern by defining the pattern and the method of transforming into a desired pattern. In the following, we introduce the three steps of Training Processes and explain them in both elevator detection and stairs detection.

5.3.1 Data Filtering

Filtering step is to process the data we obtain from IMU sensors. In this step, we process the data in order to reduce the noise of data and transform the data into the form that will be used in training pattern formation step.

Elevator Detection

In the data filtering step of elevator detection, we process our patterns by low pass filter(LPF).

low pass filter can be addressed as following equation:

a0i := α × ai+ (1 − α) × a0i−1 (5.1) aiis the i-th element before LPF processing. a0iis the i-th element after LPF processing. a0i−1is the (i-1)-th element after LPF processing. α is a parameter controlling the frequency to be cut off. We use low pass filter to filter out the high frequency noise. During our observation, since frequency of walking is much higher than the frequency of elevator’s movement, we can filter out the noise which walking may make as in Fig. 5.2.

Training Phase – Data Filtering

• Low Pass Filter (Optional)

– Eliminate the noise from walking.

a’

i

:= α × a

i

+ (1-α) ×a’

i-1

• Other Filters, such as High Pass Filter (Optional)

α=0.05

Figure 5.2: Low Pass Filter reduces high frequency noises.

Stair Detection

In the data filtering step of stair detection, according to the observation, the stair behavior mea-surement of pitch value is clear enough so that no filtering is needed in stair detection.

5.3.2 Training Pattern Formation I: Pattern Segmentation

Pattern segmentation step is to obtain the useful data for determining specific human behaviors.

In this step, we focus on what measurement should be used and what should be obtained for detection.

Elevator Detection

In the pattern segmentation step of elevator detection, we use the vertical acceleration measure-ment to obtain the all combination of the elevator’s moving pattern. For example, if there’s an elevator which can move from the first floor to the third floor, we then record the up 1 floor pat-tern, up 2 floor patpat-tern, down 1 floor pattern and down 2 floor pattern. During our observation,

the elevator moving up 1 floor will all be similar when the floor height is the same. However, during the case of different floor heights, more patterns will be needed. For example, same as the elevator in the previous example, we need the pattern up from first floor to second floor and the pattern up from the second floor to third floor instead of the up 1 floor pattern in the previous example. We record patterns of every elevator we need to detect.

Stair Detection

In the pattern segmentation step of stair detection, we use the pitch measurement to obtain the features used in stair detection. In this step, we obtain three types of human behavior related to stair detection including walking upstairs, walking downstairs and walking on the floor. During our observation, we find out that the pattern between two local maximum which will repeat when the same behavior is performing. This way, the repeat pattern is the feature we want to gather in this step. To obtain a more general pattern, we will do the same behavior for several times and average them. We will have a deeper look in Pattern Formation step of averaging patterns.

5.3.3 Training Pattern Formation II: Pattern Acquisition

Pattern acquisition step is to define a pattern and describe the method we use to form a pattern.

In order to be used in behavior detection of online phase, we have three type of patterns: full pattern(FP), boundary discrete pattern(BDP) and time discrete pattern(TDP).

Full Pattern

Elevator Detection In pattern acquisition step of elevator detection, we have two type of patterns: full Pattern and half detection parameters. To form a full pattern, we first define a training pattern TBehavior = {a1, a2, ..., ak} with dynamic size of k. Element ai of TBehavior is the i-th measurement of vertical acceleration in the training pattern of specific Behavior. We directly use the measurements from the data filtering step with no further process. To retrieve the half detection parameters, we also use the patterns from data filtering step. However, we use only the beginning concave of patterns of elevator going up and elevator going down since the target of half detection is for early detection without knowing the number of floors moved.

This way, we need to obtain the length LU P, LDOW N and the sum SU P, SDOW N of vertical acceleration of concave up as the beginning concave of elevator going down and concave down

as the beginning concave of elevator going up. We choose the shortest movement of elevator to get these parameters. For example, if there is an elevator which can move from the first floor to third floor. We record the length and sum of the elevator moving only one floor up and down.

This is because during our observation, the concave grows larger when it travels more floors.

This way, we only need to obtain the smallest one as boundary.

Stair Detection To form a full pattern, we first define a training pattern TBehavior = {p1, p2, ..., pk} with dynamic size of k. Element pi of training pattern is the i-th measurement of pitch mea-surement in the training pattern of specific Behavior. We use the meamea-surements from data filtering step. In order to get a generic pattern, we need to average the pattern. To average the patterns, we need to interpolate the patterns of the same Behavior to the length of kmax the longest pattern, and then we average them to generate the desired generic training pattern of the behavior.

Boundary Discrete Pattern

In order to obtain boundary discrete pattern, we need to transfer measurement into discrete way, we first get the maximum value DM AX and the minimum value DM IN of each pattern. Then, we separate the range between DM AX and DM IN into several subrange by discrete factor DF . For example, let DF = 5, we can separate the the value between DM AX and DM IN into 5 subrange. As Fig. 5.3, we define Discrete Level that define the Lowest subrange be 1 and define the Highest subrange be 5 as discrete factor DF . Now for every measurement in the pattern, we can transfer every measurement to discrete level. This way, we can transform every pattern into the discrete form. To form a boundary discrete pattern, we first define a discrete training

Training Phase – Training Pattern Formation

(2) Pattern Acquisition

The # of distinct level between Minimum and Maximum of a pattern.

Figure 5.3: Example of Discrete Factor and Discrete Level.

patternDT PBehavior = {d1, d2, ..., dk}. Element di of training pattern is the i-th measurement

of discrete level in the full pattern of specific Behavior. We use the measurements from data filtering step. Now, we want to obtain a sequence called boundary discrete pattern TBehavior0 from the discrete training pattern. The Discrete Level Sequence Pattern is empty in the begin-ning and we add the first discrete level of a discrete traibegin-ning pattern into the sequence. Then, from the second element to the last element, we only add the discrete level into the sequence when the discrete level is different from the previous one. The detailed obtaining algorithm is described in Algorithm 1.

Algorithm 1 Sequence Obtaining Algorithm of Boundary Discrete Pattern Input: DT PBehavior

if LastInsert 6= dithen Insert di into TBehavior0 .

By Algorithm 1, we can obtain the boundary discrete pattern TBehavior0 of each behavior.

Finally, we put these patterns into the training pattern database for further matching use.

Time Discrete Pattern

To form a time discrete pattern, we also use discrete training pattern introduced previously.

Then we want to obtain a sequence called time discrete pattern TBehavior00 . This time discrete pattern is different from the previous one. We add a time constraint, time lasting factor β to the sequence obtaining algorithm with consideration of time domain. While the previous algorithm insert the discrete level only when the discrete level changes, the algorithm in this method insert the discrete level when the discrete level changes or when the discrete level keep the same at a

certain length of time set by time lasting factor. The detailed algorithm is described in Algorithm 2.

Algorithm 2 Sequence Obtaining Algorithm of Time Discrete Pattern Input: DT PBehavior, β

if LastInsert 6= dithen Insert di into TBehavior00 .

By Algorithm 2, we can obtain the time discrete pattern TBehavior00 of each behavior. Finally, we put these patterns into the training pattern database for further matching use.

相關文件