We wanted to develop a lightweight, easy to use alternative to current object recognition options. Most of these systems require an exhaustive understanding of the their development environment, and require significant time to prepare for use. One of our main goals was to make a faster, generalized solution to this problem for developers looking to enter the field of image processing and machine learning.

What it does

Given a set of labeled folders containing sample images, a recurrent neural network is trained to classify the objects contained in the image under the label of the folder. Both positive (images with the object) and negative (without the object) images are required to train the network to properly decide if an image contains the desired object. Once the neural network is done being taught, it is able to very efficiently determine the existence of a specified object in an image. Furthermore, this system was designed to be easy to modify, use, and port to other platforms. To create an optimized network, the user need only download the program and create folders with positive and negative images for training. The parameters are all contained in an easy to edit text file, and once the network is sufficiently accurate at recognizing objects, it can be exported and recreated on other systems for very efficient image recognition.

How we built it

We used Java to implement a recurrent neural network. The neural network is hosted on an Amazon Web Services EC2 server that receives images from a client. The actual network is trained by a genetic algorithm which utilizes a fitness function to perform mutations and crossover on neural networks with uniquely weighted synapses. The individual networks which identified the most objects correctly were considered the "fittest," and propagated on to the next generation. All of the code was built from scratch, no frameworks were used.

Challenges we ran into

Testing the neural network turned out to be a big challenge. Typically training takes anywhere from a couple hours to a few days, making them very challenging to test. In addition, this placed us under a much tighter time constraint than most teams, since we needed to afford adequate time to learn how to classify images. Moreover, the theory behind these systems is very dense, three of our group members spent the first 8 hours of the hackathon reading research papers and learning as much as possible about implementing neural networks. We also ran into many heated debates about the correct parameters to use. Neural networks have many parameters that have a huge but totally unpredictable impact on learning speed, so we frequently debated these design choices.

Accomplishments that we're proud of

We created a well documented, well designed, functioning open source project in roughly 24 hours of coding (due to network training time and research). Building a neural network from scratch is no easy task, especially over a weekend. Coupled with the fact that none of our team members had much experience with coding neural networks, we all accepted the fact that we were unlikely to complete our project. Creating a program that successfully learned automatically and working at all was an awesome experience. To us, this incredible feeling of personal achievement will make Hack Illinois unforgettable.

What we learned

We learned a huge amount about genetic algorithms and recurrent neural networks. Due to the opaque nature of neural network functionality, first hand experience is the best way to gain a deep understanding of them. Along the way, we also learned a lot about OpenCV from research and from hackers as we discussed our project with others. Overall, we have a greater understanding of artificial intelligence and image processing now than ever.

What's next for NeuralOR

Given time constraints, we were unable to implement the optimizations to the neural network that we planned. In the future, we are hoping to implement a NEAT neural network. We created the functionality to export the trained network as a file that can be recreated, but we did not have time to build native apis for other systems to easily run these networks. We have future features and optimizations commented throughout our code where we found better implementations but were unable to complete them. We also hope to create an iPhone or Android application to demonstrate the portability of the neural networks created by the genetic algorithm. Lastly, we aim to polish our github page by including example projects, tutorials, and a detailed readme including documentation.


We believe that with some more development and optimization, this project could be used to extend OpenCV. As we developed this project we were frequently asked about how this project fits into a world where amazing open source computer vision like OpenCV exists. OpenCV contains two very good methods for object detection (Haar feature-based cascade classifiers and FLANN) which provide image recognition and object tracking within an image. However, it has no extremely efficient method for pure object recognition without tracking (to our knowledge and according to our research). Neural networks have been shown to compute image recognition results as accurately and significantly faster than either of OpenCV's methods. We believe that a system like this could easily be adapted into OpenCv for applications that do not require tracking, and therefore is qualified to win the Missing Piece Award.

We also believe that this is an excellent tool for hackers at hackathons, because it can be trained automatically to classify and recognize images. Since it is lightweight and designed to be ported to multiple systems, newer hackers would suddenly have access to technology that up to this point has been difficult to begin using. Therefore, we think that our hack should be considered for the Hackathon Hackers award.

As for the Facebook's favorite award, we were really excited about being able to create a program that could learn on its own (while we caught up on sleep) in just 36 hours. We had plenty of other good ideas for applications of artificial intelligence that we plan to use at future hackathons, so we would love the opportunity to attend the Global Hackathon at Facebook.

Built With

Share this project: