All Projects → arnoweng → PyTorch-Deep-Image-Steganography

arnoweng / PyTorch-Deep-Image-Steganography

Licence: other
A PyTorch implementation of image steganography utilizing deep convolutional neural networks

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to PyTorch-Deep-Image-Steganography

pixcryption
📷 Pixel Safe Encryption - Now Cryptographically Secure 🔒
Stars: ✭ 56 (-21.13%)
Mutual labels:  steganography
coursera-gan-specialization
Programming assignments and quizzes from all courses within the GANs specialization offered by deeplearning.ai
Stars: ✭ 277 (+290.14%)
Mutual labels:  u-net
nats
A program to hide file into executable binary.
Stars: ✭ 16 (-77.46%)
Mutual labels:  steganography
deepedge
deep learning edge detector based on U-net and BSDS 500 dataset
Stars: ✭ 25 (-64.79%)
Mutual labels:  u-net
hiddenthread
Steganography for 2ch
Stars: ✭ 18 (-74.65%)
Mutual labels:  steganography
Steganography
Image & video steganography in Matlab
Stars: ✭ 31 (-56.34%)
Mutual labels:  steganography
stegpy
Simple steganography program based on the LSB method.
Stars: ✭ 74 (+4.23%)
Mutual labels:  steganography
DeepWay.v2
Autonomous navigation for blind people
Stars: ✭ 65 (-8.45%)
Mutual labels:  u-net
W-Net-Keras
An unofficial implementation of W-Net for crowd counting.
Stars: ✭ 20 (-71.83%)
Mutual labels:  u-net
covid19.MIScnn
Robust Chest CT Image Segmentation of COVID-19 Lung Infection based on limited data
Stars: ✭ 77 (+8.45%)
Mutual labels:  u-net
euli treasure hunt
Euli is not a computer game but a tool which helps you set up a real life treasure hunt
Stars: ✭ 34 (-52.11%)
Mutual labels:  steganography
HiddenWave
Hide Your Secret Message in any Wave Audio File.
Stars: ✭ 97 (+36.62%)
Mutual labels:  steganography
unet-pytorch
This is the example implementation of UNet model for semantic segmentations
Stars: ✭ 17 (-76.06%)
Mutual labels:  u-net
stegjs
Encrypt message to PNG image.
Stars: ✭ 18 (-74.65%)
Mutual labels:  steganography
Hidden-Eye
Hide data into Picture
Stars: ✭ 39 (-45.07%)
Mutual labels:  steganography
Fashion-Clothing-Parsing
FCN, U-Net models implementation in TensorFlow for fashion clothing parsing
Stars: ✭ 29 (-59.15%)
Mutual labels:  u-net
TryHackMe-Write-Up
The entire walkthrough of all my resolved TryHackMe rooms
Stars: ✭ 53 (-25.35%)
Mutual labels:  steganography
Pix2Pix-Keras
基于pix2pix模型的动漫图片自动上色(keras实现) 2019-2-25
Stars: ✭ 95 (+33.8%)
Mutual labels:  u-net
AperiSolve
Steganalysis web platform
Stars: ✭ 268 (+277.46%)
Mutual labels:  steganography
Brain-Tumor-Segmentation
Attention-Guided Version of 2D UNet for Automatic Brain Tumor Segmentation
Stars: ✭ 125 (+76.06%)
Mutual labels:  u-net

PyTorch-Deep-Image-Steganography

Introduction

This is a PyTorch implementation of image steganography via deep learning, which is similar to the work in paper "Hiding Images in Plain Sight: Deep Steganography ". Our result significantly outperforms the unofficial implementation by harveyslash.

Steganography is the science of unobtrusively concealing a secret message within some cover data. In this case, a full-sized color image is hidden inside another image with minimal changes in appearance utilizing deep convolutional neural networks.

Dependencies & Installation & Usage

  1. Clone or download this repository

  2. Install the dependencies

    pip install -r requirements.txt
    
  3. If you just want to inference via the model

    # because the file size is limited to 100MB, so the model is separated into 2 file netH.tar.gz.1 and netH.tar.gz.2 in the checkPoint folder
    cat ./checkPoint/netH.tar.gz* | tar -xzv -C ./checkPoint/
    CUDA_VISIBLE_DEVICES=0 python main.py --test=./example_pics
    

    You can also use your own image folder to replace example_pics.

  4. Otherwise if you need to train the model on your own dataset, change the DATA_DIR path(in 35th line) in the main.py

    DATA_DIR = '/n/liyz/data/deep-steganography-dataset/'
    

    Put train and validation datasets into the folder and run

    CUDA_VISIBLE_DEVICES=0 python main.py 
    

Framework & Results

This task requires a lot of computing resources. Our model was trained on 45000 images from ImageNet, and evaluated on 5000 images. All images are resized to 256×256 without normalization. This took us nearly 24 hours on one NVIDIA GTX 1080 Ti.

The Framework takes as input two images: cover image(the 1st row) and secret image(the 3rd row) . The goal is to encode a secret image into a cover image through a Hiding network(H-net) such that the secret is invisible. Output of H-net is called container image(the 2nd row). Then, putting this container into a Reveal network(R-net), one can decode the hidden image called revealed secret image(the 4th row).

Result Picture

As you can see, it is visually very hard to find out the difference between cover image and contianer image. Yet the Reveal network can get back the information of the secret image with only tiny deviation. (If you can not notice the tiny deviation, download the picture and zoom in)

Tiny Deviations

  • deviation between cover and contianer

    cover image container image
  • deviation between secret and revealed secret

    secret image revealed secret image

Network Architecture

  • Unlike [1], we only used two nets(H-net and R-net) to get this result.
  • For the H-net, an U-net structured convolutional network was selected to achieve this goal. Cover image and secret image are concatenated into a 6-channel tensor as the input of the H-net.
  • For R-net, there are 6 conv layers with 3×3 kernel size, and each layer is followed by a BN and ReLU except the last one. Contianer images produced by H-net are taken as input of R-net directly.

Loss Curves & Averaged pixel-wise discrepancy (APD)

Two networks were trained with a hyper-parameter with an empirical value 0.75 to balance the visual performance of cover images and revealed secret images. Batch size was set to 32(16 covers and 16 secrets). The loss curves are shown below.

  • Loss curves on H-net and R-net

    MSE loss on cover and contianer MSE loss on secret and revealed secret
  • Averaged pixel-wise discrepancy

Dataset Contianer - Cover(APD)   (0-255) Secret - Rev_Secret(APD)   (0-255)
Training 4.20 4.73
Validation 4.16 4.40

Reference

Baluja, S.: Hiding images in plain sight: Deep steganography. In: NIPS. (2017).

Acknowledgement

Thanks for the help of @arnoweng during this project.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].