Show HN: I turned my face rec system into a video codec (vertigo.ai)

518 points by jacobgorm ↗ HN
Before the pandemic, my tiny startup was doing quite well selling Edge AI systems, based on our own lightweight AI inference engine, with object detection and face recognition for smart city and smart retail & food service applications.

When the real world shut down, there was suddenly nothing to monitor on streets and in restaurants, so I set out to try and evolve our real time face recognition system into a video codec for high quality face-to-face online interactions, as I was not satisfied with the quality of Zoom and friends. I got it to work, and the first release for IOS was just approved on Apple's app store, link: https://apps.apple.com/app/vertigo-focus/id1540073203

The way it works is that you create a meeting URL, which you can share out-of-band, for instance via slack or text message. You can also share as a QR code which the app can scan to join a call. You then place your device on a surface in front of you so that the front camera can see you, and it will recognize you face and assign you to your own session, which is broadcast to the meeting channel. If more than one person is in view, both of you will be broadcast but with separate session ids, like if you were on separate cameras. Other meeting participants will show up on your screen and you can start talking. It is optimized for eye contact, meaning that the eyes will actually make it through to the other side as more than just dark pixel clouds, so thinks should feel a bit more personal than the standard Zoom/Teams/or Google Meet call.

Because it uses face rec, you can ONLY show your face, and if you disappear from view your audio will stop after a while, to avoid situations like when you need to go the the restroom but forget to mute. This also solves dick-pics etc.

The CODEC is not based on H26[45], but is pure AI that runs on the GPU. There is a neural network that compresses the video in real time, and another one decompressing on the receiving end. Finding a tight network architecture that would do this in real time with acceptable quality was a major part of the effort. There are several quality settings possible, but right now it is set fairly high and for 20FPS maxes out around 700kbit/s, though typically uses about half. I've demonstrated good results down to around 200kbit/s, so in theory it should work over satellite links or even Bluetooth. The protocol is UDP with no congestion control but with (Wirehair) FEC to protect against mild packet loss, future versions will detect packet loss and adapt to available bandwidth.

The audio just uses OPUS and may click a little bit, I blame AudioEngine or the fact that the last time I wrote audio code was for the game I published for the Amiga in 1994.

If you don't have a friend around or multiple devices to play with, there is an "echo test" server mode that allows you to be in a meeting with yourself. Traffic will be peer-to-peer if possible, but otherwise you will be relaying through my tiny Raspberry PI server, so YMMV. I plan to try to switch to something like fly.io soon to improve scalability.

There is also a MacOS version coming very soon, and the underlying AI engine also runs on Windows & Linux. Android support is planned.

Please take a look and let me know what you think.

149 comments

[ 3.5 ms ] story [ 48.0 ms ] thread
Firstly, this is pretty awesome, love it. I have a few questions:

* I applaud the work to have it run on tiny-bandwidths, how hard would it be to up the frame-rate to 60?

* How well does "framing" work? Are you able to add flexible amounts of padding around the head or is very focussed on a face taking up the whole canvas?

* How much does it "cheat". Is it firing only feature-maps so if I have a spot on my chin does it loose it in translation?

* How did you build the face-recogniser? Is it bespoke or a library?

* Is there a testing framework? Does it work on diverse faces?

Thanks!

Wrt upping the frame rate the main problem is that the phone may run a bit hot, newer iPhones/iPads should be able to handle it just fine, but the older ones based on, say, the A10, might have trouble keeping up, especially with multiple remote parties connected.

* The framing depends on a transformation derived from the face landmarks, and the amount of padding is somewhat flexible. Distance from the camera seems to impact this, so it could be that my landmarks model needs some tweaking to work better when you are sitting very close to the camera.

* This is closer to being a general video codec than a face-generating GAN, so there is not a lot of "cheating" in that respect. It is optimized for transmission of faces, but other images will pass through if you let them (which I currently don't).

* I built the AI engine and the face recognizer etc from scratch, though with the help of a former co-founder who was originally the one training our models (in pytorch). The vertigo.ai home page has some demo videos. We initially targeted raspberry-pi style devices, NVIDIA Jetsons, etc., but have since ported to IOS and MacOS. Our initial customers were startups, mostly in the US, and a large Danish university that uses us for auditorium head counting.

* It empirically does seem to work on diverse faces, both in real life and when testing on for example the "coded bias" trailer. Ideally I would like to test more systematically on something like Facebook/Meta's "casual conversations" dataset.

for poor hardware a face generator with a set of mouth and eye states seems a good failback. It would be a huge difference if both hw and bw are bad.
>Danish university that uses us for auditorium head counting.

Just wait until you find out the Chinese have the same, but they train theirs for Uygher locating...

Yeah, these technologies are amazing, but also terrifying when viewed through the OBEY lens.

What are you saying, that the Danish are selling the technology on to the Chinese? As if the Chinese government didn’t already have massively deployed facial recognition tech?
Great work!

Also, where can I learn about your edge AI smart camera system?

https://vertigo.ai/sensoros/ has some info, but you probably read through that already. There is a public github repo, but I think it needs some explanation to be useful. You are welcome to ping me at jacob@vertigo.ai.
This looks very similar to nVidia's method. Vertigo's website says this is patented, does nVidia have prior art here?

https://developer.nvidia.com/ai-video-compression

NVIDIA's solution seems very expensive, using GANs. They synthesize more of the face, where ours is closer to learning a better general image codec by training on faces. I don't think they can run it on current generation edge/mobile devices. Also, our patent to the best of my knowledge does not overlap with theirs.
Curious if you were to compare this with standard webRtc and say Tensor Flow JS face landmark detection running against the mediastream, what is the difference?

edit: oh the "recognize your face" and compression I see (referring to Nvidia link someone else posted) wow

This is super cool. The UI on the app could do with a bit of work - it’s easy to use but the text in the buttons next to the QR code wrap and cut off.

The actual video works well. kudos!

What’s funny is I’ve had this very idea but no AI skills or extra time to pull it off. Bravo!!
That is where I started ~5 years ago :-) Thanks!
Really? Impressive! Can I ask how you went about learning it all then? Any books or online courses you can recommend?
I learned by joining an early AI startup with some co-founders who knew about old-school AI (but didn't believe in backprob!), and then reading absolutely every ML paper I could find, following AI hotshots on Twitter, reading the darknet source code, and experimenting with pytorch.

Eventually two of us left to start Vertigo.ai, and found a customer who would fund a fast object detector to run on a $18 Nano-PI. That was a fun challenge and forces me to think about how to make the AI run fast and with relatively low footprint.

Today fast.ai might be a good starting point, definitely recommend going with pytorch, cloning cool projects from github, and going from there.

Yet another example that having ideas is worth close to 0, while being able to execute on your own or others ideas is worth > 0 :)
Yes. It's weird and forced when people tell you that ideas are super powerful, there is a good book "Made to stick" which is really cool. There's a section where they look at JFK's "get to the moon and back safely" as the driving force behind the whole thing. Thousands or millions before him, had the same idea, even the URSS was planning a trip. Even the travel is portrayed in a highly popular 1902 film. What set apart the moon landing of 1969 (by USA) was the execution.
I bit my tongue off at one point in my life (jumped from a high height and my knee hit my chin as I was screaming). The fact that it captures most of the details of the scar where it was reattached is phenomenal. Majorly impressed.

There’s some weird banding/rainbow effects around my glasses and the background (not on my face), but that’s the only major artifact that stood out to me.

Thanks!

Glasses are sometimes a little bit of a problem, I don't have enough of those in my training sets.

I mean the obvious question here is... how many BIPOC (Black, Indigenous, People of Colour) do you have in your training sets?
Nah, it's "how many Black, Indigenous, People of Colour do you have who wear glasses and have facial scars from having fallen from a great height while screaming?". If you can't find enough preëxisting BIPOCWWGAHFSFHFFAGHWS people, I suppose you're limited to finding other BIPOC people, giving them glasses, and throwing them from a great height. (Manufacturing them the other way around might be too offensive.)
My question was unironic, because to date there have been a large amount of issues resulting from black people using e.g. Zoom's autobackground, and it detecting them as the background, because black people were not featured in the training sets or considered when the AI was being constructed.

Likewise, many cameras do not properly pick up the skin tone of black, indigenous, people of colour. This is partly because of technological limits with respect to the number of F-stops available in commercial cameras. But also because there is a wide variety of human skin tones existing in the world, and camera manufacturers do not test for a majority of them.

Perhaps these papers speak louder for me, given that Hacker News only accepts neoliberal anecdotes :)

"Until recently, due to a light-skin bias embedded in colour film stock emulsions and digital camera design, the rendering of non-Caucasian skin tones was highly deficient and required the development of compensatory practices and technology improvements to redress its shortcomings"

https://cjc-online.ca/index.php/journal/article/view/2196/30...

"For a fixed decision threshold, the African-American image cohort has a higher false match rate and a lower false non-match rate. "

https://arxiv.org/abs/1904.07325

" The Gender Shades project revealed discrepancies in the classification accuracy of face recognition technologies for different skin tones and sexes. These algorithms consistently demonstrated the poorest accuracy for darker-skinned females and the highest for lighter-skinned males."

https://sitn.hms.harvard.edu/flash/2020/racial-discriminatio...

https://sitn.hms.harvard.edu/flash/2020/racial-discriminatio...

Ah, I see. Well diagnosed, by the way - I did indeed think you were being ironic, and was going along with the joke, as opposed to being antagonistic in the knowledge you were being sincere.

To respond in sincere mode: while I don’t think it’s terribly important whether black people are rendered correctly by some Zoom feature, nevertheless including a reasonable number of black people in one’s training data sounds like it shouldn’t require any extra effort, and so I think it’s a reasonable enough point to make.

Does it have any interesting "nonlinear" effects where it can show an entirely different face (the wrong face) based on misidentification or even adversary input?

These kinds of failure modes for "AI" are the most interesting to me.

It seems extremely smart - but don’t you think that to have success in a mass market product - think like MS Teams - it would need to be a combined solution. Where it both can do this for faces, efficiently, but also continues to work in a predictable way if I want to show an item/page from a book/my cat/my kid to other people in the call?

also, what if you want to share dicks? It would be creepy if they all had eyes. There should be a mode for that where you drop into jitsi space
Good lord. If it does, don't ever mention it to anyone on chatroulette. It's bad enough without that horror.
It will not show another person's face, it does not (yet ;) possess that level of understanding of the image contents.

Yes I agree I have to work more on the business side of things, definitely on the lookup for for a business-savvy co-founder, hints at potential companies to partner with, etc.!

impressive-very-nice.gif

This is just a phenomenal idea - I hope your patent is approved too!

This is an amazing idea and I can't wait to try it. Just one question...

>> This also solves dick-pics etc.

Is this a problem on zoom meetings, for people other than Jeffrey Toobin?

Maybe not on Zoom but I’ll bet it is on FaceTime and Messenger video chats.
> is a new from-the-ground-up patent pending

What is the invention? The models are just complex mathematical formulas and these cannot be patented.

The patent that I filed is not around the models, but in how it boosts the parts of the face most relevant to face-to-face conversations.

I am not a super fan of patents, but for background please consider that Asger Jensen and I could have patented VM live migration in 2002 and chose not to for idealistic reasons, just to see VMware do it.

Would be interesting if a foundation with a charter could own a a patent, to prevent later trolling.
If that were the case, Google would not own a patent on PageRank and we wouldn't have to bother with open source audio/video codecs.
> Google would not own a patent on PageRank

Well, in my country they actually don't. YMMV as per one's location.

Well done on creating a useful codec. One specifically optimised for face data seems apropos the emerging demand for more intimate remote interaction. Many teachers, therapists, doctors and social workers who conduct remote sessions rely on clear non-verbal signalling and need to read affect.

But the story has a deeper meaning for me (because of the book I am writing). You switched from street face surveillance (an arguably highly unethical application) to more intimate videoconferencing (a more humanistic and socially beneficial end).

May I ask you in all sincerity, what if any ethical considerations played a part in your change of direction?

I suspected from the title to read at least some sub-text that you turned your back on mass-surveillance to find a "better" use for your work. But you express no value judgements and only really mention that the pandemic took away potential targets.

The ethical considerations played a large part of the pivot. I would rather help people communicate than surveil them.

That said, we build embeddable/edge face rec because we could, and I believe our partners who used it in the real pre-pandemic world found some very innocuous uses for it. In one case we replaced a system running all the faces through Rekognition with one running purely on devices and not storing any long-term data, which I think was an ethics win overall.

> You switched from street face surveillance (an arguably highly unethical application) to more intimate videoconferencing (a more humanistic and socially beneficial end).

Or that makes it easier to identify individuals as they give consent to have their face ‘fingerprinted’ as part of the app’s EULA.

If I were going to sell a mass-surveillance solution I’d certainly want to have the ability to identify individuals without having to scrape all of Facebook or whatever. As much as people hate on apple they do make it so carrying around one of their phones doesn’t make it easy for someone to identify you.

I, for one, would think twice about installing an app from someone who “pivoted away” from their Orwellian surveillance unicorn dreams.

Hi, we don't collect any data from the app, and have filled in the privacy etc. statements on the App Store accordingly.

Ideally I would like to collect faces to train the compression on, in which case we would have to consult with lawyers to come up with an EULA allowing us to do this. The advantage compared to using broadly available datasets to train on would be more realistic shot noise, low light images, and so on. I don't see any other valid business purpose of collecting people's faces.

We've been sitting on the face recognition tech since 2018, so if we'd wanted to become Clearview.ai we probably would have a long time ago.

> We've been sitting on the face recognition tech since 2018, so if we'd wanted to become Clearview.ai we probably would have a long time ago.

It says right at the beginning of the post you were doing quite well until the pandemic shut down businesses.

I try not to be overly critical (I really do) but this is one of those cases I just can’t help myself, I see no reason individual businesses should be running facial recognition on their customers and am kind of wary of someone who would enable that. And cities adding it to their collection of public cameras is beyond wrong.

IDK, somewhere we, as a society, decided 1984 was an instruction manual and not a warning…

There is a difference between doing well and becoming China in terms of surveillance. Most of our revenue were from just plain head counting and from tracking cars in a smart city project.

The one face rec system we actually sold was used to measure waiting times in a retail setting, and replaced an existing system that was using AWS Rekognition in the same manner, except with all the video footage going to the cloud. That license has long expired and the system is no longer running.

In any case, what is stated in the app's privacy statement is what we are doing. At the moment I don't even collect the IP addresses of users connecting.

Thanks for your honest answers Jacob, and the good spirit to do so in public. This kind of discussion really helps with the topics I am researching (and btw if I mention this or anyone else from HN in the text it will always be in a non-identifying way). Good luck with your project.
Very cool. Out of curiosity, why is the H.265 size slightly more than the H.264 size? How does the compute complexity for encoding and decoding compare with those two codecs?
I got these results by using Vertigo's bitrate as the target, and squeezing the other ones until they got as close as possible to that. H265 is in general better than H264, but when you put the thumbscrews on it seems to get itself into a bit of trouble.

Wrt encoding/decoding complexity this is the major bottleneck, because you have the GPU competing with custom ASICs. I have a version of the codec that works in combination with H265, but still gets largish bandwidth gains, so if all you wanted was an insane hi-res and hi-bitrate transmissions that might be the way to go near-term.

WOW. This is amazing. I really believe your project can be game changing for the video-call industry.

Have you considered entering into the YC Program? I think it could be an awesome match. There are many startups I know they may want to take use of your service, and even fly.io is part of YC family!

Also, have you thought about open-sourcing it? (perhaps using a dual license could work great for an enterprise offering)

Thanks!

I tried entering YC in the fall 2021 batch, and got to the top 10%. I believe my main problem wrt YC is that I currently lack a co-founder, so I did not apply in the Spring as this was still the case.

I am seriously thinking about open source, I believe for instance WebRTC found a good model with dual-licensing, where you have something like AGPL with the option of buying exceptions.

I have had multiple advisors telling me not to though, they fear it would scare away any potential investors ;)

I entered YC as a solo-founder with Wasmer, so I think it might just be a circumstantial thing (they receive a lot of applications so it's always hard to judge who should enter with the limited time and data they have to make a decision). I would really encourage you to apply again!

In any case I'd love to help you on both aspects (YC application and OSS), I believe your idea has really great potential. Please ping me to syrus@wasmer.io and we can schedule some time to chat!

Very interesting! I’m getting more like 400-600 kbit/s, maybe too much beard and long hair.

The face boxing seems very aggressive, I feel like I’m trapped in the virtual prison of some 90s dr who episode.

Try moving a bit further away from the camera, and placing the device on a steady surface. It might help.
Really cool idea. Unfortunately I can't try it because app crashes for me. I'm guessing it's because of the HN crowd
From another comment:

> The rooms are hosted on a Raspberry Pi 3 lying on the floor of my office.

Hah, probably :D

This looks awesome. Looking forward to a non-Apple version to try it out myself. Great idea to solve some of the issues of video conferences. I assume it also upscales people when they move away further from the camera, as some sort of welcome side effect. So you only need to be close to the camera once and then make yourself more comfortable a little farther away, or even with suboptimal lighting.

One thing that struck me as odd on the page is that the H265 still looks considerably worse than H264, despite being the better codec and being larger. What's up with that?

In general, H265 is better than H264, but when you really squeeze it it seems to fall over its own feet. This is measured against ffmpeg's x265 implementation, the hardware-accelerated version on the iPhone will just refuse to go down to that bitrate.
> Because it uses face rec, you can ONLY show your face, and if you disappear from view your audio will stop after a while, to avoid situations like when you need to go the the restroom but forget to mute. This also solves dick-pics etc.

Who would have thought anti dick pic technology would become a product feature but here we are in 2022.

Didn't take a look yet but will, very cool. Where are the meetings rooms hosted?
The rooms are hosted on a Raspberry Pi 3 lying on the floor of my office. With the traffic it seems to be getting I will move it to a cloud server soonish.

It should do peer-to-peer for the majority of connections though, the server just does the initial hand-shake.

This reminds me of an idea I had about 15 years ago but never pursued. The concept was using basic object detection as an input as a first pass to to a standard video codec to guide where it should spend it's data budget. So, for example, a TV news broadcast could put more details on the host's eyes and mouth while a parking garage camera would be trained to get clearer number plates.
(comment deleted)
Awesome!

A thought: now that neural compression is becoming widespread, it could be a good idea to put some kind of indicator or watermark stating the compression is neural (learned/function approximation in general). I think this would avoid liabilities and criticism around the fact that some weird things may appear (incorrect detail generation), maybe giving a wrong semantic idea. It may also be a good idea to put a mean squared error term in your objective function to help preserve general meaning.

> incorrect detail generation

Absolutely. Reminds me of Xerox number mangling:

https://www.dkriesel.com/en/blog/2013/0802_xerox-workcentres...

Interesting, and it may also indicate a way to address this issue with learning.

For example, you could train a network to give semantic image descriptions of significant features in the image, and maybe also transcribe text. Then you can include semantic preservation in the objective, or some kind of graceful degradation when semantic preservation isn't achieved.

> put some kind of indicator or watermark stating the compression is neural

That ship has sailed.

Smartphone cameras and laptop webcams already use machine learning algos to improve low light performance and noise. The result is that the images already contain details that are generated.

And it's impossible to turn off.