<?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>Duck Chasing Boat History</title>
		<description>Progress report on autonomous duck-chasing toy boat creation</description>		
		<link>http://alphamou.se</link>
		<atom:link href="http://alphamou.se/duckchase/feed.xml" rel="self" type="application/rss+xml" />
		
			<item>
				<title>Recognition, part 2</title>
				<description>&lt;p&gt;Quite some time has passed since &lt;a href=&quot;/2017/09/09/recognition-part-1.html&quot;&gt;part 1&lt;/a&gt;. I’ve trained a new neural network to recognize ducks.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/duckchase/img/2019-06-16-ducks-1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/duckchase/img/2019-06-16-ducks-3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;That’s much better than what the stock network was seeing. Not ideal to be sure, but good enough to work with.&lt;/p&gt;

&lt;p&gt;This was achieved largely following the tutorial by &lt;a href=&quot;https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10&quot;&gt;EdjeElectronics&lt;/a&gt;, but on Ubuntu instead of Windows. I had around two thousand photos to train on, which took some time to label manually. I’ve struggled a bit experimenting with different models and settled on &lt;a href=&quot;https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md&quot;&gt;ssdlite_mobilenet_v2_coco&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Also, I’ve tried to follow the &lt;a href=&quot;https://medium.com/tensorflow/training-and-serving-a-realtime-mobile-object-detector-in-30-minutes-with-cloud-tpus-b78971cf1193&quot;&gt;following tutorial&lt;/a&gt;, but either I’m an idiot (which is very likely), or google cloud machine learning is very far from being a reliable product. I’ve spent dozens of attempts trying to at least start training there so that it didn’t crash after first 10 minutes running. Then after having spent 200$ (gladly out of 300$ of promo credit given upon registration) I’ve ended up with a model that didn’t perform any better than the one I’ve trained locally on my 3Gb GTX 1060.&lt;/p&gt;

&lt;p&gt;The bad news that the model takes about 1 second to run on raspberry, which is a bit slow. So I decided to try &lt;a href=&quot;https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-nano/&quot;&gt;Nvidia’s Jetson Nano&lt;/a&gt; out, which set the project budget some $100 back. To my pleasure it processes the model in about 0.2 sec. So that’ll be the way to go, even though it barely fits inside the boat.&lt;/p&gt;

&lt;p&gt;The following bad news was that the Jetson doesn’t work with raspberry cameras that I had. It only accepts IMX219 camera sensor, while the cameras I had were on older OV5647, so now I have to buy another camera.&lt;/p&gt;

&lt;p&gt;While I’m waiting for camera shipment I’ll probably try to assemble everything with raspberry, maybe one-two second latency is not that bad.&lt;/p&gt;
</description>
				<pubDate>Sun, 16 Jun 2019 00:00:00 +0300</pubDate>
				<dc:creator>alpha-mouse</dc:creator>
				<link>http://alphamou.se/duckchase/2019/06/16/recognition-part-2.html</link>
				<guid isPermaLink="true">http://alphamou.se/duckchase/2019/06/16/recognition-part-2.html</guid>
			</item>
		
			<item>
				<title>Slower motor</title>
				<description>&lt;p&gt;Since the ducks were afraid of &lt;a href=&quot;/2017/09/12/motor-noise.html&quot;&gt;motor noise&lt;/a&gt; (or maybe the boat speed) I’ve bought another motor. For some reason I’ve decided that 500 RPM should be enough. While I waited for the motor to ship, I’ve assembled a simple device to measure RPM. Arduino, led and photo transistor was all that I needed. If I place the propeller between the led and photo transistor, arduino can count how many times the blades interrupt the light and compute RPM from that. And I’ve found that the original motor produced about 24000 PRM. Needless to say that when I’ve installed the new motor that boat hardly moved. But the motor was much quieter, so I liked it anyway.&lt;/p&gt;

&lt;p&gt;Now instead of fast scary boat I now had non-moving innocuous one. Could ditch the motor altogether I guess.&lt;/p&gt;

&lt;p&gt;To remedy that I decided to replace the propeller as well, as the original one was quite small. The biggest one that I could fit was 52mm in diameter. Any bigger one would collide with the steering mechanism. The original propeller was about 38mm.&lt;/p&gt;

&lt;p&gt;Now the boat can move, though is still very slow. At least the ducks are content.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/duckchase/img/2018-05-20-courageous-ducks.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Also, by chance I’ve got a very cool gull photo.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/duckchase/img/2018-05-20-gull.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
</description>
				<pubDate>Sun, 20 May 2018 00:00:00 +0300</pubDate>
				<dc:creator>alpha-mouse</dc:creator>
				<link>http://alphamou.se/duckchase/2018/05/20/slower-motor.html</link>
				<guid isPermaLink="true">http://alphamou.se/duckchase/2018/05/20/slower-motor.html</guid>
			</item>
		
			<item>
				<title>Motor noise</title>
				<description>&lt;p&gt;While I was shooting duck photos from the boat, another unpleasant fact became obvious.&lt;/p&gt;

&lt;p&gt;Ducks are not enthusiastic about some whirring green thing swimming next to them.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/duckchase/img/2017-09-12-coward-ducks.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I swear they were a metre from the bank and the boat itself before I’ve turned it on.&lt;/p&gt;

&lt;p&gt;Now I think about getting a quieter motor somewhere, but not yet sure what exactly to look for.&lt;/p&gt;
</description>
				<pubDate>Tue, 12 Sep 2017 00:00:00 +0300</pubDate>
				<dc:creator>alpha-mouse</dc:creator>
				<link>http://alphamou.se/duckchase/2017/09/12/motor-noise.html</link>
				<guid isPermaLink="true">http://alphamou.se/duckchase/2017/09/12/motor-noise.html</guid>
			</item>
		
			<item>
				<title>Recognition, part 1</title>
				<description>&lt;p&gt;After taking some real duck shots the next step was to recognize ducks on them.&lt;br /&gt;
I’ve found that &lt;a href=&quot;https://research.googleblog.com/2017/06/supercharge-your-computer-vision-models.html&quot;&gt;tensorflow&lt;/a&gt; is the sexiest thing at the moment. Maybe there are better ways to achieve what I need, but I’m no computer vision expert.&lt;/p&gt;

&lt;p&gt;While I was struggling with installing the whole framework and drivers a friend of mine compassionately suggested that maybe it will more efficient to make infrared shots of ducks. There is &lt;a href=&quot;https://www.raspberrypi.org/products/pi-noir-camera-v2/&quot;&gt;pi cameras without IR filter&lt;/a&gt;. Augmented with visible light filter that would be an easy solution to my problem! I was very encouraged by googling “duck infrared”:&lt;br /&gt;
&lt;img src=&quot;/duckchase/img/2017-09-09-ducks2_ir.jpg&quot; alt=&quot;&quot; style=&quot;max-width:100%&quot; /&gt;
&lt;em&gt;(photo taken from &lt;a href=&quot;http://coolcosmos.ipac.caltech.edu/image_galleries/ir_zoo/duck.html&quot;&gt;http://coolcosmos.ipac.caltech.edu/image_galleries/ir_zoo/duck.html&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Then we’ve discovered that actually quite wide &lt;a href=&quot;https://en.wikipedia.org/wiki/Infrared&quot;&gt;part of the spectrum&lt;/a&gt; is called “infrared” and no way pi camera is heat radiation sensitive. So no easy wins here unfortunately.&lt;/p&gt;

&lt;p&gt;Back to tensorflow, that’s what “Faster RCNN with Inception Resnet v2” model thinks of my photos:&lt;br /&gt;
&lt;img src=&quot;/duckchase/img/2017-09-09-recognition.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;While definitely cool, that’s not perfect (not all ducks are recognized), and somewhat slow, as I’ve used the most sophisticated model. Maybe I need to train my own model to recognize ducks specifically.&lt;/p&gt;
</description>
				<pubDate>Sat, 09 Sep 2017 00:00:00 +0300</pubDate>
				<dc:creator>alpha-mouse</dc:creator>
				<link>http://alphamou.se/duckchase/2017/09/09/recognition-part-1.html</link>
				<guid isPermaLink="true">http://alphamou.se/duckchase/2017/09/09/recognition-part-1.html</guid>
			</item>
		
			<item>
				<title>Boat with camera</title>
				<description>&lt;p&gt;After ensuring that the boat itself worked just fine, I’ve attached a little pi camera to it. The camera is connected to rapsberry pi inside the hull. Raspberry is powered by a separate powerbank. It could have been powered by the boat battery, but I had a little powerbank lying around anyway. Powerbank and own battery (which is overly heavy in itself, because I’ve chosed the biggest) make the boat more sluggish, but once again, it was never meant to be too quick.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/duckchase/img/2017-04-25-boat-with-camera.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;As with the first boat, I’ve written an application to start/stop taking photos and to preview them. Raspberry hosts the application, connects to the tablet’s wifi, so that the tablet can view the application. The application code is &lt;a href=&quot;https://github.com/alpha-mouse/pi-photo-hunt&quot;&gt;on github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here are a couple of shots from the boat:&lt;br /&gt;
&lt;img src=&quot;/duckchase/img/2017-04-25-ducks1.jpg&quot; alt=&quot;&quot; /&gt;
&lt;img src=&quot;/duckchase/img/2017-04-25-ducklings2.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
</description>
				<pubDate>Tue, 25 Apr 2017 00:00:00 +0300</pubDate>
				<dc:creator>alpha-mouse</dc:creator>
				<link>http://alphamou.se/duckchase/2017/04/25/boat-with-camera.html</link>
				<guid isPermaLink="true">http://alphamou.se/duckchase/2017/04/25/boat-with-camera.html</guid>
			</item>
		
			<item>
				<title>Regular boat</title>
				<description>&lt;p&gt;After a disappointment in my own shipbuilding skills I’ve bought myself a regular RC boat. The sellers in the shop were quite suprpised at my request for a boat that would go as &lt;em&gt;slow&lt;/em&gt; as possible. Also I asked for the biggest battery I can put into it, so it would work for very long time. I suppose they concluded I’m a smuggler or something.&lt;/p&gt;

&lt;p&gt;The boat was obviously much better than mine&lt;br /&gt;
&lt;img src=&quot;/duckchase/img/2017-04-19-regular-boat.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The only mishap was that I’ve broken the propeller blades somewhat upon encountering a tree branch lying in the pond. On the other hand, I wanted the boat to be slower anyway.&lt;/p&gt;
</description>
				<pubDate>Wed, 19 Apr 2017 00:00:00 +0300</pubDate>
				<dc:creator>alpha-mouse</dc:creator>
				<link>http://alphamou.se/duckchase/2017/04/19/regular-boat.html</link>
				<guid isPermaLink="true">http://alphamou.se/duckchase/2017/04/19/regular-boat.html</guid>
			</item>
		
			<item>
				<title>Crafting my own boat</title>
				<description>&lt;p&gt;At first I thought of making my own boat from whatever materials were at hand. Maybe I even decided to make the boat first, and only later the duck chasing idea struck me. I don’t remember the details.&lt;/p&gt;

&lt;p&gt;What I had:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;basic &lt;a href=&quot;https://www.aliexpress.com/item/F17929-DIY-Handmade-Accessories-Boat-Ship-Kit-Electric-Two-Motor-Propeller-Power-Driven-for-Remote-Control/32700313467.html&quot;&gt;rc boat kit&lt;/a&gt;&lt;br /&gt;
&lt;img src=&quot;/duckchase/img/2017-03-05-boat-kit.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;kid’s construction kit&lt;br /&gt;
&lt;img src=&quot;/duckchase/img/2017-03-05-constructor-kit.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;powerbank and batteries&lt;br /&gt;
&lt;img src=&quot;/duckchase/img/2017-03-05-powerbank.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://www.raspberrypi.org/products/raspberry-pi-3-model-b/&quot;&gt;Raspberry PI 3 Model B&lt;/a&gt;&lt;br /&gt;
&lt;img src=&quot;/duckchase/img/2017-03-05-raspberry.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://thepihut.com/products/motozero&quot;&gt;MotoZero module&lt;/a&gt;&lt;br /&gt;
&lt;img src=&quot;/duckchase/img/2017-03-05-motozero.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What I’ve got:&lt;br /&gt;
&lt;img src=&quot;/duckchase/img/2017-03-05-crafted-boat.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;To control the boat I’ve written a little &lt;a href=&quot;https://github.com/alpha-mouse/piboat&quot;&gt;web application&lt;/a&gt;. Raspberry hosted the application, I opened it in the phone’s browser, and controlled the boat by it. As I’ve only tested the boat at home, both the raspberry and the phone were connected to home wifi. Outdoors I’d need to enable wifi tethering on the phone and connect the boat to phones wifi.&lt;/p&gt;

&lt;p&gt;What I’ve discovered is that either I’ve soldered the MotoZero poorly (I had little soldering experience before) or the motors in boat kit were too weak, but the propellers were barely rotating. That meant that I needed better motors. And anyway I needed a proper hull as I wouldn’t risk using such concoction in the wild lest the raspberry or batteris fall into the water or otherwise get wet. Long story short, I decided to just buy a boat and repurpose it for my needs.&lt;/p&gt;
</description>
				<pubDate>Sun, 05 Mar 2017 00:00:00 +0300</pubDate>
				<dc:creator>alpha-mouse</dc:creator>
				<link>http://alphamou.se/duckchase/2017/03/05/crafting-my-own-boat.html</link>
				<guid isPermaLink="true">http://alphamou.se/duckchase/2017/03/05/crafting-my-own-boat.html</guid>
			</item>
		
	</channel>
</rss>