/IoT-Sensor-Fault-Detection

The Air Pressure System (APS) is vital for heavy-duty vehicles, using compressed air to apply pressure to brake pads. It offers advantages like readily available and sustainable natural air. This problem classifies, the positive class attributes APS failure to a specific component, while the negative class attributes it to other causes.

Primary LanguageJupyter Notebook

Sensor-Fault-Detection

Problem Statement

The Air Pressure System (APS) is an essential part of heavy-duty vehicles, employing compressed air to apply pressure to brake pads and decelerate the vehicle. APS offers advantages such as the accessibility and sustainability of natural air. This problem involves Binary Classification, where the positive class signifies APS failure due to a specific component, while the negative class represents failure caused by other factors.

Solution Proposed

This project focuses on the Air Pressure System (APS) in trucks, which generates pressurized air for braking and gear changes. The dataset distinguishes component failures specific to APS (positive class) and failures unrelated to APS (negative class).

The goal is to reduce costs by minimizing false predictions and unnecessary repairs.

Tech Stack Used

  1. Python
  2. FastAPI
  3. Machine learning algorithms
  4. Docker
  5. MongoDB

Infrastructure Required.

  1. AWS S3
  2. AWS EC2
  3. AWS ECR
  4. Git Actions
  5. Terraform

How to run?

Before we run the project, make sure that you are having MongoDB in your local system, with Compass since we are using MongoDB for data storage. You also need AWS account to access the service like S3, ECR and EC2 instances.

Data Collections

image

Project Archietecture

image

Deployment Archietecture

image

Step 1: Clone the repository

git clone https://github.com/sethusaim/Sensor-Fault-Detection.git

Step 2- Create a conda environment after opening the repository

conda create -n sensor python=3.7.6 -y
conda activate sensor

Step 3 - Install the requirements

pip install -r requirements.txt

Step 4 - Export the environment variable

export AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID>

export AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY>

export AWS_DEFAULT_REGION=<AWS_DEFAULT_REGION>

export MONGODB_URL="mongodb+srv://arkintea:<password>@sensor.cwezzhe.mongodb.net/?retryWrites=true&w=majority"

Step 5 - Run the application server

python app.py

Step 6. Train application

http://localhost:8080/train

Step 7. Prediction application

http://localhost:8080/predict

Run locally

  1. Check if the Dockerfile is available in the project directory

  2. Build the Docker image

docker build --build-arg AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID> --build-arg AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY> --build-arg AWS_DEFAULT_REGION=<AWS_DEFAULT_REGION> --build-arg MONGODB_URL=<MONGODB_URL> . 

  1. Run the Docker image
docker run -d -p 8080:8080 <IMAGE_NAME>

To run the project first execute the below commmand. MONGO DB URL:

mongodb+srv://arkintea:<password>@sensor.cwezzhe.mongodb.net/?retryWrites=true&w=majority

then run

python main.py