Skip to main content

Qora: Quorum-Oriented Robust Aggregation for Federated Learning

Project description

Qora-FL

Quorum-Oriented Robust Aggregation for Federated Learning

Crates.io License

Byzantine-tolerant aggregation for federated learning. Handles up to 30% malicious clients with minimal overhead.

Features

  • Trimmed Mean - Coordinate-wise outlier trimming (~30% Byzantine tolerance)
  • Median - Coordinate-wise median (~50% Byzantine tolerance)
  • Krum - Distance-based selection with fixed-point arithmetic (Blanchard et al., 2017)
  • FedAvg - Standard baseline for comparison
  • Reputation tracking - Automatically scores clients based on contribution quality
  • Deterministic consensus - Optional I16F16 fixed-point math for bit-perfect reproducibility

Quick Start

cargo add qora-fl
use qora_fl::{ByzantineAggregator, AggregationMethod};
use ndarray::array;

let mut agg = ByzantineAggregator::new(AggregationMethod::TrimmedMean, 0.3);

let updates = vec![
    array![[1.0, 2.0]],   // Honest
    array![[1.1, 2.1]],   // Honest
    array![[0.9, 1.9]],   // Honest
    array![[100.0, 200.0]], // Byzantine attacker
];

let result = agg.aggregate(&updates, None).unwrap();
// Result is close to [1.0, 2.0], attacker ignored

Aggregation Methods

Method Byzantine Tolerance Use Case
TrimmedMean ~30% of clients Default choice for most FL deployments
Median ~50% of clients When stronger robustness is needed
Krum n >= 2f+3 Fixed-point deterministic consensus
FedAvg None Baseline comparison only

Using Individual Functions

use qora_fl::{trimmed_mean, median, fedavg};
use ndarray::array;

let updates = vec![array![[1.0]], array![[2.0]], array![[3.0]]];

let tm = trimmed_mean(&updates, 0.2).unwrap();
let med = median(&updates).unwrap();
let avg = fedavg(&updates, None).unwrap();

Examples

Quickstart

cargo run --example quickstart

Compare Methods

cargo run --example compare_methods

See examples/ for more.

Background

Core algorithms validated in QRES (181-day autonomous IoT deployment with 30% Byzantine tolerance). Qora-FL adapts this proven consensus to standard federated learning workflows.

License

Licensed under either of Apache License, Version 2.0 or MIT License at your option.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qora_fl-0.2.0-cp38-abi3-manylinux_2_34_x86_64.whl (404.6 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.34+ x86-64

File details

Details for the file qora_fl-0.2.0-cp38-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for qora_fl-0.2.0-cp38-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 61353a66dd667d10b7335ba1c16fadd8732403075f9081af84a86b192e665d94
MD5 81909672f62b0427900d33f52e1fe136
BLAKE2b-256 a2b76bd628c9df5cb205dd2ce86120f50beeaa6bd848ce243baca170d505f750

See more details on using hashes here.

Provenance

The following attestation bundles were made for qora_fl-0.2.0-cp38-abi3-manylinux_2_34_x86_64.whl:

Publisher: release.yml on CavinKrenik/qora-fl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page