Skip to content
mushyymushhPublic

About

GitHub repo to detect spam or malware

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

COS30049 - CTIProject

Swinburne University of Technology

The following GitHub Repository contains a Full-Stack Web Deployment for SPAM Detection in Cybersecurity Scenarios - curated for purpose of assessment of the Computing Technology Innovation Project course COS30049.

Contents includes:

  • Datasets
  • Data Processing
  • Machine Learning Model/Algorithms
  • Fast API Integration
  • Node.js / React Application
  • Running Specifications

1.1 Full-Stack Web Development Pipeline

Environment Configuration

To run the Frontend Application you will need Node.js installed on your machine to host the development server. Additionally you will need Python to install the library dependencies for the interactive features and localhost required to access the Fast API Backend.

UI Description
User Interface This is a sample of the SPAM Detection application user interface.

(i) You can install the following libraries by running the commands in the terminal of your preferred IDE once Python is installed:

Required Libraries

Python Libraries Node Package Manger
pip install pip fastapi npm install plotly.js-dist-min
pip install uvicorn npm install (Configuration check)
pip install joblib -
pip install scikit-learn -
pip install scipy -
pip install pydantic -

Running The Application

Once installed you will need to run both the Frontend and Backend servers before viewing the application - starting with the Frontend.

  1. cd into the frontend folder of the project directory via the IDE terminal.
  2. Run: npm start

This will take a couple seconds to initialize. The page will automatically open in the browser when complete.

  1. Open a new Terminal. cd into the backend folder.
  2. Run: uvicorn main:app --reload

This will take a couple seconds to initialize. Once the 'Application startup complete.' prints to the terminal the API is active in the Web Application.

The Application is now functional for testing with email inputs. To close the application simply close the IDE.

NOTICE: If you experience an error: ['react-scripts' is not recognized as an internal or external command, operable program or batch file.] after running npm start. You will need to change your Execution Policy via Window's PowerShell in Administrative Mode, to '[A] Yes to All' (Allow trusted scrips to run). Command: set-executionpolicy remotesigned. Please be advised *the execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks.

1.0 Machine Learning Configuration (Standalone)

Environment Configuration

The following Machine Leaning Models were developed using Python therefore you will need to install the Python Environment before accessing the model. Additionally you will need to configure and install the dependency's as follows.

(i) You can install the following libraries by running the commands in the terminal of your preferred IDE once Python is installed:

Required Libraries

  • pip install matplotlib
  • pip install pandas
  • pip install joblib
  • pip install scipy
  • pip install scikit-learn
  • pip install numpy

Model Training Guide

Once the dependencies are installed you have the option of training two models. To train a model open the terminal and cd into the project directory in your computer, then run the following:

  1. dataRegression.py (A Regression based algorithm) Command: python dataRegression.py
  2. dataClassification.py (A Decision Tree Classification algorithm) Command: python dataClassification.py

NOTE: Once successful the terminal will output the results and evaluations in a text string, while the matplotlib library will open graphical data visualizations in a separate window. On closing the visualizations the model will serialize itself into the 'models' directory and exit, from the serialized model data predictions can be tested via the Web Application Interface.

Model Prediction Guide

Example Outputs:

Confusion Matrix Distribution Graph
Confusion Matrix Distribution Graph

Contributors

  1. Ameer Musharraf Noor Musaddik | 104841025
  2. Ashraf Anwar | 105397820
  3. Eloise Ridder-Strickland | 104934718

About

GitHub repo to detect spam or malware

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages