Implementing Deep Neural Network Binary Classification Algorithm for AMR Reley Differential Curve.
A novel approach to the implementation differential protection scheme by using a Deep Neural Network Dataset has been obtained from Differential Characteristic plane in the Vebko AMPro software.
- Using Python Tensorflow to build a Deep Neural Network model
- 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
- 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
- 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
- Build go-tflite
export CGO_LDFLAGS=-L$HOME/workspace/tensorflow/bazel-bin/tensorflow/lite/c
export CGO_CFLAGS=-I$HOME/workspace/tensorflow/
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
This running for ubuntu/MacOs amd64:
./main
This running for xilinx Zynq-7020 (ARM-based computers):
export LD_LIBRARY_PATH=./arm
./main
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 amr ./main
Or you can go to the container for running it manually like this
docker run -it amr
If you had issue and got standard_init_linux.go:211: exec user process caused "exec format error
error, try this solution.
- Nima Akbarzade - Dr.Mohammad Parpaei - Dr.Mohammad Haji Seyed Javadi - Sajad Ansari