Showing posts with label Teaching. Show all posts
Showing posts with label Teaching. Show all posts

Wednesday, June 25, 2014

Nicaragua - Engineering World Health Summer Institute

I recently spent a month in Nicaragua as an instructor for the Engineering World Health (EWH) Summer Institute (SI). EWH is an amazing not-for-profit whose goal is to help hospitals in the developing world have access to expertise for maintaining and repairing their equipment. EWH's research has shown that while a respectable amount of equipment is donated to hospitals in the developing world, there is practically zero support for installing, maintaining, or repairing it. As such equipment donations often fail to make the desired impact because:
  • no one knows how to install it
  • no one knows how to use it
  • the donation comes without an instruction manual
  • the instructions aren't in the local language
  • the device was donated from a 50Hz country and cannot work without modification in a 60Hz country
  • the device uses consumables (pads, hoses, etc) which aren't provided and that are hard or impossible to procure locally
  • there is no local expertise for what to do when the equipment fails
EWH seeks to fill this void in a number of ways. The Summer Institute is a program where US students travel to a developing nation for two months. During Month 1, they learn the local language and receive training on medical device operation, troubleshooting, and repair. During Month 2, the students transition to regional hospitals where they work to support the hospital's medical equipment needs in any way they can. They also perform a detailed inventory of equipment to assist EWH in forecasting how to improve their support.

This summer, EWH is operating SI's in Nicaragua, Tanzania, and Rwanda. I was the instructor for the Nicaragua program during Month 1. Now that it's Month 2, I have returned home and the students are hard at work in their respective hospitals.

Our classroom! Always hot and often noisy. A big departure from the relatively
cozy confines of Temple's College of Engineering.
This was a wonderful teaching assignment for me because it was tough and therefore I was forced to learn a lot. I have a lot of general and theoretical expertise in medical instrumentation, but I haven't personally disassembled any ventilators or defibrillators so I was fairly worried about my ability to instruct others to do so. Fortunately, I had a lot of good support, including a former instructor with a zillion years of expertise who patiently answered all my late-night email questions. I did a total of sixteen lectures, (four per week for four weeks) and we covered the following subjects:
  • Lecture 1: Basic Circuit Theory
  • Lecture 2: Electrical Safety and Transformers
  • Lecture 3: Power Supplies and Batteries
  • Lecture 4: Ventilators and Oxygen Concentrators
  • Lecture 5: Pumps, Pulse Oximetry, and Blood Pressure
  • Lecture 6: ECG
  • Lecture 7: Defibrillators
  • Lecture 8: Fetal Heart Monitoring
  • Lecture 9: Infant Incubators and Warmers
  • Lecture 10: Lighting
  • Lecture 11: Apnea Monitor and Signal Detection Theory
  • Lecture 12: Electrosurgery
  • Lecture 13: Suction and Medical Gasses
  • Lecture 14: Anesthesia
  • Lecture 15: Autoclaves
  • Lecture 16: Motors

Did I mention it was hot?

There was also a series of (very!) hands-on labs where students had to solder, wire, debug, measure, and calculate any number of circuits relevant to medical electronics. The labs started out fairly straightforward (make an extension cord) but quickly got complicated (build a power supply and use it to charge a battery). The labs were a ton of fun and a good opportunity to show the students some hands on skills.

Practicing hands-on skills during lab.

Perhaps the best part of the experience was our weekly visits to the hospital, whose full name is "Hospital Amistad Japón - Nicaragua". As the name suggests, the hospital was built through a collaboration with the Japanese government. We were told that the Japanese have done a lot of philanthropic work in Nicaragua including overhauling the drinking water supply. Good for them. But I digress. The point of the hospital visits was to give the students hands on experience taking apart, reassembling, and troubleshooting medical equipment. The engineering staff there was excellent and incredibly knowledgeable. They already know full well how every piece of equipment in the hospital works and how to repair it. We were there to learn from them, not vice versa. They were very generous with their time and expertise and soon had us doing all sorts of tasks ranging from menial to sophisticated and 100% educational.

The hospital in Granada.

Because medical equipment is expensive and hard to come by (apparently all purchases must be approved by the national health ministry...) the engineering staff takes extraordinary precautions to keep their equipment operational. Every day they take perfectly functional equipment off the floor so that it can be cleaned and serviced. Preventative maintenance is in their DNA. This ethos extended beyond autoclaves and centrifuges - they also care for their ceiling fans, air conditioning units, and refrigerators with the same devotion. 

Even the motor from a lowly floor fan can teach you a lot!

Our students took apart and cleaned a lot of air conditioners and fans. But they also got to service baby incubators, centrifuges, autoclaves, ventilators, suction pumps, and nebulizers amongst others. In each case, we'd strip the device down as far as possible and then figure out how it worked as we cleaned it and put it back together. I thought the suction pumps were especially neat since their method of operation is elegantly simple. I also learned that a nebulizer is basically as suction pump running in reverse. Sometimes the lessons came from unexpected places. By taking a fan apart, I learned what permanent split capacitor motor is, and by taking apart a motor from a cafeteria meat grinder, I learned what a centrifugal switch is and why the motor needs it (the switch disengages a startup coil once the motor spins up to speed).

Taking apart an infant incubator to see how it works. The black
element radiates heat. The white disc object on the left is a fan
that moves the warm air into the infant chamber.
Taking apart a particularly dirty suction machine. The black stuff
inside the suction chamber is dried blood! At the bottom,
you can see the rubber diaphragm attached to the motor piston.
Its pumping motion is what creates a vacuum in the suction chamber.

Watching the engineering staff fix an x-ray film developing unit! With a
little cleaning and some oil, they got this thing up and running. I took
a photography class in high school and amazingly still remembered a bit
about the film developing process, so I was able to explain it to our students
who must have thought I grew up in the stone age.

One team tried putting a broken industrial dryer back into service. One of our savvy students found an english language warning sticker on the back of the dryer indicating that the gas would automatically be cut off if the exhaust duct was clogged. Of course their engineering staff couldn't read this warning and so had not thought to check the duct. Our students took it apart and sure enough it was very much clogged! They were able to clear a lot of the clog out - the dryer still isn't working but I'm pretty sure its a lot closer to functional than it was a month ago.

Mid-morning mango break!

We had one especially fulfilling experience where we were able to repair an infant incubator which had been on the fritz for over a year. The engineering staff had already repaired it but had somehow missed one connection (which to their credit was very hard to spot). I showed the students how to draw a circuit diagram by studying the circuit board, and together we determined that one of the connections on the circuit diagram had been overlooked during the original repair. A single soldered wire allowed us to turn the machine on! Then we noticed that the fuse kept blowing. Que tal? Our on-the-ground-coordinator (and lab instructor, and former EWH-SI student) remembered that its not uncommon for people to put the wrong fuse in a device. Sure enough, the incubator needed a 5 amp fuse but someone had put a 1 amp in instead. We swapped up to a properly rated fuse and lo and behold, the thing was functional. As far as I know that machine is back on the floor now, warming babies. That was a highlight of the trip, for sure.

Fixing the faulty circuit board in the infant incubator. As you
can see, the staff had already made a repair (after the board
overheated and partially burned!). We were fortunate enough
to spot a single unconnected trace and correct it.
Analyzing the circuit board.

My only regret is that I'm not around for Month 2 to visit students and keep learning about all these superbly interesting medical devices! And I'm also a bit jealous that they get to keep practicing Spanish - I'm worried I'm going to forget a lot of what I learned :-/

One final thought ... for the first time in a long time, I got to be a student again. We had Spanish lessons four days a week for four hours. I forgot that its sometimes hard work to be a student. Its hard work to sit and listen to someone speak at you. The classes were a lot easier to digest and a lot more fun when the learning was interactive. I noticed that after about two weeks of Spanish, I would have rather stopped learning new Spanish and instead focussed on becoming proficient at what I'd already learned. I suspect there's a lesson for me there in terms of how I approach teaching engineering. I try to be an upbeat and entertaining lecturer, but there's really no substitute for getting students to practice and become proficient, even if it means potentially teaching less material.

My Spanish notebook!

So that was that. A fulfilling and exciting chapter of my professional life. I hope EWH will have me back to teach again one day. Africa? Middle East? Sign me up!

Monday, October 14, 2013

Temple Made: Mark Halberstadt

Temple Engineering attracts a lot of really cool, interesting students. They are tenacious, creative, hard working and driven to succeed. Mark is one such student. I've had him in a couple of courses during which time he voluntarily made youtube videos of my lectures, Khan Academy style. It was really nice to see him profiled by Temple News. Couldn't have picked a better guy.

Here are the videos Mark made from my lectures:

Tuesday, August 21, 2012

ECE 3512 - Signals

This past spring semester, I had a really good student who decided to record every lecture I gave for my Signals and Systems (ECE 3512) class. He recorded the audio with his iPhone (usually) and recorded the lectures by doing screen recordings on his laptop while taking electronic notes with a wacom tablet. He posted all the lectures to youtube and ... lo and behold:



Pretty slick, eh? Let me know if you can sit through the whole semester!

Friday, April 29, 2011

Lindback Distinguished Teaching Award

So I won a Lindback distinguished teaching award! I got a nice certificate and got fed a fancy lunch with the President of the University. All is good. There's a nice writeup in the Temple newspaper which you can read here.

Thursday, March 17, 2011

Lecture 8

This week we moved on to some new material, taking a look at how we can write accurate mathematical descriptions of the electrical properties of neurons. In particular, what goes into modeling membrane dynamics? What can we infer about membrane structure from the models? And can those models be simplified without sacrificing too much accuracy?

Our reading was Chapter 5 of Dayan and Abbott, which does an excellent job discussing the physical underpinnings of membrane capacitance and resistance. The chapter also discusses the Hodgkin-Huxley model of electrically excitable cells, which is perhaps one of the finest basic science experiments of the 20th century. Hodgkin and Huxley did a series of painstaking experiments from which they deduced the microscopic structure and function of the membranes of electrically excitable cells. They determined how ions such as sodium and potassium flow across cell membranes in order to effect flow of current, and how this leads to action potential formation. Although there are a number of details to keep track of, the essential mechanics of membrane behavior are not more sophisticated that first-order differential equations. The Hodgkin-Huxley membrane model simplifies to four interconnected first-order diff-eqs that can be easily solved by any number crunching software (we prefer Matlab, although C/C++ will work in a pinch ;). My Matlab implementation of the Hodgkin-Huxley code can be found here. Next week we'll discuss some of the simplified models in detail, such as Integrate and Fire, as well as the notorious Izhikevitch model.

There was an interesting question about whether alternative computing platforms can be used to accelerate neural modeling. It turns out some at Georgia Tech have been trying to use FPGAs for neural modeling. Interesting papers can be found here and here.

Someone brought up the really fun question of why even bother writing mathematical models of neural activation. Fair question! Answering this question led to a lively discussion on improving medical devices such as pacemakers by trying to predict how changes to the device (or its placement) would affect functionality. Cardiac pacemakers are a great example actually: high quality electrical models of cardiac tissue are routinely used to make predictions about how to optimize performance by changing either the properties of the electrical stimuli or perhaps the locations in the cardiac muscle where those stimuli are delivered. Along those same lines, we discussed deep brain stimulation, which is commonly used to treat movement disorders such as Parkinsons and Essential Tremor. I brought up the point that despite its efficacy, there is much debate on how exactly DBS works. Neural models are being used to study DBS and to make predictions about how stimulating various parts of the brain can curb the effects of these diseases. Some incredible before-and-after video of DBS patients can be found here.

Monday, March 14, 2011

Lecture 7

This week we really swung for the fences! We read Sections 4.2 and 4.3 from Spikes (by Rieke) which cover neural coding of hyper-acuity in the bat and the fly. The fly visual system is pretty amazing - the fly can detect very small changes in its visual field far faster than can be explained by the raw speed of the visual system. It does this by integrating over a large number of broad receptive fields, thereby obviating the need for spatial oversampling. Pretty neat stuff!

The experiment described in the book goes like this: a fly is shown a random pattern and then that pattern is shifted by some small amount. The fly's H1 neuron is then monitored by dividing time from t=15-40ms post stimulus into 2ms bins and assigning a "one" (spike) or "zero" (no spike) to each of the 13 bins. (it takes 15ms for the signal to reach H1, and after 40ms, the fly has already reacted to the stimulus, meaning the signal has already been interpreted). There are therefore 2^13 possible outcomes of this experiment. The trick is to examine the contents of those 13 bits and determine whether the fly observed a pattern shift of x degrees or y degrees.

Spiking is, of course, a stochastic event - spike trains are probabilistic, not deterministic. We learned how to use signal-to-noise ratio to quantify the separability between two populations of spiking patterns, spiking patterns contributed to signal to noise ratio, and, most interestingly, that most of the information separating two populations comes in the timing of the first spike.

In general, this was a good conversation and a very tough piece of reading. I think next year this lecture could stand to be better developed, perhaps with some external readings and some simulated Matlab code.

Saturday, March 12, 2011

Lecture 6

In Week 6, we focussed on specific methods of spike decoding, spending most of our time on linear decoding methods as spelled out in Kim 2006. We started by discussing the general concept of linear decoding, specifically that the firing rate of each neuron (at a specific time lag) is linearly related to the kinematic parameter of interest. Mathematically speaking we might say:

x(t) = Sum{wij * nij(t)}

where x(t) is the kinematic parameter being predicted and nij(t) is the number of times neuron "i" fired at the "j"th time-lag. The "wij" terms are the linear coefficients; these weights can be any real number, positive or negative. In reality, no known neuron actually fires linearly with respect to a kinematic parameter, but if we include enough lags and enough neurons in the model, we should be able to approximate reasonable kinematic behavior.

The trouble becomes finding acceptable combinations of weights, "wij". If our experiment includes 300 neurons at ten lags each, then there are 3000 weights altogether that must be approximated. This problem is poorly formed numerically and lends itself to non-singular matrices and non-optimal solutions.

The Kim paper essentially discusses methods of solving for the filter weights. The most basic is the optimal Wiener filter, and its closely related cousin the normalized least mean squares filter (which converges to the Wiener solution, at least in theory). The Kim paper also discussed the Kalman filter (which models both filter weights and their uncertainty), as well as the gamma filter (which condenses the neural signal in time) and the principal component filter (which condenses the neural signal in channel-space, with respect to maximal variance).

We also looked at some Matlab code I wrote that duplicated much of the math in the paper. One lesson that we observed off the bat is that the models all work reasonably well provided that the kinematic parameter always stays in the same range of values used during the training phase.



We also set out to look at Li 2009, which uses a modified unscented kalman filter to track neurons. Their UKF system uses a non-linear (quadratic) neural firing model and also takes temporal correlations into account. Unfortunately, we didn't get to spend as much time on this paper as I would have hoped, but at least everyone read it ;)

I didn't get as far as I would have liked with my neural decoding simulator - I would still like to code up the gamma filter and the extended kalman filter, but those will have to wait for a rainy day.

Sunday, February 20, 2011

Lecture 5 - Spike Decoding

Lecture 5 was a lively one! This week we started talking about neural decoding algorithms. These are methods for trying to estimate what large numbers of neurons are 'thinking' about in real time. We started with an old standard, Georgopoulos 1986, which presented the concept of population vectors. The article was relatively easy for everyone to understand although we did note that most of the results validating their method were not published in that article. Still, the paper represents a landmark bit of thinking and we gave it its due.

The next article we discussed was at the request of one of our classmates who was in the process of reviewing a Schwartz paper for some other journal club she attends. The paper, Jarosiewicz 2008, discussed strategies monkeys undertake to compensate their brain machine interfaces when the preferred directions used in the population vector are rotated out of synch with the monkey's true preferred directions. It turns out the monkeys use a combination of three strategies: (1) changing their 'aim' to offset for the mis-tuned neurons, (2) reducing the relevance of the affected neurons on the BMI control, and (3) retuning those neurons to match the rotated preferred directions. It was an interesting and well done paper, but there was some interesting debate about whether the experiment revealed anything that wasn't already fairly obvious. Someone raised the point that what would really be interesting is to understand the mechanisms that underly the observed changes (as opposed to just knowing what those changes were).

The final paper we discussed was Quiroga 2009, which gives a solid background into the fundamental statistical issues underlying neural decoding. Everyone seemed to praise this paper for its readability and scope. The paper explained the difference between neural decoding and information theory. The take-home message was that, while a BMI can implement a successful neural decoder, there is still a lot of information encoded in the neurons that is simply being discarded. The concept of information theory (i.e. mutual information) allows us to calculate numerically exactly how much information the decoder misses. Such an objective measure is a vital tool for comparing the efficacy of different decoders. The Wikipedia page on mutual information gives a nice introduction into the math underlying that technique. We also discussed a paper written by my old lab mate Debbie Won where they used mutual information to quantify how much information is lost when neurons are mis-detected and mis-sorted. Its a great (albeit quite dense) paper. We finished off the class by creating an Excel spreadsheet that calculated some basic information theory numbers for a simple example; we changed the prior probabilities and tried to predict how the information content would change.

Next week we will tackle two more spike decoding papers that go into a lot more mathematical depth than anything we've dealt with so far. Stay tuned for the report!

Saturday, February 12, 2011

Lecture 4 - Neural Engineering

This week we started to get into specific signal processing issues. Our reading was the excellent technical BMI summary by Linderman et al (published in IEEE Signal Processing Magazine) from Dr. Shenoy's lab at Stanford University. The article discusses in some technical depth the signal processing stages of a BMI and then discusses their efforts to implement these steps as wireless and/or implantable electronics.

Our main topics of discussion were (a) electrode longevity, (b) spike sorting, (c) neuron tuning, and (d) statistical models of neural behavior. The electrode longevity question was especially interesting since its such a substantial obstacle and there are very few concrete ideas about how to extend the life of electrodes in the brain. The primary issue is that the brain eventually treats electrodes like foreign objects and initiates an immune response that results in the electrodes becoming coated with microglia and other scar-like tissue.  We also discussed electrode movement in the brain, what the ramifications are for the stability of recorded neurons (its not good) and how it might be overcome. We had some good discussion about whether larger electrodes might be the solution, since they would have a wider "listening" radius and would therefore be more resilient to micro-movements. It would seem like the flip side of the equation is that larger electrodes would record from more neurons which would increase the incidence of overlapped spikes. Decoding overlapped spikes is certainly possible but perhaps not in a computationally efficient manner.

Finally we spent a solid hour discussing spike sorting. We started by introducing the concept of neural tuning functions, since this motivates the need for spike sorting in the first place. We quickly looked at Georgopoulos' landmark 1982 paper in which he discovered that motor neurons were tuned to arm movement direction in a roughly cosinusoidal manner. Following that, we looked at some demo Matlab code I put together to demonstrate the concept and the math behind spike sorting. We started with some very simple methods (thresholding and windowing) and moved on to more sophisticated methods such as feature extraction (we tried spike amplitude and width) followed by principal component analysis (which is basically just another feature extraction technique). We discussed the concept of clustering, in which spikes with similar features are automatically clustered together. In particular, we examined the k-means clustering method (a built-in Matlab function!) which works pretty well provided you tell it ahead of time how many clusters you are looking for. We discussed some of the pros and cons, including the need for at least partial supervision in determining thresholds and cluster shapes and numbers. The figure below shows our sample data set thats been sorted using PCA and k-means clustering.

Next week we'll be looking at neuron decoding. I'm off now to find a good reading for next week and to develop a good chunk of Matlab demo code!

Monday, February 7, 2011

Lecture 3 - Brain Machine Interfaces

In Week 3 we started to get into the specifics of neural engineering - in this case we looked at brain machine interfaces, focussing on work of the Nicolelis Lab at Duke  University. In the first half of the class, we finished discussing Chapter 3 of my dissertation (see my Lecture 2 post). This chapter gives a good general overview of biomedical data acquisition. We discussed technical details such as input impedance, gain, filtering, analog to digital conversion, bit-rates, and spike detection.

Following that, we delved into the very helpful review paper by Lebedev and Nicolelis (2006 Trends in Neurosciences). This paper outlines the different types of Brain Machine Interfaces, discusses their relative strengths, and goes into some detail about the roadblocks moving forwards. These roadblocks are summarized as: implantable data acquisition devices, developing real-time computational algorithms, design realistic artificial prostheses, and incorporating sensorimotor feedback.

Upcoming this week, we will be discussing "Signal Processing Challenges for Neural Prostheses" by Linderman et al., in which we will finally start to delve into some mathematics.

Tuesday, January 25, 2011

Paying attention in class

This Doonesbury comic just about sums up the mysteries of undergraduate teaching! (click the thumbnail below for the full strip)

Lecture 2 - Acquiring Bioelectrical Signals

A custom integrated circuit that I designed in grad school for conditioning neural signals.
This week's class will be focused on the problem of how one acquires bioelectrical signals from the body. This necessitates an understanding of electrodes and their interactions with the body's electrolytes, as well as analog signal conditioning and digitization. We will use the brain machine interface as an example data acquisition system, since the concepts involved are fairly general and are hence applicable in other domains. Readings include chapters 1 and 3 from my dissertation(!) as well as Chapter 5 from the venerable book "Medical Instrumentation" by Webster.

Here are the discussion topics I emailed to the class:

Dissertation Chapter 1
What are the things you typically have to do when making a biological recording? Describe the pathway from electrode to computer. What are the details along the way that affect design constraints for the engineer?

Dissertation Chapter 3
You can focus your reading on sections 3.1 - 3.3.
Relate the design that I present in this chapter to the general design constraints laid out in Chapter 1. How do the properties of the neural signals I'm trying to capture impact the design of the data acquisition hardware?

Webster Chapter 5 (Electrode/Electrolyte Interface)
Sections 5.6-5.9 can be skimmed (or skipped if you're pressed for time)
What is the electrode/electrolyte interface? How do the chemical processes involved drive electrode designs? What are polarized and non-polarized electrodes? What are the pros and cons of each? What is motion artifact and how do we protect against it? What is the circuit model for the electrode/electrolyte interface and what does it tell us?

Thursday, January 20, 2011

First Lecture

The first lecture was mostly a success, although I'm as nervous as ever about the variety of backgrounds in the classroom. Adapting to the strengths of the class will be key. I'm also going to have to work to make sure the class has the desired feel of being a journal club and not a lecture. This might be hard considering that as many as 14 students will be taking the course.

Today we covered the basics of electrical engineering circuit and linear systems theory. And on top of that we covered the very basics of neuroanatomy. Not too shabby for one 2.5 hour session. The ECE theory came from a powerpoint presentation I gave a couple of years ago to some Neurology residents. The neuroanatomy review came from Chapter 1 of "Neuroscience" by Purves et al. The bio-types in the room didn't complain too much at my review of neurons and synapses, so either they are too polite to complain or I got most of the details at least partially correct ;)


There were many good questions - for example we talked in detail about why differential recordings are so important in biomedical settings (big offset voltages that need rejecting...). We also had a marginally uncomfortable chuckle over why the ears are so heavily represented in the homunculus - yes, they are very sensitive, but why should that be the case? Its not like they are fingers with their abundant dexterity. Hmm. We left that question open for a later date.

Next week we'll tackle instrumentation in more detail, including the electrode-electrolyte interface and common types of electrodes.

Intro to Neural Engineering


This week I'm kicking off my new graduate course "Intro to Neural Engineering". The goal is to introduce students to the concepts of neural engineering including both the scope of the field as well as some of the specific techniques. Since I've never taught this course before (indeed, I don't even think its been taught elsewhere all that much) it should be a real seat of the pants experience.

I'm going to have students treat this like a glorified journal club - every week one or two students will be responsible for guiding a discussion on a reading. Readings will come from textbooks, peer-review literature, and possibly even general-interest non-fiction. Additionally, students are going to have to roll up their sleeves and actually try implementing some of the techniques we'll be reading about. This could involve coding up a particular mathematical technique or building a circuit to do data acquisition of some sort.

One of my main challenges will be the range of students. Of the 11 students registered, I have two PhD students in Electrical Engineering, about six MS students in EE, two neuroscience students, and a physical therapy student. Thats a bit of a mixed bag! Figuring out how to keep all these abilities interested will be a real challenge...