<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>IoT | Data Science Portfolio</title>
    <link>http://mreevesdsba.hopto.org/tag/iot/</link>
      <atom:link href="http://mreevesdsba.hopto.org/tag/iot/index.xml" rel="self" type="application/rss+xml" />
    <description>IoT</description>
    <generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Sat, 27 Apr 2019 00:00:00 -0400</lastBuildDate>
    <image>
      <url>http://mreevesdsba.hopto.org/images/icon_hua2ec155b4296a9c9791d015323e16eb5_11927_512x512_fill_lanczos_center_2.png</url>
      <title>IoT</title>
      <link>http://mreevesdsba.hopto.org/tag/iot/</link>
    </image>
    
    <item>
      <title>Image Recognition For Specialty Produce</title>
      <link>http://mreevesdsba.hopto.org/project/specialty-image/</link>
      <pubDate>Sat, 27 Apr 2019 00:00:00 -0400</pubDate>
      <guid>http://mreevesdsba.hopto.org/project/specialty-image/</guid>
      <description>&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;Specialty Produce has one of the most extensive &lt;a href=&#34;https://www.specialtyproduce.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;databases&lt;/a&gt; of information surrounding produce. In order to fully leverage all of this information in the most advanced way possible, a project was started to perform image classification based on each of their products. The most prohibitive portion of most image recognition is not computation power, but labeled data collection. Specialty Produce is in the unique circumstance to have ready access to thousands of products. This is a highly valuable asset that is difficult with which to compete. The largest hurdle is simply collecting the variety of images and have them properly labelled. Through hardware development and digital data augmentation this hurdle was overcome.&lt;/p&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h2 id=&#34;approach&#34;&gt;Approach&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;Image recognition requires labeled images of &amp;ldquo;real-world&amp;rdquo; examples for each class. If the image recognition is in a restricted environment like a laboratory or machine line, the image surrounding the object is less important to introduce maximum variance. However, given that the end-state of this product will be user-submitted images, the images need to be as diverse as possible. Rather than attempting to recreate these settings in real-world environments, data is collected in as uniform of environments as possible and then introduce this variation digitally. Currently, the PoC is only classifying bananas by ripeness (i.e. days to being overripe)&lt;/p&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h2 id=&#34;hardware&#34;&gt;Hardware&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;There are 5 main components to the hardware:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Computer (Raspberry Pi)&lt;/li&gt;
&lt;li&gt;Camera module&lt;/li&gt;
&lt;li&gt;Spinning platform&lt;/li&gt;
&lt;li&gt;Photo box&lt;/li&gt;
&lt;li&gt;RFID chip reader&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/imagerecog/hardware1.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;The computer is connected to a camera and spinning platform that capture numerous images of the product from different angles. This not only ensures maximum information gain, but also naturally balances the variation within each class. The photo box provides a uniform background which makes it easy to remove during pre-processing. In order to fully streamline the process and ensure as few misclassifications as possible, RFID tags are assigned to each product. After the item is placed on the platform, the corresponding card is tapped. The product ID is captured from the card, the photos are taken, and each image is stored in a database. A single product can be scanned in as little as 15 seconds with essentially no input from the user other than the card tap.&lt;/p&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h2 id=&#34;software&#34;&gt;Software&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;The data capture code, image processing, and the neural network are written in Python.&lt;/p&gt;
&lt;br&gt;
&lt;h4 id=&#34;data-capture&#34;&gt;Data Capture&lt;/h4&gt;
&lt;p&gt;The code relies on several python hardware libraries to interface with the camera, stepper motor, and RFID tag, in addition to file system and SQL database packages to store the information. The number of images per full-rotation can be selected; however, there are diminishing returns as the images might not have enough variation if more are selected and the capture time will increase. Encoding of the RFID tags is handled separately.&lt;/p&gt;
&lt;br&gt;
&lt;h4 id=&#34;image-processing&#34;&gt;Image Processing&lt;/h4&gt;
&lt;p&gt;There are 3 steps to the pre-processing before they can be consumed by the model:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Remove Background&lt;/b&gt;: the background of the image must be removed otherwise when the model sees a real-world image, it will be confused because it does not look like the photo box&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Digital Augmentation&lt;/b&gt;: by stretching, skewing, and otherwise altering the original, we can produce multiple images from one. This step accomplishes two things. The first is that it allows for various real-world variances to be introduced. Images will not have the same lighting conditions, angles, item placement, or color balance as the captured data so this is all introduced artificially. The second is that it allows for multiple training images to be produced from a single image.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Random Backgrounds&lt;/b&gt;: the images are added on top of random backgrounds to simulate the variety of real-world images that will eventually be processed by the production model. This helps train the model to ignore everything but the original item. This is also where the image is resized to fit the model&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/imagerecog/process.PNG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;br&gt;
&lt;h4 id=&#34;neural-network&#34;&gt;Neural Network&lt;/h4&gt;
&lt;p&gt;The network was coded directly in TensorFlow. Transfer learning pretrained on ImageNet was utilized in order to expedite learning. Currently, the PoC is only classifying bananas by ripeness (i.e. days to being overripe) and has not been properly tuned. Once a larger set of the final data set has been collected, hyperparameter tuning will be performed more thoroughly.&lt;/p&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h2 id=&#34;end-state&#34;&gt;End-State&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;A twitter app has already been developed, allowing the model to run on an image tweeted to a specific account. After the model has run, it retweets with a model score. Eventually, this project will be incorporated into the Specialty Produce mobile app.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://mreevesdsba.hopto.org/img/imagerecog/twitter.PNG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Vintage Smart Remote</title>
      <link>http://mreevesdsba.hopto.org/project/remote/</link>
      <pubDate>Sat, 27 Apr 2019 00:00:00 -0400</pubDate>
      <guid>http://mreevesdsba.hopto.org/project/remote/</guid>
      <description>&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;The  Zenith Space Command was the first commercially available remote. It was battery-free and worked by using ultra-sonic clicks in order to communicate with the television. In essence, it was a musical instrument that only the television could hear. The goal of this project was to modernize the remote, maintaining its original form-factor and styling but adding WiFi and IR capabilities.
&lt;br&gt;
There were several goals to the project:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;WiFi-enabled&lt;/li&gt;
&lt;li&gt;Able to control TV, stereo, and lights&lt;/li&gt;
&lt;li&gt;Dependable&lt;/li&gt;
&lt;li&gt;User-friendly
&lt;br&gt;
&lt;br&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;approach&#34;&gt;Approach&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;As WiFi is notoriously power-hungry, enabling it in a remote device is a challenge. Another challenge was the limited number of buttons available. The one positive aspect of the project is that the remote is fairly large, by today&amp;rsquo;s standards, which allowed for a lot of room to add components. An ESP8266 chip was selected for its WiFi capabilities. This was combined with a battery and wireless charger. The additional components were the IR transmitter for local devices and a vibration sensor for battery management.
&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2 id=&#34;hardware&#34;&gt;Hardware&lt;/h2&gt;
&lt;hr&gt;
&lt;h5 id=&#34;build&#34;&gt;Build&lt;/h5&gt;
&lt;p&gt;Many of the original components were removed and the button contacts were wired to the microcontroller. A new support was designed and 3d-printed to house all of the components and hold the battery.
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/remote/remote2.jpg&#34; alt=&#34;3D-printed housing with development board&#34;&gt;&lt;/p&gt;
&lt;h5 id=&#34;microcontroller&#34;&gt;Microcontroller&lt;/h5&gt;
&lt;p&gt;The ESP8266 chip is a common starting point for many similar projects. It has a small footprint and quite capable, in fact overly capable for this project.&lt;/p&gt;
&lt;h5 id=&#34;battery&#34;&gt;Battery&lt;/h5&gt;
&lt;p&gt;An 800mAh battery was used as it was the largest battery that would still fit in the given space. It provides a decent amount of power for the project, but not nearly enough for a reasonable remote control without adjustments.&lt;/p&gt;
&lt;h5 id=&#34;charging&#34;&gt;Charging&lt;/h5&gt;
&lt;p&gt;In order to be more dependable and user-friendly without sacrificing the aesthetics, wireless charging was incorporated to allow it to be charged on any Qi-enabled charge pad.&lt;/p&gt;
&lt;h5 id=&#34;additional-components&#34;&gt;Additional Components&lt;/h5&gt;
&lt;p&gt;IR was added for local components (i.e. TV and stereo). A vibration sensor was also added in order to reduce battery usage. Without modifications, the remote lasted around 4 hours with the WiFi connection. However, by going into deep sleep until the vibration sensor is activated, this has been extended to over a week on a single charge, depending on usage. There is no discernible difference in functionality due to deep sleep.
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/remote/remote1.jpg&#34; alt=&#34;Ensuring buttons and charging work before switching from dev to production board&#34;&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2 id=&#34;software&#34;&gt;Software&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;The microcontroller was programmed with the Arduino IDE. WiFi SSID is set with an WAP if no connection can be established. The WAP allows the user to scan the local WiFi networks, select the desired connection, and add a password.&lt;/p&gt;
&lt;h5 id=&#34;button-configuration&#34;&gt;Button Configuration&lt;/h5&gt;
&lt;p&gt;Due to the lack of inputs, each button has two input methods: short press and long press. In addition to short and long presses, a single press of the yellow button allows for each of 4 lights to be controlled individually. This means there are a total of 11 button functions instead of 4.
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/remote/button.PNG&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;h5 id=&#34;wifi-communication&#34;&gt;WiFi Communication&lt;/h5&gt;
&lt;p&gt;In order to ensure ease of updates, the remote does not communicate directly with each smart device. Instead, an MQTT message is sent to a broker run through FLASK on a cloud server. The server then sends the appropriate command to the specified device.
&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2 id=&#34;results&#34;&gt;Results&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;While the functionality of the remote is not as user-friendly as hoped, the other aspects of the project were quite successful. The styling and innovation from nearly 70 years ago has been modernized to accommodate for current technologies.
&lt;img src=&#34;http://mreevesdsba.hopto.org/img/remote/remote3.gif&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
