Encoding and decoding a stylized custom graphic
An example system includes an encoder configured to receive a bit string and encode the bit string into a visual representation, and a decoder configured to receive an image including the visual representation and decode the bit string from the visual representation. In some examples, the encoder and decoder are trained as a pair by obtaining a training bit string, encoding the training bit string into a training visual representation using the encoder, decoding the training visual representation using the decoder to generate a decoded bit string, determining an error between the training bit string and the decoded bit string, and updating parameters of the encoder and decoder to reduce the error.
1. A system comprising:
an encoder configured to receive a bit string and encode the bit string into a visual representation; and
a decoder configured to receive an image including the visual representation and decode the bit string from the visual representation; wherein the encoder and decoder are trained as a pair by:
obtaining a training bit string;
encoding the training bit string into a training visual representation using the encoder;
decoding the training visual representation using the decoder to generate a decoded bit string;
determining an error between the training bit string and the decoded bit string; and
updating parameters of the encoder and decoder to reduce the error.
2. The system of claim 1 , wherein the encoder and decoder comprise convolutional neural networks.
3. The system of claim 1 , wherein updating the parameters of the encoder and decoder comprises backpropagating the error and updating weights of the encoder and decoder.
4. The system of claim 1 , wherein encoding the bit string comprises converting the bit string to image data.
5. The system of claim 1 , wherein decoding the visual representation comprises extracting content information while ignoring style information.
6. The system of claim 1 , wherein the error is a loss function determined based on a difference between each bit in the training bit string and each corresponding bit in the decoded bit string.
7. The system of claim 6 , wherein the loss function is backpropagated to update the parameters.
8. The system of claim 1 , wherein updating the parameters minimizes the error.
9. The system of claim 1 , wherein the encoder is configured to encode the bit string into image data.
10. The system of claim 1 , wherein the visual representation is a grayscale image.
11. A method comprising:
obtaining a training bit string; encoding the training bit string into a training visual representation using an encoder; decoding the training visual representation using a decoder to generate a decoded bit string; determining an error between the training bit string and the decoded bit string; and
updating parameters of the encoder and decoder to reduce the error.
12. The method of claim 11 , wherein the encoder and decoder comprise convolutional neural networks.
13. The method of claim 11 , wherein updating the parameters comprises backpropagating the error and updating weights of the encoder and decoder.
14. The method of claim 11 , wherein encoding the bit string comprises converting the bit string to image data.
15. The method of claim 11 , wherein the error is a loss function determined based on a difference between each bit in the training bit string and each corresponding bit in the decoded bit string.
16. The method of claim 15 , wherein updating the parameters comprises backpropagating the loss function.
17. The method of claim 11 , wherein updating the parameters minimizes the error.
18. The method of claim 11 , wherein the visual representation is a grayscale image.
19. A non-transitory machine-readable medium comprising instructions that, when executed by one or more processors, cause the one or more processors to perform operations comprising: obtaining a training bit string; encoding the training bit string into a training visual representation using an encoder; decoding the training visual representation using a decoder to generate a decoded bit string; determining an error between the training bit string and the decoded bit string; and
updating parameters of the encoder and decoder to reduce the error.
20. The non-transitory machine-readable medium of claim 19 , wherein the encoder and decoder comprise convolutional neural networks trained as a pair.