Activity Graph Feature Selection for Activity Pattern Classification

Sensor-based activity recognition is attracting growing attention in many applications. Several studies have been performed to analyze activity patterns from an activity database gathered by activity recognition. Activity pattern classification is a technique that predicts class labels of people such as individual identification, nationalities, and jobs. For this classification problem, it is important to mine discriminative features reflecting the intrinsic patterns of each individual. In this paper, we propose a framework that can classify activity patterns effectively. We extensively analyze activity models from a classification viewpoint. Based on the analysis, we represent activities as activity graphs by combining every combination of daily activity sequences in meaningful periods. Frequent patterns over these activity graphs can be used as discriminative features, since they reflect people's intrinsic lifestyles. Experiments show that the proposed method achieves high classification accuracy compared with existing graph classification techniques.


Introduction
The advances in sensor technology make activity recognition possible.Activity recognition is a technique that automatically recognizes human activities by analyzing senor data [1][2][3][4][5][6].Recently, several studies [7][8][9][10] have been performed to analyze activity patterns from an activity database gathered by activity recognition.Activity pattern classification is a technique that predicts class labels of people based on activity patterns.The class labels can be not only individual identification but also meaningful groups such as nationalities, genders, jobs, and hobbies.Therefore, activity pattern classification has many applications which vary the class labels accordingly.For example, recommender systems can recommend similar items to users with the same hobbies.
Accurate classification of activity patterns requires a deep understanding of activity patterns.Activity patterns are styles in which people perform their activities and they reflect people's lifestyles.People have both intrinsic and common activity patterns.The intrinsic patterns play a key role in distinguishing each individual from the others.They can appear in individuals' specific activities in different frequencies [11,12], orders, days, and periods [13].In order to find these intrinsic activity patterns, we need to explore activity patterns by adjusting the frequencies in all combinations of days.For example, certain people perform their hobbies on weekends, but others may perform the same hobby once a month.
However, it is hard to explore frequent activity graphs in all combinations of days.This naïve approach requires a very long running time and produces redundant frequent patterns.The lifestyle of people is itself a solution to solve this problem.People usually repeat similar activity patterns in specific periods such as daily, weekly, monthly, and yearly.Therefore, we only need to explore activity patterns from every combination of days in specific periods.By avoiding the exploration of meaningless combinations, we can reduce the search space in order to find discriminative features.From a classification viewpoint, these features are as effective as the features from all the combinations of days.
The other important point is to determine pattern types for activity pattern classification.The types are determined depending on activity data models.Various activity data modeling studies have been proposed to represent activity data collected from sensors such as statistics, sequence, and graph-based modeling.Statistics-based activity models [7,8] calculate the average frequency or duration of each activity.

International Journal of Distributed Sensor Networks
Sequence-based activity models [9] represent activities as daily sequences based on the occurrence time.Graph-based activity models [10] generate activity graphs by combining activity sequences in various periods such as daily, weekly, monthly, and yearly.Nodes and edges of the activity graphs represent activities and the occurrence order between two activities, respectively.Among these modeling techniques, the graph-based activity model is suitable for the activity pattern classification problem.This model can maintain sufficient information to mine the intrinsic activity patterns such as frequencies and occurrence orders and various meaningful periods of activities.
In this paper, we propose a novel feature selection framework for classifying activity patterns effectively.The proposed framework generates activity graphs by combining all combinations of daily activity sequences in each meaningful period.By performing frequent subgraph mining over these graphs, we can find all discriminative frequent activity patterns efficiently, which can reflect individuals' intrinsic lifestyles.In order to remove redundant frequent patterns, we select highly discriminative features by adopting topological similarity based feature selection (TSFS) [14].Since topologically similar graphs involve similar activity patterns, we can effectively remove redundancy.Through experiments, we show that the proposed framework can achieve a high performance in classifying activity patterns.
The remainder of this paper is organized as follows.We briefly introduce the existing activity modeling and graph classification studies as related work in Section 2. We analyze the effectiveness of various types of activity patterns in Section 3. In Section 4, we define the activity pattern classification problem and propose our feature selection framework in detail.Section 5 presents the experimental results of the proposed framework, and Section 6 concludes this paper.

Related Work
Activity recognition has gained a lot of interest in recent years due to its potential and usefulness in context-aware computing such as smart homes [3][4][5][6] and aged care monitoring [7,8].The purpose of activity recognition is to infer people's behaviors from low level data acquired through sensors in a given setting, from which other critical decisions are made.There are two approaches to acquire human activities using sensor systems.First, sensors are attached on the body and the signal readings are interpreted [1,2].This approach can recognize low level activities such as "sitting, " "running, " and "walking." Second, sensors are deployed to objects and devices in the environment and the sensor readings are interpreted [3][4][5][6].This approach can recognize high level activities such as "eating, " "sleeping, " "showering, " and "leaving home." The low level activities are used for shortterm activity monitoring such as the elderly falling down.The high level activities are used for long-term activity pattern monitoring such as healthcare.
Mining techniques generally require appropriate data models to find informative patterns to improve effectiveness or efficiency.Various studies have been proposed to represent activity data collected from sensors such as statistics, sequence, and graph-based modeling.Statistics-based activity models [7,8] calculate the average frequency and duration of each activity.Large deviations from the average time or number are considered abnormal activity patterns.Sequence-based activity models [9] represent activities as daily sequences based on the occurrence time.Sequential pattern mining techniques can be applied to activity sequences to mine informative patterns.The graph-based activity model [10] generates activity graphs by combining the daily activity sequences in every monitoring period.The activity graphs can maintain various activity related information through multilabels of nodes and edges such as frequencies, time, durations, and locations of activities.The main advantage of this activity model is that we can analyze activity patterns in various frequencies and periods.
Graph classification studies [14][15][16][17][18] have been proposed to classify graph modeled data such as chemical compounds, social networks, and XML documents.The techniques represent graphs as feature vectors with values indicating the presence or absence of graph structural features, and a discriminative power of each feature is estimated by feature evaluation criteria including G-tests and information gain (IG).The graphs are then classified by using a machine learning classifier.
The existing techniques mostly adopt frequent subgraphs as graph structural features for classification.Many efficient frequent subgraph mining algorithms have been proposed such as FSG [11] and gSpan [13].These algorithms enable us to extract frequent subgraph features in practical time.TSFS [14], M b T [15], and LEAP [16] use frequent subgraph features.COM [17] has shown that cofrequent patterns can have high discriminative powers.Structure feature selection [18] has shown that frequent subgraphs have different discriminative powers according to their spatial distribution in a graph database.However, they cannot achieve the high classification performance for activity graphs since they only consider the frequency of the features.

Analyzing Activity Patterns in Various Activity Data Models
Individual lifestyles are hidden in one's frequently performed activity patterns.It has also been shown in literature [19] that frequent patterns are highly discriminative in various classification problems.Therefore, we adopt frequent patterns as features for this activity pattern classification problem.
Frequent patterns involve different information depending on data models.The representative models for activity data are statistics-, sequence-, and graph-based models.In these models, frequent activity patterns include the frequency of activities, frequent activity sequences, and frequent subgraphs, sequentially.We analyze a discriminative power of each type of frequent activity pattern.
The frequency of activities does not involve enough information for activity pattern classification, because it cannot express the occurrence order among activities.People  can have similar frequencies but different activity orders.Therefore, the occurrence order is very valuable information.For example, Figure 2 shows parts of activity sequences in two consecutive days.The frequencies of "sleeping, " "eating, " and "toileting" are 4, 1, and 1 in the activity sequences.From this information, we cannot perceive that the person is suffering from insomnia.This kind of distinct patterns can be helpful in distinguishing people.
Frequent activity sequences involve the occurrence order of activities.However, the orders are valid only in their own sequences, because we have fractions of sequences.Occurrence order relationships among activity sequences, especially when a sequence shares common segments, can provide a more precise occurrence order among activities of different sequences.For example, we can interpret the activity sequences as two different meanings in Figure 1, that is, "eating or toileting" or "eating and toileting" in the middle of sleeping.
Frequent activity subgraphs represent the occurrence order of activities together in multiple activity sequences from various periods.From these graphs, we can get the occurrence order of activities at a similar time in different periods, which is useful knowledge for activity pattern classification.For example, we can accurately interpret an individual's activity patterns as "eating or toileting in the middle of sleeping" from the activity graph in Figure 2.

Classifying Activity Patterns Based on Activity Graphs
The proposed method uses activity database accumulated with unit activities recognized from various sensors.In this paper, we assume unit activities are recognized exactly.We present the proposed feature selection framework for activity pattern classification.In Section 4.1, we define an activity pattern classification problem.We analyze discriminative activity graph features in Section 4.2 and suggest a method that mines the discriminative features efficiently in Section 4.3.In this paper, our scope is limited to knowledge discovery process in Figure 2.

Notation.
In this section, we present notations related to the activity graph approach [8] and the formal definition of the activity classification problem.
Definition 1 (unit activity).A unit activity,   , is an activity performed in a certain continuous time.   represents a unit activity,   , performed in time .Unit activities are recognized from sensor data and become nodes in an activity graph.Definition 2 (activity sequence).An activity sequence,  = , is a sequence of unit activities, where   <  +1 .Any unit activity,   , can appear multiple times in different   .The sequence of activities in a day is regarded as a daily activity sequence,   = Definition 3 (modeling period).A modeling period,  ( ∈ ), is a time unit used to generate activity graphs. is generally set to a meaningful number of days such as a week ( = 7), a month ( = 30), or a year ( = 365).
Definition 4 (combination days).Given the modeling period, , the combination days of  are the all possible combinations of days in , that is,    (1 ≤  ≤ ).We denote them as For example, the combination days are  1  2 ,  1  3 , . . .,  −1   , when Definition 5 (activity graph).An activity graph,  = (, , , Σ), is a graph that consists of a set of activity nodes, , and a set of edges, , where an edge,  ∈ , represents the order between two activity nodes in . is a set of node and edge labels and Σ is a function assigning labels to nodes and edges.
Activity sequences are generated every day.In order to represent activities of more than one day concisely, we combine corresponding activity sequences and generate activity graphs using multiple sequence alignment (MSA) [18].The number of combined sequences is determined depending on the modeling period, , and combination days, . Figure 3 is an example of an activity graph generated using MSA, when  is 3. MSA first combines the activity sequences ( 2 and  3 ) that share the greatest number of common activity nodes.The common activity nodes are represented as a single node and increase the edge label by one.In the same way, activity sequence  1 is combined with  2 and  3 .In this paper, we focus on mining discriminative features for activity pattern classification.In order to mine these features efficiently, we represent activity data as activity graphs by combining every combination of daily activity sequences in each meaningful period and find frequent subgraphs,  = { 1 ,  2 , . . .,   }, from the activity graphs.Among  = { 1 ,  2 , . . .,   }, we finally select highly discriminative features,  * = argmax (), to remove redundancy, where (⋅) is a feature evaluation function.

Discriminative Activity Graph Features.
Based on the activity pattern analysis in Section 3, we adopt a graph-based activity data model for classifying activity patterns.In this section, we present the way in which discriminative activity graph features are mined efficiently.
People have their own intrinsic lifestyles that are expressed by activity patterns in different frequencies, orders, days, and periods.Therefore, we should generate activity graphs by combining all combinations of daily activity sequences and perform frequent subgraph mining on the activity graphs so that we can find all discriminative frequent subgraphs.
However, exploring frequent subgraphs from all of these activity graphs is very inefficient, since it requires a long running time and many redundant frequent subgraphs are mined.In order to solve this efficiency problem, we observe people's lifestyles.People repeat similar activity patterns in specific periods according to their own lifestyles.For example, office workers go to their companies on weekdays and have religious activities on the weekends.They may climb a mountain as a hobby every month.Through this observation, we claim that the frequent subgraphs of the combinations of days in a specific period have similar discriminative powers compared with the frequent subgraphs of all combinations of days.We present an example explaining Theorem 9. Figure 4 shows two sets of frequent subgraphs,  7 and  30 , mined in  7 and  30 , which denote weekly and monthly patterns, respectively.Suppose that activity patterns  3 and  4 are for two months. 3 is the activity pattern performed the first week in each of the two months.The support of  3 is 0.25 (= 2/8) in  7 but 1 (= 2/2) in  30 .As shown in this case, the supports of frequent subgraphs increase in larger modeling periods.Conversely, suppose that  4 is the activity pattern performed every week for a month and then performed for two weeks in the second month.For two months, the support of  3 is 0.75 in  7 but 0.5 in  30 . 4 appears to have two different activity patterns in  30 because the activity graph involves the frequency of activities in a modeling period.
Observation 1.People repeat similar daily activity sequences in specific periods according to their own lifestyles; that is,   ≅  + .
Claim 1.Given all the activity sequences for  days,  = { 1 ,  2 , . . .,   }, and the set of modeling periods, As we observed above, people repeat similar activity patterns in very specific periods; that is,   ≅  + .Therefore, Claim 1 is convincing.We find discriminative features by  1 ∪  2 ∪ ⋅ ⋅ ⋅   rather than   .
In each subset of activity sequences, we construct the sets of activity sequences for every    .Activity graphs are generated by combining activity sequences in every    .We then mine frequent subgraphs in the activity graphs.
Though we generate activity graphs with all possible combinations within the periods,  2 graphs are generated for the period, .Graphs generated in a smaller period are generated again in a larger period.Duplicate generation is a particularly severe problem for combinations of a small number of sequences, since these combinations are involved in most of the larger periods.In order to avoid generating duplicate graphs, we generate graphs from the largest period to the smallest period.In each period, we generate graphs beginning with those that have the largest number of sequences to the smallest number of ones in a combination.In this way, we can avoid generating graphs that were already generated in a larger period.We can efficiently remove a lot of duplicated graphs.Figure 6 shows an example in which duplicate graphs are generated with all possible combinations in a set of modeling periods,  = {3, 5}.When we generate activity graphs with all possible combinations in modeling periods 3 and 5, the combinations of sequences,  1 ,  2 , and  3 , are duplicated.We generate graphs from the combination days of period 5,  5 , to period 3,  3 .In this way, we can avoid generating graphs that were already generated in  5 .
After generating activity graphs, frequent subgraph mining is performed on the activity graphs to extract frequent activity patterns.A number of duplicate frequent subgraphs occur, since activity graphs are generated from the same activity sequences.Many of them have similar graph structures to each other.These redundant patterns degrade the performance in both the accuracy and running time of the classification.
We select highly discriminative features by removing the redundant frequent subgraphs.A number of feature selection methods [14][15][16][17][18][19][20] have been proposed.Among them, we    adopt the TSFS approach [14].This approach has proved that topologically similar graphs have similar discriminative powers and a method has been proposed that selects discriminative subgraphs by clustering frequent subgraphs based on their similarity.TSFS is very suitable for an activity pattern classification problem since similar activity graphs involve similar activity patterns.
We generate frequent subgraph clusters,  1 ,  2 , . . .,   , by clustering the set of frequent subgraphs,  = { 1 ,  2 , . . .,   }.For the clustering, we can use any clustering algorithm such as -means and any graph similarity measure such as graph edit distance [21] or maximum common subgraph [22,23].The highest discriminative frequent subgraph is selected in each cluster.The discriminative power of each frequent subgraph can be estimated by feature evaluation functions such as information gain, mutual information, and  2 statistic.
Figure 7 shows a processing step that selects highly discriminative features from a set of frequent subgraphs,  = { 1 ,  2 , . . .,   }.For example, the frequent subgraphs,  1 ,  2 ,  7 , and  10 , are topologically similar to each other.These activity patterns also have similar semantics, "sleeplessness." Therefore, they are clustered into the same cluster,  1 .The set of highly discriminative features,  * , is selected by selecting only one highly discriminative feature in each cluster.
We then convert each activity graph,   = { 1 ,  2 ,. . .,   }, into a set of feature vectors.Equation ( 1) is a feature-graph matrix,  , , that indicates whether each feature,   , is present or absent in   .We build a classification model by training machine learning classifiers with the converted activity graphs and class labels,   ∈ { 1 ,  2 , . . .,   }.Consider Algorithm 1 is the pseudocode for mining highly discriminative features and training an activity pattern classifier.Algorithm 1 takes the set of activity sequences, , the minimum support, min sup, and the set of modeling periods, , as input and returns a set of highly discriminative features,  * , and the activity pattern classification model, .It first mines frequent subgraphs and stores them in  in each period (line 2-4).A set of activity pattern clusters, , is generated by clustering  (line 5-9).Finally, each graph set,   , is represented as feature vectors by generating the feature-graph matrix, , and the activity pattern classification model, , is built (line 10-11).

Experiments
In this section, we experimentally evaluate the effectiveness of our feature selection framework on a real dataset.system.Figure 8 shows the interface of the system, where each activity is inputted with properties such as activity type, duration, and time.The dataset for each student contains more than 2,000 activities and consists of 19 target activities, as shown in Tables 1 and 2.
In order to show the effectiveness of our method, we conduct the following experiments.Modeling periods, , are set to 1, 2, 5, and 7, meaning a day, a weekend, a weekday, and a week, sequentially.To classify activity patterns, we use user IDs for class labels and perform fivefold cross validation using an SVM classifier: (1) effectiveness of graph features: comparison of classification accuracy among features from various activity data modeling methods, (2) the best minimum support threshold for frequent activity subgraphs: comparison of classification accuracy in various minimum supports, (3) discriminative features in each period: comparison of classification accuracy between proposed method and naïve method extracting features in a single period, (4) effectiveness of TSFS: comparison of classification accuracy among feature selection algorithms, top-k, MMRFS [19], and TSFS, (5) ineffectiveness of conventional graph classification: comparison of classification accuracy between the proposed method and conventional graph classification algorithms such as the model-based search tree (M b T) [15] and maximal marginal relevance feature selection (MMRFS) [19].

Effectiveness Evaluation.
The first experiment aims to show the effectiveness of graph features.We compare classification accuracy among features mined from statistics-, they do not consider the topological similarity for feature selection.

Conclusion
Classification is an important technique for analyzing activity data.We have defined the activity pattern classification problem and proposed an effective feature selection framework for classifying activity patterns.We have shown that a graph model is effective for activity pattern classification because the activity graphs reflect individuals' specific activities in different frequencies, orders, days, and periods.By analyzing the lifestyles of people that repeat similar activity patterns in specific periods, we have proposed an effective and efficient feature selection technique.We select frequent activity patterns in all combinations of daily sequences in meaningful periods.
Experimental results have shown that the proposed method achieves (1) suitable model for activity pattern classification, (2) better discriminative power extracting combinational features than that extracting features in a single period, and (3) higher accuracy than that of existing graph classification methods.In addition, we discussed the optimal

Figure 1 :
Figure 1: Sequence-and graph-based activity data models.

Figure 2 :
Figure 2: Overview of the proposed method.

Figure 6 :
Figure 6: Example of duplicate graphs generated with a set of modeling periods.

Figure 13 :
Figure 13: Comparison of the accuracy between graph modeling techniques.
).Given the set of activity sequences,  = { 1 ,  2 , . . .,   }, for  people, and a set of class labels, {  ,   , } =1 ,   ∈ { 1 ,  2 , . . .,   }, an activity pattern classification is a problem that predicts the class label,   , for the subset of an activity sequence,   .Definition 7 (frequent activity pattern).A frequent activity pattern, f, is a subgraph of  that occurs no less than the minimum support.A support of subgraph f, denoted by support (f), is calculated as | ⊆ |/||, where | ⊆ | is the number of graphs containing subgraph  and || is the total number of activity graphs in an activity graph DB.Definition 8 (discriminative feature).Given the set of activity graphs,    = { 1 ,  2 , . . .,   }, with   and  = { 1 ,  2 , . . .,   }; a discriminative feature is a frequent subgraph that can be mined only in a specific set of activity graphs,    .

Theorem 9 .
For each , given the set of activity graphs,    = { 1 ,  2 , ...,   }, with   ,    can have discriminative frequent subgraphs,    = { 1 ,  2 , ...,   }.Proof.Suppose that we generate all possible combinations within a modeling period; each combination of an activity sequence is unique.Moreover, daily activity sequences are different in a specific period.Therefore, we generate different graphs with each combination of days of   and each graph set,   , with   can have discriminative frequent subgraphs,    = { 1 ,  2 , . ..,   }.Given the set of activity graphs,   = { 1 ,  2 , . ..,   }, with a set of modeling periods,  = { 1 ,  2 , . ..,   }, each graph set,   , with   can have discriminative frequent subgraphs,   = { 1 ,  2 , . ..,   }.Proof.We prove it by contradiction.Suppose that a set of frequent subgraphs,   = { 1 ,  2 , . . .,   }, is mined in   = { 1 ,  2 , . . .,   } by varying   .Assume that, for all  and  ( < ), two conditions,   −   = 0 and   −   = 0, are always established.We show the case, not establishing these conditions.Suppose a certain frequent subgraph, , is in   .It is possible that  does not appear in   , since we have  < .Therefore, we have   ̸ ⊂   .This also means that the support of  in   is no less than the support of  in   .Therefore,  ∈   ∧  ∉   is also possible when we mine frequent subgraphs with the same minimum support in   and   .Since   −   = 0 and   −   = 0 are not always established,   can have frequent subgraphs, not containing   , and vice versa.