Skip to content
ICT-FinD-LabPublic

About

CHROMA: Coloring-based Graph Reconstruction Defense with Organized Merging of Perturbation

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

CHROMA

Coloring-based Graph Reconstruction Defense with Organized Merging of Perturbation

中文说明 · Quick start · Experiment settings · Reference results

CHROMA uses graph coloring and constrained merging to decide which nodes share Gaussian noise when defending against graph reconstruction from node embedding similarities.

To try it, start with the two-epoch Cora example on CPU. The reproduction section shows how to run CHROMA, GRASP, and the independent-noise baseline.

Quick start

Install dependencies

Use Python 3.11. Clone the repository and run all commands from its root.

git clone https://github.com/ICT-FinD-Lab/CHROMA.git
cd CHROMA
python -m venv .venv
source .venv/bin/activate

On Windows PowerShell, use .\.venv\Scripts\Activate.ps1.

For a CPU environment, including the quick check and tests:

python -m pip install torch==2.5.1 --index-url https://download.pytorch.org/whl/cpu
python -m pip install --only-binary=torch-scatter,torch-sparse -r requirements.txt -f https://data.pyg.org/whl/torch-2.5.1+cpu.html

For GPU experiments with CUDA 12.4, use these commands in a fresh environment:

python -m pip install torch==2.5.1 --index-url https://download.pytorch.org/whl/cu124
python -m pip install --only-binary=torch-scatter,torch-sparse -r requirements.txt -f https://data.pyg.org/whl/torch-2.5.1+cu124.html

Run a CPU check

Verify the supplied inputs and run two epochs of training and evaluation on Cora:

python scripts/verify_data.py
python main.py --dataset cora --method CHROMA --device cpu --smoke

Reproduce the experiments

Cora

python main.py --dataset cora --backbone gcn --method USP --sigma 1.0 --seed 0 --device 0
python main.py --dataset cora --backbone gcn --method GRASP --sigma 1.0 --seed 0 --device 0
python main.py --dataset cora --backbone gcn --method CHROMA --sigma 1.0 --seed 0 --device 0

The same commands support citeseer, pubmed, amazon-computer, amazon-photo, coauthor-cs, coauthor-physics, and wikics. Use --backbone gat for GAT. Datasets are downloaded to data/; use --data-dir PATH to reuse existing data.

ogbn-arxiv

Construct the CHROMA partition before training:

python prepare_groups.py --dataset ogbn-arxiv
python main.py --dataset ogbn-arxiv --backbone gcn --method GRASP --sigma 1.0 --seed 0 --device 0
python main.py --dataset ogbn-arxiv --backbone gcn --method CHROMA --sigma 1.0 --seed 0 --device 0

Main table

The main comparison uses seeds 0–4 and noise standard deviations 0.5, 1.0, 1.5, and 2.0. Use --method CLEAN --sigma 0 for the zero-noise baseline. See experiment settings for the data splits and evaluation protocol.

# List the training commands for the full comparison.
python scripts/make_main_grid.py --output main_grid.csv
# Summarize the supplied per-seed results.
python summarize.py --input results/main_table_per_seed.csv --output results/reference_summary.csv

Each training run writes its log, checkpoint, and metrics to runs/. To summarize your own completed runs, use --input runs --output results/my_summary.csv. See reference results for the main comparison and controls.

Repository structure

Path Purpose
main.py, train.py Experiment launcher and training loop
coloring/, model.py Build CHROMA groups and apply noise to node embeddings
configs/, assets/ Experiment settings, partitions, and data splits
scripts/, tests/ Experiment commands, input verification, and tests
results/, summarize.py Per-seed reference results and summary tool

See the code guide for module details and the files produced by each run.

Citation

@inproceedings{guo2025grasp,
  author    = {Guo, Zhiyu and Liu, Yang and Ao, Xiang and He, Qing},
  title     = {{GRASP}: Differentially Private Graph Reconstruction Defense with Structured Perturbation},
  booktitle = {Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining V.2},
  year      = {2025},
  pages     = {767--777},
  doi       = {10.1145/3711896.3736992}
}

Acknowledgements

CHROMA builds on GRASP (Guo et al., KDD 2025) and its original implementation. The code uses PyTorch, PyTorch Geometric, OGB, and NetworkX. The training logger is adapted from the OGB repository.

About

CHROMA: Coloring-based Graph Reconstruction Defense with Organized Merging of Perturbation

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages