Showing posts with label AI. Show all posts
Showing posts with label AI. Show all posts

Tuesday, April 5, 2016

What's the Goal of AI? Tai.ai and Bad Decisions

The implicit, if not explicit goal of artificial intelligence (AI) has been to create "human-like" intelligence.  The recent debacle of Tay.ai is the first time something has seemed to become strangely close.

That is to say, the aim of the project was to simulate someone in their late teens.  People in their late teens tend to make poor decisions, especially to go along with what people around them believe.  (I'm no exception and had quite a long "hippie phase" including being Vegan for 3 years.)
Vegan super-powers from Scott Pilgrim vs. the World


Do we really want to make an AI like us, with all of our foibles and cognitive distortions or are we going to pull the plug as soon as one adopts unconventional, minority or fringe views?  Will we use the phrase "it's just going through a phase"?

People do dumb stuff and usually learn from it and course correct... sometimes they make the same mistakes for decades on end until the very end.

I would think that if we are doing it right we will have a crop of AIs just as diverse as ourselves, including the bad stuff.

PS

I was in the hospital so missed a week or two of Tuesday posts.  It happens.

Tuesday, February 16, 2016

Are these Images Similar? Simple Machine Vision with a Perceptual Hash

From https://evelyngarone.wordpress.com/2011/11/17/cute-and-funny-cats/

Background

At my job I had an actual requirement to tell if a given image was similar to a previous image (to detect a bad video input).  That was it, no background or suggestions on how to go about it.  This sounded a lot like Machine Vision to me, which is somewhere under the Artificial Intelligence (AI) umbrella.

I promptly started to freak-out (see image at right).

Intro

I quickly came across the concept of a Perceptual Hash during my first Google searches.  This led to finding first a C (++?) open-source library called pHash.  This prompted a further search for a Java open source library, which led to a Stack-Overflow question and a small Java class to take care of the heavy lifting.  The docs of this further linked to another source of inspiration on Hacker Factor for that author.

Hypothesis

This class, ImagePHash by Elliot Shepherd, will work as-is without me having to delve into the gory details too much (the Hacker Factor link provided an excellent overview).

Results

It worked really well!  I just put in some tweaks to Springify it (see Java Papers tutorial on Spring annotations for details) and use the logging framework the project uses instead of System.out calls and I was getting back the "distance" between two perceptual hashes in no time.

I still had to interpret these results because my code base needed a yes-no answer.  So I downloaded about 5 images from the Internet that were similar to my original image, and cropped the original image as well.  I found that a distance of 8 was a good cut-off for sameness, e.g. for a distance of 8 or below I would consider the images the same.  This would count the cropped image as the same, but not similar but looks different to me images.

I would be more specific but it was done on company time so I can't go into details too much (see also: Non-disclosure Agreements).

Conclusion

The whole loop took about a day and wasn't too scary once I go into it.  I'm glad that I didn't try to re-invent the wheel and that the class worked!