Mudcracks detector is a scalable web application for detecting mudcracks images. The application has a stateless architecture and uses two persistence services: DynamoDB and S3 Bucket.
NASA are interested in mud cracks, as they are signs of a watery ancient past on Mars. QUT Space White Belly Sea Eagles Team has been developing a model, trained with 600 images of mud cracks on Earth, for detecting mud cracks in general. The model is available as an Azure Custom Vision endpoint. This leads to the idea of developing a web application for predicting images, along with scalability and persistence. Using our web application, the user will be able to search for images in NASA’s media bank and then, our machine learning model will predict whether there are mud cracks in those images.
The application scales out when the average CPU utilization is over 20%, scaling between one and three instances. While 20% is a small benchmark for CPU performance, it successfully demonstrates the auto-scaling performance of this application. For achieving higher CPU performance such as 60%, the application is more likely to crash due to Tensorflow exceeding the memory of the t3.medium instance, before using the CPU for prediction capabilities. Therefore, average CPU utilization at 20% would ensure stabilize the performance of the application.
To use the application, the user must enter the query and the number of images they want to see.
While the example usage is about mud cracks detection, the web application also works with every TensorFlow model. A TensorFlow model is represented by two files, model.pb and labels.txt.
Prequisites:
- Register for an AWS account
- Create a DynamoDB database and a S3 Bucket
- Add model.pb and labels.txt in server-flask
Installation guides:
- Install Docker
sudo curl -fsSL https://get.docker.com/ | sh
- Clone the directory
git clone https://github.com/phuongnamly/CAB420-MachineLearning.git
- Configure AWS credentials
set AWS_ACCESS_KEY_ID=your_access_key_id
set AWS_SECRET_ACCESS_KEY=your_secret_access_key
- Use Docker to build and run the image
docker build -t mudscrack .
docker run -p 80:4001 mudscrack
- Run the application on localhost
http://localhost:4001