The Imaginative Universal

Studies in Virtual Phenomenology -- @jamesashley

I Can Haz the Unconscious?

May 07
by James Ashley 7. May 2013 14:07

pet therapy

The scientific method is one of the great wonders of deliberative thought.  It isn’t just our miraculous modern world that is built upon it, but also our confidence in rationality in general.  It is for this reason that we are offended on a visceral level at all sorts of climate change deniers, creationists, birthers, conspiracy theorists and the constant string of yahoos that seem to pop up using the trappings of rationality to deny the results of the scientific method and basic common sense.

It is so much worse, however, when the challenge to the scientific method comes from within.  Dr. Yoshitaka Fujii has been unmasked as perhaps one of the greatest purveyors of made up data in scientific experimentation, and while the peer review process seems to have finally caught him out, he still had a nearly 20 year run and some 200 journal articles credited to him.  Diederik Stapel is another prominent scientific fraudster whose activities put run-of-the-mill journalistic fraudsters like Jayson Blair to shame.  Need we even bring up the demotion of Pluto or the unrecognized difficulty of predicting Italian earthquakes (seven members of the National Commission for the Forecast and Prevention of Major Risks in Italy were convicted of manslaughter for not forecasting and preventing a major seismological event)?

It’s the sort of thing that gives critics ammo when they want to discredit scientific findings like Jerry Mahlman’s hockey stick graph in climatology.  And the great tragedy isn’t that we reach a stage where we no longer believe in the scientific method, but that we now believe in any scientific method.  Everyone can choose their own scientific facts to believe in and a general opinion that incompatible scientific positions do not need to be resolved with experimentation but rather through politics prevails.

Unconscious Thought Theory is now the object of similar reconsiderations.  A Malcolm Gladwell pet theory based on the experiments of Ap Dijksterhuis, Unconscious Thought Theory posits that we simply perform certain cognitive activities better when we are not actively cognizing.  As a software programmer, I am familiar with this phenomenon in terms of “sleep coding”.  If I am working all day on a difficult problem, I will sometimes have dreams about coding in my sleep and wake up the next morning with a solution.  When I arrive back at my work, it will effectively take me a few minutes to finish typing a routine into my IDE that I’ve been working for a day or several days trying to crack. 

I am a firm believer in this phenomenon and, as they say in late night infomercials, “it really works!”  I even build a certain amount of sleep coding into my programming estimates these days.  A project may take three days of conscious effort, one night of sleep, and then an additional five minutes to code up.  Sometimes the best thing to do when a problem seems insurmountable is simply to fire up the Internets, watch some cat videos and lolcatz the unconscious.

Imagine also how salvific the notion of a powerful unconscious is following the recent series of financial crisis.  At the first level, the interpretation of financial debacles blames excessive greed for our current problems (second great depression and all that jazz).  But that’s so 1980’s Gordon Gecko.  A deeper interpretation holds that the problem comes down to falsely assuming that in economic matters we are rational actors – an observation that has given birth (or at least a second wind) to the field of behavioral economics. 

I can haz Asimo

Lots of cool counter-factual papers and books about how remarkably irrational the consumer is has come out of this movement.  The coolest has got to be not only that we are much more irrational than we think, but that our irrational unconscious selves are much more capable than our conscious selves are.  It’s a bit like the end of of Isaac Asimov’s I, Robot (spoilers ahead) where after working out all the issues with Robots someone discovers that things are just going too smoothly in the world and comes to the realization that humans are not smart enough to end wars and cure diseases like this.  After some investigation, the intrepid hero discovers that our benign computer systems have taken over the running of the world and haven’t told us because they don’t want to freak us out about it.  They want us to go on thinking that we are still in charge and to feel good about ourselves.  It’s a dis-distopian ending of sorts.

As I mentioned, however, Unconscious Thought Theory is undergoing some discreditation.  One of the rules of the scientific method is that with experiments, they gots to be reproducible, and Dijksterhuis’s do not appear to be.  Multiple experiments have not been able to replicate Dijksterhuis’s “priming effect” experiments which used social priming techniques (for instance, having something think about a professor or a football hooligan before an exam) and then evaluating the exam scores correlated with the type of priming that happened.  There’s a related social priming experiment by someone else, also not reproducible, that seemed to show that exposing people to notions about aging and old people would make them walk slower.  The failure to replicate and verify the findings of Dijksterhuis’s social priming experiments lead one inevitably to conclude that Dijksterhuis’s other experiments promoting Unconscious Thought Theory are likewise questionable.

a big friggin' eye full of clouds

On the other had, that’s exactly what a benevolent, intelligent, all-powerful, collective supra-unconscious would want us to think.  Consider that if Dijksterhuis is correct about the unconscious being, in many circumstances, basically smarter at complex thinking activities than our conscious minds are, then the last thing this unconscious would want is for us to suddenly start being conscious of it.  It works behind the scenes, after all. 

When we find the world too difficult to understand, we are expected to give up and miraculously, after a good’s night sleep, the unconscious provides us with solutions.  How many scientific eureka moments throughout history have come about this way?  How many of our greatest technological discoveries are driven by humanity’s collective unconscious working carefully and tirelessly behind the scenes while we sleep?  Who, after all, made all those cat videos to distract us from psychological experiments on the power of the unconscious while the busy work of running the world was being handled by others?  Who created YouTube to host all of those videos?  Who invented the Internet – and why? 

Tags:

Extreme Programming | Methodology

Helpful vs Creepy Face Recognition

February 13
by James Ashley 13. February 2013 14:03

mr_mall

One of the interesting potential commercial uses for the Kinect for Windows sensor is as a realtime tool for collecting information about people passing by.  The face detection capabilities of the Kinect for Windows SDK lends itself to these scenarios.  Just as Google and Facebook currently collect information about your browsing habits, Kinects can be set up in stores and malls to observe you and determine your shopping habits.

There’s just one problem with this.  On the face of it, it’s creepy.

To help parse what is happening in these scenarios, there is a sophisticated marketing vocabulary intended to distinguish “creepy” face detection from the useful and helpful kind.

First of all, face detection on its own does little more than detect that there is a face in front of the camera.  The face detection algorithm may go even further and break down parts of the face into a coordinate system.  Even this, however, does not turn a particular face into an token that can be indexed and compared against other faces. 

Turning an impression of a face into some sort of hash takes us to the next level and becomes face recognition rather than merely detection.  But even here there is parsing to be done.  Anonymous face recognition seeks to determine generic information about a face rather than specific, identifying information.  Anonymous face recognition provides data about a person’s age and gender – information that is terribly useful to retail chains. 

Consider that today, the main way retailers collect this information is by placing a URL at the bottom of a customer’s receipt and asking them to visit the site and provide this sort of information when the customer returns home.  The fulfillment rate on this strategy is obviously horrible.

Being able to collect these information unobtrusively would allow retailers to better understand how inventory should be shifted around seasonally and regionally to provide customers with the sorts of retail items they are interested in.  Power drills or perfume?  The Kinect can help with these stocking questions.

But have we gotten beyond the creepy factor with anonymous face recognition?  It actually depends on where you are.  In Asia, there is a high tolerance for this sort of surveillance.  In Europe, it would clearly be seen as creepy.  North America, on the other hand, is somewhere between Europe and Asia on privacy issues.  Anonymous face recognition is non-creepy if customers are provided with a clear benefit from it – just as they don’t mind having ads delivered to their browsers as long as they know that getting ads makes other services free.

Finally, identity face recognition in retail would allow custom experiences like the virtual ad delivery system portrayed in the mall scene from The Minority Report.  Currently, this is still considered very creepy.

At work, I’ve had the opportunity to work with NEC, IBM and other vendors on the second kind of face recognition.  The surprising thing is that getting anonymous face recognition working correctly is much harder than getting full face recognition working.  It requires a lot of probabilistic logic as well as a huge database of faces to get any sort of accuracy when it comes to demographics.  Even gender is surprisingly difficult.

Identity face recognition, on the other hand, while challenging, is something you can have in your living room if you have an XBox and a Kinect hooked up to it.  This sort of face recognition is used to log players automatically into their consoles and can even distinguish different members of the same family (for engineers developing facial recognition software, it is an irritating quirk of fate that people who look alike also tend to live in the same house).

If you would like to try identity face recognition out, you can try out the Luxand Face SDK.  Luxand provides a 30-day trial license which I tried out a few months ago.  The code samples are fairly good.  While Luxand does not natively support Kinect development, it is fairly straightforward to turn data in the Kinect’s rgb stream into images which can then be compared against other images using Luxand.

I used Luxand’s SDK to compare anyone standing in front of the Kinect sensor with a series of photos I had saved.  It worked fairly well, but unfortunately only if one stood directly in front of the sensor and about a foot or two in front of it (which wasn’t quite what we needed at the time).  The heart of the code is provided below.  It simply takes color images from Kinect and compares it against a directory of photos to see if a match can be found.  It could be used as part of a system for unlocking a computer when the proper user stands in front of it (though you can probably think of better uses – just try to avoid being creepy).

void _sensor_ColorFrameReady(object sender
    , ColorImageFrameReadyEventArgs e)
{
    using (var frame = e.OpenColorImageFrame())
    {
        var image = frame.ToBitmap();
        this.image2.Source = image.ToBitmapSource();
        LookForMatch(image);
    }
 
}
 
private bool LookForMatch(System.Drawing.Bitmap currentImage)
{
 
        if (currentImage == null)
            return false;
        IntPtr hBitmap = currentImage.GetHbitmap();
        try
        {
        FSDK.CImage image = new FSDK.CImage(hBitmap);
        FSDK.SetFaceDetectionParameters(false, false, 100);
        FSDK.SetFaceDetectionThreshold(3);
        FSDK.TFacePosition facePosition = image.DetectFace();
        if (facePosition.w != 0)
        {
 
            FaceTemplate template = new FaceTemplate();
            template.templateData = 
                ExtractFaceTemplateDataFromImage(image);
            bool match = false;
            FaceTemplate t1 = new FaceTemplate();
            FaceTemplate t2 = new FaceTemplate();
            float best_match = 0.0f;
            float similarity = 0.0f;
            foreach (FaceTemplate t in faceTemplates)
            {
 
                t1 = t;
                FSDK.MatchFaces(ref template.templateData
                    , ref t1.templateData, ref similarity);
                float threshold = 0.0f;
                FSDK.GetMatchingThresholdAtFAR(0.01f
                    , ref threshold);
 
                if (similarity > best_match)
                {
                    this.textBlock1.Text = similarity.ToString();
                    best_match = similarity;
                    t2 = t1;
                    if (similarity > _targetSimilarity)
                        match = true;
                }
            }
            if (match && !_isPlaying)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        else
            return false;
    }
    finally
    {
        DeleteObject(hBitmap);
        currentImage.Dispose();
    }
}
 
private byte[] ExtractFaceTemplateDataFromImage(FSDK.CImage cimg)
{
    byte[] ret = null;
    Luxand.FSDK.TPoint[] facialFeatures;
    var facePosition = cimg.DetectFace();
    if (0 == facePosition.w)
    {
    }
    else
    {
        bool eyesDetected = false;
        try
        {
            facialFeatures = 
                cimg.DetectEyesInRegion(ref facePosition);
            eyesDetected = true;
        }
        catch (Exception ex)
        {
            return cimg.GetFaceTemplateInRegion(ref facePosition);
        }
 
        if (eyesDetected)
        {
            ret = 
                cimg.GetFaceTemplateUsingEyes(ref facialFeatures);
        }
        else
        {
            ret = cimg.GetFaceTemplateInRegion(ref facePosition);
        }
    }
    return ret;
    cimg.Dispose();
}
 

Tags:

Kinect

One Thumb Drive To Rule Them All

January 23
by James Ashley 23. January 2013 14:44

thumbdrive

I currently have an HTC 8X windows phone on my desk which I think is one of the best smartphones on the market.  I also have a Surface tablet.   I have a fascinating little device called a Leap Motion sitting on my desk that detects finger gestures.  I also have three Kinect for Windows sensors arrayed around my desk in order to capture images from multiple directions, bullet time style.

The thing that is most precious to me, however, is the 16 Gig Lexar jump drive someone bought for my dev/design group.  It is the fastest USB flash drive currently available.  When I described it to my wife, she said she didn’t realize that thumb drives came in different speeds.  After thinking it over, I realized that before using the Lexar, I hadn’t realized it either.

Or to be more accurate, I realized vaguely in my lizard brain that some thumb drives are slower than others, but I had no idea that some were faster than others.

And above all the fast thumb drives, there’s the Lexar, which feels like it is instantaneous.  For example, a colleague recently needed a copy of Visual Studio 2012 while we were in Manhattan for a retail show.  I put the 1.5 Gig ISO on my Lexar jump drive and he brought his laptop to my hotel room to copy the file over.  He thought he could get the copying started, we’d go to dinner, and hopefully it would be done by the time dinner was over.  But practically before he’d even touched the Lexar to his USB port … ziiiiiiiiiiiiiiiiiip … it was over.  The ISO file was on his harddrive.

I have to admit that I now have a problem even letting someone else use the 16 Gig Lexar – even though it is communal property – because I’m not sure I’ll get it back.  People in our group are constantly asking for the plastic container where we keep our various jump drives … but of course we all know what they are really looking for is one of the two 16 Gig Lexars we own.  Honestly, it’s starting to be a problem, and I’m tempted to just throw these thumb drives into a volcano somewhere.  It causes nothing but friction and jealously on the team.

But at the same time, it is so beautiful and precious to me.  My colleague from New York was instantly won over and talked about the thumb drive for a half hour through dinner.  If you have a tech person you want to buy a nice present for – or if you are someone who needs a little self-care – treat yourself to something special.  They’re a little pricey, and even better than you can possibly imagine.

Tags:

Leisure | Technical Zeitgeist