Was the reason for the Shazam office in Rancho Bernardo, San Diego because you were originally from San Diego before moving to England? Lawn Love rented a suite above theirs from 2014-2018. The Shazam mobile app devs working out of that office were quiet and kept to themselves, even after the acquisition. We never heard any celebratory champagne!
This was the smart approach when Shazam launched in 2008. I would have done exactly the same thing - gone straight to developing a method to turn every song into a hash as computationally efficiently as possible. If you launched this today the default R&D approach would be to train a model which may turn out to be far less efficient and more expensive to host. It feels like the kind of thing a model might be good at, but given that there are a finite number of songs, taking a hash-based approach is probably way more performant.
Just to be clear, it's not turning each song into a hash.
It's turning each song into many hundreds (thousands?) of hashes.
And then you're looking for the greatest number of mostly-consecutive matches of tens (or low hundreds) of hashes from your shorter sample.
Also, I don't think this would be done with training a model today, because you're adding many, many new songs each day, that would necessitate constant retraining. Hashes are still going to be the superior approach, not just for efficiency but for robustness generally.
I'm an MLE, I would probably chop the songs into short segments, add noise (particularly trying to layer in people talking, room noise, and apply frequency-based filtering), and create a dataset like that. Then I would create contrastive embeddings with a hinge loss with a convnet on the spectrogram.
Ultimately this looks the same, but the "hashes" come from a convnet now. But you still are doing some nearest neighbor thing to actually choose the best match.
I imagine this is what 90% of MLEs would do, not sure if it would work better or worse than what Shazaam did. Prior to knowing Shazaam works, I might think this is a pretty hard problem, knowing Shazaam works, I am very confident the approach above would be competitive.
So you want a location-sensitive hash, or embedding, and you want it to be noise resistant.
The ml approach is to define a family of data augmentations A, and a network N, such that for some augmentation f, we have N(f(x)) ~= N(x). Then we learn the weights of N, and on real data have N(x')~=N(x).
The denoising approach is to define a set of denoising algorithms D and hash function H, so that H(D(x'))~=H(x). This largely relies on D(x')~=x, which may have real problems.
So the neutral network learns the function we actually need, with the properties we want, where the denoiser is designed for a proxy problem.
But that's not all...
Eventually our noise model needs extending (eg, reverb is a problem): the ML approach adds a new set of augmentations to A. This is fine: it's easy to add new augmentations.
But the denoiser might need some real algorithm work, and hope that there's no bad interaction with other parts of the pipeline, or too much additional compute overhead. (And de-reverb is notoriously hard.)
That could work, I think denoising a song to be a perfect match to the original recording is probably a very hard problem, so hard that your model will still need to be robust to some deviation from the original track, and therefore you need to do what I said above anyway.
Generally it's much easier to generate noised pairs from clean input than it is to do the reverse, i.e. go record lots of noised inputs from the wild and match to the original song. So the denoising problem you mention would be tougher still due to covariate shift. I think the features you learn trying to fingerprint the song through noise will probably be a bit more robust, but I don't have a mathematical proof.
Because then you’re training it on data that is more similar to the operating environment for the application. It’s a better fit for purpose. If the target environment was a clean audio signal, you’d optimise for that instead.
Adding noise is generally helpful for regularization in ML. Most modern deep learning approaches do this in one way or the other - mostly dropout. It improves generalization capabilities of the model.
To start from an original song and move it towards something that resebme a real life recording ? IOW : make the NN learn to distinguish between the song sound and its environment ?
Depends what the model targets. If I gave this problem to a bunch of musicians, they’d be pulling out features like the key, tempo, meter, chord progressions, any distinctive riffs or basslines, etc. Those are the things hashes could be built from and would be more information-dense than samples of the particular recording.
Using a model to deconstruct a song like that might enable the ability to recognize someone playing the opening bars of Mr. Brightside on a piano in a loud bar as well as its drunkest patrons.
You wouldn't necessarily need to retrain that frequently. If your model outputs hashes / vectors that can be used for searching, you just need to run inference on your new data as it comes in.
You would probably take the approach that is used for face recognition. You train a model that can tell if two faces are the “same”. Then you match an unknown face against your database of faces. You can get clever and pull out the “encoding” of a face from the trained model.
The smart approach in 1975 was to use Parsons code, which was also turning songs into hashes, computable in your head. You could then find your song back as simply as looking a word in a dictionary. Hopefully this idea won't die any time soon.
That requires identifying the melody, which is certainly not something all humans can do, and was probably not generally doable by a machine in 1975. It also throws away a huge amount of information, and requires starting from the beginning of the melody.
It launched in Britain. I remember dialing 2580 in a nightclub, waving the phone around, and everyone being impressed when the identification was correct, as it usually was. Even with relatively obscure music.
A friend was in the beta and demoed it to us in a bar.. it was insane
In the UK you dialled 2580 from your (non smart) cellphone, it would hang up after a few seconds and you’d get an SMS right away with the ID of the track
tbh for tools like Shazam there's no fundamental difference between a database + hashing algorithm and a self-supervised model; both are great indexing & compression solutions, just for different scales of data.
If you trained a model for this, how would you avoid having to run the entire training process again every time you needed to add another song?
I wonder if there's a way to build an embeddings model for this kind of thing, such that you can calculate an embedding vector for each new song without needing to fully retrain.
You'd just have the network generate fingerprints for any given song similar to how facial recogniton is done
Siamese networks are what you want, two identical pairs of layers (one cached in this case) which act as the fingerprints then then the final layers are doing the similarity matching
People who are highly skilled at this, can be easily stumped. Sure it might workfor artist who are more focused (tailor swift), it might pick out some interesting guest appearances (Eddie Van Halen on Beat It) but when you get multi talented performers who change everything about what do, they don't fit a "model". The most current example would be Andre3000's latest release.
Um, yeah, you won't be able to model artists who don't follow a model (especially done so deliberately). As you say that is true of humans or computers alike. But it's not the problem anyone cares about and not what the parent comment intended.
Certainly a well trained model will be able to have incredible accuracy just with vocals alone. It will be able to identify Lady Gaga regardless of whether she is singing a new art pop track or old standard with Tony Bennett.
We could have a debate about the consistency of Gaga or Taylor Swift and profit a motive (and we could go all the way back to composers of the classical period with this).
I could also point you to Diplo who, as a "producer" is responsible for diverse sounds with his name directly on them and then side projects Like Major Lazer or MIA's paper planes that have his hallmarks but aren't "musicaly" linked. How about the collected work of Richard D. James, I'm no so sure that all the parts fit together outside the whole of them.
Stuart Copland was the drummer for the police, a very distinct and POP sound. Are we going to be able to use ML to take those works and correlate them to his Film scores? How about his opera? Dave Grohl, Phil Colins, Sheila E, more drummers who became singers, what is the context for ML finding those connections (or people).
John Cages 4'33 is gonna be an interesting dilemma.
DO you think the player piano black hole sun, and C.R.E.A.M cover from Westworld are picked up as stylized choices by Ramin Djawadi, and would it link those to the sound track of Game of Thrones?
Even with all the details it's sometimes hard to believe what talented people can do and how diverse their output can be!
but if it is not that would be extremely impressive! determinism/freewill reduces to shazam!?
whats the training data to predict new song titles? heh
check out this reply from claude2:
>predict the next 3 new song titles from artist Taylor Swift
1. Last Dance with You - A reflective ballad about finding closure after a breakup.
2. Never Getting Back Together - A pop tune emphasizing that the same mistakes won't be made twice in a relationship.
3. 22 Was My Prime - A lighthearted look back on her early 20s as carefree years that can't be replicated.
Whenever music is mentioned in conjuction with technology, one artist seems to always - in a very literal sense - pop up like a zombie in a B-movie...Taylor Swift. No idea who this person is or what they do but they appear everywhere, all at once.
Hi - This is Chris Barton (founder of Shazam). Sony's TrackID was built by licensing (and later buying) a technology invented by Philips. That tech was invented after Shazam. Shazam was the first to create an algorithm that identifies recorded music with background noise in a highly scaled fashion. My co-founder, Avery Wang, invented the algorithm in 2000. Chris (www.chrisjbarton.com)
Hi Chris, it's Cornel Masson . I was at the London office from 2002-2006, then 4 more years working remotely from South Africa.
I worked on all the Java infrastructure around the recognition cluster (the latter being handcrafted C and assembly, optimised for specific Intel hardware).
The thing that Shazam got right was not just the core recognition tech, but the business processes and supporting systems around it. I remember how much work Chris had to do to convince the 4 major mobile networks in the UK to give Shazam the same 2580 dialing code (the middle 4 buttons, top to bottom, on an early 2000s feature phone).
A major part of the business is the constant sourcing and ingestion of the latest music, in all target markets (think Afrikaans pop in South Africa), deals with pluggers and record labels, etc. Initially, the back catalog was ripped from CD by a huge team of people in a warehouse, on custom workstations.
No no no, Tuneprint was well before that. By 2004 we were LONG gone. Shazam didn't show up until I think years later.
And I might be confusing them with another group but I thought, at the time, they were doing some goofy hash of the highest energy Fourier components -- a source of entertainment in our office. ;-)
I think Geoff had the vision and algorithm from the 90s as part of an ISEF project (!?). We had funding in 2001, when we got the real world go-to-your-car-and-get-a-cd and then we identify it ... using the audio signal alone.... demo working.
With a corpus of hundreds of thousands of songs. Positive match in less than 2 seconds.
Sadly, in 2001 there's no market for such whizbang amazing tech.
none of the companies making the previous hashing apps had the money that AI companies do. around here, the phrase "fish in a barrel" might be used to describe the situation.
For the technically knowledgeable, music fingerprinting is a concrete problem which is understandable but pretty difficult if you get into the details without looking at how other people have already solved it.
It fits into that space of an unusual but comprehensible problem, unlike superficially similar features like recognizing animals or objects in images, which is mostly weird ML magic.
It was really hard to do the first time. :) I'm honored to have been part of the first team to do any viable acoustic music recognition, in 2001 (much earlier than Shazam, a point of pride of course[0]).
You're dead on that it's pretty difficult if you don't benefit from others, we did a ton of work that in retrospect wasn't necessary. I liked the advanced psychoacoustic model, faithfully implemented in high performant C direct from Zwicker. (Psychoacoustics). To a first approximation, about 10/s model -> pca -> top 16 dim -> VQ and the resulting bytes contain more than 50% of the entropy (!!) Shove all of those in a home grown what-you-now-call-a vector DB, do dozens of range queries, and search for any song common to multiple results. Boom, music recognition. Understandable in retrospect but things like that aren't Everest they're like... multiple unclimbed mountains.
0. And far too early to have any applications. Company existed 2000-2001 \o/
I would say animals in images is more akin to matching two different musical performances of the same song (where one of the two can even be the user humming), which Shazam doesn't offer but some systems like Google Assistant do!
Rather, matching two recordings of the exact same performance (one ingested by Shazam at training time and one ingested by Shazam at run time) is more akin to identifying individuals (facial recognition) than identifying species.
At the same time it turned from “tap to listen, here you go” to a sluggish af and ads-infested bloatware. I remember when I stopped using it and deleted the app because my prev-gen iphone couldn’t load it in time anyway.
I actually went back to Shazam from SoundHound (on Android). Yeeears back, SoundHound had some advantage, I forget which. Now, Shazam starts in a second (just tried it, never used since last reboot) and SoundHound in like 15 (from memory). Inexcusable in general and for that kind of app in particular.
I seem to remember Soundhound claimed (and maybe still claims) to be able to work not only on recorded music, but when you whistle/hum/sing a song. I never had much luck with that, but that could be because of my lack of musical talent.
What Soundhound does these days that Shazam doesn't (I think; I haven't actually tried Shazam in a long time) is that it displays lyrics for many songs, and is often able to synchronize those lyrics with where you are in the song.
I'd argue that Shazam doesn't have ads, rather it is an ad. You search for the song, then see links to buy it in Apple Music. You'll also see "subscribe to Apple Music" type widgets on just about every screen on the app.
Google raised it to another lvl: Now playing feature, so it constantly detects songs and will register them in a history log, and you can also search songs in google assistant by just humming (not working reliable but sometimes it nails it)
Shazam has the same feature, I went to parties almost 10 years ago with my phone in my pocket having Shazam in background detection mode. The result was a 90% complete playlist.
If anything it's gotten even more magical. I was blown away when I tried to find the song someone was singing on America’s Got Talent and the result it returned was the singer on AGT (they index tv shows!?).
Your TV is actually actively “shazaming” everything you watch. That’s one way ads are attributed to you. TV manufacturers sell that data, that’s one of the reasons TVs are so cheap now - the ad view data is the real money.
I haven’t seen a commercial in quite a long time, but for a while many years ago, Shazam was being used like an audio QR code. Commercials would tell you to use Shazam on their ad to get a deal or something. My guess is after Apple bought Shazam they stopped needing to do stuff like that to monetize.
Ah, I thought they did this to know what people are watching. Yes... see here:
> Alphonso's software uses the same technology that Shazam and similar services employ to automatically detect the song you're listening to. It samples small bits of audio, creating a digital "fingerprint" of it, and comparing it against a a database on their server to identify the show or movie. In fact, Alphonso's CEO says they have a deal with Shazam, and use their specific technology to do this. But this embedded software can even be listening even when your phone's screen is turned off and it's ostensibly idle.
I worked at Alphonso, and yes their tech also used small fingerprints made of small bits of audios. But they primarily used it in TV's to figure out what ads people are watching and then used that data for retargeting users on digital platforms.
There is also Chromaprint [1], which works slightly differently. It’s based on pitch change patterns instead of maxima in the spectrum. Chromaprint is used by AcoustID, which is a large open database that links audio fingerprints to MusicBrainz recordings. I find it astonishing how much music is in there despite having not nearly as much commercial backing as Shazam.
Doesn't Chromaprint have to compare the whole song? This is great for detecting duplicates, but Shazam's fingerprint design allows it to match a short snippet to the complete song.
Chromaprint computes “features” roughly 8 times per second. You can do a brute-force search checking different times in a song or potentially do some more fancy indexing once you have the features.
(I did some experiments with Chromaprint - described here, https://kenschutte.com/phingerprint/)
Cool experiment. I suspect your version would be far more permissive in matching than Shazam, which makes sense for your test case. Shazam's fingerprints are a lot more specific, e.g. they would differentiate different mixes of the same recording, potentially even different masters.
This is a great post that captures what a spectrogram does, and a must read for people who want to understand how audio fingerprinting works.
There are similar approximate algorithms available for other media as well, so anyone who wishes to understand real world hashing should take their time to study this article.
The normal spectrogram technique was already invented by Phillips prior to Shazam. What Shazam did was to hash things combinatorial to reduce false positives.
For what it's worth there is a phenomenal site that applies algorithmic matching not to songs but to genera classification and the branching sub generas that new song signatures introduce. An amazing resource run as a solo sidehussle and looks like it is at risk of getting clipped due to hosting issues or something. There was Music DNA from Pandora and something similar on LastFM back a long time ago but this site is like the visual connectome of all human music produced through to 2023 and would be a loss for the World Wide Web if it stops.....
I just want to say, it's remarkable how intuitive this is, and just how well it matches our own recognition process.
It's more-or-less identifying melody fragments*, and then just trying to match those up in a sequence. The same way we'll recognize something after 5 or 7 or 10 notes.
I'm pretty sure I've read about other methods for song fingerprinting that rely on things like loudness peaks, where it might work equally well, but that doesn't match how our own brains do it at all. It's pretty cool that this isn't relying on "artifacts" but basically works the same way we do.
* Technically not always melody, but probably is most of the time
Why are there so few Shazam alternatives? Does it have something to do with licensing perhaps? The algorithm itself is fascinating but I don't get why this space seems to have just one player - i.e. Shazam
Where's the value? My Android phone just does this locally, obviously Shazam has more storage and so they're going to handle more obscure stuff that way, but for example I just set my "Power of Love" playlist running, and the Pixel's built in "Now Playing" knows both the Frankie Goes To Hollywood track and the Huey Lewis number from Back to the Future.
When a "phone" was a dumb device just barely capable of implementing GSM and displaying a clock then this might be worth something as a business, but given where the $0 baseline is, I don't see enough margin to justify competition, I'm surprised even Shazam still makes commercial sense.
I disagree. Apple isn't like Google/FB where they take a loss on a service and make it back on the backend with ads. Apple seems like they evaluate each service as if it were a physical product ie it costs X and each service needs to stand on its own and make X + Y back.
I used to use SoundHound originally, but their Android app became so bloated that it took a long time to start it. As a result, I switched to Shazam and have not used SoundHound since.
It definitely has more than one player. Google Assistant has had this ability for a while, for example. But Shazam has the advantage of being built in to iOS, which might be why you think it’s the only player
I was a SoundHound user for a long time. It came out around the same time as Shazam. Shazam had all the brand recognition, but I typically went for the underdog.
Recently, in an effort to simply things, I moved over to Shazam. It’s owned by Apple now, so it’s already built into the iPhone, even without the app. The app allows for saving things a bit easier and I find it to be a lot cleaner than the SoundHound app.
Besides potential licese issues (that may not exist), legally creating the hashes database is a big effort as access to an near-all-encompassing song library is required.
I'd sure like a Shazam for ads with mute capability, something I've been thinking about building for some time now just don't see any road to profitability and not getting adblock blocked.
Once upon a time, back in Russia we had a service that captured most of FM radio stations and detected what was playing real-time as you listened from Moscow to some obscure station 2000 km away. Sadly it was all trampled by copyright idiots by about 2013.
But the technology, the capture boxes which were SDRs before SDRs were a thing, hashes, station bosses calling in the night because DJs got too drunk and went rogue live.. oh the memories..
This was a fascinating read, not only for understanding about how Shazam works which is something I’ve long been curious about, but also a great primer on digital signal processing.
What are the legal aspects of building a service like this?
New music is created every day. Can Shazam just buy MP3s at "normal prices" (non commercial) and use them commercially?
Also if they buy music to encode its signature, wouldnt that be very big part of their running costs?
What if someone makes a track and asks 100k USD for it? Will Shazam recognize it? I doubt they want to pay some ridiculous money just to recognize something.
It's like those AI backups that seem to use books for training. Did they pay for those books?
My hit rate for those 15-to-30-second snippets they play at the top of the hour on NPR is something like 10%. It's been getting worse and worse over the years.
I’m really interested in an implementation of this that adjusts for something like pitch. So it could tell when someone is mimicing a speaker, and could even grade them on how well they did. Or even a celebrity voice matcher that tells you which celebrity you sound most like. Does this exist?
I remember I heard about this technique being developed by a guy from my NZ university years before there was ever a commercial product called Shazam. Maybe I eve heard and interview with him on the radio. But I’ve never heard of him again..
Thank you for releasing this as open source under MIT license. I wonder how well it works on human speech. I have a few thousand hours of recorded word content that I need to deduplicate. If I get around to it, I'll report back.
I always knew this had something to do with time domain to frequency domain. And I used question to interview engineers and see how creative would they think. Glad to see this post.
Shazam is perhaps the most profitable music informatics technology of all time, yet it knows nothing about music at all! It’s basically just a fast hashing algorithm!
I don’t want to be combative, but this has simply never worked for me. No matter what I do Shazam has produced incorrect results. I wonder if I’m the only one.
That is very strange. Either you've got some kind of network bug or problem with your microphone, or you're looking up music so obscure it's not on Shazam. Or the music is just way too quiet, especially if there's a lot of other noise.
It's not just you. It's super hit-or-miss for me. Do you have an Android phone? I've read complaints that Shazam's accuracy dropped for them after Apple bought it.
Not necessarily all of your issue I'm sure but genre plays a large part in discovery. I find it has a hard time with less popular electronic and soundcloud type beats for instance.
Was in a live event few days ago and was wondering whether an attempt to recognizing live/noisy songs has been made. Shazam has failed me anytime I tried it for this.
This is a platform feature of Google assistant, I believe. I have a "search a song" on my Pixel, but not in airplane mode, so probably being done at the mothership.
https://www.wsj.com/video/series/in-depth-features/how-shaza...
Chris (Shazam co-founder)