Skip to content
/ speedEST Public

Vehicle impact speed estimation using machine learning

Notifications You must be signed in to change notification settings

adsci/speedEST

Repository files navigation

Vehicle impact speed estimation using machine learning

This tool can be used to estimate the speed of the vehicle at impact with a steel road safety barrier. The estimation is made by a few different machine learning model, which were trained on both full-scale crash tests and numerical simulations. The app consists of the following pages:

  • Home - main page with prediction of the impact speed for a given set of input features
  • Data - description of the input features and the datasets used in development of machine learning models
  • Models - presentation of the developed machine learning models
    • Tree Ensemble - model based on regression trees
    • Multilayer Perceptron - model based on a neural network
    • Regularized Linear Ensemble - model based on linear regressors
    • Support Vector Ensemble - model based on support vector machines
    • Final Voting Ensemble - ensemble of machine learning models
  • About the project - summary of the research project

Usage

Online

The latest version of the app is always deployed here.

Local

For local use, production-ready docker images for amd64 and arm64 platforms are available in the DockerHub repository. To run it, first make sure that Docker is installed on your system. Then, pull the Docker image

docker pull adsci/speedest:latest

and run the container, with the necessary port mapping

docker run -p 80:8501 adsci/speedest:latest

After the container has started, the app can accessed at localhost.

Development

Building the Docker image

To build and run the image locally, use

docker build -t speedest:latest -f Dockerfile .
docker run -p 80:8501 speedest:latest

How to prepare local environment?

It is recommended to prepare a virtual environment for the project, making sure that Python version in the base environment is the same as the one specified in the Dockerfile (3.11 at the moment)

python -m venv .venv

After you're done run the following command:

make install-requirements-dev

to install the dependencies.

NOTE

On some platforms (e.g., macOS), installation of the dependencies fails as no matching distribution may be found for the torch library (due to the lack of +cpu in library name on that platform), e.g,

ERROR: No matching distribution found for torch==2.3.0+cpu

If that's the case, recompile the requirements and install the dependencies once again:

make requirements
make install-requirements-dev

How to add requirements?

If some package should be added as a requirement to this project, add it to the requirements/base.in (or requirements/dev.in if the package is needed only for development, not in production). For test-specific packages (e.g., pytest) use requirements/test.in. This way, the packages are only installed in the testing environment used by tox. After that, compile the requirements with:

make requirements

Do not forget to commit the new .txt files.

How to clean local environment?

clean will remove all files and directories created by the above commands.

make clean

Continuous Integration

Before pushing a new commit to a branch, it's recommended to check locally whether all checks run by the CI pipeline pass. To do that, make sure that the local environment is prepared (see here for details).

Linter

For this project, GitHub's CI pipline uses pre-commit hooks together with other checks (pyupgrade, flake8, isort, and black) to ensure good formatting of files. Before committing, make sure all checks pass by running

make lint

Tester

For this project, GitHub's CI pipline uses tox, which allows for running simultaneous tests on multiple environments. Locally, it's possible to run the tests in a simple way by using only tox (like in the CI pipeline)

make test

About

Vehicle impact speed estimation using machine learning

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages