A Cross-Transform Neural Network System for Few-Shot Similarity Determination and Classification

The neural network system addresses the challenge of recognizing novel categories by generating key and value embeddings with attention maps and using modified training episodes, enhancing generalization and reducing retraining needs, thus improving efficiency and accuracy.

JP7757468B2Active Publication Date: 2025-10-21ジーディーエム·ホールディング·エルエルシー
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2024102341
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-06-16
Filing Date
2024-06-25
Publication Date
2025-10-21
Estimated Expiration
2041-06-07

AI Technical Summary

Technical Problem

Existing neural networks struggle to recognize data items from categories not seen during training without requiring retraining and often fail to generalize well to novel categories due to supervision collapse.

Method used

A neural network system that generates key and value embeddings for query and support data items, using attention maps to determine similarity measures, allowing for efficient recognition of novel categories without retraining, and includes a training method using modified episodic training episodes to enhance generalization.

Benefits of technology

The system effectively recognizes data items from unseen categories with reduced memory and processing requirements, improving comparison mechanisms and reducing the need for costly retraining, while mitigating supervision collapse for better generalization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007757468000022
    Figure 0007757468000022
  • Figure 0007757468000023
    Figure 0007757468000023
  • Figure 0007757468000024
    Figure 0007757468000024
Patent Text Reader

Abstract

To provide a neural network system for determining a similarity measure between a query data item and a set of support data items.SOLUTION: A neural network system receives a query data item and acquires a support set including a support key embedding and a support value embedding. A key embedding neural network subsystem for generation of key embedding is used to generate a query key embedding for the query data item. Further, an attention map is generated based on the similarity between the query key embedding and the support key embedding for the supporting data item. A value embedding neural network subsystem is used to generate a query value embedding for the query data item, and a similarity measure of similarity scale between the query data item and the support set is determined based on the attention map, the support value embedding, and the query value embedding.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS This application claims priority to U.S. Provisional Application No. 63 / 035,469, filed June 5, 2020, and U.S. Provisional Application No. 63 / 039,748, filed June 16, 2020. The disclosures of the prior applications are considered part of the disclosure of this application and are incorporated by reference into the disclosure of this application.

[0002] This document relates to a neural network system for few-shot similarity determination and classification. [Background technology]

[0003] A neural network is a machine learning model that uses one or more layers of nonlinear units to predict an output for a received input. Some neural networks contain one or more hidden layers in addition to an output layer. The output of each hidden layer is used as the input for the next layer in the network, i.e., the next hidden layer or the output layer. Each layer of the network generates an output from the received input according to the current values ​​of its respective set of parameters.

[0004] Some neural networks are recurrent neural networks. A recurrent neural network is a neural network that receives an input sequence and generates an output sequence from the input sequence. In particular, a recurrent neural network can use some or all of the network's internal state from a previous time step when calculating an output at a current time step. An example of a recurrent neural network is a long short-term memory (LSTM) neural network that includes one or more LSTM memory blocks. Each LSTM memory block can include one or more cells, each including an input gate, a forget gate, and an output gate that enable the cell to remember the cell's previous state, for example, for use in generating current activations or to provide to other components of the LSTM neural network. [Prior art documents] [Non-patent literature]

[0005] [Non-Patent Document 1] He et al., "Deep Residual Learning for Image Recognition," arXiv:1512.03385, available at https: / / arxiv.org / abs / 1512.03385 [Non-patent document 2] Triantafillou et al., "Meta-Dataset: A Dataset of Datasets for Learning to Learn from Few Examples," arXiv:1903.03096, available at https: / / arxiv.org / abs / 1903.03096 Summary of the Invention [Means for solving the problem]

[0006] This specification describes a system comprising one or more computers and one or more storage devices storing instructions that, when executed by the one or more computers, cause the one or more computers to implement a neural network system for determining a similarity measure between a query data item and a set of support data items. The neural network system is particularly suited for use in "few-shot" applications where only a limited number of examples of particular categories are available and the neural network system must be able to recognize data items from these categories based on the limited number of example data items. The example data items may be referred to as a support set, and the recognized data items may be referred to as query data items. The neural network system described herein is capable of recognizing query data items in categories not seen during training and does not require retraining to recognize query data items in these novel categories. Rather, the neural network system provides an improved mechanism for determining similarity between query data items and support data items. Furthermore, the neural network system is trained to provide a representation of data items that is more generally applicable to all data items and can more easily transition to novel categories.

[0007] In implementations, the following operations may be performed by one or more computers implementing a neural network system: A query data item may be received; A support set of one or more support data items may be obtained, comprising a support key embedding and a support value embedding for each support data item in the support set; A query key embedding for the query data item may be generated using a key embedding neural network subsystem configured to process the data items to generate a key embedding; An attention map may be generated based on the similarity between the query key embedding and the support key embedding for each support data item; A value embedding neural network subsystem configured to process the data items to generate a value embedding may be used to generate a query value embedding for the query data item; A similarity measure between the query data item and the support set may be determined based on the attention map, the support value embedding for each support data item, and the query value embedding.

[0008] A key-value embedding may be a representation of a query data item and supporting data items that allows for easier comparison of features of the query data item and supporting data items. Thus, the similarity between the query key embedding and supporting key embedding for each supporting data item may indicate whether a particular feature of the query data item is present in the supporting data item.

[0009] The attention map can be used to guide the system as to which parts of the supporting data items may be important for determining the similarity between the query data item and the supporting data items.

[0010] The supporting key embeddings may be generated using a key embedding neural network subsystem. The supporting value embeddings may be generated using a value embedding neural network. That is, the same key embedding neural network subsystem may be used to generate the key embeddings for the query data items and the supporting data items, and similarly, the same value embedding neural network may be used to generate the value embeddings. In this way, both the query data items and the supporting data items are represented in the same feature space for comparison.

[0011] To improve efficiency, the supporting key embeddings and supporting value embeddings may be generated once and stored in a cache or other data store for later retrieval whenever new query data items are processed, or they may be generated external to the system and provided to the system as needed.

[0012] The support data items may be associated with one or more categories. The support set may comprise support data items associated with a corresponding one or more of the multiple categories. In particular, each of the data support items may be associated with a corresponding one of the categories. Each support item may be associated with a label indicating which of the categories it is associated with; for example, a particular support item may be labeled with a first category to indicate its association with that category. As mentioned above, the multiple categories may be categories that were not part of the training dataset used to train the neural network system, and the number of support data items associated with each category in the support set may be limited. The query data items may be classified based on the similarity measure determined for each category.

[0013] The support value embeddings may be weighted based on the attention map. To generate a prototype for each category associated with the support set, weighted support value embeddings for support data items associated with the same category may be aggregated. That is, weighted support value embeddings corresponding to support data items labeled with a first category may be aggregated to form a prototype for a first category. Weighted support value embeddings corresponding to support data items labeled with a second category may be aggregated to form a prototype for the second category, and so on for additional categories.

[0014] The aggregation may be a sum, an average, or any other suitable aggregation function. The aggregation may be such that a particular position in the prototype indicates whether the feature at the corresponding position in the query data item or query key embedding is present in the supporting data items or supporting key embeddings associated with the prototype category.

[0015] Determining the similarity measure may comprise determining a similarity measure between the query value embedding and the prototype. The similarity measure may be based on the distance between the query value embedding and the prototype. The distance may be based on Euclidean distance. Alternatively, other distances, such as cosine distance, may be appropriately used. The distance may indicate the likelihood that the query data item belongs to a particular category in the support set. The distance or other similarity measure may be used as the logit of a softmax function for classification. Alternatively, a classifier, such as a neural network-based classifier, may be used to perform the classification. The classifier may perform the classification based on the query value embedding and the prototype for each category, or any other suitable combination of inputs.

[0016] The similarity between the query key embedding and the supporting key embedding for each supporting data item may be based on a dot product. For example, elements at corresponding positions in the embedding may be multiplied together. As mentioned above, the similarity between the query key embedding and the supporting key embedding for each supporting data item may be based on the similarity between features of the query key embedding and each feature of the supporting key embedding. The features may be spatial features. For example, regions of an image.

[0017] It should be understood that the similarity between the query key embedding and the supporting key embedding for each supporting data item may not require normalization or a normalization constant in the similarity calculation. For example, the similarity calculation may be a dot product between the query key embedding and the supporting key embedding. The result of the dot product may be normalized based on the L-2 norm of the query and supporting key embeddings. The L-2 norm may be considered a normalization constant (or scaling constant). However, such a normalization constant may not be necessary. By using raw (unscaled) similarity values, the attention map may exhibit sharper peaks, which helps to improve the accuracy of the similarity determination. Therefore, the attention map may be generated based on the unscaled similarity measure between the query key embedding and the supporting key embedding for each supporting data item.

[0018] The attention map may be generated based on a softmax function that receives the similarity between the query key embedding and the supporting key embedding for each supporting data item of the same category. That is, the similarity of the supporting data items of the first category may be input into the softmax function to normalize the similarity value across the first category. The softmax function may further comprise a temperature parameter.

[0019] The key embedding neural network subsystem and / or the value embedding subsystem may each include a linear output layer. The key embedding neural network subsystem and / or the value embedding subsystem may each include a convolutional layer. The key embedding neural network subsystem and the value embedding neural network subsystem may share some of the same neural network layers. For example, both neural network subsystems may share an initial ResNet-type neural network structure with separate linear output layers placed on top of the ResNet structure to generate the key embedding and the value embedding.

[0020] The query data item and the supporting data item may be images. The categories associated with the supporting data items may be categories of objects present in the images. Thus, the system may be used for object recognition. The system may also be used for other tasks such as object detection and segmentation. The data items may be video data. The categories may be actions being performed in the video data. The data items may be audio utterances, and the system may be used for speech recognition.

[0021] In one exemplary implementation, the data items are images. A support set of images is provided to the system. The support set comprises images of objects that the neural network system is not trained to classify. A query image to be classified is received by the system. A ResNet-type neural network is used to generate feature maps for the query image and the support image. A linear projection is used to generate a key embedding based on the feature maps for the query image and the support image. The key embeddings for the query image and the support image of a particular object category are compared using dot-product attention and normalized across all spatial locations and support images using a softmax function to create an attention map. A second linear projection is used to generate a value embedding from the query feature map and support feature map. The attention map is used to weight the support value embeddings, and the weighted support value embeddings are aggregated to form a prototype for each object category. A distance between the query value embedding and each of the object category prototypes is calculated. A softmax function on the distances is used to obtain the probability that the query image comprises an object belonging to one of the object categories in the support set. It should be understood that this implementation is exemplary and non-limiting, and that other implementations are possible in combination with the alternative features described above.

[0022] There is also provided a method for determining a similarity measure between a query data item and a set of supporting data items, comprising operations implemented by a neural network system as described above.

[0023] A method for training a neural network system to determine a similarity measure between a query data item and a set of supporting data items is further provided. The method can include receiving an episodic training dataset comprising training data items grouped into a plurality of training episodes. Each training episode can comprise training data items divided into a support set of supporting training data items and a query set. A training episode can be selected for modification. For each of a plurality of supporting training data items in the support set of the selected training episode, first and second transformed versions of the supporting training data item can be generated. The first and second transformed versions can be labeled with a label indicating the original supporting training data item. A new query set for the training episode can be generated based on the second transformed version of the supporting training data item. A modified episodic training dataset can be generated by replacing the query set of the selected training episode with the new query set. A neural network can be generated using a training set including the modified episodic training dataset.

[0024] In the modified training episode, the training task of the selected training episode is modified to be the recognition of individual data items from the transformed versions of the data items by transforming the supporting training data items into first and second transformed versions and labeling them with labels indicating the original training data items. By training in this manner, the neural network learns more generalizable functions that can be used to distinguish data items that fall outside the distribution of the training data set, including previously unseen categories of data items, something that neural networks often struggle with.

[0025] The modified training episodes are a form of self-supervised learning because they do not require external labels.

[0026] The modification of training episodes is intended to allow neural network training to be performed without the need to modify the underlying training algorithm. Thus, neural network training may be performed using a mixture of original and modified training episodes. For example, half of a modified episode training dataset (i.e., the dataset used for training the neural network) may comprise modified training episodes and the other half original, unmodified training episodes. Thus, neural networks may be generated based on the same loss function for both modified and unmodified training episodes.

[0027] Each original training episode may be a supervised classification task aimed at classifying data items in a query set based on the provided training data items in the support set. Therefore, the loss function may be a classification loss function or a cross-entropy loss function. Training based on a mixture of modified and unmodified training episodes may mitigate the problem of "supervision collapse." In standard supervised training of neural networks, the neural network may retain only the information necessary to distinguish categories that appear in the training dataset and discard other useful information that could help distinguish data items in categories not appearing in the training dataset. This is called supervision collapse. Training based on modified training episodes to distinguish individual data items from their transformed versions encourages the neural network to learn general features of data items that can be transferred between categories, even to unseen categories. For example, objects may be composed of simpler components, and the neural network may learn to recognize these simpler components and use them in representing and recognizing novel objects.

[0028] The method may further include modifying the support set for the selected training episode based on the first transformed version. For example, when a first transformed version of an original supporting training data item is generated, the original supporting training data item may be replaced or supplemented with the corresponding first transformed version to form a modified support set for the selected training episode. The support set may be further modified by deleting original supporting training data items for which a first transformed version has not been generated.

[0029] In another example, multiple first transformed versions may be generated for each supporting training data item in the support set of the selected training episode (or for at least some of the supporting training data items in the support set of the selected training episode). Second transformed versions of the supporting training data items may be generated for each subset of the supporting training data items in the support set of the selected training episode. The first transformed versions may form a permutation support set, and the second transformed versions may form a permutation query set for the selected training episode.

[0030] A training episode may comprise a support set with 50 to 500 labeled data items in 5 to 50 categories. A query set may comprise two data items per category. A new query set for a modified training episode may comprise the same number of data items as the original query set, and the support data items for the new query set may be randomly selected according to the same category distribution as the original query set.

[0031] The neural network parameter updates may be performed at the end of each training episode. However, it should be understood that the number of data items in the support set and the query set may be fewer or more, and updates to the neural network parameters may be performed at appropriate intervals, as deemed appropriate by those skilled in the art. The neural network may be generated based on a normalized stochastic gradient descent technique. That is, the global gradient may be scaled to have unit norm before applying the updates.

[0032] The selection of training episodes for modification may be performed randomly. A transformed version of the supporting training data item may be generated by applying a transformation based on a cropping operation, a color distortion operation, or a Gaussian blur operation. Generating the transformed version of the supporting training data item may comprise applying a random transformation function (e.g., a transformation function randomly selected from a class of transformation functions) to the supporting training data item to generate the transformed version of the supporting data item. That is, the transformation operation may be selected randomly, and any parameters of the transformation operation may also be selected randomly.

[0033] Different transformation operations and / or parameters may be used to generate each of the first transformed versions. Similarly, different transformation operations and / or parameters may be used to generate each of the second transformed versions. Alternatively, the method may further comprise determining a first transformation and a second transformation, wherein the first transformation is applied to each supporting data item to generate a first transformed version for the respective supporting data item, and the second transformation is applied to each supporting data item to generate a second transformed version for the respective supporting data item. That is, within each modified training episode, all of the first transformed versions may be generated using the same first transformation, and similarly, all of the second transformed versions may be generated using the same second transformation.

[0034] Prior to episodic training, a supervised pre-training phase may be performed. That is, training data items may be grouped into episodes and classified individually on their own, rather than being split into support and query sets. The supervised pre-training phase may be performed until no further improvement is observed in metrics evaluated on a validation set. Supervised tasks instead of classification may be used for pre-training if desired.

[0035] It will be appreciated that the operations for modifying training episodes may be performed in different orders to achieve the same effect: for example, it is possible to first select data items for a new query set, generate transformed versions of these new query data items, and then apply the first and second transformations to the support data items in the support set.

[0036] It will be further appreciated that the training method may produce a neural network having the characteristics described above with respect to a neural network system for determining a similarity measure between a query data item and a set of supporting data items, and thus the neural network produced by the training method may be used as one of the neural networks used to determine the similarity measure.

[0037] Another method for training a neural network to determine a similarity measure between a query data item and a set of support data items is further provided. The method may include receiving an episodic training dataset comprising training data items grouped into a plurality of training episodes. Each training episode may comprise training data items divided into a support set and a query set. A training episode may be selected for modification. For each support training data item in the support set of the selected training episode, first and second transformed versions of the support data item may be generated. The first and second transformed versions may be labeled with a label indicating the original training data item. One or more of the support data items may be selected to generate a new query set for the training episode based on the first and second transformed versions of the selected support data item. The new query set may replace the original query set for the training episode. The neural network may be generated using a training set including the modified episodic training dataset. It will be understood that the features described above in the context of the previous training method may be combined with the features of this further training method.

[0038] The training method may be implemented by a system comprising one or more computers and one or more storage devices storing instructions that, when executed by the one or more computers, cause the one or more computers to perform the operations of the training method.

[0039] Additionally, one or more computer storage media are provided that store instructions that, when executed by one or more computers, cause the one or more computers to implement the above-described neural network system and / or perform the operations of the above-described training method.

[0040] The neural network system can be used as part of a computer vision system, for example, in a self-driving car or robotic system. Due to the so-called "long tail" of objects occurring in real scenes, unfamiliar objects are almost ubiquitous in real-world vision applications. In another example, the system can be used as part of photo organization software that needs to create new categories on the fly. In addition to object recognition, the system can perform other computer vision tasks, such as object detection and segmentation. Rare and novel objects may also exist in other domains, such as video and audio, and the system can be used in combination with such other domains.

[0041] For example, neural network systems may be used in language modeling systems, image / video processing systems, or action selection systems. For example, tasks may include classification tasks such as image processing tasks, speech recognition tasks, natural language processing tasks, word recognition tasks, or optical character recognition tasks. Additionally, tasks may include reinforcement learning tasks in which an agent interacts with one or more real or simulated environments to achieve one or more goals.

[0042] For language modeling tasks or translation of text from a source language to a target language using neural networks, the system may be configured to receive an input sequence of source embeddings representing a source sequence of words in a source natural language, and to generate an output sequence of target embeddings representing a target sequence of words that is a translation of the source sequence into the target natural language. More generally, the system may be applied to other sequence-to-sequence applications in which a source sequence is mapped to a target sequence.

[0043] The input data may comprise, for example, one or more of image data, motion / video data, motion data, voice data, audio data, electronic documents, data representing the state of an environment, and / or data representing an action. For example, the image data may comprise color or monochrome pixel value data. Such image data may be obtained from an image sensor such as a camera or LIDAR sensor. The audio data may comprise data defining an audio waveform, such as a series of values ​​in the time and / or frequency domain defining a waveform, which may represent speech in a natural language. The electronic document data may comprise text data representing words in a natural language. The data representing the state of the environment may comprise any type of sensor data, including, for example, data characterizing the state of a robot or vehicle, such as pose data and / or position / velocity / acceleration data, or data characterizing the state of an industrial plant or data center, such as sensed electronic signals, such as sensed current and / or temperature signals. The data representing an action may comprise, for example, position, velocity, acceleration, and / or torque control data, or data for controlling the operation of one or more items of equipment in an industrial plant or data center. These data may generally relate to a real or virtual environment, for example a simulated environment.

[0044] Similarly, the output data may comprise any type of data. For example, in a classification system, the output data may comprise class labels of input data items. In a regression task, the output data may predict the value of a continuous variable, such as a control variable for controlling an electronic or electromechanical system such as a robot, a vehicle, a data center, or a plant. In another example of a regression task operating on image or audio data, the output data may define one or more locations within the data, such as the location of an object, or the location of one or more corners of an object's bounding box, or the time location of a sound feature in an audio waveform. In a reinforcement learning system, the output data may comprise data representing actions, such as actions performed by an agent operating in an environment, such as a mechanical agent such as a robot or vehicle, as described above.

[0045] The data representing an action may comprise, for example, data defining an action value (Q-value) for the action, or data parameterizing a probability distribution from which the probability distribution is sampled to determine the action, or data directly defining the action, for example, in a continuous action space. Thus, in a reinforcement learning system, a neural network system may directly parameterize a probability distribution for an action selection policy or may learn to estimate the value of an action value function (Q-value). In the latter case, multiple memories and respective output networks may share a common embedding network to provide a Q-value for each available action.

[0046] Neural networks can be configured to receive any type of digital data input to generate any type of score, classification, or regression output based on the input.

[0047] For example, if the inputs to a neural network are images or features extracted from images, the output produced by the neural network for a given image may be a score for each of a set of object categories, each score representing the estimated likelihood that the image contains an image of an object belonging to the category.

[0048] As another example, if the input to a neural network is an internet resource (e.g., a web page), a document, or a portion of a document, or features extracted from an internet resource, document, or portion of a document, the output generated by the neural network for a given internet resource, document, or portion of a document may be a score for each of a set of topics, each score representing an estimated likelihood that the internet resource, document, or portion of a document is related to the topic.

[0049] As another example, if the input to a neural network is features of the impression context of a particular ad, the output produced by the neural network may be a score representing the estimated likelihood that the particular ad will be clicked.

[0050] As another example, if the inputs to a neural network are features of a personalized recommendation for a user, e.g., features that characterize the context of the recommendation, e.g., features that characterize previous actions taken by the user, the output generated by the neural network may be a score for each of a set of content items, each score representing an estimated likelihood that the user will respond favorably to the content item being recommended.

[0051] As another example, if the input to a neural network is a sequence of text in one language, the output produced by the neural network may be a score for each of a set of texts in another language, each score representing an estimated likelihood that the text in the other language is an appropriate translation of the input text into that other language.

[0052] As another example, if the input to a neural network is a sequence representing an utterance, the output produced by the neural network may be a score for each of a set of texts, each score representing an estimated likelihood that the text is a correct transcript of the utterance.

[0053] The subject matter described herein can be implemented in particular embodiments to realize one or more of the following advantages.

[0054] As described above, neural network systems can recognize data items belonging to categories not seen by the neural network system during training. This can be done without the need for costly retraining and can be performed with fewer, if not more, support data items than other conventional techniques. Thus, neural network systems can reduce memory and storage requirements for processing query data items and reduce processor and power requirements.

[0055] The neural network system provides an improved comparison mechanism compared to prior art methods and provides representations of the query and supporting data items that allow for easier comparison of features of the query and supporting data items.

[0056] Furthermore, the above-described training methods may achieve similar, if not better, performance than prior art methods at a faster rate, thus reducing overall processor and power requirements. The training methods alleviate the problem of supervision collapse, allowing neural network systems to learn more generally applicable functions for recognizing any data item, such as a component part.

[0057] Throughout this specification, processing an image using, for example, a neural network refers to using a neural network to process intensity values ​​associated with pixels of the image. [Brief explanation of the drawings]

[0058] [Figure 1] FIG. 1 is a block diagram of an example of a neural network system. [Figure 2] FIG. 1 is a schematic diagram of an exemplary operation of a neural network system. [Figure 3] 1 is a flow diagram of an example process for determining similarity between a query data item and a set of supporting data items. [Figure 4] 1 is a flow diagram of an exemplary process for training a neural network system. [Figure 5] FIG. 10 illustrates determined correspondences between example query images and support set images. DETAILED DESCRIPTION OF THE INVENTION

[0059] This specification describes a neural network system for determining a similarity measure between a query data item and a set of supporting data items, which can then be used to classify the query data item according to a category associated with the supporting set.

[0060] Generally, neural network systems use key embeddings of query and supporting data items to generate one or more attention maps. The attention maps may indicate which portions (e.g., features, elements, etc.) of the supporting data items may be important for determining similarity between the query and supporting data items. For example, the attention maps may indicate the locations and likelihoods of corresponding possible portions of the query and supporting data items. Similarity comparisons between the query and supporting data items are performed in a value embedding space taking into account the attention maps. The similarity measure may be considered a local, part-based comparison. Neural network systems provide an improved mechanism for determining similarity between data items through this local, part-based comparison, especially when categories of data items that may not have been seen during training of the neural network system and data per category are limited. For example, there may be 10 or fewer supporting data items per category.

[0061] Figure 1 illustrates an example of a neural network system 100. Neural network system 100 is an example of a system implemented as a computer program on one or more computers at one or more locations, in which the systems, components, and techniques described below may be implemented.

[0062] The neural network system 100 is configured to receive a query data item 101 and obtain a support set 102 of one or more data items to which the query data item 101 is compared and a similarity measure is determined. The support set 102 comprises a support key embedding 103 and a support value embedding 104 for each support data item in the support set 102. The support set 102 may be retrieved from a memory or data storage device, or may be received from a device external to the neural network system 100, or a combination of internal and external devices. For example, additional data items may be received that supplement an existing support set. The data items in the support set 102 may be associated with one or more categories. For example, if the data item is an image, the category may be the type of object present in the image.

[0063] The neural network system 100 comprises a key embedding neural network subsystem 105 configured to process data items to generate a key embedding. In this case, the neural network system 100 is configured to generate a query key embedding 106 for a query data item 101 using the key embedding neural network subsystem 105. The neural network system 100 may also be configured to generate a supporting key embedding 103 using the key embedding neural network subsystem 105. For example, if a data item in the support set was provided without a corresponding supporting key embedding 103, or if the supporting key embedding 103 required regeneration, such as during training of the neural network system 100. The key embedding may be a transformation of the query data item 101 and the supporting data items into an embedding space that allows for easier comparison of the data items.

[0064] The neural network system 100 further includes an attention map subsystem 107. The neural network system 100 is configured to use the attention map subsystem 107 to generate an attention map 108 based on the similarity between the query key embedding 106 and the support key embedding 103 for each support data item. The attention map 108 may be used to focus on or draw attention to specific features of the query data item and the support data items that may be particularly important for determining a similarity measure between the query data item 101 and the support set 102. The attention map 108 may indicate the location and likelihood of corresponding possible features of the query data item 101 and the support data items. For example, if the data items are images, the attention map may indicate the location of corresponding spatial features between the query image and the support image. Example features include car wheels, airplane wings, flower petals, etc. This is illustrated in FIG. 5, which is described in more detail below.

[0065] The attention map 108 may be generated based on an unscaled similarity measure between the query key embedding 106 and the supporting key embedding 103 for each supporting data item. That is, the similarity measure may not require normalization, and the calculated raw value may be used as described above. The similarity between the query key embedding 106 and the supporting key embedding 103 for each supporting data item may be based on a dot product. The similarity between the query key embedding 106 and the supporting key embedding 103 for each data item may be based on the similarity between the features of the query key embedding 106 and each feature of the supporting key embedding 103. For example, for each feature of the query key embedding 106, an attention map 108 may be generated as a result of a similarity comparison between the features of the query key embedding 106 and each feature of the features of the supporting key embedding 103.

[0066] The attention map 108 may further be generated based on a softmax function that receives a similarity measure between the query key embedding 106 and the supporting key embedding 103 for each supporting data item of the same category. In this way, the values ​​of the attention map 108 are normalized across supporting data items of a particular category. Furthermore, the softmax function may also receive a similarity between each feature of the query key embedding 106 and each feature of the supporting key embedding 103. Thus, the values ​​of the attention map (or map, if appropriate) may be normalized across features and within a particular category. Further details regarding the generation of the attention map 108 are described below.

[0067] 1 , the neural network system 100 also includes a value embedding neural network subsystem 109 configured to process the data items to generate value embeddings. The neural network system 100 is configured to generate a query value embedding 110 for the query data items 101 using the value embedding neural network subsystem 109. The neural network system 100 may also be configured to generate support value embeddings 104 using the value embedding neural network subsystem 109. For example, if a data item in the support set is provided without a corresponding support value embedding 104, or if the support value embedding 104 needs to be regenerated, such as during training of the neural network system 100.

[0068] The neural network system 100 further comprises a similarity subsystem 111 configured to determine a similarity measure 112. The neural network system 100 is configured to determine a similarity measure 112 between the query data item 101 and the support set 102 based on the attention map 108, the support value embeddings 104 for each support data item, and the query value embeddings 110. The similarity measure 112 may be a measure of similarity between the query data item 101 and each support data item in the support set 102. For example, the support value embeddings 104 may be weighted based on the corresponding attention map 108, thus utilizing a form of soft attention. A similarity measure between the query value embeddings 110 and the weighted support value embeddings may be determined.

[0069] Alternatively, the similarity measure 112 may be a measure of similarity between the query data item 101 and aggregated support data items generated based on each support data item associated with the same category. For example, aggregated support data items, also known as prototypes, may be generated for each category by aggregating the weighted support value embeddings of the support data items associated with the same category. A similarity measure may be determined between the query value embedding 110 and the prototype for each category.

[0070] The determined similarity measure 112 may indicate the likelihood that the query data item 101 belongs to a particular category associated with the supporting data item. The similarity measure 112 may be based on distance. For example, the distance between the query value embedding and the respective prototype. A smaller distance may indicate a higher likelihood that the query data item belongs to the category associated with the respective prototype. This distance may be a Euclidean distance or any other distance deemed appropriate by a person skilled in the art.

[0071] Further details regarding determining the similarity measure 112 are described in more detail below. The neural network system 100 can also be configured to output the similarity measure 112.

[0072] The neural network system 100 may also include a classifier subsystem 113. The neural network system 100 may be configured to classify the query data item 101 based on the determined similarity measure 112. For example, the classification may be based on the determined similarity measure between the query data item 101 and each supporting data item, or the classification may be based on the determined similarity measure using a prototype for each category. The classifier subsystem 113 may implement any suitable type of classifier. For example, a softmax function may be used to convert the determined similarity measure into a probability distribution indicating the likelihood that the query data item belongs to each category. In another example, a logistic regression or neural network classifier may be used. The classification may be performed using the classifier subsystem 113, which may provide an output classification 114.

[0073] The key embedding neural network subsystem 105 and the value embedding neural network subsystem 109 may comprise neural networks with linear output layers. They may also comprise neural networks with convolutional layers. The key embedding neural network subsystem 105 and the value embedding neural network subsystem 109 may comprise an initial set of shared neural network layers. In one example, all but the final respective output layers are shared. This is shown in more detail in Figure 2.

[0074] 2, there is shown a schematic diagram of generating prototypes for each category using a neural network system 100. The following example is based on image data as the modality of the query data item 101 and supporting data items. It should be understood that similar processing can be applied to other modalities and types of data items, such as audio signals and video.

[0075] In Figure 2, the query image x q is first transformed using the function φ(.). The function φ(.) may be implemented using a neural network configured to process the image to generate a feature map representation of the image. For example, φ(.) may be implemented based on a ResNet architecture, details of which can be found in He et al., "Deep Residual Learning for Image Recognition," arXiv:1512.03385, available at https: / / arxiv.org / abs / 1512.03385, which is incorporated herein by reference in its entirety.

[0076] Given an image x with height (H), width (W), and three color channels, φ(.) may generate image features with dimensions H' x W' and D channels. In one example, the image has a starting resolution of 224 x 224, and the output of the function φ(.) (implemented using a ResNet-34 architecture with an extended final block) has a 14 x 14 grid of 512 channels. The function φ(.) may also be applied to images in the support set 201, as shown at the top of Figure 2. The support set for category c is S c As shown, supporting image

[0077]

number

[0078] j is S c This is an index of supporting images within the image.

[0079] Support set image features

[0080]

number

[0081] is the number of images in the support set ("key k" as shown in Figure 2). c The key head may be further processed by the key head to generate the supporting key embedding 202 for each

[0082]

number

[0083] Therefore, in this case, the support key embedding for a particular support image has dimensions H' x W' x d k In one example, d k = 128, but it will be understood that other values ​​are possible.

[0084] Query image features φ(x q ) may be further processed by the query head to generate a query key embedding 203 (also called "query(q)" as shown in FIG. 2). The query head may implement a function Ω, which is a linear functional mapping

[0085]

number

[0086] Therefore, the query key embedding of the query image is also of dimensions H'×W'×d kThe query head and the key head may implement the same function, i.e., Γ = Ω. The query head and the key head may be considered as part of the key embedding neural network subsystem 105. The function φ(.) may be a shared initial part of the key embedding neural network subsystem 105, as described above. Alternatively, the image feature representation computed using the function φ(.) may be pre-computed externally and provided to the neural network system 100.

[0087] Then, in Figure 2, multiple attention maps 204 are generated by determining, for each supporting image, the similarity between each spatial feature of the query key embedding and each spatial feature of the supporting key embedding. This process is shown for a particular spatial location p of the query key embedding in Figure 2. In Figure 2, the vector at location p of the query key embedding is compared to the vector at each spatial location of each of the supporting key embeddings by taking the dot product between the respective query key vector and the respective supporting key vector. This generates an attention map 204 for each supporting image / key embedding of the query vector at location p.

[0088]

number

[0089] is generated to show the correspondence between the image features at position p and the supporting image features at all possible spatial locations.

[0090] More specifically, the following equation provides an exemplary calculation of the support key embedding:

[0091]

number

[0092] In the above equation,

[0093]

number

[0094] is the vector at spatial location m of the support key embedding of the jth support image belonging to category c,

[0095]

number

[0096] is the j-th supporting image belonging to category c. The following equation shows an exemplary calculation of the query key embedding: q p =Ω·φ(x q )p In the above equation, q p is a vector of spatial locations p of the query key embedding. The following equation shows an exemplary calculation of the attention map value corresponding to the spatial location pair p and m of the query key embedding and the supporting key embedding j.

[0097]

number

[0098] In the above equation,

[0099]

number

[0100] is the attention map value of the query key spatial location p and supporting key j at spatial location m.

[0101] Following the calculation of attention map values ​​for all pairs of spatial locations and each support set image within a category, the attention map values ​​may be normalized by applying a softmax function to all spatial location pairs and attention maps that belong to the same support category, as shown in the following exemplary equation:

[0102]

number

[0103] In the above equation,

[0104]

number

[0105] and

[0106]

number

[0107] is the normalized attention map value.

[0108] It will be appreciated that the above process for generating the attention map may be implemented by the attention map subsystem 107.

[0109] As mentioned above, a prototype for a particular category c in the support set can be generated based on the attention map 108 and the support value embedding 104. In FIG.

[0110]

number

[0111] is the value of each support set image (as shown in Figure 2). c The value head may be further processed by the value head to generate a support value embedding 205 for each linear function mapping

[0112]

number

[0113] Thus, in this case, the support value embedding for a particular support image has dimensions H' x W' x d v In one example, d v = 128, although it will be understood that other values ​​may be possible. The value head may be considered part of the value embedding neural network subsystem 109.

[0114] 2, an attention map may be used to weight the corresponding support value embeddings for each support image, and a weighted sum is performed to generate a vector of prototypes 206 at spatial location p. In this way, the attention map indicates which parts of the support images are most relevant based on the query image. The following exemplary formula may be used to calculate the support value embedded at spatial location m of support image j associated with category c:

[0115]

number

[0116] In the above equation,

[0117]

number

[0118] is a vector at spatial location m of the support value embedding of the j-th support image of category c. The prototype may be calculated as shown in the following exemplary equation:

[0119]

number

[0120] In the above equation,

[0121]

number

[0122] is the vector at spatial location p of prototype t of category c. Vectors at the remaining spatial locations of the prototypes can be determined in a similar manner. The prototypes can be considered "query-aligned" prototypes in that the data generated for a particular location of the prototype corresponds to a particular feature at the same location in the query image. In some conventional techniques, prototypes are generated independently of the query and are generated solely based on the supporting data items themselves. In this case, each prototype is generated with the query in mind specifically, and thus the similarity between the query and prototypes of different categories can be better determined.

[0123] As mentioned above, the similarity measure 112 between the query data item 101 and the support set of data items may be determined based on prototypes of a particular category. For example, the similarity measure 112 may be determined based on the Euclidean distance between the query value embedding and the support value embedding. The query value embedding is calculated by using the value head Λ to map the query image features φ(x q ) can be computed in a similar way to the support value embedding. w p =Λ φ(x q ) p In the above equation, w p is a vector at spatial location p of the query value embedding. The similarity measure 112 may be calculated based on Euclidean distance according to the following exemplary formula:

[0124]

number

[0125] In the above equation, d(x q ,S c) is the similarity measure between the query image and the support set of category c. It will be appreciated that the process for determining the similarity measure is implemented by the similarity subsystem 111.

[0126] The similarity measures may be used to determine the likelihood that a query image belongs to a particular category. For example, a softmax function may be applied to the similarity measures for each category to generate a probability distribution according to the following example equation:

[0127]

number

[0128] In the above equation, p(y=c|x q ) is the query image x q is the probability that {right arrow over (x)} belongs to category c. Alternatively, the similarity measure may be provided to the classifier to determine a set of scores for each category or to provide a classification of the query image. It will be appreciated that the processing for generating the classification scores / probabilities may be implemented by the classifier subsystem 113.

[0129] Referring now to Figure 3, a process for determining a similarity measure between a query data item and a set of supporting data items will now be described. It will be understood that the process may be implemented by the neural network system 100 of Figure 1.

[0130] A query data item is received at block 305. A supporting set of one or more supporting data items is received at block 310. The supporting set comprises a supporting key embedding and a supporting value embedding for each supporting data item in the supporting set.

[0131] At block 315, a query key embedding for the query data item is generated using a key embedding neural network subsystem. The key embedding neural network subsystem is configured to process the data item to generate the key embedding described above.

[0132] At block 320, an attention map is generated based on the similarity between the query key embedding and the supporting key embedding for each supporting data item, which may be performed using the attention map subsystem described above.

[0133] At block 325, a query value embedding of the query data item is generated using a value embedding neural network subsystem. The embedding neural network subsystem is configured to process the data item to generate an embedding value as described above.

[0134] In block 330, a similarity measure between the query data item and the support set is determined based on the attention map, the support value embeddings for each supporting data item, and the query value embedding. This may be performed using the similarity subsystem described above.

[0135]

[0041] Referring now to Figure 4, a process for training a neural network system for determining a similarity measure between a query data item and a set of supporting data items will now be described. It will be understood that the neural network system 100 of Figure 1 may be trained according to the described process.

[0136] At block 405, an episodic training dataset is received, comprising training data items grouped into multiple training episodes. Each training episode comprises training data items divided into a support set of supporting training data items and a query set. The training episodes may be designed for a classification task in which data items in the query set are classified according to categories associated with data items in the support set. The number of data items per category in the support set may be limited. Suitable techniques for generating episodic datasets are described in "Meta-Dataset: A Dataset of Datasets for Learning to Learn from Few Examples" by Triantafillou et al., arXiv:1903.03096, available at https: / / arxiv.org / abs / 1903.03096, which is incorporated herein by reference in its entirety.

[0137] A training episode is selected for modification at block 410. The training episode may be randomly selected from a set of training episodes in an episodic training dataset.

[0138] At block 415, for each of a plurality of supporting training data items in the support set of the selected training episode, first and second transformed versions of the supporting training data item are generated, and the first and second transformed versions are labeled with labels indicating the original supporting training data item. The transformations may be based on a cropping operation, a color distortion operation, or a Gaussian blur operation. Other exemplary transformations may be based on rotation, posterization, solarization, color shift, contrast, brightness, sharpness, shearing, translation, and cutout. A particular transformation operation and any parameters of the transformation operation may be randomly selected from a set of appropriate values.

[0139] At block 420, a new query set for the training episode is generated based on the second transformed versions of the supporting training data items. For example, a subset of the second transformed versions may be selected to form the new query set. The subset may have the same number of data items as the original query set and may be selected according to the same category distribution as the original query set. It should also be understood that it is possible to first select a subset of the supporting training data items for the new query set and generate only a second transformed version of the subset, rather than generating a second transformed version for each supporting data item.

[0140] At block 425, a modified episodic training dataset is formed by replacing the query set of the selected training episode with the new query set. The original support set may be modified based on the first transformed version, for example, by replacing the original support set with the first transformed version in the modified training episode.

[0141] To select additional training episodes for modification, the process of blocks 410 through 425 can be repeated. In one example, half of the training episodes in the training data set are modified according to the process described above.

[0142] In block 430, a neural network is generated using a training set comprising the modified episodic training dataset. The modifications performed on the training episodes above mean that the same loss function can still be used for both modified and unmodified training episodes. That is, in the modified training episodes, each supporting data item becomes its own class. The goal of the modified training episodes is to recognize the supporting data items from which each query data item is derived. This can be posed as a classification problem under the same episodic learning framework as the original training episodes, using the same classification or cross-entropy loss function. The neural network can then be trained using standard techniques of supervised learning, such as stochastic gradient descent, particularly normalized stochastic gradient descent (using normalized gradients). The introduction of modified training episodes helps prevent the problem of supervision collapse, in which a neural network learns only representations that help distinguish between classes present in the training set and does not retain other information. Using modified training episodes to recognize transformed versions of data items allows the neural network to retain information about the data items and generate better representations that can generalize to unseen classes. For example, a neural network may learn to represent a data item based on local component parts, which may be useful for representing data items of unseen classes.

[0143] While the process of Figure 4 above is described as generating first and second transformed versions of the supporting training data items, it will be appreciated that further transformed versions may be generated, and new query sets and / or support sets may be generated based on these further transformed versions as deemed appropriate by those skilled in the art.

[0144] FIG. 5 illustrates correspondences between portions of a query image and images in a support set from an attention map generated by an exemplary neural network system. Corresponding portions, indicated by large attention values, are highlighted in the image. As can be seen from FIG. 5, semantically similar portions between the query image and the support image have a high degree of agreement. For example, the tail, wings / engine, and paint of the airplane in FIG. 5 are highlighted. Thus, the example in FIG. 5 illustrates the effectiveness of the technique for determining a similarity measure between the above query data item and a support set of data items.

[0145] In situations where the systems described herein utilize data that may include personal information, the data may be processed in one or more ways, such as by aggregation and anonymization, before being stored or used, so that such personal information cannot be determined from the data that is stored or used. Further, the use of such information may be such that personally identifiable information cannot be determined from the output of the systems that use such information.

[0146] A system of one or more computers configured to perform particular operations or actions means that the system has installed thereon software, firmware, hardware, or a combination thereof that, when in operation, causes the system to perform the operations or actions. One or more computer programs configured to perform particular operations or actions means that the one or more programs contain instructions that, when executed by a data processing device, cause the device to perform the operations or actions.

[0147] Embodiments of the subject matter and functional operations described herein can be implemented in digital electronic circuitry, tangibly embodied computer software or firmware, computer hardware including the structures disclosed herein and their structural equivalents, or one or more combinations thereof. Embodiments of the subject matter described herein can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier for execution by or to control the operation of a data processing apparatus. Alternatively or additionally, the program instructions can be encoded on an artificially generated propagated signal, such as a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode information for transmission to a suitable receiving device for execution by the data processing apparatus. The computer storage medium can be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of these. However, the computer storage medium is not a propagated signal.

[0148] The term "data processing apparatus" encompasses all kinds of apparatus, devices, and machines for processing data, including, by way of example, a programmable processor, a computer, or multiple processors or computers. An apparatus may include special-purpose logic circuitry, such as an FPGA (field-programmable gate array) or an ASIC (application-specific integrated circuit). In addition to hardware, an apparatus may also include code that creates an execution environment for the computer program in question, such as code comprising processor firmware, a protocol stack, a database management system, an operating system, or one or more combinations thereof.

[0149] A computer program (which may also be referred to or written as a program, software, software application, module, software module, script, or code) can be written in any form of programming language, including compiled or interpreted, or declarative or procedural, and can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. A computer program may, but need not, correspond to a file in a file system. A program can be stored as part of a file that holds other programs or data, e.g., in one or more scripts stored in a markup language document, in a single file dedicated to the program, or in multiple cooperating files, e.g., files that store one or more modules, subprograms, or portions of code. A computer program can be deployed to be executed on one computer or on multiple computers located at one site or distributed across multiple sites and interconnected by a communications network.

[0150] As used herein, the term "engine" or "software engine" refers to a software-implemented input / output system that provides an output distinct from the input. An engine may be a block of coded functionality, such as a library, a platform, a software development kit ("SDK"), or an object. Each engine may be implemented on any suitable type of computing device, such as a server, a mobile phone, a tablet computer, a notebook computer, a music player, an e-book reader, a laptop or desktop computer, a PDA, a smartphone, or other fixed or portable device that includes one or more processors and computer-readable media. Furthermore, two or more engines may be implemented on the same computing device or on different computing devices.

[0151] The processes and logic flows described herein may be performed by one or more programmable computers executing one or more computer programs to perform functions by operating on input data and generating output. The processes and logic flows may also be performed by, and an apparatus may be implemented as, special purpose logic circuitry, such as, for example, an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit). For example, the processes and logic flows may be performed by, and an apparatus may be implemented as, a graphics processing unit (GPU).

[0152] A computer suitable for executing a computer program can include or be based on, by way of example, a general-purpose microprocessor, a special-purpose microprocessor, or both, or another type of central processing unit. Typically, the central processing unit receives instructions and data from a read-only memory, a random-access memory, or both. The essential elements of a computer are a central processing unit for executing or carrying out instructions and one or more memory devices for storing instructions and data. Typically, a computer includes one or more mass storage devices for storing data, e.g., magnetic, magneto-optical, or optical disks, or is operatively coupled to receive data from or transfer data to them, or both. However, a computer need not be equipped with such devices. Furthermore, a computer can be embedded in another device, such as, for example, a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device, e.g., a universal serial bus (USB) flash drive, to name just a few.

[0153] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and memory devices, including, by way of example, semiconductor memory devices such as EPROM, EEPROM, and flash memory devices, magnetic disks, e.g., internal hard disks or removable disks, magneto-optical disks, and CD-ROM and DVD-ROM disks. The processor and memory can be supplemented by, or incorporated in, special purpose logic circuitry.

[0154] To provide for user interaction, embodiments of the subject matter described herein can be implemented on a computer having a display device, e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor for displaying information to the user, and a keyboard and pointing device, e.g., a mouse or trackball, by which the user can provide input to the computer. Other types of devices can also be used to provide for user interaction; for example, feedback provided to the user can be any form of sensory feedback, such as visual feedback, auditory feedback, or tactile feedback, and input from the user can be received in any form, including acoustic, speech, or tactile input. Additionally, a computer can interact with a user by sending and receiving documents to and from a device used by the user, e.g., by sending a web page to a web browser on the user's client device in response to a request received from the web browser.

[0155] Embodiments of the subject matter described herein can be implemented in a computing system that includes a back-end component, e.g., a data server; a middleware component, e.g., an application server; a front-end component, e.g., a client computer with a graphical user interface or web browser through which a user can interact with an implementation of the subject matter described herein; or any combination of one or more such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication, such as a communications network. Examples of communications networks include local area networks ("LANs") and wide area networks ("WANs"), e.g., the Internet.

[0156] A computing system may include clients and servers. Clients and servers are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.

[0157] While this specification contains details of many specific implementations, these should not be construed as limiting the scope of the invention or what may be claimed, but rather as descriptions of features that may be specific to particular embodiments of a particular invention. Certain features described herein in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination. Furthermore, while features may be described above as acting in a particular combination and initially claimed as such, one or more features from a claimed combination can, in some cases, be separated from the combination, and the claimed combination may be directed to subcombinations or variations of the subcombination.

[0158] Similarly, while operations are shown in the figures in a particular order, this should not be understood as requiring that such operations be performed in the particular order or sequential order shown, or that all of the operations shown be performed, to achieve desirable results. In certain situations, multitasking and parallel processing may be advantageous. Furthermore, the separation of various system modules and components in the above embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems may generally be integrated together in a single software product or packaged in multiple software products.

[0159] Specific embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. For example, the actions recited in the claims may be performed in a different order and still achieve desirable results. As an example, the processes depicted in the accompanying figures do not necessarily require the particular order shown or sequential order to achieve desirable results. In certain implementations, multitasking and parallel processing may be advantageous. [Explanation of symbols]

[0160] 100 Neural Network Systems 101 Query Data Items 102 Support Set 103 Support key embedding 104 Support Value Embedding 105 Key Embedding Neural Network Subsystem 106 Query Key Embedding 107 Attention Map Subsystem 108 Attention Map 109 Value Embedding Neural Network Subsystem 110 Query Value Embedding 111 Similarity Subsystem 112 Similarity measure 113 Classifier Subsystem 114 Output Classification 201 Support Set 202 Support key embedding 206 Prototype

Claims

1. 1. A neural network system for determining a similarity measure between a query data item and a set of supporting data items, the neural network system comprising: one or more computers; and when executed by the one or more computers, the one or more computers: receiving the query data item; obtaining a support set of one or more supporting data items; generating, for each supporting data item, a respective attention map for each portion of the query data item, the respective attention map characterizing the likelihood that different portions of the supporting data item correspond to the portions of the query data item; generating a query value embedding for the query data item using a value embedding neural network subsystem configured to process the data item to generate a value embedding; determining, for each supporting data item, a respective similarity measure between the query data item and the supporting data item based at least in part on the attention map and the query value embedding for the supporting data item; and one or more storage devices storing instructions for performing operations comprising: The neural network system comprises: obtaining, for each support data item, a support key embedding; generating a query key embedding for the query data item using a key embedding neural network subsystem configured to process the data item to generate a key embedding; a neural network system, wherein for each supporting data item, generating the attention map for the supporting data item comprises generating the attention map based on a similarity between the query key embedding and the supporting key embedding for the supporting data item.

2. A neural network system for determining a similarity measure between a query data item and a set of supporting data items, said neural network system comprising: one or more computers; and when executed by said one or more computers, said one or more computers: receiving the query data item; obtaining a support set of one or more supporting data items; generating, for each supporting data item, a respective attention map for each portion of the query data item, the respective attention map characterizing the likelihood that different portions of the supporting data item correspond to the portions of the query data item; generating a query value embedding for the query data item using a value embedding neural network subsystem configured to process the data item to generate a value embedding; determining, for each supporting data item, a respective similarity measure between the query data item and the supporting data item based at least in part on the attention map and the query value embedding for the supporting data item; and one or more storage devices storing instructions for performing operations comprising: the supporting data items are associated with one or more categories; The operation is for each supporting data item, weighting each supporting value embedding for said supporting data item based on said attention map for said supporting data item; aggregating the weighted support value embeddings of the support data items associated with the same category to generate a prototype for each category associated with the support set; and The neural network system further comprises:

3. generating, for each supporting data item, a supporting value embedding for said supporting data item; 3. The neural network system of claim 1, wherein for each supporting data item, the similarity measure between the query data item and the supporting data item is based at least in part on (i) the attention map for the supporting data item, and (ii) the query value embedding, and (iii) the support value embedding for the supporting data item.

4. 4. The neural network system of claim 1, wherein the supporting data items are associated with one or more categories.

5. The operation is The neural network system of claim 4 , further comprising classifying the query data items based on a similarity measure determined for each category.

6. 3. The neural network system of claim 2, wherein determining a similarity measure comprises determining a similarity measure between the query value embedding and the prototype for each category.

7. 10. The neural network system of claim 2 or 6, wherein the similarity measure is based on the distance between the query value embedding and the prototype.

8. The neural network system of claim 7 , wherein the distance is based on Euclidean distance.

9. 9. The neural network system of claim 1, wherein for each supporting data item, the attention map for the supporting data item is generated based on an unscaled similarity measure between a query key embedding and a supporting key embedding for the respective supporting data item.

10. 10. The neural network system of claim 9, wherein the similarity between the query key embedding and the supporting key embedding for each supporting data item is based on a dot product.

11. 10. The neural network system of claim 9, wherein the similarity between the query key embedding and the supporting key embedding for each supporting data item is based on similarities between features of the query key embedding and each feature of the supporting key embedding.

12. 12. The neural network system of claim 11, wherein the features of the query key embedding and each feature of the supporting key embedding are spatial features.

13. 13. The neural network system of claim 2, wherein for each supporting data item, the attention map for the supporting data item is generated based on a softmax function that receives a similarity measure between a query key embedding and a supporting key embedding for each supporting data item of the same category.

14. 14. The neural network system of claim 1, wherein the data items are images.

15. 15. One or more computer storage media storing instructions that, when executed by one or more computers, cause the one or more computers to implement the neural network system of any one of claims 1 to 14.

16. 15. A method implemented by one or more computers, comprising performing the operations of a neural network system according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Computer system

    JP2020071694A

  • Attention-based image generation neural networks

    US20190130213A1