How shoaib-devpy/blockchain_fl_framework_py works
This is a financial-ML framework combining federated learning with blockchain consensus and security techniques. Its main workflow preprocesses credit-card data, partitions it for client-side training, aggregates local models, evaluates and visualizes results, and also records blocks through a PBFT-backed chain. The map includes the documented security and smart-contract capabilities. The excerpts show key calls and PBFT message handling; other connections are included only where the main.py reference index or README supports them. Several main.py sections and visualization internals were not shown, so their internal relationships are not expanded.
Main entry points: main.py Workflow orchestrator · pbft_node.py PBFT node · blockchain.py Blockchain · network.py PBFT network
Components 15
Data and ML
- Workflow orchestrator
main.py - Data preprocessing
utils/data_preprocessing.py - Federated clients
federated_learning/client.py - Model aggregation
federated_learning/aggregator.py
Blockchain and PBFT
- Smart contract
blockchain/smart_contract.py - Blockchain
blockchain/blockchain.py - PBFT network
pbft/network.py - PBFT node
pbft/pbft_node.py - PBFT message
pbft/pbft_message.py
Security
- Adversarial training
security/adversarial_training.py - Anomaly detection
security/anomaly_detection.py
Evaluation and Visualization
- Model evaluation
main.py - Result visualization
visualization.py
Other components
- Framework operator
- Dataset provider
Connections 16
- Framework operator → Workflow orchestrator: runs workflow
README.md - Workflow orchestrator → Data preprocessing: loads and partitions
main.py - Data preprocessing → Dataset provider: downloads dataset
utils/data_preprocessing.py - Workflow orchestrator → Federated clients: trains clients
main.py - Workflow orchestrator → Model aggregation: aggregates models
main.py - Workflow orchestrator → Adversarial training: applies training
main.py - Workflow orchestrator → Anomaly detection: runs detection
main.py - Workflow orchestrator → Model evaluation: evaluates models
main.py - Workflow orchestrator → Result visualization: plots results
main.py - Workflow orchestrator → Smart contract: uses contract
main.py - Workflow orchestrator → Blockchain: adds blocks
main.py - Blockchain → PBFT network: creates network
blockchain/blockchain.py - Blockchain → PBFT node: initializes nodes
blockchain/blockchain.py - PBFT node → PBFT network: broadcasts messages
pbft/pbft_node.py - PBFT network → PBFT node: delivers messages
pbft/network.py - PBFT node → PBFT message: creates messages
pbft/pbft_node.py