News for hackers. Stuff that matters.
Re:Apple Buys Shazam to Boost Apple Music by amelius on Monday December 11, 2017 @02:43PM (#15899688)
(removed)
Re:Apple Buys Shazam to Boost Apple Music by vedant on Monday December 11, 2017 @03:15PM (#15900025)
This has the smell of a comment written by someone with limited real-world experience. Simply writing down the list of problems you would have to solve to build Shazam would take an entire afternoon.

Yes, deep neural networks have proven remarkably useful for machine perception, but you would still need to collect a colossal amount of audio data, fingerprint all of it, build a low-latency processing infrastructure for making inferences, and convince a hundred million people to install your software to feed you copious real-world training data that you can use to improve model performance.

Re:Apple Buys Shazam to Boost Apple Music by amelius on Monday December 11, 2017 @03:24PM (#15900105)
> and convince a hundred million people to install your software to feed you copious real-world training data that you can use to improve model performance.

That's actually the easy part. You already have the music. Distorting it by superimposing background noise is really not difficult.

Re:Apple Buys Shazam to Boost Apple Music by tsomctl on Monday December 11, 2017 @04:19PM (#15900542)
Lol. When you superimpose noise, the original data is still there. When you have a FM radio playing staticky, heavily compressed music through crappy speakers in an acoustically terrible store and being captured by a terrible microphone and then being compressed, a significant amount of nonlinear distortion has taken place. That is extremely hard to model. And you would have to model it or have real data to train a neural network. Neural networks are extremely hard to train without excellent data.
Re:Apple Buys Shazam to Boost Apple Music by amelius on Monday December 11, 2017 @04:31PM (#15900663)
> playing staticky, heavily compressed music through crappy speakers in an acoustically terrible store

I think you just confirmed how easy (and cheap) it is to actually generate this data.

Re:Apple Buys Shazam to Boost Apple Music by abraae on Monday December 11, 2017 @04:32PM (#15900668)
If by "model" you mean reproduce, why is it so hard to simulate the distortion introduced by poor FM reception? Or by the acoustics of a store?
Re:Apple Buys Shazam to Boost Apple Music by d33 on Monday December 11, 2017 @04:33PM (#15900679)
I wonder if you could build a neural network that would do that...
Re:Apple Buys Shazam to Boost Apple Music by throwawayfinal on Monday December 11, 2017 @03:58PM (#15900374)
The easy part? If you're apple, google, or microsoft, maybe.
Re:Apple Buys Shazam to Boost Apple Music by amelius on Monday December 11, 2017 @04:10PM (#15900475)
Can you explain?

I mean, you can easily find thousands of hours of music online. Recording background noise is easy (just go to a random bar where they are not playing music). Now simply add the two signals (you can shift them randomly to generate more data). You can also add some linear filtering if you like (just imagine random settings of an equalizer for starters).

This should give you enough data to build a proof of concept at least.

Re:Apple Buys Shazam to Boost Apple Music by throwawayfinal on Monday December 11, 2017 @05:37PM (#15901302)
For training:

Illegally grabbing thousands of hours of music to train a commercial model hardly qualifies as fair use. Any company you build upon that would be tainted.

For sustaining:

In addition, you'll need to keep an updated catalog of music to identify new songs against, and most uses of a service like shazam are to find names of songs people aren't familiar with, so that catalog needs to be very fresh.

That means you'll have to grab some sort of feed, and engage in large scale music piracy for commercial gain or have access to a library of songs from many disparate music providers, such as ascap.

Background noise:

there are literally hundreds of different background noise environments you need to train against. Dozens of common microphone configurations. Clipping, variations.

It's very much a problem where a proof of concept is neat but doesn't really get you anywhere.

Re:Apple Buys Shazam to Boost Apple Music by throwawayfinal on Monday December 11, 2017 @05:38PM (#15901317)
Also, I'm not saying it's impossible or not worth doing (obviously, it's possible and worth doing), just that a few minutes of thinking and hacker news comments are going to hardly touch the breadth of difficulties required to get this to work even somewhat reliably.
Re:Apple Buys Shazam to Boost Apple Music by dzhiurgis on Monday December 11, 2017 @04:22PM (#15900568)
> use to improve model performance.

Shazam doesn't actually let you improve the answer, nor report incorrect guess. They are so confident with them, even if it's sometimes completely missed genre and style of music.

Re:Apple Buys Shazam to Boost Apple Music by dawnerd on Monday December 11, 2017 @03:01PM (#15899889)
I'd be more curious to see you try to build this in an afternoon.

Also, it works a lot better than being able to find "slightly distorted" versions. It can catch a song in a noisy room where you can barely make out the song to begin with. Couple months back it found a song when there was a very loud crowd yelling over it. They're also able to determine differences between versions of songs pretty well. Some remixes might sound very close to the original.

Other thing you might be missing is just how fast it is even on a slow mobile connection.

Re:Apple Buys Shazam to Boost Apple Music by amelius on Monday December 11, 2017 @03:05PM (#15899923)
(removed explanation because it seems not appreciated)
Re:Apple Buys Shazam to Boost Apple Music by vedant on Monday December 11, 2017 @03:24PM (#15900102)
This is a heap of nonsense. Not only does this summarily dismiss the enormous challenges in digital signal processing required for removing arbitrary background audio, it exposes some confusion associated with the ideas of correlated random variables, inner products, and affine transformations.
Re:Apple Buys Shazam to Boost Apple Music by amelius on Monday December 11, 2017 @03:50PM (#15900316)
> it exposes some confusion associated with the ideas of correlated random variables, inner products

Read this article, then come back: [1]

[1] https://en.wikipedia.org/wiki/Cross-correlation

Re:Apple Buys Shazam to Boost Apple Music by xapata on Monday December 11, 2017 @03:42PM (#15900244)
> (removed explanation because it seems not appreciated)

I think describing the reaction as lack-of-appreciation is a bit misleading. Perhaps disbelief might be a better description.

Re:Apple Buys Shazam to Boost Apple Music by amelius on Monday December 11, 2017 @03:53PM (#15900333)
For the wrong reasons. See my response.
Re:Apple Buys Shazam to Boost Apple Music by xapata on Monday December 11, 2017 @06:00PM (#15901517)
Since you deleted the original comment, it's hard to evaluate it. I think you should have left it there.
Re:Apple Buys Shazam to Boost Apple Music by mmmmmbop on Monday December 11, 2017 @03:14PM (#15900019)
So they're doing this vector correlation for every song in their database (40 million)?
Re:Apple Buys Shazam to Boost Apple Music by ska on Monday December 11, 2017 @03:29PM (#15900156)
A tiny percentage of the time occasionally when a successful company makes a N-hundred million purchase of a technology and company and you don't understand why, it's because they have made a mistake.

The smart money, though, is on the main chance: you don't understand the purchase, or the problem domain, or both.

In this case I think you are overestimating the progress in NN and search, and underestimating the signal processing. Have you tried this with any significant corpus?

"Whack it through a FFT and do correlation " seems like one of the obvious solution to the toy problem version, but this is exactly the sort of thing that usually falls apart in practice.

Re:Apple Buys Shazam to Boost Apple Music by paulcole on Monday December 11, 2017 @03:00PM (#15899882)
> isn't it possible to build this yourself in Python in an afternoon?

Is anyone keeping a running list of products that HN commenters have suggested could be built in an afternoon/weekend?

Ones I've seen so far: Facebook, Twitter, Dropbox, and now Shazaam.

Re:Apple Buys Shazam to Boost Apple Music by fuck_google on Monday December 11, 2017 @04:04PM (#15900423)
Building the service is not usually the hard part, but building the ecosystem around it is. There were/are countless services similar to Facebook or Twitter, but only a few of them can be really successful because of herd mentality.
Re:Apple Buys Shazam to Boost Apple Music by cocktailpeanuts on Monday December 11, 2017 @03:42PM (#15900247)
Go build it yourself in an afternoon and come back.

Then we'll talk.

Re:Apple Buys Shazam to Boost Apple Music by Zenst on Monday December 11, 2017 @03:10PM (#15899971)
Some insight into the Shazam tech and article has a link to the algorithm being used.

https://www.toptal.com/algorithms/shazam-it-music-processing...

Re:Apple Buys Shazam to Boost Apple Music by amelius on Monday December 11, 2017 @04:12PM (#15900491)
Thanks. This actually proves my point that the core concepts of Shazam can be implemented in a weekend. Of course, programming the front-end etc. is more work, but that is besides the point.
Re:Apple Buys Shazam to Boost Apple Music by ghaff on Monday December 11, 2017 @02:46PM (#15899722)
You'd need access to the fingerprints database but otherwise should be fairly straightforward.

What's not straightforward is recognizing cover songs and the like. But that's not only non-trivial but AFAIK can't be done.

Re:Apple Buys Shazam to Boost Apple Music by amelius on Monday December 11, 2017 @02:48PM (#15899741)
> What's not straightforward is recognizing cover songs and the like. But that's not only non-trivial but AFAIK can't be done.

Well, you could translate the music into actual notes (or musical intervals), and use Smith-Waterman (or any more advanced and more recent technique) to find the song with the lowest edit-distance.

Re:Apple Buys Shazam to Boost Apple Music by rhizome on Monday December 11, 2017 @03:10PM (#15899974)
Converting digital audio to notes is both not as easy as it sounds and not how Shazam works.

https://www.toptal.com/algorithms/shazam-it-music-processing...

Re:Apple Buys Shazam to Boost Apple Music by amelius on Monday December 11, 2017 @03:43PM (#15900259)
Yes, you can look at the frequency with the highest intensity in the FFT. This is the "dumb" version of converting music to notes (and is what I really intended to say but didn't choose to for sake of brevity).
Re:Apple Buys Shazam to Boost Apple Music by rhizome on Monday December 11, 2017 @04:46PM (#15900787)
The thing is that the process looks for spectral patterns, let's call it "harmonic content per unit of time," not just notes. Mere notes would result in lots and lots of false positives.
Re:Apple Buys Shazam to Boost Apple Music by amelius on Monday December 11, 2017 @05:06PM (#15900954)
Let's just agree that the process is not too far removed from my initial brief description, and should be simple to implement, as the article shows. For any competent signal processing engineer, this should all be evident, which was the main point.

Also, even if you have many false positives, you have already narrowed down the search, and this allows you to do more brute-force searching like computing cross-correlations.

Re:Apple Buys Shazam to Boost Apple Music by cortesoft on Monday December 11, 2017 @04:27PM (#15900615)
Where are you going to get 'the music'? There are millions and millions of hours of music out there, how are you going to gather and fingerprint it all?
Re:Apple Buys Shazam to Boost Apple Music by azinman2 on Monday December 11, 2017 @03:10PM (#15899970)
Uhh isn’t creating the “fingerprint” the non-straightforward part? Keep in mind you could start listening at any point in the song as well.
Re:Apple Buys Shazam to Boost Apple Music by chiefalchemist on Monday December 11, 2017 @03:18PM (#15900065)
Yeah you can build the platform but you won't have any data; no history of searches. You also won't have any users.

I'm not disputing they overpaid. However, long to short, building the technology is the easy part, and just a fraction of the brand / product value.

Re:Apple Buys Shazam to Boost Apple Music by lavezzi on Monday December 11, 2017 @03:23PM (#15900097)
y'all realise they run a music service too right? Having access to cross-platform data that gives them insight into bleeding edge emerging/trending artists and songs is priceless.
Re:Apple Buys Shazam to Boost Apple Music by amelius on Monday December 11, 2017 @03:31PM (#15900165)
Apple already had a music service too (itunes).
Re:Apple Buys Shazam to Boost Apple Music by oarsinsync on Monday December 11, 2017 @04:08PM (#15900457)
Different signals.

"What's that song?" is a different signal to buying a song. Especially when "what's that song?" isn't restricted by licensing agreements.

Re:Apple Buys Shazam to Boost Apple Music by coppolaemilio on Monday December 11, 2017 @02:45PM (#15899714)
It is already working. It is not that simple to start from scratch and get it working properly + the DB and everything
Re:Apple Buys Shazam to Boost Apple Music by donarb on Monday December 11, 2017 @03:28PM (#15900149)
It's not only the song recognition technology, Shazam also has video recognition and AR technology.