Friday, December 25, 2009

2009: Blogging et al

It has been a long and tumultuous year. It was one year back that I made my entry to the wonderful world of blogging. From the blog that it was to the blog it is has been quiet a journey. I must thank my friends and my readers who have patiently read some of my good and not so good posts.

Thank you all. Sigh!

It has also been year where IIT has really shown its Aukaat, so as to say. 3rd semester hasn't been easy. First OP and then the wonderful grades that I managed all thanks to Signets. For the information of those who do not know - Signals and Networks is the most dreaded course in IIT Kharagpur in the 2nd year. Rumour has it that there was only one A and one Ex given in the course last year. And well... ah! my marks in the mid-sems weren't really great to put it mildly. [The Algorithms course didn't make help matters :( ]

I have turned into a weighlifter (no! it isn't the same as body-building. Please!!). And there has been an evolution in my outlook towards things all round. (That happens every year I guess!).

For me, it hasn't been about --- well --- whatever has been the news --- it has been a long drawn out struggle. But I won't draw my readers into it all. I remain the optimist that I have always been. And with that, here is Jazzy signing off for the year.

A Merry Christmas and A Happy New Year to all my esteemed readers.


Friday, December 18, 2009

Trudging Unknown Waters: Image Registration

It has been some time since my last post. Even after one year of blogging, the phenomenon called Writer's Block has intrigued me. There are times when it is difficult to come up with a post for days and then there are times when one comes up with posts back to back. Very difficult to understand unless one really faces it first hand.

It has also been quiet a hectic time. Life in IIT is not all that rosy as it is made out to be. I have been involved with a project on 3D deformable image registration using GPU. Here is an example of an image registration (2D) that I did using MATLAB.



What is Image Registration?

For those not in the know, I have used a very well known image in Image Processing - that of Lena Soderberg. It is often used as a standard test image. The first image is a deformed one (also known as the moving image) and the second is the static image. The moving image has to be transformed to match with the static image which is the result (the third image - the registered image).

Applications

One often uses image registration in medical imaging. Instead of a face, one might have a deformed state of the human lung. That becomes the moving image. It can then be transformed to match with a human lung in the normal state. This way one can integrate the data and work on the human lung.

As the wikipedia defines it, Image Registration is the process of transforming different sets of data into one coordinate system.


Image registration is not confined to medical imaging alone. It is a widely used technique in astrophotography and panoramic photography.

The Challenge

The image that I have used is a grayscale image of dimensions 512 x 512. Image registration algorithms require that you work pixel by pixel and iterate over the operations 100 to 200 times. This means each operation within the loop has to performed 512 x 512 x 200 = 52428800 times which can be computationally very expensive (This image took me 3 to 4 minutes)

This is where my project comes in - to parallelize the code. Instead of the operations on individual pixels running serially, they can be made to run in parallel by making use of the Graphics Processing Unit (GPU) [The NVidia G80 has 16 multiprocessors and each multiprocessor is composed of 8 processors (ALUs).  That is one too many compared to what Intel has to offer].

Parallelizing the code has been used to achieve a speedup of upto 55 times in many applications. This can very useful in image registration, specially in medical applications where time is of prime importance.

The GPU is not the only way to do it - there are other ways too (FPGA based for example). However, image registration using the GPU is a fairly new domain and it is going to be exciting to see how the GPU fairs in comparison to the existing procedures.

P.S: Was this post too technical in nature? Have any ideas for me too write on? You can let me know in the comments section :)

Wednesday, December 9, 2009

Classification of Teachers

As I was surfing through the flotsam and jetsam of the blogosphere, I came across this post on Classification of Students - A professor of Network Analysis taking a dig at the students on Teacher's Day. And frankly speaking, this was it. Emotions were up to the brim and I had to defend the students.

This is the student version - to which the readers are free to add on and comment upon. A Professor/Teacher at any given instance of time may belong to one or more of the categories.

# The OK Professor

This is the really annoying kind. Talking to them is a real pain in the neck. Their lectures are peppered with OKs, Does This Makes Sense and aahh.. aahh..

They are really nervous while teaching. Or probably, they developed this bad habit in spite of all the training.

In one class that I still remember, the professor had uttered 180 OKs in a span of 30 minutes - that averages to 6 OKs per minute! Or an OK every 10 seconds! Does that make sense? OK?

# The Somnolent Professor

Though the professor is a master in his subject and his presentation is immaculate, there is something in his lecture that puts everyone to sleep.

The professor may not realize it but half the class would be sleeping. It maybe because of his dull voice (rather monotonic?), probably his haphazard manner of going about things or it maybe just nothing at all. But he justs puts everyone to sleep.

#  The Peace Maaru Professor

Really doesn't believe in working very hard. Will teach as much as he is paid for. Nothing more.

Comes to the class 10 minutes late and leaves the class 10 minutes early. Solves a question on the board in the whole class and doesn't bother the students much. His policy is - "Live and let Live".

#  The Dynamic Professor

This is the professor who feels that the students should get the best out of his class. He gives them a lot of assignments and takes surprise tests.

He is young, energetic and full of passion for his subject. He thinks - "I should try to become the Ideal (Utopian?) professor."

# The Motivators

These are generally the old guys. Already in the teaching profession for 20 to 30 years, they know that whatever they teach is not going to make much of a difference. If however they can motivate some of the students to do something in life, they would have accomplished something.

Their lectures are filled with quotes from the Gita and the Bible. They borrow extensively from Shiv Khera and think that their plagiarism would go unnoticed. One can stand them for a day or two but the rest of their lectures are just "Rewinding the Tape".

# The Pundits

The really knowledgable ones. They have worked in the industry for some time and their breadth of knowledge puts you to awe.

But their lectures are hardly organised. They would start of with programming in C and end up with the reactions that take place in a rocket launcher.

Their lectures can be really hilarious and fun. But it won't do you any good for your exams.

#  The Sadists

They may not be sadists at heart. But some of their activities really annoy the students.

If they are invigilators in the exam hall, they might as well throw out half the candidates out of the hall for plagiarism/not bringing admit card/ringing of the mobile phone.

When they evaluate the papers, one really wonders if he had been having breakfast while evaluating the paper. And worse of all, when the answer scripts are shown, the professor is out of town.

They may be excellent teachers. But rarely student friendly.

# The Liberals

They are the modern professors. They believe in modern methods of teaching. They ask students of the opposite gender to sit together in class and they come in casuals instead of formal wear to class.

Their evaluation is liberal and they are a real hit with the students.

I will stop here. I think this is the basic classification. Did I miss any? Have any to add on to this? Do let me know!

Thursday, December 3, 2009

The Economics of Travel



Travelling involves a lot of preparation. More so, in Bengal.

As I was travelling from Burdwan to Kolkata by train, I was given some funda on travelling
  • Board the last bogie (Reason? The last bogie turns out to be the first bogie when it arrives in Howrah)
  • There won't be much space to stand. But do not sit.

The second needs some explanation. In fact, it didn't make much sense to me till I boarded the train. The train seemed to be empty. But all the seats appeared to be reserved. Rather "Handkerchiefed" (something that some of my friends really hate about Bengalis) or "Trump Carded" whatever you may like to call it. 

F: Do not sit. Possibly, you may be called to sit.

As I linger about the empty seats, one of those sitting beckons me to sit. He removes a card and gives me a seat. I sit down skeptically.

In a while, the train fills up and the passengers seem to be seated comfortably.

Enter the Dalal.

Medium height, photocromatic eyeglasses and a thick shock of hair oiled in coconut oil. He comes and collects the cards. Counts them. 25 cards. One missing. Sits down besides me.

D: Dutta da, Maal ta din (Give me the goods!)
Dutta da: Diye debo. Apni tho amar bondhu (Will give you. You are my friend)
D: Jhule jhule jaaben, sheta ki bhalo lagbe? (Would you like to go standing in the crowded train?)

As I was about to doze off in the hubbub, what appears to be a 10 rupee note grazes past my shoulder. As I open my eyes, I can see the Dalal writing down carefully on a piece of paper Rs 10 against Dutta da.

Some Quick Calculations

I make some quick calculations. 26 people. Rs 10. That makes it Rs 260. Now if the Dalal loses a card daily. Then he has to buy a new deck every fortnight.  Rs 260 minus Rs 20 / 2 = Rs 250. How much does the Dalal get? Rs 1000 every month (one way!). Not bad if it is weekly.

Now could this weekly or monthly? Would I be willing to pay Rs 10 for a seat if my ticket was for Rs 30 x 7 = Rs 210. How much was that? Roughly 5%. What if it was monthly? It would too low to be even significant. If it was weekly, the Dalal would be earning a handsome amount all for nothing! (If the Dalal earned Rs 15000/month at his office in Kolkata, this would contribute to roughly 10% of his income!). But what if it was monthly?

I was all confused and was about to doze off when it dawned on me that it wasn't 26 people. It was more than that. One couldn't have the same 26 people travel on all 30 days. He was reserving seats for more than 26 people. Maybe 50. Maybe 100. Couldn't tell where his boundaries ended and the next Dalal's boundaries started.

Some Open Questions

Suddenly, what appeared to be a mere gimmick for seats in a train looked like brisk business. And everybody paying/getting paid was equally culpable! Consider the number of Dalals one could have - If one had 2 Dalals per bogie and 15 bogies per train, the amount that went ??? was Rs 2000 x 30. And considering the number of local trains that crisscross the Indian railways daily, here are some questions I leave the reader to ponder upon
  • Where do all these big numbers go when multiplied and added?
  • Where do they come from? (My answer: The taxpayers)
  • If you were a daily passenger, would you pay Rs 10 for a seat?
P.S: Do keep one thing in mind while answering the last question. You are an avid Card player. You love bridge/poker whatever and it is very difficult to play cards if you are standing. Now, would you pay Rs 10 for a seat?