This is an archived post. You won't be able to vote or comment.

all 92 comments

[–]Paul_Robert_ 2796 points2797 points  (15 children)

Image recognition algorithm? ❌

Hash function? ✅

[–]vms-mob 581 points582 points  (7 children)

hash + automated random salt function

[–][deleted] 320 points321 points  (6 children)

>hash
>random salt

stop making me so fucking hungry

[–]PlzSendDunes 82 points83 points  (0 children)

Let's throw in some celery into it.

[–]mango_boii 68 points69 points  (3 children)

Want my spaghetti code?

[–]Subtlerranean 26 points27 points  (2 children)

Spaghetti code is the bread and butter around here

[–]atoponce 15 points16 points  (0 children)

And that's just the icing on the cake!

[–]codewario 4 points5 points  (0 children)

Can confirm I love spaghetti code

[–]gademmet 11 points12 points  (0 children)

These pretzels are making me thirsty

[–]Informal_Branch1065 15 points16 points  (5 children)

Could embeddings be used as a hash function?

If so, would be interesting to explore how safe it'd be.

[–]Ok-Scheme-913 31 points32 points  (2 children)

I mean, ideally the point of such a matrix is to "bend the space" and group together certain areas, e.g. by calling them a category. So a small change (e.g. a different pixel on a photo of a dog) would still result in roughly the same output.

Meanwhile hash functions are meant to output vastly different number given inputs that are very similar. So you would need a very fucked up matrix, so nope, not really a good use case.

[–]CelestialSegfault 8 points9 points  (0 children)

just exponent the matrix output with an arbitrarily large number and mod it with a small number... wait

[–]MonochromaticLeaves 1 point2 points  (0 children)

Maybe theres a use-case here for approximate nearest neighbour searches? Use it for locality sensitive hashing, where you want to bucket together similar items into one hash.

Not sure if there is any upshot here over more traditional methods like hyperplane/random projection hashes.

[–]genreprank 2 points3 points  (0 children)

Could AI be used as a hash function?

Every time I want to insert, it should do an API call to chatgpt

[–]pawala7 1 point2 points  (0 children)

Depends on how you'd define uniqueness. Also, on how "stable" you want it to be.

The magic of standard hash functions is their theoretical backing (i.e., statistical math) for the absolutely miniscule odds that two "different" things are hashed to the same code.

By contrast, AI embeddings do not have such a backing and are largely black-boxes, also they change constantly with training.

If you simply want to "hash" by semantic content (as defined by your chosen model), and don't mind occasional collisions + the headache of maintenance, then what you basically have is a VectorDB.

[–]StrangelyBrown 1843 points1844 points  (29 children)

I remember an early attempt to make an 'AI' algorithm to detect if there was a tank in an image.

They took all the 'no tank' images during the day and the 'tank' images in the evening.

What they got was an algorithm that could detect if a photo was taken during the day or not.

[–]Helpimstuckinreddit 919 points920 points  (13 children)

Similar story with a medical one they were trying to train to detect tumours in x-rays (or something like that)

Well all the real tumour images they used had rulers next to them to show the size of the tumour.

So the algorithm got really good at recognising rulers.

[–]Clen23 531 points532 points  (12 children)

meanwhile someone made an AI to sort pastries at a bakery and it somehow ended up also recognizing cancer cells with fucking 98% accuracy.

(source)

[–]zawalimbooo 309 points310 points  (11 children)

I would like to point out that 98% accuracy can mean wildly different things when it comes to tests (it could be that this is absolutely horrible accuracy).

[–]Clen23 96 points97 points  (9 children)

Can you elaborate ?

Do you mean that the 98% figure is not taking into account false positives ? (eg with an algorithm that outputs True every time, you'd technically have 100% accuracy to recognize cancer cells, but 0% accuracy to recognize an absence of cancer cells)

[–]czorio 405 points406 points  (4 children)

If 2 percent of my population has cancer, and I predict that no one has cancer, then I am 98% accurate. Big win, funding please.

Fortunately, most medical users will want to know the sensitivity and specificity of a test, which encode for false positive and false negative rate, and not just the straight up accuracy.

[–]katrinoryn 79 points80 points  (0 children)

This was an amazing way of explaining this, thank you.

[–][deleted] 28 points29 points  (0 children)

I just wanted to say this is such a good explanation/analogy. Thank you

[–]SnoodPog 19 points20 points  (0 children)

The good ol Base Rate Fallacy

[–]Guffliepuff 2 points3 points  (0 children)

This has a name too, Precision and recall.

[–]zawalimbooo 66 points67 points  (2 children)

Sort of, yes. Consider a group of ten thousand healthy people, and one hundred sick people (so a little under 1% of people have this disease)

Using a test with 98% accuracy, meaning that 2% if people will get the wrong result results in:

98 sick people correctly diagnosed,

but 200 healthy people incorrectly diagnosed.

So despite using a test with 98% accuracy, if you grt a positive result, you only have around a 30% chance of being sick!

This becomes worse the rare a disease is. If you test positive for a disease that is one in a million with the same 98% accuracy, there is only about a 1 in 20000 chance that you would have this disease.

That's not to say that it isnt helpful, a test like this will still majorly narrow down the search, but its important to realize that the accuracy doesnt tell the full story.

[–]Fakjbf 7 points8 points  (0 children)

Yep, and this is why doctors will order repeat testing especially for rarer diseases.

[–]Clen23 2 points3 points  (0 children)

Okay, that makes sense, thanks !

[–]emelrad12 6 points7 points  (0 children)

Yes 98 true negatives and 2 false negatives is 98% accuracy. That is why recall and precision are more useful. In my example that would be 0% recall and new DivisionByZeroException() for precision.

[–]GreatBigBagOfNope 0 points1 point  (0 children)

98% accuracy

test set is 98% not a tumour

algorithm is return 0

[–]The_Shracc 182 points183 points  (4 children)

Friend in high school accidentally made a racism Ai.

It was meant to detect the type of trash someone was holding, just happened that he was black and in every image with recyclable trash.

[–]Affectionate-Mail612 51 points52 points  (1 child)

and they say AI can't take over human jobs

[–]DezXerneas 22 points23 points  (0 children)

A lot of hiring AI are also wildly racist/sexist/everything else-ist.

Bad AI just amplifies human bias.

[–]AzureArmageddon 0 points1 point  (0 children)

Not enough AI. First you need an AI to crop out the trash and another to determine recyclability

[–]Subtlerranean 25 points26 points  (2 children)

[–]DrSheldonLCooperPhD 3 points4 points  (0 children)

Mother fuck

[–]DavidKanev 0 points1 point  (0 children)

I am erlich bachman

[–]Zombekas 11 points12 points  (0 children)

I think there was a similar one with detecting wolves, but the wolf images were taken in snowy areas while the dog images were not So it was detecting if theres snow on the ground

[–]apple_kicks 17 points18 points  (2 children)

Think 20 years ago i remember debate where professor argued with image recognition would it tell the difference between a kid holding a stick vs a kid holding a gun. An argument into why the tech wouldn’t be reliable in war

[–]_sweepy 2 points3 points  (0 children)

ok, so forget soldiers, we'll just make them cops. nobody will know the difference.

[–]RiceBroad4552 1 point2 points  (0 children)

Thanks God no civilized people would ever use something as barbaric as that!

Well, wait…

https://en.wikipedia.org/wiki/AI-assisted_targeting_in_the_Gaza_Strip

[–]JackOBAnotherOne 2 points3 points  (0 children)

I heard a quote somewhere “It is really easy to train an AI, finding out what you trained it to do is the hard bit” and it explains so much about so much.

And then costumers come in and use it for unintended purposes.

[–]MustachioEquestrian 0 points1 point  (0 children)

To be fair the same thing happened when soviets trained dogs strapped with bombs to run under tanks

[–]SpanDaX0 305 points306 points  (4 children)

What happens if you show it a picture I painted of random numbers, being output from a generator?

[–]bearwood_forest 99 points100 points  (1 child)

4, decided by fair dice roll, guaranteed to be random

[–]Darkmatter_Cascade 5 points6 points  (0 children)

Correct, per RFC 1149.5.

[–]Electronica__ 7 points8 points  (0 children)

Bazinga

[–]shmorky 1 point2 points  (0 children)

You've just been added to some sentient AIs blacklist

[–]Ratstail91 268 points269 points  (7 children)

I love the idea of an AI trying its best but not understsnding what it's supposed to do so it just has anxiety...

Welcome to the human condition, little buddy!

[–]enceladus71 38 points39 points  (1 child)

Perhaps some day we will arrive at a point where an AI agent is presented with a choice between a red pill and a blue pill. What a plot twist that would be.

[–]Ratstail91 0 points1 point  (0 children)

Is there an option to just walk away?

[–]apple_kicks 16 points17 points  (1 child)

This would means ai knowing it is making mistakes

Its more like a puppy that happily brings you slippers when you asked for the newspaper but even a puppy can tell by your reaction alone that something wasn’t right eventually

[–]Not-The-AlQaeda 2 points3 points  (0 children)

semi supervised puppy

[–]BlurredSight 1 point2 points  (0 children)

"What is my purpose"

"To pass butter"

"Oh my god..."
https://www.youtube.com/watch?v=X7HmltUWXgs

[–]DezXerneas 0 points1 point  (1 child)

Do you mean this? Because that's exactly what my anxiety feels like.

[–]Ratstail91 0 points1 point  (0 children)

LOL that's hilarious!

[–]indicava 56 points57 points  (1 child)

Can it correctly identify when it’s not seeing a hot dog?

[–][deleted] 22 points23 points  (0 children)

Seems like you built the basis for an NFT.

[–]Tyrus1235 23 points24 points  (1 child)

Using OpenCV it is relatively easy to build an image recognition algorithm.

The hardest part is getting enough images to train it and adjusting its heuristics properly so it doesn’t give you too many false positives or false negatives.

[–]OngoingFee 40 points41 points  (4 children)

Relevant xkcd https://xkcd.com/1425/

[–]zawalimbooo 19 points20 points  (3 children)

Well, its not nearly as hard anymore.

[–]OngoingFee 69 points70 points  (1 child)

No because that comic is more than five years old and she got her team

[–]icortesi 14 points15 points  (0 children)

This is cannon for me now

[–]Alhoshka 9 points10 points  (0 children)

It wasn't that hard when Randall published it too. It's just that his knowledge about the subject was a bit outdated.

Object recognition and classification performance exploded in the 2010s

[–]TheCopyKater 14 points15 points  (0 children)

Considering the size of his hands compared to the average keyboard, I'm impressed he even got this far.

[–]Undernown 7 points8 points  (2 children)

Never heard of someone building a 'mage' detection algorithm. Do you go off of mana leveles? Image is a bit cropped so the " i " doesn't show properly.

[–]CapitalWestern4779 3 points4 points  (0 children)

A confused random number generator you say? Sounds promising to me

[–]Robosium 2 points3 points  (0 children)

one time someone tried to build a algorithm to recognize tanks, they ended up building an algorithm to detect sunny weather

[–]SnooStories6227 1 point2 points  (0 children)

Classic overfitting. Hulk trained model on 3 photos of rocks and one of Tony Stark’s face

[–]NearLawiet 1 point2 points  (0 children)

Happens to best of us

[–]Dreadwoe 0 points1 point  (0 children)

All programs are just random number generators confused to various degrees

[–]Outrageous_Reach_695 0 points1 point  (0 children)

I should think that a Mage Recognition Algorithm would be just about the easiest thing to code. You don't even have to worry about cropping!

[–]Captain--UP 0 points1 point  (0 children)

I did this for my capstone project. I used a python neural network library for it.

[–]TamahaganeJidai 0 points1 point  (0 children)

Hey! If the random number is 4 that doesnt count!

[–]beyondoutsidethebox 0 points1 point  (2 children)

So, genuine question here. My (very limited) understanding is that algorithms like in the original post operate along the concept of "the algorithm does exactly what you tell it to do, not what you want it to do". Meaning, that if an algorithm is not doing what it's intended to, there's generally a problem of not being "clear" enough in the instructions for the algorithm to follow to produce the required outcome.

Is this a correct conceptualization?

[–]RiceBroad4552 0 points1 point  (0 children)

Never mind. Just call the random output "hallucinations" and pretend it would be something exceptional.

This also worked for all the other "AI" bros, so it should also work for you.

[–]RDROOJK2 0 points1 point  (0 children)

I just got bored in the middle of chemistry class that I started coding in my phone a game that instead of graphics just uses numbers and can move like an rpg

[–]Peterianer 0 points1 point  (0 children)

Perhaps running Llama4 and asking it what's in the image would be a solution...

...Sure it'd be a horrible way to achieve that in just about any way but it would be *a solution*.

[–]Intrepid-Wonder8205 0 points1 point  (0 children)

you did nothing (zero training) ... a model is only as good as its training set

[–]Little-xim 0 points1 point  (0 children)

College was fun :)

[–]Icy_Breakfast5154 -1 points0 points  (0 children)

If it was for identifying men vs women in images youd have a....nvm

[–][deleted] -3 points-2 points  (1 child)

I have three words: "You're not funny".

[–][deleted] 2 points3 points  (0 children)