Tuesday, June 16, 2009

Facebook Application: Spot the Fake Smile Quiz

Web development has always been a hobby of mine. I enjoy it because it provides a more artistic outlet than typical programming. That's not to say that designing program architectures and writing code doesn't require creativity; rather, sometimes I like to create something visually appealing. Sometimes I like to dabble in Photoshop as well.

Also, websites and web applications often have a more direct social impact. One day while browsing the BBC website I stumbled across this online quiz where you are asked to spot the difference between fake smiles and real smiles. The theory is based on the work of Guillaume Duchenne who discovered that people who are genuinely smiling have raised cheeks and crow's feet (wrinkles in the outer corner of the eyes).

I thought that it would be interesting to see how well my friends and colleagues could spot the fake smiles, so I decided to create a Spot the Fake Smile Quiz Facebook application where users can post their quiz results to their profile feed. My first task was to find free-to-use photos of smiling people and determine myself if their smiles were real or fake. In order to remove any errors in my classification, I only used photos available under the an appropriate Creative Commons license where the author commented on whether the subject's smile is fake or not.

Some of the technologies I used to develop the application include HTML, CSS, PHP, AJAX, JavaScript, JSON, and mySQL. I slightly modified some jQuery code to create the photo sliding effect. I decided not to use the special FaceBook Markup Language (FBML) tags and instead embed my application in the Facebook webpage as an iframe. I found that this approach provided me with more freedom over the layout of my application and allowed me to use the web technologies that I'm already familiar with. Also, FBML applications require special modification to use jQuery, which was a major turnoff. The differences between the two approaches are explained here.

000webhost.com is an excellent free web hosting service that I'm using to host my application.

Monday, June 1, 2009

Work History Part 5: RIT CS Dept. Teacher's Assistant

Location: Rochester, NY
Position: Teacher's Assistant and Student Lab Instructor
Period: September 2008 - May 2009

This job was my saving grace. The CS dept. had an excellent arrangement where they would pay for 100% tuition costs and give out a multi-thousand dollar stipend in exchange for about 20 hours of TA work per week.

I enjoyed teaching new students about object-oriented programming and the difference between references and pointers. Some of the student projects were interesting too, like solving the traffic jam puzzle and peg board game.

Responsibilities and accomplishments:
  • Taught computer science labs in Java and C++.
  • Graded student programming assignments.
  • Answered student questions in the mentoring center.
  • Held CS1-CS4 test review sessions.

Thursday, May 14, 2009

Object Tracking using Particle Filters

During my first year as a computer science grad I took a course in advanced computer vision. The class was divided into teams and each team could choose one of two projects to work on. The first project involved identifying students as they walked into a classroom based on their facial features. The second project involved tracking students as they walked into the classroom in-between other students. My team decided to work on the second project because my partner and I were both interested in motion tracking at the time.

We developed 3 systems with various degrees of motion-tracking success:
  1. Kalman filter. Actually the particle filter developed by Cuevas, Zaldivar, and Rojas which is based on the Extended Kalman Filter (EKF). Some success.
  2. Kalman filter with spring forces. Attempt to use multiple particle systems linked by spring forces to track multiple parts of a subject's body. Limited success.
  3. Hierarchical particle filter. Based on the work of Viola and Jones and the work of Yang, et al. Uses rectangular windows for feature extraction. Quite different from the Kalman filter and the 2 systems described above. Most successful.
A lot of time was spent adjusting the particle set properties used by the first 2 systems for each student test video. The third system is more robust and doesn't require as much custom-tailoring to the video to which it is applied.

The particle filter presented by Cuevas, Zaldivar, and Rojas attempts to track a small color distribution within a circular window centered around a target pixel.

Alternatively, the approach presented by Viola and Jones employs a rectangular target window to determine the relative position of average color intensities within an area of the video.

Viola and Jones had great success detecting faces using the target window to capture the average color intensity around a person’s eyes and the average color intensity of that person’s upper cheeks. It's a very simple concept but it works well in practice because of the intensity difference between those two regions of a person's face. In general a person's upper cheeks are much brighter than the inset region around their eyes.

Resources:

Sunday, May 10, 2009

Mobile Robots Programming: Retriever

During my third quarter as a computer science grad I took a course in mobile robot programming. Students were required to use the Player network server to control a Pioneer 2 DX (differential drive) robot with an 8-point sonar array and bumper array built into the front of the robot.

Using the Player interface, programs can be written on a laptop attached to the robot via an ethernet cable. In such a setup the laptop provides most of the processing power while communicating with the robot's sensors and actuators via an IP connection. Programs can be tested before controlling the hardware using the Stage simulator, which can simulate sensor readings and objects in a 2-D bitmapped environment.

Teams of students were asked to write control software capable of guiding the robot to a number of predetermined locations on the third floor of the GCCIS building, making sure to avoid other robots and innocent human bystanders on the way as well as successfully maneuvering along walls and through door frames when required. The idea was that there were items at each intermediary location that needed to be retrieved before traveling to a final destination.

To accomplish this the robot needed to perform 3 major tasks: localization, path planning, and path execution. The robot was guaranteed to start in one of 8 known poses (location and orientation), however, it did not know which of those locations it started in. We had the robot determine its starting pose by detecting known landmarks in the environment near its starting location, such as pillars and walls, and narrowing down the set of possible locations until it was left with the most probable one.

After localization the robot planned a path to the destinations specified in a user-provided input file. Path planning was aided by the fact that the environment was known a priori. The robot was provided with a black and white raw image file of the layout of the third floor of GCCIS that it converted to a rudimentary obstacle map. A probabilistic road map (PRM) approach was employed to plan a path from one location to another using the obstacle map.

Each path that was planned consisted of a series of waypoints. The entire path itself may have been complex, but the path between any 2 waypoints is nothing more than a straight line. The robot navigated the path between each pair of waypoints by using potential field motion. This addressed the issue of obstacle avoidance because the robot was repulsed by obstacles in its environment while being attracted to its current goal.

Resources:

Thursday, February 12, 2009

NeuroEvolution of Augmenting Topologies

During my second quarter as a computer science grad I took a course on neural networks. As mentioned in a previous post, I had previously taken a course in pattern recognition. Since I already knew quite a bit about neural nets I decided to research the topic of NeuroEvolution of Augmenting Topologies (NEAT) instead of work on the scheduled class project (comparing the performance of feed-forward, recurrent, and radial basis function neural nets).

NEAT is a genetic algorithm for evolving artificial neural networks that protects innovation by dividing network types into species based on similar characteristics. During crossover new networks inherit nodes and node connections from their parent networks to form a new network structure. Node genes and connection genes are labeled with innovation numbers so that as those genes can be tracked as they are passed on to future generations. After crossover new networks undergo mutation where new nodes or new connections are added to the network and connections weights are adjusted by a random process.

Unlike traditional learning where connection weights are adjusted via a backpropagation technique, NEAT selects members from the spawned population, called genomes, for breeding. The evolved members are composed of nodes with sigmoidal activation functions that behave in the same way as traditional multi-layer perceptron networks.

Using jNEAT, a Java implementation of NEAT, I attempted to solve 2 different classification problems. The first problem was to classify 150 iris samples as 1 of 3 breeds based on 4 features. The second problem was to classify 178 wine samples as originating from 1 of 3 batches of wine based on 13 features. After conducting a number of different experiments using various configurations settings, I was able to generate a network with 96% correct classification for the iris test dataset and a network with 85% correct classification for the wine test dataset.

About a year later I went on to apply the concept of speciation to a genetic algorithm in my masters thesis.

Resources: