A General Approach for Using Deep Neural Network for Digital Watermarking