Skip to content

0xDVC/federated-blockchain

Repository files navigation

Federated Blockchain Startup Success Predictor

This project combines federated learning and blockchain technology to create a decentralized system for predicting startup success. Using machine learning models trained on distributed data, we help investors and entrepreneurs make more informed decisions about startup investments while maintaining data privacy and model integrity.

Overview

The system consists of three main components:

  • A federated learning framework for distributed model training
  • A blockchain-based model registry for tracking model updates
  • A machine learning pipeline for startup success prediction

Architecture

Federated Learning

  • Distributed training across multiple clients while keeping data private
  • Configurable training rounds and minimum client requirements
  • Model aggregation on a central server
  • Real-time training monitoring via dashboard

Blockchain Registry

  • Smart contract-based model update tracking
  • Immutable record of model versions and performance metrics
  • Verification of model provenance and training history

Machine Learning Models and Neural Networks

  • Convolutional Neural Network (CNN)
  • Random Forest Classifier (RFC)

Dataset

The training data is sourced from Kaggle and includes:

  • Startup funding history
  • Company location and industry
  • Team size and composition
  • Operating status and outcomes

Each client maintains their own private dataset while contributing to the global model.

Setup & Running the System

1. Environment Setup

# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows use: .venv\Scripts\activate

# Install Python dependencies
pip install -r requirements.txt

# Install Foundry (if not already installed)
curl -L https://foundry.paradigm.xyz | bash
foundryup

2. Smart Contract Setup

# Navigate to model registry directory
cd model-registry

# Install Foundry dependencies
forge install

# Build contracts
forge build

# Deploy contract (in a new terminal)
forge script script/ModelUpdateRegistry.s.sol:ModelUpdateRegistryScript --rpc-url localhost --broadcast

3. Configure Environment

# Copy environment template
cp .env.sample .env

# Edit .env with your values:
# PRIVATE_KEY=your_private_key
# CONTRACT_ADDRESS=deployed_contract_address
# RPC_URL=http://localhost:8545

4. Run the System

# Terminal 1: Start local blockchain
anvil

# Terminal 2: Start FL server
python main.py server

# Terminal 3: Start dashboard
streamlit run dashboard.py

# Terminal 4+: Start clients (run in separate terminals)
python main.py client0
python main.py client1
python main.py client2

5. Access the System

Quick Start (Single Command)

For development, you can use the provided start script:

# Make script executable
chmod +x start.sh

# Run all components
./start.sh

Stopping the System

Ctrl+c 

Acknowledgements

  • Initial model training and data collection was done by @sahil-sahil
  • The dataset was sourced from Kaggle
  • The model was trained using Flower and [Foundry]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published