BG SUB
BACKGROUND REMOVAL FOR A NEW MOBILE APP
![](https://freight.cargo.site/t/original/i/9703527731bf099186319f4c784434b27393f619f73cd7b809fe48f845654c4d/llama-slow.gif)
A collaboration with the fine folks at Daze to add background removal capabilities to their upcoming mobile app so that users can snap a picture and have the relevant part cut out.
![Input](https://freight.cargo.site/t/original/i/72b55db62e0f7fd8c59ef1da2cf22fac8c8683f6aaa726489e1fdc8244b56e32/lion-sketch.jpeg)
![Output](https://freight.cargo.site/t/original/i/fcacae88608fec4004f9c95711824eda3f662357c1b68f74019847b9a1480c0a/lion-sketch_u2net_output.png)
Our final on-device model allows users to get near-instant results (<200ms, compared to 1-3 seconds using an API). Daze saves time and money not having to maintain as much server infrastructure or pay for a third-party background removal API.
![Input](https://freight.cargo.site/t/original/i/b93c4ca3f69f3f1f8b37c65a7d167367040364f3fcbf354c08d26d24330c4247/guys-on-bleachers.jpg)
![Output](https://freight.cargo.site/t/original/i/37eb7fa3fa8e242b6742cd5374c28ff3ec8bb432e5a5ab479c822a353cb605da/guys-on-bleachers_u2net_output.png)
The process began with research of modern alpha matting and salient object models. With candidates selected, we created a prototype webapp that allowed us to upload images and compare the results of >10 different models and techniques.
![Early version of the model comparison app](https://freight.cargo.site/t/original/i/1b926ed58d6cb0c0a2101122ad083ab68aa6f6b44f4084990bf7b6bb038f5641/bg-sub-demo-early-blurred.gif)
![Test of an interactive segmentation model](https://freight.cargo.site/t/original/i/2749a419ea1c8ea46a33e68ba8a41334452c24dd3862018fb013e999ebbc5330/active-demo.gif)
After selecting the most promising, we gathered a custom dataset and trained a variation on that model that was tuned to balance size, speed, and quality. The final result was converted to mobile formats and delivered to Daze for incorporation into the app.