StegaStamp: Invisible Hyperlinks in Physical Photographs

Inc Lomin's avatar
May 16, 2019
StegaStamp: Invisible Hyperlinks in Physical Photographs
 
QR는 결제(알리페이 등), AR 뿐만 아니라 다양한 분야에서 사용되고 있습니다. 하지만 QR코드는 QR코드임이 분명하게 보인다는 장점과 함께 미관상 좋지 않은 단점도 가지고 있습니다. 이러한 문제를 해결하기 위해서 딥러닝을 활용해 정보를 이미지에 입히는 기술입니다.
 

Introduction

 
 
어떤 사진에 QR code를 보이지 않게 숨겨두는 방법을 만들고자 합니다. 이 논문은 이 방법을 위해서 아키텍쳐, 알고리즘 그리고 프로토타입을 제작하였습니다.
steganographic(암호 메시지) 알고리즘은 통해서 hyperlink bit string을 사진에 사람은 인식할 수 없도록 숨겨둘 수 있습니다.
 
stegastamp는 space distortion이나 printing로 부터 robust한 encoding/decoding을 학습한 Deep neural network로 구성됩니다. 그리고 이를 다양한 환경에서 real-time으로 이를 인식할 수 있습니다.
prototype은 error correction을 거쳐 56bits의 hyperlink를 robust하게 얻어낼 수 있습니다.
 
이 방식은 세 가지의 잠재적 활용처가 있습니다.(QR코드의 활용예시와 유사합니다.)
  1. 시장에서 사진에 가격 뿐만 아니라 원산지, 영양정보, 레시피 등을 연동하여 가져올 수 있습니다.
  1. 대학교의 로비에 교수 사진에 해당 교수의 webpage를 연동할 수 있습니다.
  1. 뉴욕 타임즈 스퀘어의 전광판에 URL을 encode하여 내보냅니다.
 
전체적인 구조는 아래와 같습니다.
  1. URL shortening service를 이용하여 hyperlink을 bit string으로 만듭니다.
  1. StegaStamp encoder를 이용하여 bit string을 target image에 encode합니다.
      • 이때 image는 사람이 보기에 동일해야 합니다.
  1. 이를 print하고 사진을 찍습니다.
  1. image detector로 crop을 합니다.
  1. StegaStamp decoder는 unique bitstring을 추출합니다.
  1. bitstring으로부터 hyperlink를 얻어냅니다.
notion image
 
기술적으로 달성한 것은 다음 두가지입니다.
  1. physical transmission(printing, displaying 등)을 거친 사진에서 95%의 정확도로 encoded bit를 추출할 수 있었습니다.
      • 이전 HiDDeN과 달리 physical transmission에 대비합니다.
  1. 고품질의 이미지를 어떻게 유지할 수 있는지를 보여줍니다. 100bits를 encode하면서 perceptual image quality를 유지할 수 있습니다.
 
 

Proposed Method

1. Training for Real World Robustness

 
학습과정에서 아래와 같은 augmentation의 조합을 적용하였습니다. 이전에는 robust adversarial example을 합성하기 위해서 classification network를 사용하였습니다. 이러한 방법은 transformation의 조합에 한정될 수 밖에 없습니다.
  • HiD-DeN은 nonspatial perturbation만이 적용되었습니다.
  • Deep ChArUco는 spatial과 nonspatial이 모두 적용되었습니다.
notion image
 
1.1 Perspective Warp
pinhole camera모델로 가정하고 동일한 평면을 찍의 homography인 두개의 이미지가 있다고 가정합니다. random homography를 만들어 카메라가 image marker에 정확하게 align이 되지 않을 때의 효과를 구현합니다. homographies의 공간을 얻기 위해서 image marker의 끝 네개의 점을 +- 40 pixel로 random하게 변경한 하였습니다.
 
1.2 Motion and Defocus Blur
motion blur는 카메라에서 motion과 autofocus가 잘못 적용되었을 때 나타납니다. 이를 위해서 radom angle로 sample한 후에 3~7 pixel 굵기의 직선 blur kernel을 만들어 적용합니다. misfocus로는 gaussian blur kernel을 1~3 pixel로 적용합니다.
 
1.3 Noise
카메라 시스템으로 부터 photon noise, dark noise, shot noise등을 도입했습니다. (ref) Gaussian noise를 도입하여 사용했습니다. ink를 섞음으로서 low pass filter 역할을 하게되어 Printing은 심각한 pixel wise noise를 주지 않습니다.
 
1.4 Color Manipulation
Printer와 display는 전체 RGB color space에 비해 한정된 범위를 가지고 있습니다. 카메라는 exposure setting, white balance, color correction matrix등을 변경하여 output을 조정합니다. 다음의 변형들을 random affine color transformation으로 가정하였습니다.
 
  1. Hue shift: RGB channel 각각에 random color offset을 [-0.1, 0.1] 사이로 더합니다.
  1. Desaturation: 랜덤하게 RGB image와 gray scale image 간에 linearly interpolation합니다.
  1. Brightness와 contrast: affine histogram rescaling mx+b를 거칩니다. b ~ U[-0.3, 0.3] m~U[0.5, 1.5]
이 transformation을 거친 후 color channel은 다시 [0,1]로 clip합니다.
 
1.5 JPEG Compression
카메라 이미지는 JPEG과 같이 정보가 손실이 되는 format으로 저장합니다. JPEG은 이미지 내에서 8x8 block에 대해 discrete cosine transformation을 계산한 후 quantizing을 통해 rounding하여 이미지를 압축합니다. rounding은 differentiable하지 않습니다. 때문에 approximating quantization step을 아래와 같이 변경하여 사용합니다. JPEG quality는 [50, 100]으로 적용하였습니다.
notion image
 

2. Implementation Details

2.1 Encoder
U-Net style의 architecture를 사용하였고 400 x 400 pixel을 input으로 받습니다. (RGB channel과 message channel이 합쳐진 input입니다.) output은 RGB residual image입니다.
 
Input message은 100bit binary string입니다. 이는 fully connected layer를 거쳐 50x50x3 tensor에 연결됩니다. 이후 upsampling을 통해서 400x400x3 tensor로 만들어 집니다. 모델에 message를 입력하기 위해서 전처리를 함으로서 수렴에 도움이 됩니다.
 
Encoded image에서 perceptual distortion을 최소화하기 위해서 L2 loss중 LPIPS perceptual Loss를 사용했습니다.
 
notion image
 
2.2 Decoder
Decoder는 encoded image 내의 hidden message를 복원하기 위해 학습된 네트워크 입니다. perspective transformation에 robust하고 rectifying을 하기위해서 Spatial Transformer Networks를 사용하였습니다. transform된 이미지는 convolution layer와 dense layer 그리고 sigmoid를 거쳐 message와 같은 길이의 output을 만듭니다. decoder는 cross entropy를 사용하여 학습됩니다.
 
2.3 Detector
실생활에서 사용하기 위해서는 StegaStamp을 detect하고 rectify하는 과정이 필요합니다. semantic segmentation network인 BiSeNet을 fine-tuning하여 StegaStamp가 있는 area를 segment하도록 학습했습니다. DIV2K에서 sample된 고화질 이미지에 랜덤하게 변형한 StegaStamp를 embeded하여 학습에 사용하였습니다. Test시에는 각 제안된 영역의 convex hull에 fit한 quadrangle을 얻어내고 400x400 pixel의 square에 맞도록 homography warp를 적용합니다.
 
 
2.4 Encoder/Decoder Training Procedure
  • Training data
MIRFLICKR dataset을 랜덤하게 샘플링된 binary message와 결합하여 사용합니다.
 
  • Critic
total loss의 일부로서 message가 encode된 이미지인지 판별하는 Critic network를 사용하였습니다. 이는 encode, decode pipeline에서 perceptual loss로서 사용되었습니다. 이 네트워크는 Convolution layer로 구성되고 마지막에 max pooling layer가 붙습니다. Critic network를 학습하기 위해서 Wasserstein loss가 classification에 대해 사용되었습니다.
 
  • Loss Weighting
    • - L_R: residual loss
      - L_P: perceptual loss
      - L_C: Critic Loss
      - L_M: entropy message
네트워크를 학습하면서 아래의 세가지 loss function 조정이 수렴에 도움됬습니다.
  1. R,P,C image loss weight는 처음에는 0으로 setting한 후에 decoder가 높은 accuracy로 학습된 후에 선형적으로 올려야 합니다.
  1. 이미지의 pertubation 강도는 0에서 시작해야합니다. perspective warping은 perturbation에 민감하므로 천천히 올려야 합니다.
  1. 모델이 이미지 edge 주변에 패턴을 추가하도록 학습되게 됩니다. 이를 방지하기 위해서 edge의 L2 loss weight를 증가시켰습니다.
 

Experiment

이 시스템을 real-world와 displaying image pipeline 모두에서 시험해보았습니다. 이를 통해서 message를 제어할 수 없는 실내외 환경에서 message를 복구할 수 있음을 볼 수 있습니다.
real word에서 조정할 수 있는 setting을 6가지 다른 display, printer와 3가지 다른 camera를 조합하여 18가지 조합에 대해 평가했습니다. 1890장의 captured image에 대해서 98.7%의 mean bit-accuracy를 달성하였습니다.
 
1 In-the-Wild Robustness
다양한 환경에서 휴대폰 카메라를 손으로 잡고 video capture를 하여 시험을 진행했습니다.
56bit message를 BCH error correcting codes를 통해서 완벽하게 복원합니다. 실제로 bouding box rectangular detection accuracy와 decoding accuracy는 높았습니다. 하지만 가끔 비디오에서 detector가 StegaStamp를 놓치는 경우가 있었습니다.
notion image
notion image
 
2 Controlled Real World Experiments
synthetic data에서 학습한 후에 real data에서 generalize됨을 보여주기 위해서 real enviroment에 대해 실험을 했습니다. ImageNet에서 100장을 random으로 뽑은 후 random한 100bit message를 각 이미지에 embed하였습니다. 그리고 100장 중 5장을 더 뽑아서 다른 message를 넣어 총 105장의 test set을 만들었습니다. darkroom에서 제한된 조명인 환경에서 실험을 하였습니다. 인쇄된 이미지와 카메라는 고정된 후에 사용되었습니다. 촬영된 사진은 손으로 crop한 후 rectified된 후 decoder에 입력됩니다.
 
  • Printer
      1. consumer printer (HP LaserJet Pro M281fdw)
      1. enterprise printer(HP LaserJet Enterprise CP4025)
      1. commercial printer(Xerox 700i Digital Color Press)
  • Monitor
      1. matte 1080p monitor(Dell ST2410)
      1. glossy high DPI laptop screen(Macbook Pro 15 inch)
      1. OLED cellphone screen(iPhone X)
  • camera
      1. HD webcam (Logitech C920)
      2. cellphone camera (Google Pixel 3)
      3. DSLR camera (Canon 5D Mark II)
 
105장의 사진은 위의 18가지 조합으로 촬영되었습니다. 그에 따른 결과는 다음과 같습니다. 전체 1890장의 이미지에 대한 정확도는 98.7%를 보였습니다.
notion image
 
 
3 Ablation Tests
image perturbation에 따른 효과를 확인하기 위해서 base 모델과 다르게 학습된 3개의 모델을 비교했습니다.
  • no perturbation
  • only pixel-wise perturbation
  • only spatial perturbation
 
perturbation ablation study
perturbation ablation study
perturbation and strength ablation study
perturbation and strength ablation study
 
 
4. Practical Message Length
이전의 모든 실험은 길이가 100인 digit을 실험했습니다. 아래 그림에서는 message의 길이에 따른 image의 결과입니다. 큰 메시지일 수록 encode 및 decode가 어렵습니다.
notion image
길이에 따른 perceptual similarity metric
길이에 따른 perceptual similarity metric
모델 학습 시 image와 message loss로 95% 정확도에 수렴합니다. 100자리가 image quality와 information transfer간의 좋은 균형을 가지므로 이를 사용하였습니다. 또한 56자리부터는 BCH codes를 사용하여 error correction이 가능합니다. 50자는 표현하는 정보량이 너무 적고 150~200자는 image의 quality가 심하게 떨어집니다.
 

Conclusions

전체적인 시스템은 real world에서 높은 정확도로 동작합니다. 이는 invisible hyperlink를 동작하게 합니다. encoder network에 더해지는 미묘한 high-frequency texture residual이 종종 low-frequency region의 image에서는 보이게 됩니다. 다음 work에서는 이를 해결하기 위해 encoder와 decoder를 pair로 subtle encoding을 loss function에 추가하고자 합니다.
 
추가적으로 real world에서 detection network가 bottleneck이 됨을 확인하여 custom detection architecture를 개선하여 encoder, decoder를 end to end로 연결해 detection performance를 올리고자 합니다.
 
 
 
 
 
Share article