A Life of your Dreams?


“So, I take the queen two steps ahead and check mate!”, exclaimed David as he finished off the game with his Dad. “You have become better with time. You play just like Nana”, said his Dad proudly. “Oh Dad! You hardly moved your pieces. I played just like Nana?”,  asked the boy, flushing crimson and looking up at his dad with bright, ecstatic eyes. “Yes. You two are similar in a lot of ways. Remember Dr. Whitaker said the same thing the last time he visited us?”. The mention of Dr. Whitaker brought mixed emotions on David’s face. The soft spoken, charismatic Dr. Whitaker was loved by all, but David was scared of him ever since he and his team took Nana away.

“He won’t take me away from you all, would he dad?”. His dad simply nodded, reassuring him that nothing like this would happen. “Guys, lunch is ready”, David’s mom shouted from the kitchen. The three spent hours during lunch time talking about each and everything that happened in their lives everyday. David always did most of the talking. He went on and on. “And then in the movie, Batman -“, the doorbell cutting his speech short. “I’ll  go answer the door”, said David as he ran to greet the visitor.

It was Dr. Whitaker with his assistant. “Hey David, how have you been?” David ran back to the kitchen, scared, breathing heavily to hide behind his dad. Dr. Whitaker and his assistant made their way through the living room towards the kitchen. “It has become worse. We need to take him”, said the doctor as they entered the kitchen to find  David hiding. “Common David, don’t make it tough for us. It will be just a matter of days until your treatment is over and then you can come back here.”

“No! Dad! Mom! Tell them I’m all right. Please”, David cried. His parents seemed helpless as Dr. Whitaker’s assistant pulled David to take him with them. “Dad! Do something”, he shouted on top of his voice. His dad simply looked down as his son was dragged by the assistant across the living room. “Dad, you are just like Thomas Wayne”, he shouted as they took him outside.

“How did you know it had become worse?” asked the assistant. “Didn’t you see the chess board? The black pieces never moved. His hallucinations are getting stronger by the day.” “I’m not hallucinating! For god’s sake, leave me!”

The next day, Dr. Whitaker sat in office, thinking deeply, holding a newspaper in his hand. His assistant read out from behind, “David Christ, 15, a schizophrenic, dead after being run over by a vehicle.” “Oh God! We were going to visit him yesterday, right?”, asked his assistant. “Yes, but I had to cancel the visit because of a conference. Perhaps he just hallucinated that we were there, to take him way from his family. Poor soul. Just like I used to.”, said Dr. Whitaker, David’s Nana, as a tear rolled down his cheek. “Doctor, you need to take care of yourself”, said his assistant handing him his medicines. “How long do I have to stay with this guy who just can’t stop hallucinating!”, murmured his assistant as he left the room.

– Aadesh M Bagmar



Down the high road

Things get a little complicated down the high road. People generally get deadlocked in the state their mind is in. Raj and Rahul appeared in such contrasting moods. Rahul appeared a little grim. An air of melancholy surrounded him. Raj seemed happy, letting out his crazy laugh once in a while. “I want you to write my name once we get back”, said Rahul.

“Why can’t you just get over her?”, asked Raj to a visibly depressed Rahul as they walked with Raj following Rahul. Rahul shrugged, “You think it is easy? When you have had someone as an integral part of your thought process for the past 3 years, you think it is this simple?”, looking grimmer and more intense as he completed his sentence. “Ever since I met her, I rarely have spent a day without thinking about her.”

“Is she with someone?”, inquired Raj assuring him that he does not intend to try on her. “Not exactly. But there is this one guy”, replied Rahul, his face going paler. “What kind of a person is he?”

Rahul was not someone who would stand out if queried with a ‘distinct’ keyword. He was just an ordinary computer geek who was good at his course work. Nothing to set him apart. An emotional fool as some people called him, he had started to have feelings for the girl ever since he came into the institute.

“He is one of the best people I have met at this place”, he answered, thinking what was it that he missed. Did he not care well enough for her to even notice and acknowledge?

“How is it different from what is it is between the two of you?”, asked Raj continuing with his unending set of questions making Rahul more uncomfortable. Though an extrovert on the outside, Rahul kept some things to himself. But today seemed a little different. Perhaps the cannabis had the better of him. “They met at a student chapter and some organization meetings. They eventually got close and started going out. As days passed, their friendship grew stronger. For me, we were both just classmates, didn’t talk a lot in the first year and majority of second year. During the second year vacations, we went for training at the same place. That was when we came really close. I miss that time like hell. Meanwhile, the guy got into a relationship with some other girl.”, seemed like his whining was just getting started.

“Wait, what? The guy got committed to some other girl?”, Raj’s eyes lighting up. “Yup. but they broke up soon. Seems like he was just ‘confused’ about whom he liked”.

A flashback of the time he spent about a year back crossed his mind. This had happened a lot of times before. It gave him mixed feelings. The memories brought a smile onto his face but that usually turned into a frown thinking of how things had changed after those vacations. Suddenly, everything appeared different. The bonding looked lost. Something unusual did happen, but absence of a plausible explanation was killing him from inside.

“I don’t understand why people are confused with such things”, started Raj. Though a little stingy with words, he was always good at advises. “It is so simple. If he really liked the first one, he would have never fallen for someone else.” Rahul’s eyes sparkled. “Hmm. Maybe you are right. They are out on a date today as well. I asked her out thrice, she seemed to be busy then. You know, I have realized, when people say, I’ll get back to you, never get your hopes high. It hurts when they don’t get fulfilled. Just about a year back, we spent hours talking to each other, and now she behaves as if she does not even know me. It is painful to know, when you are crying for someone, they are busy laughing with someone else”, Rahul had strayed on the sentiyappa street earlier as well, but today the mood seemed hard to let go.

“Hey, don’t worry. They say life is like quicksort, everything eventually will fall into its right place. You just need to wait until you are chosen to be a pivot”, said Raj, trying to support his nerdy friend. “But, I don’t get it. Why is it O(n^2) for me when it is O(nlogn) for others?”, the geek in him might be gullible, but the pessimism was hard to beat. The countless conversations he had with her were all taped in his mind. All he had to do was just press the start button and he would go down the memory lane.

Raj gave a weird look which read, ‘How am I ever going to convince this guy!’ as he removed an apple from his bag. He had a bizarre obsession with them. The aura around him always appeared a little ghostly, the reason why he was friends with only a specific set of people. “You will never be able to”, answered Rahul, as if he read his mind. They finally reached their hostels. The distance they walked even though was less than a mile seemed like eternity. Rahul smiled and waved at a guy passing by. He didn’t notice Raj. No one around ever did. The same way she ignores me probably, thought Rahul. “There he is, presumably his date got over a little before time today.” Raj looked a little surprised.

“How does this make a difference if she goes out with you or him?”, asked Raj, pointing to the mirror Rahul just waved at. “It’s my alter ego. Are you done with your questions, Raj?”, replied a tired Rahul. “Just a last one. Why have you been calling me Raj all day?”. “Things do get little hazy down the high road. Sorry …. Ryuk”, acknowledged Rahul as Ryuk let out his cancerous laugh before he wrote ‘Rahul’ in his note as they had promised before they took this walk.

–The Broken Wizard.

The loop

A Student's Diary

He couldn’t help this feeling of deja vu he had been having of late.
“Bah, it’s like I am stuck in an endless loop of misery.”

Sameer took in another puff of the cigarette, and wondered how his life would have turned out had he not been an impulsive fool.

“You came here for what?” his friends had cried in shock.
“To see her. It’s been too long. What’s with the surprised look? I might even get my own timeless love story today, you just watch.”

What his friends did get to see was him getting drunk and making a fool out of himself on the streets of the night-loving city. Turned out the love of his life had moved on, and how. She and her beau were all over each other half an hour into their long-awaited meet. All he could do was watch in silence and hold back his…

View original post 616 more words

Explaining LIDA to a 10 year-old kid


“Be a dreamer. If you don’t know how to dream, You are dead!”

Jim Valvano

And if you still can dream, you might soon be able to ask your machine to do it for you.

As I write this article, sitting in an air conditioned office of the Multimedia and Robotics Group at Tata Innovation Labs, Delhi, working on the cognitive theory of mind and simultaneously thinking about last night’s movie, “The Inception”, a vague thought crosses my mind.

“Can Machines Dream?”

Consciousness of mind has been somewhat replicated by software designers. Before we jump into how the next-gen robots would be created, let us first understand how the consciousness and thinking cycle of our brain can be modeled?

We can consider ourselves to be called agents who are driven by a particular motive. The driver of this agent is our mind. An agent follows a cycle of events. Firstly, it senses the environment around it, and cognition helps it take decisions to alter it. The decisions taken are in pursuit of its agenda. E.g. If I want to pick up a cup. I would see (sensory input through eyes) where the cup is and pick it up (action taken and environment has no cup now i.e. altered).

This cycle is endless and the method of deciding what to do next is termed as cognition.

Screenshot from 2015-06-02 13:50:59The term cognition is too broad. We don’t only sense what’s around us, we perceive it too. We understand what objects are in it and our mind extracts features from it. We know what we are seeing.

So, we can simply split the word “Cognition” into a perception-cognition model which looks like this.

Screenshot from 2015-06-02 13:54:21The way our Cognition acts on the environment can be split too. The way we execute our decisions follow certain procedures. Lifting a cup of tea needs you to lean down, hold the handle, curl in your fingers and apply appropriate pressure to prevent it from toppling. All of this is stored in a “Procedural Memory” of our mind. As we keep repeating things, we reinforce our knowledge about it and develop our skill set. In way, we are learning how to execute procedures. So, the diagram now looks like this.

Screenshot from 2015-06-02 14:04:04There is more that our mind does. It relates to what happened in the past during a similar situation and how we reacted to it then. Before taking decisions, we gather a lot of information about related stuff from our past. E.g. If we wish to know where the car is parked, our mind automatically recollects images of the car sitting silently in the garage two blocks away from here. These images flash from a part of memory called the “Episodic Memory”. It contains the what, the when, the where of any event happening around you.

Screenshot from 2015-06-02 14:12:17 This kind of memory decays over time. Like, I doubt even 1% of people reading this remember what they had for breakfast a week ago. We are more likely to answer the same question if the day is changed to today. But, Episodic memory doesn’t always decay. Some parts of it stay for a lifetime. Like, we never forget “what” part of certain events though “the when” and “the where” might have been lost.  This type of memory is termed as “Declarative memory”.

When we recall certain things, do we recall everything about that event? Obviously Not! We recollect certain facts which are relevant to the current scenario. All the facts blasting in your mind from the episodic memory fight for “Attention” in your brain. The events winning the fight, get to come to consciousness. The winner is determined by relevance, importance, urgency of the facts. The percepts coupled with some important factors make it through and determine what action one would be taking.  The model finally looks like this.

Screenshot from 2015-06-02 14:25:39As our mind follows this cognitive cycle endlessly, it also learns a lot of things. We identify new objects (Perceptual Learning), we acquire new skills (Procedural Learning), as we grow we learn to think and bring better contexts from the past (Episodic Learning), more relevant coalitions winning and coming to consciousness (Attentional Learning).

Screenshot from 2015-06-02 14:30:56The cognitive cycle shown above is a simplistic representation of how minds work. The famous IDA (Intelligent Distribution Agent) has been modeled on this. The cognitive cycle with learning can be shown in a better way as follows.

Screenshot from 2015-06-02 14:32:06The Workspace shown above makes analysis of the current situation and moves its ideas to the Global Workspace. This hosts a competition, whose winner decides what procedure would be followed or action would be selected.

The above model has been proposed by the Cognitive Computing Research Group, University of Memphis.

This is a proposed model on how the mind works from a cognitive science perspective. It also suggests that learning can take place in consciousness. A solid example of this model being successfully implemented is IDA model.

IDA is an agent being used by the US navy to grant activities and distribution to the sailors. You can search more about her here. Currently, IDA can successfully negotiate with clients in English, access databases, adhere to rules, make intelligent decisions. IDA is considered to be a “conscious software“.

So, moving the discussion towards our title, Can Machines Dream? Yes, they can. Even though it seems way too weird, there is a remote possibility of making that happen. If we can model the subconscious brain in some way, we can make machines dream. Let us consider this, our dreams are merely customized episodes from our declarative memory or (episodic memory which hasn’t decayed). Our dreams also relate to our motives/agendas and means to achieve those goals. The Workspace theory talks strongly about how software agents like IDA achieve their goals and fulfill their given agenda’s.

The subconscious stores your beliefs, memory and life experiences. You can see how each of these can be modeled in the cognitive cycle. Machines might not be able to dream exactly as humans but they can very well link our past, current episodes and play it for us. Once the dream model is successfully built and understood, we might have machines creating totally unknown stories for us.

A study of 320 adult dream reports found:

  • 48% of characters represented a named person known to the dreamer
  • 35% of characters were identified by their social role (e.g., policeman) or relationship to dreamer (e.g., a friend)
  • 16% were not recognized.

Among named characters:

  • 32% were identified by appearance
  • 21% identified by behavior
  • 45% by face
  • 44% by “just knowing.”

This suggest something very interesting. If most of what we see in our dreams is from our memory and very less from what is yet to happen, we can at least model this region.  Moreover, If cognitive science and machine learning can model something very close to our brain, why can’t we model our dreams? Can’t something very close to what Humans are dreaming be perceived in a machine?

As Science progresses, we are not very far, from achieving this reality. Might as well have, machines “sharing” dreams! The first inception, might just start with Machines!

Real Time Facial Expression Recognition!

Real Time Facial Expression Recognition. This field has been live since the 1970’s. As automation is taking over in all fields, Detection and Analysis of Facial Expressions has been an interesting and challenging topic to work on. I have used the Eigen Face modelling technique for this project. The crux of analyzing things in real time has been the speed of processing. Since, an image needs to be processed before the next frame gets loaded, speeding up of processing was the main focus of my project. A lot was learnt during this endeavor and a lot of techniques employed here maybe useful for people referring this blog.

This, was a part of my summer research project at the end of my second year at National Institute of Technology, Surat under my guide Dr. M.A.Zaveri, Associate Professor, SVNIT, Surat.

The idea crept in from an interesting incident. Being an avid and a fond reader of Human psychology and emotion science, I thought of creating an application wherein a machine can determine Facial Expressions and judge mental state of a person. The following is my project report for the same.

Project Report (1)

I had given a small talk on the same topic. You can find the power point presentation here:

The Talk!

The live Video can be found here: https://www.youtube.com/watch?v=wotYK6CmyuM

Any Doubts/queries are always welcome!


Ha! a lot of selfies! 😛

The Turing Test Doesn’t Matter

Scientia Salon

turing testby Massimo Pigliucci

You probably heard the news: a supercomputer has become sentient and has passed the Turing test (i.e., has managed to fool a human being into thinking he was talking to another human being [1,2])! Surely the Singularity is around the corner and humanity is either doomed or will soon become god-like.

Except, of course, that little of the above is true, and it matters even less. First, let’s get the facts straight: what actually happened [3] was that a chatterbot (i.e., a computer script), not a computer, has passed the Turing test at a competition organized at the Royal Society in London. Second, there is no reason whatsoever to think that the chatterbot in question, named “Eugene Goostman” and designed by Vladimir Veselov, is sentient, or even particularly intelligent. It’s little more than a (clever) parlor trick. Third, this was actually the second time that a chatterbot passed…

View original post 2,075 more words

Install OpenCV in Ubuntu



A lot of people have been asking me about this, so I thought it would be easier to explain it through a written tutorial which you can follow easily.

A lot of websites, videos are available showing how to do this, but a majority of them lack some or the other installers!

So, this is a simple guide on how to install and compile one of the most famous computer vision software on your Ubuntu (11.0+) device!

Method 1: Crude method. Install all libraries and files one by one.

 10 Simple steps to have OpenCV running on your Ubuntu system: 

Step 1: Have your updates and upgrades at the newest level. Use:

sudo apt-get update

sudo apt-get upgrade

Step 2: You need something to build your libraries on. So, we use the Cross Platform Make or Cmake

sudo apt-get install cmake

Step 3: GUI’s would be created. Thus, we install the libgtk2.0 package. 

 sudo apt-get install libgtk2.0-dev

This would take some time. So, be patient.

Step 4: Next, we install python’s numpy library. It is used for scientific computations. Type in:

sudo apt-get install python-numpy

Step 5: Download the latest OpenCV version from the official page. Here is the link:


Extract it to your HOME  (home as in, not yours, Ubuntu’s home).

Step 6: In your terminal, enter the Extracted OpenCV folder using the cd command: 

 cd OpenCV-2.4.9 (Put in your folder name)

Step 7: Build your OpenCV package using cmake.


There are many types to build like debug, but here, we are using the type Build. Cmake install prefix is used to generate the make file.

Step 8: Use make on the Make File! A make file is a special shell command file. Simply type:


make install

This is going to take a lot of time!

Step 9: Editor: some of you might want to use eclipse. I personally prefer using sublime text.

for eclipse:

cd ..

sudo apt-get install eclipse

sudo apt-get install eclipse-cdt.

You can run it by simply typing eclipse and it would open.

Step 10: This is the most important step.

You need to export your libraries to the packages installed or while  running, your terminal would throw up an error saying, OpenCV Package not found.

Export packages and set path to lib.

 export LD_LIBRARY_PATH=/home/opencv/lib

export PKG_CONFIG_PATH=/home/opencv/lib/pkgconfig

And you are done!


Try a sample program using the nano editor.

type nano opencvtest.cpp

using namespace cv;

int main()

    Mat img = imread("/home/USER/Pictures/python.jpg",CV_LOAD_IMAGE_COLOR);

    return 0;

Compile it using:

g++ -ggdb `pkg-config --cflags opencv` -o `basename opencvtest.cpp .cpp` opencvtest.cpp `pkg-config --libs opencv`

For compiling an openCV code, you would have to always type the above lines. I prefer using a bash file instead of going through this boring stuff!

Next tutorial , I will show you how to create this bash file to make life simpler!