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.

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.3.tar.gz (34.5 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.3-py3-none-any.whl (40.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: acti_motus-2.3.3.tar.gz
  • Upload date:
  • Size: 34.5 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for acti_motus-2.3.3.tar.gz
Algorithm Hash digest
SHA256 b335fa41a26850b33d130b25a70bb0d945aa260dbf48713755549ed6f9bb3c55
MD5 0a1cef16acc7b09a1b98df2cba31e2d6
BLAKE2b-256 928e00cb7716130e535a4af0291035f983dcea1d6092d1e3ed6059a32be8e651

See more details on using hashes here.

File details

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

File metadata

  • Download URL: acti_motus-2.3.3-py3-none-any.whl
  • Upload date:
  • Size: 40.8 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for acti_motus-2.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8747daa761df72ccbdbcd4389f08891d8ce3c006e030da2533261ae3164346d4
MD5 be1c46fc8c6a43330e4b54ab9e73a987
BLAKE2b-256 02874678d83475f48169161307b79e2b9c3a5823f8320cc15a54ef60a0faa0c3

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.3.3 This release

2 files

2.3.2

2 files

2.3.1

2 files

2.3.0

2 files

2.2.0

2 files

0.1.6

2 files

0.1.5

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

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