Giter VIP home page Giter VIP logo

seizure-detection-tensor-flow's Introduction

No one deserves a seizure from social media.

Detect seizure inducing images using Tensor Flow

Background

Earlier in March 2017, there was a lot of news coverage about an incident in the social media. Journalist Kurt Eichenwald received a tweet that stated "YOU DESERVE A SEIZURE FOR YOUR POSTS". The Journalist who suffered from epilepsy, got a seizure by looking at the image.

This incident has shown how social media could potentially be used as a terror weapon to inflict immediate physical pain and suffering to unsuspecting victims. Email, websites with user generated content are equally vulnerable to such attacks. In 2008 a hacker defaced the website of the Epilepsy Foundation and inserted flashing images which caused multiple health incidents to unsuspecting victims.

It is important for sites with user generated content to acknowledge this and take preventive action. Machine Learning can be applied to automatically detect images causing strobe behavior and block them.

Technical Details

TensorFlow is a an open source library for building machine learning models. In our case we will use an existing model and retrain it to detect seizure inducing images.This is called transfer learning. The popular Inception v3 model trained on ImageNet is used as the base model.

  1. TensorFlow is installed on docker. the image used is gcr.io/tensorflow/tensorflow:latest-devel
  2. Use Fatkun Batch Image downloader for chrome to search and download images of flashing strobe lighting.
  3. Follow the instructions in Google Code Labs to retrain your model.
  • With 500 Iterations, Final test accuracy was 86.8%
  • With 4000 Iterations, Final test accuracy improved to 91.5% and that is the model uploaded here as retrained_graph.pb
  1. Download test images to validate the trained model. Since I used google images to batch download training images, I decided to use bing image search for the test images. Couple of test images are uploaded under the test_images folder.

Notes

The animated gif needs to be converted to a jpg image for the model to work on it. This can be easily accomplished in the command line using ImageMagick.

Credits

seizure-detection-tensor-flow's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.