Skip to main content

Python-powered human activity recognition algorithm that build upon Acti4, processing data from multiple accelerometers with a required thigh sensor.

Project description

ActiMotus

PyPi Coverage Monthly Downloads License

A Python-powered human activity recognition algorithm building upon Acti4. It processes data from multiple accelerometers with a primary requirement for a thigh-worn sensor.

  • Scientifically validated activity detection.
  • Device-independent, relies on RAW accelerometry.
  • Minimum Requirement: Single accelerometer worn on the thigh (front or side).
  • Detects: Lying, sitting, standing, walking, stair climbing, and bicycling.
  • Optional: A back-worn sensor enhances lying/sitting detection; a calf-worn sensor adds squatting/kneeling detection.

About predecessor Acti4

Developed by the Danish National Research Center for Working Environment (NRCWE), Acti4 was a MATLAB-based tool designed to classify physical activities (lying, sitting, standing, walking) and assess posture using sensors on the thigh, hip, arm, and trunk. It allowed for combining detections with participant diaries to analyze movement behavior during work and leisure. Development of Acti4 concluded in July 2020. Focus has since shifted to its Python-based successor, ActiMotus, which is being developed in partnership with SENS Innovation ApS and is the core of Motus infrastructure.

Installation

Install using pip install acti-motus.

Usage example

To see ActiMotus in action, here is a simple workflow processing data from a single thigh-worn accelerometer.

1. Load the raw accelerometer data

import pandas as pd
from actimotus import Sens

# Load binary data
raw = Sens.from_bin(raw_thigh.bin)
print(raw)

datetime                           acc_x       acc_y       acc_z  
2024-09-02 08:08:50.227000+00:00   0.218750   -0.171875   -0.773438
2024-09-02 08:08:50.307000+00:00   0.257812   -0.203125   -0.937500
2024-09-02 08:08:50.387000+00:00   0.242188   -0.226562   -0.953125
2024-09-02 08:08:50.467000+00:00   0.234375   -0.242188   -0.945312
2024-09-02 08:08:50.548000+00:00   0.257812   -0.226562   -0.953125

2. Extract features and detect activity types

Next step is to extract features and detect activity types:

from actimotus import Features, Activities

# Calculate features from the raw data
features = Features(calibrate=False).compute(df)

# Classify activities
acivities, references = Activities(vendor="Sens").compute(features)
print(activities)

datetime                    activity  
2024-09-02 08:08:51+00:00   sit
2024-09-02 08:08:52+00:00   sit
2024-09-02 08:08:53+00:00   sit
2024-09-02 08:08:54+00:00   sit
2024-09-02 08:08:55+00:00   sit

3. Generate aggregated exposures

To summarize the detected activities over time (e.g., daily totals), transform the data into exposures:

from actimotus import Exposures

# Compute daily exposures from the activity data
exposures = Exposures().compute(df)
print(exposures)

datetime                    sit               stand             walk              bicycle
2024-09-02 00:00:00+00:00   0 days 04:13:20   0 days 02:29:48   0 days 01:43:48   0 days 00:00:00
2024-09-03 00:00:00+00:00   0 days 07:20:48   0 days 02:23:44   0 days 01:42:22   0 days 00:17:35
2024-09-04 00:00:00+00:00   0 days 08:16:13   0 days 02:24:17   0 days 00:54:27   0 days 00:37:01
2024-09-05 00:00:00+00:00   0 days 00:44:01   0 days 00:38:16   0 days 00:10:19   0 days 00:17:27

Detailed information on ActiMotus processing and features is available in the learning center.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

acti_motus-2.3.1.tar.gz (31.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

acti_motus-2.3.1-py3-none-any.whl (37.6 kB view details)

Uploaded Python 3

File details

Details for the file acti_motus-2.3.1.tar.gz.

File metadata

  • Download URL: acti_motus-2.3.1.tar.gz
  • Upload date:
  • Size: 31.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for acti_motus-2.3.1.tar.gz
Algorithm Hash digest
SHA256 c97ff0be4b364ff939f98832eb9923e2ad610faa8a9cd42755553b78357ae377
MD5 da5883e82f0df27d39c0a6bf0b13ec8e
BLAKE2b-256 76412161a791880f9a9c8206d8daf60d44a5d7ba77960d01ad9dc9bdb703f516

See more details on using hashes here.

File details

Details for the file acti_motus-2.3.1-py3-none-any.whl.

File metadata

  • Download URL: acti_motus-2.3.1-py3-none-any.whl
  • Upload date:
  • Size: 37.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for acti_motus-2.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5bd6665b3ae0c58e9359de25e8933c8699db8e6cd141920ed816a955bd698004
MD5 0e2db8df3183cfc16cf4d4e01eb33d25
BLAKE2b-256 f58ef4edb926b7f3ec61db1266722727754a0d46b79879085649ca82c08d1dac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page