Balancing training data for training neural networks

EP4740116A1Pending Publication Date: 2026-05-13GDM HOLDING LLC
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
EP · EP
Patent Type
Applications
Current Assignee / Owner
GDM HOLDING LLC
Filing Date
2024-09-26
Publication Date
2026-05-13

AI Technical Summary

Technical Problem

Neural networks trained on imbalanced datasets, where certain attributes are over- or under-represented, can perform poorly on tasks requiring balanced attribute distributions, leading to association bias and reinforcement of harmful societal biases.

Method used

The technique involves determining item attribute vectors for each training item to assess the likelihood of exhibiting specific attributes, defining weight values for each item, and iteratively minimizing a loss function to rebalance the training database, thereby reducing association bias.

Benefits of technology

This approach improves the performance of neural networks by ensuring they are trained on a balanced dataset, reducing the likelihood of association bias and enhancing the network's ability to handle diverse input data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure EP2024077181_03042025_PF_FP_ABST
    Figure EP2024077181_03042025_PF_FP_ABST
Patent Text Reader

Abstract

A computer-implemented method is provided for processing a training database for training a neural network to perform a computational task, the training database comprising training items, to obtain a weight value for each training item. The method comprises: for each of one or more attributes, determining a corresponding item attribute vector for each training item which is a vector indicative of a likelihood of the training item exhibiting the attribute; and for each training item determining a corresponding weight value by: defining a loss function of the weight values and the item attribute vectors; and updating the weight values to reduce the loss function. A corresponding computer system and computer program product are also provided.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] BALANCING TRAINING DATA FOR TRAINING NEURAL NETWORKS

[0002] CROSS-REFERENCE TO RELATED APPLICATION

[0003] [1] This application claims priority to U.S. Provisional Application No. 63 / 586,392, filed on September 28, 2023. The disclosure of the prior application is considered part of and is incorporated by reference in the disclosure of this application.

[0004] BACKGROUND

[0005] [2] This specification relates to systems for pre-processing a training database of training items which is to be used for neural network training. The training items may comprise audiovisual items, such as images (still images or videos) or audio items. Additionally or alternatively, the training items may comprise other data such as transactional records or textual records.

[0006] [3] Neural networks are machine learning models that employ one or more layers of nonlinear units to predict an output for a received input. Some neural networks are deep neural networks that include one or more hidden layers in addition to an output layer. The output of each hidden layer is used as input to 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 a received input in accordance with current values of a respective set of parameters.

[0007] SUMMARY

[0008] [4] The training databases used in many neural network training processes are drawn from the internet or other public repositories of e.g. audio-visual elements, and the distribution of audio-visual elements in such databases is often different from a desired distribution. This may be because it is different from a distribution of audio-visual elements which the trained neural network is intended to process or generate (e.g. there may be more images of cats than are encountered performing some audio-visual processing tasks). Thus, the present techniques allow a training database to be “rebalanced”, so that the performance of the neural network is improved (e.g. images having the attribute “cat” are removed and / or given less weight in the training). Similar rebalancing may be achieved for non audio-visual data associated with attributes, such as transactional records or textual records.

[0009] [5] In particular, this specification describes technologies which enable a training database of training items to be processed, in order to be subsequently used to train a neural network to perform a computing task, which may for example be an audio-visual computing task. The training items may include at least one corresponding audio-visual item; that is, at least one image (which may be a still image or a moving (video) image, e.g. captured by a camera) and / or at least one audio item (a sound item lasting a time duration, e.g. a captured recording of one or more voices speaking). Additionally or alternatively, the training items may include non audio-visual data such as transactional records or textual records.

[0010] [6] In general terms, the present technique proposes that, for each of one or more attributes (e.g., attributes which are believed to be over-represented in the training database), an item attribute vector is determined for each training item, indicating a likelihood of the training item exhibiting the attribute (e.g. the item attribute vector may optionally be a single value, e.g. a binary value indicating that the likelihood is above a threshold, or a real value varying with the likelihood; or it can include multiple values, e.g. a binary vector). A weight value is defined for each training item, and a loss function is defined based on the item attribute vectors and the weight vectors. The loss function is reduced (e.g. iteratively minimized) with respect to the weight values.

[0011] [7] In one expression, there is provided a computer-implemented method of processing a training database for training a neural network to perform a computational task, the training database comprising training items, to obtain a weight value for each training item, the method comprising: a. for each of one or more attributes, determining a corresponding item attribute vector for each training item which is a vector indicative of a likelihood of the training item exhibiting the attribute; and b. for each training item determining a corresponding weight value by: i. defining a loss function of the weight values (e.g. using initial values for the weight values, which may be chosen to be all the same, or at random) and the item attribute vectors; and (e.g. repeatedly) ii. updating the weight values to reduce the loss function.

[0012] [8] According to a further aspect of the disclosure, there is provided 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 above method.

[0013] [9] According to a further aspect of the disclosure, there is provided a computer-program product containing instructions that, when executed by one or more computers, cause the one or more computers to perform the above method.

[0010] The subject matter described in this specification can be implemented in particular embodiments so as to realize one or more of the following advantages.

[0014]

[0011] First, a training database may be processed to reduce an over- or under-representation of training elements exhibiting certain attributes, for example to make their incidence match an application of a neural network subsequently trained from the examples, or to ensure that the training process employs enough of the training items having or not having certain attributes, for the trained neural networks be able to handle such items when it is deployed.

[0015]

[0012] Second, the training database can be processed so that a neural network trained based on it can be less liable to problems due to association bias. In some cases, association bias in the training dataset can make a trained neural network less successful at tasks, e.g. of processing input data which does not have the same association bias. In the case of characteristics or attributes having human significance, association bias may lead to reinforcement of harmful societal biases.

[0016]

[0013] The details of one or more embodiments of the subject matter of this specification are set forth in the accompanying drawings and the description below. Other features, aspects, and advantages of the subject matter will become apparent from the description, the drawings, and the claims.

[0017] BRIEF DESCRIPTION OF THE FIGURES

[0018]

[0014] Fig. 1 shows an example neural network system.

[0019]

[0015] Fig. 2 is a flow diagram of an example process for processing a training database.

[0020]

[0016] Fig. 3 is a flow diagram of an optional continuation of the process of Fig. 2.

[0021]

[0017] Fig. 4 shows an example of the performance of the described techniques.

[0022]

[0018] Fig. 5 shows another example of the performance of the described techniques.

[0023] DETAILED DESCRIPTION

[0024]

[0019] Fig. 1 shows an example training database 100. The training database 100 is an example of a system implemented as computer programs on one or more computers in one or more locations in which the systems, components, and techniques described below are implemented. For example, methods described herein may be performed by one or more processors of one or more such computers. In some applications, the training database 100 may be configured for use in the training of a neural network.

[0020] The training database 100 comprises at least one training item 102. Each training item may comprise at least one audio-visual (AV) element 104. Additionally or alternatively, each training item may comprise other data such as transactional records or textual records Each training item 102 may be associated with one or more item attribute vectors 106a, 106b, 106c, each item attribute vector corresponding to a respective attribute and indicating a likelihood of the training item 102 exhibiting that attribute. The training database 100 may be associated with the training of a neural network 108.

[0025]

[0021] If present, the AV element 104 comprises at least one image (which may be a still image or a moving (video) image, e.g. captured by a camera) and / or at least one audio item (a sound item lasting a time duration, e.g. a captured recording of one or more voices speaking).

[0026]

[0022] The item attribute vectors 106a, 106b, 106c are each associated with a respective attribute (for example, these may be attributes which are believed to be over-represented in the training database 100). Each item attribute vector may optionally comprise a single value, e.g. a binary value indicating that the likelihood is above a threshold, or a real value varying with the likelihood. Alternatively, each item attribute vector may include multiple values, e.g. a binary vector.

[0027]

[0023] As an illustrative example, the AV element 104 may be an image of an individual. Two attributes of this image may relate to the probability of the shown individual being a man and the probability of them being a woman. In this example, the item attribute vector 106a may express a probability determined by a neural network, such as the neural network 108, that the individual shown in the image is a man, while the item attribute vector 106b may express a determined probability that the individual is a woman.

[0028]

[0024] Fig. 2 is a flow diagram of a method 200 of processing a training database.

[0029]

[0025] At step S202, the method comprises for each of one or more attributes, determining a corresponding item attribute vector for each training item which is a vector indicative of a likelihood of the training item exhibiting the attribute.

[0030]

[0026] At step S204, the method comprises for each training item determining a corresponding weight value. This is done by defining a loss function of the weight values and the item attribute vectors at step S206, and updating the weight values to reduce the loss function at step S208.

[0031]

[0027] In particular, a weight value may be defined for each training item, and a loss function may be defined based on the item attribute vectors 106a, 106b, 106c and the weight vectors. The loss function is reduced (e.g. iteratively minimized) with respect to the weight values.

[0028] After multiple iterations the weight values may approach those which minimize the loss function. In an alternative, depending on the form of the loss function, it may be possible to obtain analytically in a single step weight values which minimize the loss function.

[0032]

[0029] The weight values can then be used in the neural network 108 training process, e.g. by eliminating from the training set 100 a certain number of the training items 102 (e.g. ones for which the corresponding weight value is above or below a threshold), or making more or less use of different ones of the training items 102 in the neural network 108 training process according to the corresponding weight values. For example, in a training process in which training items 102 are selected from the training database 100 (e.g. in batches), the weight value of a given training item 102 may determine how often it is selected from the training database 100.

[0033]

[0030] The term “audio-visual computational task” means a computational task of processing at least one audio-visual element 104 (and optionally other data, such as associated text) to obtain an output based on the AV element 104 (e.g. a classification of it, or a segmentation of it), or the generation of another audio-visual element 104. Example applications are given below.

[0034]

[0031] If the function of the item attribute vectors 106a, 106b, 106c is such that it has a higher value in the case of an item attribute vector 106a, 106b, 106c which specifies that the corresponding training item 102 is likely to have an attribute which is over-represented in the training database 100 compared to a desired level of representation, the present technique may result in lower weight values for such training items 102. Training items 102 having low weight values may be removed from the training database 100, and / or less importance may be given to them during the training of the neural network 108. In implementations, this enables a neural network 108 with superior properties to be trained based on the processed training database 100.

[0035]

[0032] The loss function may have many forms, but (e.g. in the case of an attribute which is believed to be over-represented) it may be a non-decreasing function of the product of the item attribute vectors 106a, 106b, 106c forthat attribute and the corresponding weight values. It may also include terms which are dependent on the weight values but not the item attribute vectors 106a, 106b, 106c. Optionally, all terms of the loss function may have a dependence on the weight values which is polynomial (or polynomial but with some terms of the polynomial set to be constant for some ranges of the weight values), with powers no higher than two, guaranteeing a single minimum.

[0033] In implementations, the loss function may have multiple terms. They may include, for each attribute, a corresponding “attribute term”. Each attribute term may have a nondecreasing dependence on each weight value.

[0036]

[0034] Each attribute term may be based on a corresponding first sum over the training items 102, weighted (not necessarily linearly) by the corresponding weight values, of a first function of the item attribute vector 106a, 106b, 106c for the corresponding training item 102 and attribute. The first function may be the item attribute vector 106a, 106b, 106c minus a desired attribute vector corresponding to the attribute (with the result optionally converted to a scalar value, e.g. by adding its components). The desired attribute vector may have a number of components equal to the number of components of the item attribute vector 106a, 106b, 106c, and each component of the desired attribute vector may be equal to a single value (e.g. denoted by 7tk), which may denote a desirable incidence of training items 102 in the processed training database 100 having that attribute (e.g. because, once trained, the neural network 108 will be used to process / generate audio-visual items in which the corresponding attribute has that incidence).

[0037]

[0035] In some implementations, there may be some range(s) of values for the weight values and / or item attribute vectors 106a, 106b, 106c, for which any of the attribute terms is constant, e.g. zero. For example, each attribute term may only be non-zero only if the corresponding first sum is above a first threshold. This possibility allows the attribute term to be irrelevant to the minimization of the loss function if the first sum is below the first threshold (which may imply that that the items having the corresponding attribute are not, in fact, over- represented, or at least not significantly so). The first threshold may define an amount of tolerance to this over-representation. Providing such a tolerance may make the minimization of the loss function easier. The corresponding desired value for the at least one attribute term may be a product of a sum of the weight values and a target value for the attribute.

[0038]

[0036] “Representation bias” is a “first order bias”, i.e. a bias relating to a single quantity, but the training database 100 may also exhibit a “second order bias” which is an association between two properties of the training items 102. Second order bias too may make training based on the training database 100 harder. For example, if a database contains images of a first sort of object (e.g. cats) in consistent settings (e.g. interiors of houses), and a second sort of object (e.g. horses) in different settings (e.g. fields), a neural network may use lighting conditions as a proxy for distinguishing the two sorts of object, and thus, once trained, have difficulty recognizing cats or horses in different lighting conditions.

[0037] For that reason, as well as attributes, an implementation may consider “characteristics” (i.e. properties of audio-visual elements which are different from the attributes, but possibly statistically correlated with them, e.g. in the training database 100). The correlation between attributes (e.g. cats / horse) and characteristics (e.g. interior lighting / exterior lighting) can provide an “association bias”, which, as noted, is often a problem in neural network learning problems. Characteristics are also referred to herein as labels.

[0039]

[0038] In one case, for example, different “characteristics” may correspond to different professions which are related to the content of a training item 102 (and / or one characteristic of the training item 102 may be related to a profession, e.g. the AV element 104 may include an image of an individual who has a recognizable profession). For example, many images on the internet show managers (which may be one characteristic) who are men (which may be an attribute), and secretaries (which may be another characteristic) who are women (which may be an attribute). If a text-to-image neural network model trained on such images is queried with the prompt “clipart picture of a manager dressed in black talking to a secretary dressed in blue”, typical generated images show managers as men and secretaries as women. In another example, an image classifier may be more likely to recognize an image of a man as a judge than an image of a woman. Biases of this kind too may be reduced or removed by balancing the training database using which the neural network model is to be trained, to reduce association bias between certain attributes and certain characteristics (e.g. characteristics which are professions).

[0040]

[0039] For this reason, an implementation of the present method may include, for each of one or more characteristics, determining a corresponding item characteristic vector for each training item 102, which is a vector indicative of a likelihood of the training item 102 exhibiting the characteristic. Again, this may be a single value (e.g. a binary digit) or multiple values (e.g. a binary vector).

[0041]

[0040] Fig. 3 is a flow diagram of a method 300 which is an optional continuation of the method 200 described above with reference to Fig. 2 using item characteristic vectors.

[0042]

[0041] At step S302, the method comprises for each of one or more characteristics, determining a corresponding item characteristic vector for each training item, which is a vector indicative of a likelihood of the training item exhibiting the characteristic. S304 specifies the loss function including, for each attribute and each characteristic, a corresponding attribute characteristic term based on a corresponding second sum over the training items, weighted by the corresponding weight values, of a second function of the item attribute vector for the corresponding training item and attribute, and the item characteristic vector for the corresponding training item and characteristic (S306).

[0043]

[0042] More specifically, in an illustrative example, the loss function may include, for each combination of an attribute and a characteristic, a corresponding term, an “attribute characteristic term”, which may be based on a corresponding second sum over the training items 102, weighted (not necessarily linearly) by the corresponding weight values, of a second function of the item attribute vector 106a, 106b, 106c for the corresponding training item 102 and attribute, and the item characteristic vector for the corresponding training item 102 and characteristic. Finding weight values which reduce the attribute characteristic thus corresponds to reducing association bias between attributes and characteristics in the training database 100.

[0044]

[0043] The second function may be a product of (i) the item attribute vector 106a, 106b, 106c minus the desired attribute vector corresponding to the attribute, and (ii) the item characteristic vector.

[0045]

[0044] Optionally, each attribute characteristic term is non-zero only if the corresponding second sum is above a second threshold. This second threshold having a non-zero value (though it may be chosen to have a low value) means that there is a certain (e.g. low) tolerance of the association of attributes and characteristics, and may make the minimization of the loss function easier. Each attribute characteristic term may be the greater of (i) zero and (ii) the corresponding second sum minus the second threshold, so that the attribute-characteristic association is ignored, provided it is below the second threshold.

[0046]

[0045] The item attribute vectors 106a, 106b, 106c (and, if present, item characteristic vectors) may be at least partly obtained by applying a neural network (such as the neural network 108) to the e.g. audio-visual element(s) 104 of the corresponding training items 102. For example, if the audio-visual element(s) 104 are present and are image(s), an object detection neural network model may be applied to generate an output which lists recognized objects in the image, and each item attribute vector 106a, 106b, 106c (or a part of it, called a “first vector”) may be obtained using that output; similarly, each item characteristic vector (or a part of it, called a “third vector”) may be obtained using that output. If the audio-visual element(s) are audio segment(s), a voice recognition neural network may be applied to generate an output which lists recognized words in the audio segment, to generate the first vector (and, if present, third vector).

[0047]

[0046] In some cases association bias can occur indirectly. For example, a certain training database (such as the training database 100) may statistically correlate “men” with briefcases (e.g. in a database of images, a high proportion of individuals shown as carrying briefcases may be men), and briefcases with being lawyers, such that an indirect association exists between men and lawyers. For that reason, optionally, the method may include selecting one or more attributes (e.g. ones for which it is desired to balance the training database 100, e.g. “men”) and using a trained language model to define one or more additional “proxy” attributes based on the selected attributes (e.g. “briefcases”), which tend to be collated with the selected attributes. The attributes used in the balancing of the training database 100 may be the selected attributes plus the proxy ones. The statistical correlation of the proxy attributes with the characteristics is reduced by the present method, and this has been found to reduce biases of the trained neural networks further, as described below with reference to Figs. 4 and 5.

[0048]

[0047] In some implementations, each training item 102 further comprises a textual descriptor. That is, the training item 102 may be a tuple of one or more audio-visual elements 104 and a text descriptor, usually relating to (e.g. describing, but in some cases just statistically correlated with) the content of the image. For example, some of the audio-visual elements 104 may be taken from photos in books or magazines and their corresponding captions. The textual descriptor for each training item 102 comprises one or more tokens selected from a vocabulary of tokens. The tokens in the vocabulary / vocabularies can be any appropriate text tokens, e.g., words, word pieces, punctuation marks, and so on that represent elements of text in one or more natural languages and, optionally, numbers and other text symbols that are found in a corpus of text. To generate the textual descriptor from a piece of free text (a sequence of words) associated with an audiovisual element 104, the system can tokenize the given sequence of words by applying a tokenizer, e.g., the SentencePiece tokenizer or another tokenizer, to divide the sequence into tokens from the vocabulary. The vocabulary may also include pre-defined tokens labelling positions in input dataset, e.g. the input text tokens may include a text token indicating the start / end of a phrase formed by other input text tokens, or indicating that a given input text token is the last input text token of the input dataset.

[0049]

[0048] The item attribute vectors 106a, 106b, 106c (and, if present, item characteristic vectors) may be partly based on the textual descriptors. For example, a part of each item characteristic vector, called a “second vector”, may be obtained for a given training item 102 by applying a first criterion specific to the attribute to the textual descriptor. For example, the first criterion may be that the text descriptor contains one of more words or phrases associated with the attribute (e.g. in the case of the attribute “cat”, these may be “cat”, “kitty”, “whiskers”, “miaow”, etc). Similarly, a part of each item characteristic vector (if any), called a “second vector”, may be obtained for a given training item 102 by applying a second criterion specific to the characteristic, to the corresponding texual descriptor. For example, the second criterion may be that the text descriptor contains one of more words or phrases associated with the characteristic (e.g. in the case of the characteristic “judge”, these may be “judge”, “courtroom”, “pass sentence”, etc).

[0050]

[0049] The loss function may include one or more further terms designed to further improve the training database 100. For example, the loss function may include a penalty term penalising a sum over the weight values of a divergence of the weight value from a subsampling rate, which may be denoted by ?]. For example, the penalty term may be a sum over the weight values of a measure of divergence of the weight value from the sub sampling rate (e.g. the square of the difference).

[0051]

[0050] This penalty term (and / or any other term of the loss function, including the attribute term(s) and the attribute characteristic term(s)) may also be defined based on at least one respective utility value for each training item 102, which may be indicative of the suitability of the training item 102 to the training process (e.g. because the corresponding audio-visual element 104 has a low level of noise, and / or a data size in a certain range, and / or because of some aspect of its content which is not captured by the attributes and characteristics). For example, the penalty term may be based on (e.g. proportional to) a sum over the weight values of a product of a utility value for the corresponding training item 102, and the measure of a divergence of the weight value from the sub-sampling rate. Here the utility value may be a value derived by an analysis process (e.g. by another trained neural network model) indicative of the suitability of the training item 102 to the training process.

[0052]

[0051] Once the training database 100 has been processed as described, it can be used for the training process, and the trained neural network 108 can be used to perform the e.g. audiovisual computational task. Note that it is not necessary for the processed training database 100 to be used throughout the training process. For example, a first part of the training process may be performed using an unbalanced training database 100 (e.g. while in parallel the training database 100 is being balanced), and a later part of the training process (“fine- tuning”) may be performed using a training database 100 processed as described here.

[0053]

[0052] If the computational task is an audio-visual computational task, the audio-visual computational task may be any one in which training items 102 including audio-visual element(s) 104, and in some case textual descriptors, are used (as inputs and / or outputs), and the training of the neural network 108 may be carried out with any known method.

[0053] For example, the e.g. audio-visual computational task may be a task in which audiovisual elements 104 are processed to generate corresponding textual labels. For example, the neural network 108 may be trained by a contrastive learning technique, which learns to generate embeddings of audio-visual elements 104, and embeddings of text descriptors, such that the respective embeddings are similar (e.g. as measured by a distance measure such as Euclidean distance) if the audio-visual elements 104 and text descriptors have similar content. From a given audio- visual element 104, the trained neural network 108 may be able to obtain the corresponding embedding, and convert that into a textual descriptor having a similar embedding.

[0054]

[0054] Alternatively, the e.g. audio-visual computational task may be a task in which audiovisual elements 104 are processed to classify them into one of a plurality of (typically predefined) categories indicative of the content of the audio-visual elements 104, or to identify segments of the audio-visual elements 104 (e.g. if the AV elements 104 are images, the segments may be corresponding objects depicted in the images; if the AV elements 104 are audio items, the segments may be portions of the audio item which have speech by a corresponding speaker). Another known audio-visual task is to identify keypoints within the audio-visual elements 104 meeting a content criterion.

[0055]

[0055] Alternatively, the e.g. audio-visual computation task may be a task in which textual items are processed to generate corresponding audio-visual elements 104 (e.g. one having an embedding similar to an embedding generated from the audio-visual element 104; the training process in this case may be contrastive learning). The training process may for example be one employing a GAN (generative adversarial network).

[0056]

[0056] Fig. 4 shows plots 402 and 404, which contain data summarizing results obtained by models trained using on training databases processed using methods disclosed herein. The model used is a CLIP (contrastive language-image pretraining) model. The model was trained on a database of images collected online of the size shown (100 million images for plot 402, 1 billion images for plot 404), and was evaluated using 8,000 images from the ILSRCV2012 database. The model was tasked to determine the gender of individuals shown in the training images, and the vertical axis plots the expected value of the difference between the probability of an individual being found male or female (such that a value nearer zero generally indicates a reduction in representation bias). The test was repeated for the “baseline” database (i.e. the original database not having been processed), the “balanced” database (processed as described herein to reduce representation bias), and the “proxies” database (processed as described herein including the use of proxies described above) as labeled. The labels “S / 32” and “B / 32” refer to model sizes introduced in Dosovitskiy et al. (2020) and Zhai et al. (2022a), with S referring to a model with 30 million parameters and B to a model with 100 million parameters for each modality. The numbers 384 and 768 indicate representation size, which is a measure of the dimensionality of the associated model.

[0057]

[0057] It can be seen from Fig. 4 that training based on the balanced database generally results in a reduction in representation bias, whether or not proxies are used. The use of proxies is particularly beneficial for models with large representations trained on large datasets.

[0058]

[0058] Fig. 5 shows corresponding data based on the FairFace (Karkkainen & Joo, 2021), UTKFace (Zhang et al., 2017), and MIAP (Schumann et al., 2021) datasets, annotated with the probability of the shown individual being a man and the probability of them being a woman. The first two datasets contain face images while MIAP contains images more representative of real-word scenarios. The vertical axis shows mean parity between men and women across all occupations obtained by providing the CLIP model with the name of each occupation.

[0059]

[0059] Once again, it can be seen that processing the data according to methods described herein reduces representation bias across the datasets and parameters that were tested.

[0060]

[0060] There is now described an example algorithm for implementing methods described herein. In particular, Algorithm 1 is an example pseudo-code implementation of a data balancing algorithm, while algorithm 2 is a code-like implementation of the bias vector a referred to in Algorithm 1.

[0061] Algorithm 1: Update step per example Algorithm 2: Bias vector implementation.

[0062] Hyperparameters: def biasvector (s, z , pi, epsd, epsr) :

[0063] Update: Ret urns :

[0064] 1 bi V t

[0065]

[0061] The operation of the example algorithm is described hereafter.

[0066]

[0062] Denote S: | S| = m and Y: |Y| = c for the set of attributes and labels respectively. (The set Y is referred to as z in the example algorithm.) That is to say, S represents the set of attributes considered for each audio-visual element 104 as described above, while Y represents the set of associated labels or characteristics that may further be associated with audio-visual elements 104 to define association bias as referred to above.

[0067]

[0063] As described above, processing the training database 100 to reduce bias may be accomplished by optimizing a set of weights assigned to each training item 102. It can be shown that finding a set of weights q that mitigate the two types of bias as described above is equivalent to finding a feasible solution q to the following constraints: for some small tolerance levels SD and SR, wherein E refers to an expectation value, s ~ D e {0, l }mis a specified attribute, TT e [0, l]mis a corresponding target, and y is a label drawn from the set Y. In this regard it is noted that, since both yrand Sk are binary-valued, zero covariance implies independence. For simplicity we assume that q falls within the unit interval [0, 1] , with 0 < q < Q for some Q e R U {co}, and further that, when subsampling from a dataset, E[q] is equal to the subsampling rate r / .

[0068]

[0064] Given these definitions, the example algorithm maintains two optimization variables v and in order to calculate the sample weight q by solving: ni wherein and are the violations to the above constraints. Given these conditions, it can be shown that Algorithm 1 as defined above (with the function bias vector as defined in Algorithm 2) provides the optimal solution to the above minimization. The expression being minimized corresponds to the loss function referred to above.

[0069]

[0065] In view of the preceding discussion, it will be appreciated that the example algorithm provides one exemplary method by which the above-defined loss function may be minimized by updating the weight values q.

[0070]

[0066] Some particular applications of the present techniques will now be discussed.

[0067] The trained neural network 108 can be configured to perform an image processing task, e.g., to receive an input comprising, for each of one or more frames, image data which includes an intensity / color values for each of an array of pixels. Alternatively, the image data may comprise features that have been extracted from one or more images. In either case, the images may have been ones which were captured by a camera (a still camera or video camera) or an imaging system such as a medical scanner. The neural network 108 can be configured to process the image data to generate an output for the image processing task.

[0071]

[0068] Alternatively, the trained neural network 108 may be configured to perform an audio processing task, e.g. to receive an audio item which is sound samples for each of a plurality of times during a sound duration (e.g. captured by a microphone). The neural network 108 can be configured to process the audio item to generate an output for the audio processing task.

[0072]

[0069] In either case, the task may be classification, e.g. generating output data indicating a likelihood that the input data item (e.g. the at least one audio-visual element 104) has content in one or more predetermined categories. The output data may be data indicating one of the categories, e.g. a one-hot vector with components corresponding to the categories). Alternatively, the output data could be multiple numerical values (e.g. real values, such as in the range 0 to 1) representing a distribution of estimated likelihoods that the input data item, or an object or element of the input data item, or an action within a video data item, belongs to a category.

[0073]

[0070] For example, if the task is image classification, the outputs generated by the neural network 108 for a given image may be scores for each of a set of object categories, with each score representing an estimated likelihood that the image contains an image of an object belonging to the category.

[0074]

[0071] As an example of audio data classification, if the input to the trained neural network 108 is an audio item which is a sequence representing a spoken utterance, the output generated by the neural network 108 may be a score for each of a set of pieces of text, each score representing an estimated likelihood that the piece of text is the correct transcript for the utterance. As another example, if the input to the neural network-based system is a sequence representing a spoken utterance, the output generated by the neural network-based system can indicate whether a particular word or phrase (“hotword”) was spoken in the utterance. As another example, if the input to the neural network-based system is a sequence representing a spoken utterance, the output generated by the neural network-based system can identify the natural language in which the utterance was spoken. Thus in general the network input may comprise an audio item for performing an audio processing task and the network output may provide a result of the audio processing task e.g. to identify a word or phrase or to convert the audio to text.

[0075]

[0072] As another example, if the task is object detection, the outputs generated by the neural network 108 for a given received image (still or video) may be one or more bounding boxes each associated with respective scores, with each bounding box representing an estimated location in the image and the respective score representing an estimated likelihood that an object is depicted at the location in the image, i.e., within the bounding box.

[0076]

[0073] As another example, if the task is semantic segmentation, the outputs generated by the neural network 108 for a given image may be labels for each of a plurality of pixels in the image, with each pixel being labeled as belonging to one of a set of object categories. For example, in the case that the image is a medical image, the segmentation may indicate a portion of a human or animal body. For a depth estimation task, the output may comprise, for each pixel, an estimated depth value such that the output pixels define a (3D) depth map for the image. In the case of an audio item, the semantic segmentation could indicate which speaker is speaking at any time.

[0077]

[0074] Another example image processing task may include an image keypoint detection task in which the output comprises the coordinates of one or more image keypoints such as landmarks of an object represented in the image, e.g. a human pose estimation task in which the keypoints define the positions of body joints. A further example is an image similarity determination task, in which the output may comprise a value representing a similarity between two images, e.g. as part of an image search task.

[0078]

[0075] In another example, the trained neural network 108 may be a multi-modal language model, such as one which is trained to receive inputs comprising an audio-visual image and optionally text, and to generate a text response to the input. For example, in the case of audiovisual elements 104 which are images, one multi-modal language model (“visual language model” - VLM) is described in “Flamingo: a visual language model for few-shot learning”, by J-B Alayrac et al, 2022, arXiv:2204.14198.

[0079]

[0076] Training items 102 from the balanced training database 100 generated by the existing techniques could be used to train this system, e.g. the multi-modal language model could be trained, upon receiving an input based on the audio-visual elements 104, to generate a corresponding text response which is the text descriptor for the training item 102.

[0080]

[0077] In this case, the balanced database 100 described above may be further processed by a language model to create modified training data, e.g. to generate questions from the text descriptors which could be associated with the audio-visual elements 104 to generate a training input to the multi-modal model, and corresponding answers from the text descriptor to be used as a training output. The training input and training output together constitute a training data item. The multi-modal model could be trained to generate the training outputs upon receiving the training inputs. Alternatively or additionally, the balancing process may be applied after the generation of the training data items.

[0081]

[0078] In certain cases, the training data items may comprise data items which comprise audio-visual elements 104 of more than one type (e.g. training data items including both text data and associated image and / or video and / or sound data, such as text describing, or asking a question about, content of the image and / or video and / or sound data; or data items including associated image and / or video data and associated sound data, such as sounds encoding a voice describing, or asking a question about, content of the image and / or video data).

[0082]

[0079] As another example, the trained neural network 108 may be one which is trained to receive a text input, and to generate an audio-visual element (e.g. an image (still or moving) or audio file) having content corresponding to the text input (a “generative model”). Several sorts of generative model are known, such as diffusion models and Generative Adversarial Networks (GAN) that include an inference model comprising a generator neural network, an encoder neural network and a discriminator neural network. The generator neural network, once trained, may be used to generate samples from the distribution based on latent values (or simply “latents”) selected from a latent value distribution (or “latent distribution”). The encoder neural network, once trained, may be used to generate latent values from the latent value distribution based on data items selected from the distribution. That is, the encoder neural network may be considered to implement the reverse function of the generator neural network. The generator neural network, once trained, may be employed for image processing tasks such as de-noising, de-blurring, image completion and the like by employing target data defining a noisy or incomplete image. The encoder neural network may be employed for image compression. The system may similarly be used to process signals representing other than images, e.g. audio items.

[0083]

[0080] For a system of one or more computers to be configured to perform particular operations or actions means that the system has installed on it software, firmware, hardware, or a combination of them that in operation cause the system to perform the operations or actions. For one or more computer programs to be configured to perform particular operations or actions means that the one or more programs include instructions that, when executed by data processing apparatus, cause the apparatus to perform the operations or actions.

[0081] Embodiments of the subject matter and the functional operations described in this specification can be implemented in digital electronic circuitry, in tangibly-embodied computer software or firmware, in computer hardware, including the structures disclosed in this specification and their structural equivalents, or in combinations of one or more of them. Embodiments of the subject matter described in this specification 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, data processing apparatus. Alternatively or in addition, the program instructions can be encoded on an artificially-generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode information for transmission to suitable receiver apparatus for execution by a 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 them.

[0084]

[0082] The term “data processing apparatus” refers to data processing hardware and 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. The apparatus can also be or further include special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit). The apparatus can optionally include, in addition to hardware, code that creates an execution environment for computer programs, e.g., code that constitutes processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of them. Thus a system, artificial neural network, or trained artificial neural network as described herein, can be implemented in hardware using electronic circuitry, e.g. in a physical box. Similarly computer code as described herein can be code to emulate such hardware or code for a hardware description language.

[0085]

[0083] A computer program (which may also be referred to or described as a program, software, a software application, a module, a software module, a script, or code) can be written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages, and it can be deployed in any form, including as a standalone 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 in a portion of a file that holds other programs or data, e.g., one or more scripts stored in a markup language document, in a single file dedicated to the program in question, or in multiple coordinated files, e.g., files that store one or more modules, sub-programs, or portions of code. A computer program can be deployed to be executed on one computer or on multiple computers that are located at one site or distributed across multiple sites and interconnected by a communication network.

[0086]

[0084] The processes and logic flows described in this specification can 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 can also be performed by, and apparatus can also be implemented as, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit).

[0087]

[0085] Computers suitable for the execution of a computer program include, by way of example, can be based on general or special purpose microprocessors or both, or any other kind of central processing unit. Generally, a central processing unit will receive instructions and data from a read-only memory or a random access memory or both. The elements of a computer are a central processing unit for performing or executing instructions and one or more memory devices for storing instructions and data. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. However, a computer need not have such devices. Moreover, a computer can be embedded in another device, e.g., a mobile telephone, 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.

[0088]

[0086] 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, e.g., 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 the memory can be supplemented by, or incorporated in, special purpose logic circuitry.

[0089]

[0087] To provide for interaction with a user, embodiments of the subject matter described in this specification 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 a pointing device, e.g., a mouse or a trackball, by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback, e.g., visual feedback, auditory feedback, or tactile feedback; and input from the user can be received in any form, including acoustic, speech, or tactile input. In addition, a computer can interact with a user by sending documents to and receiving documents from a device that is used by the user; for example, by sending web pages to a web browser on a user’s client device in response to requests received from the web browser.

[0090]

[0088] Embodiments of the subject matter described in this specification can be implemented in a computing system that includes a back-end component, e.g., as a data server, or that includes a middleware component, e.g., an application server, or that includes a front-end component, e.g., a client computer having a relationship graphical user interface or a Web browser through which a user can interact with an implementation of the subject matter described in this specification, 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, e.g., a communication network. Examples of communication networks include a local area network (“LAN”) and a wide area network (“WAN”), e.g., the Internet.

[0091]

[0089] The computing system can include clients and servers. A client and server are generally 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.

[0092]

[0090] While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or of what may be claimed, but rather as descriptions of features that may be specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.

[0093]

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

[0092] Particular 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 can be performed in a different order and still achieve desirable results. As one 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.

Claims

Claims1. A computer-implemented method of processing a training database for training a neural network to perform a computational task, the training database comprising training items, to obtain a weight value for each training item, the method comprising: for each of one or more attributes, determining a corresponding item attribute vector for each training item which is a vector indicative of a likelihood of the training item exhibiting the attribute; and for each training item determining a corresponding weight value by: defining a loss function of the weight values and the item attribute vectors; and updating the weight values to reduce the loss function.

2. The method of claim 1, wherein each training item comprises at least one audiovisual element.

3. The method of claim 1 in which the loss function includes, for each attribute, a corresponding attribute term based on a corresponding first sum over the training items, weighted by the corresponding weight values, of a first function of the item attribute vector for the corresponding training item and attribute.

4. The method of claim 3, in which the first function is the item attribute vector minus a desired attribute vector corresponding to the attribute.

5. The method of claim 3 or claim 4, in which each attribute term is non-zero only if the corresponding first sum is above a first threshold.

6. The method of claim 5, in which each attribute term is the greater of (i) zero and (ii) the corresponding first sum minus the first threshold.

7. The method of any preceding claim, which further comprises: for each of one more characteristics, determining a corresponding item characteristic vector for each training item, which is a vector indicative of a likelihood of the training item exhibiting the characteristic,the loss function including, for each attribute and each characteristic, a corresponding attribute characteristic term based on a corresponding second sum over the training items, weighted by the corresponding weight values, of a second function of: the item attribute vector for the corresponding training item and attribute, and the item characteristic vector for the corresponding training item and characteristic.

8. The method of claim 7 when dependent on claim 4, in which the second function is a product of (i) the item attribute vector minus the desired attribute vector corresponding to the attribute, and (ii) the item characteristic vector.

9. The method of claim 7 or claim 8 in which each attribute characteristic term is nonzero only if the corresponding second sum is above a second threshold.

10. The method of claim 9, in which each attribute characteristic term is the greater of (i) zero and (ii) the corresponding second sum minus the second threshold.

11. The method of any of claims 2 to 6, or of claims 7 to 10 when dependent on claim 2, in which each training item further comprises a textual descriptor which comprises one or more tokens selected from a vocabulary of tokens, and the item attribute vector for each training item depends upon both the corresponding at least one audio-visual element and the corresponding textual descriptor.

12. The method of claim 11 in which the item attribute vector, for each training item and attribute, is a concatenation of a first vector indicating whether the corresponding at least one audio-visual element exhibits the attribute, and a second vector indicating whether the corresponding text descriptor exhibits the attribute.

13. The method of claim 12, in which the audio-visual items are images, and which includes deriving the first vector for each training item and attribute from the output of an object detection neural network model upon receiving the corresponding at least one audiovisual item.

14. The method of claim 12 or claim 13, which includes deriving the second vector for each training item and attribute, by determining if the corresponding textual descriptor meets a corresponding first criterion.

15. The method of any of claims 11 to 14, when dependent on claim 7, in which the item characteristic vector for each training item and each characteristic depends upon both the corresponding at least one audio-visual element and the corresponding textual descriptor.

16. The method of claim 15, in which the item characteristic vector, for each training item and characteristic, is a concatenation of a third vector indicating whether the corresponding at least one audio-visual element exhibits the characteristic, and a fourth vector indicating whether the corresponding text descriptor exhibits the attribute.

17. The method of claim 16, in which the audio-visual items are images, and which includes deriving the third vector for each training item and characteristic from the output of an object detection neural network model upon receiving the corresponding at least one audio- visual item.

18. The method of claim 16 or claim 17, which includes deriving the fourth vector for each training item and characteristic by determining if the corresponding textual descriptor meets a corresponding second criterion.

19. The method of any preceding claim, further including defining the attributes by selecting one or more attributes and using a trained language model generating one or more additional attributes based on the selected attributes.

20. The method of any preceding claim in which the loss function further includes a penalty term which is a sum over the weight values of a measure of divergence of the weight value from a sub sampling rate.

21. The method of claim 20 in which the penalty term is a sum over the weight values of a product of a utility value for the corresponding training item and the measure of a divergence of the weight value from the sub-sampling rate, the utility value being a derived value indicative of the suitability of the training item to the training process.

22. A method of training a neural network to perform an audio-visual computational task based on a training database comprising training items each containing at least one audio-visual element, the method comprising: training the neural network to perform the audio-visual computational task, using the training database and based on weight values obtained by the method of claim 2, or of any of claims 3 to 21 when dependent on claim 2.

23. The method of claim 22, in which the training of the neural network employs a subset of the training items, the subset being selected based on the weight values.

24. The method of claim 22, in which the training of the neural network is performed by selecting training items from the database based on the weight values, and making an update to the neural network model to reduce the value of a training loss function defined based on current state of the neural network modal and the selected training items.

25. The method of claim 24, in which the training of the neural network includes repeatedly selecting training items from the training database with a selection frequency based on the corresponding weight values.

26. The method of claim 22, in which the training of the neural network comprises updating the neural network model to reduce the value of a training loss function defined based on the current state of the neural network, one or more of the training items, and corresponding weight values for the one or more of the training items.

27. A method of performing an audio-visual computational task, the method including: obtaining a neural network which has been trained by the method of any of claims22-26; and performing, by the neural network, the audio-visual computational task.

28. The method of claim 2, or of any of claims 3 to 27 when dependent on claim 2, in which the audio-visual computational task is a task in which audio-visual elements are processed to generate corresponding textual labels.

29. The method of claim 27, in which the neural network is trained by a contrastive learning technique.

30. The method of claim 2, or of any of claims 3 to 29 when dependent on claim 2, in which the audio-visual computational task is a task in which audio-visual elements are processed to classify them to one of a plurality of categories indicative of the content of the audio-visual elements, or to identify segments or keypoints within the audio-visual elements meeting a content criterion.

31. The method of claim 2, or of any of claims 3 to 30 when dependent on claim 2, in which the audio-visual computation task is a task in which textual items are processed to generate corresponding audio-visual elements.

32. The method of claim 7 when dependent on claim 2, or any of claims 8-31 when dependent on claims 7 and 2, in which the audio-visual elements are images, and the at least one of the characteristics is a profession of an individual represented in the image.

33. 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 method of any preceding claim.

34. A computer-program product containing instructions that when executed by one or more computers cause the one or more computers to perform the method of any one of claims 1-32.