<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Deebul Nair</title>
    <description>The latest articles on DEV Community by Deebul Nair (@deebuls).</description>
    <link>https://dev.to/deebuls</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F23054%2F1f5d0463-9f9e-425e-b173-7dc269d9a28c.jpeg</url>
      <title>DEV Community: Deebul Nair</title>
      <link>https://dev.to/deebuls</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/deebuls"/>
    <language>en</language>
    <item>
      <title>You Should Accept the Occasional Faults by Machine Learning</title>
      <dc:creator>Deebul Nair</dc:creator>
      <pubDate>Mon, 14 Aug 2017 12:59:12 +0000</pubDate>
      <link>https://dev.to/deebuls/you-should-accept-the-occasional-faults-by-machine-learning</link>
      <guid>https://dev.to/deebuls/you-should-accept-the-occasional-faults-by-machine-learning</guid>
      <description>&lt;p&gt;One will never achieve a 100% accurate machine learning algorithm. If you have one then please take the trouble to prove us that its not over-fitting the training dataset.&lt;/p&gt;

&lt;p&gt;The best performing machine learning algorithms for any particular task achieves around 90% accuracy. For example, parts-of-speech tagging problem in the field of natural language processing, the state-of-art is &lt;a href="https://nlp.stanford.edu/pubs/CICLing2011-manning-tagging.pdf" rel="noopener noreferrer"&gt;97% &lt;/a&gt;. Similarly in the most famous &lt;a href="http://image-net.org/" rel="noopener noreferrer"&gt;Imagenet challenge&lt;/a&gt; for Large scale visual recognition, the 2016 results show &lt;a href="http://image-net.org/challenges/LSVRC/2016/results" rel="noopener noreferrer"&gt;97% accuracy&lt;/a&gt; for object detection.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftkdyk5amktar0xppditm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftkdyk5amktar0xppditm.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thus the conclusion being you will never achieve 100% accuracy. Which implies some of the output from the machine learning will be &lt;strong&gt;incorrect&lt;/strong&gt; .&lt;/p&gt;

&lt;p&gt;Based on these 2 facts, there is one most important conclusion we can draw, &lt;strong&gt;we should not write deterministic code based on the outputs of the machine learning algorithms&lt;/strong&gt;. Currently all our codes are based on deterministic style, basically we know if the bit is either 0 or 1.&lt;br&gt;
For example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int i = 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we know that the value of i is 5, full deterministic. But if the value of i came from a machine learning algorithm, we cannot not be sure that the value is 5.&lt;br&gt;
For a real world example, if the image classifier says the object is a table we cannot be fully deterministic that the object is table because there is 4% chance that the object is not a table.&lt;/p&gt;

&lt;p&gt;This information about machine learning has greater impact on the software developed which uses prediction of machine learning algorithms in their software architecture.&lt;/p&gt;

&lt;p&gt;We face this problem based on our experience from our participation in &lt;a href="http://www.robocupatwork.org/" rel="noopener noreferrer"&gt;Robocup@work&lt;/a&gt; competition. The competition is about mobile robot in an industrial environment and solving the pick and place task. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fzuxt29g2me4a27cu4c3g.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fzuxt29g2me4a27cu4c3g.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before picking robot perceives the location and decides which object to pick. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5v7tqjvzsga967zq2ird.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5v7tqjvzsga967zq2ird.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We use a CNN based deep learning algorithm to classify the objects that needs to be picked with 99% accuracy on our training dataset.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fux2trvfbbxokufhl6gfc.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fux2trvfbbxokufhl6gfc.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The problem is sometimes the objects are mis-classified. But as we were not taking care of this corner condition, we ended up picking wrong objects and loosing lot of points during the competition. These problems can be addressed using some solutions to accommodate the corner conditions. &lt;/p&gt;

&lt;p&gt;There are different solutions for robustly using machine learning predictions in your software architectures. Some solutions which we have used are:&lt;/p&gt;

&lt;h3&gt;
  
  
  Using Confidence Parameter of the Machine Learning algorithms
&lt;/h3&gt;

&lt;p&gt;Most of the state-of-art machine learning algorithms(SVM, Random forest, CNN etc) provide a confidence parameter for their predictions. This should be used to determine which predictions should be used.&lt;br&gt;
But not algorithms provide the expected confidence measures. For example in CNN classification sometimes it mis-classifies with 100% confidence. This makes it difficult to use this as parameter for discarding the faulty prediction.&lt;/p&gt;

&lt;h3&gt;
  
  
  Repeated Predictions
&lt;/h3&gt;

&lt;p&gt;Never use just 1 time prediction in real world. For example, if doing image classification we should take multiple images from different angles or different cameras and do multiple prediction. Then find a knowledge fusion method to combine the predictions from the multiple prediction to determine what is the correct prediction.&lt;/p&gt;

&lt;p&gt;These are some simple solutions but more complex methods using filters and &lt;a href="http://wiki.ros.org/wire" rel="noopener noreferrer"&gt;Bayesian methods&lt;/a&gt; will improve results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The main take away point from the discussion is that machine learning algorithms output are not deterministic. So the software which uses these output(predictions) cannot be just simple if-else condition based, on the contrary they should have mechanisms through which it can &lt;strong&gt;accommodate the faults&lt;/strong&gt; of the predictions.&lt;/p&gt;

&lt;p&gt;Please comment on the various methods you have used to accommodate the faults in prediction of your algorithms.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>nlp</category>
      <category>imagenet</category>
      <category>faultanalysis</category>
    </item>
    <item>
      <title>CPP output coloured text in console</title>
      <dc:creator>Deebul Nair</dc:creator>
      <pubDate>Thu, 29 Jun 2017 11:43:01 +0000</pubDate>
      <link>https://dev.to/deebuls/cpp-output-coloured-text-in-console</link>
      <guid>https://dev.to/deebuls/cpp-output-coloured-text-in-console</guid>
      <description>&lt;h1&gt;
  
  
  Coloured Debug output
&lt;/h1&gt;

&lt;p&gt;Print statements are the most widely used debug method for coding in any programming. Its always useful to have a bag of methods for good print statements for debugging.&lt;/p&gt;

&lt;p&gt;One of the method is to color the output on the screen. Coloured debug statements are far more effective that plain white statements. For example can have green for positive statements and red for error statements.&lt;/p&gt;

&lt;p&gt;In cpp there are tons of ways of doing things. I always like the KISS  (keep it simple silly) method . The below code seems the most simplest way of doing it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;iostream&amp;gt;
#include &amp;lt;string&amp;gt;


int main()
{
    const std::string red("\033[0;31m");
    const std::string green("\033[1;32m");
    const std::string yellow("\033[1;33m");
    const std::string cyan("\033[0;36m");
    const std::string magenta("\033[0;35m");
    const std::string reset("\033[0m");

    std::cout &amp;lt;&amp;lt; yellow &amp;lt;&amp;lt; " Hello color yellow " &amp;lt;&amp;lt; reset &amp;lt;&amp;lt; std::endl;
    std::cout &amp;lt;&amp;lt; red &amp;lt;&amp;lt; " Hello color red " &amp;lt;&amp;lt; reset &amp;lt;&amp;lt; std::endl;
    std::cout &amp;lt;&amp;lt; green &amp;lt;&amp;lt; " Hello color green " &amp;lt;&amp;lt; reset &amp;lt;&amp;lt; std::endl;
    std::cout &amp;lt;&amp;lt; cyan &amp;lt;&amp;lt;" Hello color cyan " &amp;lt;&amp;lt; reset &amp;lt;&amp;lt; std::endl;
    std::cout &amp;lt;&amp;lt; magenta &amp;lt;&amp;lt; " Hello color magenta " &amp;lt;&amp;lt; reset &amp;lt;&amp;lt; std::endl;
     return 0;
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Obviously it has its drawbacks. I don't know now ,  but feel free to comment ✏️ of it doesn't work for you .&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>cout</category>
    </item>
    <item>
      <title>Hi, I'm Deebul Nair</title>
      <dc:creator>Deebul Nair</dc:creator>
      <pubDate>Sat, 24 Jun 2017 23:15:45 +0000</pubDate>
      <link>https://dev.to/deebuls/hi-im-deebul-nair</link>
      <guid>https://dev.to/deebuls/hi-im-deebul-nair</guid>
      <description>&lt;p&gt;I have been coding for [10] years.&lt;/p&gt;

&lt;p&gt;You can find me on GitHub as &lt;a href="https://github.com/deebuls" rel="noopener noreferrer"&gt;deebuls&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I live in [Bonn, Germany].&lt;/p&gt;

&lt;p&gt;I work for [Bonn-Rhine-Sieg University]&lt;/p&gt;

&lt;p&gt;I mostly program in these languages: [c++, python].&lt;/p&gt;

&lt;p&gt;I am currently learning more about [Bayesian learning, Deep learning and NLP].&lt;/p&gt;

&lt;p&gt;Nice to meet you.&lt;/p&gt;

</description>
      <category>introduction</category>
    </item>
  </channel>
</rss>
