Machine-learned text alignment prediction for providing an augmented-reality translation interface

The system addresses the challenge of text alignment in non-native environments by using machine-learned models for accurate translation and alignment, ensuring readable and contextually correct text rendering in augmented reality.

WO2025221508A1PCT designated stage Publication Date: 2025-10-23GOOGLE LLC

Patent Information

Application Number
PCT/US2025/023645
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-04-15
Filing Date
2025-04-08
Publication Date
2025-10-23

AI Technical Summary

Technical Problem

Traversing an environment with text in a non-native language is challenging due to the lack of comprehensive translation solutions that provide accurate text alignment and positioning, leading to difficulties in understanding the relationship between different parts of the text.

Method used

A computing system utilizing machine-learned models for text alignment prediction, including paragraph detection and alignment classification, to generate augmented images with translated text aligned according to the original text's format, leveraging optical character recognition and translation models for accurate alignment and rendering.

Benefits of technology

Provides translated text in a native format, improving comprehension by maintaining the original text's alignment, position, and style, while reducing computational latency through parallel processing and lightweight models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure US2025023645_23102025_PF_FP_ABST
    Figure US2025023645_23102025_PF_FP_ABST
Patent Text Reader

Abstract

Systems and methods for providing an augmented-reality translation interface can include obtaining an image, processing the image to generate an image representation and one or more paragraph bounding boxes, and processing the image representation and the one or more paragraph bounding boxes with a machine-learned alignment classification model to generate one or more alignment classifications. In parallel or in series, text from the image can be determined and translated. The image, the translated text, and the one or more alignment classifications can then be processed to generate and provide the translation in an augmented-reality interface.
Need to check novelty before this filing date? Find Prior Art

Description

MACHINE-LEARNED TEXT ALIGNMENT PREDICTION FOR PROVIDING ANAUGMENTED -REALITY TRANSLATION INTERFACEPRIORITY CLAIM

[0001] The present application is based on and claims priority to United States Provisional Application 63 / 634,233 having a filing date of April 15, 2024. Application claims priority to and the benefit of each of such applications and incorporates all such applications herein by reference in their entirety.FIELD

[0002] The present disclosure relates generally to text alignment prediction. More particularly, the present disclosure relates to text alignment prediction for determining text positioning for generating augmented images.BACKGROUND

[0003] Traversing an environment with text in a non-native language to the user can be difficult. Translations can bridge some of the gap by providing the text in a language that is understandable to the user. However, translations alone may not provide a full picture as how the information is provided can provide further insight. Tabulation, position, and alignment of the text can provide details on how the different parts of the text are related to one another.SUMMARY

[0004] Aspects and advantages of embodiments of the present disclosure will be set forth in part in the following description, or can be learned from the description, or can be learned through practice of the embodiments.

[0005] One example aspect of the present disclosure is directed to a computing system for text alignment classification. The system can include one or more processors and one or more non-transitory computer-readable media that collectively store instructions that, when executed by the one or more processors, cause the computing system to perform operations. The operations can include obtaining an image including text. The text can be in a first language. The operations can include obtaining a text translation request associated with a translation from the first language to a second language. The operations can include processing the image to generate an image representation and processing the image with a paragraph detection model to generate one or more paragraph bounding boxes. The one ormore paragraph bounding boxes can be descriptive of a position of one or more paragraphs within the image. The operations can include processing the image representation and the one or more paragraph bounding boxes with a machine-learned alignment classification model to generate one or more alignment classifications associated with the one or more paragraphs. The one or more alignment classifications can be descriptive of a predicted text alignment for the one or more paragraphs. The operations can include obtaining translated text. In some implementations, the translated text can be descriptive of the text in a second language. The operations can include generating an augmented image based on the image, the one or more alignment classifications, and the translated text. The augmented image can include the image with the text replaced with the translated text with text alignment determined based on the one or more alignment classifications.

[0006] In some implementations, processing the image with the paragraph detection model to generate the one or more paragraph bounding boxes can include generating, by processing the image representation with the paragraph detection model, a plurality of paragraph bounding boxes. The plurality of predicted paragraph positions can be associated with a plurality of different paragraphs within the image. Processing the image representation and the one or more paragraph bounding boxes with a machine-learned alignment classification model can include generating, by processing the image representation and the plurality of paragraph bounding boxes with the machine-learned alignment classification model, a plurality of alignment classifications associated with the plurality of different paragraphs. In some implementations, generating an augmented image based on the image, the one or more alignment classifications, and the translated text can include determining a plurality of feature anchors based on the plurality of paragraph bounding boxes and the plurality of alignment classifications and rendering the translated text based on the plurality of feature anchors and the plurality of alignment classifications. The plurality of feature anchors can be descriptive of image features within the image to associate with positions for rendering particular paragraphs. The operations can include obtaining a second image, determining the second image includes the image features, and generating a second augmented image based on the plurality of feature anchors, the translated text, and the plurality of alignment classifications. The second augmented image can include the second image with the text of the first language replaced with the translated text of the second language.

[0007] In some implementations, processing the image representation and the one or more paragraph bounding boxes with the machine-learned alignment classification model togenerate the one or more alignment classifications associated with the one or more paragraphs can include performing region of interest pooling on the visual features of the image representation based on the one or more paragraph bounding boxes to generate one or more pooled visual embeddings, processing the one or more pooled visual embeddings with a convolutional block to predict shape features for the one or more paragraphs, generating one or more box positional embeddings based on the one or more paragraph bounding boxes and the shape features, and processing the one or more pooled visual embeddings and the one or more box positional embeddings to generate the one or more alignment classifications. The one or more alignment classifications can include at least one of right, left, justified, top, bottom, or centered.

[0008] In some implementations, the machine-learned alignment classification model may have been trained on a training dataset including a plurality of example image representations, a plurality of ground truth bounding boxes, and a plurality of ground truth alignment labels. The plurality of example image representations can be associated with a plurality of training images. Each of the plurality of training images can include respective text. The plurality of training images can include text of a plurality of different languages. In some implementations, the plurality of example image representations can be associated with a plurality of training images. Each of the plurality of training images can include respective text. The plurality of training images can include text of a plurality of different alignments. In some implementations, the plurality of different alignments can include left, right, and justified.

[0009] Another example aspect of the present disclosure is directed to a computer- implemented method for an augmented-reality translation interface. The method can include obtaining, by a computing system including one or more processors, image data descriptive of an image from one or more image sensors of a user computing device. The image can include text in a first language. The method can include obtaining, by the computing system, a text translation request associated with a translation from the first language to a second language. The method can include processing, by the computing system, the image with a paragraph detection model to generate one or more paragraph bounding boxes. The one or more paragraph bounding boxes can be descriptive of a position of one or more paragraphs within the image. The method can include processing, by the computing system, the image data and the one or more paragraph bounding boxes with a machine-learned alignment classification model to generate one or more paragraph position predictions and one or more alignment classifications associated with the one or more paragraphs. The one or morealignment classifications can be descriptive of a predicted text alignment for the one or more paragraphs. The method can include obtaining, by the computing system, translated text. The translated text can be descriptive of the text in a second language. The method can include generating, by the computing system, an augmented image based on the image, the one or more paragraph location predictions, the one or more alignment classifications, and the translated text. The augmented image can include the image with the text replaced with the translated text with text alignment determined based on the one or more alignment classifications and a particular text position based on the one or more paragraph position predictions.

[0010] In some implementations, the method can include determining, by the computing system, one or more feature anchors based on the one or more paragraph location predictions and the one or more alignment classifications. The image data can include a compressed version of the image. In some implementations, obtaining, by the computing system, the translated text can include processing, by the computing system, the image with an optical character recognition model to generate text data descriptive of the text in the first language and processing, by the computing system, the text data with a translation model to generate the translated text. Processing, by the computing system, the text data with the translation model to generate the translated text can include processing, by the computing system, the text data to determine the text is in the first language and in response to determining the text is in the first language, obtaining, by the computing system, the translation model. In some implementations, obtaining, by the computing system, the translation model can include determining, by the computing system, a language preference for a particular user and obtaining, by the computing system, the translation model from a translation model database based on a translation request from the first language to the second language. The language preference can include the second language.

[0011] Another example aspect of the present disclosure is directed to one or more non- transitory computer-readable media that collectively store instructions that, when executed by one or more computing devices, cause the one or more computing devices to perform operations. The operations can include obtaining training data. The training data can include an example image representation, a ground truth bounding box, and a ground truth alignment label. The example image representation can be descriptive of a particular image. The ground truth bounding box can be descriptive of a ground truth position of a paragraph within the particular image. In some implementations, the ground truth alignment label can be descriptive of a ground truth text alignment of the paragraph within the particular image. Theoperations can include processing the example image representation and the ground truth bounding box with an alignment classification model to generate a predicted alignment classification. In some implementations, the predicted alignment classification can be descriptive of a predicted alignment for the paragraph. The operations can include evaluating a loss function that evaluates a difference between the predicted alignment classification and the ground truth alignment label and adjusting one or more parameters of the alignment classification model based at least in part on the loss function.

[0012] In some implementations, the operations can include processing the image representation with a paragraph detection model to generate a predicted paragraph bounding box. The predicted paragraph bounding box can be descriptive of a predicted position of the paragraph. The operations can include evaluating a second loss function that evaluates a difference between the predicted paragraph bounding box and the ground truth bounding box and adjusting one or more second parameters of the alignment classification model based at least in part on the second loss function. The ground truth bounding box and the ground truth alignment label may have been generated based on user inputs associated with the particular image. In some implementations, the loss function can include a cross entropy loss.

[0013] Other aspects of the present disclosure are directed to various systems, apparatuses, non-transitory computer-readable media, user interfaces, and electronic devices.

[0014] These and other features, aspects, and advantages of various embodiments of the present disclosure will become better understood with reference to the following description and appended claims. The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate example embodiments of the present disclosure and, together with the description, serve to explain the related principles.BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Detailed discussion of embodiments directed to one of ordinary skill in the art is set forth in the specification, which makes reference to the appended figures, in which:

[0016] Figure 1 depicts a block diagram of an example alignment prediction system according to example embodiments of the present disclosure.

[0017] Figure 2 depicts a block diagram of an example image augmentation system according to example embodiments of the present disclosure.

[0018] Figure 3 depicts a flow chart diagram of an example method to perform text alignment-based image augmentation according to example embodiments of the present disclosure.

[0019] Figure 4 A depicts an illustration of an example image according to example embodiments of the present disclosure.

[0020] Figure 4B depicts an illustration of an example augmented output image that incorporates the text alignment prediction according to example embodiments of the present disclosure.

[0021] Figure 4C depicts an illustration of an example augmented image without text alignment prediction according to example embodiments of the present disclosure.

[0022] Figure 5 depicts a block diagram of an example text alignment classification system according to example embodiments of the present disclosure.

[0023] Figure 6 depicts a block diagram of an example text alignment classification model system according to example embodiments of the present disclosure.

[0024] Figure 7 depicts a flow chart diagram of an example method to perform augmented-reality interface generation according to example embodiments of the present disclosure.

[0025] Figure 8 depicts a flow chart diagram of an example method to perform alignment classification model training according to example embodiments of the present disclosure.

[0026] Figure 9 depicts a block diagram of an example augmented-reality system according to example embodiments of the present disclosure.

[0027] Figure 10 depicts a block diagram of an example augmented reality translation system according to example embodiments of the present disclosure.

[0028] Figures 11 A - 11C depict graphical diagrams of an example augmented reality translation according to example embodiments of the present disclosure.

[0029] Figure 12A depicts a block diagram of an example computing system that performs alignment classification according to example embodiments of the present disclosure.

[0030] Figure 12B depicts a block diagram of an example computing system that performs alignment classification according to example embodiments of the present disclosure.

[0031] Reference numerals that are repeated across plural figures are intended to identify the same features in various implementations.DETAILED DESCRIPTION

[0032] Generally, the present disclosure is directed to text alignment prediction for translated text augmented-reality rendering. In particular, the systems and methods disclosed herein can leverage an alignment classification model to generate a predicted alignment classification for one or more text sequences within an image. For example, an augmented- reality interface can obtain an image via one or more image sensors of a user computing device. An embedding model can process the image to generate an image representation. Additionally and / or alternatively, a paragraph detection model can process the image to generate one or more bounding boxes descriptive of the position and size for the textual paragraphs depicted in the image. An alignment classification model can then process the image representation and the one or more paragraph bounding boxes to generate a predicted alignment classification for each detected paragraph within the image. Before, after, or during the alignment prediction, an optical character recognition model can process the image to generate text data descriptive of the text within the image. A translation model can process the text data to generate translated text descriptive of the text from the image translated into a different language. The augmented-reality interface can then render the translated text into the image over and / or in place of the original text. The augmented-reality interface can leverage the predicted alignment classification(s) to render the text such that the translated text has the same alignment as the original text.

[0033] The text alignment prediction can be leveraged by the augmented-reality interface to provide translated text in the format of the original text, which can provide for a more comprehensive and understandable display of the translated text. Additionally and / or alternatively, text size, color, kerning, and / or font can be determined and utilized to generate text renderings that mirror the style and / or format of the original text. The text can then be provided in their natural form while providing the text in a language understood by the user.

[0034] In some implementations, text alignment prediction can be leveraged for determining a position and alignment for rendering text in place of existing text, which may include removing the original text and rendering the new text in the position of the original text with the same alignment. For example, the user may request text within an environment be translated in a viewfinder. Translated text can be generated, and the text alignment for preexisting text can be determined. The pre-existing text can then be replaced with the translated text based on the text alignment prediction to generate an augmented image. In some implementations, the determined position and / or alignment can be leveraged to generateaugmented-reality anchors that are descriptive of what image features the rendered text is to be rendered on for the augmented-reality experience.

[0035] Providing an augmented reality interface for providing text in a native format can be difficult as placement based on heuristics alone may lead to improper alignment. Tabular lists and other complex formats, in particular, can provide for increased difficulty for placement determination. For example, heuristics alone may cause a system to always center single line text, while lists may include a plurality of single lines with left alignments and varying indentations.

[0036] An alignment classification model can be trained on labeled images (e.g., the images may have been annotated by a plurality of different human reviewers to label the paragraphs and / or their respective alignments) to train the model to predict the text alignment for one or more paragraphs. The alignment classification model can process an image representation and one or more paragraph bounding boxes to generate the predictions. The paragraph bounding boxes can be generated with a paragraph detection model, which can be a separate model and / or may be part of the alignment classification model. In some implementations, the alignment classification model may be further utilized for indentation classification, table alignment classification, and / or other structure classifications.

[0037] Text alignment prediction can be utilized to provide translated text renderings in a native format, which can be rendered via augmented-reality glasses and / or augmented- reality application on a user computing device. Therefore, users can view an environment in a preferred language. The text alignment prediction can be lightweight and can be performed in parallel to the translation generation to reduce latency.

[0038] Additionally and / or alternatively, the systems and methods may perform style alignment. Style alignment can include processing the image data with a style recognition model to determine the font, the font size, the animation, and / or other style features (e.g., italics, bold, etc.). The output of the style recognition model can then be utilized to determine what style to utilize for the text rendering of the text in the translated language. The systems and methods may perform style transfer and / or may select a style that is aesthetically similar to the recognized style. In some implementations, the font and / or other style may be adjusted to ensure the translated text is rendered in a readable manner while maintaining the predicted alignment and a relative style aesthetic.

[0039] In some implementations, the systems and methods disclosed herein may adjust the size, kerning, height, width, and / or other feature of the translated text to ensure the rendered text is readable, while maintaining the semantic alignment of the native text.

[0040] The systems and methods disclosed herein can be utilized to provide augmented- reality translation experience that provides translations in a native alignment and location while addressing problems caused by screen-based size constraints. The systems and methods can leverage a hybrid solution for providing readable content within a limited space capacity.

[0041] The systems and methods of the present disclosure provide a number of technical effects and benefits. As one example, the system and methods can provide an augmented- reality experience that replaces text of a first language with text of a second language, while providing the text in the native format (e.g., alignment, position, color, font, size, etc.). In particular, the systems and methods disclosed herein can leverage paragraph detection, text alignment classification, optical character recognition, text translation, and / or augmented- reality rendering to provide an augmented-reality experience for generating and providing translated text. Image data can be obtained and processed with a paragraph detection model and / or an alignment classification model to generate a text alignment prediction. The image data can additionally be processed with an optical character recognition model and / or a translation model to generate translated text. The text alignment prediction and the translated text can then be leveraged to augment the original image to replace the text of the first language with the translated text.

[0042] Another technical benefit of the systems and methods of the present disclosure is the ability to leverage one or more machine-learned models to understand text within an image and provide rendered text in a native format. For example, the systems and methods can obtain an image, can process the image with an embedding model to generate an image representation and a paragraph detection model to generate a paragraph bounding box, can process the image representation and the paragraph bounding box with an alignment classification model to generate a predicted alignment classification, and can then render text (e.g., translated text) within images based on the predicted alignment classification.

[0043] Another example of technical effect and benefit relates to improved computational efficiency and improvements in the functioning of a computing system. For example, the systems and methods disclosed herein can leverage parallel processing and / or one or more lightweight models for reduced latency and for reducing computational cost for alignment prediction and image augmentation. The parallel processing can reduce latency by determining the predicted alignment classification and the text translation in parallel (e.g., simultaneously) instead of in series. By processing visual embeddings instead of full images, the computational cost can be reduced, and the cost can be further reduced by only processing the embedding features within the paragraph bounding box.

[0044] With reference now to the Figures, example embodiments of the present disclosure will be discussed in further detail.

[0045] Figure 1 depicts a block diagram of an example alignment prediction system 10 according to example embodiments of the present disclosure. In some implementations, the alignment prediction system 10 is configured to receive, and / or obtain, a set of input data that includes an image representation 12 descriptive of an image and a bounding box 14 descriptive of a position and size of a text block within the image and, as a result of receipt of the input data, generate, determine, and / or provide output data that includes an alignment classification 18 descriptive of a predicted text alignment for the text block within the image (e.g., a predicted text alignment for the text within the bounding box in the image). Thus, in some implementations, the alignment prediction system 10 can include an alignment classification model 16 that is operable to process the image representation 12 and the bounding box 14 to predict whether text is right aligned, left aligned, center aligned, justified aligned, top aligned, and / or bottom aligned.

[0046] In particular, an image may be captured with one or more image sensors of a computing device. The image may then be processed with an encoder model (e.g., an embedding model) to generate an image representation 12. The image representation 12 can include one or more visual embeddings descriptive of visual features within the image. The encoder model may include one or more transformer models. Additionally and / or alternatively, the encoder model may be part of a document understanding model for determining a document type depicted in an image, the presence of text within the image, a reading order for the text, and / or other document processing tasks.

[0047] The image may be processed with a paragraph detection model to generate one or more bounding boxes 14 descriptive of the position and / or size of one or more text blocks within the image (e.g., one or more paragraph bounding boxes descriptive of a position and / or size of one or more paragraphs depicted within the image). The one or more bounding boxes 14 can include coordinates associated with a position(s) within the image.

[0048] The alignment classification model 16 can process the image representation 12 and the one or more bounding boxes 14 to generate an alignment classification 18 for each text block (e.g., paragraph or other semantic grouping of text determined by the bounding boxes). The alignment classification model 16 can be a machine-learned model trained on ground truth bounding boxes and / or ground truth alignment classification labels. In some implementations, the alignment classification model 16 can include one or more classification heads of a document understanding model. Additionally and / or alternatively, the alignmentclassification model 16 can generate the alignment classification 18 by processing a particular portion of the image representation 12 based on the one or more bounding boxes 14. The alignment classification model 16 can be further conditioned based on a document type classification, a detected language classification, and / or text data descriptive of the text within the image.

[0049] The alignment classification 18 can be descriptive of the text within the bounding box 14 being left aligned, right aligned, center aligned, top aligned, bottom aligned, and / or justified. The alignment classification 18 can be tagged with and / or indexed with information descriptive of the position and / or size of the respective text block (e.g., the respective paragraph).

[0050] The alignment classification 18 and / or the one or more bounding boxes 14 can then be utilized to augment the image to generate an augmented image that includes rendered text in the format of the original text. The rendered text may include translated text that is descriptive of the original text translated into a different language. Alternatively and / or additionally, the rendered text may include the original text rendered in a higher resolution. The augmented image can then be provided to the user.

[0051] Figure 2 depicts a block diagram of an example image augmentation system 200 according to example embodiments of the present disclosure. The image augmentation system 200 is similar to the alignment prediction system 10 of Figure 1 except that the image augmentation system 200 further includes a translation pipeline and augmented image 232 generation.

[0052] In particular, an image 220 can be captured with one or more image sensors of a user computing device (e.g., a mobile computing device and / or a smart wearable). The image 220 can depict text, which may include text of a document, a sign, and / or a product label. In some implementations, the image 220 can be an image obtained from the web and / or other applications.

[0053] The image 220 can be processed with a representation generation model 222 (e.g., an encoder model) to generate an image representation 212. The image representation 212 can include one or more visual embeddings (e.g., one or more image embeddings and / or one or more text embeddings) descriptive of visual features (e.g., object features, text features, and / or environment features) within the image 220. The representation generation model 222 may include one or more transformer models, one or more convolutional models, one or more self-attention models, and / or one or more feed-forward models. Additionally and / or alternatively, the representation generation model 222 may be part of an encoderbackbone that may include a document understanding model for a document type determination for a document depicted in an image, layout parsing, text parsing, object recognition, contextual translation, text detection, a reading order determination, and / or other document processing tasks.

[0054] The image 220 can be processed with a paragraph detection model 224 to generate one or more bounding boxes 214 descriptive of the position and / or size of one or more text blocks within the image (e.g., one or more paragraph bounding boxes descriptive of a position and / or size of one or more paragraphs depicted within the image). The one or more bounding boxes 214 can include coordinates associated with a position(s) within the image. The paragraph detection model 224 may perform feature detection associated with detecting text features and / or structural features. In some implementations, the one or more bounding boxes 214 may be generated by processing the image representation 212 with the paragraph detection model 224.

[0055] The alignment classification model 216 can process the image representation 212 and the one or more bounding boxes 214 to generate an alignment classification 218 for each text block (e.g., paragraph or other semantic grouping of text). The alignment classification model 216 can be a machine-learned model trained on ground truth bounding boxes and / or ground truth alignment classification labels that were generated based on user inputs to an annotation user interface. In some implementations, the alignment classification model 216 can include one or more classification heads of an image encoding backbone. Additionally and / or alternatively, the alignment classification model 216 can generate the alignment classification 218 (e.g., an alignment class identification) by processing a particular portion of the image representation 212 based on the one or more bounding boxes 214. The alignment classification model 216 may be further conditioned based on a document type classification, a detected language classification, and / or text data descriptive of the text within the image 220. In some implementations, the alignment classification model 216 may be configured to process the image 220 directly to generate one or more predicted positions for one or more paragraphs and one or more predicted alignment classifications 218 for the one or more paragraphs.

[0056] The alignment classification 218 can be descriptive of the text within the bounding box 214 being left aligned, right aligned, center aligned, top aligned, bottom aligned, and / or justified. The alignment classification 218 can be tagged with and / or indexed with information descriptive of the position and / or size of the respective text block (e.g., therespective paragraph). In some implementations, the alignment classification and / or the one or more bounding boxes 214 may be embedded into an image layout embedding.

[0057] The alignment classification 218 and / or the one or more bounding boxes 214 can then be utilized to augment the image 220 to generate an augmented image 232 that includes rendered text in the format of the original text. The rendered text may include translated text 230 that is descriptive of the original text translated into a different language.

[0058] In particular, the image augmentation system 200 can include a translation pipeline that processes the image 220 to generate translated text 230 that can be rendered into the augmented image 232 based on the alignment classification and / or the one or more bounding boxes 214.

[0059] The training pipeline can include an optical character recognition model 226 and a translation model 228. The optical character recognition model 226 can process the image 220 to generate text data descriptive of the text identified within the image 220. The translation model 228 can then process the text data to translate the text from a first language to a second language to generate the translated text 230. The optical character recognition model 226 and the translation model 228 can include machine-learned models. The translation model 228 may be trained for a particular language-to-language translation and / or may be trained for a plurality of different translation types.

[0060] Generating the augmented image 232 can include performing inpainting with a machine-learned inpainting model to replace text of the image 220 with predicted background pixels before performing the translated text 230 rendering (and / or overlay). In some implementations, the augmented image 232 may be generated with one or more machine- learned augmentation models, which may include a diffusion model and / or one or more other generative image models. In some implementations, the augmented image 232 generation may include determining the source language (e.g., the first language) of the image 220 has different directional flow than the target language (e.g., the second language) (e.g., the source language may read left-to-right, while the target language may read right-to-left). The augmented-image 232 may then be generated to account for the directional difference while maintaining the native text alignment.

[0061] Figure 3 depicts a flow chart diagram of an example method to perform according to example embodiments of the present disclosure. Although Figure 3 depicts steps performed in a particular order for purposes of illustration and discussion, the methods of the present disclosure are not limited to the particularly illustrated order or arrangement. Thevarious steps of the method 300 can be omitted, rearranged, combined, and / or adapted in various ways without deviating from the scope of the present disclosure.

[0062] At 302, a computing system can obtain an image including text. The text can be in a first language (e.g., English, Spanish, French, Portuguese, Japanese, Vietnamese, etc.). The image may be generated with one or more sensors of a user computing device. The user computing device may include a mobile computing device and / or a smart wearable. The image may be obtained from a live camera feed of a viewfinder application and / or an augmented-reality interface.

[0063] At 304, the computing system can process the image to generate an image representation. The image representation may include a plurality of vector representations. In some implementations, the image representation may include one or more visual embeddings. The image representation may be generated by processing the image with an encoder model. The encoder model may be part of a document understanding model. The encoder model may include one or more transformer models.

[0064] At 306, the computing system can process the image with a paragraph detection model to generate one or more paragraph bounding boxes. The one or more paragraph bounding boxes can be descriptive of a position of one or more paragraphs within the image. The paragraph detection model may be part of a document understanding model. The paragraph detection model may be a machine-learned model trained to generate bounding boxes that indicate the position and size of a paragraph (or text block) within the image. In some implementations, the one or more paragraph bounding boxes may be generated by processing the image representation with the paragraph detection model.

[0065] In some implementations, processing the image with the paragraph detection model to generate the one or more paragraph bounding boxes can include generating, by processing the image representation with the paragraph detection model, a plurality of paragraph bounding boxes. The plurality of predicted paragraph positions can be associated with a plurality of different paragraphs within the image. The paragraph bounding boxes may include orientation bounding boxes (e.g., bounding boxes with the same orientation as the text block) and / or axis-aligned bounding boxes (e.g., bounding boxes with the same orientation as the borders of the image).

[0066] At 308, the computing system can process the image representation and the one or more paragraph bounding boxes with a machine-learned alignment classification model to generate one or more alignment classifications associated with the one or more paragraphs. The one or more alignment classifications can be descriptive of a predicted text alignment forthe one or more paragraphs. The one or more alignment classifications can include right, left, justified, top, bottom, and / or centered. The machine-learned alignment classification model may be trained on user annotated data. In some implementations, the machine-learned alignment classification model may include one or more classification heads. The one or more alignment classifications may be tagged with paragraph position data determined based on the one or more paragraph bounding boxes.

[0067] In some implementations, the machine-learned alignment classification model may have been trained on a training dataset that includes a plurality of example image representations, a plurality of ground truth bounding boxes, and a plurality of ground truth alignment labels. The plurality of example image representations can be associated with a plurality of training images. Each of the plurality of training images can include respective text. In some implementations, the plurality of training images may include text of a plurality of different languages. The plurality of example image representations can be associated with a plurality of training images. Each of the plurality of training images can include respective text, and the plurality of training images may include text of a plurality of different alignments. The plurality of different alignments can include left, right, centered, top, bottom, and / or justified.

[0068] In some implementations, processing the image representation and the one or more paragraph bounding boxes with a machine-learned alignment classification model can include generating, by processing the image representation and the plurality of paragraph bounding boxes with the machine-learned alignment classification model, a plurality of alignment classifications associated with the plurality of different paragraphs. For example, a respective alignment classification may be generated for each of the plurality of detected paragraphs.

[0069] In some implementations, processing the image representation and the one or more paragraph bounding boxes with the machine-learned alignment classification model to generate the one or more alignment classifications associated with the one or more paragraphs can include performing region of interest pooling on the image representation (e.g., visual features of the image representation) based on the one or more paragraph bounding boxes to generate one or more pooled visual embeddings, processing the one or more pooled visual embeddings with a convolutional block to predict shape features for the one or more paragraphs, generating one or more box positional embeddings based on the one or more paragraph bounding boxes, and processing the one or more shape features and the one or more box positional embeddings to generate the one or more alignment classifications.

[0070] At 310, the computing system can obtain translated text. The translated text can be descriptive of the text in a second language (e.g., Spanish, French, Portuguese, Japanese, Vietnamese, English, Norwegian, Finnish, etc.). The translated text may be obtained from a translation pipeline that may have performed parallel processing with the alignment prediction pipeline. The translation pipeline may include an optical character recognition model and a translation model.

[0071] At 312, the computing system can generate an augmented image based on the image, the one or more alignment classifications, and the translated text. The augmented image can include the image with the text replaced with the translated text with text alignment determined based on the one or more alignment classifications. The augmented image may be generated with one or more augmentation models (e.g., one or more machine- learned augmentation models). The augmentation model may perform inpainting to remove the original text then may perform text rendering based on the translated text, the paragraph bounding box, and the alignment classification. The computing system can then provide the augmented image for display. The augmented image may be provided for display in an augmented-reality interface.

[0072] In some implementations, generating an augmented image based on the image, the one or more alignment classifications, and the translated text can include determining a plurality of feature anchors based on the plurality of paragraph bounding boxes and the plurality of alignment classifications and rendering the translated text based on the plurality of feature anchors and the plurality of alignment classifications. The plurality of feature anchors can be descriptive of image features within the image to associate with positions for rendering particular paragraphs. For example, the plurality of feature anchors can be augmented-reality rendering anchors.

[0073] Additionally and / or alternatively, the computing system can obtain a second image, determine the second image includes the image features associated with the plurality of feature anchors, and generate a second augmented image based on the plurality of feature anchors, the translated text, and the plurality of alignment classifications. The second augmented image can include the second image with the text of the first language replaced with the translated text of the second language.

[0074] Figure 4 A depicts an illustration of an example image 410 according to example embodiments of the present disclosure. The image 410 can be a real -world, ground truth image that depicts text from a real -world document, sign, etc. The image 410 can include text of a document in a source language (e.g., a first language). The document depicted in theexample image 410 includes a first portion 412 with a set of paragraphs with a first alignment format and a second portion 414 with a set of bullet points with a second alignment format.

[0075] Figure 4B depicts an illustration of an example augmented output image that incorporates the text alignment prediction 420 according to example embodiments of the present disclosure. In particular, the systems and methods disclosed herein can be utilized to translate the text of the image 410 and perform the text alignment classifications for the plurality of paragraphs of the document. The augmented image with text alignment prediction 420 can then be generated based on the translated text and the text alignment classifications for the plurality of paragraphs. The rendered translated text can be rendered to have the correct native text alignment for both the first portion 412 and the second portion 414.

[0076] Figure 4C depicts an illustration of an example augmented image without text alignment prediction 430 according to example embodiments of the present disclosure. The translated text of the augmented image without text alignment prediction 430 may have been rendered based on heuristics instead of the machine-learned text alignment prediction. The text alignment for the single line paragraphs may then be centered instead of left aligned as depicted in the source document. Therefore, the machine-learned alignment classification model can perform more accurate text alignment predictions than heuristic-based predictions.

[0077] Figure 5 depicts a block diagram of an example text alignment classification system 500 according to example embodiments of the present disclosure. In particular, the text alignment classification system 500 can include a text alignment producer 506 for processing a page layout embedding 502 and backbone visual embeddings 504 to generate mapping data 508 for rendering text. The page layout embedding 502 can be descriptive of a layout, structure, and / or document type for a document depicted in an image. In some implementations, the page layout embedding can include a structural representation (e.g., an embedding that includes information on words, lines, paragraphs, equations, blocks, tables, etc., and their metadata along with how the information is logically connected). The backbone visual embeddings 504 can be descriptive of visual features within the image.

[0078] The text alignment producer 506 can include a preprocessing block, a text alignment model (e.g., an alignment classification model), and / or a postprocessing block. The preprocessing block can preprocess the page layout embedding 502 and backbone visual embeddings 504 to generate model inputs for the text alignment model. The text alignment model can process the model inputs to generate model outputs descriptive of paragraph text alignments and paragraph positions. The postprocessing block can process the page layout embedding 502 and the model outputs to generate mapping data 508. The mapping data 508can be descriptive of where and / or how to render text for recreating the text format of a source image. The mapping data 508 can include embeddings, feature anchors, tagged alignment data, and / or other data.

[0079] Figure 6 depicts a block diagram of an example text alignment classification model system 600 according to example embodiments of the present disclosure. The text alignment classification model system may include a variety of different configurations and / or architectures. Figure 6 depicts one example; however, the text alignment classification model may include other configurations or architectures. In particular, the text alignment classification model system 600 can include a text alignment model 606 (e.g., an alignment classification model) for processing the visual embeddings 602 and the paragraph bounding boxes 604 to generate an alignment class 608 (e.g., one or more alignment classifications). The text alignment model 606 can include one or more region-of-interest pooling blocks, one or more L2 normalization blocks, one or more first batchnorm blocks, one or more first ReLU blocks, one or more first linear blocks, one or more second batchnorm blocks, one or more second ReLU blocks, one or more second linear blocks, and / or one or more additional processing blocks. The text alignment model 606 can include blocks (and / or layers) in the order depicted in Figure 6 and / or in a variety of other configurations.

[0080] For example, the text alignment model may include a classification head. The classification head (e.g., the alignment classification model) may perform region of interest pooling on visual features (of dim [batch size, H, W, 786]) of the given image using paragraph bounding boxes (ground truth during training and predicted by the paragraph detector during inference) resulting in features of dim [batch size, max num paragraphs, 7, 7, 768], The classification head may process the pooled visual embeddings with a convolutional layer resulting in features of dim [batch size, max num paragraphs, 7, 7, 256] and may perform max pooling on 2, 3 axes to produce features of shape [batch size, max num paragraphs, 256], The classification head may add processed box positional embeddings to these processed pooled visual embeddings. In some implementations, the classification head may process the obtained features with 3 subsequent linear layers to obtain predictions of dim [batch size, max number of paragraphs] for each of the input paragraphs.

[0081] Figure 7 depicts a flow chart diagram of an example method to perform according to example embodiments of the present disclosure. Although Figure 7 depicts steps performed in a particular order for purposes of illustration and discussion, the methods of the present disclosure are not limited to the particularly illustrated order or arrangement. Thevarious steps of the method 700 can be omitted, rearranged, combined, and / or adapted in various ways without deviating from the scope of the present disclosure.

[0082] At 702, a computing system can obtain image data descriptive of an image from one or more image sensors of a user computing device. The image can include text in a first language. The image data can include a compressed version of the image. The image data may include one or more image embeddings and / or one or more text embeddings. The image may depict a sign, a menu, a book, a screen, and / or other objects.

[0083] At 704, the computing system can process the image with a paragraph detection model to generate one or more paragraph bounding boxes. The one or more paragraph bounding boxes can be descriptive of a position of one or more paragraphs within the image. The one or more paragraph bounding boxes may be descriptive of a size of a text block. The one or more paragraph bounding boxes may include one or more overlapping bounding boxes associated with overlapping text.

[0084] At 706, the computing system can process the image data and the one or more paragraph bounding boxes with a machine-learned alignment classification model to generate one or more paragraph position predictions and one or more alignment classifications associated with the one or more paragraphs. The one or more alignment classifications can be descriptive of a predicted text alignment for the one or more paragraphs. The machine- learned alignment classification model may be stored on the user computing device. In some implementations, the one or more paragraph position predictions may be determined based on parsing detected text and / or based on the one or more paragraph bounding boxes.

[0085] At 708, the computing system can obtain translated text. The translated text can be descriptive of the text in a second language. The translated text may be parsed and / or segmented based on image regions. The translated text may be generated by processing the text of the image with one or more machine-learned natural language processing models.

[0086] In some implementations, obtaining the translated text can include processing the image with an optical character recognition model to generate text data descriptive of the text in the first language and processing the text data with a translation model to generate the translated text. Processing the text data with the translation model to generate the translated text can include processing the text data to determine the text is in the first language and in response to determining the text is in the first language, obtaining the translation model. In some implementations, obtaining the translation model can include determining a language preference for a particular user. The language preference can include the second language.Obtaining the translation model can include obtaining the translation model from a translation model database based on a translation request from the first language to the second language.

[0087] At 710, the computing system can generate an augmented image based on the image, the one or more paragraph location predictions, the one or more alignment classifications, and the translated text. The augmented image can include the image with the text replaced with the translated text with text alignment determined based on the one or more alignment classifications and a particular text position based on the one or more paragraph position predictions. The augmented image can then be provided for display via the user computing device.

[0088] In some implementations, the computing system can determine one or more feature anchors based on the one or more paragraph location predictions and the one or more alignment classifications. The one or more feature anchors can be leveraged for continuous augmented-reality rendering.

[0089] Figure 8 depicts a flow chart diagram of an example method to perform according to example embodiments of the present disclosure. Although Figure 8 depicts steps performed in a particular order for purposes of illustration and discussion, the methods of the present disclosure are not limited to the particularly illustrated order or arrangement. The various steps of the method 800 can be omitted, rearranged, combined, and / or adapted in various ways without deviating from the scope of the present disclosure.

[0090] At 802, a computing system can obtain training data. The training data can include an example image representation, a ground truth bounding box, and a ground truth alignment label. The example image representation can be descriptive of a particular image. In some implementations, the training data may include an image instead of the image representation. The training image can be processed with an image representation model to generate an image representation. In some implementations, the ground truth bounding box can be descriptive of a ground truth position of a paragraph within the particular image. The ground truth alignment label can be descriptive of a ground truth text alignment of the paragraph within the particular image. In some implementations, the ground truth bounding box and the ground truth alignment label may have been generated based on user inputs associated with the particular image. The user inputs may be obtained via a dedicated annotation user interface for generating ground truth bounding boxes and ground truth alignment label selection. The plurality of example images of a training dataset may have varying quantities of paragraphs, varying languages, varying indentations, varying alignments, varying document types, and / or other variances.

[0091] At 804, the computing system can process the example image representation and the ground truth bounding box with an alignment classification model to generate a predicted alignment classification. The predicted alignment classification can be descriptive of a predicted alignment for the paragraph. The predicted alignment can include a predicted text alignment and / or a predicted indentation. The alignment classification model may include an encoder model, a paragraph detection model, and / or one or more classification heads. Alternatively and / or additionally, the computing system can process the example image representation and a predicted paragraph bounding box with the alignment classification model to generate the predicted alignment classification.

[0092] At 806, the computing system can evaluate a loss function that evaluates a difference between the predicted alignment classification and the ground truth alignment label. The loss function can include a cross entropy loss. Additionally and / or alternatively, the loss function may include one or more other losses (e.g., an L2 loss).

[0093] At 808, the computing system can adjust one or more parameters of the alignment classification model based at least in part on the loss function. The adjustment may include tuning one or more parameters. The adjustment may be performed based on backpropagating a gradient descent generated with the loss function. The training loop may be performed iteratively with a plurality of different training triplets.

[0094] In some implementations, the computing system can process the image representation with a paragraph detection model to generate a predicted paragraph bounding box. Alternatively and / or additionally, the predicted paragraph bounding box may be generated with the alignment classification model. The predicted paragraph bounding box can be descriptive of a predicted position of the paragraph. The computing system can evaluate a second loss function that evaluates a difference between the predicted paragraph bounding box and the ground truth bounding box and adjust one or more second parameters of the alignment classification model based at least in part on the second loss function. Additionally and / or alternatively, one or more parameters of a paragraph detection model may be adjusted based on the second loss function.

[0095] Figure 9 depicts a block diagram of an example augmented-reality system 900 according to example embodiments of the present disclosure. In particular, the augmented- reality system 900 can include a plurality of pipelines for processing an image to generate an augmented-reality output. The plurality of pipelines can include a translation pipeline, a format determination pipeline, and / or a document type determination pipeline.

[0096] The image can be obtained from image sensors of a user computing device and / or from the web and / or a second user. The image can be processed with one or more optical character recognition models 902 to generate text data descriptive of text identified and recognized within the image. The one or more optical character recognition models 902 may include a general OCR model and / or a math OCR model (e.g., an OCR model particularly trained for mathematical character recognition, which may include diagram recognition and / or equation recognition).

[0097] The text data can then be processed with a language detection block 906 to determine a source language (e.g., a language of the text in the image) and / or a target language (e.g., the preferred language of the user). The text data can then be processed with a translation model 908 based on the determined source language and determined target language to generate translated text.

[0098] The image and / or the text data can also be processed with a content extractor block, which may include an encoder model to generate visual embeddings. The extracted content (e.g., the image representation) and / or the image may be processed with a paragraph detection model 910 to generate paragraph bounding boxes that may be associated with respective unique ids. The paragraph bounding boxes and the image representation may then be processed with an inpainting model 912, a text style determination model 914, and / or an alignment classification model 916. The inpainting model 916 can replace text pixels from the image with predicted replacement pixels. The text style determination model can determine a font, kerning, size, color, and / or other style features of the original text. The alignment classification model 916 can determine the text alignment for each of the paragraphs. The inpainting data, the text style data, and the alignment classifications can then be merged with the page layout embedding and / or the image representation.

[0099] Additionally and / or alternatively, the image can be processed with a document type classification model 904 to generate a document type classification. The document type classification can be utilized to condition the input of one or more other blocks.

[0100] A text response 920 can then be generated based on the merged data, the translated text, and the document type classification. The text response 920 can include what, how, and where to render text. The substance of the text rendering can include the translated text. The location and format can be based on the text style determination, the text alignment determinations, and / or the document type classification. An augmented image for an augmented-reality interface can then be generated by performing inpainting with the inpainting model 914, then rendering the text based on the text response 920.

[0101] A text alignment model (e.g., an alignment classification model) can be used in an augmented-reality application (e.g., an augmented-reality translation interface) to align the text in the rendered translated paragraphs as the text is aligned in the original input image (left, center, right, top, down, or justified). The alignment signal can provide a visual appearance improvement in rendering of the translated text. The model can be implemented in a document understanding framework as a lightweight classification prediction head, which may process document understanding visual embeddings and paragraph bounding boxes detected by a paragraph detector (e.g., a machine-learned paragraph prediction model).

[0102] The systems and methods disclosed herein can generate a signal for an augmented-reality interface that, for each paragraph, captures whether source text in an image was left, right, or center-aligned. The alignment can improve the rendering quality of the translated text as the alignment-based renderings may better preserve the original text structure and may allow users to effortlessly map translated text to the original source text.

[0103] An augmented-reality translation interface can overlay translations over text in an image and / or live camera feed. The translation overlay can become tricky if the translated text is not well aligned with the source text. Rendering translations with the correct alignment can be difficult.

[0104] Systems can utilize writing direction for image understanding, which can be determined by mapping the inferred source language to left-to-right or right-to-left. The translation rendering can use a similar mapping from the target language, rather than the source language to determine how to align translated text.

[0105] In some implementations, systems and methods can utilize heuristics to align text on a per-paragraph basis. For example, the alignment may be based on heuristics including: (1) if the paragraph consists of a single line of text, center align; (2) if the target language is RTL (e.g., Arabic), align right; and / or (3) otherwise, align left. However, heuristics can struggle with more complex alignments.

[0106] For training, ground truth paragraphs can be annotated with alignment signals to generate a training dataset. The datasets may include a plurality of images with a plurality of paragraphs in a plurality of different languages, and each paragraph may be annotated with one of the following alignment categories: center, justified, left, right, top, and bottom.

[0107] The data can be split into tuning and launch splits, where launch can be utilized for final testing of production models. Thus, for training, the remaining training examples can be split into tuning train and tuning val in order to obtain the validation set for monitoring the training of the models. The split of tuning train and tuning val may be generated withdocument types in mind such that both sets are balanced with respect to the different document type tags. The annotated data can include word, line, and / or paragraph annotations.

[0108] The annotation process may include obtaining inputs from human raters using a plugin. The rating interface can include providing a reference image for display with options to label the paragraphs (e.g., labeling the alignment). In some implementations, the rating interface can include providing a reference image for display with options to annotate paragraph positions and sizes.

[0109] During model training, the systems and methods can measure the accuracy, precision, recall and Fl score on a tuning val split of the annotated ground truth data. The evaluation metrics may be aggregated per class, aggregated per language, and / or aggregated across all classes. Additional evaluations may be performed with confusion matrices and / or a visualization of predictions.

[0110] The systems and methods disclosed herein may implement the alignment classification model within a document understanding framework as a separate lightweight classification head.

[0111] The paragraph alignment signal can be included as a downstream task. The objective can be to use the image and text features obtained from a frozen encoder backbone as inputs to a lightweight downstream classification model (e.g., image and text features can be processed with the alignment classification model to generate the predicted alignment classification signal).

[0112] In some implementations, the architecture can include an encoder model, a paragraph detector model, and a prediction head (e.g., the alignment classification model). The encoder model can process an image to generate one or more image representations and / or one or more text representations. The paragraph detection model (i.e., paragraph detector) can process the image to generate a sequence of paragraph bounding boxes. The prediction head (e.g., the alignment classification model) can process the image representation(s) and paragraph bounding box(es) to generate one or more predicted alignment classes. The prediction head may include a region-of-interest align layer and one or more linear layers.

[0113] The encoder model may be part of a document understanding model that was trained to process images and / or text to encode full-page context and hierarchical relationships between different text entities and / or generate a generic structured representation of documents from pixels that can be seamlessly used for several downstream tasks. The document understanding model may include one or more encoder models, one ormore vision decoders, and / or one or more text decoders. The encoder model may include a transformer model (e.g., a multi-modal vision-text transformer with trainable vision mask tokens and trainable text mask tokens). In some implementations, the document understanding model may determine paragraphs, reading order for a document, problem selection (e.g., problem identification and segmentation), text alignment, and / or document type classification.

[0114] In some implementations, the document understanding model can include a multi-modal transformer to encode images and text and may include a box prediction head in charge of regressing the bounding boxes corresponding to different parts of text layout such as paragraphs, sections, titles etc. The model can process both text detected within the image and the pixels of the image at the same time. Inputs can be provided to the model paired with a “positional embedding” that may represent the position of that element (i.e., a word or a patch of pixels) within the 2D reference frame of the image.

[0115] The paragraph detection model may include a multimodal encoder and one or more bounding box decoders. In some implementations, the paragraph detection model may be trained for paragraph detection, indentation detection, list detection, table detection, and / or other semantic structure detection tasks. The paragraph detection model may be part of the document understanding model and / or the alignment classification model. In some implementations, the paragraph detection model may be configured and / or trained for multimodal processing. For example, the paragraph detection model may process the image and text extracted from the image to generate the paragraph bounding boxes. In some implementations, the paragraph detection model may generate oriented bounding boxes that may be oriented (or angled) based on the orientation (or angle) of the detected text. The orientation of the bounding box may be processed by the alignment classification model to generate an orientation-based classification (e.g., upside-down left aligned).

[0116] The separate blocks and / or models may be trained and / or tuned separately or jointly. The alignment prediction may be performed in parallel to text translation, text color prediction, image inpainting prediction (e.g., replacing previous text with predicted background pixels before translated text overlay), font prediction, and / or other tasks.

[0117] Alternatively and / or additionally, the systems and methods may include a single model for paragraph detection and alignment classification. For example, the image representation may be generated, and the alignment classification model may process the image representation to generate the one or more paragraph bounding boxes and one or morealignment classifications (e.g., sequence of paragraph bounding box predictions together with the alignment class prediction).

[0118] In some implementations, the encoder model may be a separate model from the alignment classification model and may be interchangeable with one or more other encoder models. In some implementations, the alignment classification model may include a dense prediction head that may process image representations to generate dense predictions of same size as the input image, each pixel labeled with the alignment class prediction. The alignment classification model may include one or more upscaling convolutional blocks (e.g., upscaling convolutional layers).

[0119] In some implementations, the encoder model may include and / or be a part of a uni-modal visual backbone to obtain the image representation. The representations can then be pooled with region-of-interest align using the graphical optical character recognition paragraph bounding boxes and can then be transmitted to the classification block(s) to predict the alignment.

[0120] In some implementations, the encoder model can include a pretrained image encoder and / or a multi-modal embedding model.

[0121] The model may include a classification head. The classification head (e.g., the alignment classification model) may perform region of interest pooling on visual features (of dim [batch size, H, W, 786]) of the given image using paragraph bounding boxes (ground truth during training and predicted by the paragraph detector during inference) resulting in features of dim [batch size, max num paragraphs, 7, 7, 768], The classification head may process the pooled visual embeddings with a convolutional layer resulting in features of dim [batch size, max num paragraphs, 7, 7, 256] and may perform max pooling on 2, 3 axes to produce features of shape [batch size, max num paragraphs, 256], The classification head may add processed box positional embeddings to these processed pooled visual embeddings. In some implementations, the classification head may process the obtained features with 3 subsequent linear layers to obtain predictions of dim [batch size, max number of paragraphs] for each of the input paragraphs.

[0122] In some implementations, the systems and methods may train with text modality along with the image modality. Additionally and / or alternatively rotated bounding boxes may be processed by the alignment classification model instead of the axis aligned bounding boxes. In some implementations, the alignment classification model may process a document type classification to condition the model for tables, lists, and / or receipts. For example, the document type classification (e.g., nutritional table, purchase receipt, etc.) may be an inputtoken for conditioning the model. The alignment classification model may include a kernel regularizer, one or more dropouts, L2 loss regularization, batch normalization, ReLU activation, layer normalization, cross attention blocks, self-attention blocks (e.g., a multi-head self-attention model), and / or other architectural blocks or layers.

[0123] The text alignment prediction can be performed to enrich a structural representation (e.g., an embedding that includes information on words, lines, paragraphs, equations, blocks, tables, etc., and their metadata along with how the information is logically connected) with an additional signal representing the alignment of the text in each paragraph. The text alignment prediction can include processing the output of a paragraph detection model and visual features obtained from an encoding backbone.

[0124] The text alignment prediction may include a preprocessing node, a text alignment classification model, and / or a post processing node.

[0125] In the preprocessing node, the system can preprocess the paragraph bounding boxes obtained from the paragraphing model, which may be provided in the bounding box including [top, left, height, width, angle] metadata and can be read from the input page layout embedding. The boxes may be preprocessed to be axis-aligned and in the format [top, left, width, height] and may be scaled to be in the range [0, 1], The processed axis-aligned paragraph bounding boxes together with the visual embeddings can then be provided to the alignment classification model.

[0126] The alignment classification model can include a lightweight classification model built on top of the encoder backbone. The axis-aligned paragraph bounding boxes and visual features obtained from the encoder backbone can be processed to output the alignment class for each given paragraph.

[0127] The alignment predictions generated by the alignment classification model can then be transmitted to the postprocessing node together with the input page layout embedding. The post processing node can then output a mapping between the unique paragraph ids and their respective alignment signal, where the unique paragraph ids are obtained from the input page layout embedding (e.g., the ids of each paragraph entity).

[0128] The alignment signal may be transmitted in the format of text metadata. The alignment labels can then be post processed into the dedicated text alignment classification and may be matched with the unique paragraph ids defined by the page layout embedding. The matching can then be stored in a text metadata map format and may be the output of the post processing node.

[0129] The mapping can be transmitted to the merging operator, which can insert the text alignment signal (along with other metadata signals such as the translation, image inpainting, and / or reading order prediction) into the input page layout embedding.

[0130] In some implementations, the text alignment can be implemented as a signal on a semantic understanding platform. The alignment classification model may be run on the CPU, and the model execution may be performed on the semantic understanding platform backend.

[0131] The preprocessing block can prepare the inputs for input into the alignment classification model. Inputs to the alignment classification model can include the visual embeddings from the encoder backbone and paragraph bounding boxes retrieved from the input page layout embedding. The bounding boxes may be converted into axis aligned bounding boxes and then converted into a tensor together with the visual embeddings.

[0132] Paragraph bounding boxes of each detected paragraph returned by the paragraph detection model may be transmitted as rotated bounding boxes and may be stored in the input page layout embedding. The coordinates can be expressed in pixels and may be defined with the top left coordinate point (top left x, top_left_y) as well as width and height of the box and the angle of rotation. The boxes may be preprocessed to be axis-aligned with the image axes before being transmitted to the alignment classification model. The preprocessing can prepare the bounding box for region-of-interest pooling.

[0133] The axis aligned bounding boxes can additionally be translated by an offset defined by the padding applied to the input image. For example, the raw input image may undergo preprocessing before being transmitted to the encoder backbone, which may resize the image and may apply a center padding such that the input image is of square dimension. The visual embeddings obtained from the model may correspond to the padded image. However, the bounding boxes given in the input page layout embedding can be provided with respect to the original raw image (e.g., they may undergo a postprocessing to revert the padding and resizing operations done on the image). The system may add the offset corresponding to the image padding to the obtained axis-aligned bounding boxes in order to position them to the correct part of the visual embedding. The translation of the bounding boxes may move the boxes such that they point to the part of the visual embedding that corresponds to the raw input image pixels and not to the padding pixels.

[0134] The preprocessing block may output a tensor map including the visual embeddings and axis-aligned paragraph bounding boxes.

[0135] The alignment classification model may process the visual embeddings and the paragraph bounding boxes to generate a classification identification for each of the detected paragraphs.

[0136] The alignment classification model can generate an alignment prediction for each paragraph bounding box passed as an input including the padding tokens. In the post processing step, the system may merge the predictions with the unique paragraph ids provided in the paragraph entity information in the page layout embedding. For example, the system can generate a mapping relating each paragraph prediction to a corresponding unique paragraph id. The mapping can then be transmitted to merge the relevant metadata with the page layout embedding.

[0137] Generally, the present disclosure is directed to systems and methods that use generative models (e.g., generative adversarial networks) to enable photorealistic text inpainting in augmented reality. One example application of the proposed systems is to perform augmented reality translation. For example, a user can operate an image capture device (e.g., camera, smartphone, etc.) to capture imagery of a real-world scene that includes real-world text (e.g., signage, restaurant menus, etc.). The real-world text can be translated into a different language. Further, according to an aspect of the present disclosure, the captured imagery can be processed with a machine-learned generative model to produce an augmented image. The augmented image can depict the real-world scene with the real-world text removed. Specifically, because a machine-learned generative model is used, the augmented image can appear significantly more realistic, for example versus an image in which the real-world text has simply been blocked using a box with a single color. The translated text can be combined with the augmented image to generate an output image that depicts the real-world scene including the translated text. The output image can be provided for display to the user (e.g., within a viewfinder interface of a camera-enabled application), thereby providing an augmented reality experience that includes translation of real-world text.

[0138] The systems and methods of the present disclosure provide a number of technical effects and benefits. As one example, through the use of machine-learned generative models, the proposed techniques can provide for a more realistic and immersive augmented reality experience. Specifically, the machine-learned generative models are able to generate augmented imagery in which the real-world text has been removed, but which remain significantly more realistic or visually accurate versus more naive text-removal or blocking techniques. For example, the machine-learned generative models can be particularly trainedto remove text from imagery and replace (or “inpainf ’) a very realistic, consistent, and accurate background in place of the removed text. Therefore, the use of the machine-learned generative models can result in final imagery that is far more true to the actual real-world background, while also including the translated text, thereby providing a more immersive augmented reality experience. This also has the effect of not blocking useful content in the image such as content included in labeled diagrams, maps, etc. which may have text to be translated. As another example technical effect and benefit, through the use of machine- learned generative models, for example as opposed to brittle handcrafted algorithms, the proposed approaches can be more robust against changes in camera pose, lighting, or other dynamic changes to the scene. This can result in a more consistent and immersive user experience.

[0139] Figure 10 depicts a block diagram of an example augmented reality translation system 1000 according to example embodiments of the present disclosure. The augmented reality translation system 1000 can receive an input image 1014. The input image can depict a real-world scene that includes real-world text at a text location. For example, the scene can include a sign that includes text on the sign. As another example, the scene can include a physical document (e.g., menu, form, newspaper, receipt, etc.) that includes text on the physical document.

[0140] Further, although aspects of the present disclosure are described with reference to real-world imagery that depicts a real-world scene, they could also be applied to virtual or synthetic imagery that depicts a virtual or synthetic scene. As one example, the proposed approaches could be applied to a virtual camera (e.g., a virtual camera in a video game or other virtual world) to perform translation of textual content rendered or otherwise included within the virtual or synthetic scene.

[0141] In some implementations, the input image 1014 can be an image captured by a user with an image capture device (e.g., camera, smartphone, etc.). For example, a user device (e.g., smartphone, tablet, etc.) can include one or more applications that are camera- enabled. As an example, the application can be a dedicated camera application. In other examples, various applications may include an interface that allows a user to capture imagery (e.g., by calling to the dedicated camera application, or otherwise). When facilitating the user to capture imagery, the application(s) can provide a viewfinder interface, where the viewfinder interface generally depicts a field of view of the camera in real-time (e.g., displays in the interface the current field of view of the camera).

[0142] The augmented reality translation system 1000 can include a text detection and recognition system 1018. The text detection and recognition system 1018 can detect and recognize the text within the input image 1014. As examples, the text detection and recognition system 1018 can include various components or perform various techniques such as line detection, script identification, optical character recognition, inferring text structure (e.g., “paragraphing”), etc. These tasks can be performed using traditional approaches or using machine-learning models such as, for example, text detection and / or recognition models.

[0143] Thus, the text detection and recognition system 1018 can perform various techniques to generate a set of recognized text 1026 and identification of one or more text locations 1028. The recognized text 1026 can be expressed using tokens, characters, and / or other text representations. The text locations 1028 can be expressed as coordinate values (e.g., (x, y) values in pixel space), bounding boxes, extracted portions of the input image 1014, and / or other formats. As another example, the text locations 1028 can be used to generate a mask (e.g., a binary pixel-wise mask) that indicates location(s) of the input image 1014 that include text.

[0144] As yet another example, the text locations 1028 can be used to extract one or more sub-portions of the input image 1014 that specifically depict the text (e.g., to the exclusion of portion(s) of the input image 1014 that do not depict text). As examples, the plurality of sub-portions respectively correspond to a plurality of lines of text, a plurality of words of text, or a plurality of chunks of text. For example, portion(s) of the input image 1014 that depict text can be broken into chunks that have a predefined size.

[0145] The augmented reality translation system 1000 can include a translation system 1020. The translation system 1020 can translate the recognized text 1026 into translated text 1030, where the translated text 1030 corresponds to the recognized text 1026 translated into a different language. The translation system 1020 can include various components or perform various techniques such as lookup tables or machine learning models such as sequence-to- sequence translation models. In some examples, the translation system 1020 can be executed or implemented by calling to an external translation service or server.

[0146] According to an aspect of the present disclosure, the augmented reality translation system 1000 can include a machine-learned generative model 1022. The machine- learned generative model 1022 can process at least a portion of the input image 1014 to generate an augmented image 1032. The augmented image 1032 can depict the real -world scene with the real -world text removed (e.g., replaced or “inpainted” with an inferred orpredicted background that realistically visually matches the remainder of the background of the real -world scene). In some implementations, the machine-learned generative model 1022 can be a convolutional neural network. In some implementations, the machine-learned generative model 1022 can be trained in an adversarial arrangement, and therefore can be referred to as a generative adversarial network (GAN). Figure 10 depicts a machine-learned generative model 1022; however, the systems and methods disclosed herein may utilize one or more other machine-learned models in place of the machine-learned generative model 1022. For example, in some implementations, image generation and / or pixel generation may not be performed.

[0147] In some implementations, the machine-learned generative model 1022 can process an entirety of the input image 1014 to generate the augmented image 1032. In other implementations, the machine-learned generative model 1022 can process one or more subportions of the input image 1014 to generate the augmented image 1032. For example, as described above, the text detection and recognition system 1018 can detect one or more subportions of the input image 1014 that depict the real-world text. The machine-learned generative model 1022 can process the one or more sub-portions of the input image 1014 to generate one or more augmented sub-portions. The augmented reality translation system 1012 can replace the one or more sub-portions of the input image 1014 with the one or more augmented sub-portions to generate the augmented image 1032.

[0148] The augmented reality translation system 1012 can generate an output image 1016 from the augmented image 1032 and the translated text 1030. The output image 1016 can depict the real-world scene with the translated text 1030 at the text location(s) 1028. As one example, the augmented reality translation system 1000 can implement a Tenderer 1024 to overlay the translated text 1030 upon the augmented image 1032 at the text location(s) 1028. The Tenderer 1024 may be provided with information about the text location(s) 1028, attributes (e.g., color, font, etc.) of the real -world text in the input image 1014, information about the camera pose / orientation, and / or other information that permits the output image 1016 to have a similar look and feel to the input image 1014 as regards the translated text 1030. In another example, the Tenderer 1024 may be a more complex model that performs generative text rendering.

[0149] The augmented reality translation system 1012 (or other cooperative system) can provide the output image 1016 for display to a user. For example, the output image 1016 can be provided in a viewfinder interface of a camera-enabled application.

[0150] In some implementations, the augmented reality translation system 1000 can operate iteratively and in real-time over a plurality of iterations. For example, the augmented reality translation system 1000 can be executed while a user operates a camera-enabled application. While the application is opened, each image captured by the camera can be processed as shown in Figure 10 to generate a respective output image. The output image can be provided in a viewfinder interface. In such fashion, a real-time augmented reality experience can be provided. In other implementations, rather than running on each individual image captured by the camera, the proposed approach can be implemented on only selected key frames (e.g., determined by motion, blurriness, etc.). The augmented images can then be tracked and overlaid in the correct position on the live camera feed until the next frame is selected. Adjustments can be made to, for example, brightness of the augmented images by measuring changes relative to neighboring pixels at time of frame selection. Alternatively or additionally, the augmented reality translation system 1000 can operate “post-capture” (that is, at some time after an image has been captured and not in real-time).

[0151] The augmented reality translation system 1000 can be implemented in whole or in part at the user device, at server device(s), or at a mix of the user device and the server device(s).

[0152] The generative model 1022 can include an encoder-decoder architecture. The architecture can include special mobile-friendly convolutional heads (e.g., MobileNetVl and / or MobileNetV2 convolutional blocks or layers). Further, to increase the flow between distant layers, the architecture can include skip connections. Additionally and / or alternatively, the architecture can include dilated convolutional layers in the middle of the bottleneck part of the network, enabling the model to capture the global context.

[0153] In some implementations, the generative model 1022 can process the whole image 1014 (e.g., with bounding boxes of optical character recognition lines also provided to the model). However, in other implementations, the generative model 1022 can process subportions of the input image 1014. For example, each sub-portion can be processed separately and / or in parallel by the model.

[0154] In one example, lines of text can be segmented into fixed-sized chunks and then passed into the model in one batch. In other examples, each sub-portion can correspond to a single word. In yet another example, each sub-portion can correspond to a full line of text.

[0155] Figures 11 A - C depict graphical diagrams of an example augmented reality translation according to example embodiments of the present disclosure. In particular, Figure 11 A shows an initial image captured by an image capture device. The image in Figure 11 Adepicts a book that includes real-world English language text on the cover. Figure 11 A can be an original image, while Figures 1 IB and 11C are augmented images.

[0156] Figure 1 IB shows an output image in which the real -world English language text has been translated into Japanese language text on the cover of the book in an augmented reality fashion. As can be seen in Figure 1 IB, aspects (e.g., coloring) of the background imagery (e.g., the cliffs and beach) is still retained behind the translated Japanese text (e.g., the cliffs and beach are still visible behind the Japanese text). This demonstrates an improvement of the present disclosure (e.g., versus systems that rely on single color blocks, blurring, or other techniques which do not retain the color and / or semantic content of the background imagery).

[0157] Figure 11C shows that the augmented reality translation experience continues seamlessly despite a change in orientation of the camera relative to the scene (e.g., movement of the camera relative to the book). This demonstrates a benefit of the use of learned models by the present disclosure to provide a consistent output.

[0158] Figure 12A depicts a block diagram of an example computing system 100 that performs alignment classification according to example embodiments of the present disclosure. The system 100 includes a user computing system 102, a server computing system 130, and / or a third computing system 150 that are communicatively coupled over a network 180.

[0159] The user computing system 102 can include any type of computing device, such as, for example, a personal computing device (e.g., laptop or desktop), a mobile computing device (e.g., smartphone or tablet), a gaming console or controller, a wearable computing device, an embedded computing device, or any other type of computing device.

[0160] The user computing system 102 includes one or more processors 112 and a memory 114. The one or more processors 112 can be any suitable processing device (e.g., a processor core, a microprocessor, an ASIC, a FPGA, a controller, a microcontroller, etc.) and can be one processor or a plurality of processors that are operatively connected. The memory 114 can include one or more non-transitory computer-readable storage mediums, such as RAM, ROM, EEPROM, EPROM, flash memory devices, magnetic disks, etc., and combinations thereof. The memory 114 can store data 116 and instructions 118 which are executed by the processor 112 to cause the user computing system 102 to perform operations.

[0161] In some implementations, the user computing system 102 can store or include one or more machine-learned models 120. For example, the machine-learned models 120 can be or can otherwise include various machine-learned models such as neural networks (e.g.,deep neural networks) or other types of machine-learned models, including non-linear models and / or linear models. Neural networks can include feed-forward neural networks, recurrent neural networks (e.g., long short-term memory recurrent neural networks), convolutional neural networks or other forms of neural networks.

[0162] In some implementations, the one or more machine-learned models 120 can be received from the server computing system 130 over network 180, stored in the user computing device memory 114, and then used or otherwise implemented by the one or more processors 112. In some implementations, the user computing system 102 can implement multiple parallel instances of a single machine-learned model 120 (e.g., to perform parallel machine-learned model processing across multiple instances of input data and / or detected features).

[0163] More particularly, the one or more machine-learned models 120 may include one or more detection models, one or more classification models, one or more segmentation models, one or more augmentation models, one or more generative models, one or more natural language processing models, one or more optical character recognition models, and / or one or more other machine-learned models. The one or more machine-learned models 120 can include one or more transformer models. The one or more machine-learned models 120 may include one or more neural radiance field models, one or more diffusion models, and / or one or more autoregressive language models.

[0164] The one or more machine-learned models 120 may be utilized to detect one or more object features. The detected object features may be classified and / or embedded. The classification and / or the embedding may then be utilized to perform a search to determine one or more search results. Alternatively and / or additionally, the one or more detected features may be utilized to determine an indicator (e.g., a user interface element that indicates a detected feature) is to be provided to indicate a feature has been detected. The user may then select the indicator to cause a feature classification, embedding, and / or search to be performed. In some implementations, the classification, the embedding, and / or the searching can be performed before the indicator is selected.

[0165] In some implementations, the one or more machine-learned models 120 can process image data, text data, audio data, and / or latent encoding data to generate output data that can include image data, text data, audio data, and / or latent encoding data. The one or more machine-learned models 120 may perform optical character recognition, natural language processing, image classification, object classification, text classification, audio classification, context determination, action prediction, image correction, imageaugmentation, text augmentation, sentiment analysis, object detection, error detection, inpainting, video stabilization, audio correction, audio augmentation, and / or data segmentation (e.g., mask based segmentation).

[0166] Machine-learned model(s) can be or include one or multiple machine-learned models or model components. Example machine-learned models can include neural networks (e.g., deep neural networks). Example machine-learned models can include non-linear models or linear models. Example machine-learned models can use other architectures in lieu of or in addition to neural networks. Example machine-learned models can include decision tree based models, support vector machines, hidden Markov models, Bayesian networks, linear regression models, k-means clustering models, etc.

[0167] Example neural networks can include feed-forward neural networks, recurrent neural networks (RNNs), including long short-term memory (LSTM) based recurrent neural networks, convolutional neural networks (CNNs), diffusion models, generative-adversarial networks, or other forms of neural networks. Example neural networks can be deep neural networks. Some example machine-learned models can leverage an attention mechanism such as self-attention. For example, some example machine-learned models can include multiheaded self-attention models.

[0168] Machine-learned model(s) can include a single or multiple instances of the same model configured to operate on data from input(s). Machine-learned model(s) can include an ensemble of different models that can cooperatively interact to process data from input(s).For example, machine-learned model(s) can employ a mixture-of-experts structure. See, e.g., Zhou et al., Mixture-of-Experts with Expert Choice Routing, ARXIV:2202.09368V2 (Oct. 14, 2022).

[0169] Input(s) can generally include or otherwise represent various types of data. Input(s) can include one type or many different types of data. Output(s) can be data of the same type(s) or of different types of data as compared to input(s). Output(s) can include one type or many different types of data.

[0170] Example data types for input(s) or output(s) include natural language text data, software code data (e.g., source code, object code, machine code, or any other form of computer-readable instructions or programming languages), machine code data (e.g., binary code, assembly code, or other forms of machine-readable instructions that can be executed directly by a computer's central processing unit), assembly code data (e.g., low-level programming languages that use symbolic representations of machine code instructions to program a processing unit), genetic data or other chemical or biochemical data, image data,audio data, audiovisual data, haptic data, biometric data, medical data, financial data, statistical data, geographical data, astronomical data, historical data, sensor data generally (e.g., digital or analog values, such as voltage or other absolute or relative level measurement values from a real or artificial input, such as from an audio sensor, light sensor, displacement sensor, etc.), and the like. Data can be raw or processed and can be in any format or schema.

[0171] In multimodal inputs or outputs, example combinations of data types include image data and audio data, image data and natural language data, natural language data and software code data, image data and biometric data, sensor data and medical data, etc. It is to be understood that any combination of data types in an input or an output can be present.

[0172] An example input can include one or multiple data types, such as the example data types noted above. An example output can include one or multiple data types, such as the example data types noted above. The data type(s) of input can be the same as or different from the data type(s) of output. It is to be understood that the example data types noted above are provided for illustrative purposes only. Data types contemplated within the scope of the present disclosure are not limited to those examples noted above.

[0173] Additionally or alternatively, one or more machine-learned models 140 can be included in or otherwise stored and implemented by the server computing system 130 that communicates with the user computing system 102 according to a client-server relationship. For example, the machine-learned models 140 can be implemented by the server computing system 130 as a portion of a web service (e.g., a viewfinder service, a visual search service, an image processing service, an ambient computing service, and / or an overlay application service). Thus, one or more models 120 can be stored and implemented at the user computing system 102 and / or one or more models 140 can be stored and implemented at the server computing system 130.

[0174] The user computing system 102 can also include one or more user input component 122 that receives user input. For example, the user input component 122 can be a touch-sensitive component (e.g., a touch-sensitive display screen or a touch pad) that is sensitive to the touch of a user input object (e.g., a finger or a stylus). The touch-sensitive component can serve to implement a virtual keyboard. Other example user input components include a microphone, a traditional keyboard, or other means by which a user can provide user input.

[0175] In some implementations, the user computing system 102 can store and / or provide one or more user interfaces 124, which may be associated with one or more applications. The one or more user interfaces 124 can be configured to receive inputs and / orprovide data for display (e.g., image data, text data, audio data, one or more user interface elements, an augmented-reality experience, a virtual reality experience, and / or other data for display. The user interfaces 124 may be associated with one or more other computing systems (e.g., server computing system 130 and / or third party computing system 150). The user interfaces 124 can include a viewfinder interface, a search interface, a generative model interface, a social media interface, and / or a media content gallery interface.

[0176] The user computing system 102 may include and / or receive data from one or more sensors 126. The one or more sensors 126 may be housed in a housing component that houses the one or more processors 112, the memory 114, and / or one or more hardware components, which may store, and / or cause to perform, one or more software packets. The one or more sensors 126 can include one or more image sensors (e.g., a camera), one or more lidar sensors, one or more audio sensors (e.g., a microphone), one or more inertial sensors (e.g., inertial measurement unit), one or more biological sensors (e.g., a heart rate sensor, a pulse sensor, a retinal sensor, and / or a fingerprint sensor), one or more infrared sensors, one or more location sensors (e.g., GPS), one or more touch sensors (e.g., a conductive touch sensor and / or a mechanical touch sensor), and / or one or more other sensors. The one or more sensors can be utilized to obtain data associated with a user’s environment (e.g., an image of a user’s environment, a recording of the environment, and / or the location of the user).

[0177] The user computing system 102 may include, and / or be part of, a user computing device 104. The user computing device 104 may include a mobile computing device (e.g., a smartphone or tablet), a desktop computer, a laptop computer, a smart wearable, and / or a smart appliance. Additionally and / or alternatively, the user computing system may obtain from, and / or generate data with, the one or more one or more user computing devices 104. For example, a camera of a smartphone may be utilized to capture image data descriptive of the environment, and / or an overlay application of the user computing device 104 can be utilized to track and / or process the data being provided to the user. Similarly, one or more sensors associated with a smart wearable may be utilized to obtain data about a user and / or about a user’s environment (e.g., image data can be obtained with a camera housed in a user’s smart glasses). Additionally and / or alternatively, the data may be obtained and uploaded from other user devices that may be specialized for data obtainment or generation.

[0178] The server computing system 130 includes one or more processors 132 and a memory 134. The one or more processors 132 can be any suitable processing device (e.g., a processor core, a microprocessor, an ASIC, a FPGA, a controller, a microcontroller, etc.) and can be one processor or a plurality of processors that are operatively connected. The memory134 can include one or more non-transitory computer-readable storage mediums, such as RAM, ROM, EEPROM, EPROM, flash memory devices, magnetic disks, etc., and combinations thereof. The memory 134 can store data 136 and instructions 138 which are executed by the processor 132 to cause the server computing system 130 to perform operations.

[0179] In some implementations, the server computing system 130 includes or is otherwise implemented by one or more server computing devices. In instances in which the server computing system 130 includes plural server computing devices, such server computing devices can operate according to sequential computing architectures, parallel computing architectures, or some combination thereof.

[0180] As described above, the server computing system 130 can store or otherwise include one or more machine-learned models 140. For example, the models 140 can be or can otherwise include various machine-learned models. Example machine-learned models include neural networks or other multi-layer non-linear models. Example neural networks include feed forward neural networks, deep neural networks, recurrent neural networks, and convolutional neural networks. Example models 140 are discussed with reference to Figure 9B.

[0181] Additionally and / or alternatively, the server computing system 130 can include and / or be communicatively connected with a search engine 142 that may be utilized to crawl one or more databases (and / or resources). The search engine 142 can process data from the user computing system 102, the server computing system 130, and / or the third party computing system 150 to determine one or more search results associated with the input data. The search engine 142 may perform term based search, label based search, Boolean based searches, image search, embedding based search (e.g., nearest neighbor search), multimodal search, and / or one or more other search techniques.

[0182] The server computing system 130 may store and / or provide one or more user interfaces 144 for obtaining input data and / or providing output data to one or more users. The one or more user interfaces 144 can include one or more user interface elements, which may include input fields, navigation tools, content chips, selectable tiles, widgets, data display carousels, dynamic animation, informational pop-ups, image augmentations, text-to-speech, speech-to-text, augmented-reality, virtual-reality, feedback loops, and / or other interface elements.

[0183] The user computing system 102 and / or the server computing system 130 can train the models 120 and / or 140 via interaction with the third party computing system 150 that iscommunicatively coupled over the network 180. The third party computing system 150 can be separate from the server computing system 130 or can be a portion of the server computing system 130. Alternatively and / or additionally, the third party computing system 150 may be associated with one or more web resources, one or more web platforms, one or more other users, and / or one or more contexts.

[0184] An example machine-learned model can include a generative model (e.g., a large language model, a foundation model, a vision language model, an image generation model, a text-to-image model, an audio generation model, and / or other generative models).

[0185] Training and / or tuning the machine-learned model can include obtaining a training instance. A set of training data can include a plurality of training instances divided between multiple datasets (e.g., a training dataset, a validation dataset, or testing dataset). A training instance can be labeled or unlabeled. The runtime inferences can form training instances when a model is trained using an evaluation of the model’s performance on that runtime instance (e.g., online training / leaming). Example data types for the training instance and various tasks associated therewith are described throughout the present disclosure.

[0186] Training and / or tuning can include processing, using one or more machine- learned models, the training instance to generate an output. The output can be directly obtained from the one or more machine-learned models or can be a downstream result of a chain of processing operations that includes an output of the one or more machine-learned models.

[0187] Training and / or tuning can include receiving an evaluation signal associated with the output. The evaluation signal can be obtained using a loss function. Various determinations of loss can be used, such as mean squared error, likelihood loss, cross entropy loss, hinge loss, contrastive loss, or various other loss functions. The evaluation signal can be computed using known ground-truth labels (e.g., supervised learning), predicted or estimated labels (e.g., semi- or self-supervised learning), or without labels (e.g., unsupervised learning). The evaluation signal can be a reward (e.g., for reinforcement learning). The reward can be computed using a machine-learned reward model configured to generate rewards based on output(s) received. The reward can be computed using feedback data describing human feedback on the output(s).

[0188] Training and / or tuning can include updating the machine-learned model using the evaluation signal. For example, values for parameters of the machine-learned model(s) can be learned, in some embodiments, using various training or learning techniques, such as, for example, backwards propagation. For example, the evaluation signal can be b ackprop agatedfrom the output (or another source of the evaluation signal) through the machine-learned model(s) to update one or more parameters of the model(s) (e.g., based on a gradient of the evaluation signal with respect to the parameter value(s)). For example, system(s) containing one or more machine-learned models can be trained in an end-to-end manner. Gradient descent techniques can be used to iteratively update the parameters over a number of training iterations. In some implementations, performing backwards propagation of errors can include performing truncated backpropagation through time. Training and / or tuning can include implementing a number of generalization techniques (e.g., weight decays, dropouts, etc.) to improve the generalization capability of the models being trained.

[0189] In some implementations, the above training loop can be implemented for training a machine-learned model from an initialized state to a fully trained state (e.g., when the model exhibits a desired performance profile, such as based on accuracy, precision, recall, etc.).

[0190] In some implementations, the above training loop can be implemented for particular stages of a training procedure. For instance, in some implementations, the above training loop can be implemented for pre-training a machine-learned model. Pre-training can include, for instance, large-scale training over potentially noisy data to achieve a broad base of performance levels across a variety of tasks / data types. In some implementations, the above training loop can be implemented for fine-tuning a machine-learned model. Fine- tuning can include, for instance, smaller-scale training on higher-quality (e.g., labeled, curated, etc.) data. Fine-tuning can affect all or a portion of the parameters of a machine- learned model. For example, various portions of the machine-learned model can be “frozen” for certain training stages. For example, parameters associated with an embedding space can be “frozen” during fine-tuning (e.g., to retain information learned from a broader domain(s) than present in the fine-tuning dataset(s)). An example fine-tuning approach includes reinforcement learning. Reinforcement learning can be based on user feedback on model performance during use.

[0191] The third party computing system 150 can include one or more processors 152 and a memory 154. The one or more processors 152 can be any suitable processing device (e.g., a processor core, a microprocessor, an ASIC, a FPGA, a controller, a microcontroller, etc.) and can be one processor or a plurality of processors that are operatively connected. The memory 154 can include one or more non-transitory computer-readable storage mediums, such as RAM, ROM, EEPROM, EPROM, flash memory devices, magnetic disks, etc., and combinations thereof. The memory 154 can store data 156 and instructions 158 which areexecuted by the processor 152 to cause the third party computing system 150 to perform operations. In some implementations, the third party computing system 150 includes or is otherwise implemented by one or more server computing devices.

[0192] The network 180 can be any type of communications network, such as a local area network (e.g., intranet), wide area network (e.g., Internet), or some combination thereof and can include any number of wired or wireless links. In general, communication over the network 180 can be carried via any type of wired and / or wireless connection, using a wide variety of communication protocols (e.g., TCP / IP, HTTP, SMTP, FTP), encodings or formats (e.g., HTML, XML), and / or protection schemes (e.g., VPN, secure HTTP, SSL).

[0193] The machine-learned models described in this specification may be used in a variety of tasks, applications, and / or use cases.

[0194] In some implementations, the input to the machine-learned model(s) of the present disclosure can be image data. The machine-learned model(s) can process the image data to generate an output. As an example, the machine-learned model(s) can process the image data to generate an image recognition output (e.g., a recognition of the image data, a latent embedding of the image data, an encoded representation of the image data, a hash of the image data, etc.). As another example, the machine-learned model(s) can process the image data to generate an image segmentation output. As another example, the machine- learned model(s) can process the image data to generate an image classification output. As another example, the machine-learned model(s) can process the image data to generate an image data modification output (e.g., an alteration of the image data, etc.). As another example, the machine-learned model(s) can process the image data to generate an encoded image data output (e.g., an encoded and / or compressed representation of the image data, etc.). As another example, the machine-learned model(s) can process the image data to generate an upscaled image data output. As another example, the machine-learned model(s) can process the image data to generate a prediction output.

[0195] In some implementations, the input to the machine-learned model(s) of the present disclosure can be text or natural language data. The machine-learned model(s) can process the text or natural language data to generate an output. As an example, the machine- learned model(s) can process the natural language data to generate a language encoding output. As another example, the machine-learned model(s) can process the text or natural language data to generate a latent text embedding output. As another example, the machine- learned model(s) can process the text or natural language data to generate a translation output. As another example, the machine-learned model(s) can process the text or naturallanguage data to generate a classification output. As another example, the machine-learned model(s) can process the text or natural language data to generate a textual segmentation output. As another example, the machine-learned model(s) can process the text or natural language data to generate a semantic intent output. As another example, the machine-learned model(s) can process the text or natural language data to generate an upscaled text or natural language output (e.g., text or natural language data that is higher quality than the input text or natural language, etc.). As another example, the machine-learned model(s) can process the text or natural language data to generate a prediction output.

[0196] In some implementations, the input to the machine-learned model(s) of the present disclosure can be speech data. The machine-learned model(s) can process the speech data to generate an output. As an example, the machine-learned model(s) can process the speech data to generate a speech recognition output. As another example, the machine- learned model(s) can process the speech data to generate a speech translation output. As another example, the machine-learned model(s) can process the speech data to generate a latent embedding output. As another example, the machine-learned model(s) can process the speech data to generate an encoded speech output (e.g., an encoded and / or compressed representation of the speech data, etc.). As another example, the machine-learned model(s) can process the speech data to generate an upscaled speech output (e.g., speech data that is higher quality than the input speech data, etc.). As another example, the machine-learned model(s) can process the speech data to generate a textual representation output (e.g., a textual representation of the input speech data, etc.). As another example, the machine- learned model(s) can process the speech data to generate a prediction output.

[0197] In some implementations, the input to the machine-learned model(s) of the present disclosure can be sensor data. The machine-learned model(s) can process the sensor data to generate an output. As an example, the machine-learned model(s) can process the sensor data to generate a recognition output. As another example, the machine-learned model(s) can process the sensor data to generate a prediction output. As another example, the machine-learned model(s) can process the sensor data to generate a classification output. As another example, the machine-learned model(s) can process the sensor data to generate a segmentation output. As another example, the machine-learned model(s) can process the sensor data to generate a segmentation output. As another example, the machine-learned model(s) can process the sensor data to generate a visualization output. As another example, the machine-learned model(s) can process the sensor data to generate a diagnostic output. Asanother example, the machine-learned model(s) can process the sensor data to generate a detection output.

[0198] In some cases, the input includes visual data and the task is a computer vision task. In some cases, the input includes pixel data for one or more images and the task is an image processing task. For example, the image processing task can be image classification, where the output is a set of scores, each score corresponding to a different object class and representing the likelihood that the one or more images depict an object belonging to the object class. The image processing task may be object detection, where the image processing output identifies one or more regions in the one or more images and, for each region, a likelihood that region depicts an object of interest. As another example, the image processing task can be image segmentation, where the image processing output defines, for each pixel in the one or more images, a respective likelihood for each category in a predetermined set of categories. For example, the set of categories can be foreground and background. As another example, the set of categories can be object classes. As another example, the image processing task can be depth estimation, where the image processing output defines, for each pixel in the one or more images, a respective depth value. As another example, the image processing task can be motion estimation, where the network input includes multiple images, and the image processing output defines, for each pixel of one of the input images, a motion of the scene depicted at the pixel between the images in the network input.

[0199] In some implementations, the task can be a generative task, and the one or more machine-learned models (e.g., 120 and / or 140) can be configured to output content generated in view of one or more inputs. For instance, the inputs can be or otherwise represent data of one or more modalities that encodes context for generating additional content.

[0200] In some implementations, the task can be a text completion task. The machine- learned models can be configured to process the inputs that represent textual data and to generate the outputs that represent additional textual data that completes a textual sequence that includes the inputs. For instance, the machine-learned models can be configured to generate the outputs to complete a sentence, paragraph, or portion of text that follows from a portion of text represented by inputs.

[0201] In some implementations, the task can be an instruction following task. The machine-learned models can be configured to process the inputs that represent instructions to perform a function and to generate the outputs that advance a goal of satisfying the instruction function (e.g., at least a step of a multi-step procedure to perform the function). The outputs can represent data of the same or of a different modality as the inputs. Forinstance, the inputs can represent textual data (e.g., natural language instructions for a task to be performed) and the machine-learned models can process the inputs to generate the outputs that represent textual data responsive to the instructions (e.g., natural language responses, programming language responses, machine language responses, etc.). The inputs can represent image data (e.g., image-based instructions for a task to be performed, optionally accompanied by textual instructions) and the machine-learned models can process the inputs to generate the outputs that represent textual data responsive to the instructions (e.g., natural language responses, programming language responses, machine language responses, etc.). One or more outputs can be iteratively or recursively generated to sequentially process and accomplish steps toward accomplishing the requested functionality. For instance, an initial output can be executed by an external system or be processed by the machine-learned models to complete an initial step of performing a function. Multiple steps can be performed, with a final output being obtained that is responsive to the initial instructions.

[0202] In some implementations, the task can be a question answering task. The machine-learned models can be configured to process the inputs that represent a question to answer and to generate the outputs that advance a goal of returning an answer to the question (e.g., at least a step of a multi-step procedure to perform the function). The outputs can represent data of the same or of a different modality as the inputs. For instance, the inputs can represent textual data (e.g., natural language instructions for a task to be performed) and the machine-learned models can process the inputs to generate the outputs that represent textual data responsive to the question (e.g., natural language responses, programming language responses, machine language responses, etc.). The inputs can represent image data (e.g., image-based instructions for a task to be performed, optionally accompanied by textual instructions) and the machine-learned models can process the inputs to generate the outputs that represent textual data responsive to the question (e.g., natural language responses, programming language responses, machine language responses, etc.). One or more outputs can be iteratively or recursively generated to sequentially process and accomplish steps toward answering the question. For instance, an initial output can be executed by an external system or be processed by the machine-learned models to complete an initial step of obtaining an answer to the question (e.g., querying a database, performing a computation, executing a script, etc.). Multiple steps can be performed, with a final output being obtained that is responsive to the question.

[0203] In some implementations, the task can be an image generation task. The machine-learned models can be configured to process the inputs that represent contextregarding a desired portion of image content. The context can include text data, image data, audio data, etc. Machine-learned models can be configured to generate the outputs that represent image data that depicts imagery related to the context. For instance, the machine- learned models can be configured to generate pixel data of an image. Values for channels associated with the pixels in the pixel data can be selected based on the context (e.g., based on a probability determined based on the context).

[0204] In some implementations, the task can be an audio generation task. Machine- learned models can be configured to process the inputs that represent context regarding a desired portion of audio content. The context can include text data, image data, audio data, etc. The machine-learned models can be configured to generate the outputs that represent audio data related to the context. For instance, the machine-learned models can be configured to generate waveform data in the form of an image (e.g., a spectrogram). Values for channels associated with pixels of the image can be selected based on the context. The machine- learned models can be configured to generate waveform data in the form of a sequence of discrete samples of a continuous waveform. Values of the sequence can be selected based on the context (e.g., based on a probability determined based on the context).

[0205] In some implementations, the task can be a data generation task. Machine- learned models can be configured to process the inputs that represent context regarding a desired portion of data (e.g., data from various data domains, such as sensor data, image data, multimodal data, statistical data, etc.). The desired data can be, for instance, synthetic data for training other machine-learned models. The context can include arbitrary data types. The machine-learned models can be configured to generate the outputs that represent data that aligns with the desired data. For instance, the machine-learned models can be configured to generate data values for populating a dataset. Values for the data objects can be selected based on the context (e.g., based on a probability determined based on the context).

[0206] The user computing system may include a number of applications (e.g., applications 1 through N). Each application may include its own respective machine learning library and machine-learned model(s). For example, each application can include a machine- learned model. Example applications include a text messaging application, an email application, a dictation application, a virtual keyboard application, a browser application, etc.

[0207] Each application can communicate with a number of other components of the computing device, such as, for example, one or more sensors, a context manager, a device state component, and / or additional components. In some implementations, each applicationcan communicate with each device component using an API (e.g., a public API). In some implementations, the API used by each application is specific to that application.

[0208] The user computing system 102 can include a number of applications (e.g., applications 1 through N). Each application is in communication with a central intelligence layer. Example applications include a text messaging application, an email application, a dictation application, a virtual keyboard application, a browser application, etc. In some implementations, each application can communicate with the central intelligence layer (and model(s) stored therein) using an API (e.g., a common API across all applications).

[0209] The central intelligence layer can include a number of machine-learned models. For example a respective machine-learned model (e.g., a model) can be provided for each application and managed by the central intelligence layer. In other implementations, two or more applications can share a single machine-learned model. For example, in some implementations, the central intelligence layer can provide a single model (e.g., a single model) for all of the applications. In some implementations, the central intelligence layer is included within or otherwise implemented by an operating system of the computing system 100.

[0210] The central intelligence layer can communicate with a central device data layer. The central device data layer can be a centralized repository of data for the computing system 100. The central device data layer may communicate with a number of other components of the computing device, such as, for example, one or more sensors, a context manager, a device state component, and / or additional components. In some implementations, the central device data layer can communicate with each device component using an API (e.g., a private API).

[0211] Figure 12B depicts a block diagram of an example computing system 50 that performs alignment classification and image augmentation according to example embodiments of the present disclosure. In particular, the example computing system 50 can include one or more computing devices 52 that can be utilized to obtain, and / or generate, one or more datasets that can be processed by a sensor processing system 60 and / or an output determination system 80 to feedback to a user that can provide information on features in the one or more obtained datasets. The one or more datasets can include image data, text data, audio data, multimodal data, latent encoding data, etc. The one or more datasets may be obtained via one or more sensors associated with the one or more computing devices 52 (e.g., one or more sensors in the computing device 52). Additionally and / or alternatively, the one or more datasets can be stored data and / or retrieved data (e.g., data retrieved from a web resource). For example, images, text, and / or other content items may be interacted with by auser. The interacted with content items can then be utilized to generate one or more determinations.

[0212] The one or more computing devices 52 can obtain, and / or generate, one or more datasets based on image capture, sensor tracking, data storage retrieval, content download (e.g., downloading an image or other content item via the internet from a web resource), and / or via one or more other techniques. The one or more datasets can be processed with a sensor processing system 60. The sensor processing system 60 may perform one or more processing techniques using one or more machine-learned models, one or more search engines, and / or one or more other processing techniques. The one or more processing techniques can be performed in any combination and / or individually. The one or more processing techniques can be performed in series and / or in parallel. In particular, the one or more datasets can be processed with a context determination block 62, which may determine a context associated with one or more content items. The context determination block 62 may identify and / or process metadata, user profile data (e.g., preferences, user search history, user browsing history, user purchase history, and / or user input data), previous interaction data, global trend data, location data, time data, and / or other data to determine a particular context associated with the user. The context can be associated with an event, a determined trend, a particular action, a particular type of data, a particular environment, and / or another context associated with the user and / or the retrieved or obtained data.

[0213] The sensor processing system 60 may include an image preprocessing block 64. The image preprocessing block 64 may be utilized to adjust one or more values of an obtained and / or received image to prepare the image to be processed by one or more machine-learned models and / or one or more search engines 74. The image preprocessing block 64 may resize the image, adjust saturation values, adjust resolution, strip and / or add metadata, and / or perform one or more other operations.

[0214] In some implementations, the sensor processing system 60 can include one or more machine-learned models, which may include a detection model 66, a segmentation model 68, a classification model 70, an embedding model 72, and / or one or more other machine-learned models. For example, the sensor processing system 60 may include one or more detection models 66 that can be utilized to detect particular features in the processed dataset. In particular, one or more images can be processed with the one or more detection models 66 to generate one or more bounding boxes associated with detected features in the one or more images.

[0215] Additionally and / or alternatively, one or more segmentation models 68 can be utilized to segment one or more portions of the dataset from the one or more datasets. For example, the one or more segmentation models 68 may utilize one or more segmentation masks (e.g., one or more segmentation masks manually generated and / or generated based on the one or more bounding boxes) to segment a portion of an image, a portion of an audio file, and / or a portion of text. The segmentation may include isolating one or more detected objects and / or removing one or more detected objects from an image.

[0216] The one or more classification models 70 can be utilized to process image data, text data, audio data, latent encoding data, multimodal data, and / or other data to generate one or more classifications. The one or more classification models 70 can include one or more image classification models, one or more object classification models, one or more text classification models, one or more audio classification models, and / or one or more other classification models. The one or more classification models 70 can process data to determine one or more classifications.

[0217] In some implementations, data may be processed with one or more embedding models 72 to generate one or more embeddings. For example, one or more images can be processed with the one or more embedding models 72 to generate one or more image embeddings in an embedding space. The one or more image embeddings may be associated with one or more image features of the one or more images. In some implementations, the one or more embedding models 72 may be configured to process multimodal data to generate multimodal embeddings. The one or more embeddings can be utilized for classification, search, and / or learning embedding space distributions.

[0218] The sensor processing system 60 may include one or more search engines 74 that can be utilized to perform one or more searches. The one or more search engines 74 may crawl one or more databases (e.g., one or more local databases, one or more global databases, one or more private databases, one or more public databases, one or more specialized databases, and / or one or more general databases) to determine one or more search results. The one or more search engines 74 may perform feature matching, text based search, embedding based search (e.g., k-nearest neighbor search), metadata based search, multimodal search, web resource search, image search, text search, and / or application search.

[0219] Additionally and / or alternatively, the sensor processing system 60 may include one or more multimodal processing blocks 76, which can be utilized to aid in the processing of multimodal data. The one or more multimodal processing blocks 76 may includegenerating a multimodal query and / or a multimodal embedding to be processed by one or more machine-learned models and / or one or more search engines 74.

[0220] The output(s) of the sensor processing system 60 can then be processed with an output determination system 80 to determine one or more outputs to provide to a user. The output determination system 80 may include heuristic based determinations, machine-learned model based determinations, user selection based determinations, and / or context based determinations.

[0221] The output determination system 80 may determine how and / or where to provide the one or more search results in a search results interface 82. Additionally and / or alternatively, the output determination system 80 may determine how and / or where to provide the one or more machine-learned model outputs in a machine-learned model output interface 84. In some implementations, the one or more search results and / or the one or more machine-learned model outputs may be provided for display via one or more user interface elements. The one or more user interface elements may be overlayed over displayed data. For example, one or more detection indicators may be overlayed over detected objects in a viewfinder. The one or more user interface elements may be selectable to perform one or more additional searches and / or one or more additional machine-learned model processes. In some implementations, the user interface elements may be provided as specialized user interface elements for specific applications and / or may be provided uniformly across different applications. The one or more user interface elements can include pop-up displays, interface overlays, interface tiles and / or chips, carousel interfaces, audio feedback, animations, interactive widgets, and / or other user interface elements.

[0222] Additionally and / or alternatively, data associated with the output(s) of the sensor processing system 60 may be utilized to generate and / or provide an augmented-reality experience and / or a virtual -reality experience 86. For example, the one or more obtained datasets may be processed to generate one or more augmented-reality rendering assets and / or one or more virtual -reality rendering assets, which can then be utilized to provide an augmented-reality experience and / or a virtual-reality experience 86 to a user. The augmented- reality experience may render information associated with an environment into the respective environment. Alternatively and / or additionally, objects related to the processed dataset(s) may be rendered into the user environment and / or a virtual environment. Rendering dataset generation may include training one or more neural radiance field models to learn a three- dimensional representation for one or more objects.

[0223] In some implementations, one or more action prompts 88 may be determined based on the output(s) of the sensor processing system 60. For example, a search prompt, a purchase prompt, a generate prompt, a reservation prompt, a call prompt, a redirect prompt, and / or one or more other prompts may be determined to be associated with the output(s) of the sensor processing system 60. The one or more action prompts 88 may then be provided to the user via one or more selectable user interface elements. In response to a selection of the one or more selectable user interface elements, a respective action of the respective action prompt may be performed (e.g., a search may be performed, a purchase application programming interface may be utilized, and / or another application may be opened).

[0224] In some implementations, the one or more datasets and / or the output(s) of the sensor processing system 60 may be processed with one or more generative models 90 to generate a model-generated content item that can then be provided to a user. The generation may be prompted based on a user selection and / or may be automatically performed (e.g., automatically performed based on one or more conditions, which may be associated with a threshold amount of search results not being identified).

[0225] The one or more generative models 90 can include language models (e.g., large language models and / or vision language models), image generation models (e.g., text-to- image generation models and / or image augmentation models), audio generation models, video generation models, graph generation models, and / or other data generation models (e.g., other content generation models). The one or more generative models 90 can include one or more transformer models, one or more convolutional neural networks, one or more recurrent neural networks, one or more feedforward neural networks, one or more generative adversarial networks, one or more self-attention models, one or more embedding models, one or more encoders, one or more decoders, and / or one or more other models. In some implementations, the one or more generative models 90 can include one or more autoregressive models (e.g., a machine-learned model trained to generate predictive values based on previous behavior data) and / or one or more diffusion models (e.g., a machine- learned model trained to generate predicted data based on generating and processing distribution data associated with the input data).

[0226] The one or more generative models 90 can be trained to process input data and generate model -generated content items, which may include a plurality of predicted words, pixels, signals, and / or other data. The model-generated content items may include novel content items that are not the same as any pre-existing work. The one or more generative models 90 can leverage learned representations, sequences, and / or probability distributions togenerate the content items, which may include phrases, storylines, settings, objects, characters, beats, lyrics, and / or other aspects that are not included in pre-existing content items.

[0227] The one or more generative models 90 may include a vision language model.

[0228] The vision language model can be trained, tuned, and / or configured to process image data and / or text data to generate a natural language output. The vision language model may leverage a pre-trained large language model (e.g., a large autoregressive language model) with one or more encoders (e.g., one or more image encoders and / or one or more text encoders) to provide detailed natural language outputs that emulate natural language composed by a human.

[0229] The vision language model may be utilized for zero-shot image classification, few shot image classification, image captioning, multimodal query distillation, multimodal question and answering, and / or may be tuned and / or trained for a plurality of different tasks. The vision language model can perform visual question answering, image caption generation, feature detection (e.g., content monitoring (e.g., for inappropriate content)), object detection, scene recognition, and / or other tasks.

[0230] The vision language model may leverage a pre-trained language model that may then be tuned for multimodality. Training and / or tuning of the vision language model can include image-text matching, masked-language modeling, multimodal fusing with cross attention, contrastive learning, prefix language model training, and / or other training techniques. For example, the vision language model may be trained to process an image to generate predicted text that is similar to ground truth text data (e.g., a ground truth caption for the image). In some implementations, the vision language model may be trained to replace masked tokens of a natural language template with textual tokens descriptive of features depicted in an input image. Alternatively and / or additionally, the training, tuning, and / or model inference may include multi-layer concatenation of visual and textual embedding features. In some implementations, the vision language model may be trained and / or tuned via jointly learning image embedding and text embedding generation, which may include training and / or tuning a system to map embeddings to a joint feature embedding space that maps text features and image features into a shared embedding space. The joint training may include image-text pair parallel embedding and / or may include triplet training. In some implementations, the images may be utilized and / or processed as prefixes to the language model.

[0231] The one or more generative models 90 may be stored on-device and / or may be stored on a server computing system. In some implementations, the one or more generative models 90 can perform on-device processing to determine suggested searches, suggested actions, and / or suggested prompts. The one or more generative models 90 may include one or more compact vision language models that may include less parameters than a vision language model stored and operated by the server computing system. The compact vision language model may be trained via distillation training. In some implementations, the visional language model may process the display data to generate suggestions. The display data can include a single image descriptive of a screenshot and / or may include image data, metadata, and / or other data descriptive of a period of time preceding the current displayed content (e.g., the applications, images, videos, messages, and / or other content viewed within the past 30 seconds). The user computing device may generate and store a rolling buffer window (e.g., 30 seconds) of data descriptive of content displayed during the buffer. Once the time has elapsed, the data may be deleted. The rolling buffer window data may be utilized to determine a context, which can be leveraged for query, content, action, and / or prompt suggestion.

[0232] In some implementations, the generative models 90 can include machine-learned sequence processing models. An example system can pass inputs to sequence processing models. Sequence processing models can include one or more machine-learned components. Sequence processing models can process the data from inputs to obtain an input sequence. Input sequence can include one or more input elements obtained from inputs. The sequence processing model can process the input sequence using prediction layers to generate an output sequence. The output sequence can include one or more output elements generated based on input sequence. The system can generate outputs based on output sequence.

[0233] Sequence processing models can include one or multiple machine-learned model components configured to ingest, generate, or otherwise reason over sequences of information. For example, some example sequence processing models in the text domain are referred to as “Large Language Models,” or LLMs. See, e.g., PaLM 2 Technical Report, Google, https: / / ai.google / static / documents / palm2techreport.pdf (n.d.). Other example sequence processing models can operate in other domains, such as image domains, see, e.g., Dosovitskiy et al., An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale, arXiv:2010.11929v2 (Jun. 3, 2021), audio domains, see, e.g., Agostinelli et al., MusicLM: Generating Music From Text, arXiv:2301.11325vl (Jan. 26, 2023), biochemical domains, see, e.g., Jumper et al., Highly accurate protein structure prediction with AlphaFold,596 Nature 583 (Aug. 26, 2021), by way of example. Sequence processing models can process one or multiple types of data simultaneously. Sequence processing models can include relatively large models (e.g., more parameters, computationally expensive, etc.), relatively small models (e.g., fewer parameters, computationally lightweight, etc.), or both.

[0234] In general, sequence processing models can obtain an input sequence using data from inputs. For instance, input sequence can include a representation of data from inputs 2 in a format understood by sequence processing models. One or more machine-learned components of sequence processing models can ingest the data from inputs, parse the data into pieces compatible with the processing architectures of sequence processing models (e.g., via “tokenization”), and project the pieces into an input space associated with prediction layers (e.g., via “embedding”).

[0235] Sequence processing models can ingest the data from inputs and parse the data into a sequence of elements to obtain input sequence. For example, a portion of input data from inputs can be broken down into pieces that collectively represent the content of the portion of the input data. The pieces can provide the elements of the sequence.

[0236] In some implementations, processing the input data can include tokenization. For example, a tokenizer may process a given portion of an input source and output a series of tokens (e.g., corresponding to input elements) that represent the portion of the input source. Various approaches to tokenization can be used. For instance, textual input sources can be tokenized using a byte-pair encoding (BPE) technique. See, e.g., Kudo et al., SentencePiece: A simple and language independent subword tokenizer and detokenizer for Neural Text Processing, Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing (System Demonstrations), pages 66-71 (October 31-November 4, 2018), https: / / aclanthology.org / D18-2012.pdf. Image-based input sources can be tokenized by extracting and serializing patches from an image.

[0237] In general, arbitrary data types can be serialized and processed into an input sequence.

[0238] Prediction layers can predict one or more output elements based on the input elements. Prediction layers can include one or more machine-learned model architectures, such as one or more layers of learned parameters that manipulate and transform the inputs to extract higher-order meaning from, and relationships between, input elements. In this manner, for instance, example prediction layers can predict new output elements in view of the context provided by input sequence.

[0239] Prediction layers can evaluate associations between portions of input sequence and a particular output element. These associations can inform a prediction of the likelihood that a particular output follows the input context. For example, consider the textual snippet, “The carpenter’s toolbox was small and heavy. It was full of .” Example prediction layers can identify that “It” refers back to “toolbox” by determining a relationship between the respective embeddings. Example prediction layers can also link “It” to the attributes of the toolbox, such as “small” and “heavy.” Based on these associations, prediction layers can, for instance, assign a higher probability to the word “nails” than to the word “sawdust.”

[0240] A transformer is an example architecture that can be used in prediction layers. See, e.g., Vaswani et al., Attention Is All You Need, arXiv: 1706.03762v7 (Aug. 2, 2023). A transformer is an example of a machine-learned model architecture that uses an attention mechanism to compute associations between items within a context window. The context window can include a sequence that contains input sequence and potentially one or more output elements. A transformer block can include one or more attention layers and one or more post-attention layers (e.g., feedforward layers, such as a multi-layer perceptron).

[0241] Prediction layers can include other machine-learned model architectures in addition to or in lieu of transformer-based architectures. For example, recurrent neural networks (RNNs) and long short-term memory (LSTM) models can also be used, as well as convolutional neural networks (CNNs). In general, prediction layers can leverage various kinds of artificial neural networks that can understand or generate sequences of information.

[0242] Output sequence can include or otherwise represent the same or different data types as input sequence. For instance, input sequence can represent textual data, and output sequence can represent textual data. The input sequence can represent image, audio, or audiovisual data, and output sequence can represent textual data (e.g., describing the image, audio, or audiovisual data). It is to be understood that prediction layers, and any other interstitial model components of sequence processing models, can be configured to receive a variety of data types in input sequences and output a variety of data types in output sequences.

[0243] The output sequence can have various relationships to an input sequence. Output sequence can be a continuation of input sequence. The output sequence can be complementary to the input sequence. The output sequence can translate, transform, augment, or otherwise modify input sequence. The output sequence can answer, evaluate, confirm, or otherwise respond to input sequence. The output sequence can implement (or describe instructions for implementing) an instruction provided via an input sequence.

[0244] The output sequence can be generated autoregressively. For instance, for some applications, an output of one or more prediction layers can be passed through one or more output layers (e.g., softmax layer) to obtain a probability distribution over an output vocabulary (e.g., a textual or symbolic vocabulary) conditioned on a set of input elements in a context window. In this manner, for instance, the output sequence can be autoregressively generated by sampling a likely next output element, adding that element to the context window, and re-generating the probability distribution based on the updated context window, and sampling a likely next output element, and so forth.

[0245] The output sequence can also be generated non-autoregressively. For instance, multiple output elements of the output sequence can be predicted together without explicit sequential conditioning on each other. See, e.g., Saharia et al., Non-Autoregressive Machine Translation with Latent Alignments, arXiv:2004.07437v3 (Nov. 16, 2020).

[0246] The output sequence can include one or multiple portions or elements. In an example content generation configuration, the output sequence can include multiple elements corresponding to multiple portions of a generated output sequence (e.g., a textual sentence, values of a discretized waveform, computer code, etc.). In an example classification configuration, the output sequence can include a single element associated with a classification output. For instance, an output “vocabulary” can include a set of classes into which an input sequence is to be classified. For instance, a vision transformer block can pass latent state information to a multilayer perceptron that outputs a likely class value associated with an input image.

[0247] The output determination system 80 may process the one or more datasets and / or the output(s) of the sensor processing system 60 with a data augmentation block 92 to generate augmented data. For example, one or more images can be processed with the data augmentation block 92 to generate one or more augmented images. The data augmentation can include data correction, data cropping, the removal of one or more features, the addition of one or more features, a resolution adjustment, a lighting adjustment, a saturation adjustment, and / or other augmentation.

[0248] In some implementations, the one or more datasets and / or the output(s) of the sensor processing system 60 may be stored based on a data storage block 94 determination.

[0249] The output(s) of the output determination system 80 can then be provided to a user via one or more output components of the user computing device 52. For example, one or more user interface elements associated with the one or more outputs can be provided for display via a visual display of the user computing device 52.

[0250] The processes may be performed iteratively and / or continuously. One or more user inputs to the provided user interface elements may condition and / or affect successive processing loops.

[0251] The technology discussed herein makes reference to servers, databases, software applications, and other computer-based systems, as well as actions taken and information sent to and from such systems. The inherent flexibility of computer-based systems allows for a great variety of possible configurations, combinations, and divisions of tasks and functionality between and among components. For instance, processes discussed herein can be implemented using a single device or component or multiple devices or components working in combination. Databases and applications can be implemented on a single system or distributed across multiple systems. Distributed components can operate sequentially or in parallel.

[0252] While the present subject matter has been described in detail with respect to various specific example embodiments thereof, each example is provided by way of explanation, not limitation of the disclosure. Those skilled in the art, upon attaining an understanding of the foregoing, can readily produce alterations to, variations of, and equivalents to such embodiments. Accordingly, the subject disclosure does not preclude inclusion of such modifications, variations and / or additions to the present subject matter as would be readily apparent to one of ordinary skill in the art. For instance, features illustrated or described as part of one embodiment can be used with another embodiment to yield a still further embodiment. Thus, it is intended that the present disclosure cover such alterations, variations, and equivalents.

Claims

WHAT IS CLAIMED IS:

1. A computing system for text alignment classification, the system comprising: one or more processors; and one or more non-transitory computer-readable media that collectively store instructions that, when executed by the one or more processors, cause the computing system to perform operations, the operations comprising: obtaining an image comprising text, wherein the text is in a first language; obtaining a text translation request associated with a translation from the first language to a second language; processing the image to generate an image representation; processing the image with a paragraph detection model to generate one or more paragraph bounding boxes, wherein the one or more paragraph bounding boxes are descriptive of a position of one or more paragraphs within the image; processing the image representation and the one or more paragraph bounding boxes with a machine-learned alignment classification model to generate one or more alignment classifications associated with the one or more paragraphs, wherein the one or more alignment classifications are descriptive of a predicted text alignment for the one or more paragraphs; obtaining translated text, wherein the translated text is descriptive of the text in the second language; and generating an augmented image based on the image, the one or more alignment classifications, and the translated text, wherein the augmented image comprises the image with the text replaced with the translated text with text alignment determined based on the one or more alignment classifications.

2. The system of claim 1, wherein processing the image with the paragraph detection model to generate the one or more paragraph bounding boxes comprises: generating, by processing the image representation with the paragraph detection model, a plurality of paragraph bounding boxes, wherein the plurality of predicted paragraph positions are associated with a plurality of different paragraphs within the image; and wherein processing the image representation and the one or more paragraph bounding boxes with a machine-learned alignment classification model comprises:generating, by processing the image representation and the plurality of paragraph bounding boxes with the machine-learned alignment classification model, a plurality of alignment classifications associated with the plurality of different paragraphs.

3. The system of claim 2, wherein generating an augmented image based on the image, the one or more alignment classifications, and the translated text comprises: determining a plurality of feature anchors based on the plurality of paragraph bounding boxes and the plurality of alignment classifications; and rendering the translated text based on the plurality of feature anchors and the plurality of alignment classifications.

4. The system of claim 3, wherein the plurality of feature anchors are descriptive of image features within the image to associate with positions for rendering particular paragraphs.

5. The system of claim 4, wherein the operations further comprising: obtaining a second image; determining the second image comprises the image features; and generating a second augmented image based on the plurality of feature anchors, the translated text, and the plurality of alignment classifications, wherein the second augmented image comprises the second image with the text of the first language replaced with the translated text of the second language.

6. The system of any preceding claim, wherein processing the image representation and the one or more paragraph bounding boxes with the machine-learned alignment classification model to generate the one or more alignment classifications associated with the one or more paragraphs comprises: performing region of interest pooling on the visual features of the image representation based on the one or more paragraph bounding boxes to generate one or more pooled visual embeddings; processing the one or more pooled visual embeddings with a convolutional block to predict shape features for the one or more paragraphs; generating one or more box positional embeddings based on the one or more paragraph bounding boxes and the shape features; andprocessing the one or more pooled visual embeddings and the one or more box positional embeddings to generate the one or more alignment classifications.

7. The system of any preceding claim, wherein the one or more alignment classifications comprises at least one of right, left, justified, top, bottom, or centered.

8. The system of any preceding claim, wherein the machine-learned alignment classification model was trained on a training dataset comprising a plurality of example image representations, a plurality of ground truth bounding boxes, and a plurality of ground truth alignment labels.

9. The system of claim 8, wherein the plurality of example image representations are associated with a plurality of training images, wherein each of the plurality of training images comprise respective text, and wherein the plurality of training images comprise text of a plurality of different languages.

10. The system of claim 8, wherein the plurality of example image representations are associated with a plurality of training images, wherein each of the plurality of training images comprise respective text, and wherein the plurality of training images comprise text of a plurality of different alignments, wherein the plurality of different alignments comprise left, right, and justified.

11. A computer-implemented method for an augmented-reality translation interface, the method comprising: obtaining, by a computing system comprising one or more processors, image data descriptive of an image from one or more image sensors of a user computing device, wherein the image comprises text in a first language; obtaining, by the computing system, a text translation request associated with a translation from the first language to a second language; processing, by the computing system, the image with a paragraph detection model to generate one or more paragraph bounding boxes, wherein the one or more paragraph bounding boxes are descriptive of a position of one or more paragraphs within the image; processing, by the computing system, the image data and the one or more paragraph bounding boxes with a machine-learned alignment classification model to generate one ormore paragraph position predictions and one or more alignment classifications associated with the one or more paragraphs, wherein the one or more alignment classifications are descriptive of a predicted text alignment for the one or more paragraphs; obtaining, by the computing system, translated text, wherein the translated text is descriptive of the text in the second language; and generating, by the computing system, an augmented image based on the image, the one or more paragraph location predictions, the one or more alignment classifications, and the translated text, wherein the augmented image comprises the image with the text replaced with the translated text with text alignment determined based on the one or more alignment classifications and a particular text position based on the one or more paragraph position predictions.

12. The method of claim 11, further comprising: determining, by the computing system, one or more feature anchors based on the one or more paragraph location predictions and the one or more alignment classifications.

13. The method of any preceding claim, wherein the image data comprises a compressed version of the image.

14. The method of any preceding claim, wherein obtaining, by the computing system, the translated text comprises: processing, by the computing system, the image with an optical character recognition model to generate text data descriptive of the text in the first language; and processing, by the computing system, the text data with a translation model to generate the translated text.

15. The method of claim 14, wherein processing, by the computing system, the text data with the translation model to generate the translated text comprises: processing, by the computing system, the text data to determine the text is in the first language; and in response to determining the text is in the first language, obtaining, by the computing system, the translation model.

16. The method of claim 15, wherein obtaining, by the computing system, the translation model comprises: determining, by the computing system, a language preference for a particular user, wherein the language preference comprises the second language; and obtaining, by the computing system, the translation model from a translation model database based on a translation request from the first language to the second language.

17. One or more non-transitory computer-readable media that collectively store instructions that, when executed by one or more computing devices, cause the one or more computing devices to perform operations, the operations comprising: obtaining training data, wherein the training data comprises an example image representation, a ground truth bounding box, and a ground truth alignment label, wherein the example image representation is descriptive of a particular image, wherein the ground truth bounding box is descriptive of a ground truth position of a paragraph within the particular image, and wherein the ground truth alignment label is descriptive of a ground truth text alignment of the paragraph within the particular image; processing the example image representation and the ground truth bounding box with an alignment classification model to generate a predicted alignment classification, wherein the predicted alignment classification is descriptive of a predicted alignment for the paragraph; evaluating a loss function that evaluates a difference between the predicted alignment classification and the ground truth alignment label; and adjusting one or more parameters of the alignment classification model based at least in part on the loss function.

18. The one or more non-transitory computer-readable media of claim 17, wherein the operations further comprise: processing the image representation with a paragraph detection model to generate a predicted paragraph bounding box, wherein the predicted paragraph bounding box is descriptive of a predicted position of the paragraph; evaluating a second loss function that evaluates a difference between the predicted paragraph bounding box and the ground truth bounding box; and adjusting one or more second parameters of the alignment classification model based at least in part on the second loss function.

19. The one or more non-transitory computer-readable media of any preceding claim, wherein the ground truth bounding box and the ground truth alignment label were generated based on user inputs associated with the particular image.

20. The one or more non-transitory computer-readable media of any preceding claim, wherein the loss function comprises a cross entropy loss.

Citation Information

Patent Citations

  • Method for translating and editing text included in image, and device performing same

    WO2023101114A1

  • US202463634233P

Cited By

  • Intelligent text retrieval analysis method and system fusing machine language and natural language

    CN121597827A