Tag: ai

Deep Learning for NLP

Deep learning is usually associated with neural networks.

In this article, we show that generative classifiers are also capable of deep learning.

What is deep learning?

Deep learning is a method of machine learning involving the use of multiple processing layers to learn non-linear functions or boundaries.

What are generative classifiers?

Generative classifiers use the Bayes rule to invert probabilities of the features F given a class c into a prediction of the class c given the features F.

The class predicted by the classifier is the one yielding the highest P(c|F).

A commonly used generative classifier is the Naive Bayes classifier.  It has two layers (one for the features F and one for the classes C).

Deep learning using generative classifiers

The first thing you need for deep learning is a hidden layer.  So you add one more layer H between the C and F layers to get a Hierarchical Bayesian classifier (HBC).

Now, you can compute P(c|F) in a HBC in two ways:

Product of Sums
Computing P(c|F) using a Product of Sums
Sum of Products
Computing P(c|F) using a Sum of Products

The first equation computes P(c|F) using a product of sums (POS).  The second equation computes P(c|F) using a sum of products (SOP).

POS Equation

We discovered something very interesting about these two equations.

It turns out that if you use the first equation, the HBC reduces to a Naive Bayes classifier. Such an HBC can only learn linear (or quadratic) decision boundaries.

Consider the discrete XOR-like function shown in Figure 1.


There is no way to separate the black dots from the white dots using one straight line.

Such a pattern can only be classified 100% correctly by a non-linear classifier.

If you train a multinomial Naive Bayes classifier on the data in Figure 1, you get the decision boundary seen in Figure 2a.

Note that the dotted area represents the class 1 and the clear area represents the class 0.

Multinomial NB Classifier Decision Boundary
Figure 2a: The decision boundary of a multinomial NB classifier (or a POS HBC).

It can be seen that no matter what the angle of the line is, at least one point of the four will be misclassified.

In this instance, it is the point at {5, 1} that is misclassified as 0 (since the clear area represents the class 0).

You get the same result if you use a POS HBC.

SOP Equation

Our research showed us that something amazing happens if you use the second equation.

With the “sum of products” equation, the HBC becomes capable of deep learning.

SOP + Multinomial Distribution

The decision boundary learnt by a multinomial non-linear HBC (one that computes the posterior using a sum of products of the hidden-node conditional feature probabilities) is shown in Figure 2b.

Decision boundary of a SOP HBC.
Figure 2b: Decision boundary learnt by a multinomial SOP HBC.

The boundary consists of two straight lines passing through the origin. They are angled in such a way that they separate the data points into the two required categories.

All four points are classified correctly since the points at {1, 1} and {5, 5} fall in the clear conical region which represents a classification of 0 whereas the other two points fall in the dotted region representing class 1.

Therefore, the multinomial non-linear hierarchical Bayes classifier can learn the non-linear function of Figure 1.

Gaussian Distribution

The decision boundary learnt by a Gaussian nonlinear HBC is shown in Figure 2c.

Decision Boundary of a Gaussian SOP HBC.
Figure 2c: Decision boundary learnt by a SOP HBC based on the Gaussian probability distribution.

The boundary consists of two quadratic curves separating the data points into the required categories.

Therefore, the Gaussian non-linear HBC can also learn the non-linear function depicted in Figure 1.


Since SOP HBCs are multilayered (with a layer of hidden nodes), and can learn non-linear decision boundaries, they can therefore be said to be capable of deep learning.

Applications to NLP

It turns out that the multinomial SOP HBC can outperform a number of linear classifiers at certain tasks.  For more information, read our paper.

Visit Aiaioo Labs

Fun with Text – Managing Text Analytics

The year is 2016.

I’m a year older than when I designed the text analytics lecture titled “Fun with Text – Hacking Text Analytics“.

Yesterday, I found myself giving a follow on lecture titled “Fun with Text – Managing Text Analytics”.

Here are the slides:

“Hacking Text Analytics” was meant to help students understand a range text analytics problems by reducing them into simpler problems.

But it was designed with the understanding that they would hack their own text analytics tools.

However, in project after project, I was seeing that engineers tended not to build their own text analytics tools, but instead rely on handy and widely available open source products, and that the main thing they needed to learn was how to use them.

So, when I was asked to lecture to an audience at the NASSCOM Big Data and Analytics Summit in Hyderabad, and was advised that a large part of the audience might be non-technical, and could I please base the talk on use-cases, I tried a different tack.

So I designed another lecture “Fun with Text – Managing Text Analytics” about:

  • 3 types of opportunities for text analytics that typically exist in every vertical
  • 3 use cases dealing with each of these types of opportunities
  • 3 mistakes to avoid and 3 things to embrace

And the take away from it is how to go about solving a typical business problem (involving text), using text analytics.

Enjoy the slides!

Visit Aiaioo Labs

Ruminations on Consciousness

Descartes’ illustration of the mind-body problem

There is an interesting unanswered question that humanity still hasn’t managed to put to rest, and it is:

“What is consciousness?”

Is human consciousness magical or mechanical?

Is there some magical thing called a soul in all animals that makes us who we are, drives our actions and makes us conscious of the world around us?

Various religious traditions have different explanations for consciousness.

Traditional Hypothesis

Semitic traditions – Judaism, Islam and Christianity – don’t talk much about consciousness but they have an implicit position on the subject.  On the other hand, Hindu philosophical traditions talk explicitly about it, and the following are some of the more well-known philosophical positions:

  1. a) Advaita – the consciousness of creatures on earth is essentially the same as that of the divine.
  2. b) Dvaita – there are two kinds of consciousness – that of earthly creatures and that of the divine.
  3. c) Vishishtadvaita – there are two kinds of consciousness – earthly and divine – and the former can become one with the latter.

So, Hindu philosophies take one of the following positions:



The earthly consciousness is singular from the point of view of the individual.  Each person (and in some traditions each animal) is believed to have one.



The view of all Semitic religions, though not explicitly stated, seems to be closer to that of Dvaita philosophy, in that souls are considered distinct entities from the gods (after death, these souls end up in a good place or a bad place for a long time).

I say gods in plural because all Semitic religions seem to believe in the existence of a good divine being and an evil divine being (satan/shaitan/iblees) who is different from the good divine being and not fully subject to him (which is different from Hindu philosophies where the concept of an absolutely bad/evil divine being doesn’t seem to exist).


So, there are two or more (if you count the lesser divine beings called angels, jinns, etc) divine consciousnesses in Judaism, Islam or Christianity.

Judeo-Christian Beliefs

In Judeo-Christian literature, for example, a text about a man called Job deals with this concept of a bad divine being.  The Wikipedia says: “Between Job 1:9–10 and 2:4–5, Satan points out that God has given Job everything that a man could want, so of course Job would be loyal to God; Satan suggests that Job’s faith would collapse if all he has been given (even his health) were to be taken away from him. God therefore gives Satan permission to test Job.”  There are also in this belief system conceptions of other divine beings: a holy trinity, a pantheon of angels, etc.

Islamic Beliefs

In an account by al-Tabari, a 9th century scholar, the prophet Muhammad is described as having endorsed in verse three dieties of the Kaaba other than Al-Lah at one point (they were called Al-Lat, Al-Uzza, and Manat), and later withdrawn the endorsement with the explanation that Satan (who in Islamic theology is believed to have only the power to put ideas into people’s minds) had made him do it.  The verses endorsing these other deities (later withdrawn) are referred to in some places as the Satanic Verses (https://en.wikipedia.org/wiki/Satanic_Verses).

All the above religious belief systems imagine one single soul as resident in each living thing on earth.

However, in the Baha’i faith, it appears that there is a concept of a good and an evil side in each living thing, though possibly not as two consciousnesses.  Abdu’l-Bahá is supposed to have said: “This lower nature in man is symbolized as Satan — the evil ego within us, not an evil personality outside.”

In fiction, there have been imaginings of more than one conscious ‘soul’ being resident in a human.

Take the tale of Dr. Jekyll and Mr. Hyde.  In it, the character of Jekyll/Hyde is described as having two consciousnesses, one good and one bad – each akin to one of the principal divine beings in Semitic religions.


So, in Jekyll/Hyde’s world, there is a multiplicity of consciousnesses, not just in the divine plane, but also on earth.


So, it appears that we can imagine multiple divine beings in existence, and multiple consciousnesses existing in each of us.  We can also imagine a single divine being in existence, and a single conscious soul.  We can even imagine the earthly soul/consciousness being the same as the divine soul/consciousness.

The obvious question is:  can we imagine the absence of the magical soul since we can imagine the absence of a divine being (atheistic belief systems have existed since times immemorial)?

One of the reasons for postulating the existence of divine beings is that they give us a way of explaining inexplicable phenomena.  In antiquity, when humans needed to explain thunder and tides, they imagined thunder gods and sea gods.  Later, when they became better able to explain (or at least to be conscious of unchangeable patterns in and to fend against) nature, they began to adopt more abstract conceptions of deities that reflected human consciousness, and where the religious traditions served to provide an explanation for the phenomenon of life, and an ethical framework for reasoning during the period of life.

Once the creation of living things could be explained, and social contracts became things one could reason about, humans seem to have found it easier to surmise that no gods were needed to explain creation, life and ethical values.

Similarly, as we become better able to explain how our minds work, and to understand perception, memory, cognition and language, and also phenomena such as hallucination and mental illnesses, beliefs in magical phenomena such as spirits taking possession of individuals have begun to diminish.

By extrapolation, one might suppose that with time, the belief in an immortal soul will also diminish.

Alternative Hypothesis

What is likely to replace the concept of a magical soul in all living things?

One of the modern theories of consciousness (according to David Chalmers) seems to be that the mind and the brain are one (see the mind-brain identity theory of 1950 mentioned in http://consc.net/papers/five.pdf).

However, since the brain itself is little understood, we’d merely be explaining something we don’t understand using something that we don’t understand (though we’d be seeing it as something physical).

It seems to me that it might be better to explain our consciousness to ourselves in terms of how computers do the things that we are conscious of doing, since computers are well-understood.

It appears that a definition of consciousness as:  “the ability to perceive the world, form a model of the world (including imagined worlds), retain a memory of the perceptions and models, reason independently about those models, and optionally, to act on the perceptions” would be accurate.

So any machine could be considered conscious if it is able to perceive the world, form a model of the world (including imagined worlds), retain a memory of the perceptions and models, reason independently about those models, and optionally act on the perceptions.

There are already theories that seem to come close to the above definition.  They are called Representationalist Theories.  And many of them, interestingly, seem to have been developed only in the last 20 years: http://plato.stanford.edu/entries/consciousness/#RepThe

Here are some other discussions of the aforesaid theories:

  1. http://plato.stanford.edu/entries/consciousness-representational/
  2. http://plato.stanford.edu/entries/qualia/

A concept such as qualia (see preceding link), which seems so troubling to a representationalist philosopher, would appear trivial to someone well-versed in machine learning, because in machine learning, we already have names for concepts that go beyond these, such as features and models.

So it seems to me at first glance that representationalist theories of consciousness with the addition of concepts from machine learning can adequately explain consciousness in all animals.

Buddhist Philosophy

Now, it turns out that this alternative hypothesis that there is no soul is not such a recent supposition.  It seems to have appeared a long time ago.

In fact, it formed a central tenet of another Indian religion – Buddhism.

In Buddhism the concept of the non-existence of the soul is called Anatta from an (not, without) and attā (soul).

So, it appears that in one Indian philosophical tradition, there is no place for the supernatural consciousness.


Consequences and More Questions

The consequences of reducing the being/soul/consciousness to a mechanical process would be very interesting.

If, we accept the above definition, we would have to think of humans as computers, because if human perceptions of the physical world are nothing more than a mental model of the same, then an electronic model of the world in a computer or a physical model in a mechanical device would also qualify as consciousness of the world.

Can we say that a computer or a mechanical model is conscious of the world in the same way that we are?

If we go with the theory that we have no magical soul, then the only alternative that remains is to accept that if a physical representation of the world can be created of its own volition by a machine that can also reason about it, then the machine is also conscious of the world.  In other words, our consciousness would have to be accepted as consisting of nothing more than our memories of the world we perceive and the models we create in our minds, and our ability to think about and reason over them.  Anything that can similarly perceive, model and remember things would have to be considered as possessing consciousness, leading to other interesting questions such as:  are humans machines, is ‘consciousness’ = ‘life’, can we have consciousness without life, and finally,  what is life?

Visit Aiaioo Labs

Building Machine Learning Models that can help with Customer Service and Supply Chain Management

The Laptop that Stopped Working

One fine day, a couple of months ago, a laptop that we owned stopped working.  We heard 4 beeps coming from the machine at intervals but nothing appeared on the screen.

Customer Service

The service person quickly looked up the symptoms in his knowledge base and informed us that 4 beeps meant a memory error.

I replaced first the two memory modules one by one, but the machine still wouldn’t start.  I tried two spare memory modules that I had in the cupboard but the computer wouldn’t start.

I had a brand new computer with me that used the same type and speed of memory as the one we were fixing.  I pulled out its memory chips and inserted them into the faulty computer, but still no luck.

At that point, the service person told me that it must be the mother board itself that was not working.

Second Attempt at Triage

So the next day, a mother board and some memory arrived at my office.  A little later a field engineer showed up and replaced the mother board.   The computer still wouldn’t start up.

When the field engineer heard 4 beeps, the engineer said it MUST BE THE MEMORY.

Third Attempt at Triage

A few days later, a new set of memory modules arrived.

The engineer returned and tried inserting the new memory in.  Still no luck.  The computer would not start and you could still hear the 4 beeps.

A third set of brand new memory modules and a new mother board were sent over.

Fourth Attempt at Triage

The engineer tried both motherboards and various combinations of memory modules, but still, all you could hear were 4 beeps and the computer would not start.

During one of his attempts to combine memory and motherboards, the engineer noticed that though the computer did not start, it did not beep either.

So, the engineer guessed that it was the screen that was not working.  But just to be safe, he’d ask them to send another motherboard and another set of memory modules to go with it.

Fifth Attempt at Triage

The screen, the third motherboard and the fourth set of memory modules arrived in our office and an engineer spent the day trying various combinations of screens, motherboards and memory modules.

But the man on the phone said: “Sir, 4 beeps means there is something wrong with your memory.  I will have them replaced.”

I had to take out my new laptop’s memory and pop it into the faulty machine to convince the engineer and support staff that replacing the memory would not fix the problem.

All the parts were now sent over – the memory, motherboard, processor, drive, and screen.

Sixth Attempt at Triage

Finally, the field engineer found that when he had replaced the processor, the computer was able to boot up with no problems.

Better Root Cause Analysis

The manufacturer could have spared themselves all that expense, time and effort had they used an expert system that relied on a probabilistic model of the symptoms and their causes.

Such a model would be able to tell, given the symptoms, which component was the most likely to have failed.

Such a model would be able to direct a field engineer to the component or components whose replacement would be most likely to fix the problem.

If the attempted fix did not work, the model would simply update its understanding of the problem and recommend a different course of action.

I will illustrate the process using what is known in the machine learning community as a directed probabilistic graphical model.

Run-Through of Root Cause Analysis 

Let’s say a failure has occurred and there is only one symptom that can be observed: the laptop won’t start and emits 4 beeps.

The first step is to enter this information into the probabilistic graphical model.  From a list of symptoms, we select the ones that we observe (all observed symptoms are represented as yellow circles in this document).

So the following diagram has only one circle (observed symptom). 

Model 1:  The symptom of 4 beeps is modeled in a probabilistic graphical model with a yellow circle as follows:


Now, let’s assume that this symptom can be caused by the failure of memory, the motherboard or the processor.

Model 2:  I can add that information to the predictive model, so that the model now looks like this:


The model captures the belief that the causes of the symptom – processor / memory / motherboard failure are (in the absence of any symptoms) independent of each other.

It also captures the belief that given a symptom like 4 beeps, evidence for one cause will explain away (or decrease the probability of) the other causes.

Once such a model is built, it can tell a field engineer the most probable cause of a symptom, the second most probable cause and so on.

So, the engineer will only have to look at the output of the model’s analysis to know whether he needs to replace one component, or two, and which ones.

When the field engineer goes out and replaces the components, his actions can also be fed into the model.

Model 3:  Below is an extended model into which attempts to fix the problem by replacing the memory can be incorporated.


If a field engineer were to feed into the system the fact that the memory was replaced with a new module and it didn’t fix the problem, the system would be able to immediately figure out that the memory could not be the cause of the problem, and it would suggest the next most probable cause of failure.

Model 4

Finally, in case new memory modules being sent to customers for repairs frequently turned out to be defective, that information could also be added to the model as follows:


Now, if the error rate for new memory modules in the supply chain happens to be high for a particular type of memory, then if memory replacement failed to fix a 4-beep problem, the model would understand that faulty memory could still be the cause of the problem.

Applications to Supply Chain Management

The probabilities of all the nodes adjust themselves all the time and this information can actually be used to detect if the error rates in new memory module deliveries suddenly go up.

Benefits to a Customer Service Process

1.  Formal capture and storage of triage history

2.  Suggestion of cause(s) given the effects (symptoms)

3.  Suggestion of other causes given triage steps performed

What the system will seem to be doing (to the layman):

1.  Recording symptoms

2.  Recommending a course of action

3.  Recording the outcome of the course of action

4.  Recommending next steps

Analysing documents for non-obvious differences

The ease of classification of documents depends on the categories you are looking to classify documents into.

A few days ago, an engineer wrote about a problem where the analysis that needed to be performed on documents was not the most straight-forward.

He described the problem in a forum as follows: “I am working on sub classification. We already crawled sites using focused crawling. So we know domain, broad category for the site. Sometimes site is also tagged with broad category. So I don’t require to predict broad class for individual site. I am interested in sub-classification. For example, I don’t want to find if post is related to sports, politics, cricket etc. I am interested in to find if post is related to Indian cricket, Australia cricket, given that I already know post is related to cricket. Since in cricket post may contains frequent words like runs, six, fours, out,score etc, which are common across all cricket related posts. So I also want to consider rare terms which can help me in sub-classification. I agree that I may also require frequent words for classification. But I don’t want to skip rare terms for classification.

If you’re dealing with categories like sports, politics and finance, then using machine learning for classification is very easy.  That’s because all the nouns and verbs in the document give you clues as to the category that the document belongs to.

But if you’re given a set of categories for which there are few indicators in the text, you end up with no easy way to categorize it.

After spending a few days thinking about it, I realized that something I had learnt in college could be applied to the problem.  It’s a technique called Feature Selection.

I am going to share the reply I posted to the question, because it might be useful to others working on the classification of documents:

You seem to have a data set that looks as follows (letters are categories and numbers are features):

A P 2 4
A Q 2 5
B P 3 4
B Q 3 5

Let’s say the 2s and the 3s are features that occur very frequently in your corpus while the 4s and the 5s are features that occur far less frequently in your corpus.

When you use the ‘bag of words’ model as your feature vector, your classifier will only learn to tell A apart from B (because the 4s and 5s will not matter much to the classifier, being overwhelmed as it is by the 2s and 3s which are far more frequent).

I think that is why you have come to the conclusion that you need to look for rare words to be able to accomplish your goal of distinguishing category P from category Q.

But in reality, perhaps what you need to do is identify all the features like 4 and 5 that might be able to help you distinguish P from Q and you might even find some frequent features that could help you do that (it might turn out that some frequent features might also have a fairly healthy ability to resolve these categories).

So, now the question just boils down to how you would go about finding the set of features that resolves any given categorization scheme.

The answer seems to be something that literature refers to as ‘Feature Selection’.

As the name says, you select features that help you break data points apart in the way you want.

Wikipedia has an article on Feature Selection:


And Mark Hall’s thesis http://www.cs.waikato.ac.nz/~mhall/thesis.pdf seems to be highly referenced.

Mark Hall’s thesis – “A good feature subset is one that contains features highly correlated with (predictive of) the class, yet uncorrelated with (not predictive of) each other.”

To be honest to you, I’d heard about Feature Selection, but never connected it to the problem it solves until now, so I’m just looking up reading material as I write.

Best of luck with it.

Mental Models and Art Aesthetics

The Mind of a Dance
An Exploration of the Mental Model that a Spectator might Form when Watching a Dance.

This is a post about a painting that I completed only last week.  But it was a painting that I’d been trying to figure out how to paint for all of 7 years.  It all started with a motorbike ride.

One day in 2006, I was riding down a mountainous road in North Carolina,
when I saw a hill of striking beauty (I believe it was somewhere near a town called

It was evening and the colours were beginning to fade, but I could clearly
make out on one side of the hill striking trees that were reddish-orange in hue and I
found them beautiful against the light green that surrounded them and the blue skies

I continued to ride down the road.  I rounded the hill and came to the other
side. I saw again, waves of green and yellow and touches of red and I was overcome
with a sense of being in the presence of the highest beauty that the eye could

So, I stopped and removed the camera from the knapsack behind me. From
various points along the road, I tried to photograph the hill.

However, I could not frame a shot that could evoke the beauty of
the hill that stood before my eyes.

That evening, I was troubled by a sense of failure, of bafflement at having failed to record the soul of the scenery that I had left behind. The hills around Marion were all extremely beautiful, but nothing else on the road had the perfection of the hill that I had not been able to photograph.

So, that evening, I sat and pondered a very interesting question that had to do with
aesthetics. The question was this: Does the mind experience beauty according to
images that it has seen, or does the mind experience beauty by a mental model it
has built of an object and the associations it has made between that model and
models of other objects?

Let me clarify what I mean by a mental model with an example. When we approach a
person whom we have never met before, we don’t immediately see all of that person.
We perhaps at first only see the front of the person, at a distance. Later we see more
of the person, their face, their profile, and how they look from behind. As we see
more and more of a person, we fill in more and more of the missing information about
how the person looks.

However, from the very beginning, we know that we are
looking at a person, even though we haven’t seen the person’s teeth or sides or
back. So we must have decided that the frontal image that we saw fit best into a
mental model of a person.  The mental representation may not just be a 3
dimensional representation. It may be a set of associations and memories over time, all woven together in complex ways.

So, the question that came to my mind was:  Is a human mind’s evaluation of
the aesthetics of an object based on a) any of the individual images of the object
that we have seen or on b) the entire mental model that we have constructed in our
minds of the object.

The more I thought about it, the more I began to feel that my experience with the hill
would be best explained by the conclusion that our aesthetic experience of an
object is determined by the mental model we have formed of it, and not by any image
of it, and here were the reasons for my leaning towards the latter conjecture:

a) If it is just a single view or image of an object that drives us to experience it as
beautiful or attractive, then our feelings about its attractiveness should change all
the time, based on small things like the angle at which we are viewing it. That does
not seem to be how we experience things in real life.

b) The experience of the hill led me to think that the latter explanation was the more
likely because if it was one of the views of the hill that made me think it beautiful, I
should have been able to capture the view with my camera. Since I couldn’t,
perhaps it was something I saw on the other side of the hill, combined with the
fading light and the landscape along the way (perhaps combined with the beauty of
some of the trees I saw upon the hill) that came together to contribute to the sense
of beauty that I experienced when looking at the hill.

That evening, I thought of a new kind of painting technique that would be possible if
the above conjecture proved true. It seemed that it might be worthwhile to paint a
picture from the point of view of the mental model a viewer might form if they saw the actual subject of the painting in context, possibly from different angles, or at different distances, and over an extended period of time.

But it was only last week, a good 7 years after I passed through Marion, NC, that I
tried to create a painting of the sort. Since I have recently watched many Indian
classical dance performances and some contemporary dance performances, I
attempted to paint all the things that might be associated with a dance performance
in the mind of a spectator. I constructed the painting like a fractal, starting with a
dancer and then representing the dancer at different levels of granularity and detail.

One of the things on the mind of the spectator would be the dancer’s body
(the whole form, from head to toe). Emoting is a key aspect of dancing in Indian classical dance.  So, in order to appreciate the emotion, a spectator would have to pay close attention to (and so form a model of) the dancer’s face, and of his or her eyes. So, I wove an
image of a forehead, and of an eye, into the painting. Another part of the body that
Indian classical dancers use a lot is the hands and the fingers. They use them to
denote various objects, characters and actions. I associated the movements of the
arms and fingers with flowing water, and plants with branches. So, I painted in some
flowing washes and let some negative white spaces take the form of trees in the
painting. Indian dance costumes are colourful, so I made everything in the painting
as bright as a classical dance costume.

The process of painting was a lot of fun. It was very different from the process of
scientific experimentation of course. There was none of the same rigour and I
wasn’t really looking to prove anything.

I liked the painting that came about and I have inserted a photograph of the same into this blog entry (it’s at the top).

But we don’t know yet whether mental models lie at the root of aesthetic
experiences. And you know what? As an AI researcher, I am just dying to find out! It
seems possible to design an experiment to determine the validity of the conjecture.

We could take an object whose facade is beautiful but whose side view is not. The
subjects of the experiment would be shown the front and side views of the building
and asked to rate the appearance of the front of the building. The control group
would be shown just the front of the building and asked to rate its appearance.

A significant difference in ratings (poorer ratings by subjects shown the front and
side view) would support the conjecture that a mental model lay at the root of the
aesthetic experience.

I hope that one fine day, we might be able to conduct the experiment, and if we do, I
shall share the results here with you!

As a footnote, I’d like to share this blog post http://aimeeknight.com/2012/04/10/the-new-aestheticperhaps/ by a blogger from (it appears to be – hmm, what a coincidence) North Carolina.  The article is about art that attempts to portray the world from the point of view of a machine – using a machine’s aesthetic – the phrase they’ve used is ‘New Aesthetic’.  I had not heard of the concept before, and it isn’t the same thing that I am working on, but since we’re discussing aesthetics and perception, it appeared relevant and interesting.

As a second footnote, I’d like to put in a word of explanation about why a firm of computer scientists and AI researchers should be interesting in painting.  Well, to many early AI researchers, AI was as much a quest to understand the human mind as it was a quest to solve difficult problems.  There were many attempts to comprehend the human mind by constructing logical and mathematical models of various cognitive processes (things the mind did) and seeing if the models could mimic the real thing.  So, AI research had a lot of common ground with Psychology.  And there is still a cross-disciplinary research area known as Cognitive Science that blends Psychology and AI research.  So, I just want to defend myself by saying that talking about aesthetics is not off-topic for this blog.

Can an algorithm identify the perpetrators of a bomb attack

On 13th July, 2011, there were simultaneous bomb attacks at different locations in Mumbai.  One day, while I was thinking about it, I suddenly realized that there was an algorithm that could be used to bring the perpetrators to book.

It’s almost a year since the attacks took place, and we thought we’d finally write about our work on the problem (which we’ve shared with many government organizations, including CAIR, though we frankly don’t know if they plan to implement it).


When multiple coordinated attacks take place (like the three bombs that were triggered simultaneously in three locations in Mumbai in 2011), if the attackers had used cell phones to coordinate their attacks, the phone numbers involved can be extracted mathematically from the call records linked to the cell towers in the vicinity of the attacks.

Our calculations indicate that in a city the size of Mumbai and a population of around 20 million people, you would need a minimum of only 3 simultaneous attacks to be able to pinpoint the attackers to within 1 person. If there were only 2 attacks, you would have a much higher uncertainty. The greater the number of coordinated attacks, the easier it is to identify the attackers.

The identification will only be possible if the attackers used their cell phones to coordinate with a central handler, or with each other, or a group of handlers who in turn communicated with each other. It would be possible to support different possible patterns of communication and usage of cell phones and SMS to coordinate between the attackers and confirm the attacks.


A similar method might have already been used in Europe after the Madrid bombings to identify those responsible for the same.
Two years after the attacks, the EU mandated that carriers store some details for 6 months. The information that the carriers need to preserve contains all the details required to triangulate attackers in multiple simultaneous attacks.

Here is some information on the directive from the Wikipedia:

On 15 March 2006 the EU formally adopted Directive 2006/24/EC, on “the retention of data generated or processed in connection with the provision of publicly available electronic communications services or of public communications networks and amending Directive 2002/58/EC.”

The Directive requires Member States to ensure that communications providers must retain, for a period of between 6 months and 2 years, necessary data as specified in the Directive.

 to trace and identify the source of a communication;
 to trace and identify the destination of a communication;
 to identify the date, time and duration of a communication;
 to identify the type of communication;
 to identify the communication device;
 to identify the location of mobile communication equipment.

The data is required to be available to competent national authorities in specific cases, “for the purpose of the investigation, detection and prosecution of serious crime, as defined by each Member State in its national law”.


The minimum information that would be needed to obtain an effective fix on an attacker is the following:

Indian carriers tend to store the FROM, TO and TIME information in call logs (used by the carriers for billing and for customer service) for SMS messages for 2 days and for phone calls for 30 days. These can be obtained easily from them by a simple request from police.
The location of the cell tower is determined from signaling logs.


Messages used to coordinate teams have certain patterns. For example, a possible pattern in an attack is a confirmation – success/failure – to the central handler after an attack.

Each message would have to originate from a cell tower near the site of a blast and in a short time window after the blast and have the same destination.

Out of all the hundreds of millions of messages sent in a city, only some would satisfy all these constraints.
Simple graph analysis can identify these messages, to very high accuracies in a city of 20 million of the size of Mumbai, provided there were 3 or more coordinated attacks.

The algorithm is so simple that an undergraduate student could build it in a few months.


There are many people I have to thank for their help with this study, including old mentors from other research firms in the area who helped me with suggestions for handling temporal queries, and students/interns who helped speed up the study, and my colleague Sumukh who works on graph/tree search himself.