/Bot-Detection

Protection of Web applications with behavioral biometrics – bot detection module

Primary LanguagePythonMIT LicenseMIT

release-date code-size tag Website Contributors Last-commit Languages MIT License


Logo

Mouse Behavioral Biometrics

Protection of Web applications with behavioral biometrics.
Bot detection module
Visit Site · Report Bug

Table of Contents

About The Project

This project was created in the manner of preparing the bachelor's degree thesis on AGH University of Science and Technology, Department of Computer Science, Electronics and Telecommunications. The serialized data, collected from the previous module is used as the input dataset for InceptionV3 Machine Learning model, imported from tensorflow hub. The idea is to perform transfer learning techniques to produce a model able to distinguish Web bots and humans on real commercial websites.

Built With

  • Python – language used
  • Tensorflow – Machine Learning framework
  • Numpy – scientific calculation library
  • Pandas – data manipulation library
  • Pytest - framework for unit tests
  • Go – language used to implement serializer
  • Protocol Buffers – used to serialize and store data

Project structure

This section provides an information about project modules:

config
  • .env – sample file with environmental variables that MUST be filled in order to run project locally
  • config.json – contains path to .env file and public notifier variables
  • logger.config – logger config
  • usersequence.proto – protobuf schema for serialized data
ml_models
  • inceptionV3 – core machine learning model
utils
  • csv_writer – module responsible for saving each model result to .csv file
  • deserializer – module responsible for deserializing protobuf files that contains user mouse data
  • imgur_uploader – module responsible for uploading plots to imgur in order to send it as url to slack webhook for live notifications
  • notification_jobs – message informing about pending slurm job
  • preprocessing – module for data preprocessing
  • prometheus_scripts – shell scripts for operating on Prometheus cluser
  • results_terminator – terminates a global job result into the csv file
  • serializer – go module to serialize data from database into the protofiles
  • slack_notifier – custom notifier about pending, executing or finished/crashed job
  • statistics – module to calculate statistics
root
  • main – main script that runs the ML model
  • Makefile – autoconfiguration for setting up the environment for the project

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

Things you need to install before running:

python 3.8
pip3
go 1.14

Installation

  1. Clone the repo and change the directory to install requirements:
git clone https://github.com/Mouse-BB-Team/Bot-Detection.git
cd Bot-Detection/
pip3 install -r requirements.txt

At this point you MUST set the variables in .env file

Usage

Run script with:

python3 main.py -d <path_to_dataset> -t <count_of_ml_model_execution>

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Mail - mouse.bb.team@gmail.com

Project Link: https://github.com/Mouse-BB-Team

Acknowledgements

Our thesis supervisor:

Project made with PLGrid Infrastructure:

Authors

Appendix

go serializer help for detailed usage

go run main.go -h