Learning Temporal Context for Activity Recognition
This repository contains algorithms and data that we used for our work on long-term temporal models for activity recognition, which we will present at the ECAI 2016 conference . With these codes and data, you should be able to reproduce experiments performed on the two datasets described in Section 5 of . The software is related to the Frequency Map Enhancement (FreMEn) method and the data are part of the datasets for long-term mobile robot autonomy (DaLTeMoR) provided by the Lincoln Centre for Autonomous Systems (LCAS).
How to compile and run
The project uses standard libraries and we provide relevant Makefiles to compile it, so the only think you need to do is to go to the src folder an call
Now, to quickly test the method, call e.g.
../bin/fremen ../data/aruba/ FN 5 15 0.2|grep Precision
You should get 15 lines that show how the classification performed each day. Each value contains the day, number of correct and incorrect classifications, classification precision etc.
The arguments in this example are as follows:
- ../data/aruba is the location of the dataset,
- FN is selection of the spatio-temporal model. First letter determines temporal model (FreMEn) in this case and N means that None spatial context is used. See the code main/fremen.cpp for details.
- 5 stands for order of the model - 5 periodics in the aforementioned example,
- 15 is the number of days used in the experiment,
- 0.2 is the filename of the confusion matrix or the value of elements at the matrix diagonal, i.e. we used 0.2 for weak and 0.8 for strong in the experiments described in 1.
Datasets are located in the
data folder. Each dataset consists of 5 files
- activity.min contains the timelines of activities per minute, (e.g. 1440 lines of that file represent one day).
- activity.names contains names of the activities so you know what are the ID's in the previous file mean.
- locations.min containes IDs of rooms where the person was. Again 1440 lines of that file represent one day.
- locations.names provides room types of the rooms' IDs in locations.min.
If it works OK, then you can try to reproduce our experiments.
You will need to have the
alglib installed - simply invoke
sudo apt-get install libalglib-dev
Go to the eval_scripts folder and call
This will create a small binary for statistical testing.
./process_dataset.sh aruba, processes the aruba dataset, see Section 5 of .
./summarize_results.sh aruba, performs statistical tests over the aruba dataset results calculated in the previous step and generates aruba.pdf, which provides comparison of the individual temporal models.
./summarize_results.sh withamdoes the same for the witham dataset.
./draw_results.sh, processes the results of both aruba and witham and generates the figures (in fig format) used in the Section 5 of .
Conditions of use
If you use the software for your research, please cite either  (is you use FreMEn) or  that describes FreMEn's application to activity recognition.. Since one of the datasets used is based on the CASAS datasets, you should also cite the article .
- C.Coppola, T.Krajnik, T.Duckett, N.Bellotto: In proceedings of the European Conference on Artificial Intelligence (ECAI), 2016. [bibtex]
- T.Krajnik, J.P.Fentanes, G.Cielniak, C.Dondrup, T.Duckett: Spectral Analysis for Long-Term Robotic Mapping. In proceedings of the IEEE International Conference on Robotics and Automation (ICRA), 2014. [bibtex]
- D.J. Cook: Learning setting-generalized activity models for smart spaces. IEEE Intelligent Systems, 2012. [bibtex]