Giter VIP home page Giter VIP logo

federated-learning-and-split-learning's Introduction

Federated-Learning-and-Split-Learning

This project is comparison between Federated Learning and Split Learning for credit card fraud detection dataset.

Dataset link: https://www.kaggle.com/mlg-ulb/creditcardfraud

This dataset has been processed, split into train and test, and it was used for training, testing, and comparison. Smote1.ipynb is to generate somte file for the dataset.

Required Files:

Download dataset from below links

creditcard_train_SMOTE_1.csv

creditcard_test.csv

creditcard_train.csv

How to perform Experiment

Step 1: Download the dataset from the above links.

Step 2: Open Fed_Split_Learning.ipynb. Run all the cells above "Federated Learning" section.

Step 3: In the Federated Learning section, chnage the value of "num_clients" variable, which decides the dataset split size. It should be the number that can divide the dataset length. (ex. 32,24,16,12)

Step 4: Change the variable "num_selected", which decides the number of bank clients. It should be less than "num_clients" variable.

Step 5: Add dataset to the drive, and replace the path for training and testing file(Variable "traindata" and "test_file"). This should be according to your drive path. Train file for balanced dataset should be of "creditcard_train_SMOTE_1.csv" , and for imbalanced dataset it should be of "creditcard_train.csv". For test data, the path should be of "creditcard_test.csv".

Step 6: Run all the cells of "Federated Learning". It will store the results in "mp" variable.

Step 7: Now, run the whole "Federated Learning" section by changing number of clients by changing variable "num_selected". This should be done with the same dataset split.

Step 8: Run the whole "Regular Learning" section. It does not have nuber of clients, so run it just one time. Results will be stored inside "mp" variable.

Step 9: Now, run the "Split Learning" section by keeping the same "num_clients". Do change datset file name according to your need(Refer step 4). Run it multiple times by changing variable "num_selected", and store the results in mp.

Step 10: Run the first cell of "Graphs" section's sub-section "Separate graphs for each dataset split". It will save the JSON file of ypur results. Change the variable "i" to the value of "num_clients"(Should be same in both Federated and Split Learning).

Step 11: We have executed the code for dataset split of 32, 24, 16, 12. Each will have clients 3,6,10,16 (Except for the dataset split 12, it will only have 3,6,10 clients' result).

Step 12: This will leave you with 32_results.json, 24_results.json, 16_results.json, 12_results.json. For seperate graph, pick the data from any of the json file. You can execute the "Separate graphs for each dataset split" for multiple times to view yur results.

Step 13: For all the combined result, run the "Graphs for combined results" sub-section of section "Graphs". This should be executed one time only to get ypur results. Make sure JSON files generated previously should be accessible to it.

Results

Accuracy

Accuracy

Turn Around Time

Turnaround Time for Execution

federated-learning-and-split-learning's People

Contributors

phet2309 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.