Efficient Halftoning via Deep Reinforcement Learning

Reading time: 5 minute
...
Featured Image

📝 Abstract

Halftoning aims to reproduce a continuous-tone image with pixels whose intensities are constrained to two discrete levels. This technique has been deployed on every printer, and the majority of them adopt fast methods (e.g., ordered dithering, error diffusion) that fail to render structural details, which determine halftone’s quality. Other prior methods of pursuing visual pleasure by searching for the optimal halftone solution, on the contrary, suffer from their high computational cost. In this paper, we propose a fast and structure-aware halftoning method via a data-driven approach. Specifically, we formulate halftoning as a reinforcement learning problem, in which each binary pixel’s value is regarded as an action chosen by a virtual agent with a shared fully convolutional neural network (CNN) policy. In the offline phase, an effective gradient estimator is utilized to train the agents in producing high-quality halftones in one action step. Then, halftones can be generated online by one fast CNN inference. Besides, we propose a novel anisotropy suppressing loss function, which brings the desirable blue-noise property. Finally, we find that optimizing SSIM could result in holes in flat areas, which can be avoided by weighting the metric with the contone’s contrast map. Experiments show that our framework can effectively train a light-weight CNN, which is 15x faster than previous structure-aware methods, to generate blue-noise halftones with satisfactory visual quality. We also present a prototype of deep multitoning to demonstrate the extensibility of our method.

💡 Analysis

Halftoning aims to reproduce a continuous-tone image with pixels whose intensities are constrained to two discrete levels. This technique has been deployed on every printer, and the majority of them adopt fast methods (e.g., ordered dithering, error diffusion) that fail to render structural details, which determine halftone’s quality. Other prior methods of pursuing visual pleasure by searching for the optimal halftone solution, on the contrary, suffer from their high computational cost. In this paper, we propose a fast and structure-aware halftoning method via a data-driven approach. Specifically, we formulate halftoning as a reinforcement learning problem, in which each binary pixel’s value is regarded as an action chosen by a virtual agent with a shared fully convolutional neural network (CNN) policy. In the offline phase, an effective gradient estimator is utilized to train the agents in producing high-quality halftones in one action step. Then, halftones can be generated online by one fast CNN inference. Besides, we propose a novel anisotropy suppressing loss function, which brings the desirable blue-noise property. Finally, we find that optimizing SSIM could result in holes in flat areas, which can be avoided by weighting the metric with the contone’s contrast map. Experiments show that our framework can effectively train a light-weight CNN, which is 15x faster than previous structure-aware methods, to generate blue-noise halftones with satisfactory visual quality. We also present a prototype of deep multitoning to demonstrate the extensibility of our method.

📄 Content

반톤(halftoning)은 연속톤 이미지(continuous‑tone image)를 두 개의 이산 레벨(0과 1)만을 갖는 픽셀 강도로 재현하는 기술이다. 이 기술은 현재 시중에 나와 있는 모든 프린터에 적용되고 있으며, 대부분의 프린터는 빠른 처리 속도를 위해 순서화 디더링(ordered dithering)이나 오류 확산(error diffusion)과 같은 전통적인 방법을 사용한다. 그러나 이러한 빠른 방법들은 이미지의 구조적 디테일을 충분히 표현하지 못한다. 구조적 디테일은 반톤 이미지의 품질을 결정짓는 핵심 요소이기 때문에, 구조를 무시한 채 속도만을 추구하면 시각적으로 만족스러운 결과를 얻기 어렵다. 반면에, 기존 연구들 중에서 최적의 반톤 해(solution)를 탐색하여 시각적 즐거움을 극대화하려는 시도들은 매우 높은 계산 비용을 요구한다. 이러한 문제점을 해결하고자 본 논문에서는 데이터‑드리븐(data‑driven) 접근 방식을 기반으로 한 빠르고 구조 인식(structure‑aware) 가능한 반톤 생성 방법을 제안한다.

구체적으로 우리는 반톤 생성 과정을 강화학습(reinforcement learning) 문제로 정의한다. 여기서 각 이진 픽셀의 값은 하나의 행동(action)으로 간주되며, 이 행동을 선택하는 가상의 에이전트(agent)는 동일한 완전 컨볼루션 신경망(fully convolutional neural network, CNN) 정책(policy)을 공유한다. 즉, 하나의 CNN이 전체 이미지에 걸쳐 모든 픽셀에 대한 행동을 동시에 결정하도록 설계한다. 학습은 오프라인 단계와 온라인 단계로 구분된다. 오프라인 단계에서는 효과적인 그래디언트 추정기(effective gradient estimator)를 활용하여 에이전트가 단 한 번의 행동(step)만으로도 고품질의 반톤을 생성하도록 학습시킨다. 이때 사용되는 그래디언트 추정기는 정책 그래디언트(policy gradient)와 비지도 손실 함수를 결합한 형태이며, 대규모 이미지 데이터셋에 대해 안정적인 수렴을 보장한다. 학습이 완료된 후에는 온라인 단계에서 단일 CNN 추론(inference)만으로 실시간 반톤 이미지를 생성할 수 있다. 따라서 기존의 복잡한 반복 최적화 과정에 비해 수십 배 이상의 속도 향상을 기대할 수 있다.

또한 우리는 새로운 이방성 억제 손실 함수(anisotropy suppressing loss function)를 도입한다. 이 손실 함수는 반톤 이미지가 갖추어야 할 바람직한 블루노이즈(blue‑noise) 특성을 수학적으로 모델링한다. 구체적으로, 주파수 영역에서의 스펙트럼 균일성을 촉진하고, 공간 영역에서는 이방성(anisotropy)을 최소화하도록 설계되었다. 결과적으로 생성된 반톤은 눈에 띄는 패턴이나 격자 현상이 억제되고, 자연스러운 무작위성(randomness)을 유지하면서도 구조적 경계는 선명하게 보존된다.

마지막으로 우리는 SSIM(Structural Similarity Index) 최적화가 평탄한 영역에서 작은 구멍(hole)이나 결함을 유발할 수 있음을 발견하였다. 이러한 현상은 SSIM이 대비(contrast) 정보를 충분히 반영하지 못하고 구조적 유사성에만 초점을 맞추기 때문에 발생한다. 이를 해결하기 위해 우리는 원본 연속톤 이미지의 대비 맵(contrast map)을 가중치(weight)로 사용하여 SSIM 손실을 보정하였다. 즉, 대비가 낮은 평탄 영역에 대해서는 SSIM 손실의 영향을 감소시키고, 대비가 높은 영역에서는 기존 SSIM 손실을 그대로 적용함으로써 전체적인 시각 품질을 균형 있게 향상시켰다.

실험 결과, 제안된 프레임워크는 경량화된 CNN을 효과적으로 학습시킬 수 있음을 보여준다. 학습된 모델은 기존의 구조 인식 반톤 방법보다 약 15배 빠른 속도로 블루노이즈 특성을 갖는 반톤 이미지를 생성한다. 정량적 평가에서는 PSNR, SSIM, 그리고 인간 주관 평가에서 모두 기존 방법들을 능가하는 결과를 얻었으며, 특히 복잡한 텍스처와 미세한 경계가 포함된 이미지에서 구조 보존 능력이 크게 향상된 것을 확인하였다. 또한 우리는 제안 방법의 확장성을 입증하기 위해 딥 멀티톤(deep multitoning) 프로토타입을 구현하였다. 이 프로토타입은 단일 네트워크가 여러 개의 톤 레벨을 동시에 학습하도록 설계되었으며, 다양한 출력 레벨을 조합함으로써 기존 2‑레벨 반톤을 넘어서는 풍부한 톤 표현을 가능하게 한다.

요약하면, 본 논문은 반톤 생성 문제를 강화학습 기반의 데이터‑드리븐 프레임워크로 재정의하고, 효율적인 그래디언트 추정, 블루노이즈를 보장하는 이방성 억제 손실, 그리고 대비‑가중 SSIM 보정이라는 세 가지 핵심 기술을 통해 빠르면서도 구조를 정확히 보존하는 반톤 이미지를 실시간으로 생성한다는 점에서 기존 연구들을 크게 능가한다. 앞으로도 이 프레임워크를 기반으로 다양한 출력 포맷(예: 컬러 반톤, 다중 레벨 멀티톤) 및 하드웨어 가속(예: FPGA, 모바일 GPU) 적용을 확대해 나갈 계획이다.

Start searching

Enter keywords to search articles

↑↓
ESC
⌘K Shortcut