DTG-BlockFL is a research codebase for secure federated learning under malicious-client settings. The repository implements a dynamic trust-graph pipeline with anomaly-aware scoring, survivor-aware aggregation, and append-only audit metadata logging. It supports single-run experiments, manifest-based batch execution, and paper-oriented result export utilities.
This public repository is intended for research reproducibility and method inspection.
DTG-BlockFLis implemented directly in this repository.- The blockchain component is a lightweight pseudo-chain metadata logging prototype for auditability studies, not a production blockchain deployment.
- Several advanced baselines are compact reproduction-style implementations for controlled comparison, not official upstream releases.
- Historical filenames such as
paper_full_v13.yamlare retained for compatibility with launcher scripts and previous experiment notes.
run.py # main experiment entrypoint
configs/ # single-run experiment configurations
manifests/ # batch experiment plans
scripts/ # setup, diagnosis, launch, summary, plotting
src/ # attacks, defenses, FL flow, models, utils
launchers/windows/ # one-click Windows launchers
docs/ # organized documentation hub
data/ # local-only data placeholders (not tracked)
outputs/ # runtime outputs (ignored except .gitkeep)
- cleaned
.gitignorefor datasets, caches, checkpoints, and outputs - MIT license and corrected
CITATION.cff - Windows launchers with no machine-specific Conda path
- documentation hub, contribution files, issue templates, and release notes
- source code, configs, manifests, and helper scripts
- large or private datasets
- processed dataset caches such as
femnist_cache.pt - local experiment outputs under
outputs/ - generated paper tables or logs that should be recreated from real runs
conda create -n dtgblockfl python=3.10 -y
conda activate dtgblockfl
pip install -r requirements-cpu-pytorch.txt
pip install -r requirements.txtconda create -n dtgblockfl_gpu python=3.10 -y
conda activate dtgblockfl_gpu
pip install -r requirements-cu118-pytorch.txt
pip install -r requirements.txt- Double-click
WIN_MENU.bat. - Create or repair the CPU or GPU environment.
- Run
doctor/gpu_doctor. - Start with
smoke_femnist_dtg.yamlor a short MNIST run. - Move to manifest-based trend or paper-oriented experiments.
The Windows launcher auto-detects Conda from standard locations. You can also set DTG_CONDA_HOME manually before running the menu.
bash scripts/setup_env.sh
python scripts/doctor.py
python scripts/validate_project.py
python run.py --config configs/smoke_femnist_dtg.yamlpython scripts/prepare_data.pyPlace LEAF-style FEMNIST JSON files under:
data/raw/femnist/train/data/raw/femnist/test/
Then build the processed cache:
python scripts/prepare_femnist.pypython run.py --config configs/smoke_mnist_fedavg.yaml
python run.py --config configs/smoke_mnist_labelflip.yaml
python run.py --config configs/smoke_femnist_dtg.yaml
python scripts/launch_experiments.py --manifest manifests/trend_baselines_quick.yaml --max_workers 1docs/README.md— documentation hubREADME_CN.md— Chinese homepagedocs/03_windows/WINDOWS_FRIENDLY_GUIDE_CN.md— Chinese Windows guidedocs/02_experiments/EXECUTION_ROADMAP_CN.md— recommended execution orderdocs/05_policy/baseline_fidelity_policy.md— fidelity boundary note
git init
git branch -M main
git add .
git commit -m "Initial public release v18"
git remote add origin <your-github-repo-url>
git push -u origin mainAfter the first push, create a GitHub Release and archive the tagged version to Zenodo if you want a citable software record.
Use the paper citation for scientific claims, and cite the exact software release for reproducibility. The repository already includes CITATION.cff so GitHub can surface a standard citation block.
This repository is released under the MIT License. See LICENSE.