An adaptable deep-learning model for mechanical stress inference in tissues
Project description
StressNET
StressNET: an adaptable deep-learning model for mechanical stress inference in tissues
What is StressNET?
StressNET is an open-source Python library for data-driven mechanical stress inference in tissues. It implements Graph Neural Network models that infer intercellular stress from tissue geometry, without requiring users to specify a fixed physical model. The package includes pretrained models for stress prediction and utilities to finetune them on in silico and in vivo datasets.
It can be used to:
- preprocess Surface Evolver outputs or skeletonized microscopy images into graph data,
- load pretrained or finetuned StressNET model weights,
- infer stress/tension values on tissue interfaces,
- compare StressNET predictions against ground truth or other method predictions when available,
- plot inferred stress maps.
Installation
pip install stressnet
Or with Poetry:
poetry add stressnet
Quick start
import stressnet
print(stressnet.__version__)
From a repository checkout, run the test suite with:
poetry install --with dev
poetry run pytest
Or, if make is available:
make install-dev
make test
Usage
The recommended entry points are the worked example notebooks in examples/:
examples/inference_in_silico.ipynb: inference on synthetic Surface Evolver data.examples/inference_in_vivo.ipynb: inference on experimental skeleton/myosin image data.examples/finetuning.ipynb: finetuning a pre-trained StressNET model on user-provided graph data.
These notebooks show the complete workflow, including data loading, model loading, inference, metrics, plotting and fine-tuning.
AI assistants for users
This repository includes AGENTS.md, a user-facing grounding document for AI assistants. It helps assistants write scripts or notebook cells that use StressNET to load data, run inference, compare metrics, generate plots and fine-tune models on new datasets.
To avoid stale duplicated instructions, treat AGENTS.md as the source document and make tool-specific files point back to it when possible.
Development setup
Requires Poetry and Python 3.10 (TensorFlow 2.8 / NumPy constraints in pyproject.toml).
git clone https://github.com/nicolasaldecoa/StressNET.git
cd StressNET
poetry install --with dev
poetry run pytest
Common development shortcuts are available through the Makefile:
make lint # run Ruff checks like CI
make lint-diff # preview Ruff auto-fixes
make lint-fix # apply Ruff auto-fixes
make test # run pytest with coverage
make docs # build local HTML documentation
make build # build wheel and source distribution
make check # run lint, tests, and package build
Documentation
- Read the Docs (stable): https://stressnet.readthedocs.io/en/stable/ (development: latest).
- Local HTML build:
poetry install --with docs
poetry run python docs/build_docs.py
Or, with make:
make install-docs
make docs
Open docs/_build/html/index.html in a browser.
Running examples
The example notebooks assume the repository layout is available. Clone the repo, start Jupyter from the repository root, and open notebooks under examples/ so relative paths such as examples/example_data/... resolve as written.
Installing stressnet from PyPI provides the library package only; running the publication examples also requires this repository's examples/ folder and any downloaded example data.
Example finetuning dataset
The radial_1d_2d_inverted_9v dataset is intentionally not tracked in git because of its size.
Download it to the expected examples path with:
python examples/download_radial_1d_2d_inverted_9v.py
You can also import ensure_dataset_downloaded from examples/download_radial_1d_2d_inverted_9v.py in a notebook.
How to cite
If you use the StressNET software, cite this repository/software package:
@software{stressnet,
author = {Aldecoa Rodrigo, Nicolás},
title = {{StressNET}: an adaptable deep-learning model for mechanical stress inference in tissues},
version = {1.0.0},
url = {https://github.com/nicolasaldecoa/StressNET},
license = {BSD-3-Clause},
}
Software citation metadata is also available in CITATION.cff.
License
BSD 3-Clause © Nicolás Aldecoa Rodrigo
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stressnet-1.0.0.tar.gz.
File metadata
- Download URL: stressnet-1.0.0.tar.gz
- Upload date:
- Size: 29.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91dba44fcd09b3a14bc316449bd5c29adca63b3b4f343311f06babf8b97ef98c
|
|
| MD5 |
9cb8e14a878eeb185cc4d089a92ab31c
|
|
| BLAKE2b-256 |
ddd74da089b6d6b0cc12c61d22272bd248644282006855892106a7e2290538b6
|
Provenance
The following attestation bundles were made for stressnet-1.0.0.tar.gz:
Publisher:
publish.yml on nicolasaldecoa/StressNET
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stressnet-1.0.0.tar.gz -
Subject digest:
91dba44fcd09b3a14bc316449bd5c29adca63b3b4f343311f06babf8b97ef98c - Sigstore transparency entry: 1687698454
- Sigstore integration time:
-
Permalink:
nicolasaldecoa/StressNET@16fb5fc5db3e1f159e549ace041990b0348e3d0e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/nicolasaldecoa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@16fb5fc5db3e1f159e549ace041990b0348e3d0e -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file stressnet-1.0.0-py3-none-any.whl.
File metadata
- Download URL: stressnet-1.0.0-py3-none-any.whl
- Upload date:
- Size: 32.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d723998068bbbab100cb53b9996e0d8c44ff13d09f0b8aa4ff97d3889c4be5b
|
|
| MD5 |
07f6d53cb6acd5e9a5ff0137652e4468
|
|
| BLAKE2b-256 |
4d56175d53bc3fce34f9b870583d12b8b089b336894ccbd267b09ec443add605
|
Provenance
The following attestation bundles were made for stressnet-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on nicolasaldecoa/StressNET
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stressnet-1.0.0-py3-none-any.whl -
Subject digest:
5d723998068bbbab100cb53b9996e0d8c44ff13d09f0b8aa4ff97d3889c4be5b - Sigstore transparency entry: 1687698725
- Sigstore integration time:
-
Permalink:
nicolasaldecoa/StressNET@16fb5fc5db3e1f159e549ace041990b0348e3d0e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/nicolasaldecoa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@16fb5fc5db3e1f159e549ace041990b0348e3d0e -
Trigger Event:
workflow_dispatch
-
Statement type: