DALL·E: Δημιουργία εικόνων από κείμενο
Έχουμε εκπαιδεύσει ένα νευρωνικό δίκτυο που ονομάζεται DALL·E, το οποίο δημιουργεί εικόνες από λεζάντες κειμένου για ένα ευρύ φάσμα εννοιών που μπορούν να εκφραστούν σε φυσική γλώσσα.

Illustration: Justin Jay Wang
Το DALL·E είναι μια έκδοση 12 δισεκατομμυρίων παραμέτρων του GPT‑3(ανοίγει σε νέο παράθυρο) που έχει εκπαιδευτεί να δημιουργεί εικόνες από περιγραφές κειμένου, χρησιμοποιώντας ένα σύνολο δεδομένων ζευγών κειμένου-εικόνας. Έχουμε διαπιστώσει ότι διαθέτει μια ποικιλία δυνατοτήτων, συμπεριλαμβανομένου του να δημιουργεί ανθρωπόμορφες εκδοχές ζώων και αντικειμένων, να συνδυάζει άσχετες έννοιες αποτελεσματικά, να αποδίδει κείμενο και να εφαρμόζει μετασχηματισμούς σε υπάρχουσες εικόνες.
Δείτε επίσης: το DALL·E 2, που δημιουργεί πιο ρεαλιστικές και ακριβείς εικόνες με 4 φορές μεγαλύτερη ανάλυση.
Το GPT‑3 έδειξε ότι η γλώσσα μπορεί να χρησιμοποιηθεί για να καθοδηγήσει ένα μεγάλο νευρωνικό δίκτυο να εκτελεί διάφορες εργασίες δημιουργίας κειμένου. To Image GPT έδειξε ότι ο ίδιος τύπος νευρωνικού δικτύου μπορεί επίσης να χρησιμοποιηθεί για τη δημιουργία εικόνων με υψηλή πιστότητα. Επεκτείνουμε αυτά τα ευρήματα για να δείξουμε ότι ο χειρισμός οπτικών εννοιών μέσω της γλώσσας είναι πλέον εφικτός.
Like GPT‑3, DALL·E is a transformer language model. It receives both the text and the image as a single stream of data containing up to 1280 tokens, and is trained using maximum likelihood to generate all of the tokens, one after another. A
This training procedure allows DALL·E to not only generate an image from scratch, but also to regenerate any rectangular region of an existing image that extends to the bottom-right corner, in a way that is consistent with the text prompt.
We recognize that work involving generative models has the potential for significant, broad societal impacts. In the future, we plan to analyze how models like DALL·E relate to societal issues like economic impact on certain work processes and professions, the potential for bias in the model outputs, and the longer term ethical challenges implied by this technology.
We find that DALL·E is able to create plausible images for a great variety of sentences that explore the compositional structure of language. We illustrate this using a series of interactive visuals in the next section. The samples shown for each caption in the visuals are obtained by taking the top 32 of 512 after reranking with CLIP, but we do not use any manual cherry-picking, aside from the thumbnails and standalone images that appear outside.B
We test DALL·E’s ability to modify several of an object’s attributes, as well as the number of times that it appears.
Ο ταυτόχρονος έλεγχος πολλαπλών αντικειμένων, των χαρακτηριστικών τους και των χωρικών τους σχέσεων παρουσιάζει μια νέα πρόκληση. Ας πάρουμε για παράδειγμα τη φράση «ένας σκαντζόχοιρος που φοράει ένα κόκκινο καπέλο, κίτρινα γάντια, μπλε πουκάμισο και πράσινο παντελόνι.» Για να ερμηνεύσει σωστά αυτή την πρόταση, το DALL·E πρέπει όχι μόνο να συνθέσει σωστά κάθε κομμάτι ένδυσης με το ζώο, αλλά και να σχηματίσει τις συσχετίσεις (καπέλο, κόκκινο), (γάντια, κίτρινο), (πουκάμισο, μπλε) και (παντελόνι, πράσινο) χωρίς να τα μπερδέψει C
Δοκιμάζουμε την ικανότητα του DALL·E να το κάνει αυτό για τη σχετική τοποθέτηση, τη στοίβαξη αντικειμένων και τον έλεγχο πολλών χαρακτηριστικών.
While DALL·E does offer some level of controllability over the attributes and positions of a small number of objects, the success rate can depend on how the caption is phrased. As more objects are introduced, DALL·E is prone to confusing the associations between the objects and their colors, and the success rate decreases sharply. We also note that DALL·E is brittle with respect to rephrasing of the caption in these scenarios: alternative, semantically equivalent captions often yield no correct interpretations.
Βρίσκουμε ότι το DALL·E επιτρέπει επίσης τον έλεγχο της οπτικής γωνίας μιας σκηνής και του τρισδιάστατου στυλ με το οποίο αποδίδεται μια σκηνή.
To push this further, we test DALL·E’s ability to repeatedly draw the head of a well-known figure at each angle from a sequence of equally spaced angles, and find that we can recover a smooth animation of the rotating head.
DALL·E appears to be able to apply some types of optical distortions to scenes, as we see with the options “fisheye lens view” and “a spherical panorama.” This motivated us to explore its ability to generate reflections.
Τα δείγματα από την «άποψη εξαιρετικά κοντινού πλάνου» και το στυλ «ακτινογραφίας» μάς οδήγησαν να εξερευνήσουμε περαιτέρω την ικανότητα του DALL·E να αποδίδει την εσωτερική δομή με διατομές και την εξωτερική δομή με μακροφωτογραφίες.
The task of translating text to images is underspecified: a single caption generally corresponds to an infinitude of plausible images, so the image is not uniquely determined. For instance, consider the caption “a painting of a capybara sitting on a field at sunrise.” Depending on the orientation of the capybara, it may be necessary to draw a shadow, though this detail is never mentioned explicitly. We explore DALL·E’s ability to resolve underspecification in three cases: changing style, setting, and time; drawing the same object in a variety of different situations; and generating an image of an object with specific text written on it.
With varying degrees of reliability, DALL·E provides access to a subset of the capabilities of a 3D rendering engine via natural language. It can independently control the attributes of a small number of objects, and to a limited extent, how many there are, and how they are arranged with respect to one another. It can also control the location and angle from which a scene is rendered, and can generate known objects in compliance with precise specifications of angle and lighting conditions.
Unlike a 3D rendering engine, whose inputs must be specified unambiguously and in complete detail, DALL·E is often able to “fill in the blanks” when the caption implies that the image must contain a certain detail that is not explicitly stated.
Next, we explore the use of the preceding capabilities for fashion and interior design.
The compositional nature of language allows us to put together concepts to describe both real and imaginary things. We find that DALL·E also has the ability to combine disparate ideas to synthesize objects, some of which are unlikely to exist in the real world. We explore this ability in two instances: transferring qualities from various concepts to animals, and designing products by taking inspiration from unrelated concepts.
Στην προηγούμενη ενότητα, εξερευνήσαμε την ικανότητα του DALL·E να συνδυάζει άσχετες μεταξύ τους έννοιες κατά τη δημιουργία εικόνων πραγματικών αντικειμένων. Στην παρούσα, εξερευνούμε αυτή την ικανότητα στο περιβάλλον της τέχνης, για τρία είδη εικονογραφήσεων: ανθρωπόμορφες εκδοχές ζώων και αντικειμένων, χίμαιρες ζώων και emoji.
Το GPT‑3 μπορεί να εκτελέσει πολλών ειδών εργασίες αποκλειστικά με μια περιγραφή και μια υπόδειξη, για να δημιουργήσει την απάντηση που παρέχεται στην προτροπή του, χωρίς καμία επιπλέον εκπαίδευση. Για παράδειγμα, όταν δίνεται η προτροπή με τη φράση «αυτή είναι η πρόταση "ένας άνθρωπος βγάζει βόλτα τον σκύλο του στο πάρκο" μεταφρασμένη στα Γαλλικά:», το GPT‑3 απαντά «un homme qui promène son chien dans le parc». Αυτή η δυνατότητα ονομάζεται συλλογισμός zero-shot.. Διαπιστώνουμε ότι το DALL·E επεκτείνει αυτή την ικανότητα στον οπτικό τομέα και μπορεί να εκτελεί διάφορες εργασίες μετάφρασης εικόνας σε εικόνα όταν του δίνεται η σωστή προτροπή.
Δεν περιμέναμε ότι θα εμφανιζόταν αυτή η δυνατότητα και δεν κάναμε καμία τροποποίηση στο νευρωνικό δίκτυο ή στη διαδικασία εκπαίδευσης για να την προωθήσουμε. Με κίνητρο αυτά τα αποτελέσματα, μετράμε την ικανότητα του DALL·E σε προβλήματα αναλογικού συλλογισμού, δοκιμάζοντάς το στις προοδευτικές μήτρες του Raven, ένα οπτικό τεστ IQ που χρησιμοποιήθηκε ευρέως τον 20ό αιώνα.
We find that DALL·E has learned about geographic facts, landmarks, and neighborhoods. Its knowledge of these concepts is surprisingly precise in some ways and flawed in others.
In addition to exploring DALL·E’s knowledge of concepts that vary over space, we also explore its knowledge of concepts that vary over time.
Το DALL·E είναι ένας απλός μετασχηματιστής λειτουργίας αποκλειστικά μέσω αποκωδικοποίησης που λαμβάνει κείμενο και εικόνα ως μια ενιαία ροή αποτελούμενη από 1280 token—256 για το κείμενο και 1024 για την εικόνα—και τα μοντελοποιεί όλα αυτοπαλινδρομικά. Η μάσκα προσοχής σε καθένα από τα 64 επίπεδα αυτοπροσοχής επιτρέπει σε κάθε token εικόνας να δίνει προσοχή σε όλα τα token κειμένου. Το DALL·E χρησιμοποιεί την τυπική αιτιακή μάσκα για τα token κειμένου και αραιή προσοχή για τα token εικόνας με μοτίβο προσοχής γραμμής, στήλης ή συνελικτικό, ανάλογα με το στρώμα. Παρέχουμε περισσότερες λεπτομέρειες σχετικά με την αρχιτεκτονική και τη διαδικασία εκπαίδευσης στο άρθρο(ανοίγει σε νέο παράθυρο) μας.
Η σύνθεση κειμένου σε εικόνα είναι ένα ενεργό πεδίο έρευνας από τότε που εκδόθηκε η πρωτοποριακή εργασία των Reed et. al,1 των οποίων η προσέγγιση χρησιμοποιεί ένα GAN προσαρμοσμένο σε ενσωματώσεις κειμένου. Οι ενσωματώσεις παράγονται από έναν κωδικοποιητή που έχει προεκπαιδευτεί χρησιμοποιώντας αντιθετική απώλεια, παρόμοια με το CLIP. Το StackGAN3 και το StackGAN++4 χρησιμοποιούν GAN πολλαπλής κλίμακας, για να αυξήσουν την ανάλυση της εικόνας και να βελτιώσουν την οπτική πιστότητα. Το AttnGAN5 ενσωματώνει την προσοχή μεταξύ των χαρακτηριστικών κειμένου και εικόνας, και προτείνει μια αντιθετική απώλεια αντιστοίχισης χαρακτηριστικών κειμένου-εικόνας ως βοηθητικό στόχο. Είναι ενδιαφέρον να συγκρίνουμε αυτή τη διαδικασία με την ανακατάταξή μέσω του CLIP, η οποία γίνεται εκτός σύνδεσης. Άλλα έργα2, 6, 7 ενσωματώνουν επιπλέον πηγές εποπτείας κατά την εκπαίδευση για να βελτιώσουν την ποιότητα της εικόνας. Τέλος, η εργασία των Nguyen et al. al8 και Cho et. al9 εξερευνά στρατηγικές βασισμένες στη δειγματοληψία για τη δημιουργία εικόνων που αξιοποιούν προεκπαιδευμένα πολυτροπικά διακριτικά μοντέλα.
Παρόμοια με τη δειγματοληψία απόρριψης που χρησιμοποιείται στο VQVAE-2(ανοίγει σε νέο παράθυρο), χρησιμοποιούμε το CLIP για να επανακατατάξουμε τα κορυφαία 32 από τα 512 δείγματα για κάθε λεζάντα σε όλα τα διαδραστικά οπτικά στοιχεία. Αυτή η διαδικασία μπορεί επίσης να θεωρηθεί ως είδος αναζήτησης καθοδηγούμενης από τη γλώσσα16 και μπορεί να επηρεάσει δραστικά την ποιότητα των δειγμάτων.
Footnotes
- A
A token is any symbol from a discrete vocabulary; for humans, each English letter is a token from a 26-letter alphabet. DALL·E’s vocabulary has tokens for both text and image concepts. Specifically, each image caption is represented using a maximum of 256 BPE-encoded tokens with a vocabulary size of 16384, and the image is represented using 1024 tokens with a vocabulary size of 8192.
The images are preprocessed to 256x256 resolution during training. Similar to VQVAE, each image is compressed to a 32x32 grid of discrete latent codes using a discrete VAE that we pretrained using a continuous relaxation. We found that training using the relaxation obviates the need for an explicit codebook, EMA loss, or tricks like dead code revival, and can scale up to large vocabulary sizes.
- B
Further details provided in a later section.
- 17
This task is called variable binding, and has been extensively studied in the literature.
References
- 1
Reed, S., Akata, Z., Yan, X., Logeswaran, L., Schiele, B., Lee, H. (2016). “Generative adversarial text to image synthesis(ανοίγει σε νέο παράθυρο)”. In ICML 2016.
- 2
Reed, S., Akata, Z., Mohan, S., Tenka, S., Schiele, B., Lee, H. (2016). “Learning what and where to draw(ανοίγει σε νέο παράθυρο)”. In NIPS 2016.
- 3
Zhang, H., Xu, T., Li, H., Zhang, S., Wang, X., Huang X., Metaxas, D. (2016). “StackGAN: Text to photo-realistic image synthesis with stacked generative adversarial networks(ανοίγει σε νέο παράθυρο)”. In ICCY 2017.
- 4
Zhang, H., Xu, T., Li, H., Zhang, S., Wang, X., Huang, X., Metaxas, D. (2017). “StackGAN++: realistic image synthesis with stacked generative adversarial networks(ανοίγει σε νέο παράθυρο)”. In IEEE TPAMI 2018.
- 5
Xu, T., Zhang, P., Huang, Q., Zhang, H., Gan, Z., Huang, X., He, X. (2017). “AttnGAN: Fine-grained text to image generation with attentional generative adversarial networks(ανοίγει σε νέο παράθυρο).
- 6
Li, W., Zhang, P., Zhang, L., Huang, Q., He, X., Lyu, S., Gao, J. (2019). “Object-driven text-to-image synthesis via adversarial training(ανοίγει σε νέο παράθυρο)”. In CVPR 2019.
- 7
Koh, J. Y., Baldridge, J., Lee, H., Yang, Y. (2020). “Text-to-image generation grounded by fine-grained user attention(ανοίγει σε νέο παράθυρο)”. In WACV 2021.
- 8
Nguyen, A., Clune, J., Bengio, Y., Dosovitskiy, A., Yosinski, J. (2016). “Plug & play generative networks: conditional iterative generation of images in latent space(ανοίγει σε νέο παράθυρο).
- 9
Cho, J., Lu, J., Schwen, D., Hajishirzi, H., Kembhavi, A. (2020). “X-LXMERT: Paint, caption, and answer questions with multi-modal transformers(ανοίγει σε νέο παράθυρο)”. EMNLP 2020.
- 10
Kingma, Diederik P., and Max Welling. “Auto-encoding variational bayes(ανοίγει σε νέο παράθυρο).” arXiv preprint (2013).
- 11
Rezende, Danilo Jimenez, Shakir Mohamed, and Daan Wierstra. “Stochastic backpropagation and approximate inference in deep generative models(ανοίγει σε νέο παράθυρο).” arXiv preprint (2014).
- 12
Jang, E., Gu, S., Poole, B. (2016). “Categorical reparametrization with Gumbel-softmax(ανοίγει σε νέο παράθυρο)”.
- 13
Maddison, C., Mnih, A., Teh, Y. W. (2016). “The Concrete distribution: a continuous relaxation of discrete random variables(ανοίγει σε νέο παράθυρο)”.
- 14
van den Oord, A., Vinyals, O., Kavukcuoglu, K. (2017). “Neural discrete representation learning(ανοίγει σε νέο παράθυρο)”.
- 15
Razavi, A., van der Oord, A., Vinyals, O. (2019). “Generating diverse high-fidelity images with VQ-VAE-2(ανοίγει σε νέο παράθυρο)”.
- 16
Andreas, J., Klein, D., Levine, S. (2017). “Learning with Latent Language(ανοίγει σε νέο παράθυρο)”.
- 17
- 18
- 19
Gayler, R. (1998). “Multiplicative binding, representation operators & analogy(ανοίγει σε νέο παράθυρο)”.
- 20
Kanerva, P. (1997). “Fully distributed representations(ανοίγει σε νέο παράθυρο)”.


