Sunday, August 1, 2010

Work History Part 7: RIT Electrical Engineering Dept.

Location: Rochester, NY
Position: Software / Firmware Engineer
Period: June 2010 - December 2010

Ever since I began my thesis work I've had a growing interest in applying my skills to the field of medicine and medical research. I find devices that interact with the underlying biomechanical processes of the human body fascinating. I enjoy learning about how the human body functions and technological advances ranging from neural modification to gene manipulation and artificial limb development.

Through the recommendation of a certain kindhearted software engineering professor, I was put in contact with the up-and-coming RIT Biomedical Engineering Dept. Within a matter of days I was hired by the RIT Electrical Engineering Dept. (which forms the backbone of the new biomedical engineering dept.) to begin working on the body area sensor network (BASN) project.

The BASN consists of multiple wireless nodes strapped to a user's body. Each node is about the size of a watch and the band is similar to a watchband. Each node collects biometric information, such as body temperature and limb orientation and acceleration, based on where it is positioned on the user's body. Each collector node wirelessly sends data back to a central access point. In turn the access point aggregates all of the data and wirelessly sends it to a USB dongle attached to a host machine where it is processed by a host-side application.

Each node consists of custom-designed PCB architecture and firmware API. A complementary API allows host-side applications to communicate with the nodes using the USB dongle. The centerpiece of each node is the Texas Instruments CC430 microcontroller. Wireless communication leverages the Texas Instruments SimpliciTI protocol.

The goal of the project is to implement a development platform that will allow future developers to create custom applications such as:
  • Seizure / muscle tremor detection and patient caretaker alert system.
  • Local positioning system using dead reckoning from a known starting location. Can be used to track firefighters as they enter a burning building.
  • Wireless electrocardiograph (ECG). Current ECG models use 10 wired electrodes and are cumbersome.
  • Soldier injury detection system. In a battle scenario, the command center can track the physical condition and stress levels of soldiers in the field.
Responsibilities and accomplishments:
  • Developed 3D proof-of-concept applications demonstrating the ability to capture and process biometric data.
  • Leveraged existing firmware to set up a low-power RF communication network between wireless nodes and a host-side USB dongle.
  • Implemented a device driver in Linux to provide an API for interacting with the RF network through the host-side USB dongle.

Saturday, July 10, 2010

Safari 5 and Flash Player 10 Woes

Lately Safari has been prone to freezing (pinwheel of doom scenario) and other undesirable behavior when browsing Flash-intensive websites. The problem seems to occur when viewing videos on Youtube or other websites. Stopping one video mid-load and then starting to view another video will often cause Flash to go belly-up. Sometimes when this happens the <div> where the Flash video should have been appears empty. The problem is usually corrected by restarting Safari.

FYI, I'm running the 64-bit version of Snow Leopard on a 2.4 GHz Intel Core 2 Duo MacBook Pro with 4 GB of RAM and in general I'm very satisfied with its performance.

Could this problem be related to Apple's decision not to allow Adobe to develop an implementation of Flash for Apple's hand-held consumer devices, such as the iPhone? Steve Jobs stated that Flash is a closed platform not suitable for open application development. He also stated that problems related to running Flash is the number one reason macs crash. It's kind of strange that I'm noticing such problems a lot more now that Jobs has made that statement, but then again it could just be my imagination.

In Adobe's defense, CEO Shantanu Narayen states that Flash is not a closed platform and that Flash does not cause macs to crash, rather those problems are related to underlying issues with the Mac OS X.

While many geeks feel that Flash should be phased out entirely in favor of the up-and-coming HTML5 video format, I personally feel that Flash still has a place when it comes to ease-of-development for interactive web content. At least for a while until HTML 5 has time to mature and gain wider acceptance. This video from Google's annual web developer conference demonstrating HTML5 in action is pretty slick:

Saturday, June 26, 2010

3 Partition Trifecta: Mac OS X, Ubuntu, and Windows

I recently installed Mac OS X, Snow Leopard, Ubuntu Lucid Lynx, and Windows XP on my MacBook Pro in 3 separate partitions. This guide was very helpful.

Some of the things I learned are:
  • Windows XP must be the last partition. Mac OS X is my first bootable partition and Ubuntu Lucid Lynx is my second.
  • Boot camp will not recognize the Ubuntu partition. VMware Fusion running within the Mac OS X partition will not recognize the Ubuntu partition either. I hear you can hack some configuration settings to make it happen, but doing so will most likely corrupt the Ubuntu partition.
  • The windows partition must contain a Master Boot Record (MBR) to be bootable. Be careful when installing Ubuntu after installing Mac OS X and Windows. The installation procedure likes to overwrite the MBR by default.
  • No matter which OS you're running, all modern hard drives are limited to 4 primary (bootable) partitions. One of those partitions can be an extended partition and divided into as many logical partitions as you want though.
  • Mac OS X uses the Globally Unique IDentifier (GUID) partition scheme to layout the partition table on the hard drive.
  • The Mac OS X boot loader is located in /System/Library/CoreServices/boot.efi and runs as an Extensible Firmware Interface (EFI) application.
  • EFI replaces the need for a dedicated boot loader (such as the BIOS firmware interface) and is responsible for kicking off other boot loader applications.
  • In order to boot Ubuntu, GRUB (GNU GRand Unified Bootloader) must be installed in the Ubuntu partition. The Ubuntu installer will do this automatically.
  • You can create a swap file in Ubuntu instead of specifying a partition for swap space during installation. You can create the file from within Ubuntu while the OS is active.
  • GParted (Gnome Partition Editor) is a useful graphical tool for checking and resizing partitions from with Ubuntu.
  • The Mac OS X partition can be non-destructively resized using the diskutil command-line tool; however, you must ensure that there is enough free space at the end of the Mac OS X partition if you wish to shrink it.
  • iDefrag is an excellent commercial tool for compressing Mac OS X partition data and moving it towards the front of the partition. I had to start my MacBook Pro in target disk mode and attach it to my old PowerBook G4. I then ran iDefrag on my PowerBook and targeted my MacBook hard drive.
I use the rEFIt (re-fit) boot menu to choose which partition I boot into after my laptop starts up. As you can tell by its name, rEFIt takes advantage of the EFI capabilities of Intel Macs and other EFI-based machines. It's very slick and is installed directly from within Mac OS X while the OS is active.

Tuesday, June 22, 2010

Masters Thesis Part 3: Algorithm Overview

I represent each RF using a multivariate Gaussian distribution with a mean vector (position), covariance matrix (alignment and size), and gain factor (response magnitude). I determine the value of each of these parameters for each RF using a competitive algorithm where the result of a custom greedy algorithm competes against the result of a genetic algorithm. Gaussians are trained one at a time in a staged approach so that the addition of each new Gaussian to the model takes into consideration the effects of all of the previously trained Gaussians.

Actually, the genetic algorithm applies a little more intelligence by dividing a population of Gaussians into species based on similar characteristics and mating (i.e. crossing-over) the best performing Gaussian members within the same species during each generation of evolutionary training. The addition of each new Gaussian to the model attempts to address some residual error in the model resulting from recorded neuron firing rate response values that have not yet been fully explained by the addition of previous Gaussian distributions. The theory is that the best performing Gaussian of each species is associated with a different local minima in the residual error search space, thereby increasing the chances that one of those Gaussians is associated with the global minimum. The Gaussian which results in the greatest drop in residual error among all of the species is selected and added to the model.

The Gaussian model (also known as a Scaled Gaussian Mixture Model) is then used to extract features that are fed into a linear regression (LR) technique. Why is LR necessary on top of the Gaussian model? The reason is because not all RFs are the same. A great deal of research indicates the existence of hotspot segments in the visual field which have a major impact on the response values generated by RFs in non-hotspot segments. Specifically, the directional preference of RFs associated with hotspot segments plays a major role. Thus, the response value of RFs associated with hotspot segment needs to be weighted differently than those for non-hotspot segments and the response values each segment needs to be divided into directional contribution vectors that are each weighted differently.

Overall my algorithmic approach trains models that are capable of predicting neuron firing rate response values with moderate to high accuracy. As such my research offers support for a number of existing concepts in the field of visual neuroscience, such as the gradient hypothesis and opponent organization.

Read the full report (PDF) for a complete explanation.

Masters Thesis Part 2: Receptive Field Theory

So how did I go about creating a model capable of predicting individual neuron responses of primates to various patterns of moving white dots? The key was to use receptive field (RF) theory. In general, a RF is a physiological construct associated with an area of the visual field. Let's say you're staring straight ahead and perceive some motion across the upper right of your visual field. You may have a RF associated with that region such that as you perceive motion across it your nervous system reacts by speeding up (excitation) or slowing down (inhibition) the number of electric impulses between neurons in your visual cortex within a certain period of time.

Each RF is very simple in structure. Imagine a doughnut. The outer ring and missing center form 2 separate areas across which the RF responds to motion. There are 2 flavors of RFs. The first is on-center off-surround where motion across the center causes an excitatory response and motion across the ring causes an inhibitory response. The second is off-center on-surround, which behaves in the opposite way. Multiple RFs can be aligned in various ways to respond to various directions of motion. If you consider your visual field to be 2-D with an x-axis (left/right) and y-axis (up/down), you can place multiple RFs within that plane to respond to all kinds of motion.

An extension of the RF theory is that each RF has a directional preference. This makes sense if you think about how multiple simple on-center off-surround RFs and off-center on-surround RFs can be combined to form more complex RFs. With the addition of a directional preference, the 2-D visual field space becomes a 3-D RF space. The task then becomes a matter of placing RFs within the RF space, aligning them properly, sizing them properly, and understanding the relationships between them.

Read the full report (PDF) for a complete explanation.

Masters Thesis Part 1: Primate Experiments

My computer science thesis work (PDF) at the Rochester Institute of Technology involved analyzing the firing rate response patterns of neurons in the Medial Superior Temporal (MST) region of Rhesus monkeys, which resides above the temple on both sides of the skull. The primate experiments were performed by Dr. Charles Duffy and Dr. William Page at the University of Rochester Neuroscience Department.

Each primate was trained to sit in a special chair and stare directly at a red dot in the center of a rear projection screen covering 90 deg. x 90 deg. of his visual field. The rest of the screen was black. The primate was rewarded with sweet juice if he remained still and stared at the dot for 5 minutes. After successfully completing this task various patterns of moving white dots were shown in the screen, like snow in the wind (except with uniform density and constant velocity). The screen was divided into 9 segments (like the side of a traditional Rubik's cube). Each dot would appear at one edge of the screen and travel in a certain pattern before exiting at another edge of the screen.

The simplest patterns consisted of linear motion where all of the dots moved in the same vertical or horizontal direction across one of the 9 screen segments. More complex patterns consisted of linear motion in 2 of the 9 screen segments where the dots could be moving in different directions within each segment. The most complex patterns were designed to simulation self-motion and occupied all 9 of the screen segments. For example, imagine the old Windows starfield screensaver where the dots travel from the center of the screen outwards, which makes you feel like you're moving into the screen. A cylindrical piece of the primate's skull cap was removed and an electrode was positioned to record individual neuron firing rate responses as the primate perceived each moving pattern on screen.

My task was to design a mathematical model capable of predicting how the primate responded to self-motion patterns given his response to simpler patterns in regards to individual MST neurons. Why? To further our understanding the mammalian brain. Such a biologically-inspired model can potentially be used to program the AI for more realistic robots, or potentially be used to program the firmware for a cybernetic implant to help treat the sensory degradation symptoms of Alzheimer's disease patients.

Note that firing rate signals were captured in a region of the brain before any higher level cognition was performed. In other words, the response values were not affected by what the primate was thinking about when viewing the patterns on screen (i.e. bananas). Well, in theory that's what we'd like to believe.

Saturday, May 15, 2010

Work History Part 6: RIT Industrial Engineering Dept.

Employer: RIT Industrial Engineering Dept.
Location: Rochester, NY
Position: LabVIEW Specialist
Period: December 2009 - May 2010

The Electrophotographic Development and Transfer Station (EDTS) fixture was a generous donation by Kodak to the Print Research and Image Systems Modeling Laboratory in the Center for Imaging Science at RIT. I briefly mentioned this job in a previous post.

The ultimate goal is to use the fixture as a tool to teach students about the fundamentals of xerography. Additionally, the fixture exposes the internal components of a xerographic printing press, which makes it a desirable candidate for running experiments that require modifying individual components, spaces between components, carriage speeds over specific stations, etc. Xerox expressed an interest in using the fixture to analyze the characteristics of small-particle developer (i.e. toner) and examining its impact on print quality.

I worked directly with the P10503 senior design team and representatives from both Kodak and Xerox. All of the team's documentation can be found on their website. The project poster (PPT) provides a general overview. My primary objective was to modify the existing rudimentary LabVIEW software in order to execute control over all of the various electrical and mechanical components of the fixture. When I began the fixture could not print an image. When I left it could. I call that a success!

Responsibilities and accomplishments:
  • Led a 6-person team consisting of mechanical engineers, an industrial engineer, an electrical engineer, and a software engineer.
  • Implemented LabVIEW software to control a flat plate xerographic printing fixture through NI DAQ hardware.
  • Wired electrical and mechanical components, including stepper motors, DC motors, relays, high voltage power supplies, and electrostatic voltmeters.