Skip to main content
QUICK REVIEW

[Paper Review] Real-time Hair Segmentation and Recoloring on Mobile GPUs

Andrei Tkachenka, Gregory Karpiak|arXiv (Cornell University)|Jul 15, 2019
Image Enhancement TechniquesComputer Science4 references8 citations
TL;DR

This paper presents a lightweight, real-time neural network for mobile GPU-based hair segmentation and realistic recoloring, using a 4-channel input (RGB + previous frame mask) to ensure temporal consistency. The method achieves 81.0% IOU and 30–100+ FPS on mobile devices, enabling high-fidelity AR hair effects deployed at scale in production applications.

ABSTRACT

We present a novel approach for neural network-based hair segmentation from a single camera input specifically designed for real-time, mobile application. Our relatively small neural network produces a high-quality hair segmentation mask that is well suited for AR effects, e.g. virtual hair recoloring. The proposed model achieves real-time inference speed on mobile GPUs (30-100+ FPS, depending on the device) with high accuracy. We also propose a very realistic hair recoloring scheme. Our method has been deployed in major AR application and is used by millions of users.

Motivation & Objective

  • To enable real-time, high-quality hair segmentation on mobile GPUs for AR applications without depth sensors or green screens.
  • To ensure temporal consistency in segmentation masks across video frames using a lightweight, GPU-optimized inference pipeline.
  • To develop a realistic, automated hair recoloring technique that adapts to varying hair colors and lighting conditions.
  • To design a mobile-friendly model that runs at 30+ FPS on diverse devices while maintaining high accuracy.
  • To deploy a scalable, production-ready solution for virtual hair coloring in consumer AR applications.

Proposed method

  • The model uses a 4-channel input combining RGB image and the previous frame's segmentation mask to enforce temporal consistency.
  • A modified hourglass architecture with large-stride convolutions and skip connections improves speed and accuracy, achieving 5% IOU gain over baseline.
  • E-Net bottlenecks are aggressively compressed (factor of 16–32) without significant quality loss, enhancing inference speed.
  • DenseNet-like layers are added at full resolution to refine edge details, improving perceptual quality by 0.5% IOU.
  • A two-step recoloring pipeline uses reference LUTs for light and dark hair, interpolating based on input image’s average hair intensity for realistic colorization.
  • End-to-end GPU acceleration is used via TFLite GPU, with custom shaders for intensity calculation and LUT application.

Experimental results

Research questions

  • RQ1Can a lightweight neural network achieve high-accuracy hair segmentation in real time on mobile GPUs?
  • RQ2How can temporal consistency be maintained in video segmentation without using LSTMs or depth sensors?
  • RQ3What is the optimal architecture and training strategy for real-time mobile inference with minimal latency and high IOU?
  • RQ4Can automated, realistic hair recoloring be achieved across diverse hair colors and lighting conditions?
  • RQ5How effective is the use of prior segmentation masks as input context for improving frame-to-frame consistency?

Key findings

  • The model achieves 81.0% IOU on full-size (512×512) inputs, with inference times of 5.7ms on iPhone XS and 19ms on Pixel 3.
  • The small model variant (256×256) reaches 80.2% IOU with only 1.9ms inference time on iPhone XS, enabling 100+ FPS performance.
  • The addition of skip connections improves IOU by 5% compared to a baseline without them.
  • The use of DenseNet-style layers at full resolution increases perceptual quality despite only a 0.5% IOU gain.
  • The LUT-based recoloring method enables consistent, realistic hair color changes across diverse hair tones and lighting conditions.
  • The system is deployed in production AR applications and used by millions of users, demonstrating scalability and real-world robustness.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.