Coder Social home page Coder Social logo

steganography-lstm's Introduction

Steganography LSTM

Code for the paper Generating Steganographic Text with LSTMs. The LSTM is based on the Word Language Model example from PyTorch (http://pytorch.org/).

Requirements

Data

A small sample of Penn Treebank and Tweets. pre-process.py is tokenization of punctuation.

Training

python main.py --cuda --nhid 600 --nlayers 3 --epochs 6 --data './data/tweets --save './models/twitter-model.pt' For the full list of arguments, check the PyTorch example README.

Text Generation

One of our key original contributions. After we train our model, we generate words and restrict the output based on the secret text. generate.py is modified such that it takes the secret text and modifies the probabilities based on the "bins" as described in our paper.

Example generation with 4 bins: python generate.py --data './data/tweets' --checkpoint './models/twitter-model.pt' --cuda --outf 'outputs/stegotweets.txt' --words 1000 --temperature 0.8 --bins 4 --common_bin_factor 4 --num_tokens 20

See the arguments in generate.py or refer to the PyTorch example README.

Evaluation

We proposed and implemented an alternate measure of perplexity in Section 3.2 of our paper. The code is in evaluate.py.

Example evaluation: python evaluate.py --cuda --data './data/tweets' --model './models/twitter-model.pt' --bins 4

Contact

If there are any questions or concerns about the code or paper, please contact Tina Fang at [email protected]. We would love to hear your feedback!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.