Skip to main content

Behaviour-mediated and direct prediction workflows for livestock health monitoring using accelerometry

Project description

Motion2Health: Livestock Accelerometry & Health Outcome Prediction

PyPI version License: MIT Python 3.8+

Motion2Health is a SOTA Python package and research framework for livestock health outcome prediction (Gamma-Glutamyl Transferase - GGT) using high-frequency continuous accelerometry data and behavior classification.


🚀 Key Features

  • Unified Predictor Engine (GGTPredictor): Easily load pre-trained classical and PyTorch deep learning models to predict livestock health outcomes.
  • 12 Benchmarking Workflows:
    • Classical Tabular Models: ElasticNet, LME, RandomForest, SVM
    • Deep Learning Models: MultiScale-CNN + LSTM, MultiScale-CNN + Causal Transformer
    • Direct Sensor & Behavior-Disentangled Architectures
  • End-to-End Pipeline: From 1 Hz raw tri-axial accelerometer CSV data to behavior estimation (Grazing, Ruminating, Standing, Lying) and GGT trajectory forecasting.

📦 Installation

Install directly via pip:

pip install motion2health

Or install from source:

git clone https://github.com/SydneyBioX/motion2health.git
cd motion2health
pip install -e .

💡 Quick Start

from motion2health import GGTPredictor

# Initialize the predictor using the behavior-disentangled Random Forest model
predictor = GGTPredictor(workflow="behaviour_rf")

# Predict GGT outcome on Study Day 14
predicted_ggt = predictor.predict_ggt(
    csv_path="data/sample_animal.csv",
    baseline_ggt=32.0,    # Pre-trial baseline GGT (U/L)
    study_day=14          # Target day (-7 to 24)
)

print(f"Predicted GGT Value: {predicted_ggt:.2f} U/L")

🧪 Deep Learning (PyTorch Transformer) Workflow

# Initialize deep learning Transformer workflow
predictor_dl = GGTPredictor(workflow="behaviour_transformer")

# Predict GGT with Monte Carlo Test-Time Augmentation (TTA)
predicted_ggt_dl = predictor_dl.predict_ggt(
    csv_path="data/sample_animal.csv",
    baseline_ggt=28.5,
    study_day=7
)

print(f"Transformer Predicted GGT: {predicted_ggt_dl:.2f} U/L")

📖 Citation & Repository

Public research code, analysis scripts, and evaluation benchmarks are available in the official repository:

License: MIT License

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

motion2health-1.0.0.tar.gz (10.5 MB view details)

Uploaded Source

Built Distribution

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

motion2health-1.0.0-py3-none-any.whl (10.8 MB view details)

Uploaded Python 3

File details

Details for the file motion2health-1.0.0.tar.gz.

File metadata

  • Download URL: motion2health-1.0.0.tar.gz
  • Upload date:
  • Size: 10.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for motion2health-1.0.0.tar.gz
Algorithm Hash digest
SHA256 59ee5e5adeabe688f6a45ec3dc9b9d920eff86fded8aef31d75bc9faea28be2d
MD5 a70b68c0be20b1357a516f923b4f5a5b
BLAKE2b-256 26fe4790eb17e12ead11654e6cc2ea7ca35a2ff5689179a96cb6230409b9fd19

See more details on using hashes here.

File details

Details for the file motion2health-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: motion2health-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for motion2health-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7b80208e4591352a5572cd0c6a53894547f7df7762f0485b0d69dad889476456
MD5 3aeb8765ff54a58704945c082478f353
BLAKE2b-256 79fda0e027b8381f8207a56c20fa6e542e09c54399af811a4727ef209013a7c0

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