Skip to main content

WoundSim

Gymnasium-compatible reinforcement learning environments for wound healing treatment optimization

Python 3.10+ License: MIT Tests PyPI version version


WoundSim provides four Gymnasium-compatible RL environments for wound healing treatment optimization, each wrapping a validated ODE model from the wound healing literature. All model parameters are sourced from peer-reviewed publications with inline # SOURCE: comments. The package includes random, clinical heuristic, and PPO baselines with full Stable-Baselines3 compatibility.

Installation

pip install woundsim              # Core (numpy, scipy, gymnasium)
pip install woundsim[rl]          # + SB3, PyTorch for RL training
pip install woundsim[all]         # Everything

Development install:

git clone https://github.com/HassDhia/woundsim.git
cd woundsim
pip install -e ".[all]"

Quick Start

import gymnasium as gym
import woundsim
from woundsim.agents.heuristic import HeuristicAgent

env = gym.make("woundsim/WoundMacrophage-v0", difficulty="medium")
agent = HeuristicAgent(env, env_id="woundsim/WoundMacrophage-v0")
obs, info = env.reset(seed=42)

done = False
total_reward = 0.0
while not done:
    action, _ = agent.predict(obs)
    obs, reward, terminated, truncated, info = env.step(action)
    total_reward += reward
    done = terminated or truncated

print(f"Episode reward: {total_reward:.2f}")
env.close()

Environments

Environment Model State Dim Action Dim Source
WoundMacrophage-v0 Zlobina macrophage polarization 5 1 Zlobina & Gomez (2022)
WoundIschemic-v0 Simplified Xue-Friedman ischemic 6 2 Xue, Friedman & Sen (2009)
WoundHBOT-v0 Flegg HBOT angiogenesis 4 2 Flegg et al. (2009, 2015)
WoundDiabetic-v0 Extended diabetic inflammation 7 3 Waugh & Sherratt (2006)

WoundMacrophage-v0

Five-variable ODE model of macrophage M1/M2 polarization from Zlobina et al. (2022). The agent controls a polarization treatment signal to balance debris clearance (M1) with tissue regeneration (M2).

  • Observation: [debris, M1, M2, granulation, new_tissue] (normalized to [0,1])
  • Action: [polarization_signal] in [0, 1]
  • Reward: Penalizes debris and treatment cost; rewards tissue growth
  • Difficulties: easy (a0=0.3), medium (a0=0.6), hard (a0=0.9 + noise)

WoundIschemic-v0

Six-variable model simplified from Xue & Friedman (2009). The agent controls revascularization intensity and growth factor application to heal ischemic wounds.

  • Observation: [wound_area, oxygen, VEGF, macrophages, fibroblasts, ECM]
  • Action: [revascularization, growth_factor] in [0, 1]
  • Difficulties: mild, moderate, severe

WoundHBOT-v0

Four-variable HBOT angiogenesis model from Flegg et al. (2009, 2015). The agent controls hyperbaric oxygen session parameters to promote vascularization and wound closure.

  • Observation: [capillary_tips, sprouts, oxygen, wound_area]
  • Action: [intensity, duration_fraction] in [0, 1]
  • Difficulties: acute, chronic, non-healing

WoundDiabetic-v0

Seven-variable diabetic wound model incorporating glucose-insulin dynamics from Waugh & Sherratt (2006) with macrophage polarization from Zlobina et al. (2022). The agent must simultaneously manage wound treatment and glycemic control.

  • Observation: [wound, debris, M1, M2, glucose, insulin, ECM]
  • Action: [polarization, growth_factor, insulin_dose] in [0, 1]
  • Difficulties: well-controlled, moderate, uncontrolled

Architecture

woundsim/
  src/woundsim/
    models/        # ODE wound healing models (Zlobina, Xue-Friedman, Flegg)
    envs/          # Gymnasium environments wrapping each model
    agents/        # Random, heuristic, PPO agent implementations
    training/      # Training infrastructure with shared configs
    benchmarks/    # Systematic benchmark evaluation runner
  tests/           # 173 unit and integration tests
  paper/           # LaTeX paper and publication figures
  results/         # Training results (JSON)

Training

# Train PPO on all environments and evaluate against baselines
python train_all.py

# Generate publication-quality figures from training results
python generate_figures.py

Paper

The accompanying paper is available at:

Citation

If you use WoundSim in your research, please cite the software:

@software{dhia2026woundsim_software,
  author = {Dhia, Hass},
  title = {WoundSim: Gymnasium-Compatible Reinforcement Learning Environments for Wound Healing Treatment Optimization},
  year = {2026},
  publisher = {Smart Technology Investments Research Institute},
  url = {https://github.com/HassDhia/woundsim}
}

To cite the accompanying paper:

@misc{dhia2026woundsim,
  author = {Dhia, Hass},
  title = {WoundSim: Gymnasium-Compatible Reinforcement Learning Environments for Wound Healing Treatment Optimization},
  year = {2026},
  howpublished = {\url{https://github.com/HassDhia/woundsim/blob/main/paper/woundsim.pdf}},
  institution = {Smart Technology Investments Research Institute}
}

License

MIT License. See LICENSE for details.

Contact

Hass Dhia - Smart Technology Investments Research Institute

Metadata

Release files for woundsim 0.1.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 woundsim 0.1.0
File Size Uploaded Provenance
woundsim-0.1.0.tar.gz 3.3 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for woundsim 0.1.0
File Interpreter ABI Platform
woundsim-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.3 MB

Release files / woundsim-0.1.0.tar.gz

Download URL woundsim-0.1.0.tar.gz
Size 3.3 MB
Tags Source
SHA-256 checksum
How to use checksums
8f2d275e607d6a5be8741f191f9aec6d2b428501b65ae2bd16dc853d0c9db2b7
BLAKE2b-256 checksum
How to use checksums
15fcdcf50112230471798913ec63e205ad02db32c579740aaf1ba48a260431a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release files / woundsim-0.1.0-py3-none-any.whl

Download URL woundsim-0.1.0-py3-none-any.whl
Size 31.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c81eb2816494496ab3c085780d94f73f09511f9dc39ea8c6766c37371799f2b
BLAKE2b-256 checksum
How to use checksums
82033dfd484262ee77ca08d9c69def65b69a8dc616389a590c0ba7dfab918019
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Security for woundsim 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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