Monday 22 February 2016

The simple Mathematics behind object catching

I always ask myself, do we do some complex Mathematics in our brain when we want to recognize an object or make a decision? Or do we solve tens of time-related multidimensional partial differential equations to cache a thrown object?

My answer, we don't. Our brain is a network of hundreds of billions of neurons, how could this system work based on some brain-made models and abstraction like Mathematics, which we the creator of these formulas still have problems solving them? Have you ever tried to model the "Object Catching" completely?

What I'm attempting to say is that our brain uses very simple mathematics to do things, like recognizing objects, making a decision or catching a thrown object. I don't say these are simple tasks our brain do; I just say the Mathematics and model behind all these tasks are simple.
In fact, what makes our brain does these incredible works is the simplicity of the way it works, not the complexity of it.

A sophisticated tool or solution works well for particular situations or problems while a simple one could work for different kinds of problems or situations. (Think about a knife; you can do many things with a knife while with something like a Phillips or Torx screwdriver you can't. You even can turn a Phillips or Torx screw with a knife.)

All we do to catch a thrown object is repeatedly doing some linear position approximation
and moving or adjusting the body or the hands based on already learned patterns.

Consider the "Object caching" process which is one of my favorites processes to think about; whenever I see a dog catches a thrown object, I give one more vote to the idea that there should be a simple Mathematics behind this process, which even a plant does it, they grow the light!


Now if you are good at Mathematics and Physics, you might write some equations to address the problem. (For both the thrown object and the catcher, just think how difficult this could be!?) Even if you write such equations, you've assumed many ignorances in them like air resistance, what if the wind starts blowing, what if it rains, etc. Then when it comes to solving the equations; you just can't! You need to use programs and computer, or some numerical methods, etc to find the answer.

But the truth is we can catch the thrown ball even if there are wind or rain, or even if you try to do it on the moon with different gravity! All you need is practicing catching a ball in such weather conditions or on the moon.

Now the question is what is the basic Mathematics we use to do these things? It must be something that our understanding of neurons explains it, so it is unquestionably is not advanced Mathematics.

A network of information like a "Bayesian Network" (which I usually use it to solve an ML problem) is a comprehensive model to make a decision and pattern recognition. That is what totally fits with the structure and the behavior of our brain, especially if you consider the concept of Hierarchical Bayesian Network, which supports hierarchical thinking model of the brain.

So until now we can see and learn the pattern of the moving object in any environment, like what we show in our previous posts. So you have hundreds of these patterns stored in your brain. The other thing we need is finding the way we move our body or raise our hand to catch the ball. I believe that we only use kind of linear approximation to compare our position and the ball's position to adjust our movement. And note that this comparison result is directly sent to that Bayesian Network to make a new decision. So over time when the object gets closer, our brain adjusts the body or hand until we catch the ball. The following simple lines of code describes it better:

do {
      ballPosition = me.eyes.getObjectPosition(ball);
      myHandPosition = me.hand.getCurrentPosition();
      if (ballPosition !=  myHandPosition) {
            if (me.hand.canReachTo(ballPosition)) {
                  me.hand.moveOneStepToward(ballPosition);
            } else {
                  me.body.moveOneStepToward(ballPosition);
            }
      }
} while (ballPosition ==  myHandPosition || me.getDisappointed());

if (me.getDisappointed()) {
            me.hand.catchTheObjectAt(ballPosition);
}

In the above code, whenever we make a logical comparison or call "canReachTo()" or "getDisappointed()" methods, it is the Bayesian Network which does some simple calculation and returns the result. And methods like "moveOneStepToward()" both for body and hand are nothing but sending some signals to motor sensors to move appropriate muscles.

The "moveOneStepToward()" should be intelligent enough and have access to many already learned patterns to do the best possible movement. The number of trained patterns this method has access to defines the skill grade of the catcher. When you are weak in catching objects, mainly all you need to do is practicing, by practicing you storing more patterns of movements and catch in your brain, then next time you have access to more information than before. 

No comments:

Post a Comment