GithubHelp home page GithubHelp logo

taherfattahi / dnn-distance-line-protection-zone Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 2.0 9.06 MB

Implementing Machine Learning Multi-class Classification Algorithms for obtaining the Micom P543 distance relay protection curve in transmission lines with Deep Neural Network and Random Forest

Jupyter Notebook 77.98% Python 1.77% C 17.98% C++ 1.39% Go 0.78% Dockerfile 0.11%

dnn-distance-line-protection-zone's Introduction

Machine Learning Distance Line Protection Zone

Implementing Machine Learning Multi-class Classification Algorithms for obtaining the Micom P543 distance relay protection curve in transmission lines with Deep Neural Network and Random Forest.

For gathering data requirements, first, the distance function of Micom P543 relay was tested with Vebko AMT105 relay tester and the results were given as input to the Deep Neural Network and Random Forest to get the characteristic distance curve.

Features

  • Using Tensorflow to build a Multi Classification Algorithm with a Deep Neural Network model
  • Using Scikit-Learn to build a Multi Classification Algorithm with Random Forest
  • Deep Neural Network Accuracy = 98%
  • Random Forest Accuracy = 96%
  • Using Schneider Electric Micom P543 Relay testing by Vebko AMT105 relay tester to creating the dataset
  • Converting the Tensorflow model to tflite for running on Embedded Board ARM Architecture
  • Using Golang TFLite to be able to easily run tflite model
  • Running on Xilinx Zynq-7020 Embedded Board
  • Usable via Docker file

Installation

First you need install TensorFlow for C

  1. Install bazel
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
sudo apt update && sudo apt install bazel
sudo apt install openjdk-11-jdk
  1. Build tensorflowlite c lib from source
cd ~/workspace
git clone https://github.com/tensorflow/tensorflow.git && cd tensorflow
./configure
bazel build --config opt --config monolithic --define tflite_with_xnnpack=false //tensorflow/lite:libtensorflowlite.so
bazel build --config opt --config monolithic --define tflite_with_xnnpack=false //tensorflow/lite/c:libtensorflowlite_c.so

# Check status
file bazel-bin/tensorflow/lite/c/libtensorflowlite_c.so
# ELF 64-bit LSB shared object, x86-64
  1. Build go-tflite
export CGO_LDFLAGS=-L$HOME/workspace/tensorflow/bazel-bin/tensorflow/lite/c
export CGO_CFLAGS=-I$HOME/workspace/tensorflow/

Build

For Linux/MacOs amd64:

  export CGO_LDFLAGS=-L$HOME/workspace/tensorflow/bazel-bin/tensorflow/lite/c

  go build main.go

For xilinx Zynq-7020 (ARM-based computers):

  sudo apt-get install gcc-arm-linux-gnueabihf

  export CGO_LDFLAGS=-L$HOME/workspace/tensorflow/bazel-bin/tensorflow/lite/c
  
  CGO_ENABLED=1 GOOS=linux GOARCH=arm CC=arm-linux-gnueabihf-gcc go build -o main

Running

This running for ubuntu/MacOs amd64:

  ./main

This running for xilinx Zynq-7020 (ARM-based computers):

  export LD_LIBRARY_PATH=./arm
  
  ./main

Running with Docker

First of all, clone and the repo then run

  docker build -t dnn .

After pulling and building the image, You can get the result like this

  docker run --rm -t distance ./main

Or you can go to the container for running it manually like this

  docker run -it distance

More Info

Micom P543 Relay testing by vebko AMT105

Graph

Distance Line Protection Zone in the AMPro software

Graph

Graph of the Deep Neural Network

Graph

Model Accuracy Plot

Graph

Model Loss Plot

Graph

Note:

If you had issue and got standard_init_linux.go:211: exec user process caused "exec format error error, try this solution.

Collaborators

License

MIT

dnn-distance-line-protection-zone's People

Contributors

iw4p avatar mohsenshahsavari avatar taherfattahi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

vebko iw4p

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.