MACHINE LEARNING MODEL TRAINING WITH ADVERSARIAL LEARNING AND TRIPLET LOSS REGULARIZATION

A method, computer system, and a computer program product for training a machine learning model are provided. A first set of labelled training data from a source domain is obtained. A second set of labelled training data from a target domain is obtained. A number of labelled samples of the first set is greater than a number of labelled samples of the second set. The first machine learning model is trained with the first set and the second set and with a discriminator so that the discriminator is unable to distinguish whether a sample is from the first set or from the second set. The first machine learning model is trained with triplet loss regularization using the first set and the second set.

BACKGROUND

The present invention relates to the fields of computers, artificial intelligence, automatic machine learning, transfer learning, multi-data modality, and data science, and more particularly to training machine learning models for new data domains so that the machine learning models can perform inference.

Current artificial intelligence-based machine learning models often require enormous amount of labeled data samples to train a reliable predictive model. In many practical applications, however, collecting and annotating a large number of samples is expensive and time-consuming.

InDomain Adaptation with Structural Correspondence Learningby Blitzer et al., a structural correspondence learning technique was applied to automatically induce correspondence among features from different domains. Both domains had ample unlabeled data, but only the source domain had labeled training data. A set of pivot features was defined on the unlabeled data from both domains. The pivot features were used to learn a mapping from original feature spaces of both domains to a shared, low-dimensional real-valued feature space. If a good mapping was learned, then the classifier learned on the source domain was also deemed to be effective on the target domain.

InPreparing Network Intrusion Detection Deep Learning Models with Minimal Data Using Adversarial Domain Adaptationby Singla et al., adversarial domain adaptation was evaluated to address the problem of scarcity of labeled training data in a dataset by transferring knowledge gained from an existing network intrusion dataset. A GAN architecture with a generator and discriminator that were artificial (deep) neural networks with the same layer configuration were used to perform adversarial domain adaptation. The main objective of the model was then to learn a classifier that could accurately predict whether data samples in a target domain belonged to an attack class or to a benign class. Samples from the source and target data distributions were taken and converted into a domain-invariant representation to fool the discriminator into misclassifying the representations generated by the generator. However, in most scenarios where the source dataset had a different feature space than the target dataset, Singla et al. indicated a lack of interest for the efficacy of the trained model in identifying the attacks contained in the source dataset.

US 2022/0198339 A1 to Zhao et al. disclosed systems and methods for training a machine learning model based on cross-domain data. A first processing unit of the machine learning model was associated with a first loss function. An adversarial unit of the machine learning model was associated with a second loss function. A second processing unit of the machine learning model determined multiple second source prediction outputs based on source features and determined multiple second target prediction outputs based on target features. The machine learning model performed a third loss function that reflects the consistency of the first processing unit and the second processing unit.

Reusing well-trained artificial intelligence model from a closely related domain or fine tuning an existing artificial intelligence model often leads to less reliable models and sub-optimal solutions. With adversarial learning alone, there is no guarantee that samples with the class labels in two domains are mapped close to each other. Using conventional adversarial learning can lead to failure in classification because a trained target model might predict samples from a single class as being from a variety of different classes. Some extraneous features may be beneficial in the source domain but might distract a target model from learning more fundamental features for the target domain.

A need exists to provide a training scheme for training an artificial intelligence machine learning model that has only an extremely limited number of annotated training data samples available for training. A need exists to better leverage the more extensive labelling from a source domain. A need exists to produce such a training scheme that can be performed more quickly to train a machine learning model to be able to accurately perform class prediction.

SUMMARY

According to one exemplary embodiment, a method for training a machine learning model is provided. According to the method, a first set of labelled training data from a source domain is obtained. A second set of labelled training data from a target domain is obtained. A number of labelled samples of the first set is greater than a number of labelled samples of the second set. The first machine learning model is trained with the first set and the second set and with a discriminator so that the discriminator is unable to distinguish whether a sample is from the first set or from the second set. The first machine learning model is trained with triplet loss regularization using the first set and the second set. A computer system and computer program product corresponding to the above method are also disclosed herein.

In this manner, a training scheme is provided for training an artificial intelligence machine learning model that can use a small number of annotated training data samples in a target domain by successfully leveraging more extensive labelling from a source domain. Such a training scheme may be helpful when time and or cost constraints prohibit production of extensive labelled data for the target domain. The trained artificial intelligence model may be able to successfully perform classification despite the minimal amount of labelled data from the target domain.

In some additional embodiments, the training of the first machine learning model with the discriminator and with the triplet loss regularization occurs iteratively based on refining of a sample pool of the first set. The sample pool is refined and/or filtered by evaluating relevancy of the first set in a latent common embedding space between the first set and the second set. The refining may include comparing a first distance between a matching pair to a second distance between a non-matching pair to determine a triplet function value. The matching pair and the non-matching pair may each belong to a triplet and may include an anchor sample from the second set and a respective additional sample from the first set. The refining may further include discarding a first triplet for the iterative training in response to the triplet function value for a first triplet not exceeding a threshold value.

In this manner, a changing embedding space may facilitate updating sample pools so that most relevant sample triplets are kept for the training, required training time for the model is reduced, the convergence rate is increased, and model stability is improved. The number of overhead computations for training an effective machine learning model for the target domain may be reduced by increasing the frequency of calculating distances among samples.

In some additional embodiments, a classifier of the first machine learning model is trained using classification loss from the first set and the second set. A first generator encoder of the first machine learning model is updated based on (1) domain loss from the training of the discriminator, (2) distance loss from the training with the triplet loss regularization, and (3) classification loss from training a classifier of the first machine learning model using the first set and the second set. The trained first machine learning model for use in an inference phase includes the updated first generator encoder and the trained classifier.

In this manner, tradeoff factors among the losses may be tuned, e.g., using cross-validation, and the trained artificial intelligence model hereby produced may successfully perform classification despite the minimal amount of labelled data from the target domain.

In some additional embodiments, classification is performed with the trained first machine learning model via (1) inputting a new sample into the updated first generator encoder so that the updated first generator encoder generates an embedding in an embedding space and (2) inputting the embedding into the trained classifier so that the trained classifier produces a class prediction.

In this manner, the trained artificial intelligence model hereby produced successfully performs classification for a new domain. The trained artificial intelligence model may be used to perform a wide variety of machine learning tasks such as image classification, sound classification, natural language processing tasks, automated question-and-answer, etc.

In some additional embodiments, a second generator encoder is updated based on (1) domain loss from the training with the discriminator, and (2) classification loss from training a classifier of the first machine learning model using the first set and the second set.

In this manner, a source-side generator encoder and a target-side generator encoder may be used for the training with the discriminator and for the training of the classifier so that labelled samples from the source domain may be leveraged to accelerate training within the target domain.

In some additional embodiments, the triplet loss regularization includes penalization in response to samples from the second set being mapped at a distance greater than a distance threshold from samples from the first set and from the second set having the same class labels as the samples from the second set. The triplet loss regularization may also include penalization in response to samples from the second set being mapped at a distance less than a distance threshold from samples from the first set and from the second set having different class labels as the samples from the second set.

In this manner, training is conducted in an accelerated time frame to achieve a robust and effective machine learning model for a new domain in which few labelled samples were present for the domain.

DETAILED DESCRIPTION

The following described exemplary embodiments provide a computer-implemented method, a computer system, and a computer program product for training a machine learning model in an accelerated manner and so that the so-trained machine learning model is able to perform prediction reliably. The training may be successfully completed using a lower number of annotated training data samples for a target domain. Such training is particularly helpful in situations where an urgent need exists for machine learning model prediction to begin as soon as possible. Such training is also particularly helpful in situations where implementation of machine learning in one particular environment might be short-term so that long-term data and sample collection is not possible. In some instances, machine learning prediction is desired for implementation in frequent new environments. By better harnessing the learning of a source domain that is different from the target domain, the present embodiments allow an accelerated training of a machine learning process even with an extremely limited number of annotated training data samples for the target domain. By providing this machine learning training that may occur in an automated manner, the technology of artificial intelligence and machine learning is improved.

Machine learning is a branch of artificial intelligence (AI) and computer science which focuses on the use of data and algorithms to imitate the way that humans learn, gradually improving its accuracy. Neural networks, or artificial neural networks (ANNs), include node layers, containing an input layer, one or more hidden layers, and an output layer. Each node, or artificial neuron, connects to another and has an associated weight and threshold. If the output of any individual node is above the specified threshold value, that node is activated, sending data to the next layer of the network. Otherwise, no data is passed along to the next layer of the network by that node. The “deep” in deep learning may refer to the number of layers in a neural network. A neural network that consists of more than three layers—which would be inclusive of the input and the output—can be considered a deep learning algorithm or a deep neural network. A neural network that only has three layers may be referred to as a basic neural network. Deep learning and neural networks are credited with accelerating progress in areas such as computer vision, natural language processing, and speech recognition. The present embodiments improve a training process for a machine learning model so that the training may occur in an accelerated manner even with the availability of few labelled samples from a target domain.

Supervised learning, also known as supervised machine learning, is defined by its use of labeled datasets to train algorithms to classify data or predict outcomes accurately. As input data is fed into the machine learning model, the machine learning model adjusts its weights until the machine learning model has been fitted appropriately. As part of that process the label is also provided to the machine learning model so that the model learns to associate a correct class with the sample that is provided. The model fitting occurs as part of the cross validation process to ensure that the model avoids overfitting or underfitting. Supervised learning helps solve a variety of real-world problems at scale, such as classifying spam in a separate folder from an inbox. Some structures and/or methods used in supervised learning include neural networks, naïve bayes, linear regression, logistic regression, random forest, and support vector machine (SVM).

The present embodiments include the combination of adversarial training steps as well as triplet loss regularization to better harness the already-achieved learning of labelled samples from a source domain that is different from the target domain. By combining these techniques, the present embodiments achieve improved machine learning model accuracy compared to models trained with only one or the other of these techniques and compared to an existing model with classifier training only.

The present embodiments include training the first machine learning model with a discriminator in an adversarial manner so that the discriminator is unable to distinguish whether a sample is from a source domain or from a target domain. In this manner, the machine learning model learns to better accept the ground truth information from the source domain because the annotated samples from both domains are treated as being part of a single set. A discriminator is used to train encoders for the machine learning model. The discriminator attempts to predict whether a submitted sample having been embedded into an embedding space is from one of the two source possibilities (source domain or target domain). The weights of the encoders are adjusted to attempt to fool the discriminator so that the discriminator is unable to distinguish from which source possibility the sample originated. Due to this competition and back-and-forth adjustment, the weights of the encoders are eventually adjusted and optimized so that the machine learning model learns to better accept all of the labelled samples as being part of a single set.

The present embodiments include triplet loss regularization as a technique to guide the predictions of the being-trained machine learning model to better match the labels of the samples provided. The triplet loss regularization optimizes the neural network layer and/or node weights for producing embeddings in the embedding space z so that data points with the same class identity are closer to each other than to data points for other class identities. The labelled samples may be separated into triplet groups with an anchor sample “a” from the target domain that has a known class due to the label that is provided. The triplet group may also further include a positive sample “p” that has a known class the same as the anchor sample. The class of the positive sample is also known due to the label that is provided. The triplet group may also further include a negative sample “n” that has a known class that is different from the class of the anchor sample. The class of the negative sample is also known due to the label that is provided. The triplet loss regularization may include distance regularization between one or more of the following triplet data sets (with “t” referring to the target domain and “s” referring to the source domain):(a) L(at, pt, nt): penalizes if samples atand ptare mapped far apart in z, while atand ntare mapped close (within the target domain);(b) L(at, pt, ns): penalizes if samples atand ptare mapped far apart in z, while atand nsare mapped close (across two domains);(c) L(at, ps, nt): penalizes if samples atand psare mapped far apart in z, while atand ntare mapped close (across two domains); and(d) L(at, ps, ns): penalizes if samples atand psare mapped far apart in z, while atand nsare mapped close (across two domains)where an L(a, p, n)=[dp−dn+m]+with dpbeing a function that measures the distance between (a, p), and dnbeing a function that measures the distance between (a, n) in the embedding space, and m being a positive margin factor. Compared to the first three triple set possibilities, the number of triplet samples used for L(at, ps, ns) is the largest because both p, n are sampled from the source domain. The present embodiments may include the most potential samples in a “pool” and may include refining the pool and its samples as part of the regularization and model training.

The present embodiments help developers to take an end-to-end approach for retrieving data, training a model, saving the trained model, and implementing the trained model.

In one example a target domain is monitoring for vehicular activity in a desert environment by the gathering of image samples. Those seeking usage of the machine learning model for this purpose may have few samples of the images of the vehicular activity in the desert that they can provide to the machine learning model for training same. To accelerate model training, predictive power of a different source domain with many labelled samples may be harnessed. For this vehicular activity example, labelled samples that were used for training a machine learning model that predicted vehicular activity in a city environment were obtained. The number of labelled samples of the vehicular activity in the city may be numerous, e.g., greater than the number of labelled samples of vehicular activity in the desert.

In other examples, a new domain is sought in another environment such as identifying objects such as vehicles in an Arctic environment, in an Antarctic environment, in a water environment, in an underwater environment, in a forest environment, etc. The object that is sought to be identified in a predictive manner may be a vehicle such as an airplane, a submarine, etc. The source domain used to harness machine learning training for these other domains may be any for which a large number of labelled samples is had or readily available.

In one example a target domain is monitoring for anomalous sound detection for machine condition monitoring after a domain shift. Anomalous sound detection is a task of identifying whether a sound emitted from a machine is normal or anomalous. This type of sound detection is a helpful technology for detecting mechanical failures. While labeled samples are often collected under ideal conditions, due to domain shifts it is more challenging to obtain substantial samples for supervised training in real-world cases. For example, training sounds from a product conveyor are collected in one season, but anomalous sound detection requires continuously monitoring the conveyor through all seasons, under different operating conditions. For example, a conveyor may need to be monitored in a wide variety of situations such as a variation of motor speed in response to product demand, uncontrollable fluctuating noise from different environments, etc. Collecting sufficient training data in all conditions/environments is unrealistic. Hence, the present embodiments may harness learning from training data sets already obtained to train the machine learning model for the new situation. The present embodiments are capable of transferring and adapting knowledge in the source domain to a novel target domain with extremely limited annotated data samples. The present embodiments may be implemented with binary class settings such as normal vs. anomalous. The present embodiments may be implemented with multiple class settings for different levels of mechanical failures.

In some embodiments, labelled samples from the target domain and from the source domain may have similar types and/or modalities such as both being image data. In other embodiments, labelled samples from the target domain and from the source domain may have some different types and/or modalities such as, in one example, the target domain providing image samples and the source domain providing sound samples and, in another example, the target domain providing sound samples and the source domain providing image samples. The present embodiments may still through the discussed techniques be able to harness the learning from the earlier labelled data set despite the differences in sample/data modality type.

Referring now toFIG.1, an operational flowchart is shown that illustrates a machine learning model accelerated training process100according to at least one embodiment.

In step102of the machine learning model accelerated training process100shown inFIG.1, labelled samples from a source domain are obtained. In at least some embodiments, all of the samples taken from the source domain are labelled and, therefore, constitute ground truth-holding members. In at least some embodiments, a number of the labelled samples that are received in step102from the source domain will exceed, i.e., be greater than, a number of the labelled samples that are to be received in step104from the target domain. InFIGS.2-4, these samples obtained in step102are shown as labelled source domain samples202.

In one example a target domain is monitoring for vehicular activity in a desert environment by the gathering of image samples. Those seeking usage of the machine learning model for this purpose may have few samples of the images of the vehicular activity in the desert to provide the machine learning model for training same. To accelerate model training, predictive power of a different source domain with many labelled samples may be harnessed. For this vehicular activity example, in step102labelled samples that were used for training a machine learning model that predicted vehicular activity in a city environment were obtained. The number of labelled samples of the vehicular activity in the city may be numerous, e.g., greater than the number of labelled samples of vehicular activity in the desert.

In at least one embodiment, the obtaining of step102includes receiving the labelled samples as one or more digital files. The receiving may occur via a transmission over a communication network such as the wide area network702that is shown inFIG.7. The obtaining may include one or more computers such as the client computer701and/or the remote server704receiving the one or more digital files via that network transmission. The obtaining may occur via the accelerated ML, training program716receiving an uploaded file at the computer701.

In step104of the machine learning model accelerated training process100shown inFIG.1, a target domain with few labelled samples is identified. In at least some embodiments, a number of the labelled samples that are identified in step104along with the target domain is less than a number of the labelled samples that were received from the source domain in step102. InFIGS.2-4, the labelled samples that are part of the target domain identified in step104are shown as labelled target domain samples204. In at least some embodiments, the number of labelled samples that are identified in step104along with the target domain includes a few labelled samples per class. For example, in a binary prediction model there may be four labelled samples provided—two of a first class and two different ones of a second class. In one embodiment, the number of labelled samples that are identified in step104along with the target domain includes one respective labelled sample per class.

For the desert vehicular activity example, in step104labelled samples that were used for training a machine learning model that predicted vehicular activity in a desert environment were obtained. The number of labelled samples of the vehicular activity in the desert may be less than, e.g., substantially less than, the number of labelled samples of vehicular activity in the city. For a model with five different vehicle types, the step104may include receiving ten different labelled samples (two each for the five different vehicle types). For a model with five different vehicle types, the step104may include receiving five different labelled samples (one each for the five different vehicle types).

In at least one embodiment, the identification of step104includes receiving labelled target domain samples204as one or more digital files. The receiving may occur via a transmission over a communication network such as the wide area network702that is shown inFIG.7. The obtaining may include one or more computers such as the client computer701and/or the remote server704receiving the one or more digital files via that network transmission. The obtaining may occur via the accelerated ML training program716receiving an uploaded file at the computer701.

In step106of the machine learning model accelerated training process100shown inFIG.1, the shape/dimensions of the samples for the source domain are compared with the shape/dimensions of the samples for the target domain. The samples for the source domain refers to those received in step102. The samples for the target domain refers to those that were with the target domain that was identified in step104. The dimensions of a respective labelled sample are equal to the number of inputs, features, and/or measurement variables of that sample. Shapes are tuples representing how many elements an array or tensor has in each dimension. For example, a shape (20, 4, 8) means an array or tensor with 3 dimensions, containing twenty elements in the first dimension, four elements in the second dimension, and eight elements in the third dimensions, totaling 30*4*10=640 elements or numbers. For an image sample, the shape/dimensions may include elements/features such as color (red, green, and blue intensity), black and white, image size with pixel numbers, etc. For an audio sample, the shape/dimensions may include elements/features such as wave frequencies, intensities, wave durations, decibels, pitch, etc.

In some embodiments step106is performed by submitting the samples to a machine learning model that has been trained to recognize the shape/dimensions of a data set. The output of the machine learning model indicates the shapes/dimensions of the data set. In other embodiments, step106may be performed via a subject matter expert who analyzes the samples and manually inputs the shape/dimensions to the accelerated ML training program716. Such input may occur by way of the UI device set723that is connected to the computer701, that may receive input from a user such as subject matter expert, and that may transmit the data signal through a bus of the computer701to the accelerated ML training program716stored on the persistent storage713of the computer701.

In step108of the machine learning model accelerated training process100shown inFIG.1, labelled samples from the source domain are used to embed samples into a feature space and a classifier.FIG.2shows an initialization view200which includes an example of step108taking place in that the labelled source domain samples202are input into source-side encoders206. The encoders such as the source-side encoders206and/or the target-side encoders208may be multi-layer neural networks such as a convolutional neural network (“CNN”) or a recurrent neural network (“RNN”) depending on the implemented applications and input type. For example, a CNN may be implemented to perform machine learning on acoustic spectrum images.

In response to the inputting, the source-side encoders206produce an embedding in the embedding z-space210. The embedding represents a particular sample, respectively. An embedding is a low-dimensional space into which high-dimensional vectors are translated. Embeddings make it easier to do machine learning on large inputs. Ideally, an embedding captures some of the interrelationships of the features of the input so that similar data samples are placed close together in the embedding space. Embeddings are used to represent data in a space with “d” dimensions, where d is the number of dimensions of the embedding matrix. Every data point is then represented by a vector of length d, and similar data points are going to be clustered close to one another. Each dimension represents a different aspect or feature of the data.

In response to generating an embedding in the embedding z-space210, the embedding is input into a classifier212which, in response, produces a prediction of a class of the embedding. The predicted class, therefore, is a prediction of the class of the input sample. Because the labelled source domain samples202are labelled and are provided with a correct classification, this inputting may begin a training of the classifier212. The classifier such as the classifier212may be a multilayer network with a last layer as a softmax that uses cross entropy for the loss function.

The source-side encoder206used in step108may be already trained and taken from a machine learning model for the source domain or may be untrained and trained by inputting the extensive labelled source samples202.

In step110of the machine learning model accelerated training process100shown inFIG.1, an encoder of the target domain model is initialized with weights based on the sample shape/dimension similarity comparison. This comparison refers to the shape/dimension comparison of step106. As described below, the initialization view200shown inFIG.2includes an example of step110being performed.

For instances in which the comparison indicates that the target samples have shapes and/or dimensions which pass a similarity threshold with respect to corresponding shapes and/or dimensions of the labelled training data of the source samples, the initialization of step110includes implementing weights of the source encoders206as weights for the target encoders208. InFIG.2, this weight implementation is indicated with the weight transfer arrow214. In this instance, the source-side encoders206in at least some embodiments are extracted from an already-trained model for the source domain. The accelerated ML training program716may, in an automated manner, analyze programming code of the already-trained machine learning of the source domain, identifying linking code between different code portions that perform the layers, and extract the layers for the encoder portions. The programming code may be in one of a variety of programming languages. In other embodiments, a programmer uses the client computer701to perform the above-mentioned code analysis, linking code identification, and portion extracting so that the source-side encoders208are extracted or other portions are extracted and the source-side encoders208remain. The various layers may in some embodiments be represented respectively in different parts of the programming code. Such different code areas may in at least some embodiments be joined together via programming connectors such as loops. Different layers of the machine learning model may be joined together via a respective loop. After the source-side encoders208are obtained, their weights may be copied over to the target-side encoders210via an automated command in a ML modification/initialization program.

For instances in which the comparison indicates that the target samples have shapes and/or dimensions which fail a similarity threshold with respect to corresponding shapes and/or dimensions of the labelled training data of the source samples, the initialization of step110includes randomly initializing weights of the target-side encoder208. In these instances, a random distribution such as a uniform distribution and/or a gaussian distribution may be selected for the initialization of the weights of the target-side encoders208. The accelerated ML training716in some embodiments performs this random initialization in an automated manner via a random weight installation programming command.

For some instances, the initialization of step110in some embodiments includes randomly initializing weights of the target-side encoder208for one or more initial layers and transferring and/or copying, from the source-side encoders206, weights for latter layers of the target-side encoder208which are closer to the embedding z-space210. This approach allows for (1) weight differences in initial layers due to differences in samples but (2) converging machine learning weight values as the encoders approach the embedding z-space210. This converging at the later layers of the two encoders206,208helps the trained machine learning model learn to assimilate samples from the different sources as the signals enter the embedding z-space210. This assimilation helps the accelerated ML training program716better evaluate samples from the labelled source samples202which are most similar to the labelled target samples204, and, therefore, are most valuable for use in helping to train the new target domain-focused machine learning model in an accelerated manner.

In step112of the machine learning model accelerated training process100shown inFIG.1, a discriminator is trained using target and source model encoders and so that the discriminator cannot determine sample domain origin.FIG.3shows a discriminator-involved training view300which includes an example of step112taking place.FIG.3shows many of the same elements and/or components that were shown for the initialization view200inFIG.2.FIG.3shows that for the discriminator-involved training, source-domain samples302and target-domain samples304are both input into the encoders. Different from the labelled source-domain samples202and the labelled target-domain samples204shown inFIG.2, however, the source-domain samples302and target-domain samples304are input into the encoders while ignoring the labels. The samples may otherwise be the same except that the labels are ignored or are input with the labels removed or not received. As part of the ignoring of the class label information, the training for the discriminator320does not include instructing the discriminator to choose a class for the samples. The source-domain samples302may be input into the source-side encoders206. The target-domain samples304may be input into the target-side encoders208. The inputting of the samples into the encoders causes the encoders to generate an embedding representing the input into the embedding z-space210. The embeddings from the embedding z-space210are then fed into the training discriminator320which itself is a classifier. The classifier in at least some embodiments includes a softmax layer as an output layer.

The training discriminator320then seeks to predict whether the embedding came from the source-side samples302or from the target-side samples304. This prediction constitutes the classification by the training discriminator320. Thus, the training discriminator320is itself a classifier which may perform binary entropy. The prediction is challenging for the training discriminator320because the samples are submitted to training discriminator320without indicating which domain (source or target) provided the sample. This training of the training discriminator320is part of adversarial training and is intended to develop so that the training discriminator320is unable to distinguish whether a sample is from the source-side samples302or from the target-side samples304. In this manner, the machine learning model learns to better accept the ground truth information from the source domain because the annotated samples from both domains are treated as being part of a single set. The training discriminator320may perform binary cross entropy to produce a domain loss function. The training discriminator320is updated to minimize this loss which is computed for samples from both domains and which may be computed from labeled and/or unlabeled samples. In the discriminator-involved training view300the source side encoder206and the target side encoder208initially perform with their weights frozen to produce the embeddings in the embedding z-space that are then fed to the training discriminator320.

An adversarial aspect of this training includes adjusting the encoder weights to attempt to fool the discriminator so that the discriminator is unable to distinguish from which source possibility the sample originated occurs in a subsequent stage. Due to that subsequent adjustment a back-and-forth competition occurs with the training discriminator320seeking to predict sample origin possibility (source or target) and the encoder being adjusted to try to fool the training discriminator320. The loss with respect to the target samples is kept track of via the accelerated ML, program716in order to subsequently update the encoder networks.

In step114of the machine learning model accelerated training process100shown inFIG.1, the encoder is trained with triplet loss regularization, with classification loss, and with domain discriminator loss.FIG.4shows an encoder training view400which includes an example of step114taking place.FIG.4shows some of the same elements and/or components that were shown for the initialization view200inFIG.2and/or for the discriminator training view300shown inFIG.3.

FIG.4shows that the target encoder208is trained along with the classifier212through classification loss. In response to receiving an input of one of the labelled target samples204and/or one of the labelled source samples202into the target-side encoders208and/or the source-side encoders206, respectively, the particular encoder generates an embedding in the embedding z-space210that represents the particular sample. The embedding is then input into the classifier212which, in response, produces a prediction of a class of the embedding. The predicted class, therefore, is a prediction of the class of the input sample. Because the labelled samples are labelled and are provided with a correct classification, this inputting may be part of training of the classifier212. The classifier such as the classifier212may be a multilayer network with a last layer as a softmax that uses cross entropy for the loss function. The weights of the source-side encoder208are adjusted by the accelerated ML training program716in order to optimize the loss function for the classification. The classifier212itself is also adjusted based on the classification loss that is determined, particularly to reduce the classification loss. This adjustment occurs by adjusting weights of layers and/or nodes of the classifier212.

FIG.4also shows that a sample pool430of the source side samples is refined by performing a triplet loss regularization aspects of which are also further illustrated inFIG.5. The sample pool430is divided into source-domain samples432and target-domain samples434. The source-domain samples432include positive and negative samples from the labelled source domain labels202with respect to an anchor sample selected from the target domain samples. The positive samples are from a same class as the anchor sample from the labelled target samples204. The negative samples are from a different class than the class of the anchor sample. The target-domain samples434include positive and negative samples from the labelled target domain labels204. These samples are embedded into frozen versions of the encoders, namely a frozen source-side encoder406and a frozen target-side encoder408, respectively. These frozen encoders generate embeddings within the embedding z-space210which output into a triplet loss regularization function440. The anchor sample “a” from the target domain has a known class due to the label that is provided. The triplet loss regularization may include distance regularization between one or more of the following triplet data sets (with “t” referring to the target domain and “s” referring to the source domain):(a) L(at, pt, nt): penalizes if samples atand ptare mapped far apart in z, while atand ntare mapped close (within the target domain);(b) L(at, pt, ns): penalizes if samples atand ptare mapped far apart in z, while atand nsare mapped close (across two domains);(c) L(at, ps, nt): penalizes if samples atand psare mapped far apart in z, while atand ntare mapped close (across two domains); and(d) L(at, ps, ns): penalizes if samples atand psare mapped far apart in z, while atand nsare mapped close (across two domains)where an L(a, p, n)=[dp−dn+m]+with dpbeing a function that measures the distance between (a, p), and dnbeing a function that measures the distance between (a, n) in the embedding space, and m being a positive margin factor. The “+” assures that the value is non-negative, e.g., so that whenever dp−dn+m<0 the value is set to “0” instead. With this feature the model assures that any loss L(a, p, n) that is trying to minimize will never be a negative value. Compared to the first three triplet set possibilities, the number of triplet samples used for L(at, ps, ns) is the largest of the four groups, because both p, n are sampled from the source domain. The sample pool430with this fourth group is refined and identified and then provided as the labelled source-side samples202for refining the encoders206,208and the classifier212.

The pool of potential samples from the source domain is not fixed as the embedding z-space210is gradually learnt and, of course, is not in a proper shape at early training phase/epochs (e.g., because noise and/or irrelevant features have not yet been filtered out from the samples). In addition, maintaining this pool of samples across domains reduces overhead computations as distances among the samples are frequently calculated.

Also occurring during the encoder training view400is further adversarial training with the training discriminator320. The training discriminator320seeks to predict the domain origin of a submitted sample, while the encoders206,208are adjusted to try to prevent the training discriminator320from correctly predicting the domain origin. Thus, the weights of the target-side encoder208are updated with the discriminator domain loss for target samples.

Thus, the target-side encoder208which will be part of the final machine learning model for implantation in the new domain is trained as part of the encoder training view400with triplet loss regularization, with classification loss, and with domain discriminator loss.

In step116of the machine learning model accelerated training process100shown inFIG.1, the source encoder is refined based on the domain discriminator loss and classification loss. The encoder training view400shown inFIG.4also illustrates aspects of step116via the training of the source-side encoder206. The classification loss that is determined with the classifier212is used to update the weights of the source-side encoder206. The domain discriminator training that was shown inFIG.3also is used as part of step116to update the weights of the source-side encoder206. Moreover, for those embodiments in which the source-side encoder206and the target-side encoder208share weights the source-side encoder206is updated with the aggregated loss for the target-side encoder208. Thus, the machine learning model accelerated training process100includes the updating of not only the target-side encoder208in preparation for implementation in the target domain, but also updating of the source-side encoder206to achieve more accurate discriminator domain loss calculation and classification loss calculation.

In step118of the machine learning model accelerated training process100shown inFIG.1, sample pool refining is attempted based on source sample relevancy.FIG.5shows with its sample pool refining graph500an example of aspects of performance of step118according to at least one embodiment.FIG.4above also with respect to the sample pool430illustrated aspects of the step118.

The sample pool refining graph500includes a first anchor sample502shown as a first graph point which, as described previously, represents a labelled target sample from the target domain. The sample pool refining graph500includes a first positive sample504shown as a second graph point which, as described previously, represents a labelled source sample which is from a same class as the anchor sample is from and which is from the source domain. Thus, the second arrow510shown inFIG.5represents a distance between the first anchor sample502and the first positive sample504. This distance may be indicated by the function dp(at, ps) meaning that the anchor sample is from the “t” target domain and the positive sample “p” is from the source domain. The sample pool refining graph500includes a third graph point506which represents a position equal to the positive sample point plus a positive margin factor “m”. Thus, the third arrow512shown inFIG.5represents the value of this positive margin factor “m”. In other words the length of the third arrow512is equal to the positive margin factor “m”. The sample pool refining graph500includes a fourth graph point508which represents a position equal to the positive sample point plus the positive margin factor “m” plus an additional value equal to the positive margin factor “m” multiplied by γ. γ here represents a non-negative coefficient that is smaller than one. Thus, the fourth arrow514shown inFIG.5represents the value of the positive margin factor “m” multiplied by γ. In other words the length of the fourth arrow514is equal to the positive margin factor “m” multiplied by γ.

The first arrow516shown in the sample pool refining graph500represents the value of the combination of the second arrow510, the third arrow512, and the fourth arrow514and may be represented by the formula dp(at, ps)+(1+γ)m where the values γ and m are those described above.

Not all samples in the source domain are relevant to compute the triplet distance loss towards optimizing the target-side encoder208and the source-side encoder206. Moreover, as the target-side encoder208and the source-side encoder206are repeatedly updated, the shape of the embeddings in the embedding z-space210also keeps changing. Consequently, distances in the triplet sample groups, namely between the anchor sample and the pairs (ps, ns) of positive and negative samples from the source domain, are improved by revision after each epoch. While the number of samples acting as atthe anchor sample is small, the number of samples acting for the combination of (ps, ns) are exceptionally large. Many from this large sample base (ps, ns) do not, however, satisfy the relevancy of [dp−dn+m]>0. The accelerated ML training program716maintains triplets (at, ps, ns) in the sample pool430if dn(at, ns)≤dp(at, ps)+(1+γ)m in other words if the distance between a particular negative sample of the triplet and the anchor sample is greater than or equal to the value of the first arrow516.

Step118in at least some embodiments includes the accelerated ML training program716calculating distances among these samples in every epoch. The samples that fall within the first range518are used to compute the triplet loss distance for the training of the target-side encoder208and the source-side encoder206in steps114and116, respectively. Samples that fall outside of this first range518are in at least some embodiments not used to compute this triplet loss distance for training, e.g., are not used for adjusting the weights of, the target-side encoder208and the source-side encoder206. The samples that fall within the second range520may be maintained and stored in the first sample pool430. The second range520is inclusive of the first range518. The samples that fall within the third range522may be discarded as being less relevant to the particular target domain that has been selected. Thus, by using the sample pool relevancy evaluation the sample pool is refined to provide an improved pool for generating a machine learning model to make more accurate predictions in the target domain. At an epoch, if a significant number of samples have changed from being within the first range518to being outside of the first range518then the shape of the embeddings in the embedding space have significantly changed and the accelerated ML training program716, in response, re-calculates distances for all of the triplet groups and re-update the sample pool430. The change in at least some embodiments is considered significant if the change amount exceeds or equals a pre-determined threshold, e.g., if thirty percent or more of the samples have changed from being within the first range518to moving outside of the first range518. An epoch may refer to one complete pass through the entire possible training dataset of labelled target and labelled domain samples.

In step120of the machine learning model accelerated training process100shown inFIG.1, a determination is made as to whether the model performance has converged. If the determination of step120is affirmative in that the model performance has converged, the machine learning model accelerated training process100proceeds to step122. If the determination of step120is negative in that the model performance has not converged, the machine learning model accelerated training process100proceeds to step112for a repeat of steps112,114,116,118, and120with respect to the refined pool sample. Thus, the steps112,114,116,118, and120may constitute a loop which is not exited until the model performance has converged, e.g., until the model convergence is sufficient, e.g., has passed a threshold convergence level.

Step120may in at least some embodiments be performed by applying a validation set of samples to the trained machine learning model. The performance may be numerically evaluated and compared to a pre-determined threshold. Exceeding the pre-determined threshold may indicate sufficient training and successful performance by the trained machine learning model. The performance achieved using the validation set may be logged by the accelerated ML training program716and tracked and compared to the performance of the machine learning model in earlier partially trained states. The error on that tracking data may decrease in the beginning and increase at a certain point during training. The checkpoint with the lowest error from the validation data should be selected for the prime training level. Thus, for step120if the performance has improved since the previous iteration, then the model performance is considered to have not yet converged so the training loop should continue. If the performance decreased since the last iteration, the most-recent weight adjustments may be discarded and the model (encoders and classifier) may be extracted in their state from the previous iteration.

In step122of the machine learning model accelerated training process100shown inFIG.1, the trained target encoder and the trained classifier are provided as the trained target machine learning model. The trained target machine learning model may be stored in the persistent storage713on the computer701shown inFIG.7or stored in a remote server704that is accessible by the computer701as shown inFIG.7.

FIG.6shows an inference phase600being performed with the trained target domain machine learning model650that includes the target-side encoder208trained in the machine learning model accelerated training process100and also includes the classifier212that was trained in the machine learning model accelerated training process100. The target-side encoder208may receive sample inputs from new unlabeled samples660from the target domain and may, in response thereto, generate an embedding in the embedding z-space210. The classifier212may take the generated embedding from the embedding z-space210and pass it through the layers of the classifier and generate a class prediction680as the output. In one example the trained target domain machine learning model650may be able to receive images of random objects from a desert environment, indicate when one of the objects is from a class of vehicles, and provide a prediction/output that a vehicle is identified and indicating to which vehicle class the particular object belongs.

After step122, the machine learning model accelerated training process100may end. The trained model may be used to perform a variety of machine learning tasks such as computer vision, natural language processing, and/or speech recognition.

The machine learning model accelerated training process100may also be subsequently performed to train a machine learning model for another domain which has few labelled samples for the domain. The same target samples or different target samples may be used for accelerating the process in this further iteration.

Training using the present embodiments was shown to provide improvements in class prediction for the trained model as compared to models trained by adjusting only the classifier. The present embodiments include explaining information among data samples within and between classes and domains for learning a domain independent space. The present embodiments include minimizing the difference between two domains in the embedding space not only relying on adversarial learning but also from optimizing the distance among samples of the same class and different class, within one domain and across different domains. The present embodiments include maintaining a pool of effective samples toward learning the domain encoders (generators), timely adapting to the change of the embedding space under training, and hence potentially converging faster and avoiding more computational overhead. In at least some embodiments the triplet groups are not constructed within one domain but across multiple domains.

The present embodiments exploit the combination of adversarial learning, supervised classification, and triplet loss regularization in a single system to use training achieved from labeled samples in a source domain to accelerate training for a target domain with few labeled samples. For example, labelled image samples from a zoo environment and including animal images may be used to train a machine learning model that is to perform class prediction to predict animal classes such as dog, wolf, or coyote in a forest environment. In other embodiments, labelled cartoon images of samples may be used as source samples to train a machine learning model for class prediction of images of a target domain of live animals within a particular environment. The present embodiments may include first training each network component individually and then aggregating and training them as a single model. Moreover, the triplet loss samples are not required to be fixed in advance but may be varied over the course of the system training as their relevancy is evaluated in the latent common space between the two domains, which might not be known a priori. The present embodiments are hence more advantageous in accelerating training time, convergence rate and its robustness.

The present embodiments may include the identification and exploitation of a dynamic set of relevant triplet samples across domains to accelerate the system training process. By exploiting relevant triplet samples within and across two domains, the present embodiments can effectively regularize the learning process of common latent space between the two domains from which samples from both domains are well classified into known class labels. At least some embodiments allow iterative refinement of relevant triplet samples adaptively based on the current state of the latent space under optimization. This refinement benefits the training process by reducing the training time and boosting convergence rate and stability. The present embodiments may also include using a single source domain instead of multiple source domains to obtain samples to accelerate the ML training for the target domain. The present embodiments may also include performing the described training techniques to train a machine learning model for implementation in a single target domain with a few labelled samples instead of in multiple target domains. The target domain may include a large number of unlabeled samples for which the eventually trained machine learning model may perform class prediction. A pool of triplet sample groups may be kept and repeatedly revised by adapting to the changes of the latent embedding subspace. This revision may constitute a progressive identification of relevant samples. This sample pool updating helps narrow down the learnt subspace more effectively, accelerate the training time, as well as improve the robustness of the trained system.

It may be appreciated thatFIGS.1-6provide only illustrations of certain embodiments and do not imply any limitations with regard to how different embodiments may be implemented. Many modifications to the depicted embodiment(s), e.g., to a sequence of steps or components that are depicted, may be made based on design and implementation requirements.

Computing environment700shown inFIG.7contains an example of an environment for the execution of at least some of the computer code involved in performing the inventive methods, such as accelerated ML training716. In addition to accelerated ML training716, computing environment700includes, for example, computer701, wide area network (WAN)702, end user device (EUD)703, remote server704, public cloud705, and private cloud706. In this embodiment, computer701includes processor set710(including processing circuitry720and cache721), communication fabric711, volatile memory712, persistent storage713(including operating system722and multilingual machine learning model pretraining716, as identified above), peripheral device set714(including user interface (UI) device set723, storage724, and Internet of Things (IoT) sensor set725), and network module715. Remote server704includes remote database730. Public cloud705includes gateway740, cloud orchestration module741, host physical machine set742, virtual machine set743, and container set744.

PROCESSOR SET710includes one, or more, computer processors of any type now known or to be developed in the future. Processing circuitry720may be distributed over multiple packages, for example, multiple, coordinated integrated circuit chips. Processing circuitry720may implement multiple processor threads and/or multiple processor cores. Cache721is memory that is located in the processor chip package(s) and is typically used for data or code that should be available for rapid access by the threads or cores running on processor set710. Cache memories are typically organized into multiple levels depending upon relative proximity to the processing circuitry. Alternatively, some, or all, of the cache for the processor set may be located “off chip.” In some computing environments, processor set710may be designed for working with qubits and performing quantum computing.

VOLATILE MEMORY712is any type of volatile memory now known or to be developed in the future. Examples include dynamic type random access memory (RAM) or static type RAM. Typically, volatile memory712is characterized by random access, but this is not required unless affirmatively indicated. In computer701, the volatile memory712is located in a single package and is internal to computer701, but, alternatively or additionally, the volatile memory may be distributed over multiple packages and/or located externally with respect to computer701.

PERIPHERAL DEVICE SET714includes the set of peripheral devices of computer701. Data communication connections between the peripheral devices and the other components of computer701may be implemented in various ways, such as Bluetooth connections, Near-Field Communication (NFC) connections, connections made by cables (such as universal serial bus (USB) type cables), insertion-type connections (for example, secure digital (SD) card), connections made through local area communication networks and even connections made through wide area networks such as the internet. In various embodiments, UI device set723may include components such as a display screen, speaker, microphone, wearable devices (such as goggles and smart watches), keyboard, mouse, printer, touchpad, game controllers, and haptic devices. Storage724is external storage, such as an external hard drive, or insertable storage, such as an SD card. Storage724may be persistent and/or volatile. In some embodiments, storage724may take the form of a quantum computing storage device for storing data in the form of qubits. In embodiments where computer701is required to have a large amount of storage (for example, where computer701locally stores and manages a large database) then this storage may be provided by peripheral storage devices designed for storing very large amounts of data, such as a storage area network (SAN) that is shared by multiple, geographically distributed computers. IoT sensor set725is made up of sensors that can be used in Internet of Things applications. For example, one sensor may be a thermometer and another sensor may be a motion detector.

END USER DEVICE (EUD)703is any computer system that is used and controlled by an end user (for example, a customer of an enterprise that operates computer701) and may take any of the forms discussed above in connection with computer701. EUD703typically receives helpful and useful data from the operations of computer701. For example, in a hypothetical case where computer701is designed to provide a natural language processing result to an end user, this result would typically be communicated from network module715of computer701through WAN702to EUD703. In this way, EUD703can display, or otherwise present, the result to an end user. In some embodiments, EUD703may be a client device, such as thin client, heavy client, mainframe computer, desktop computer and so on.

REMOTE SERVER704is any computer system that serves at least some data and/or functionality to computer701. Remote server704may be controlled and used by the same entity that operates computer701. Remote server704represents the machine(s) that collect and store helpful and useful data for use by other computers, such as computer701. For example, in a hypothetical case where computer701is designed and programmed to provide a recommendation based on historical data, then this historical data may be provided to computer701from remote database730of remote server704.

PRIVATE CLOUD706is similar to public cloud705, except that the computing resources are only available for use by a single enterprise. While private cloud706is depicted as being in communication with WAN702, in other embodiments a private cloud may be disconnected from the internet entirely and only accessible through a local/private network. A hybrid cloud is a composition of multiple clouds of different types (for example, private, community or public cloud types), often respectively implemented by different vendors. Each of the multiple clouds remains a separate and discrete entity, but the larger hybrid cloud architecture is bound together by standardized or proprietary technology that enables orchestration, management, and/or data/application portability between the multiple constituent clouds. In this embodiment, public cloud705and private cloud706are both part of a larger hybrid cloud.