An open API service indexing awesome lists of open source software.

https://github.com/ashr-exe/phishnet-fl

PhishNet-FL is a federated learning system using Flower and TensorFlow to train phishing detection models across distributed clients while preserving data privacy. It leverages UCIโ€™s Phishing Websites Dataset, neural networks, and federated aggregation for decentralized training.
https://github.com/ashr-exe/phishnet-fl

federated-learning flower phishing-detection tensorflow

Last synced: 4 months ago
JSON representation

PhishNet-FL is a federated learning system using Flower and TensorFlow to train phishing detection models across distributed clients while preserving data privacy. It leverages UCIโ€™s Phishing Websites Dataset, neural networks, and federated aggregation for decentralized training.

Awesome Lists containing this project

README

          

# **PhishNet-FL: Federated Learning for Phishing Detection**

PhishNet-FL is a federated learning system designed to detect phishing websites while preserving user data privacy. Using **Flower** for federated learning and **TensorFlow** for deep learning, PhishNet-FL enables multiple clients to collaboratively train a phishing detection model without sharing raw data.

This approach enhances security by distributing the learning process while still benefiting from shared knowledge.

## **๐Ÿš€ Features**
โœ” **Federated Learning (FL):** Clients train locally and only share model updates, ensuring data privacy.
โœ” **Phishing Detection Model:** A neural network trained on the UCI Phishing Websites Dataset.
โœ” **Decentralized Training:** No need to centralize sensitive data, reducing security risks.
โœ” **Scalable Architecture:** Supports multiple clients communicating with a central federated server.
โœ” **Easy Deployment:** Simple client-server setup with minimal dependencies.

---

## **๐Ÿ“‚ Repository Structure**
```
/PhishNet-FL
โ”‚โ”€โ”€ server.py # Federated learning server
โ”‚โ”€โ”€ client.py # Federated learning client
โ”‚โ”€โ”€ README.txt # Project documentation
โ”‚โ”€โ”€ requirements.txt # Dependencies
โ”‚โ”€โ”€ .gitignore # Ignore unnecessary files
```

---

## **โšก Installation**

Before running the project, install the required dependencies:
```bash
pip install -r requirements.txt
```

---

## **๐Ÿ–ฅ Running the Server**

The **server** manages the federated learning process by coordinating clients and aggregating their updates.

```bash
python server.py
```

You should see output confirming the server is running and waiting for clients to connect.

---

## **๐Ÿ‘จโ€๐Ÿ’ป Running Clients**

Each client trains the phishing detection model on its local dataset and communicates updates to the server.

```bash
python client.py
```
- `` โ†’ Unique ID for the client (e.g., 0, 1, 2...)
- `` โ†’ Total number of clients participating in training
- `` โ†’ IP address of the federated learning server

For example, if you have 3 clients and your server is running on **192.168.1.10**, start each client as follows:

```bash
python client.py 0 3 192.168.1.10
python client.py 1 3 192.168.1.10
python client.py 2 3 192.168.1.10
```

---

## **๐Ÿงช Model Architecture**

The phishing detection model is a deep neural network built using TensorFlow:

- **Input Layer:** 30 features (preprocessed phishing website attributes)
- **Hidden Layers:**
- Dense (64 neurons, ReLU activation)
- Dropout (20%)
- Dense (32 neurons, ReLU activation)
- Dropout (20%)
- Dense (16 neurons, ReLU activation)
- **Output Layer:** 1 neuron (Sigmoid activation for binary classification)

---

## **๐Ÿ“Š How Federated Learning Works in PhishNet-FL**

1๏ธโƒฃ **Server Initialization:** The federated server starts and waits for clients to connect.
2๏ธโƒฃ **Client Training:** Each client trains a local model on its dataset without sharing raw data.
3๏ธโƒฃ **Model Updates:** Clients send model updates (weights) to the server instead of raw data.
4๏ธโƒฃ **Federated Aggregation:** The server averages the received model updates and improves the global model.
5๏ธโƒฃ **Global Model Distribution:** The updated global model is sent back to clients for the next training round.
6๏ธโƒฃ **Repeat:** The process repeats for multiple rounds until the model converges.

This ensures privacy-preserving, decentralized machine learning across multiple devices.

---

## **๐Ÿ“Œ Dependencies**

- `flwr` (Flower for federated learning)
- `tensorflow` (Deep learning framework)
- `scikit-learn` (Data preprocessing and evaluation)
- `ucimlrepo` (Dataset retrieval)
- `numpy` (Numerical computations)

---

## **๐Ÿ“š Future Improvements**
๐Ÿ”น Support for additional datasets and real-time phishing detection.
๐Ÿ”น Advanced privacy-preserving techniques like differential privacy.
๐Ÿ”น More efficient aggregation methods for improved performance.

---

## **๐Ÿ“ฌ Contact & Contribution**

๐Ÿ’ก Found a bug? Have a feature request? Feel free to open an issue or contribute!
๐Ÿ“ง Reach out if you have any questions or need help setting up PhishNet-FL.

Happy training! ๐Ÿš€๐Ÿ”