System and method for machine learning model having convolution and attention

By integrating a relative attention mechanism into machine learning convolutional attention networks, the method addresses the computational cost and accuracy issues in combining convolution and attention, resulting in efficient and accurate computer vision performance.

JP2025060604AActive Publication Date: 2025-04-10GOOGLE LLC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2024207410
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2021-05-27
Filing Date
2024-11-28
Publication Date
2025-04-10
Estimated Expiration
2042-05-27

AI Technical Summary

Technical Problem

Existing techniques for combining convolution and attention in machine learning models face challenges such as increased computational costs, which hinder their efficiency and accuracy in applications like computer vision.

Method used

The implementation of a computer-implemented method using a machine learning convolutional attention network that incorporates a relative attention mechanism, which combines a static convolution kernel with an adaptive attention matrix to reduce computational costs while improving accuracy.

Benefits of technology

This approach reduces computational costs and enhances accuracy in computer vision tasks by effectively unifying convolution and attention mechanisms, achieving state-of-the-art performance with fewer parameters and operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025060604000001_ABST
    Figure 2025060604000001_ABST
Patent Text Reader

Abstract

To perform computer vision with reduced computational cost and improved accuracy.SOLUTION: A method by a computing system, comprising one or more computing devices, comprises: acquiring input data including an input tensor having one or more dimensions; providing the input data to a machine learning convolutional attention network; in response to providing the input data to the machine learning convolutional attention network, receiving, by the computing system, a machine learning prediction from the machine learning convolutional attention network. The convolutional attention network includes at least one attention block, the attention block includes a relative attention mechanism, and the relative attention mechanism includes the sum of a static convolution kernel and an adaptive attention matrix.SELECTED DRAWING: Figure 5
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] Related Applications This application claims priority to and the benefit of U.S. Provisional Patent Application No. 63 / 194,077, filed May 27, 2021. U.S. Provisional Patent Application No. 63 / 194,077 is incorporated herein by reference in its entirety.

[0002] The present disclosure relates generally to machine learning. More particularly, the present disclosure relates to systems and methods for machine learning based models with convolution and attention. [Background technology]

[0003] Machine learning refers to a class of learning algorithms that give predictions for input data. Convolutional Neural Networks, or CNNs, are a class of machine learning models that utilize convolutional frames in neural networks. Transformers are a class of machine learning models that utilize attention mechanisms to weight distinct portions of input data. Existing approaches to combine convolution and attention face drawbacks such as increased computational cost. Summary of the Invention [Means for solving the problem]

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

[0005] One exemplary aspect of the present disclosure is directed to a computer-implemented method for performing computer vision with reduced computational cost and improved accuracy. The computer-implemented method includes obtaining input data, including an input tensor having one or more dimensions, by a computing system including one or more computing devices. The computer-implemented method includes providing the input data to a machine-learned convolutional attention network, by the computing system, the machine-learned convolutional attention network including two or more network stages, each of the two or more network stages including one of an attention stage or a convolution stage. The computer-implemented method includes receiving, by the computing system, a machine-learned prediction from the machine-learned convolutional attention network in response to providing the input data to the machine-learned convolutional attention network. The attention stage includes a relative attention mechanism, the relative attention mechanism including a sum of a static convolution kernel and an adaptive attention matrix.

[0006] Another exemplary aspect of the present disclosure is directed to a computer-implemented method for performing computer vision with reduced computational cost and improved accuracy. The computer-implemented method includes obtaining input data, including an input tensor having one or more dimensions, by a computing system including one or more computing devices. The computer-implemented method includes providing the input data to a machine-learned convolutional attention network, by the computing system. The machine-learned convolutional attention network includes a downsampling stage configured to reduce spatial resolution relative to the input tensor, and one or more attention blocks including a relative attention mechanism, the relative attention mechanism including a sum of a static convolution kernel and an adaptive attention matrix. The computer-implemented method includes receiving, by the computing system, a machine-learned prediction from the machine-learned convolutional attention network in response to providing the input data to the machine-learned convolutional attention network.

[0007] Another exemplary aspect of the present disclosure is directed to a computer-implemented method for performing computer vision with reduced computational cost and improved accuracy. The computer-implemented method includes obtaining input data, including an input tensor having one or more dimensions, by a computing system including one or more computing devices. The computer-implemented method includes providing the input data, by the computing system, to a machine-learned convolutional attention network, the machine-learned convolutional attention network including a plurality of network stages. The plurality of network stages includes an S0 stage including a two-layer convolutional stem network, an S1 stage including a convolutional block with squeezed excitation, an S2 stage including a convolutional block, an S3 stage including a convolutional block, an S4 stage including an attention block, and an S5 stage including an attention block. Each of the S4 stage and the S5 stage includes a relative attention mechanism including a sum of a static convolution kernel and an adaptive attention matrix. The spatial resolution is reduced in each of the plurality of network stages. The number of channels is increased in each of the plurality of network stages. The computer-implemented method includes receiving, by a computing system, a machine learning prediction from the machine learning convolutional attention network in response to providing input data to the machine learning convolutional attention network.

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

[0009] 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 exemplary embodiments of the present disclosure and, together with the description, serve to explain related principles.

[0010] The appendix describes in more detail exemplary implementations of the proposed techniques. The appendix is ​​incorporated into and forms a part of this disclosure. However, the disclosure is not limited to the exemplary implementations given in the appendix.

[0011] Detailed descriptions of embodiments directed to persons skilled in the art are set forth herein and refer to the accompanying figures. [Brief description of the drawings]

[0012] [Figure 1A] FIG. 1 is a block diagram of an exemplary computing system for implementing computer vision with reduced computational cost and increased accuracy, in accordance with an exemplary embodiment of the present disclosure. [Figure 1B] FIG. 1 is a block diagram of an exemplary computing device for implementing computer vision with reduced computational cost and improved accuracy, in accordance with an exemplary embodiment of the present disclosure. [Figure 1C] FIG. 1 is a block diagram of an exemplary computing device for implementing computer vision with reduced computational cost and improved accuracy, in accordance with an exemplary embodiment of the present disclosure. [Diagram 2] FIG. 1 is a block diagram of an exemplary Convolutional Attention Network (CoAtNet) model in accordance with an exemplary embodiment of the present disclosure. [Diagram 3] FIG. 1 is a block diagram of an exemplary convolutional attention network model according to an exemplary embodiment of the present disclosure. [Figure 4] FIG. 1 is a block diagram of an exemplary convolutional attention network model according to an exemplary embodiment of the present disclosure. [Diagram 5] FIG. 1 is a flowchart diagram of an exemplary method for performing computer vision with reduced computational cost and improved accuracy, according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0013] Reference numbers that are repeated among the figures identify like features in various implementations.

[0014] In general, the present disclosure is directed to systems and methods for machine learning based models with convolution and attention. In particular, the systems and methods according to the exemplary aspects of the present disclosure may include a convolution block and / or an attention block. According to the exemplary aspects of the present disclosure, the attention block may include a relative attention mechanism. In particular, the exemplary aspects of the present disclosure recognize that the relative attention described above may be considered as a natural mixture of depth-wise convolution and content-based attention. Furthermore, the exemplary aspects of the present disclosure recognize that both depth-wise convolution and self-attention may be represented as a weighted sum of values ​​in a receptive field. Thus, the relative attention mechanism may include a sum of a static convolution kernel and an adaptive attention matrix. This sum may be applied prior to and / or subsequent to softmax normalization by the relative attention mechanism. As an example, the relative attention mechanism (e.g., applied prior to softmax normalization) may include:

[0015]

number

[0016] As another example, a relative attention mechanism (e.g., applied following softmax regularization) can be expressed mathematically as:

[0017]

number

[0018] It can be mathematically expressed as:

[0019] In the above equation, the depthwise convolution kernel w i-j is an input-dependent parameter with a static value for a given index in the input tensor (i,j) (e.g., the relative shift between indices i to j; the dependence on the relative shift rather than on a specific value is called transformation equivalence, which may improve generalization under datasets of limited size), and x iand x j are the input and output at location i, respectively, and G is the global acceptance field (e.g., the entire set of locations).

[0020] The use of global receptive fields (as opposed to the limited local receptive fields traditionally utilized in convolutional networks, for example) can improve the ability to capture complex relational interactions between different spatial locations, which may be desirable when processing higher-level concepts. The denominator term is the attention weight, i.e., A i,j The attention weights can be jointly determined by the depthwise convolution kernel and the transformation equivalence of the input-adaptive input-output pair, which can provide properties of both to varying degrees, improving the generalization, capacity, and / or accuracy of the model.

[0021] These attention blocks with relative self-attention can be utilized in networks with convolution and attention (referred to herein as "CoAtNet" models) to improve the fusion of benefits from convolution and attention. For example, the models can have the high accuracy and efficiency associated with convolutional networks, as well as robustness against overfitting, relatively low computational cost, reduced memory usage, and / or relatively small parameter size, while further providing the ability to learn complex relational interactions between spatial locations in the input data associated with transformers.

[0022] Systems and methods according to exemplary aspects of the present disclosure (e.g., utilizing attention blocks with relative attention) can provide several technical effects and benefits, including improvements to computer technology. As an example, systems and methods according to exemplary aspects of the present disclosure can unify convolution and attention to provide improved generalization, model capacity, and / or efficiency. For example, systems and methods according to exemplary aspects of the present disclosure can more effectively manage the trade-off between improved generalization (e.g., similar to convolutional networks) and improved model capacity (e.g., similar to transformers). For example, some exemplary implementations of the present disclosure can achieve state-of-the-art performance under different data sizes and computational budgets.

[0023] The improvements provided by the proposed model architecture (e.g., generalization and / or model capacity) can provide improved model accuracy, improved scope of input data types and / or dimensions, reduced consumption of computational resources (e.g., faster computation speed, fewer computation cycles, reduced processor or memory usage, etc.), especially for unknown input data, and / or other improvements over existing models. In particular, the models proposed herein can achieve performance comparable to state-of-the-art convolutional neural networks while having a smaller number of parameters. As an example, an exemplary implementation of the CoAtNet model can achieve comparable best accuracy on the ImageNet dataset with only 40% of the number of parameters and 70% of the FLOPs.

[0024] As another exemplary technical effect, the hybrid convolution and attention architecture described herein may enable more efficient use of dedicated hardware, such as processors (e.g., graphics processing units), that were dedicated to implementing the convolution and attention mechanisms. For example, the convolution stage of the proposed hybrid model may be implemented by hardware dedicated to convolution operations, and the attention stage of the proposed hybrid model may be implemented by hardware dedicated to attention operations. For example, the convolution operations of the convolution stage of the proposed hybrid model may be implemented in parallel by multiple processors.

[0025] Systems and methods according to exemplary aspects of the present disclosure can be applied to a variety of machine learning tasks, particularly tasks that traditionally utilize convolutional neural networks. By way of example, the machine learning task may be a computer vision task, such as object detection, object recognition, image classification, semantic segmentation, video recognition, video classification, video segmentation, etc. As another example, the machine learning task may be a multi-modality application, such as one that involves additional signals (e.g., visual signals), such as image captioning, video captioning, etc.

[0026] Referring now to the drawings, exemplary embodiments of the present disclosure will be discussed in further detail.

[0027] 1A illustrates a block diagram of an exemplary computing system 100 for implementing computer vision with reduced computational cost and improved accuracy in accordance with an exemplary embodiment of the present disclosure. 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.

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

[0029] 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 a single processor or multiple 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 that are executed by the processor 112 to cause the user computing device 102 to perform operations.

[0030] In some implementations, the user computing device 102 may store or include one or more machine learning models 120. For example, the machine learning models 120 may be or may otherwise include various machine learning models, such as neural networks (e.g., deep neural networks) or other types of machine learning models including nonlinear and / or linear models. The neural networks may 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. Some exemplary machine learning models may leverage attention mechanisms such as self-attention. For example, some exemplary machine learning models may include multi-headed self-attention models (e.g., transformer models). Exemplary machine learning models 120 (e.g., CoAtNet models) are discussed with reference to FIGS. 2-3.

[0031] In some implementations, one or more machine learning based models 120 may be received from the server computing system 130 over the network 180, stored in the user computing device memory 114, and then used or otherwise implemented by one or more processors 112. In some implementations, the user computing device 102 may implement multiple parallel instances of a single machine learning based model 120 (e.g., to perform parallel computer vision across multiple instances of the CoAtNet model).

[0032] Additionally or alternatively, one or more machine learning based 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 based models 140 may be implemented by the server computing system 130 as part of a web service (e.g., a computer vision service such as image classification). 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.

[0033] 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 stylus). The touch-sensitive component may be useful for implementing a virtual keyboard. Other exemplary user input components include a microphone, a traditional keyboard, or other means by which a user may provide user input.

[0034] The server computing system 130 includes one or more processors 132 and a 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 a single processor or multiple 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.

[0035] 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 multiple server computing devices, such server computing devices may operate according to a sequential computing architecture, a parallel computing architecture, or some combination thereof.

[0036] As described above, the server computing system 130 may store or otherwise include one or more machine learning based models 140. For example, the models 140 may be or otherwise include various machine learning based models. Exemplary machine learning based models include neural networks or other multi-layer nonlinear models. Exemplary neural networks include feed-forward neural networks, deep neural networks, recurrent neural networks, and convolutional neural networks. Some exemplary machine learning based models may leverage attention mechanisms such as self-attention. For example, some exemplary machine learning based models may include a multi-headed self-attention model (e.g., a transformer model). Exemplary models 140 are discussed with reference to FIGS. 2-3.

[0037] The user computing device 102 and / or the server computing system 130 can train the models 120 and / or 140 by interacting with a training computing system 150 that is communicatively coupled via a network 180. The training computing system 150 may be separate from the server computing system 130 or may be part of the server computing system 130.

[0038] The training computing system 150 includes one or more processors 152 and a 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 a single 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, magnetic disks, etc., and combinations thereof. The memory 154 may store data 156 and instructions 158 that are 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.

[0039] The training computing system 150 may include a model trainer 160 that trains the machine learning based models 120 and / or 140 stored in the user computing device 102 and / or the server computing system 130 using various training or learning techniques, such as, for example, backpropagation. For example, a loss function may be backpropagated 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 the parameters for several training iterations.

[0040] In some implementations, performing the error backpropagation may include performing truncated backpropagation over time. The model trainer 160 can implement several generalization techniques (e.g., weight decay, dropout, etc.) to improve the generalization ability of the trained model.

[0041] In particular, model trainer 160 can train machine learning based models 120 and / or 140 based on a set of training data 162. Training data 162 may include, for example, a corpus of task-specific training data or other datasets, such as an image classification database (e.g., ImageNet, JFT300M, etc.).

[0042] In some implementations, if the user has given consent, the training examples may be provided by the user computing device 102. Thus, in such implementations, the model 120 provided to the user computing device 102 may be trained by the training computing system 150 against user-specific data received from the user computing device 102. In some instances, this process may be referred to as individualizing the model.

[0043] The model trainer 160 includes computer logic used to provide the desired functionality. The model trainer 160 can be implemented in hardware, firmware, and / or software controlling a general-purpose processor. For example, in some implementations, the model trainer 160 includes program files stored on a storage device, loaded into memory, and executed by one or more processors. In other implementations, the model trainer 160 includes one or more sets of computer-executable instructions stored in a tangible computer-readable storage medium, such as a RAM, a hard disk, or an optical or magnetic medium.

[0044] Network 180 may be any type of communications 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 network 180 may be carried over any type of wired and / or wireless connections, using a wide variety of communications 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).

[0045] The machine learning models described herein may be used in a variety of tasks, applications, and / or use cases.

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

[0047] In some implementations, the input to the machine learning based model of the present disclosure may be text or natural language data. The machine learning based model may process the text or natural language data to generate an output. As an example, the machine learning based model may process the natural language data to generate a language encoding output. As another example, the machine learning based model may process the text or natural language data to generate a latent text embedding output. As another example, the machine learning based model may process the text or natural language data to generate a transformation output. As another example, the machine learning based model may process the text or natural language data to generate a classification output. As another example, the machine learning based model may process the text or natural language data to generate a text segmentation output. As another example, the machine learning based model may process the text or natural language data to generate a semantic intent output. As another example, the machine learning based model may 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 of higher quality than the input text or natural language, etc.). As another example, the machine learning based model may process the text or natural language data to generate a prediction output.

[0048] In some implementations, the input to the machine learning based model of the present disclosure may be audio data. The machine learning based model may process the audio data to generate an output. As an example, the machine learning based model may process the audio data to generate a speech recognition output. As another example, the machine learning based model may process the audio data to generate a speech conversion output. As another example, the machine learning based model may process the audio data to generate a latent embedding output. As another example, the machine learning based model may process the audio data to generate an encoded audio output (e.g., an encoded and / or compressed representation of the audio data, etc.). As another example, the machine learning based model may process the audio data to generate an upscaled audio output (e.g., audio data of higher quality than the input audio data, etc.). As another example, the machine learning based model may process the audio data to generate a text representation output (e.g., a text representation of the input audio data, etc.). As another example, the machine learning based model may process the audio data to generate a predicted output.

[0049] In some implementations, the input to the machine learning based model of the present disclosure may be latent coding data (e.g., a latent space representation of the input, etc.). The machine learning based model may process the latent coding data to generate an output. As an example, the machine learning based model may process the latent coding data to generate a recognition output. As another example, the machine learning based model may process the latent coding data to generate a reconstruction output. As another example, the machine learning based model may process the latent coding data to generate an exploration output. As another example, the machine learning based model may process the latent coding data to generate a reclustering output. As another example, the machine learning based model may process the latent coding data to generate a prediction output.

[0050] In some implementations, the input to the machine learning based model of the present disclosure may be statistical data. The statistical data may be, represent, or otherwise include data calculated and / or derived from some other data source. The machine learning based model may process the statistical data to generate an output. As an example, the machine learning based model may process the statistical data to generate a recognition output. As another example, the machine learning based model may process the statistical data to generate a prediction output. As another example, the machine learning based model may process the statistical data to generate a classification output. As another example, the machine learning based model may process the statistical data to generate a segmentation output. As another example, the machine learning based model may process the statistical data to generate a visualization output. As another example, the machine learning based model may process the statistical data to generate a diagnostic output.

[0051] In some implementations, the input to the machine learning based models of the present disclosure may be sensor data. The machine learning based models may process the sensor data to generate an output. As an example, the machine learning based models may process the sensor data to generate a recognition output. As another example, the machine learning based models may process the sensor data to generate a prediction output. As another example, the machine learning based models may process the sensor data to generate a classification output. As another example, the machine learning based models may process the sensor data to generate a segmentation output. As another example, the machine learning based models may process the sensor data to generate a visualization output. As another example, the machine learning based models may process the sensor data to generate a diagnostic output. As another example, the machine learning based models may process the sensor data to generate a detection output.

[0052] In some cases, the machine learning based model may be configured to perform a task that includes encoding input data for reliable and / or efficient transmission or storage (and / or corresponding decoding). For example, the task may be an audio compression task. The input may include audio data and the output may include compressed audio data. In another example, the input may include visual data (e.g., one or more images or videos) and the output may include compressed visual data, and the task is a visual data compression task. In another example, the task may include generating an embedding for the input data (e.g., input audio or visual data).

[0053] 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 a likelihood that one or more images show 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, a likelihood that the region shows 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 respective 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, for each pixel in one or more images, a respective depth value. 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 of one of the input images, the scene motion represented in pixels between the images in the network input.

[0054] In some cases, the input includes audio data representing speech and the task is a speech recognition task. The output may include text output that is mapped to the speech. In some cases, the task includes encrypting or decrypting input data. In some cases, the task includes a microprocessor-implemented task such as branch prediction or memory address translation.

[0055] 1A illustrates one exemplary computing system that can be used to implement the present disclosure. Other computing systems may be used. For example, in some implementations, the user computing device 102 may include a model trainer 160 and a training dataset 162. In such implementations, the model 120 can be both trained and used locally on the user computing device 102. In some of such implementations, the user computing device 102 can implement the model trainer 160 to personalize the model 120 based on user-specific data.

[0056] 1B illustrates a block diagram of an exemplary computing device 10 for implementing an exemplary embodiment of the present disclosure. The computing device 10 may be a user computing device or a server computing device.

[0057] The computing device 10 includes several applications (e.g., applications 1-N). Each application includes its own machine learning library and machine learning model. For example, each application may include a machine learning model. Exemplary applications include a text messaging application, an email application, a dictation application, a virtual keyboard application, a browser application, etc.

[0058] 1B, each application may communicate with several other components of the computing device, such as one or more sensors, a context manager, a device state component, and / or additional components. In some implementations, each application may 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.

[0059] 1C illustrates a block diagram of an exemplary computing device 50 for implementing according to an exemplary embodiment of the present disclosure. The computing device 50 may be a user computing device or a server computing device.

[0060] Computing device 50 includes several applications (e.g., applications 1-N). Each application communicates with a central intelligence layer. Exemplary 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 the models stored therein) using an API (e.g., a common API across all applications).

[0061] The central intelligence layer includes several machine learning models. For example, as shown in FIG. 1C, a respective machine learning model may be provided to each application and 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 to all of the applications. In some implementations, the central intelligence layer is included in or otherwise implemented by the operating system of the computing device 50.

[0062] The central intelligence layer can communicate with a central device data layer, which can be a centralized repository of data for computing devices 50. As shown in FIG. 1C, the central device data layer can communicate with several other components of the computing device, such as 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).

[0063] 2 illustrates a block diagram of an exemplary Convolutional Attention Network (CoAtNet) model 200 according to an exemplary embodiment of the present disclosure. In some implementations, the model 200 is trained to receive a set of input data 202 describing, for example, image data, or other task-specific input data, and to provide, as a result of receiving the input data 202, output data 204 responsive to a particular machine learning task, such as a computer vision task (e.g., image classification).

[0064] According to an exemplary embodiment of the present disclosure, the model 200 may include a downsampling stage 210. The downsampling stage 210 may reduce the spatial resolution of the input data 202. For example, if the input data 202 includes tensors, the downsampling stage 210 may reduce the spatial resolution such that the output of the downsampling stage 210 has at least one dimension or resolution that is lower than that of the tensors of the input data 202. Additionally and / or alternatively, the downsampling stage 210 may increase the number of channels relative to the input data. In some implementations, the downsampling stage 210 may be or include a convolutional stem. The convolutional stem may have an aggressive stride, such as a stride greater than 10.

[0065] Additionally and / or alternatively, the model 200 may include one or more attention blocks 212. The attention block 212 may receive the downsampled input data from the downsampling stage 210 and produce the output data 204. The attention block 212 may implement a relative attention mechanism. In some implementations, the attention block 212 may be a transformer block that operates similarly to a transformer network.

[0066] According to an exemplary embodiment of the present disclosure, the attention block 212 may include a relative attention mechanism. The relative attention mechanism may include a sum of a static convolution kernel and an adaptive attention matrix. This sum may be applied prior to and / or subsequent to softmax normalization by the relative attention mechanism. As an example, the relative attention mechanism (e.g., applied prior to softmax normalization) may include:

[0067]

number

[0068] As another example, a relative attention mechanism (e.g., applied following softmax regularization) can be expressed mathematically as:

[0069]

number

[0070] It can be mathematically expressed as:

[0071] In the above equation, the depthwise convolution kernel w i-j is an input-dependent parameter with a static value for a given index in the input tensor (i,j) (e.g., the relative shift between indices i to j; the dependence on the relative shift rather than on a specific value is called transformation equivalence, which may improve generalization under datasets of limited size), and x i and x j are the input and output at location i, respectively, and G is the global acceptance field (e.g., the entire set of locations).

[0072] The use of global receptive fields (as opposed to the limited local receptive fields traditionally utilized in convolutional networks, for example) can improve the ability to capture complex relational interactions between different spatial locations, which may be desirable when processing higher-level concepts. The denominator term is the attention weight, i.e., A i,j The attention weights can be jointly determined by the depthwise convolution kernel and the transformation equivalence of the input-adaptive input-output pair, which can provide properties of both to varying degrees, improving the generalization, capacity, and / or accuracy of the model.

[0073] 3 illustrates a block diagram of an exemplary Convolutional Attention Network (CoAtNet) model 300 according to an exemplary embodiment of the present disclosure. In some implementations, the model 300 is trained to receive a set of input data 202 describing, for example, image data, or other task-specific input data, and to provide, as a result of receiving the input data 202, output data 204 responsive to a particular machine learning task, such as a computer vision task (e.g., image classification).

[0074] The machine learning convolutional attention network 300 may include two or more network stages (e.g., 302, 304, 306, 308, and 310). Each of the two or more network stages may be or include one of an attention stage or a convolution stage, such that the convolution stage precedes the attention stage in order. As an example, in some implementations, the two or more network stages may include an S0 stage 302, an S1 stage 304, an S2 stage 306, an S3 stage 308, and an S4 stage 310. Each of these stages may be a convolution stage including one or more convolution blocks (e.g., MBConv blocks) or an attention stage including one or more attention blocks with a relative attention mechanism. As another example, in some implementations, the convolution blocks may perform a depthwise separable convolution (e.g., across multiple channels). Additionally and / or alternatively, in some implementations, the convolution blocks may perform an inverse bottleneck convolution. In some implementations, the spatial resolution tapers off over two or more network stages. In some implementations, the number of channels can be increased (e.g., doubled) in any of the stages, such as at least one of the S1 stage 304, the S2 stage 306, the S3 stage 308, or the S4 stage 310.

[0075] In some implementations, the S0 stage 302 includes a two-layer convolutional stem network. Additionally and / or alternatively, the S1 stage 304 may include one or more convolution blocks with squeezed excitation. One or more convolution blocks of the S1 stage and / or other convolution stages may include an MBConv block. The MBConv block may be configured to expand a channel size from an original channel size of the input to the one or more convolution blocks, and then back-project the expanded channel size to the original channel size. As another example, in some implementations, the convolution block may perform a depthwise separable convolution (e.g., across multiple channels). Additionally and / or alternatively, in some implementations, the convolution block may perform an inverse bottleneck convolution. In some implementations, the width of the S0 stage 302 is equal to or less than the width of the S1 stage 304. In some implementations, each of the S0 stage 302, S1 stage 304, and S4 stage 310 includes (e.g., exactly) two blocks, and each of the S2 stage 306 and S3 stage 308 includes more than two blocks. For example, in one particular implementation, the two or more network stages include an S0 stage 302 including a two-layer convolutional stem network, an S1 stage 304 including a convolutional block with squeezed excitation, an S2 stage 306 including a convolutional block, an S3 stage 308 including an attention block, and an S4 stage 310 including an attention block, each of the S3 stage 308 and S4 stage 310 including a relative attention mechanism configured to determine a sum of a static convolution kernel and an adaptive attention matrix.

[0076] The attention block and / or stage (e.g., S3 and / or S4 stages 308, 310) may include a relative attention mechanism according to an exemplary embodiment of the present disclosure. The relative attention mechanism may include a sum of a static convolution kernel and an adaptive attention matrix. This sum may be applied prior to and / or subsequent to softmax normalization by the relative attention mechanism. As an example, the relative attention mechanism (e.g., applied prior to softmax normalization) may include:

[0077]

number

[0078] It can be mathematically expressed as:

[0079] As another example, a relative attention mechanism (e.g., applied following softmax regularization) may be

[0080]

number

[0081] It can be mathematically expressed as:

[0082] In the above equation, the depthwise convolution kernel w i-j is an input-dependent parameter with a static value for a given index in the input tensor (i,j) (e.g., the relative shift between indices i to j; the dependence on the relative shift rather than on a specific value is called transformation equivalence, which may improve generalization under datasets of limited size), and x i and x j are the input and output at location i, respectively, and G is the global acceptance field (e.g., the entire set of locations).

[0083] FIG. 4 illustrates a block diagram of an exemplary convolutional attention network (CoAtNet) model 400 according to an exemplary embodiment of the present disclosure. As shown in FIG. 4, the model 400 may include S0, S1, S2, S3, and S4 stages. For example, the S0 stage, or stem stage, may include two (e.g., 3×3) convolutional layers (e.g., with a stride of 2). Furthermore, the convolutional S1 and S2 stages may each include a 1×1 convolutional layer, a 3×3 deconvolutional layer, and a 1×1 convolutional layer. Furthermore, the attention (e.g., S3 and S4) stages may each include a relative attention mechanism and a feedforward network. The model may further include a global pooling layer and a fully connected layer to produce a model output. Each of the stages may be repeated as many times as designed.

[0084] 5 shows a flow chart diagram of an exemplary method performed in accordance with an exemplary embodiment of the present disclosure. Although FIG. 5 shows steps performed in a specific order for purposes of explanation and discussion, the method of the present disclosure is not limited to the specifically shown order or sequence. Various steps of method 500 may be omitted, rearranged, combined, and / or adapted in various ways without departing from the scope of the present disclosure.

[0085] The method 500 may include, at 502, obtaining (e.g., by a computing system including one or more computing devices) input data including an input tensor having one or more dimensions. For example, the input tensor may be a two-dimensional tensor having a length and / or a width. Additionally and / or alternatively, the input tensor may have one or more channels. In some implementations, for example, the input tensor may be or include image data, such as an image having a length, width, and / or multiple color channels.

[0086] The method 500 may include providing (e.g., by a computing system) the input data to a machine learning convolutional attention network, at 504. The machine learning convolutional attention network may be any suitable network according to example aspects of the disclosure, such as networks 200 and / or 300 of FIG. 2 and / or FIG.

[0087] For example, in some implementations, a machine learning convolutional attention network may include two or more network stages, each of which includes one of an attention stage or a convolution stage, with the convolution stage preceding the attention stage in order. As an example, in some implementations, the two or more network stages may include an S0 stage, an S1 stage, an S2 stage, an S3 stage, and an S4 stage. Each of these stages may be a convolution stage including one or more convolution blocks (e.g., MBConv blocks) or an attention stage including one or more attention blocks with a relative attention mechanism. In some implementations, the spatial resolution decreases gradually over the two or more network stages. In some implementations, the number of channels may be increased (e.g., doubled) in any of the stages, such as at least one of the S1 stage, the S2 stage, the S3 stage, or the S4 stage.

[0088] In some implementations, the S0 stage includes a two-layer convolutional stem network. Additionally and / or alternatively, the S1 stage may include one or more convolutional blocks with squeezed excitation. One or more convolutional blocks of the S1 stage and / or other convolutional stages may include an MBConv block. The MBConv block may be configured to expand a channel size from an original channel size of the input to the one or more convolutional blocks, and then backproject the expanded channel size to the original channel size. As another example, in some implementations, the convolutional block may perform a depthwise separable convolution (e.g., across multiple channels). Additionally and / or alternatively, in some implementations, the convolutional block may perform an inverse bottleneck convolution. In some implementations, the width of the S0 stage is equal to or less than the width of the S1 stage. In some implementations, the S0 stage, the S1 stage, and the S5 stage each include (e.g., exactly) two blocks, and the S2 stage and the S3 stage each include more than two blocks. For example, in one particular implementation, the two or more network stages include an S0 stage including a two-layer convolutional stem network, an S1 stage including a convolution block with squeezed excitation, an S2 stage including a convolution block, an S3 stage including an attention block, and an S4 stage including an attention block, each of the S3 stage and the S4 stage including a relative attention mechanism configured to determine a sum of a static convolution kernel and an adaptive attention matrix.

[0089] As another example, in some implementations, a machine learning convolutional attention network may include a downsampling stage configured to reduce spatial resolution relative to an input tensor, and one or more attention blocks including a relative attention mechanism. The downsampling stage may reduce spatial resolution to improve the feasibility of performing the calculation. For example, if the input data includes a tensor, the downsampling stage may reduce spatial resolution such that the output of the downsampling stage has at least one dimension or resolution that is lower than that of the tensor of the input data. Additionally and / or alternatively, the downsampling stage may increase the number of channels relative to the input data. In some implementations, the downsampling stage may be or include a convolutional stem. The convolutional stem may have an aggressive stride, such as a stride greater than 10.

[0090] The attention block and / or stage (e.g., S3 and / or S4 stages) may include a relative attention mechanism according to an exemplary embodiment of the present disclosure. The relative attention mechanism may include a sum of a static convolution kernel and an adaptive attention matrix. This sum may be applied prior to and / or subsequent to softmax normalization by the relative attention mechanism. As an example, the relative attention mechanism (e.g., applied prior to softmax normalization) may include:

[0091]

number

[0092] As another example, a relative attention mechanism (e.g., applied following softmax regularization) can be expressed mathematically as:

[0093]

number

[0094] It can be mathematically expressed as:

[0095] In the above equation, the depthwise convolution kernel w i-j is an input-dependent parameter with a static value for a given index in the input tensor (i,j) (e.g., the relative shift between indices i to j; the dependence on the relative shift rather than on a specific value is called transformation equivalence, which may improve generalization under datasets of limited size), and x i and x j are the input and output at location i, respectively, and G is the global acceptance field (e.g., the entire set of locations).

[0096] The method 500 may include, at 506, receiving, by the computing system, a machine learning prediction from the machine learning convolutional attention network in response to providing the input data to the machine learning convolutional attention network. The machine learning prediction may be a task-specific machine learning prediction. By way of example, the output may be a computer vision output, such as a classification output (e.g., a classification vector), an object recognition output, or the like. Alternatively, the machine learning prediction may be an intermediate prediction or representation, such as an embedding in a latent or learned space.

[0097] The techniques described herein refer 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 wide variety of possible configurations, combinations, and divisions of tasks and functions among components. For example, the processes described herein may be implemented using a single device or component, or multiple devices or components working in combination. Databases and applications may be implemented on a single system or distributed across multiple systems. Distributed components may operate sequentially or in parallel.

[0098] Although the present subject matter has been described in detail with respect to various specific exemplary embodiments thereof, each example is provided as an explanation, not a limitation of the present disclosure. Upon understanding the above, those skilled in the art can easily create modifications, variations, and equivalents of such embodiments. Thus, the present disclosure does not exclude such modifications, variations, and / or additions to the present subject matter as would be readily apparent to those skilled in the art. For example, features illustrated or described as part of one embodiment may also be used with another embodiment to produce yet a further embodiment. Thus, it is intended that the present disclosure cover such modifications, variations, and equivalents. [Explanation of symbols]

[0099] 100 Computing Systems 120 Machine Learning Models 130 Server Computing System 140 Machine Learning Models 160 Model Trainer 200 Models, Network 210 Downsampling Stages 212 Attention Block 300 Convolutional Attention Network (CoAtNet) model, a machine learning convolutional attention network 302 Network stage, S0 stage 304 Network stage, S1 stage 306 Network stage, S2 stage 308 Network stage, S3 stage 310 Network stage, S4 stage 400 Convolutional Attention Network (CoAtNet) Model

Claims

1. 1. A computer-implemented method for performing computer vision with reduced computational cost and increased accuracy, comprising: obtaining, by a computing system comprising one or more computing devices, input data comprising an input tensor having one or more dimensions; providing, by the computing system, the input data to a machine learning convolutional attention network, the machine learning convolutional attention network comprising two or more network stages, the two or more network stages comprising one or more attention stages and one or more convolution stages, at least one of the one or more attention stages comprising a relative attention mechanism configured to determine a sum of a static convolution kernel and an adaptive attention matrix; and receiving, by the computing system, a machine learning prediction from the machine learning convolutional attention network in response to providing the input data to the machine learning convolutional attention network.

2. 2. The computer-implemented method of claim 1, wherein the two or more network phases include an S0 phase, an S1 phase, an S2 phase, an S3 phase, and an S4 phase.

3. 3. The computer-implemented method of claim 2, wherein the S0 stage includes a two-layer convolutional stem network.

4. 4. The computer-implemented method of claim 2 or 3, wherein the S1 stage includes one or more convolution blocks with squeezed excitation.

5. 5. The computer-implemented method of claim 4, wherein the one or more convolution blocks of the S1 stage include an MBConv block configured to upscale a channel size from an original channel size of an input to the one or more convolution blocks and subsequently backproject the upscaled channel size to the original channel size.

6. 6. The computer-implemented method of claim 2, wherein each of the S2 stage, S3 stage, or S4 stage that includes a convolution stage includes an MBConv block.

7. 7. The computer-implemented method of claim 2, wherein a number of channels is doubled for at least one of the S1 stage, the S2 stage, the S3 stage, or the S4 stage.

8. The computer-implemented method of claim 2 , wherein the width of the S0 stage is less than or equal to the width of the S1 stage.

9. 9. The computer-implemented method of claim 2, wherein the S0 stage, the S1 stage, and the S5 stage each include two blocks, and the S2 stage and the S3 stage each include more than two blocks.

10. 10. The computer-implemented method of claim 1, wherein spatial resolution decreases over the two or more network stages.

11. 11. The computer-implemented method of claim 1, wherein the sum of the static convolution kernel and the adaptive attention matrix is ​​applied prior to softmax regularization by the relative attention mechanism.

12. The computer-implemented method of claim 1 , wherein the input data comprises image data.

13. 13. The computer-implemented method of claim 1, wherein the machine learning predictions include computer vision outputs.

14. 14. The computer-implemented method of claim 1, wherein the machine learning prediction comprises a classification output.

15. 15. The computer-implemented method of claim 1, wherein the one or more convolution stages sequentially precede the one or more attention stages in the two or more network stages.

16. 1. A computer-implemented method for performing computer vision with reduced computational cost and increased accuracy, comprising: obtaining, by a computing system comprising one or more computing devices, input data comprising an input tensor having one or more dimensions; providing, by the computing system, the input data to a machine learning convolutional attention network, the machine learning convolutional attention network comprising: a downsampling stage configured to reduce a spatial resolution relative to the input tensor; and one or more attention blocks including a relative attention mechanism, the relative attention mechanism including one or more attention blocks configured to determine a sum of a static convolution kernel and an adaptive attention matrix; and receiving, by the computing system, a machine learning prediction from the machine learning convolutional attention network in response to providing the input data to the machine learning convolutional attention network.

17. 17. The computer-implemented method of claim 16, wherein the downsampling step comprises a convolution stem.

18. 18. The computer-implemented method of claim 16 or 17, wherein the convolution stems have a stride greater than 10.

19. 19. The computer-implemented method of claim 16, wherein the input data comprises image data.

20. 20. The computer-implemented method of claim 16, wherein the machine learning predictions include computer vision outputs.

21. 21. The computer-implemented method of claim 16, wherein the machine learning prediction comprises a classification output.

22. 22. The computer-implemented method of claim 16, wherein the sum of the static convolution kernel and the adaptive attention matrix is ​​applied prior to softmax regularization by the relative attention mechanism.

23. 1. A computer-implemented method for performing computer vision with reduced computational cost and increased accuracy, comprising: obtaining, by a computing system comprising one or more computing devices, input data comprising an input tensor having one or more dimensions; providing, by the computing system, the input data to a machine learning convolutional attention network, the machine learning convolutional attention network including a plurality of network stages, the plurality of network stages comprising: S0 stage, which contains a two-layer convolutional stem network; S1 stage including convolution block with squeezed excitation, The S2 stage includes a convolution block. S3 stage, including attention block; and Includes S4 stage, which includes attention blocks; Each of the steps S3 and S4 includes a relative attention mechanism configured to determine a sum of a static convolution kernel and an adaptive attention matrix; the spatial resolution is reduced in each of said plurality of network stages; a number of channels is increased in each of said plurality of network stages; and receiving, by the computing system, a machine learning prediction from the machine learning convolutional attention network in response to providing the input data to the machine learning convolutional attention network.

24. 24. The computer-implemented method of claim 23, wherein the input data comprises image data.

25. 25. The computer-implemented method of claim 23 or 24, wherein the machine learning predictions include computer vision outputs.

26. 26. The computer-implemented method of claim 23, 24, or 25, wherein the machine learning prediction comprises a classification output.

27. 27. The computer-implemented method of claim 23, 24, 25, or 26, wherein the sum of the static convolution kernel and the adaptive attention matrix is ​​applied prior to softmax regularization by the relative attention mechanism.

28. 28. A system comprising one or more processors configured to carry out the method of any one of claims 1 to 27.

29. 28. One or more non-transitory computer-readable media storing instructions that, when executed by one or more processors, cause the one or more processors to perform the method of any one of claims 1 to 27.

Citation Information

Patent Citations

  • Visual question answering model, electronic device, and storage medium

    JP2020149685A

  • Systems and methods for applying machine learning to analyze microcopy images in high-throughput systems

    WO2020028313A1