@timmyjc/pet-armadillo

0
0
flwr new @timmyjc/pet-armadillo

pet-armadillo

⚠️ Development status — not for production. This app is a work in progress, provided as an example only. It has not been reviewed for data-disclosure risk and must not be used with real or sensitive data.

Federated Oxford-IIIT Pet training with Flower and PyTorch — joint cat/dog classification and foreground segmentation — loading data from MOLGENIS Armadillo via its /flower/push-data endpoint.

The app runs in both Flower runtimes without code changes:

  • Simulation: the Oxford-IIIT Pet dataset is downloaded via torchvision and sharded on the fly. The default federation expects 2 virtual SuperNodes.
  • Deployment: each ClientApp loads its node's pre-split .pt tensors from the local Armadillo server. The SuperExec container is started by Armadillo, which injects ARMADILLO_URL and ARMADILLO_CONTAINER_NAME. The researcher authenticates with each Armadillo node (armadillo-flwr-authenticate, from molgenis-flwr-armadillo) and submits the run with armadillo-flwr-run, which injects one OIDC token per node into armadillo-tokens.

Simulation

pip install -e .
flwr run . local-simulation --stream --federation-config "num-supernodes=2"

Deployment

  1. Prepare per-node data (each file is a dict {"images", "masks", "labels"}):

    python -m petexample.split_data --num-nodes 2 --train-per-node 64 --test-per-node 32

    This writes upload/node0/data/pet_train.pt, pet_test.pt, etc.

  2. Upload each node's pet_train.pt and pet_test.pt into the project named by the project run-config key (default test-flower-pet) under the data/ folder on the matching Armadillo node.

  3. Authenticate with each node: armadillo-flwr-authenticate.

  4. Submit the run:

    armadillo-flwr-run . --federation local-deployment --stream

Data pushed into the container is read into memory and deleted immediately; see the molgenis-flwr-armadillo documentation for details.