News for hackers. Stuff that matters.

Show HN: “Is this loss?”: A TensorFlow Lite app to detect Loss.jpg

I built this app over a week as a way to learn how to use TensorFlow with Mobilenets and to get some experience with Google Play (and partly as a dare). It's written in Java, as I wasn't able to find a Kotlin API for TFLite. It was built with Bazel.

I'm pretty satisfied with the actual detector's performance, although I expect I could improve the UI a little bit.

It's a weird UX, as you want it to be as simple and fast as possible (loss/notloss) but you also want it to have some sort of recognizability. I would love to hear your thoughts.

https://play.google.com/store/apps/details?id=party.eigenlos...

( 37 comments | 82 points | on HN )
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by wufufufu on Monday April 23, 2018 @07:00PM (#16908259)
For anyone wondering what the "Is this loss?" meme is about, this provides good context http://nymag.com/selectall/2015/11/longest-running-miscarria...
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by lainga on Monday April 23, 2018 @06:13PM (#16907942)
Does it detect only Loss.png, or attempt to see other (disguised) instances of the form

  |  ||
  || |_

?
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by eigenloss on Monday April 23, 2018 @06:56PM (#16908232)
Framed properly, it does detect what you posted: https://imgur.com/a/0wdqPea. Positively identifying abstract geometric loss while rejecting non-loss text and drawings was something I had to explicitly optimize the training sets for.
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by lainga on Monday April 23, 2018 @08:07PM (#16908646)
NEAT. I rate this (1/2) / (2/50).
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by lccarrasco on Monday April 23, 2018 @06:24PM (#16908040)
In the screenshots shown in the link you can see that it detects plenty of "disguised" Loss images.

By the way, cool app eigenloss, way more accurate than I'd have expected.

Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by eigenloss on Monday April 23, 2018 @06:47PM (#16908173)
Thanks lccarrasco! It does work surprisingly well for such a tiny CNN. Props to the MobileNet team at Google.
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by tyrust on Monday April 23, 2018 @06:37PM (#16908116)
Give your model to a reddit bot and let it loose on /r/me_irl.
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by eigenloss on Monday April 23, 2018 @09:57PM (#16909259)
Not a bad idea. The "not loss" training set actually contains a few hundred images scraped from there.

There are plenty of subreddits and online forums where a single-purpose lightweight CNN like this one could be enormously productive. It would obviously need a small backend somewhere, but the hardware requirements are minimal.

Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by rrcaptain on Friday April 27, 2018 @11:21AM (#16941425)
I mean, I wouldn't call this productive. But fun and useful most definitely.
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by eigenloss on Friday April 27, 2018 @11:50PM (#16945974)
Obviously, loss/not loss isn't a genuinely useful classification.

Something to automatically help users identify forum-specific images (e.g. poisonous/harmless spiders, bedbugs/beetles, snakes, etc.) would be useful, and the network would be the same.

Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by gowld on Monday April 23, 2018 @06:44PM (#16908159)
In other words, eignloss says "I just gamed The Loss"

( https://en.wikipedia.org/wiki/The_Game_(mind_game) )

Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by mynegation on Monday April 23, 2018 @07:04PM (#16908278)
I had to lookup the backstory. I obviously cannot know all of the context, but... honest question: why would people make fun of a comic about such deeply personal tragedy? To me it seems tone-deaf to say the least.
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by geofft on Monday April 23, 2018 @07:27PM (#16908401)
Because they're making fun of a comic, not out of a personal tragedy: it was a gag-a-day comic strip about video games with limited plot, and giving the characters a deeply personal tragedy was extremely out of character for the comic strip.

Plenty of people make fun of webcomics that developed a serious plot and actual characterization over time (MegaTokyo and Questionable Content both come to mind). This one went from 0-100 in one strip.

Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by fwip on Monday April 23, 2018 @07:36PM (#16908448)
And after that one strip, it dropped back down to 0 pretty quickly.

It seemed to a lot of people that Tim Buckley realized "oh hey I don't want to have a baby in the strip" and decided to get a cheap emotional punchline while he was writing himself out of that self-inflicted hole.

But when your comic has less depth than your average Garfield comic, it doesn't work out so great.

Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by sneak on Tuesday April 24, 2018 @04:30AM (#16910891)
Calling QC “serious characterization” is a huge stretch. JJ appears to basically only know how to write characters that have the same crippling anxiety that he does. It’s maddening to read.
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by geofft on Tuesday April 24, 2018 @08:32AM (#16911963)
I'm not commenting on whether it's good characterization (although I do non-ironically enjoy reading QC personally), just that it's a marked departure from the esrly days of the strip when there was no attempt at giving the characters any more characterization than requires for the short-term jokes. Regardless of how good he is at it, the author is certainly being consistent about writing a long-term plot that is isn't just a bunch of gags and about giving the characters meaningful backstories and personalities beyond "likes indie rock."
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by larzang on Monday April 23, 2018 @08:09PM (#16908659)
10 years ago, a moderator on the Something Awful forums posted a home-improvement thread in which he chronicled building an addition to his house, a noble goal.

It was a disaster. He insulted his stairs. He had load-bearing drywall. None of the windows matched, making a big ugly box even uglier. The foundation settled and the addition separated from the original house. He fucked up the plumbing real bad and swamped his yard multiple times. He tried to get certified as an inspector because no professional inspectors would touch his work.

It quickly became a legend, and is fondly remembered even today as one of the good old stories of the internet.

Sometimes someone with poor talents and awe-inspiring arrogance does something so monumentally stupid, tasteless, and just plain bad, that it gains a life of its own. Sometimes that's bad siding, sometimes that's bad comics.

Pictures and more details saved for posterity: https://twitter.com/3liza/status/891475977183739905

Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by rcoveson on Monday April 23, 2018 @07:11PM (#16908318)
Imagine if South Park did a completely serious episode where an adult Cartman's wife had a miscarriage. It would be mocked mercilessly. Whether it would be morally right to mock it or not is anybody's guess, but mocked into memedom it would be.
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by mintplant on Monday April 23, 2018 @08:04PM (#16908618)
They're mocking the comic's complete failure at representing such a deeply personal tragedy and the apparent hubris of the creator behind it.
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by chatmasta on Tuesday April 24, 2018 @06:03AM (#16911270)
The context is that Buckley was criticized for shallow comics, so he dropped Loss.jpg as a bomb on his detractors, who turned it into a meme.

From the article:

> The last strip to mention Lilah’s pregnancy prior to “Loss” had been published 10 installments and nearly a month prior, and readers found the sudden attempt at gravity hilarious. So they did what the internet does: turned “Loss” — again, a comic strip about miscarriage — into a running joke

Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by maw on Monday April 23, 2018 @07:25PM (#16908386)
Not all things called "comics" are always funny all the time.
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by mynegation on Monday April 23, 2018 @07:38PM (#16908460)
I understand that. The question was why people would make memes out of this comic strip.
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by wrinkl3 on Monday April 23, 2018 @08:02PM (#16908611)
I audibly groaned when I read the title, but it's certainly a neat app. Do you plan to post the source code or a detailed training model description?
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by eigenloss on Monday April 23, 2018 @09:30PM (#16909118)
Yes; I'll be doing one or both of the above shortly. There are tutorials online for most of the process, but the non-Google-maintained ones are generally very out of date. The app itself draws heavily from the TFLite Java Demo App, which can be found at tensorflow.org.

For now, it's a placeholder with just a privacy policy, but the details will be at eigenloss.party in a week or so.

Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by Osseric on Monday April 23, 2018 @06:34PM (#16908102)
Best thing I've seen on Show HN in awhile.
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by YetAnotherNick on Monday April 23, 2018 @08:44PM (#16908883)
Too easy examples. Try on loss kanji vs non loss kanji ;)
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by mediocrejoker on Monday April 23, 2018 @06:57PM (#16908239)
Can someone explain what Loss.jpg is? I've never heard of it and pretty much none of the comments here make sense as a result.
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by evanpw on Monday April 23, 2018 @06:58PM (#16908245)
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by newen on Monday April 23, 2018 @06:30PM (#16908079)
This is pretty neat lol. I'm curious about what architecture you used, how many images and what kind of augmentation you used.
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by eigenloss on Monday April 23, 2018 @06:55PM (#16908226)
Training was a bit of a process. The architecture I use now is an 8-bit quantized mobilenet_v1_050_224 retrained on about 1000 versions of Loss.jpg (some quite similar, but not exact duplicates) and about 10,000 other images. All the images are 240x240 or thereabouts.

I'll be publishing something soon on what it took to build that 10K image dataset - it was more challenging than I initially anticipated.

Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by scottmf on Tuesday April 24, 2018 @12:11AM (#16909792)
Wow I was thinking of this exact idea just yesterday.

Could you share the code or make this a web app? I don’t have access to Android.

Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by eigenloss on Tuesday April 24, 2018 @12:36AM (#16909870)
A very similar demo is available on the Tensorflow website, and the sources are available in the main TF repo. My sources will probably go public eventually.

https://www.tensorflow.org/mobile/tflite/demo_android

A web app could be done, but the use case and development process is somewhat different. The TFLite API is also significantly more mature. Looking at this TensorFlow.js demo might be helpful:

https://github.com/google/emoji-scavenger-hunt/

Send me an email at the address in my profile if you do anything with it - I'd be happy to help out with training!

Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by alexfi on Monday April 23, 2018 @06:36PM (#16908114)
Do you want to make it open source? :)
Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by eigenloss on Monday April 23, 2018 @06:46PM (#16908170)
Maybe. I don't see any reason not to!

Edit: I can't reply to any other comments at the moment due to low karma. In response to wrinkl3 and others, I will likely be sharing more details about the development process and network in the next week or two, probably at eigenloss.party.

Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by luc_ on Monday April 23, 2018 @08:05PM (#16908629)
I don't think perpetuating a meme that, even inadvertently, belittles the emotional hardness of a miscarriage, is the right thing to do.

Regardless of this meme originating from a comic going from 0 to 100 in the level of seriousness it usually portrays, it is not something that we should endorse.

Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by legostormtroopr on Monday April 23, 2018 @11:45PM (#16909695)
Sadly the original post that went with it is lost to time, but Cyancide and Happiness kept some of it.

We aren't making fun of miscarriage, but someones terrible poor attempt at portraying it in a comic, along with a post that said miscarriage is "often much harder on the woman than on the man" and that it "doesn't necessarily turn you into a sad, depressed sack of tears". [1]

If you don't like it, as Tim B^Uckley says "move past it".

[1] http://explosm.net/comics/1310/

Edit: I found the original, its longer and more insufferable than I ever imagined - https://cad-comic.com/so-then-lets-chat/

Re:Show HN: “Is this loss?”: A TensorFlow Lite app to detect... by whywhywhywhy on Tuesday April 24, 2018 @07:02AM (#16911492)
This is looking at humour in a very one dimensional and puritanical manner. Comedy, like art we can't just point at the subject matter and shake our heads that it's distasteful and dismiss the whole work.

Some of the most highly regarded comedy ever made has used subject matter that is tragic or horrifying, any comedy around Nazis for which there are countless examples and the work of Chris Morris (Brasseye, Jam, Four Lions) come to mind.