<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Is it Intelligent yet?</title>
	<atom:link href="http://bouguerra.org/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://bouguerra.org</link>
	<description>Artificial Intelligence recipe with a dash of Computer Vision, 2 spoons of Actionscript, few drops of Web development and a cup of Software Engineering</description>
	<lastBuildDate>Tue, 27 Jul 2010 19:46:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Detecting Face features</title>
		<link>http://bouguerra.org/?p=137</link>
		<comments>http://bouguerra.org/?p=137#comments</comments>
		<pubDate>Sat, 24 Jul 2010 18:03:30 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Computer Vision]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[AAM]]></category>
		<category><![CDATA[ASM]]></category>
		<category><![CDATA[Face Detection]]></category>
		<category><![CDATA[OpenCv]]></category>

		<guid isPermaLink="false">http://bouguerra.org/?p=137</guid>
		<description><![CDATA[<div id="_prewig_4c8320b03c4f3">Cincopa <a href="http://www.cincopa.com/wpplugin/wordpress-plugin.aspx">video hosting</a> solution for your website. Another great product from Cincopa <a href="http://www.cincopa.com/mediasend/start.aspx">Send Files</a>.</div><script type="text/javascript">document.getElementById("_prewig_4c8320b03c4f3").innerHTML="";</script>

I&#8217;ve been a lot of research lately about the best way to detect and track face features such as noise, eye, noise, etc.. My initial thought was to use the]]></description>
			<content:encoded><![CDATA[<div id="_prewig_4c8320b049fb3">Cincopa <a href="http://www.cincopa.com/wpplugin/wordpress-plugin.aspx">video hosting</a> solution for your website. Another great product from Cincopa <a href="http://www.cincopa.com/mediasend/start.aspx">Send Files</a>.</div><script type="text/javascript">document.getElementById("_prewig_4c8320b049fb3").innerHTML="";</script>
<p><img class="aligncenter" title="Tim" src="http://personalpages.manchester.ac.uk/staff/timothy.f.cootes/Models/faceasm2.gif" alt="" width="171" height="210" /></p>
<p>I&#8217;ve been a lot of research lately about the best way to detect and track face features such as noise, eye, noise, etc.. My initial thought was to use the same technique ubiquitously used for face detection, <a href="http://en.wikipedia.org/wiki/Viola-Jones_object_detection_framework" target="_blank">Viola-Jones object detection framework</a>. The latter works great for face detection and can easily be tested in the examples provided in <a href="http://opencv.willowgarage.com/wiki/" target="_blank">Opencv</a>. Although, Opencv provides haarcascade_eye.xml for eye detection and another one for the mouth, the results were pretty disappointing even in trying to find the bounding box and not the contour of those features, which what we ultimately trying to achieve.</p>
<p>After few hours of searching and digging online, I came across a very promising technique called Active Appearance Model, created by <a href="http://personalpages.manchester.ac.uk/staff/timothy.f.cootes/">Timothy Cootes</a> from Manchester University.</p>
<p>He describes his technique with the following:</p>
<p><span style="color: #888888;">&#8220;The Active Appearance Model (AAM) is a generalisation of the widely used Active Shape Model approach, but uses all the information in the image region covered by the target object, rather than just that near modelled edges.An AAM contains a statistical model of the shape and grey-level appearance of the object of interest which can generalise to almost any valid example. Matching to an image involves finding model parameters which minimise the difference between the image and a synthesised model example, projected into the image. The potentially large number of parameters makes this a difficult problem.<br />
We observe that displacing each model parameter from the correct value induces a particular pattern in the residuals. In a training phase, the AAM learns a linear model of the relationship between parameter displacements and the induced residuals. During search it measures the residuals and uses this model to correct the current parameters, leading to a better fit. A good overall match is obtained in a few iterations, even from poor starting estimates.&#8221;</span></p>
<p><span style="color: #888888;"><span style="color: #000000;">Tim was kind enough to provide tools and toys that we can play with to understand the AAM. These toys can be found <a href="http://personalpages.manchester.ac.uk/staff/timothy.f.cootes/software/am_tools_doc/index.html" target="_blank">here</a>. You might notice that there is no source code provided. If you are looking for source code for AAM, you would definitely want to check out <a href="http://www2.imm.dtu.dk/~mbs/" target="_top">Mikkel B. Stegmann</a>&#8217;s site fully dedicated to AAM with an open source library. The site can be found <a href="http://www2.imm.dtu.dk/~aam/" target="_blank">here</a>.</span></span></p>
<p><span style="color: #888888;"><span style="color: #000000;">I also found a great project using ASM <a href="http://code.google.com/p/asmlibrary/" target="_blank">here</a> and another one that uses AAM <a href="http://code.google.com/p/aam-opencv/">here</a>. And a great opensource one <a href="http://www.milbo.users.sonic.net/stasm/download.html" target="_self">here</a></span></span></p>
<p><span style="color: #888888;"><span style="color: #000000;"><br />
</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://bouguerra.org/?feed=rss2&amp;p=137</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yahoo!&#8217;s Browser Plus</title>
		<link>http://bouguerra.org/?p=134</link>
		<comments>http://bouguerra.org/?p=134#comments</comments>
		<pubDate>Thu, 01 Jul 2010 11:51:32 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://bouguerra.org/?p=134</guid>
		<description><![CDATA[<div id="_prewig_4c8320b055853">Cincopa <a href="http://www.cincopa.com/wpplugin/wordpress-plugin.aspx">video hosting</a> solution for your website. Another great product from Cincopa <a href="http://www.cincopa.com/mediasend/start.aspx">Send Files</a>.</div><script type="text/javascript">document.getElementById("_prewig_4c8320b055853").innerHTML="";</script>
If you are a frontend Ninja and thinking that the browser is limiting what you can build then you&#8217;re in for a treat. Yahoo!&#8217;s BrowserPlus team came in for a]]></description>
			<content:encoded><![CDATA[<div id="_prewig_4c8320b05e0ab">Cincopa <a href="http://www.cincopa.com/wpplugin/wordpress-plugin.aspx">video hosting</a> solution for your website. Another great product from Cincopa <a href="http://www.cincopa.com/mediasend/start.aspx">Send Files</a>.</div><script type="text/javascript">document.getElementById("_prewig_4c8320b05e0ab").innerHTML="";</script>
<p>If you are a frontend Ninja and thinking that the browser is limiting what you can build then you&#8217;re in for a treat. <a href="http://browserplus.org/" target="_blank">Yahoo!&#8217;s BrowserPlus</a> team came in for a rescue and gave the world an open source project that extends the browser&#8217;s functionality to embed your c++ libraries in it and interact with it using JS or even Actionscript using External Interface or just TCP/IP sockets.</p>
<p>This is how the BrowserPlus guys describe their product:</p>
<p><span style="color: #888888;">&#8220;BrowserPlus is a &#8220;Browser Plugin Abstraction&#8221; that allows you to write and deploy functionality to end user devices that augments what is possible from browser-based javascript.</span></p>
<p><span style="color: #888888;">BrowserPlus provides mechanisms to deploy and update these new plugins (we call them &#8220;services&#8221;), and makes it much simpler to produce services with wide end-user platform support.  Our goal is to breathe new life into web plugins of today, and make a whole lot more possible on the web.</span></p>
<div><span style="color: #888888;">BrowserPlus is a &#8220;Browser Plugin Abstraction&#8221; that allows you to writeand deploy functionality to end user devices that augments what is possible from browser-based javascript.</span></div>
<p><span style="color: #888888;">BrowserPlus provides mechanisms to deploy and update these new plugins(we call them &#8220;services&#8221;), and makes it much simpler to produce serviceswith wide end-user platform support.<br />
Our goal is to breathe new life into web plugins of today, and make a whole lot more possible on the web.&#8221;</span></p>
<p>I will be posting about the little project I am building using BrowserPlus.</p>
]]></content:encoded>
			<wfw:commentRss>http://bouguerra.org/?feed=rss2&amp;p=134</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A stunning moon</title>
		<link>http://bouguerra.org/?p=124</link>
		<comments>http://bouguerra.org/?p=124#comments</comments>
		<pubDate>Fri, 18 Jun 2010 06:10:50 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Garbeville]]></category>
		<category><![CDATA[Memorial Day weekend]]></category>
		<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://bouguerra.org/?p=124</guid>
		<description><![CDATA[<div id="_prewig_4c8320b068427">Cincopa <a href="http://www.cincopa.com/wpplugin/wordpress-plugin.aspx">video hosting</a> solution for your website. Another great product from Cincopa <a href="http://www.cincopa.com/mediasend/start.aspx">Send Files</a>.</div><script type="text/javascript">document.getElementById("_prewig_4c8320b068427").innerHTML="";</script>
Right when we parked at our friend&#8217;s cabin up on Garberville California for a memorable Memorial Day weekend, the first things we spotted besides the neighbor&#8217;s crazy dog who kept]]></description>
			<content:encoded><![CDATA[<div id="_prewig_4c8320b06d23d">Cincopa <a href="http://www.cincopa.com/wpplugin/wordpress-plugin.aspx">video hosting</a> solution for your website. Another great product from Cincopa <a href="http://www.cincopa.com/mediasend/start.aspx">Send Files</a>.</div><script type="text/javascript">document.getElementById("_prewig_4c8320b06d23d").innerHTML="";</script>
<p>Right when we parked at our friend&#8217;s cabin up on Garberville California for a memorable Memorial Day weekend, the first things we spotted besides the neighbor&#8217;s crazy dog who kept on following us for the rest of the weekend was the moon. so I grabbed my cam and snapshotted it. And this is how it looked like:</p>
<p><a rel="attachment wp-att-125" href="http://bouguerra.org/wp-content/uploads/2010/06/sky.jpg"><img class="aligncenter size-medium wp-image-125" title="sky" src="http://bouguerra.org/wp-content/uploads/2010/06/sky-300x199.jpg" alt="" width="300" height="199" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://bouguerra.org/?feed=rss2&amp;p=124</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cross platform my Arch</title>
		<link>http://bouguerra.org/?p=121</link>
		<comments>http://bouguerra.org/?p=121#comments</comments>
		<pubDate>Fri, 18 Jun 2010 05:55:52 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://bouguerra.org/?p=121</guid>
		<description><![CDATA[<div id="_prewig_4c8320b0788b3">Cincopa <a href="http://www.cincopa.com/wpplugin/wordpress-plugin.aspx">video hosting</a> solution for your website. Another great product from Cincopa <a href="http://www.cincopa.com/mediasend/start.aspx">Send Files</a>.</div><script type="text/javascript">document.getElementById("_prewig_4c8320b0788b3").innerHTML="";</script>
After years of cracking serious actionscript and building dope Flash apps and Microsites without the fear of things breaking randomly when ran on old browsers that also happened to be]]></description>
			<content:encoded><![CDATA[<div id="_prewig_4c8320b081a52">Cincopa <a href="http://www.cincopa.com/wpplugin/wordpress-plugin.aspx">video hosting</a> solution for your website. Another great product from Cincopa <a href="http://www.cincopa.com/mediasend/start.aspx">Send Files</a>.</div><script type="text/javascript">document.getElementById("_prewig_4c8320b081a52").innerHTML="";</script>
<p>After years of cracking serious actionscript and building dope Flash apps and Microsites without the fear of things breaking randomly when ran on old browsers that also happened to be our users&#8217; favorite according to some statistics&#8230; I decided to take on new challenges and Ajax it a little, which I did and I am very grateful for the opportunity. The product I built is not out for public yet so I can&#8217;t really discuss it but I will post info about once we get the green light from our PM and PR.</p>
<p>Now, I decided that it would be nice to get a little deeper and do some low level stuff. Why the hell not? How about some graphics and videos in C++. Sounds great doesn&#8217;t it? But what if I want to build my stuff on Ubuntu and my teammates are working on Macs and PCs?</p>
<p>So I decided to take the bull by the horns, follow the rules for cross platform development and things should just work. Not quite the case&#8230; I used Eclipse since it is a cross platform dev. tool and boost library since it is also a cross platform framework to build a simple echo server that spits out video frames to a TCP/IP socket. The project worked great on my ubuntu box and things were pretty happy on my desk until I decided to take that code and run it in my Windows machine using Eclipse CDT, MinGW and Gnu Make ( since they all claim to be cross platform and so I can be consistent ). And before I knew it, I spent a good 10 hours sitting on my chair wrestling with integrating boost with my tool chain. I am not sure if it is just hard by nature to do things like this or I am just too stupid for the task&#8230; 14 hours later, I gave up and went ahead, took everyone&#8217;s advice and installed Visual Studio 2008 and my server was up and running in minutes.</p>
<p style="text-align: center;">
<img class="aligncenter" title="cross platform" src="http://learn.alcacoop.it/2009/seminario-openweb/images/cross-platform.jpg" alt="Cross Platform my Arch" width="363" height="340" /></p>
<p>I have to say that although I have it running on VS 08, I am still uneasy about it and I am gonna have to go back to it another day when I am less frustrated and try again. Hopefully I will get to blog on the steps I took to get it set up.</p>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://bouguerra.org/?feed=rss2&amp;p=121</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My first encounter with WebM</title>
		<link>http://bouguerra.org/?p=119</link>
		<comments>http://bouguerra.org/?p=119#comments</comments>
		<pubDate>Sun, 23 May 2010 01:39:08 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://bouguerra.org/?p=119</guid>
		<description><![CDATA[<div id="_prewig_4c8320b0917e7">Cincopa <a href="http://www.cincopa.com/wpplugin/wordpress-plugin.aspx">video hosting</a> solution for your website. Another great product from Cincopa <a href="http://www.cincopa.com/mediasend/start.aspx">Send Files</a>.</div><script type="text/javascript">document.getElementById("_prewig_4c8320b0917e7").innerHTML="";</script>
Last week, everyone at work was talking about WebM and it&#8217;s direct and indirect impact on our video conferencing product. 
What&#8217;s interesting is that I am not sure if Google]]></description>
			<content:encoded><![CDATA[<div id="_prewig_4c8320b09c8c2">Cincopa <a href="http://www.cincopa.com/wpplugin/wordpress-plugin.aspx">video hosting</a> solution for your website. Another great product from Cincopa <a href="http://www.cincopa.com/mediasend/start.aspx">Send Files</a>.</div><script type="text/javascript">document.getElementById("_prewig_4c8320b09c8c2").innerHTML="";</script>
<p>Last week, everyone at work was talking about WebM and it&#8217;s direct and indirect impact on our <a href="http://messenger.yahoo.com/features/webcam/" target="_blank">video conferencing product. </a></p>
<p>What&#8217;s interesting is that I am not sure if Google intensionally announced open sourcing VP8 in a skeptic environment with a lot of open questions, especially legal ones, about H264 patent infringements when using VP8 in commercial products to get free advertisement or it happened this way.</p>
<p>I just read today that Steve Jobs is already talking trash about VP8 claiming that it is <a href="http://www.eweek.com/c/a/Application-Development/Apple-CEO-Jobs-Lacks-Faith-in-VP8-Says-Report/" target="_blank">buggy and not as good as H264</a>. Typical!</p>
<p>Despite the discouraging advice from Jobs, I decided to take on the adventure of trying VP8 on my own and see if I like it or not. I will be using this blog post to log all the steps I took to get me up and running with VP8 SDK on my Ubuntu 10.04</p>
<p><span style="color: #008080;">Installed Git</span>: sudo apt-get -y install git-core gitosis</p>
<p>configured the git account using : git config &#8211;global user.email &#8220;my_email_address@email_server.com&#8221;</p>
<p><span style="color: #008080;">Grabbed the Source Code from Github</span>: git clone  git://review.webmproject.org/libvpx.git</p>
<p>went inside the source folder and ran <strong>./configure</strong> then<strong> make</strong></p>
<p>Once you see ivfenc, you are good to go. You can run the commands listed in http://www.webmproject.org/tools/encoder-parameters/ on any video file source.</p>
<p>I think building and running WebM is an extreme easy task and it took me less than 30 minutes to get the examples running! I will write a post later about my comments on the performance of VP8.</p>
]]></content:encoded>
			<wfw:commentRss>http://bouguerra.org/?feed=rss2&amp;p=119</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up my Ubuntu machine</title>
		<link>http://bouguerra.org/?p=97</link>
		<comments>http://bouguerra.org/?p=97#comments</comments>
		<pubDate>Sat, 22 May 2010 19:28:52 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Computer Vision]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://bouguerra.org/?p=97</guid>
		<description><![CDATA[<div id="_prewig_4c8320b0b27e4">Cincopa <a href="http://www.cincopa.com/wpplugin/wordpress-plugin.aspx">video hosting</a> solution for your website. Another great product from Cincopa <a href="http://www.cincopa.com/mediasend/start.aspx">Send Files</a>.</div><script type="text/javascript">document.getElementById("_prewig_4c8320b0b27e4").innerHTML="";</script>

Last year I decided to give Ubuntu ( the new cool kid ) a try and use it as my development platform. Bad idea! Ubuntu 9.10 was a Vista like]]></description>
			<content:encoded><![CDATA[<div id="_prewig_4c8320b0c11f4">Cincopa <a href="http://www.cincopa.com/wpplugin/wordpress-plugin.aspx">video hosting</a> solution for your website. Another great product from Cincopa <a href="http://www.cincopa.com/mediasend/start.aspx">Send Files</a>.</div><script type="text/javascript">document.getElementById("_prewig_4c8320b0c11f4").innerHTML="";</script>
<p><a rel="attachment wp-att-102" href="http://bouguerra.org/wp-content/uploads/2010/05/ubuntu-logo.png"><img class="aligncenter size-full wp-image-102" title="ubuntu-logo" src="http://bouguerra.org/wp-content/uploads/2010/05/ubuntu-logo.png" alt="" width="406" height="336" /></a></p>
<p>Last year I decided to give Ubuntu ( the new cool kid ) a try and use it as my development platform. Bad idea! Ubuntu 9.10 was a Vista like experience to me. I had a hard time with the booting system GRUB that kept on failing every time I do a system update or my laptop runs out of power. It was very frustrating to say the least.</p>
<p>Today, I am going to give ubuntu 10.04 a try hoping for a better luck this time around. My main development will be computer vision/machine learning related stuff so OpenCV is the first thing I want to install and I will use this blog post to log all the steps taken to have OpenCV up and running in my Ubuntu 10.04</p>
<p><span style="color: #008000;">install svn</span>: sudo apt-get install subversion</p>
<p><span style="color: #008000;">OpenCV</span></p>
<p>Searching for OpenCV in Synaptic returned the list of OpenCV 2.0  libraries needed to run it. So I installed them.</p>
<p>It looks like the .h files were installed in<span style="color: #000080;"> /usr/include/opencv <span style="color: #000000;">and the Haar Cascade xml files are located in </span></span><span style="color: #000080;">/usr/share/opencv/haarcascades/</span></p>
<p><span style="color: #008000;">cmake</span>:</p>
<p>sudo apt-get install cmake<br />
Download CMake module for OpenCV:<br />
<a href="http://opencv.willowgarage.com/wiki/Getting_started?action=AttachFile&amp;do=view&amp;target=FindOpenCV.cmake" target="_blank">http://opencv.willowgarage.com/wiki/Getting_started?action=AttachFile&amp;do=view&amp;target=FindOpenCV.cmake</a><br />
Save it to:  /usr/share/cmake/Modules</p>
<p>install the ccmake by running: sudo apt-get install cmake-curses-gui</p>
<p><span style="color: #000080;"><span style="color: #008000;">Eclipse</span><br />
</span></p>
<p><span style="color: #000080;"><span style="color: #000000;">Ec</span><span style="color: #000000;">lipse can easily be installed using the Ubuntu Software Center. Right now, the shipped </span></span>version is 3.5.2</p>
<ul>
<li><span style="color: #000080;">SVN plugin: </span>http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA ( If you get an error about JavaHL, just install libsvn by running:<span style="color: #333399;"> sudo apt-get install libsvn-java</span> )</li>
</ul>
<ul>
<li><span style="color: #003366;">CDT plugin: </span>can be installed using help-&gt; Install New Software-&gt; Available sites and you can see C++ Development Toolkit listed.</li>
</ul>
<p>Et Voila! Now you can create OpenCV projects and compile them using cmake!</p>
<p>I should now write a post on how to build a similar environment in MAC and Windows.</p>
]]></content:encoded>
			<wfw:commentRss>http://bouguerra.org/?feed=rss2&amp;p=97</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logistic Regression to classify flying aircrafts [2]</title>
		<link>http://bouguerra.org/?p=73</link>
		<comments>http://bouguerra.org/?p=73#comments</comments>
		<pubDate>Fri, 25 Dec 2009 08:00:54 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Computer Vision]]></category>
		<category><![CDATA[Machine Learning]]></category>

		<guid isPermaLink="false">http://bouguerra.org/?p=73</guid>
		<description><![CDATA[<div id="_prewig_4c8320b0cbdd2">Cincopa <a href="http://www.cincopa.com/wpplugin/wordpress-plugin.aspx">video hosting</a> solution for your website. Another great product from Cincopa <a href="http://www.cincopa.com/mediasend/start.aspx">Send Files</a>.</div><script type="text/javascript">document.getElementById("_prewig_4c8320b0cbdd2").innerHTML="";</script>
C++ Training and Testing code
I created a Google Code project for this example and it can be found here.
The code should be simple and self explanatory. It uses batch Logistic Regression by]]></description>
			<content:encoded><![CDATA[<div id="_prewig_4c8320b0d3adb">Cincopa <a href="http://www.cincopa.com/wpplugin/wordpress-plugin.aspx">video hosting</a> solution for your website. Another great product from Cincopa <a href="http://www.cincopa.com/mediasend/start.aspx">Send Files</a>.</div><script type="text/javascript">document.getElementById("_prewig_4c8320b0d3adb").innerHTML="";</script>
<p>C++ Training and Testing code</p>
<p>I created a Google Code project for this example and it can be found <a href="http://code.google.com/p/logisiticregression/" target="_blank">here</a>.</p>
<p>The code should be simple and self explanatory. It uses batch Logistic Regression by default to train but if you pass 1 as an argument, then it will use stochastic instead.</p>
<p>High level explanation of the difference between Stochastic and Batch mode: If we use Batch mode, then the gradient descent will make slower and smaller steps hence they are in the right direction. It will also merge very close to the minima. Stochastic, on the other hand, will make faster steps toward the mimima but it might not get as close as Batch to the goal.</p>
<p>Here is an example of the TesterMain ran on one image of an aircraft in the sky:</p>
<div id="attachment_74" class="wp-caption alignleft" style="width: 160px"><a rel="attachment wp-att-74" href="http://bouguerra.org/wp-content/uploads/2009/12/capture_0_0031.jpg"><img class="size-thumbnail wp-image-74 " title="logistic regression input 1" src="http://bouguerra.org/wp-content/uploads/2009/12/capture_0_0031-150x150.jpg" alt="" width="150" height="150" /></a><p class="wp-caption-text">Input (click to enlarge)</p></div>
<div id="attachment_75" class="wp-caption alignleft" style="width: 160px"><a rel="attachment wp-att-75" href="http://bouguerra.org/wp-content/uploads/2009/12/logisitic-regression-result.png"><img class="size-thumbnail wp-image-75" title="logistic regression output 1" src="http://bouguerra.org/wp-content/uploads/2009/12/logisitic-regression-result-150x150.png" alt="" width="150" height="150" /></a><p class="wp-caption-text">Output (click to enlarge)</p></div>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>The testing part can be done in Actionscript and all it needs is the Thetas calculated from out training examples.</p>
<p>.</p>
]]></content:encoded>
			<wfw:commentRss>http://bouguerra.org/?feed=rss2&amp;p=73</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logistic Regression to classify flying aircrafts [1]</title>
		<link>http://bouguerra.org/?p=6</link>
		<comments>http://bouguerra.org/?p=6#comments</comments>
		<pubDate>Wed, 23 Dec 2009 07:01:47 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Computer Vision]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Machine Learning]]></category>

		<guid isPermaLink="false">http://bouguerra.org/?p=6</guid>
		<description><![CDATA[<div id="_prewig_4c8320b0e447e">Cincopa <a href="http://www.cincopa.com/wpplugin/wordpress-plugin.aspx">video hosting</a> solution for your website. Another great product from Cincopa <a href="http://www.cincopa.com/mediasend/start.aspx">Send Files</a>.</div><script type="text/javascript">document.getElementById("_prewig_4c8320b0e447e").innerHTML="";</script>
Logistic Regression to detect Airplane Pixels
Background:
Logistic Regression falls into the supervised learning algorithms category ( algorithms used to train a software for a specific task where the training data is labeled ).  The]]></description>
			<content:encoded><![CDATA[<div id="_prewig_4c8320b0f063b">Cincopa <a href="http://www.cincopa.com/wpplugin/wordpress-plugin.aspx">video hosting</a> solution for your website. Another great product from Cincopa <a href="http://www.cincopa.com/mediasend/start.aspx">Send Files</a>.</div><script type="text/javascript">document.getElementById("_prewig_4c8320b0f063b").innerHTML="";</script>
<p><a rel="attachment wp-att-34" href="http://bouguerra.org/wp-content/uploads/2009/12/g.gif"></a>Logistic Regression to detect Airplane Pixels</p>
<p><strong><span style="text-decoration: underline;">Background:</span></strong></p>
<p><a href="http://en.wikipedia.org/wiki/Logistic_regression" target="_blank">Logistic Regression</a> falls into the <a href="http://en.wikipedia.org/wiki/Supervised_learning" target="_blank">supervised learning algorithms</a> category ( algorithms used to train a software for a specific task where the training data is labeled ).  The great thing about Logistic Regression is that it is simple to implement and its simplicity makes it very easy to debug.</p>
<p>The logistic regression is based on the <a href="http://en.wikipedia.org/wiki/Sigmoid_function" target="_blank">sigmoid function</a>:</p>
<p><img title="g" src="http://bouguerra.org/wp-content/uploads/2009/12/g1.gif" alt="" width="81" height="61" /></p>
<p>This function has lots of nice features including:</p>
<p><img title="g'" src="http://bouguerra.org/wp-content/uploads/2009/12/g_.gif" alt="" width="144" height="21" /></p>
<p><a href="javascript:collapseExpand('9241')">The Math behind it &gt;&gt;</a><div id="9241" style="display:none;"> <br />
<img title="g'" src="http://bouguerra.org/wp-content/uploads/2009/12/g.gif" alt="" width="177" height="174" /></p>
<p> </div></p>
<p>You can learn more about Logistic Regression by clicking on the inline links. And now let&#8217;s talk about the problem we are trying to solve.</p>
<p style="text-align: justify;"><strong>Problem:</strong></p>
<p>Given an image or video of an airplane in the sky, how can we classify a pixel to be a sky or airplane one?</p>
<p><strong><span style="text-decoration: underline;">Solution:</span></strong></p>
<p>The idea is simple; We will be traverse all the image pixels and plug the R,G and B into some hypothesis equation h(x) ( that we need to figure out). If the result is close to zero then we classify that pixel as a sky pixel and an aircraft pixel otherwise. This description implies that our equation should have an output from 0 to 1 which is how the sigmoid function is designed.</p>
<p>Let&#8217;s refer to a specific pixel by x, then the hypothesis function h(x) can be defined as:<br />
<img title="cost2" src="http://bouguerra.org/wp-content/uploads/2009/12/cost2.gif" alt="" width="90" height="45" /></p>
<p>where</p>
<p><img title="theta_x" src="http://bouguerra.org/wp-content/uploads/2009/12/theta_x.gif" alt="" width="205" height="45" /></p>
<p>and g is the sigmoid function.</p>
<p><span style="color: #003366;">Our goal is then to train some data to find the best values of Thetas.</span></p>
<p><strong><span style="text-decoration: underline;">Implementation</span></strong></p>
<p><strong><em><span style="color: #800080;">Training Part:</span></em></strong></p>
<p>This could be done in Actionscript and have the code trace out the Thetas but it would take a very long time to complete the task. Much longer if we would do it in low level languages such as C++.</p>
<p>Since we are trying to do things the right way, let&#8217;s do the training part in C++ and the testing part in Flash.</p>
<p style="padding-left: 60px;"><strong><span style="color: #ff0000;">If you don&#8217;t feel like training data and get your hands dirty with C++, feel free to use my training result (the best possible Thetas) straight into your AS code.</span></strong></p>
<p>to be continued&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://bouguerra.org/?feed=rss2&amp;p=6</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ready, set, GO!</title>
		<link>http://bouguerra.org/?p=1</link>
		<comments>http://bouguerra.org/?p=1#comments</comments>
		<pubDate>Wed, 23 Dec 2009 01:48:27 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://bouguerra.org/?p=1</guid>
		<description><![CDATA[<div id="_prewig_4c8320b105fac">Cincopa <a href="http://www.cincopa.com/wpplugin/wordpress-plugin.aspx">video hosting</a> solution for your website. Another great product from Cincopa <a href="http://www.cincopa.com/mediasend/start.aspx">Send Files</a>.</div><script type="text/javascript">document.getElementById("_prewig_4c8320b105fac").innerHTML="";</script>
Abjuring my laziness and engaging in a love affair with my newly created blog.
]]></description>
			<content:encoded><![CDATA[<div id="_prewig_4c8320b10a068">Cincopa <a href="http://www.cincopa.com/wpplugin/wordpress-plugin.aspx">video hosting</a> solution for your website. Another great product from Cincopa <a href="http://www.cincopa.com/mediasend/start.aspx">Send Files</a>.</div><script type="text/javascript">document.getElementById("_prewig_4c8320b10a068").innerHTML="";</script>
<p>Abjuring my laziness and engaging in a love affair with my newly created blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://bouguerra.org/?feed=rss2&amp;p=1</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
