<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Anil Kumar on Medium]]></title>
        <description><![CDATA[Stories by Anil Kumar on Medium]]></description>
        <link>https://medium.com/@anilkumar_82555?source=rss-c857eea517c8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MK9R3Mha2EwYl7Kr-4hEkA.jpeg</url>
            <title>Stories by Anil Kumar on Medium</title>
            <link>https://medium.com/@anilkumar_82555?source=rss-c857eea517c8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 08:33:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anilkumar_82555/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to design a simple object theft detection circuit using Arduino and load sensor]]></title>
            <link>https://medium.com/@anilkumar_82555/how-to-design-a-simple-object-theft-detection-circuit-using-arduino-and-load-sensor-4fffc396b8e2?source=rss-c857eea517c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/4fffc396b8e2</guid>
            <category><![CDATA[arduino]]></category>
            <category><![CDATA[electronics-engineering]]></category>
            <category><![CDATA[diy]]></category>
            <dc:creator><![CDATA[Anil Kumar]]></dc:creator>
            <pubDate>Mon, 03 Jun 2019 21:10:01 GMT</pubDate>
            <atom:updated>2019-06-04T05:38:46.176Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F0uFVpFIVt3I%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D0uFVpFIVt3I&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F0uFVpFIVt3I%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba1681682bb17f8a52c899bffa596e19/href">https://medium.com/media/ba1681682bb17f8a52c899bffa596e19/href</a></iframe><h3>How to design a simple Object Theft Detection circuit using Arduino and load sensor</h3><p>This article gives the steps to design a theft detection circuit using Arduino . Something similar to the ones you see on those Oceans 11 movies where the diamond is safeguarded by circuitry that gives an irritating alarm sound when the diamond is taken :)</p><p>I use weight measurement technique using a load sensor to register the weight of the object and detect when the object is taken. The algorithm is simple</p><p>&lt;1&gt; Place object on load sensor and register the weight when user presses switch</p><p>&lt;2&gt; In a loop do this</p><p><strong>“if weight != to registered weight activate LED or buzzer alarm “</strong></p><p>For weight measurement, I have used a load cell and HX711 load sensor. HX711 is analog to digital converter that converts analog inputs to digital data.</p><p>Load cell comes in various ranges like 5KG, 10KG, 100KG and more, here I have used load cell, which can weight up to 5KG. HX711 module amplifies the low electric output of load cell and then this amplified &amp; digitally converted signal is fed into the Arduino to derive the weight</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*1-sYAPQqvi7SBFU6LzQK9w.png" /><figcaption>Block schema of the circuit</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OeX6I2Uicnj5qSJAdJSZ5A.png" /><figcaption>Circuit diagram</figcaption></figure><p><strong>Arduino Code explained</strong></p><ol><li>readCount → This function reads digital data from HX711 sensor</li><li>setup → Initialization code. Sets up serial port . Configures input and output pins. Configures LEDs. Runs calibrate function to calibrate the weight measurement algorithm</li><li>calibrate() → calibration algorithm. Use a 100g weight as a reference for calibration</li><li>loop() → Infinite loop. Does the following :</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*hhZypZyquXp5ZOfTh-0eJQ.png" /><figcaption>Loop() algorithm</figcaption></figure><p>#define DT A0 <br>#define SCK A1<br>#define sw 2<br>#define green_led 3<br>#define red_led 4</p><p>long sample=0;<br>float val=0;<br>long count=0;<br>int stored_weight=0;</p><p>unsigned long readCount(void)<br>{<br> unsigned long Count;<br> unsigned char i;<br> pinMode(DT, OUTPUT);<br> digitalWrite(DT,HIGH);<br> digitalWrite(SCK,LOW);<br> Count=0;<br> pinMode(DT, INPUT);<br> while(digitalRead(DT));<br> for (i=0;i&lt;24;i++)<br> {<br> digitalWrite(SCK,HIGH);<br> Count=Count&lt;&lt;1;<br> digitalWrite(SCK,LOW);<br> if(digitalRead(DT)) <br> Count++;<br> }<br> digitalWrite(SCK,HIGH);<br> Count=Count⁰x800000;<br> digitalWrite(SCK,LOW);<br> return(Count);<br>}</p><p>void setup() {<br> Serial.begin(9600);<br> pinMode(SCK, OUTPUT);<br> pinMode(sw, INPUT_PULLUP);<br> pinMode(green_led, OUTPUT);<br> pinMode(red_led, OUTPUT);<br> digitalWrite(green_led, LOW);<br> digitalWrite(red_led, HIGH);<br> delay(1000);<br> calibrate();<br>}</p><p>void loop() {<br> // put your main code here, to run repeatedly:<br> //Serial.print(“Hello World”);<br> count= readCount();<br> Serial.println(count);<br> delay(1000);<br> int w=(((count-sample)/val)-2*((count-sample)/val));<br> Serial.print(“weight:”);<br> Serial.print((int)w);<br> Serial.println(“g”);<br> if(digitalRead(sw)==0)<br> {<br> stored_weight=w;<br> Serial.println(“Recording new weight !!…………….”);<br> }<br> if(stored_weight == w)<br> {<br> digitalWrite(green_led, HIGH);<br> digitalWrite(red_led, LOW);<br> }<br> else<br> {<br> digitalWrite(green_led, LOW);<br> digitalWrite(red_led, HIGH); <br> delay(500);<br> digitalWrite(red_led, LOW);<br> <br> }<br> <br>}<br>void calibrate()<br>{<br> Serial.print(“Calibrating…”);<br> Serial.print(“Please Wait…”);<br> for(int i=0;i&lt;100;i++)<br> {<br> count=readCount();<br> sample+=count;<br> Serial.println(count);<br> }<br> delay(10000);<br> sample/=100;<br> Serial.print(“Avg:”);<br> Serial.println(sample);<br> Serial.print(“Put 100g &amp; wait”);<br> count=0;<br> delay(2000);<br> while(count&lt;1000)<br> {<br> count=readCount();<br> count=sample-count;<br> Serial.println(count);<br> }<br> <br> Serial.print(“Please Wait….”);<br> delay(2000);<br> for(int i=0;i&lt;100;i++)<br> {<br> count=readCount();<br> val+=sample-count;<br> Serial.println(sample-count);<br> }<br> Serial.println(val);<br> val=val/100.0;<br> val=val/100.0; // put here your calibrating weight<br> delay(2000);<br> <br>}</p><p><strong>Bill of Materials</strong></p><ol><li>Arduino Uno → <a href="https://www.ebay.com/i/183710474768?chn=ps">https://www.ebay.com/i/183710474768?chn=ps</a></li><li>Load sensor+ HX711 A/D convertor → <a href="https://tinyurl.com/yxamdyl6">https://tinyurl.com/yxamdyl6</a></li><li>Standard weight 100g →<a href="https://tinyurl.com/yxoelb3x">https://tinyurl.com/yxoelb3x</a></li><li>leds switches and connectors</li><li>Bread board</li></ol><p><strong>References</strong></p><p><a href="https://circuitdigest.com/microcontroller-projects/arduino-weight-measurement-using-load-cell">Arduino Weight Measurement Project with Load Cell and HX711 Module Interfacing: Circuit Diagram and Code</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fffc396b8e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How we all helped(unknowingly) Google to digitize books]]></title>
            <link>https://medium.com/good-audience/how-we-all-helped-unknowingly-google-to-digitize-books-acb45bc65084?source=rss-c857eea517c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/acb45bc65084</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[recaptcha]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[smart]]></category>
            <category><![CDATA[optimization]]></category>
            <dc:creator><![CDATA[Anil Kumar]]></dc:creator>
            <pubDate>Thu, 17 Jan 2019 23:45:47 GMT</pubDate>
            <atom:updated>2019-03-12T19:20:24.516Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*s1wTpcg4QSvteGty" /><figcaption>Photo by <a href="https://unsplash.com/@taylor08n?utm_source=medium&amp;utm_medium=referral">Taylor Barber</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If there are multiple ways of performing a task, Google always manages to do it the smart way. One such example is how Google achieved the humongous job of digitizing scanned ebooks to a digital format.</p><p>Google instead of using software to do the job, made use of us, the users of Google. Every one of us who have been using Google helped in the digitization process, unaware.</p><p>How did Google achieve this? Using <a href="https://en.wikipedia.org/wiki/ReCAPTCHA">reCAPTCHA</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*XrcYSaol73R5ZYWkawBHJg.png" /></figure><p>reCAPTCHA is a CAPTCHA-like system designed to establish that a computer user is human (normally in order to protect websites from bots). The company was acquired by Google in 2009.</p><p>We all have been using reCAPTCHA from several years to prove that we are not robots. Google has been cleverly using this test results for digitization. The text presented during reCAPTCHA test is usually a digital image of the text from scanned books. Users type the text as they see, or in other words have converted the scanned image to a text data which can be stored as a digital document. This document is searchable, more legitimate and occupies less memory compared to the scanned image of the book. Every day millions of users taking the reCAPTCHA test on sites such as Facebook, TicketMaster, Twitter, CNN.com, Craigslist, have been helping Google in this process.</p><p>reCAPTCHA has completely digitized the archives of The New York Times and books from Google Books, as of 2011. The archive can be searched from the New York Times Article Archive, where more than 13 million articles in total have been archived, dating from 1851 to the present day.<br>Through mass collaboration, reCAPTCHA was helping to digitize books that are too illegible to be scanned by computers, as well as translate books to different languages.</p><p><strong><em>What Next?</em></strong></p><p>Google hasn’t stopped at ebook digitization. It is also using reCAPTCHA in creating datasets and labels for training its machine learning models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m663ySNjhqMd7rLS7gOTbg.jpeg" /></figure><p>Whenever we identify images during reCAPTCHA tests, we are doing image classification and providing a label to the image. Google uses this dataset for improving the accuracy of its AI models which is used in its products.</p><p><strong><em>Conclusion</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9N9vkLhjJegtTixXGd9Ojg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=acb45bc65084" width="1" height="1" alt=""><hr><p><a href="https://medium.com/good-audience/how-we-all-helped-unknowingly-google-to-digitize-books-acb45bc65084">How we all helped(unknowingly) Google to digitize books</a> was originally published in <a href="https://medium.com/good-audience">Good Audience</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Food detection app using Tensorflow Object Detection APIs]]></title>
            <link>https://medium.com/good-audience/food-detection-app-using-tensorflow-object-detection-apis-1b9302a9aad2?source=rss-c857eea517c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b9302a9aad2</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Anil Kumar]]></dc:creator>
            <pubDate>Fri, 31 Aug 2018 19:07:54 GMT</pubDate>
            <atom:updated>2018-09-15T19:43:59.871Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*3lAxV0t43t9KFf0q4EJXNA.gif" /></figure><p>The TensorFlow Object Detection API is an open source framework built on top of TensorFlow that makes it easy to construct, train and deploy object detection models.</p><p>Being a novice in the world of deep learning, I began exploring on Google’s code labs and was introduced to the world of TensorFlow and its offerings to the developer community. After getting my hands dirty on a few starter projects (check <a href="https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/#0">this </a>and <a href="https://codelabs.developers.google.com/codelabs/tensorflow-for-poets-2-tflite/#0">this</a>) on Image classification I wanted to work on real-world projects using Object Detection algorithms.</p><p>Inspired by <a href="https://www.oreilly.com/ideas/object-detection-with-tensorflow">this</a> <strong>O’Reilly post</strong>, I wanted to experiment on TensorFlow Object Detection APIs and learn how to train custom datasets. An interesting use case which occurred to me is food detection application. This app is a toy project to detect food item classes (max 20 in one image) and also display the calorie count for each item.<br>This blog post provides step by step instructions on how to train your own dataset (images+labels) using <a href="https://ai.googleblog.com/2017/06/mobilenets-open-source-models-for.html">Mobilenet SSD</a> as a base model. The code for this blog is available on my <a href="https://github.com/kumarkan/Food_Detection">github</a>.</p><p>In this project, you will be training a custom object detection model on a dataset containing images of food. The model will then be invoked for inference on a live camera feed to detect the type of food and list the calorie count.</p><p>The TensorFlow Object Detection API makes it extremely easy to train your own object detection model for a large variety of applications. With an object detection model, not only can you classify multiple objects in one image, but you can specify exactly where that object is in an image with a bounding box framing the object.</p><p>This project was tested on an Ubuntu machine (16.04.3 LTS) with Python and other supported libraries. I guess you should be able to run this on a Raspberry Pi running Raspian OS as well.</p><p><strong>Step 1: Gathering a dataset</strong></p><p>The first step is to gather a dataset. A dataset is a collection of images and labels for these images.</p><p>Depending on how many classes, you intend to train the model for, you need a large dataset of food images. Fortunately, we have Kaggle which offers free images for training and evaluation. <a href="https://www.kaggle.com/dansbecker/food-101">https://www.kaggle.com/dansbecker/food-101</a> is a good collection of food images which u can use for this project.</p><p>You can also download multiple images from Google Chrome browser with one click using the <a href="https://chrome.google.com/webstore/detail/download-all-images/ifipmflagepipjokmbdecpmjbibjnakm?hl=en">Download Images plugin</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*fISaJldlXJKoyObxnjs4gA.jpeg" /></figure><p>In this food detection app, we train the model to detect 2 classes: 1) Cheeseburger 2) Fries. The images directory will have a collection of images for Cheeseburger and Fries and the corresponding labels (.xml) files which describe the location of the bounding box in the image and labels for the image. The more images the better is the accuracy of your trained model. For Ex. for the simple case of Cheeseburger and Fries, it is essential to have images of Burger, Fries, and images having Burger+fries.</p><p>For this project, I downloaded images from the web and resized them to 300x300 using skimage utility in python</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*ExgqdB8AxKOOQY765wXkBQ.jpeg" /></figure><p><strong>Step 2: Label the dataset</strong></p><p>The tedious part is to label the images to create the .xml files. Each image needs bounding boxes to specify the location of the object in the image. I used an open source tool LabelImg for this purpose — <a href="https://github.com/tzutalin/labelImg">https://github.com/tzutalin/labelImg</a></p><p>You can open the image directory on LabelImg and add bounding box and a label name. When you save, it gives you a .xml file with the details of x,y co-ordinates of the bounding box (xmin,ymin xmax,ymax) and label name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GDZ73dBAX6Q-6hadFjrOnQ.jpeg" /><figcaption>LabelImg screenshot</figcaption></figure><p>At the end of this step, you should have a folder with .jpg (data)images and .xml (label)file. For example, if we are training the model to detect two classes 1) Cheeseburger 2) Fries, the dataset folder will look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*x8GUd-FNyjbeWXrBxpg50A.jpeg" /></figure><p>I have provided the images and .xml files for the two classes (Cheeseburger and Fries) in my github</p><p><strong>Step 3: Install the object detection API</strong></p><p>Before getting started, we have to clone and install the object detection API into our GitHub repository. The full installation process for this is documented in the <a href="https://github.com/kumarkan/Food_Detection/blob/master/README.md">GitHub repository Readme</a>.</p><p>At the end of the steps mentioned in the Readme file, you will be asked to execute the Jupyter Notebook command to continue to execute remaining commands via. the ipynb file</p><p><strong>Step 4: Convert label files (.xml) to .csv format</strong></p><p>Follow the instructions in the ipynb file to convert the label files to .csv format. You can either run the commands directly by clicking “run” button on Jupyter notebook or you can execute ipython on your terminal and copy paste the commands from the ipynb file</p><p><strong>Step 5: Convert labels to binary format (TFRecord)</strong></p><p>If you are working with large datasets, using a binary file format for storage of your data can have a significant impact on the performance of your import pipeline and as a consequence on the training time of your model. Binary data takes up less space on disk, takes less time to copy and can be read much more efficiently from disk.</p><p>TFRecord is TensorFlows binary storage format. We can generate a TFRecord file using code adapted from this <a href="https://github.com/datitran/raccoon_dataset/blob/master/generate_tfrecord.py">raccoon detector</a>.</p><p>Follow instructions from the ipynb file to generate the TFRecord files for test and train datasets</p><p><strong>Step 6: Choose a model to retrain</strong></p><p>Training a model from beginning to end with your dataset can take a long time (weeks) and a high-end GPU. Instead, you could use a pre-trained model and retrain it with your dataset to replace the classes in that model with your classes. For this project, we chose Mobileset SSD as the base model. The SSD models offer high speed and are ideal for detection on video feeds. The Mobilenet is suitable for low core devices as it consumes lesser space while still giving decent accuracy numbers. Check this <a href="https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md">link</a> for a list of models available and their comparison.</p><p>Download the model using the command :</p><pre>wget http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_coco_11_06_2017.tar.gz<br>tar xvzf ssd_mobilenet_v1_coco_11_06_2017.tar.gz</pre><p>Retrain the model using the command :</p><pre>python3 models/research/object_detection/legacy/train.py --logtostderr --train_dir=data/ --pipeline_config_path=data/ssd_mobilenet_v1_pets.config</pre><p><strong>Step 7 : Export graph</strong></p><p>Once our loss is consistently around the value of 1 or starts rising, we can stop TensorFlow training by pressing ctrl+c. You can choose the latest checkpoint file to export it to a graph file for inference. Checkpoint files get stored in /data folder with the .index extension</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*Mffp-ASzubREpi746ECHsQ.jpeg" /></figure><pre>rm -rf object_detection_graph<br>python3 models/research/object_detection/export_inference_graph.py <strong>\</strong><br>    --input_type image_tensor <strong>\</strong><br>    --pipeline_config_path data/ssd_mobilenet_v1_pets.config <strong>\</strong><br>    --trained_checkpoint_prefix data/model.ckpt-11454 <strong>\</strong><br>    --output_directory object_detection_graph</pre><p><strong>Step 8 : Perform Live inference</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EajOKpd7fmphXCMKytBppg.jpeg" /></figure><p><strong>Results</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*RHbR_c2muM7J_W7pwEA0cQ.jpeg" /></figure><p>This sample project was an attempt to list all the steps for training a model to perform object detection on you custom dataset. The resulting model can be run directly on mobile device or converted to TensorFlow Lite format to leverage Android’s Neural Network APIs .</p><p>Hope you enjoyed the read!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2F7b0181%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2F7b0181%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/748a06e9019942f2677bba917ef55804/href">https://medium.com/media/748a06e9019942f2677bba917ef55804/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b9302a9aad2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/good-audience/food-detection-app-using-tensorflow-object-detection-apis-1b9302a9aad2">Food detection app using Tensorflow Object Detection APIs</a> was originally published in <a href="https://medium.com/good-audience">Good Audience</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>