Multi-axis vision Transform

By introducing a multi-axis self-attention model into the Transformer model in the field of computer vision, the problem of the existing Transformer model performing poorly in image recognition tasks is solved, efficient global-local spatial interaction is achieved, and the visual task is significantly improved performance.

CN119422151APending Publication Date: 2025-02-11GOOGLE LLC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380032004.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-03-30
Filing Date
2023-03-30
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

In the field of computer vision, existing Transformer models perform poorly in image recognition tasks, especially in the absence of large amounts of pre-training, and window-based attention has limited model capacity due to non-local loss, resulting in Scaling on larger data systems is not favorable.

Method used

A multi-axis self-attention model (Max-SA) ​​is proposed. By decomposing the fully dense attention mechanism into two sparse forms, the quadratic complexity of attention is reduced to linearity, and the localization is configured in series and the global processing part realize global-local spatial interaction.

Benefits of technology

The balanced model capacity and universal applicability under the computational budget have been achieved, and the performance of visual tasks has been significantly improved, especially in tasks such as image classification, object detection and visual aesthetic evaluation, and achieved state-of-the-art results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119422151A_ABST
    Figure CN119422151A_ABST
Patent Text Reader

Abstract

An efficient and scalable attention model, which may be referred to as multi-axis attention, is provided. Example implementations may include two aspects: local attention of a tile and expanded global attention. These design selections allow for global-local spatial interaction on any input resolution, with only linear complexity. The disclosure also proposes new architecture elements by effectively mixing the proposed multi-axis attention model with convolution. Furthermore, the present disclosure proposes a simple hierarchical visual trunk by simply repeating basic building blocks in multiple stages, an example implementation of which may be referred to as MaxViT. It is notable that MaxViT can globally "insight" throughout the entire network, even in early high resolution stages.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Related Applications

[0002] This application claims priority to and the benefit of U.S. Provisional Patent Application No. 63 / 325,356, filed on March 30, 2022, which is incorporated herein by reference in its entirety. Technical Field

[0003] The present disclosure generally relates to a more efficient machine learning architecture for visual tasks. More specifically, the present disclosure relates to a multi-axis visual Transformer, which includes one or more multi-axis blocks, the one or more multi-axis blocks including a local attention axis and a global attention axis connected in series. Background Art

[0004] Transformers have recently gained significant attention in the field of computer vision. However, the lack of scalability of self-attention mechanisms in terms of image size has limited their widespread adoption in state-of-the-art vision backbones.

[0005] More specifically, Convolutional Neural Networks (ConvNets) have historically been the dominant architectural design choice for computer vision. ConvNets continue to excel on a wide range of vision problems by becoming deeper, wider, adding dense connections, efficient separable convolutions, dilated convolutions, using encoder-decoder frameworks, and even introducing modern micro-design components.

[0006] Meanwhile, in natural language processing, inspired by the evolution of self-attention models such as Transformer (Vaswani et al., Attention is all you need, Advances in Neural Information Processing Systems 30 (2017)), many researchers have begun to introduce attention mechanisms into visual models. As an example, the Visual Transformer (ViT) (Dosovitskiy et al., An image is worth 16x16 words: Transformers for image recognition at scale, arXiv preprint arXiv:2010.11929 (2020)) may be the first fully Transformer-based architecture for vision, whereby image patches are simply treated as sequences of words and the Transformer encoder is applied to these visual tokens. When pre-trained on large-scale datasets, ViT can achieve convincing results in image recognition.

[0007] However, it has been observed that ViT performs poorly in image recognition without extensive pre-training. This is due to ViT's powerful model capacity, which is instilled with a small inductive bias, which leads to overfitting. In order to appropriately adjust the model capacity and improve its scalability, many subsequent efforts have studied sparse Transformer models tailored for visual tasks (such as local attention). These methods often reintroduce hierarchical architectures to compensate for the loss of non-locality. SwinTransformer (Liu et al., Swin transformer: Hierarchical vision transformer using shifted windows, in Proceedings of the IEEE / CVF International Conference on Computer Vision. pp. 10012–10022 (2021)) is such a successful attempt: the Transformer is modified by applying self-attention to shifted non-overlapping windows. This method outperformed ConvNet on the ImageNet benchmark with a pure visual Transformer for the first time. Despite having greater flexibility and general applicability than the full attention used in ViT, it has been observed that window-based attention has limited model capacity due to the loss of non-locality and thus scales poorly on larger datasets such as ImageNet-21K and JFT. However, capturing global interactions via full attention at early or high-resolution stages in a hierarchical network is computationally heavy since the attention operator requires quadratic complexity.

[0008] Therefore, how to efficiently combine global and local interactions to balance model capacity and general applicability under the computational budget remains challenging. Summary of the invention

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

[0010] An example aspect of the present disclosure relates to a computing system for performing computer vision tasks with improved efficiency. The computing system includes: one or more processors; and one or more non-transitory computer-readable media, which together store: a machine learning computer vision model, which is configured to process input image data to generate output predictions. The machine learning computer vision model includes one or more multi-axis self-attention blocks. Each of the one or more multi-axis self-attention blocks includes: a local processing portion, which is configured to perform a local attention operation on a first feature data set; and a global processing portion, which is configured to perform a global attention operation on a second feature data set. The global processing portion and the local processing portion are arranged in a series configuration relative to each other.

[0011] Another example aspect of the present disclosure relates to a computer-implemented method for performing a computer vision task. The method includes obtaining an input image. The method includes processing the input image using a machine learning computer vision model to generate an output prediction, wherein processing the input image using the machine learning computer vision model includes: at each of one or more multi-axis self-attention blocks of the machine learning computer vision model. The method includes, at a local processing portion of the multi-axis self-attention block: performing a first partitioning operation to partition a first feature data set into a plurality of local windows; and performing a corresponding local attention operation on each of the plurality of local windows. The method includes: at a global processing portion of the multi-axis self-attention block: performing a second partitioning operation to partition a second feature data set into a plurality of global windows; and performing a corresponding global attention operation on each of the plurality of global windows. The local processing portion and the global processing portion are arranged in a series configuration relative to each other. The method includes providing an output prediction as an output.

[0012] Another example aspect of the present disclosure relates to a computing system for performing image generation tasks with improved efficiency. The computing system includes: one or more processors; and one or more non-transitory computer-readable media, which together store: a machine learning image generation model, which is configured to process input data to generate an output image. The machine learning image generation model includes one or more multi-axis self-attention blocks. Each of the one or more multi-axis self-attention blocks includes: a global processing portion, which is configured to perform a global attention operation on a second feature data set; and a local processing portion, which is configured to perform a local attention operation on a first feature data set. The global processing portion and the local processing portion are arranged in a series configuration relative to each other.

[0013] Other aspects of the disclosure relate 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 be 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 relevant principles. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] A detailed discussion of the embodiments for those skilled in the art is set forth in this specification with reference to the accompanying drawings, in which:

[0016] Figure 1A to Figure 1B Depicted are example experimental results of example embodiments of the present disclosure.

[0017] Figure 2 Depicted is a graphical diagram of an example network architecture including an example multi-axis self-attention block according to an example embodiment of the present disclosure.

[0018] Figure 3 A graphical diagram depicting an example portion of an example multi-axis self-attention block according to an example embodiment of the present disclosure.

[0019] Figure 4 Depicted is a graphical diagram of an example network architecture including an example multi-axis self-attention block according to an example embodiment of the present disclosure.

[0020] Figure 5A A block diagram of an example computing system is depicted according to an example embodiment of the present disclosure.

[0021] Figure 5B A block diagram of an example computing device is depicted according to an example embodiment of the present disclosure.

[0022] Figure 5C A block diagram of an example computing device is depicted according to an example embodiment of the present disclosure.

[0023] Reference numerals that are repeated across multiple drawings are intended to denote like features in various implementations. DETAILED DESCRIPTION

[0024] Overview

[0025] In general, the present disclosure relates to an efficient and scalable attention model, which may be referred to as multi-axis attention. Example implementations may include two aspects: block-wise local attention and expanded global attention. These design choices allow global-local spatial interactions at arbitrary input resolutions with only linear complexity. The present disclosure also proposes new architectural elements by effectively mixing the proposed multi-axis attention model with convolutions. In addition, the present disclosure proposes a simple hierarchical visual backbone by simply repeating basic building blocks in multiple stages, an example implementation of which may be referred to as MaxViT. Notably, MaxViT is able to "see" globally throughout the entire network, even in early high-resolution stages.

[0026] The effectiveness of example implementations of the proposed model is demonstrated on a wide range of vision tasks. On image classification, MaxViT achieves state-of-the-art performance in various settings: without additional data, MaxViT achieves 86.5% ImageNet-1K top-1 accuracy; with ImageNet-21K pre-training, the model achieves 88.7% top-1 accuracy. For downstream tasks, MaxViT is used as a backbone to provide good performance in object detection as well as visual aesthetics assessment. The proposed model also exhibits strong generative modeling capabilities on ImageNet, demonstrating the superior potential of the MaxViT block as a general vision module.

[0027] More specifically, the present disclosure proposes a new type of Transformer module, called Multi-Axis Self-Attention (Max-SA), which can be used as a basic architectural component that can perform both local and global spatial interactions in a single block. Compared with full self-attention, Max-SA enjoys greater flexibility and higher efficiency, i.e., naturally adapts to different input lengths with linear complexity; in contrast to (shifted) window / local attention, Max-SA allows for more powerful model capacity by proposing a global receptive field. In addition, with only linear complexity, Max-SA can be used as a general independent attention module in any layer of the network, even in the early high-resolution stages.

[0028] To demonstrate its effectiveness and generality, a simple but effective vision backbone is proposed. An example implementation of the backbone can be called Multi-Axis Visual Transformer (MaxViT). The backbone can be constructed by layering and stacking repeated blocks consisting of Max-SA and convolution. Although the proposed model belongs to the category of hybrid visual transformers, MaxViT is different from previous methods in that the model focuses on simplicity, which is achieved by designing a basic block that unifies convolution, local and global attention, and then simply repeating the basic block.

[0029] Example experiments show that MaxViT significantly improves the state-of-the-art (SOTA) performance on a wide range of visual tasks in all data regimes. Specifically, Figure 1A to Figure 1B As shown, MaxViT outperforms all recent Transformer-based models in both accuracy vs. FLOPs and accuracy vs. parameters.

[0030] More specifically, Figure 1A to Figure 1B Shows the performance comparison of MaxViT with state-of-the-art visual Transformers on ImageNet-1K. Specifically, Figure 1A The accuracy and FLOP performance scaling curves are shown for the ImageNet-1K training setting when the input resolution is 224x224. Figure 1B Accuracy vs parameter scaling curves are shown for the ImageNet-1K fine-tuning setting that allows for higher sizes (384 / 512). Example implementations of the proposed model show superior performance in both accuracy vs compute and accuracy vs parameters tradeoffs.

[0031] Thus, one example aspect of the present disclosure relates to a general Transformer architecture (e.g., "MaxViT") that can capture both local and global spatial interactions throughout each stage of the network. Another example aspect relates to a novel independent multi-axis attention module, which consists of block-wise local attention and enlarged global attention, enjoying global perception with linear complexity. In addition, extensive experiments show that MaxViT achieves SOTA results for a wide range of tasks, including image classification, object detection, image aesthetics assessment, and image generation, under various data systems.

[0032] Therefore, the present disclosure provides a variety of technical effects and benefits. As an example, a large number of experiments show that the example implementation of the present disclosure achieves state-of-the-art results on multiple computer vision tasks. Specifically, in image classification, MaxViT achieves state-of-the-art performance under various settings: without additional data, MaxViT achieves 86.5% of ImageNet-1K top-1 accuracy; with ImageNet-21K pre-training, the model achieves 88.7% top-1 accuracy. For downstream tasks, MaxViT, as a backbone, provides good performance in object detection and visual aesthetics assessment. The proposed model also exhibits strong generative modeling capabilities on ImageNet, demonstrating the superior potential of the MaxViT block as a general visual module. Therefore, the proposed system and model provide improved computer performance on a large number of different computer vision tasks. Therefore, the present disclosure represents an improvement in the performance of the computer itself related to a specific technical purpose (e.g., computer vision tasks such as image classification, object detection or recognition, etc.).

[0033] As another example technical effect and benefit, the model architecture described herein provides superior performance even with fewer parameters and / or FLOPs. Thus, relative to existing methods, the proposed model can perform the same task and obtain superior results while consuming fewer computing resources. Thus, the proposed system and model save computing resources, such as processor usage, memory usage, network bandwidth, etc. Therefore, the proposed technology corresponds to a specific technical implementation having a design motivated by technical considerations of the internal functions of a computer.

[0034] As another example technical effect, Max-SA enjoys greater flexibility and higher efficiency than full self-attention, i.e., naturally adapts to different input lengths with linear complexity; in contrast to (shifted) window / local attention, Max-SA allows for more powerful model capacity by proposing a global receptive field. Moreover, with only linear complexity, Max-SA can be used as a general stand-alone attention module in any layer of the network, even in the early high-resolution stages. Thus, the proposed technique corresponds to a specific technical implementation with a design motivated by technical considerations of the internal functions of a computer.

[0035] Referring now to the accompanying drawings, example embodiments of the present disclosure will be discussed in greater detail.

[0036] Example Computer Vision Model

[0037] Example implementations of the present disclosure include a new type of attention module (an example of which may be referred to as a multi-axis self-attention block (Max-SA)) that reduces the quadratic complexity of the original attention to linear without any loss of non-locality by decomposing the fully dense attention mechanism into two sparse forms (local attention and global attention). Due to the flexibility and scalability of Max-SA, the block is able to contribute to the visual backbone (an example of which may be referred to as MaxViT) by simply stacking together alternative layers of Max-SA with convolutional operators in a layered architecture, an example of which is shown in Figure 2 . In some implementations, the convolution operator may include an inverted linear bottleneck layer with a depth-separable convolution. An example convolution block of this type is the MBConv block from Howard et al., Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv: 1704.04861. However, other convolution operators, layers, or blocks may be used in addition or alternatively. MaxViT benefits from global and local receptive fields throughout the network from shallow to deep stages, demonstrating superior performance in both model capacity and generalization ability.

[0038] Example Attention Mechanism

[0039] Self-attention allows spatial mixing of positions across space (or sequences) while also benefiting from content-dependent weights based on normalized pairwise similarities. The standard self-attention defined by Dosovitskiy et al. and Vaswani et al. (cited in full above) is position-independent, i.e., non-translation-equivariant, and therefore does not benefit from the important inductive biases typically instilled in ConvNets. Relative self-attention has been proposed to improve upon the original attention by introducing a relative learned bias added to the attention weights, which has been shown to consistently outperform the original attention on many visual tasks. In this work, some example implementations may use the pre-normalized relative self-attention defined by Dai et al. as the key attention operator in MaxViT. See Dai et al., Coatnet: Marrying convolution and attention for all datasizes, Advances in Neural Information Processing Systems 34 (2021).

[0040] Example of multi-axis attention

[0041] Global interaction is one of the key advantages of self-attention compared to local convolution. However, directly applying attention along the entire space is usually computationally infeasible because the attention operator requires quadratic complexity. To address this issue, this disclosure provides a multi-axis approach to decompose the full-scale attention into two sparse forms: local and global by simply decomposing the spatial axes.

[0042] set up is the input feature map. Instead of applying attention to the flattened spatial dimension HW, the local attention part can block the features into a tensor of shape ( P×P, C), which means it is divided into non-overlapping windows, each of which is of size P×P. Applying self-attention on the local spatial dimension (i.e., P×P) is equivalent to paying attention within a small window. This block attention can be used for local interactions.

[0043] Despite bypassing the well-known heavy computation of full self-attention, local attention models have been observed to underfit on large-scale datasets. Inspired by block attention, the example implementation can utilize a surprisingly simple but effective method to obtain sparse global attention, which can be called grid attention. Instead of using a fixed window size to divide the feature map, the global attention part can use a fixed G×G uniform grid to grid the tensor into a shape (G×G, This produces a self-adaptive size Adopting self-attention on the decomposed grid axes (i.e., G×G) corresponds to the enlarged global spatial mixture of tokens.

[0044] By using the same fixed window and grid size (eg, one example is P=G=7), some example implementations may perfectly balance computations between local and global operations, both of which have only linear complexity with respect to the spatial size or sequence length.

[0045] It should be noted that the proposed example Max-SA module can be a drop-in replacement for the Swin attention module with exactly the same number of parameters and FLOPs. However, it enjoys global interaction capabilities without the need for masking, padding, or circular shifting, which makes it more implementation-friendly and preferable to shifting window schemes. For example, multi-axis attention can be easily implemented using einops (Rogozhnikov, A., Einops: Clear and reliable tensor manipulations with einstein-like notation, in International Conference on Learning Representations (2022)) without modifying the original attention operation.

[0046] In some example implementations, the two types of attention can be stacked in a tandem configuration to obtain both local and global interactions in a single block, such as Figure 3 As shown. Some example implementations also use convolution blocks (e.g., MBConv blocks) before multi-axis attention, because using MBConv together with attention further increases the generalization and trainability of the network. Using a convolutional layer (e.g., MB-Conv layer) before attention provides another advantage: the depth-wise convolution can be considered as a conditional position encoding (CPE), so that the proposed model has no explicit position encoding layer.

[0047] It should be noted that the proposed independent multi-axis attentions can be used together or separately to achieve different purposes: block attention is used for local interactions, and grid attention is used for global blending. These elements can be easily plugged into many vision architectures, especially on high-resolution tasks that can benefit from computationally affordable global interactions.

[0048] Example Schema Variants

[0049] Another example aspect of the present disclosure involves a series of simple architecture variations that explore and demonstrate the effectiveness of the proposed multi-axis self-attention block, such as Figure 2 Some example architectures use a layered backbone similar to common ConvNet practice, where the input is first downsampled using a Conv3x3 layer in the backbone stage (S0). The body of the example network contains four stages (S1-S4), where each stage has half the resolution of the previous stage and has twice the number of channels (hidden dimensions). Figure 2In the example network shown, the same MaxViT block is used throughout the entire backbone. Downsampling can be applied in the depthwise Conv3x3 layer of the first MBConv block at each stage. As a default example, the dilation and contraction rates of the inverted bottleneck and squeeze-excitation (SE) are 4 and 0.25; other values ​​can be used. For all attention blocks, the attention head size can be set to, for example, 32. The example model can be scaled up by increasing the number of blocks B and the channel dimension C per stage. The architectural configurations of the four example MaxViT variants are summarized in Table 1 shown below:

[0050] Table 1: Detailed architecture specifications of the MaxViT series

[0051]

[0052] Example Model Visualization

[0053] As mentioned above, Figure 2 A graphical diagram of an example computer vision model 200 including a plurality of example multi-axis self-attention blocks 202 according to an example embodiment of the present disclosure is depicted. Although a plurality of multi-axis self-attention blocks 202 are shown in the example illustrated model 200, other model architectures according to the present disclosure may include fewer (e.g., one or more) multi-axis self-attention blocks 202. The computer vision model 200 may process an input image 204 to generate an output prediction 206.

[0054] According to one aspect of the present disclosure, each of the one or more multi-axis self-attention blocks 202 may include a local processing portion 208 and a global processing portion 210. The local processing portion 208 may be configured to perform a local attention operation 212 on a first feature data set (e.g., feature data at position 214). The global processing portion 210 is configured to perform a global attention operation 216 on a second feature data set (e.g., feature data at position 218).

[0055] In some implementations, such as Figure 2 As shown, the global processing section 210 and the local processing section 208 are arranged in a series configuration relative to each other. As an example, Figure 2 As shown, the local processing portion 208 may be located before (ie, in terms of data flow) the global processing portion 210. However, in other implementations, the global processing portion 210 may be located before (ie, in terms of data flow) the local processing portion 208.

[0056] In some implementations, such as Figure 2As shown, the local processing portion 208 may include a first feed-forward network 220 after the local attention operation 212, and the global processing portion 210 may include a second feed-forward neural network 222 after the global attention operation 216.

[0057] Reference now Figure 3 , Figure 3 A graphical diagram depicting an example portion of an example multi-axis self-attention block according to an example embodiment of the present disclosure. Specifically, Figure 3 An example local attention operation 312 and an example global attention operation 316 are shown.

[0058] The local attention portion may be configured to perform a local attention operation 312 on the first feature data set (eg, data at position 320) by dividing 322 the first feature data set 320 into a plurality of local windows. Figure 3 As shown, the division 322 has created four local windows, each of which has a size of 4x4. The local attention operation 312 may include performing self-attention separately on each of the multiple local windows. In some implementations, each of the multiple local windows has a predefined window size. In other implementations, the number of local windows can be predefined and the size of the window is adaptive. In some implementations, the multiple local windows can be non-overlapping. In other implementations, the multiple local windows can be overlapping.

[0059] In some implementations, the global attention portion may be configured to perform a global attention operation 316 on the second feature data set (e.g., data at position 324) by dividing 326 the second feature data set 324 into a plurality of global windows based on a grid pattern. For example, the division 326 has produced four global windows, each of which has a defined grid pattern and includes a plurality of non-adjacent feature values. As an example, the grid pattern may be a fixed uniform grid such that the size of each of the plurality of global windows is adaptive. The global attention operation 316 may then include performing self-attention separately on each of the plurality of global windows.

[0060] Now return to reference Figure 2 In some implementations, the multi-axis self-attention block 202 may include a convolution portion 224 configured to perform a convolution operation on a third feature data set (e.g., feature data at position 226). As an example, the convolution portion 224 may be located before the local processing portion 208 and the global processing portion 210 (i.e., in terms of data flow). In some implementations, the convolution portion 224 may include an inverted linear bottleneck layer with a depth-separable convolution and a squeeze and excitation layer.

[0061] like Figure 2 As shown, the example computer vision model 200 may include multiple multi-axis self-attention blocks 202. For example, multiple multi-axis self-attention blocks may be arranged sequentially one after another (e.g., to form a "backbone").

[0062] As discussed, model 200 may process image input 204 to generate output predictions 206. As examples, output predictions 206 may be image classification predictions, image recognition predictions, object recognition predictions, and / or various other computer vision task outputs.

[0063] In other implementations, the model described herein can be used to perform image generation tasks. As an example, Figure 4 Depicted is a graphical diagram of an example network architecture including an example multi-axis self-attention block according to an example embodiment of the present disclosure.

[0064] like Figure 4 As shown, the model may receive an input (e.g., a latent embedding) and, in response, generate an output image. The model may include multiple GAN blocks, each GAN block including a global attention portion and a local attention portion. For example, the global attention portion may be arranged before the local attention portion in a series configuration. In some implementations, each GAN block may also include a convolution block (e.g., an MBConv block) after the local attention portion.

[0065] More specifically, if Figure 4 As shown, in each stage, the model may include and use a cross-attention module to let the feature attention be the latent embedding projected from the input code, which can then be fed into the proposed MaxViT block, which includes grid attention, block attention, and MBConv layers. It should be noted that, unlike Figure 2 Unlike the example model shown in Figure 4 In , the order in which the three layers are applied is reversed: from global to local.

[0066] Example Apparatus and Systems

[0067] Figure 5A A block diagram of an example computing system 100 that performs computer vision tasks according to an example embodiment of the present disclosure is depicted. The system 100 includes a user computing device 102, a server computing system 130, and a training computing system 150 that are communicatively coupled via a network 180.

[0068] The user computing device 102 can be any type of computing device, such as, for example, a personal computing device (e.g., a laptop or desktop computer), a mobile computing device (e.g., a smart phone or tablet computer), a game console or controller, a wearable computing device, an embedded computing device, or any other type of computing device.

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

[0070] In some implementations, the user computing device 102 may store or include one or more machine learning models 120. For example, the machine learning model 120 may be or may otherwise include various machine learning models, such as a neural network (e.g., a deep neural network) or other types of machine learning models, including nonlinear models and / or linear models. The neural network may include a feedforward neural network, a recurrent neural network (e.g., a long short-term memory recurrent neural network), a convolutional neural network, or other forms of neural networks. Some example machine learning models may utilize attention mechanisms, such as self-attention. For example, some example machine learning models may include a multi-head self-attention model (e.g., a Transformer model).

[0071] In some implementations, one or more machine learning models 120 may be received from the server computing system 130 via the 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 device 102 may implement multiple parallel instances of a single machine learning model 120 (e.g., to perform parallel vision tasks across multiple instances of an image).

[0072] Additionally or alternatively, one or more machine learning models 140 may be included in or otherwise stored and implemented by a server computing system 130 that communicates with the user computing device 102 according to a client-server relationship. For example, the machine learning model 140 may be implemented by the server computing system 140 as part of a web service (e.g., a computer vision service). Thus, one or more models 120 may be stored and implemented at the user computing device 102, and / or one or more models 140 may be stored and implemented at the server computing system 130.

[0073] The user computing device 102 may also include one or more user input components 122 that receive user input. For example, the user input component 122 may be a touch-sensitive component (e.g., a touch-sensitive display screen or touchpad) that is sensitive to the touch of a user input object (e.g., a finger or a stylus). The touch-sensitive component may be used to implement a virtual keyboard. Other example user input components include a microphone, a traditional keyboard, or other devices by which a user can provide user input.

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

[0075] In some implementations, the server computing system 130 includes or is otherwise implemented by one or more server computing devices. In instances where the server computing system 130 includes multiple server computing devices, such server computing devices may operate according to a sequential computing architecture, a parallel computing architecture, or some combination thereof.

[0076] As described above, the server computing system 130 may store or otherwise include one or more machine learning models 140. For example, the model 140 may be or may otherwise include various machine learning models. Example machine learning models include neural networks or other multi-layer nonlinear models. Example neural networks include feedforward neural networks, deep neural networks, recurrent neural networks, and convolutional neural networks. Some example machine learning models may utilize attention mechanisms, such as self-attention. For example, some example machine learning models may include a multi-head self-attention model (e.g., a Transformer model).

[0077] User computing device 102 and / or server computing system 130 may train models 120 and / or 140 via interaction with training computing system 150 communicatively coupled via network 180. Training computing system 150 may be separate from server computing system 130 or may be part of server computing system 130.

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

[0079] The training computing system 150 may include a model trainer 160 that trains the machine learning models 120 and / or 140 stored at the user computing device 102 and / or the server computing system 130 using various training or learning techniques (e.g., such as error back propagation). For example, a loss function may be back propagated through the model to update one or more parameters of the model (e.g., based on the gradient of the loss function). Various loss functions may be used, such as mean squared error, likelihood loss, cross entropy loss, hinge loss, and / or various other loss functions. Gradient descent techniques may be used to iteratively update parameters over multiple training iterations.

[0080] In some implementations, performing error backpropagation may include performing truncated backpropagation through time. The model trainer 160 may perform a variety of generalization techniques (eg, weight decay, dropout, etc.) to improve the generalization ability of the model being trained.

[0081] Specifically, model trainer 160 may train machine learning models 120 and / or 140 based on training data set 162. In some implementations, if the user has provided consent, the training examples may be provided by user computing device 102. Thus, in such implementations, model 120 provided to user computing device 102 may be trained by training computing system 150 based on user-specific data received from user computing device 102. In some cases, this process may be referred to as personalizing the model.

[0082] The model trainer 160 includes computer logic for providing the desired functionality. The model trainer 160 can be implemented in hardware, firmware, and / or software that controls a general purpose processor. For example, in some implementations, the model trainer 160 includes a program file stored on a storage device, loaded into a memory, and executed by one or more processors. In other implementations, the model trainer 160 includes one or more computer executable instruction sets stored in a tangible computer readable storage medium such as RAM, a hard disk, or an optical or magnetic medium.

[0083] The network 180 may be any type of communication network, such as a local area network (e.g., an intranet), a wide area network (e.g., the Internet), or some combination thereof, and may include any number of wired or wireless links. In general, communications over the network 180 may be conducted over any type of wired and / or wireless connection using a 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).

[0084] The machine learning models described in this specification can be used for a variety of tasks, applications, and / or use cases.

[0085] In some implementations, the input to the machine learning model of the present disclosure may be image data. The machine learning model may process the image data to generate an output. As an example, the machine learning model may process the image data to generate an image recognition output (e.g., recognition of the image data, potential embedding of the image data, encoded representation of the image data, hashing of the image data, etc.). As another example, the machine learning model may process the image data to generate an image segmentation output. As another example, the machine learning model may process the image data to generate an image classification output. As another example, the machine learning model may process the image data to generate an image data modification output (e.g., a change to the image data, etc.). As another example, the machine learning model may 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 learning model may process the image data to generate an amplified image data output. As another example, the machine learning model may process the image data to generate a prediction output.

[0086] 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 may be image classification, where the output is a set of scores, each score corresponding to a different object class and representing the likelihood that 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 one or more images, and for each region, identifies the likelihood that the region depicts an object of interest. As another example, the image processing task may be image segmentation, where the image processing output defines, for each pixel in one or more images, a corresponding likelihood for each category in a predetermined set of categories. For example, the set of categories may be foreground and background. As another example, the set of categories may be object classes. As another example, the image processing task may be depth estimation, where the image processing output defines a corresponding depth value for each pixel in one or more images. As another example, the image processing task may be motion estimation, where the network input includes multiple images, and the image processing output defines, for each pixel in one of the input images, the motion of the scene depicted at the pixel between the images in the network input.

[0087] Figure 5A An example computing system that can be used to implement the present disclosure is shown. Other computing systems may also be used. For example, in some implementations, the user computing device 102 may include a model trainer 160 and a training data set 162. In such implementations, the model 120 may be both trained and used locally at the user computing device 102. In some of such implementations, the user computing device 102 may implement the model trainer 160 to personalize the model 120 based on user-specific data.

[0088] Figure 5B Depicted is a block diagram of an example computing device 10 that performs in accordance with an example embodiment of the present disclosure. Computing device 10 may be a user computing device or a server computing device.

[0089] Computing device 10 includes multiple applications (e.g., Application 1 to Application N). Each application contains its own machine learning library and machine learning model. For example, each application may include a machine learning model. Example applications include text messaging applications, email applications, dictation applications, virtual keyboard applications, browser applications, etc.

[0090] like Figure 5BAs shown, each application can communicate with multiple other components of the computing device (e.g., such as one or more sensors, context managers, device state components, and / or additional components). In some implementations, each application can 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 the application.

[0091] Figure 5C Depicted is a block diagram of an example computing device 50 that performs in accordance with an example embodiment of the present disclosure. Computing device 50 may be a user computing device or a server computing device.

[0092] The computing device 50 includes a plurality of applications (e.g., Application 1 through Application N). Each application communicates 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 may communicate with the central intelligence layer (and the models stored therein) using an API (e.g., a public API across all applications).

[0093] The central intelligence layer includes multiple machine learning models. For example, Figure 5C As shown, a corresponding machine learning model may be provided for each application, and the corresponding machine learning model may be managed by the central intelligence layer. In other implementations, two or more applications may share a single machine learning model. For example, in some implementations, the central intelligence layer may provide a single model for all applications. In some implementations, the central intelligence layer is included in the operating system of the computing device 50 or is otherwise implemented by the operating system.

[0094] The central intelligence layer may communicate with the central device data layer. The central device data layer may be a centralized data repository for the computing device 50. Figure 5C As shown, the central device data layer can communicate with multiple other components of the computing device (e.g., such as one or more sensors, context managers, device state components, 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).

[0095] Additional disclosure

[0096] The technology discussed herein relates to servers, databases, software applications, and other computer-based systems, as well as the actions taken and the information sent to and from such systems. The inherent flexibility of computer-based systems allows for a variety of possible configurations, combinations, and partitions of tasks and functions between and among components. For example, the 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.

[0097] Although the subject matter has been described in detail with respect to various specific example embodiments of the subject matter, each example is provided by way of explanation, rather than limitation of the present disclosure. Those skilled in the art, after understanding the foregoing, may easily produce changes, modifications, and equivalents to these embodiments. Therefore, the present disclosure does not exclude such modifications, changes, and / or additions to the subject matter that would be readily understood by those of ordinary skill in the art. For example, a feature shown or described as part of one embodiment may be used together with another embodiment to produce yet another embodiment. Therefore, the present disclosure is intended to cover these changes, modifications, and equivalents.

Claims

1. A computing system for performing computer vision tasks with improved efficiency, the computing system comprising: one or more processors; as well as One or more non-transitory computer-readable media that collectively store: A machine learning computer vision model configured to process input image data to generate output predictions, wherein the machine learning computer vision model comprises one or more multi-axis self-attention blocks, each of the one or more multi-axis self-attention blocks comprising: a local processing portion configured to perform a local attention operation on the first feature data set; and a global processing section configured to perform a global attention operation on the second feature data set; Wherein, the global processing portion and the local processing portion are arranged in a series configuration relative to each other.

2. The computing system of claim 1, wherein: For at least one of the one or more multi-axis self-attention blocks, the local processing part is located before the global processing part.

3. A computing system as claimed in any preceding claim, wherein: At least one of the one or more multi-axis self-attention blocks includes a convolution part, which is configured to perform a convolution operation on a third feature data set.

4. The computing system of claim 3, wherein: For at least one of the one or more multi-axis self-attention blocks, the convolution part is located before the local processing part and the global processing part.

5. The computing system of claim 3 or claim 4, wherein the convolutional portion comprises an inverted linear bottleneck layer with depthwise separable convolutions.

6. A computing system as described in any preceding claim, wherein the machine learning computer vision model includes a plurality of multi-axis self-attention blocks.

7. The computing system of claim 6, wherein the plurality of multi-axis self-attention blocks are arranged in a one-after-another order.

8. The computing system of any preceding claim, wherein the local attention portion is configured to perform the local attention operation on the first feature data set by: Dividing the first feature data set into a plurality of local windows; and Self-attention is performed separately on each of the multiple local windows.

9. The computing system of claim 8, wherein: Each of the plurality of partial windows has a predefined window size.

10. A computing system as claimed in any preceding claim, wherein: The global attention part is configured to perform the global attention operation on the second feature data set in the following manner: dividing the second feature data set into a plurality of global windows based on a grid pattern; and Self-attention is performed separately on each of the multiple global windows.

11. The computing system of claim 10, wherein: The grid pattern includes a fixed uniform grid such that a size of each of the plurality of global windows is adaptive.

12. The computing system of claim 1, wherein: For at least one of the one or more multi-axis self-attention blocks, the local processing part includes a first feed-forward network after the local attention operation, and the global processing part includes a second feed-forward neural network after the global attention operation.

13. A computing system as claimed in any preceding claim, wherein: The output prediction includes an image classification prediction, an image recognition prediction, or an object recognition prediction.

14. A computer-implemented method for performing a computer vision task, the method comprising: Get the input image; Processing the input image using a machine learning computer vision model to generate an output prediction, wherein processing the input image using the machine learning computer vision model comprises: at each of one or more multi-axis self-attention blocks of the machine learning computer vision model: At the local processing part of the multi-axis self-attention block: Performing a first partitioning operation to partition the first feature data set into a plurality of local windows; and performing a corresponding local attention operation on each of the plurality of local windows; and At the global processing part of the multi-axis self-attention block: performing a second partitioning operation to partition the second feature data set into a plurality of global windows; and performing a corresponding global attention operation on each of the plurality of global windows; wherein the local processing section and the global processing section are arranged in a series configuration relative to each other; and The output prediction is provided as an output.

15. The computer-implemented method of claim 14, wherein: For at least one of the one or more multi-axis self-attention blocks, the local processing part is located before the global processing part.

16. The computer-implemented method of claim 14 or 15, wherein: At least one of the one or more multi-axis self-attention blocks includes a convolution part, which is configured to perform a convolution operation on a third feature data set.

17. The computer-implemented method of claim 16, wherein: For at least one of the one or more multi-axis self-attention blocks, the convolution part is located before the local processing part and the global processing part.

18. The computer-implemented method of claim 16 or 17, wherein: The convolution part includes an inverted linear bottleneck layer with depthwise separable convolution.

19. The computer-implemented method of any one of claims 14 to 18, wherein: The machine learning computer vision model includes a plurality of multi-axis self-attention blocks arranged in a sequence one after another.

20. A computing system for performing image generation tasks with improved efficiency, the computing system comprising: one or more processors; as well as One or more non-transitory computer-readable media that collectively store: A machine learning image generation model configured to process input data to generate an output image, wherein the machine learning image generation model comprises one or more multi-axis self-attention blocks, each of the one or more multi-axis self-attention blocks comprising: a global processing portion configured to perform a global attention operation on the second feature data set; and a local processing part, the local processing part being configured to perform a local attention operation on the first feature data set; Wherein, the global processing portion and the local processing portion are arranged in a series configuration relative to each other.