End-to-end implementation of banknotes authentication using advanced prototype-based classification by components model within the flask framework for swagger API and streamlit app dockerized and deployed on Heroku platform as a service cloud
This project utilizes classification by components prototype-based model in the area of interpretable-ai to detect genuine and forged banknotes. The implementation uses ensemble techniques with options available for stand-alone models.
To authenticate banknotes and return the confidence of the authentication, users have the following options to select from: Soft
, Hard
, Random
and None
.
If the option is soft or hard, an ensemble of trained cbc
models with different configurations is utilized for the classification. If random, a trained cbc
model is randomly selected from the ensemble to take over the classification. If none, the most confident trained cbc
model out of the ensemble takes charge of the classification.
- click on the link https://bna-mlapp.herokuapp.com/
- Follows steps 2 to 5 for the streamlit app version described below to authenticate banknotes.
python 3.9 or later with all requirements.txt dependencies installed
git clone https://github.com/naotoo1/BNA.git
cd BNA
pip install -r requirements.txt
Run
python app1.py
- Get the local URL
http://localhost/apidocs
- To authenticate a single test case for a banknote, click on
Get
--->Try it out
- Enter the values for variance, skewness, curtosis and entropy with method chosen either as soft, hard, random or none (ie left blank)
- click on
Execute
- To authenticate a multiple test case for some banknotes, click on
Post
--->Try it out
- Choose the
csv
containing test case data with the following designated features variance, skewness, curtosis and entropy - Enter the method either as soft, hard, random or none (ie left blank)
- click on
Execute
Clone the repository and cd into the folder BNA as described above and
Run
streamlit run app.py
- Get the local host URL
http://localhost:8501
- To authenticate a single test case for a banknote, enter the values for variance, skewness, curtosis and entropy with the method chosen either as soft, hard, random or none
- click on Predict
- To authenticate a multiple test case for some banknotes, click on browse files to choose the csv file containing test case data with the following designated features variance, skewness, curtosis and entropy
- click on Predict_file
- Run
docker build -t nameofapp .
in cmd - Run
docker run -p port:port nameofapp
in cmd - Run
http://localhost:port/apidocs