Skip to main content

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.

Metadata

Release files for acti-motus 2.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for acti-motus 2.4.0
File Size Uploaded
acti_motus-2.4.0.tar.gz 39.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for acti-motus 2.4.0
File Interpreter ABI Platform
acti_motus-2.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 86.1 kB

Release files / acti_motus-2.4.0.tar.gz

Download URL acti_motus-2.4.0.tar.gz
Size 39.7 kB
Tags Source
SHA-256 checksum
How to use checksums
377ee89711dc0b3d9204fe7d004fc1bc00d3ab137c5cd9cc86355dfaf4fba579
BLAKE2b-256 checksum
How to use checksums
b521af31cf554efd3394e0ff54df3290c70ec8e19c8d5a654648610b594a2472
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"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}

Release files / acti_motus-2.4.0-py3-none-any.whl

Download URL acti_motus-2.4.0-py3-none-any.whl
Size 46.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a24876fb3647b7eb807e2b5eeb956eba299e5684b9fe8c6ec434e6ddad36a2d0
BLAKE2b-256 checksum
How to use checksums
a1895aa417b783e982d603e81f7ca0e18585b8a0472f7e46c444da3bce8c1540
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"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}

Release history Release notifications | RSS feed

This release

2.4.0 This release

2 release files

2.3.3

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page