Skip to content

Creating an end-to-end ML pipeline with cloud deployment to predict the sensor’s lifecycle (whether endangered or working normally), thereby reducing the cost of frequent setup and installation in buildings

Notifications You must be signed in to change notification settings

vineet1409/IOT-Sensor-Life_prediction

Repository files navigation

Smart Building Automation (Sensor-fault-Detection)

As part of the smart building automation, Zigbee-based end-devices such as THL (temperature, humidity, and light) sensors are used to automatically adjust room temperature or light based on their readings. These sensors were, however, subjected to battery drain, and hence their lifecycle was compromised.

The task was to create an end-to-end ML pipeline with cloud deployment to predict the sensor’s lifecycle (whether endangered or working normally), thereby reducing the cost of frequent setup and installation in buildings

Architecture

Architecture

ML Pipeline High Level Overview

ML_Training_Pipeline

Data Ingestion

data_ingestion

Data Validation

data_validation

Data Tranformation

data_transformation

Model Trainer

model_trainer

Model Evaluation

model_evaluation

Model Prediction

model_prediction

Model Pusher

model_pusher

CI/CD Pipeline using GitHub Action for deployment on AWS EC2

  1. Login to AWS console.

  2. Create IAM user for deployment

    with specific access

    1. EC2 access : It is virtual machine

    2. S3 bucket: To store artifact and model in s3 bucket

    3. ECR: Elastic Container registry To save your docker image in aws

    Description: About the deployment

    1. Build docker image of the source code
    2. Push your docker image to ECR
    3. Launch Your EC2
    4. Pull Your image from ECR in EC2
    5. Lauch your docker image in EC2

    Policy:

    1. AmazonEC2ContainerRegistryFullAccess
    2. AmazonEC2FullAccess
    3. AmazonS3FullAccess

3.Create a s3 bukcet in ap-south-1 bucket name: scania-sensor-pipeline

  1. ECR repo to store/save docker image 566373416292.dkr.ecr.ap-south-1.amazonaws.com/sensor-fault

  2. EC2 machine Ubuntu Created

  3. Open EC2 and Install docker in EC2 Machine

    #optinal sudo apt-get update -y sudo apt-get upgrade

    #required curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh sudo usermod -aG docker ubuntu newgrp docker

  4. Configure EC2 as self-hosted runner

setting>actions>runner>new self hosted runner> choose os> then run command one by one

  1. Setup github secrets

AWS_ACCESS_KEY_ID=

AWS_SECRET_ACCESS_KEY=

AWS_REGION=ap-south-1

AWS_ECR_LOGIN_URI=566373416292.dkr.ecr.ap-south-1.amazonaws.com

ECR_REPOSITORY_NAME=sensor-fault

MONGO_DB_URL=

Results

The entire pipeline developed helped to reduce the burden of frequent setup. The installation costs went down by almost 30%

About

Creating an end-to-end ML pipeline with cloud deployment to predict the sensor’s lifecycle (whether endangered or working normally), thereby reducing the cost of frequent setup and installation in buildings

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published