Methods and systems for mining minority class data samples to train neural networks

By training and recalibrating a neural network and anomaly detector to identify and calibrate minority class data samples, the problem of low efficiency in minority class data sample mining in existing technologies is solved, the performance of neural networks in minority class prediction is improved and the cost is reduced.

CN116635866BActive Publication Date: 2026-04-21HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
Filing Date
2021-06-30
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing technologies struggle to efficiently extract minority class data samples from training datasets, resulting in poor performance of neural networks when generating minority class data sample predictions. This is particularly true in applications such as medical diagnosis, spam detection, and fraud detection, where existing methods are inefficient and costly.

Method used

Minority class data samples are automatically identified using a trained recalibrated neural network and anomaly detectors (such as autoencoders), and calibrated using a labeling service. Minority class scores are calculated using the reconstruction quality of the autoencoder, and candidate minority class data samples are identified by combining a threshold estimation algorithm.

Benefits of technology

It effectively improves the class distribution skew of the training dataset, enhances the predictive performance of neural networks on minority class data samples, reduces computational and economic costs, and is applicable to data sources of various data domains and dimensions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116635866B_ABST
    Figure CN116635866B_ABST
Patent Text Reader

Abstract

A method for mining minority class data samples, relating to the field of artificial intelligence, is described. A minority class mining service receives activations generated by the inner layers of a client neural network, which has been trained to perform prediction tasks involving classification. The minority class mining service generates recalibrated activations using a recalibrated neural network and generates anomaly detector outputs using an anomaly detector. Based on the anomaly detector output, a minority class score is calculated for the data samples represented by the received activations. The calculated minority class score is compared with a minority class threshold to identify candidate minority class data samples. These candidate minority class data samples can then be labeled and added to the training dataset of the client neural network. This method can effectively and efficiently mine minority class data samples from highly skewed data distributions.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to U.S. Patent Application Serial No. 17 / 119,989, filed December 11, 2020, entitled “METHODS AND SYSTEMS FOR MINING MINORITY-CLASS DATASAMPLES FOR TRAINING A NEURAL NETWORK”, which is incorporated herein by reference as if reproduced in its entirety. Technical Field

[0002] This invention relates to the field of artificial intelligence, and more particularly to a method and system for mining minority class data samples from data sources to identify minority class data samples to be added to a training dataset used to train a neural network. Background Technology

[0003] Neural networks are typically trained in a supervised manner (i.e., using supervised learning algorithms) to perform prediction tasks involving classification (e.g., object detection, semantic segmentation, image classification, etc.). The neural network is trained using a training dataset that includes labeled data samples, where each label corresponds to at least one class in a set of classes. The trained neural network can then be deployed and used during the inference phase to generate predictions (e.g., predict the class) for unlabeled data samples. The performance of a trained neural network in generating predictions for unlabeled data samples typically depends on the quality of the labeled data samples in the training dataset. However, in many real-world applications (e.g., medical diagnostics), the class distribution of the labeled data samples in the training dataset (i.e., the distribution of labeled data samples representing different class labels) can be skewed, for example, a long-tailed class distribution may exist. The result of training a neural network with a training dataset that has a skewed class distribution of labeled data samples is that the trained neural network does not perform optimally when generating predictions for data samples belonging to a minority class (i.e., a statistically rare class with a very limited number of data samples that appears at the long tail end of the class distribution of labeled data samples in the training dataset). The ability of trained neural networks to generate accurate predictions for unlabeled data samples in minority classes is often important in many applications such as medical diagnosis, spam detection, and fraud detection.

[0004] One approach to this problem is to balance the class distribution of labeled data samples in the training dataset by mining data samples belonging to unrepresented classes (also known as minority classes or tail classes) from the unlabeled data stream of examples, obtaining labels for the mined unlabeled data samples (e.g., using human annotators), and augmenting the training dataset with the newly mined and labeled data samples. Since the class distribution of data samples in the unlabeled data stream is also similarly skewed, any pool of data samples mined for labeling using naive methods (such as random sampling) is similarly skewed, resulting in some data samples belonging to the minority class. Therefore, a significant amount of money and effort is wasted on labeling the majority class data samples, which is not what is needed to improve the performance of trained neural networks in generating predictions on unlabeled data samples. Similarly, many common computer-based methods for automatically mining data samples from unlabeled data streams, such as those based on leveraging the uncertainties (e.g., maximum scores and entropy) of trained neural networks, have proven quite inefficient in mining minority class data samples. In fact, for data with highly skewed class distributions, these methods have shown performance worse than random sampling.

[0005] Therefore, it would be useful to provide a more efficient method and system for computer-based minority class data sample mining. Summary of the Invention

[0006] In various examples, this invention describes methods and systems for mining minority class data samples from data lacking minority class labels (e.g., unlabeled data) to identify candidate minority class data samples. The disclosed methods and systems use neural networks to automatically identify minority class data samples from data lacking minority class labels. The identified minority class data samples can be labeled (e.g., using human annotators) and added to a training dataset to correct for skewness in the class distribution of labeled data samples in the training dataset.

[0007] The disclosed methods and systems can be implemented as Software as a Service (e.g., software provided as a service by a cloud computing platform or web server), accessible to multiple different clients, each with one (or more) client-side neural networks trained to perform prediction tasks involving classification. Each client can retain ownership and data privacy of its own training dataset and / or client-side neural networks.

[0008] The disclosed methods and systems utilize a trained recalibrated neural network (e.g., a single-layer recalibrated neural network) and a trained anomaly detector (e.g., an autoencoder). The anomaly detector identifies activation patterns corresponding to majority class data samples and marks anomalous minority class data samples as anomalies. The recalibrated neural network recalibrates distorted activations in the client neural network (due to any potential overfitting) and makes these distorted activations more suitable for modeling by anomaly detection. Using a trained anomaly detector can be considered a method that is more tailored to the specific training dataset of the client neural network, rather than using hard-coded metrics (e.g., entropy or maximum score).

[0009] Compared to existing computer-based methods and systems, the disclosed methods and systems can mine minority class data samples from highly skewed data distributions more effectively and efficiently. The disclosed methods and systems are also likely to be less computationally and economically costly than existing methods for mining minority class data samples. Furthermore, unlike existing methods for mining minority class data samples, the disclosed methods and systems are expected to be effective regardless of the domain, size, or dimensionality of the data in the data source to be mined (i.e., data sources lacking minority class labels, such as unlabeled data pools or data streams). The technical effect of the disclosed methods and systems is that skewed training datasets can be improved using computer-based minority class data sample mining, resulting in neural networks trained with new training datasets (including training datasets with additionally labeled minority class data samples) being able to generate better predictions for unlabeled data samples from the minority class during the inference phase.

[0010] In some exemplary aspects, the present invention describes a method for identifying candidate minority class data samples. The method includes: receiving activations comprising values ​​representing inner-layer activations of a given data sample, the received activations being generated by a client neural network trained to perform a prediction task involving classification; forward propagating the received activations through a trained recalibrated neural network to generate recalibrated activations, wherein the trained recalibrated neural network has been trained to perform the prediction task involving classification in a manner that avoids overtraining; forward propagating the recalibrated activations through a trained anomaly detector, wherein the trained anomaly detector has been trained on activations that form a majority of the majority class data samples; calculating a minority class score for the received activations based on the anomaly detector output; identifying the given data sample as a candidate minority class data sample based on a comparison of the minority class score with a minority class threshold; and transmitting the identifier of the given data sample as the candidate minority class data sample.

[0011] In any of the exemplary aspects described above, there may be multiple received activations representing the given data sample, and for each corresponding received activation among the multiple received activations, the method may include: forward propagating the corresponding received activation through the trained recalibrated neural network to generate a corresponding recalibrated activation; forward propagating the corresponding recalibrated activation through the trained anomaly detector to generate a corresponding anomaly detector output; and calculating a corresponding minority class score for the corresponding received activation based on the corresponding anomaly detector output. The method may further include: filtering and aggregating the corresponding minority class scores calculated for the multiple received activations to obtain a single minority class score to be used in a comparison with the minority class threshold.

[0012] In any of the above exemplary aspects, the trained anomaly detector may be an autoencoder that has been trained to output reconstructed activations as the output of the anomaly detector, and the corresponding minority class score may be calculated based on the quality of the corresponding reconstructed activations.

[0013] In any of the above exemplary aspects, the received activation can be received from the client computing system, and the minority class threshold can be received from the client computing system.

[0014] In any of the above exemplary aspects, the identifier of the given data sample as the candidate minority class data sample can be transmitted to the client computing system.

[0015] In any of the above exemplary aspects, the identifier of the given data sample as the candidate minority class data sample can be transmitted to the tagging service.

[0016] In any of the above exemplary aspects, the trained anomaly detector may be a trained autoencoder that has been trained to perform a reconstruction task, the anomaly detector output may be a reconstructed activation, and calculating the minority class score may include: calculating the mean squared error between the received activation and the reconstructed activation, wherein the calculated mean squared error may be used as the minority class score.

[0017] In any of the above exemplary aspects, the softmax function may be applied to the received activation and the reconstructed activation before the mean squared error is calculated.

[0018] In any of the exemplary aspects described above, the method may include: training the recalibrated neural network and the anomaly detector, wherein the anomaly detector is an autoencoder, by receiving an inner activation set generated by the client neural network and a corresponding set of class labels, each class label being associated with a corresponding inner activation. Training the recalibrated neural network using a subset of training activations from the inner activation set may include: for each training activation, forward propagating the training activation through the recalibrated neural network to generate a predicted class label; calculating a focus loss using the predicted class label, the corresponding class label associated with the training activation, and a focus loss function; and updating the weights of the recalibrated neural network by backpropagating the calculated focus loss. Training the autoencoder using a recalibrated set of training activations generated by the recalibrated neural network from the subset of training activations may include: for each recalibrated training activation, forward propagating the recalibrated training activation through the autoencoder to generate a reconstructed training activation; calculating a reconstruction loss using the reconstructed training activation, the recalibrated training activation, and a reconstruction loss function; and updating the weights of the autoencoder by backpropagating the calculated reconstruction loss.

[0019] In any of the above exemplary aspects, the number of rounds required to train the recalibration neural network can be reduced compared to training the client neural network.

[0020] In any of the exemplary aspects described above, the method may include calculating the minority class threshold by: forward propagating a subset of validation activations from the inner activation set through the trained recalibrated neural network and the trained autoencoder to obtain a reconstructed validation activation set; calculating a set of minority class scores based on the reconstruction quality of the reconstructed validation activation set; pairing each minority class score with a corresponding class label; and identifying the value of the minority class threshold from the pairings, the minority class threshold representing the boundary between the minority class score of a minority class data sample and the minority class score of a majority class data sample.

[0021] In any of the above exemplary aspects, the calculated minority class threshold can be transmitted to the client computing system.

[0022] In some exemplary aspects, the present invention describes an apparatus comprising a processor for executing instructions to cause the apparatus to perform any of the methods described above.

[0023] In any of the above exemplary aspects, the computing system may be one of the following: a server; a server cluster; or a cloud computing platform.

[0024] In some exemplary aspects, the present invention describes a computer-readable medium storing instructions that, when executed by a processing device of a computing system, cause the computing device to perform any of the methods described above.

[0025] In some exemplary aspects, the present invention describes a computer program having instructions that, when executed by a processing device of a computing system, cause the computing system to perform any of the methods described above. Attached Figure Description

[0026] The accompanying drawings, which illustrate exemplary embodiments of this application, will now be shown by way of example, in which:

[0027] Figure 1 This is a block diagram of an exemplary system provided by an example of the present invention, the exemplary system including a client and a minority class mining service;

[0028] Figure 2 This is a block diagram of an exemplary computing system applicable to implementing examples of the present invention;

[0029] Figure 3 This is a flowchart of an exemplary method for the training phase of a minority class mining service provided by an example of the present invention;

[0030] Figure 4 This is a flowchart of an exemplary method for the inference phase of a minority class mining service provided by an example of the present invention.

[0031] The same reference numerals can be used to denote the same components in different accompanying drawings. Detailed Implementation

[0032] The technical solution of the present invention will be described below with reference to the accompanying drawings.

[0033] The methods and systems described in this paper can be applied to any scenario where data mining is used to augment training datasets. Specifically, the methods and systems described in this paper can be applied to any scenario where the training dataset has a skewed class distribution (i.e., at least one class, called the minority class, is underrepresented in the training dataset). In the disclosed methods and systems, a minority class data mining service is provided, which is implemented using a trained recalibrated neural network (e.g., a single-layer recalibrated neural network), a trained anomaly detector (e.g., an autoencoder), and a threshold estimation algorithm. The minority class data mining service can be accessed by a client that possesses a trained neural network (i.e., a neural network trained using a supervised learning algorithm and a training dataset) that has been trained to perform prediction tasks involving classification; this is referred to herein as the client neural network. The recalibrated neural network and the anomaly detector are neural networks trained using activations from the inner layers (e.g., the penultimate layer activations) of the client neural network. Minority data mining services use learned thresholds to identify minority data samples from data lacking minority class labels (e.g., unlabeled data, or labeled data that was not considered in previous labeling, or data that may have been mislabeled, etc.). These minority data samples can be labeled and used to augment the training dataset to improve the performance of client-side neural networks.

[0034] To aid in understanding this invention, some existing methods and systems for finding minority class data samples are first discussed. In the following discussion, consider a neural network trained in a supervised manner on a training dataset. Data samples in the training dataset (e.g., 2D images) are labeled data samples (e.g., each 2D image is associated with at least one ground truth category label). Class imbalance may exist in the training dataset, such that there exists a set of one or more underrepresented classes (referred to herein as the minority class). Underrepresentation means that labeled data samples with minority class labels in the training dataset are statistically rare. Labeled data samples in the training dataset may be referred to as having an imbalanced class distribution or a skewed class distribution. Data samples representing the minority class may be referred to as hard data samples (or hard examples) because it is more difficult for neural networks to learn latent features from these data samples (due to their statistical rarity). Neural networks trained on skewed training datasets (i.e., training datasets containing labeled data samples with skewed class distributions) tend to perform well in generating predictions for data samples belonging to the majority class but poorly in generating predictions for data samples belonging to the minority class. This type of neural network can be called biased.

[0035] Typical existing methods for correcting biased neural networks involve first identifying data samples representing the minority class (e.g., mining minority class data samples from unlabeled data pools (e.g., unlabeled images available online) and / or unlabeled data streams (e.g., real images collected by end users)). In an example of an object detection task, data samples representing the minority class could be 2D images that include minority class objects (and other possible objects that may not belong to the minority class). Data mining algorithms can be used to identify minority class data samples. Identifying minority class data samples from a dataset (or data stream) can be called minority class data mining. Next, the identified minority class data samples are labeled by a human annotator. Then, the labeled minority class data samples are added to the training dataset to balance the class distribution of the labeled data samples in the training dataset. The neural network is then retrained using the balanced training dataset. There are different existing algorithms for identifying minority class data samples from data sources (e.g., unlabeled data pools or data streams).

[0036] An example of an existing algorithm is uncertainty sampling. Uncertainty sampling is based on labeled data samples (e.g., an unlabeled pool or stream of data) where a trained neural network has low determinism in generating predictions. Two common metrics used to measure uncertainty are called MaxScore and entropy. When using the MaxScore metric, the maximum softmax probability (called MaxScore) of all candidate classes is calculated for a given unlabeled data sample. If the MaxScore of a given unlabeled data sample is below a threshold, that given unlabeled data sample is identified as a possible minority class data sample. Entropy is a measure of uncertainty or indecisiveness in the softmax probability. When entropy is used as a metric to identify minority class data samples, any unlabeled data sample with an entropy higher than a threshold is identified as a possible minority class data sample. The threshold used to compare the MaxScore metric or the entropy metric can be a pre-computed threshold (e.g., calculated using a validation dataset).

[0037] Uncertainty sampling algorithms perform poorly when the class distribution of unlabeled data samples in a dataset is skewed. Only a small fraction of the unlabeled data samples identified as possible minority class samples are actually ground truth minority class samples. This results in wasted time and money, and wasted computational resources (e.g., wasted computation time and wasted memory resources to store possible minority class samples that are not actually minority class samples). The poor performance of uncertainty sampling algorithms can be attributed to two reasons. First, due to class imbalance in the dataset, minority class probabilities are suppressed, leading to distortion of the corresponding uncertainty measure. This effect can be exacerbated in deep neural networks, where the final softmax layer is prone to overfitting. Second, uncertainty measures (such as MaxScore and entropy measures) aggregate the entire probability distribution of class probabilities into a single scalar value, resulting in the loss of information about patterns and relationships between probability distributions of different classes.

[0038] Another existing method for finding minority class data samples is called guided learning. Instead of mining existing datasets of minority class data, guided learning uses humans (e.g., through crowdsourcing) to generate (e.g., create from scratch or search online) new minority class data samples. The new minority class data samples are labeled by humans, and these labeled samples are added to the existing training dataset used to train the neural network. One drawback of guided learning is that it can be slow and costly. The diversity of human-generated data samples can also be problematic because the generated samples may not match the domains of existing data samples in the training dataset (e.g., human-generated samples may not have the same quality as the training dataset (e.g., image brightness or background)). Furthermore, some domains, such as medical diagnostic data samples (e.g., medical scan images), are not suitable for human search (e.g., due to privacy concerns).

[0039] Another approach for mining minority class data samples is called a hybrid approach. In a hybrid approach, uncertainty sampling is enhanced by several exploratory techniques to obtain data samples from less explored regions in the feature space. Exemplary techniques for this exploration include Gaussian exploration and distance-based neighborhood estimation. An exploration score is assigned to each unlabeled data sample, quantifying how representative the unlabeled data sample is (relative to existing labeled data) or the probability that the unlabeled data sample belongs to a particular class. Unlabeled data samples with lower exploration scores (meaning they are less representative of the existing data) are preferred over those with higher exploration scores. Hybrid approaches randomly switch between uncertainty sampling and exploration-based sampling to identify potential minority class data samples.

[0040] One drawback of hybrid methods is their poor performance in high-dimensional domains and when data samples lie on complex manifolds (e.g., not in convex feature subspaces). This limits the usefulness of hybrid methods for complex data domains. Hybrid methods also require computing an exploration score for each unlabeled data sample, which is computationally expensive. Typically, each unlabeled data sample needs to go through all labeled data samples. Furthermore, many labeled possible minority class data samples are actually majority class data samples, especially in complex data domains. The result is a waste of time, money, and computational resources.

[0041] In various examples, the present invention describes methods and systems for mining minority class data samples from data sources (e.g., unlabeled data pools or data streams) using a computer. The examples described herein address some of the aforementioned drawbacks of existing methods and systems. Specifically, the disclosed methods and systems can address at least some of the ways in which uncertain sampling cannot mine minority class data samples (i.e., minority class examples), such as the suppression of minority class activation due to class imbalance and the information loss problem caused by using a single scalar hard-coded metric to estimate the probability that a data sample belongs to one of the minority classes.

[0042] The disclosed methods and systems utilize recalibrated neural networks, which can help strengthen the repressive activations of the minority class by recalibrating the activations. The disclosed methods and systems also use anomaly detectors to model the overall activation distribution, which may help capture patterns and relationships between activations across different classes. It should be understood that although the present invention describes an example with a single-layer recalibrated neural network and an autoencoder, the functionality of the single-layer recalibrated neural network can be performed using any suitable recalibrated neural network, and the functionality of the autoencoder can be performed using any suitable anomaly detector (e.g., a support vector machine (SVM), or any suitable generative model, such as a generative adversarial network (GAN) or variational autoencoder (VAE), etc.).

[0043] This invention describes the use of a recalibration neural network (e.g., a single-layer recalibration neural network) trained to prevent overfitting and recalibrate distorted activations in a client neural network. Typically, the recalibration neural network can be any suitable neural network that can match a portion of the client neural network to be recalibrated. In the example described below, the penultimate layer activation from the client neural network is recalibrated by a single-layer recalibration neural network (wherein the single-layer recalibration neural network is trained to perform the same function as the last layer of the client neural network). In other examples, any inner layer activation (e.g., penultimate or penultimate layer activation) can be recalibrated by training a corresponding recalibration neural network. For example, if the second layer activation of the client neural network is to be recalibrated, the recalibration neural network should be designed and trained to perform the same function as the last two layers of the client neural network. It should be noted that the recalibration neural network does not necessarily have the same size and structure as one or more layers of the client neural network being recalibrated (e.g., a two-layer recalibration neural network can be used to recalibrate the last three layers of the client neural network), as long as the recalibration neural network can be trained to perform the same function as one or more corresponding layers of the client neural network and is designed to solve the overfitting problem.

[0044] This invention also describes the use of anomaly detectors (e.g., autoencoders) to identify anomalous data samples as minority class data samples. This invention describes the use of autoencoders as a reconstruction-based unsupervised anomaly detector. However, many possible anomaly detectors can be used without loss of generality. For example, other reconstruction-based anomaly detectors may include principal component analysis (PCA) or sparse PCA anomaly detectors. Another type of anomaly detection is density estimation-based anomaly detection, examples of which include Gaussian mixture models, as well as many other models. Generative modeling (e.g., using GANs or VAEs) is another approach to anomaly detection. Other examples include discriminative methods, such as a class of SVMs. Therefore, this invention is not limited to using autoencoders to generate minority class scores for predicting candidate minority class data samples.

[0045] Typically, the examples disclosed in this article involve various neural networks. For ease of understanding, some concepts related to neural networks and some related terms that may be relevant to the examples disclosed in this article are described below.

[0046] A neural network is composed of neurons. A neuron is a computational unit that uses x... s The intercept of 1 is used as input. The output of the computation unit can be:

[0047]

[0048] Where s = 1, 2, ..., n, n is a natural number greater than 1, W s It is x s The weights are denoted by b, the neuron's offset (i.e., bias), and f is the neuron's activation function, used to introduce non-linear features into the neural network to transform the neuron's input into its output. The output of the activation function can be used as the input to neurons in the next layer of the neural network. For example, the activation function could be the sigmoid function. A neural network is formed by connecting multiple of these individual neurons. In other words, the output of one neuron can be the input of another neuron. The input of each neuron can be associated with a local receptive region of the previous layer to extract features from that local receptive region. A local receptive region can be a region consisting of several neurons.

[0049] A deep neural network (DNN), also known as a multilayer neural network, can be understood as a neural network consisting of a first layer (usually called the input layer), multiple hidden layers, and a final layer (usually called the output layer). The term "multiple" here has no specific metric. A layer is considered fully connected when there is a full connection between two adjacent layers of the neural network. Specifically, for two adjacent layers to be fully connected (e.g., layer i and layer (i+1)), each neuron in layer i must be connected to every neuron in layer (i+1).

[0050] The processing at each layer of a DNN can be relatively simple. In short, the operations at each layer are represented by the following linear relationship: in, For the input vector, For the output vector, Let W be the offset vector, W be the weights (also called coefficients), and α(.) be the activation function. In each layer, for the input vector... Perform the operation to obtain the output vector. The process of processing data through each layer of a DNN to generate a prediction output can be called forward propagation.

[0051] Because DNNs have a large number of layers, they also have a large number of weights W and offset vectors. The parameters in a DNN are defined as follows, where the weights W are used as an example. In this example, in a three-layer DNN (i.e., a DNN with three hidden layers), the linear weights from the fourth neuron in the second layer to the second neuron in the third layer are expressed as follows: The superscript 3 indicates the layer with weight W (i.e., the third layer in this example), and the subscript indicates that the output is at index 2 of the third layer (i.e., the second neuron in the third layer), and the input is at index 4 of the second layer (i.e., the fourth neuron in the second layer). Typically, the weights from the k-th neuron in the (L–1)-th layer to the j-th neuron in the L-th layer can be represented as... It should be noted that the input layer does not have a W parameter.

[0052] In deep neural networks (DNNs), more hidden layers allow the DNN to better model complex situations (e.g., real-world scenarios). Theoretically, DNNs with more parameters are more complex, have greater capacity (which likely refers to the learning model's ability to adapt to various possible scenarios), and demonstrate that DNNs can perform more complex learning tasks. Training a DNN is the process of learning its weight matrix. The goal of training is to obtain a trained weight matrix, which consists of the learned weights W from all layers of the DNN.

[0053] A convolutional neural network (CNN) is a DNN with a convolutional structure. A CNN consists of a feature extractor composed of convolutional layers and subsampling layers. The feature extractor can be viewed as a filter. The convolution process can be viewed as performing convolution on a two-dimensional (2D) input image or convolutional feature map using a trainable filter.

[0054] A convolutional layer is a layer of neurons in a CNN that performs convolutional processing on the input. In a convolutional layer, a neuron may be connected to only a subset of neurons in adjacent layers (i.e., not all neurons). That is, convolutional layers are typically not fully connected layers. A convolutional layer usually consists of several feature maps, each composed of neurons arranged in a rectangle. Neurons on the same feature map share weights. These shared weights are collectively called the convolutional kernel. Typically, the convolutional kernel is a 2D weight matrix. It should be understood that the convolutional kernel can be independent of the way and location of image information extraction. A principle underlying convolutional layers is that the statistical information of one part of an image is the same as the statistical information of another part. This means that image information learned from one part of an image can also be applied to another part. Multiple convolutional kernels can be used in the same convolutional layer to extract different image information. Generally, the more convolutional kernels there are, the richer the image information reflected by the convolutional operation.

[0055] Convolutional kernels can be initialized as 2D matrices with random values. The weights of the convolutional kernels are learned during the training of the CNN. One advantage of using convolutional kernels to share weights among neurons in the same feature map is that the connections between convolutional layers in a CNN are reduced (compared to fully connected layers), thus lowering the risk of overfitting.

[0056] During DNN training, the predicted values ​​output by the DNN can be compared with the desired target values ​​(e.g., the ground truth). The weight vector of each layer of the DNN (a vector containing the weights W of a given layer) is updated based on the difference between the predicted and desired target values. For example, if the predicted values ​​output by the DNN are too high, the weight vectors of each layer can be adjusted to lower the predicted values. This comparison and adjustment can be performed iteratively until a convergence condition is met (e.g., a predefined maximum number of iterations has been performed, or the predicted values ​​output by the DNN have sufficiently converged with the desired target values). A loss function or objective function is defined as a way to quantitatively represent how close the predicted values ​​are to the target values. The objective function represents the quantity to be optimized (e.g., minimized or maximized) so that the predicted values ​​are as close as possible to the target values. The loss function more specifically represents the difference between the predicted and target values, and the goal of training the DNN is to minimize the loss function.

[0057] Backpropagation is an algorithm used to train deep learning neural networks (DNNs). Backpropagation is used to adjust (also called update) the values ​​of parameters (such as weights) in the DNN so that the error (or loss) in the output becomes smaller. For example, forward propagation from the input to the output of the DNN computes a defined loss function. Backpropagation computes the gradient of the loss function with respect to the parameters of the DNN and updates the parameters using a gradient algorithm (e.g., gradient descent) to reduce the loss function. Backpropagation is performed iteratively, causing the loss function to converge or be minimized.

[0058] See Figure 1 An exemplary system 10 implementing an example of the present invention is shown. The following description should not be construed as limiting any example of the invention. System 10 includes a client computing system 20 (also simply referred to as client 20) and a minority class mining service 100. Figure 1 In the diagram, solid arrows represent the data flow during the training phase of the minority class mining service 100, while dashed arrows represent the data flow during the inference phase of the minority class mining service 100.

[0059] Client 20 can be any computing system (or group of computing systems) capable of training client neural network 22 to perform a prediction task involving classification. For example, client 20 can be a workstation, desktop computing system, server, server cluster, centralized data center, institutional data center, computing cluster, etc. In the context of this invention, the prediction task involving classification can be any prediction task involving predicting the class labels of data samples (e.g., image classification, object detection, or image segmentation, etc.). Client neural network 22 can be any neural network architecture including a classifier. Client 20 has or has access to a labeled training dataset 24 for training client neural network 22 in a supervised manner (i.e., using a supervised learning algorithm).

[0060] Training dataset 24 may be stored in the client 20's memory (e.g., random access memory (RAM), read-only memory (ROM), etc.) or mass storage device (e.g., solid-state drive, hard disk drive, etc.). Although shown as part of client 20, training dataset 24 may be stored in a database (not shown) outside of client 20. Training dataset 24 includes labeled data samples, each labeled data sample being assigned one or more class labels (from a plurality of possible class labels). The class labels are considered as ground truth labels used to train client neural network 22 using training dataset 24. Training dataset 24 may include any data format suitable for training client neural network 22. For example, labeled data samples in training dataset 24 may be labeled 2D images.

[0061] The minority class mining service 100 can be implemented in any computer system (or group of computer systems) capable of training and deploying neural networks. For example, the minority class mining service 100 can be implemented as software provided as a service by servers, server clusters, distributed computing systems, cloud computing platforms, etc.

[0062] The minority class mining service 100 implements a recalibration neural network 102 (e.g., implemented using a first neural network, including a single neural network layer), an anomaly detector 104 (e.g., an autoencoder implemented using a second neural network, including an encoder subnet and a decoder subnet), a threshold estimation algorithm 106, and a candidate prediction algorithm 110. As will be further discussed below, one or more processing devices of the minority class mining service 100 can execute software instructions to perform operations of the recalibration neural network 102, the anomaly detector 104, the threshold estimation algorithm 106, and the candidate prediction algorithm 110, as well as other operations. It should be understood that although a single-layer recalibration neural network is discussed below, any suitable recalibration neural network (e.g., a multi-layer recalibration neural network) can be trained (as discussed further below) to perform the operations of the recalibration neural network 102. Similarly, any suitable anomaly detector (e.g., a single-class SVM, or any suitable generative model, such as a GAN or VAE, etc.) can be trained (as discussed further below) and used to detect minority class data samples as anomalous.

[0063] Minority class mining service 100 performs operations to identify one or more candidate minority class data samples from data sources (e.g., unlabeled data pools or data streams) sent to labeling service 30. As will be discussed further below, minority class mining service 100 performs operations during the training phase to train recalibrated neural network 102 (i.e., learn its weights), to train anomaly detector 104, and to output a predicted minority class threshold 108 from threshold estimation algorithm 106. Minority class mining service 100 also performs operations during the inference phase (also known as deployment) to predict whether a given data sample is a candidate minority class data sample using the trained recalibrated neural network 102, the trained anomaly detector 104, and candidate prediction algorithm 110. A given data sample can be a data sample from an unlabeled data pool (i.e., a data pool that includes unlabeled data samples), a data sample from a labeled dataset where the data sample is not labeled as any minority class (i.e., the data sample is labeled, but one or more minority classes are not included in the possible labels), or a data sample from an unlabeled data stream (e.g., data samples collected in real time during the inference phase), and so on.

[0064] The labeling service 30 (which may use human labelers and / or computer algorithms) generates class labels for candidate minority class data samples. The labeled data samples are sent back to client 20 to be included in training dataset 24. In some examples, only labeled minority class data samples are added to training dataset 24. Any candidate minority class data sample that is not actually a minority class data sample (i.e., not labeled with any minority class label) is not added to the training dataset.

[0065] Minority class mining service 100 performs a learning process to enable it to predict candidate minority class data samples (based on the predicted probability that a given data sample belongs to the minority class). As will be discussed further below, an anomaly detector 104 may be an autoencoder trained on majority class activations that are predominantly present. The probability that a given data sample is a candidate minority class data sample is then estimated based on the quality of the reconstruction produced by the autoencoder. It is anticipated that minority class activation patterns cannot be accurately reconstructed by an autoencoder trained on labeled data samples that primarily represent the majority class. Typically, since anomaly detector 104 is trained using a training dataset that includes labeled data samples with skewed class distributions, anomaly detector 104 learns a latent representation of the activation patterns of majority class data samples. During inference, the activation patterns of minority class data samples act as anomalies and can be detected as candidate minority class data samples. Therefore, minority class mining service 100 is able to mine candidate minority class data samples from data sources lacking data samples with minority class labels (e.g., unlabeled data pools or data streams).

[0066] Communication between client 20, minority class mining service 100, and tagging service 30 can be via a wired communication link (e.g., Ethernet connection) and / or a wireless communication link (e.g., via a wireless network (not shown), such as the Internet). Although in Figure 1 Although not shown in the diagram, communication between client 20, minority class mining service 100, and tagging service 30 can be managed by the corresponding software agent (hereinafter referred to as "agent") in each of client 20, minority class mining service 100, and tagging service 30. The agent in each of client 20, minority class mining service 100, and tagging service 30 can be responsible for providing the communication interface and managing data communication (e.g., communication from client 20 to inner activation and tagging of minority class mining service 100).

[0067] Although a single instance of client 20 is shown, it should be understood that multiple clients 20, each with a corresponding client neural network 22 (and optionally a corresponding training dataset 24), can communicate with the minority class mining service 100 and use the services provided by the minority class mining service 100. Furthermore, a single client 20 may have multiple client neural networks 22 performing corresponding multiple prediction tasks involving classification. The minority class mining service 100 may maintain multiple instances of recalibrated neural network 102 and anomaly detector 104 to serve the corresponding multiple client neural networks 22 (each instance of recalibrated neural network 102 and anomaly detector 104 is customized for the corresponding client neural network 22). The threshold estimation algorithm 106 may be the same regardless of the client neural network 22 being served, or it may be customized for each corresponding client neural network 22.

[0068] It should be noted that, Figure 1 This is merely a schematic diagram of an exemplary system 10 provided as an example of the present invention. Figure 1 The relationships and interactions shown are not intended to limit the invention.

[0069] Figure 2 An exemplary implementation of the minority class mining service 100 in a single computing system 200 (e.g., a single server) is shown, but this is not intended to be limiting. While an exemplary computing system 200 is shown and discussed below, other embodiments can be used to implement the examples disclosed herein, which may include components different from those shown. Figure 2 A single instance of each component is shown, but multiple instances of each component shown may exist.

[0070] The computing system 200 includes one or more processing devices 202, such as a processor, microprocessor, application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), dedicated logic circuit, dedicated artificial intelligence processing unit, or a combination thereof. The computing system 200 also includes one or more optional input / output (I / O) interfaces 204, which are connected to one or more optional input devices 212 (e.g., keyboard, microphone, mouse, touchscreen, etc.) and one or more optional output devices 214 (e.g., display, speaker, etc.). The one or more optional input devices 212 and the one or more optional output devices 214 may each be external to the computing system 200, such as... Figure 2 As shown in the figure. In other examples, one or more optional input devices 212 and / or one or more optional output devices 214 may each be integrated with the computing system 200.

[0071] The computing system 200 includes one or more communication interfaces 206 for wired or wireless communication with external systems or networks (e.g., intranet, internet, P2P network, WAN, and / or LAN). The one or more communication interfaces 206 can support communication using wired links (e.g., Ethernet, using one or more cables) and / or wireless links (e.g., Wi-Fi, Bluetooth, using one or more antennas) for intra-network and / or inter-network communication. The one or more communication interfaces 206 enable the computing system 200 to communicate with external systems, such as one or more clients 20, a tagging service 30, and / or one or more databases storing training datasets.

[0072] The computing system 200 includes one or more memories 208, which may include volatile or non-volatile memories (e.g., flash memory, random access memory (RAM), and / or read-only memory (ROM)). One or more non-transitory memories 208 may store executable instructions for execution by one or more processing devices 202, such as to perform the examples described in this invention. For example, one or more memories 208 may include instructions for performing operations of the minority class mining service 100. Memory 208 may include other instructions, such as instructions for implementing an operating system and other applications / functions. One or more memories 208 may also include data 210, such as activation values, tags, and thresholds received from client 20.

[0073] In some examples, the computing system 200 may also include one or more electronic storage units (not shown), such as solid-state drives, hard disk drives, disk drives, and / or optical disk drives. In some examples, one or more datasets and / or modules may be provided by external memory (e.g., external drives or cloud storage in wired or wireless communication with the computing system 200), or may be provided by transient or non-transient computer-readable media. Examples of non-transient computer-readable media include RAM, ROM, erasable programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, CD-ROM, or other portable storage.

[0074] Now refer to it again Figure 1 Some notation is introduced to aid in understanding the invention. The client neural network 22 has been trained using a supervised learning algorithm, training dataset 24, and loss function (e.g., using any suitable training procedure). Specifically, the client neural network 22 may have been trained in a supervised manner to perform a prediction task involving classification. The trained client neural network 22 can be referred to as a learned neural model, and in... Figure 1 Let M be the learning model. The training dataset 24 can be represented as a finite labeled dataset D. L , including labeled data sample X L and the label Y L Each data sample (represented as x) L , ) Use one or more labels (represented as y) L , The training dataset 24 includes (x) tags. L y L Yes, where x L It is a data sample, y L (These are one or more labels assigned to a data sample). Label Y L The indicator is represented as multiple possible classes C. The training dataset 24 may have class imbalance, such that in data sample X... L The existence of C is represented as C. M A set of one or more minority classes. Client 20 is able to extract a representation of A from client neural network 22. L Inner layer activation. For example, inner layer activation A. LIt can be the penultimate layer activation, which is the output value of the penultimate layer (e.g., the softmax layer) before the final output layer of the neural network 22.

[0075] As mentioned above, the operation of the minority class mining service 100 includes a training phase and an inference phase. The details of the training phase will be discussed first. Figure 1 The solid arrows in the diagram illustrate an example of data flow during the training phase.

[0076] The training phase begins with client 20 activating inner layer A. L and the corresponding label Y L The data is transmitted to the minority class mining service 100. Each activation representation is generated by the client neural network 22 for a given labeled data sample x from the training dataset 24. L The activation values ​​are calculated, and each activation is associated with a data sample x that has already been assigned to a given label by the client neural network 22. L The tag y L Related. It should be noted that the client-side neural network 22 has already been trained using training dataset 24, and the training of the client-side neural network 22 does not occur during the training phase of the minority class mining service 100. The minority class mining service 100 uses inner activation A... L And label Y L A recalibrated neural network 102 is trained to acquire recalibrated activations and thus avoid suppressed / distorted activations due to overfitting of the final softmax layer of the client neural network 22. The minority class mining service 100 then uses the output of the trained recalibrated neural network 102 to train an anomaly detector 104, enabling the anomaly detector to learn the latent space of the probability distribution of recalibrated activations (e.g., a mapping of the probability features of the recalibrated activations). A threshold estimation algorithm 106 uses validation data to predict the minority class threshold 108 provided to the client 20.

[0077] Recalibrating the neural network 102 helps address the problem of activation distortion due to overfitting (in uncertain sampling). As will be discussed further below, the neural network 102 is trained in a way that prevents overfitting. The anomaly detector 104 helps address the problem of information loss (in uncertain sampling) due to the use of scalars and hard-coded metrics used in uncertain sampling. The anomaly detector 104 is trained to learn a model of the entire activation distribution to help capture identifying patterns between activations of different classes. The anomaly detector 104 is trained on a skewed dataset, enabling it to learn latent representations of activation patterns in majority class data samples. When the trained anomaly detector 104 is used during the inference phase, activation patterns in minority class data samples are detected as anomalous and can therefore be identified as candidate minority class data samples.

[0078] It should be noted that the minority class mining service 100 does not need to own or receive the client neural network 22, does not need to know or access the training process used by the client 20 to train the client neural network 22, and does not need to access or receive the set X included in the training dataset 24. L The data samples are labeled. Although the minority class mining service 100 receives inner activation A from client 20 L And label Y L However, this information may not reveal detailed information about the client neural network 22 and the training dataset 24 (e.g., the specific neural network architecture, set X). L (Specific data samples). This protects the data privacy of client 20.

[0079] Figure 3 This is a flowchart of an exemplary method 300 for training a minority class mining service 100 and outputting a predicted optimal minority class threshold. The predicted minority class threshold can be used in the inference phase to control precision and / or recall to identify candidate minority class data samples from data lacking minority class labels. For example, when in... Figure 2 When running on the computing system 200, method 300 can be executed by the minority class mining service 100.

[0080] In 302, inner activation A is received from client 20 (e.g., via minority class mining service 100 and the corresponding agent of client 20). L (For example, the penultimate activation layer) and the corresponding label Y L For example, inner layer activation A L The data samples X, labeled accordingly, are obtained from the training dataset 24 by the penultimate layer of the client neural network 22. L The output activation value. The corresponding label Y. LIt is the corresponding data sample X assigned to the training dataset 24. L The ground truth category label. Inner layer activation A L Each activation in the corresponding label Y L Each class has at least one corresponding label. Client 20 can also transmit one or more minority class identifiers to minority class mining service 100. Alternatively, minority class mining service 100 can classify them based on the corresponding label Y. L The category distribution is used to identify one or more minority classes (e.g., those with less than 10% corresponding label Y). L Any category represented by a set can be identified as a minority class, or in the corresponding label Y. L The category with the fewest elements can be identified as a minority class.

[0081] In 304, the received activation A L The set is divided into a training activation set (denoted as A). TL ) and the verification activation set (denoted as A) VL The training activation set A can be partitioned by stratified random sampling of all available categories (i.e., the activations of each given category (identified by the corresponding label) are randomly and uniformly divided into training activations and validation activations). TL and verify activation set A VL This ensures that the activation set A is trained. TL and verify activation set A VL Each represents a data sample X L The category distribution. It should also be noted that through this step, the corresponding label Y... L It is also implicitly divided into a training label set (represented as Y). TL ) and the set of verification labels (represented as Y) VL ).

[0082] In 306, the training activation set A is used. TL The corresponding training label set Y TL The recalibrated neural network 102 is trained using the focus loss function. In the example where the activation received from the client neural network 22 is the penultimate layer activation, the recalibrated neural network 102 can be a single-layer neural network (e.g., a single fully connected layer). Training of the recalibrated neural network 102 can be performed as follows.

[0083] Recalibrating the neural network 102 includes hyperparameters that specify the dimensions of the input to the recalibrated neural network 102. The hyperparameters use parameters corresponding to the training activation set A. TLThe values ​​of each activation dimension are initialized. The dimension of the output of the recalibrated neural network 102 is equal to the number of possible classes. That is, the recalibrated neural network 102 is designed to replicate a prediction task involving classification, which is performed by one or more layers of the client neural network 22 after generating the inner layers of the received inner layer activations. The weights of the recalibrated neural network 102 can each be initialized to random values. Training activation set A TL The activations can be sampled in batches or individually. The sampled training activations are forward-propagated through the recalibrated neural network 102 to output a predicted label for each sampled training activation. The focus loss of the recalibrated neural network 102 is calculated using the predicted labels, the corresponding ground truth training labels, and the focus loss function. The focus loss function is a dynamically weighted cross-entropy loss function, which can be expressed as follows:

[0084] FL=-(1-p t ) γ log(p t )

[0085] Where FL is the focal loss, p t γ is the probability corresponding to the correct class (indicated by the corresponding ground truth training label), and γ is an optional parameter controlling the influence of the weighting terms. Optimizing the focus loss function involves maximizing the activation corresponding to the correct class, similar to the cross-entropy loss function. However, the focus loss function reduces the weight of the contribution of the more common class (i.e., the majority class) and, as learning progresses, focuses the learning on the less common class (i.e., the minority class).

[0086] The calculated focal loss is backpropagated (e.g., using gradient descent) to update the weights of the recalibrated neural network 102. The recalibrated neural network 102 is performed over multiple epochs (each epoch is achieved by training the activation set A). TL The recalibrated neural network 102 is trained on a single process (pass) of all activations. The output of the trained recalibrated neural network 102 is the set of recalibrated activations, denoted as L. TL .

[0087] The neural network 102 is trained in a manner that avoids overfitting (which tends to lead to distorted class probabilities and thus poor predictions for the minority class). The focus loss function is likely less prone to overfitting compared to other loss functions typically used to train classifier neural networks (e.g., cross-entropy loss). Furthermore, the training of the recalibrated neural network 102 can be achieved using early stopping. That is, training can be performed in a smaller number of epochs (e.g., 20 epochs or less) compared to typical training of a classifier neural network (e.g., 100 epochs or more). While some exemplary methods for avoiding overtraining of the recalibrated neural network 102 have been described, it should be understood that other methods for reducing or avoiding overtraining may be used in addition to or in place of focus loss and early stopping. For example, methods such as regularization or weight decay may be used to reduce or avoid overfitting. Those skilled in the art will understand that these and other training methods for avoiding overtraining are within the scope of this invention.

[0088] In 308, the anomaly detector 104 is trained to learn to recalibrate the activation set L. TL The probability distribution (or internalized identification pattern). For example, the anomaly detector 104 could be an autoencoder trained using a reconstruction loss function. The training of the autoencoder can be performed in an unsupervised manner, as shown below.

[0089] The autoencoder is initialized to receive the recalibration activation set L from the recalibration neural network 102. TL Specifically, the autoencoder receives a set of recalibrated activations L from the recalibrated neural network 102. TL The recalibrated activation set L is generated from the last epoch of training the recalibrated neural network 102. TL Recalibrate to activate L TL The activation values ​​(which can be called logits) can be received from the recalibrated neural network 102 before the softmax function is applied. TL As logits can help ensure stable and easy training of the autoencoder (compared to training on sparse softmax values). However, in other examples, recalibrating the activation L... TL These can be received as softmax values ​​by the autoencoder. The weights of the autoencoder can each be initialized to random values. Recalibrate the activation set L. TLThe activations can be sampled in batches or individually. The sampled recalibrated activations are forward-propagated through the autoencoder to output the reconstructed activations for each sampled recalibrated activation. The reconstruction loss of the autoencoder is calculated using the reconstructed activations, the corresponding original recalibrated activations, and the reconstruction loss function. The reconstruction loss function can be the mean square error (MSE) loss function, as shown below:

[0090]

[0091] Where L is the calculated reconstruction loss, Y is the ground truth original recalibration activation, and X is the reconstruction activation.

[0092] The reconstruction loss is backpropagated (e.g., using gradient descent) to update the weights of the autoencoder. Training of the autoencoder can continue until the activation set L is recalibrated. TL All activations are sampled. It should be understood that other loss calculations can be used to train the autoencoder. Furthermore, it should be understood that different types of anomaly detectors 104 (e.g., PCA, GAN, VAE, etc.) can use different training methods, and those skilled in the art will understand that this is within the scope of the invention.

[0093] Training the anomaly detector 104 enables it to learn a latent model of the probability distribution of recalibrated activations for majority-class data samples. Specifically, in the case where the anomaly detector 104 is an autoencoder, the autoencoder is trained such that during the inference phase, the recalibrated activations for majority-class data samples are reconstructed well, but the recalibrated activations for minority-class data samples are reconstructed poorly. The quality of the reconstruction can be numerically evaluated to generate minority-class scores, as described in the next step.

[0094] In 310, the activation set A is verified through forward propagation using a trained recalibrated neural network 102 and a trained anomaly detector 104. VL To predict the verification activation for each recalibration (denoted as L). VL The minority class score. As mentioned above, the input to the anomaly detector 104 can be the recalibrated activation values ​​(also known as logits) from the recalibrated neural network 102 before the application of the softmax function.

[0095] In step 312, based on the output of the anomaly detector 104, minority class scores are computed for all validation activations. For example, if the anomaly detector 104 is an autoencoder, the quality of the reconstruction generated by the autoencoder is numerically evaluated (similar to method 400 performed during the inference phase, explained further below) to compute scores from the validation activation set A. VLThe minority class scores for all generated reconstructed activations are then calculated. Subsequently, the optimal value of the minority class threshold is estimated by performing threshold estimation algorithm 106. An exemplary method for numerically evaluating reconstruction quality is as follows.

[0096] For example, the softmax function can be optionally applied to a given original validation activation and a reconstructed activation generated by an autoencoder (applying softmax can help amplify quality differences). The MSE loss between the original validation activation (optionally with softmax applied) and the reconstructed activation (optionally with softmax applied) is calculated. A high MSE loss indicates poor reconstruction, suggesting the original validation activation may have been generated from minority class data samples. Therefore, the MSE loss can be used as a minority class score, where a higher minority class score indicates a greater likelihood that the corresponding data sample (represented by activations) is a minority class data sample. It should be understood that other methods can be used to numerically evaluate reconstruction quality to calculate the minority class score. Furthermore, it should be understood that different types of anomaly detectors 104 (e.g., PCA, GAN, VAE, etc.) can produce different anomaly detector outputs, which can be numerically evaluated in different ways to detect anomalies (and therefore candidate minority class data samples). Those skilled in the art will understand that techniques using the outputs of different types of anomaly detectors to detect anomalies are within the scope of this invention.

[0097] In 314, the minority class score of validation activation and the set of validation labels Y are used. VL The predicted minority class threshold is calculated (e.g., by performing threshold estimation algorithm 106). An example of threshold estimation algorithm 106 is shown below.

[0098] Threshold estimation algorithm 106 pairs the minority class score computed for a given validation activation with the ground truth validation label corresponding to that validation activation. Threshold estimation algorithm 106 sorts all minority class scores (each paired with a validation label) in ascending or descending order. Since the minority class score represents the probability that the validation activation was generated from minority class data samples, it is expected that validation labels representing the minority class should be paired with higher minority class scores, while validation labels representing the majority class should be paired with lower minority class scores. Based on the sorted minority class scores, threshold estimation algorithm 106 computes a numerical threshold representing the boundary between the minority class scores paired with minority class labels and the minority class scores paired with majority class labels. Threshold estimation algorithm 106 can use any suitable method to compute the numerical threshold. For example, when a threshold-based classifier uses a predicted minority class threshold, threshold estimation algorithm 106 can use any method that maximizes the precision and recall of the predicted minority class data samples. For example, threshold estimation algorithm 106 can compute the numerical threshold based on a precision-recall curve or by maximizing a metric such as the F-score. The threshold estimation algorithm 106 can use any other method to calculate the numerical threshold, including simple statistical methods (e.g., calculating the numerical threshold and finding that 95% of the minority class data samples exceed the numerical threshold).

[0099] The numerical threshold calculated by the threshold estimation algorithm 106 is the best predicted value of the minority class threshold predicted by the minority class mining service 100.

[0100] In 316, the predicted minority class threshold is output by minority class mining service 100 to client 20 (e.g., through the corresponding agents of minority class mining service 100 and client 20).

[0101] Client 20 can store the predicted minority class threshold (e.g., in client 20's local memory) as minority class threshold 108. Minority class threshold 108 can be adjusted by client 20. For example, if client 20 wants to reduce false positives (i.e., majority class data samples are incorrectly identified as candidate minority class data samples), minority class threshold 108 can be adjusted to have a higher threshold. Conversely, if client 20 wants to identify more candidate minority class data samples (potentially increasing the risk of false positives), minority class threshold 108 can be adjusted to have a lower threshold.

[0102] In some examples, step 316 can be omitted, and the predicted minority class threshold may not be output to client 20. For example, the minority class mining service 100 may itself store the minority class threshold 108. In this example, client 20 may communicate with the minority class mining service 100 to adjust the minority class threshold 108. Alternatively, the minority class threshold 108 may not be adjustable by client 20.

[0103] After the minority class threshold 108 has been predicted and optionally received by the client 20 from the minority class mining service 100, the training phase of the minority class mining service 100 can end. Subsequently (at any future time after the end of the training phase), the minority class mining service 100 can perform the operations of the inference phase to identify candidate minority class data samples from the data that does not include any minority class labels.

[0104] Now refer to it again Figure 1 . Figure 1 The dashed arrows in the diagram illustrate an example of data flow during the inference phase.

[0105] During the inference phase, client 20 can access data sources lacking minority class labels. This data is the data mined for candidate minority class data samples. Data lacking minority class labels can be data without any labels (i.e., unlabeled data) or data that has been labeled but one or more minority classes are not included in the possible labeled categories. In some examples, the data to be mined may have some minority class labels, but client 20 may want to use minority class mining service 100 to identify additional data samples that should have minority class labels (e.g., if client 20 believes the data is mislabeled). That is, even if the data includes some minority class labels, the data may still lack minority class labels because more minority class labels should be assigned. For example, the data source can be an existing dataset, an unlabeled data pool (e.g., an online data repository), or a data stream (e.g., inference data acquired in real time).

[0106] If the minority class threshold 108 is stored by client 20, then client 20 transmits the minority class threshold 108 (which client 20 may have adjusted after receiving it from minority class mining service 100). Minority class mining service 100 uses the minority class threshold 108 received from client 20 (which may differ from the predicted minority class threshold initially generated by minority class mining service 100) to identify candidate minority class data samples, as discussed further below. Alternatively, if the minority class threshold 108 is stored by minority class mining service 100, then minority class mining service 100 can retrieve the minority class threshold 108 from storage.

[0107] Client 20 transmits the inner activations of a given data sample from client neural network 22 to minority class mining service 100. The inner activations transmitted from client 20 for inference should correspond to the inner activations used to train minority class mining service 100 (i.e., if the penultimate layer activations are used to train minority class mining service 100, then the penultimate layer activations should be transmitted by client 20 for inference). Minority class mining service 100 uses a trained recalibrated neural network 102 to generate recalibrated activations from the received activations. Possible anomalies are then detected using a trained anomaly detector 104, and the output of anomaly detector 104 is used to compute a minority class score. For example, if anomaly detector 104 is a trained autoencoder, the trained autoencoder is used to reconstruct the recalibrated activations, and the reconstruction quality is evaluated by candidate prediction algorithm 110 to compute a minority class score for the received activations. Candidate prediction algorithm 110 compares the computed minority class score with a minority class threshold 108 received from client 20 to determine whether the received activations represent a candidate minority class data sample. If the received activation is identified as representing a candidate minority class data sample (e.g., a calculated minority class score higher than the minority class threshold 108), then the minority class mining service 100 sends the candidate minority class data sample to the labeling service 30 for labeling.

[0108] Labeling service 30 generates one or more class labels for candidate minority class data samples (e.g., using human labelers). Labeled data samples generated using one or more class labels can be added to training dataset 24 (e.g., if the labeled data samples are actually minority class data samples). This allows class imbalance in training dataset 24 to be corrected by adding more minority class data samples to it. The client neural network 22 can be retrained using the rebalanced training dataset 24 (e.g., after mining a minimum number of minority class data samples and adding them to training dataset 24). In some examples, the class distribution of labels in training dataset 24 can be analyzed before retraining client neural network 22 to ensure a sufficiently balanced class distribution.

[0109] In some examples, minority class data samples can be repeatedly mined and the client neural network 22 can be retrained. For example, after performing a certain amount of mining (e.g., after mining a given data source for candidate minority class data samples), the client neural network 22 can be trained on a rebalanced training dataset 24. However, the rebalanced training dataset 24 and the retrained client neural network 22 may lack new minority class data samples (e.g., the training dataset 24 may have been rebalanced for the first minority class, which was previously the least represented, but after rebalancing, the second minority class is now the least represented). Subsequently, the minority class mining service 100 can repeat the training phase using the activations generated by the retrained client neural network 22, and can repeat the inference phase to mine candidate minority class data samples (for minority classes different from those previously mined). Therefore, the training dataset 24 can be further enhanced, and the client neural network 22 can be further retrained.

[0110] It should be noted that the minority class mining service 100 does not need to own or receive the client neural network 22, does not need to know or access the training process used by the client 20 to train the client neural network 22, and does not need direct access to the data source to be mined. In some examples, to ensure greater data privacy, the client 20 can use code or other identifiers to identify each activation transmitted to the minority class mining service 100. Only the client 20 knows the data sample corresponding to each identifier. When the minority class mining service 100 determines that a given received activation represents a candidate minority class data sample, the minority class mining service 100 can transmit the identifier of the given activation to the client 20 or the labeling service 30. If the identifier is transmitted to the labeling service 30, the labeling service 30 can then transmit the identifier to the client 20. The client 20 can then use the identifier to identify the corresponding data sample as a candidate minority class data sample, and the client 20 can send the identified candidate minority class data sample to the labeling service 30. The labeling service 30 then sends the labeled minority class data sample back to the client 20. Therefore, the minority class mining service 100 may have no knowledge of the actual data sample at all.

[0111] Figure 4 This is a flowchart of an exemplary method 400, which can be executed by a minority class mining service 100 to identify candidate minority class data samples. Method 400 can be executed by the minority class mining service 100 during the inference phase following the training phase described above. For example, when in... Figure 2 When running on the computing system 200, method 400 can be executed by the minority class mining service 100.

[0112] In step 402, the minority class threshold 108 is obtained. For example, the minority class threshold 108 can be received from client 20. When client 20 initiates a service request to the minority class mining service 100, the minority class threshold 108 can be transmitted to the minority class mining service 100. In some examples, the minority class threshold 108 can be stored by the minority class mining service 100 instead of client 20. In such examples, the minority class threshold 108 can also be obtained from the memory of the minority class mining service 100.

[0113] In a 404 error, client 20 receives the inner activation representing a given data sample. The received activation can be represented as A. U When a given data sample is forward-propagated through the client neural network 22, the client 20 can extract the received activation A from the inner layer of the client neural network 22 (corresponding to the inner layer from which activations are extracted during the training phase). U Although expressed in the singular, it should be understood that the received activation A U It can be a set of activation values, corresponding to the activation modes of the inner layer of the client neural network 22.

[0114] Received activations can be received from client 20 as a batch of activations or as a live stream of activations. Regardless of how the activations are received, minority class mining service 100 can process each received activation individually.

[0115] In 406, the received activation A U The trained recalibrated neural network 102 is forward-propagated to generate recalibrated activations. The recalibrated activations (denoted as L) are... U The values ​​of the activations (i.e., logits) are provided to the trained anomaly detector 104. In some examples, the values ​​of the activations (i.e., logits) recalibrated before the softmax function can be provided to the trained anomaly detector 104 as recalibrated activations.

[0116] In step 408, the recalibrated activations (which may be represented by logits) are forward-propagated through the trained anomaly detector 104 to produce the anomaly detector output. For example, if the anomaly detector 104 is a trained autoencoder, the anomaly detector output could be the reconstructed activations.

[0117] In step 410, a minority class score is calculated for the received activations based on the anomaly detector output. The calculation of the minority class score can be performed by the candidate prediction algorithm 110 using the same calculation as the threshold estimation algorithm 106 described above.

[0118] For example, if the anomaly detector 104 is an autoencoder, the softmax function can be applied to the originally received activations and the reconstructed activations generated by the autoencoder. The MSE loss between the originally received activations (optionally with softmax applied) and the reconstructed activations (optionally with softmax applied) is calculated. This MSE loss is then used as the minority class score for the received activations. Furthermore, it should be understood that the minority class score calculation can differ for different types of anomaly detectors 104 (e.g., PCA, GAN, VAE, etc.). For example, different anomaly detectors can produce different types of anomaly detector outputs, which can be numerically evaluated in different ways to detect anomalies (and thus candidate minority class data samples). Those skilled in the art will understand that techniques using the outputs of different types of anomaly detectors to detect anomalies are within the scope of this invention.

[0119] In some examples, optional step 412 may be performed. Optional step 412 may be performed where there are multiple received activations representing a single given data sample. For example, if the client neural network 22 is trained to perform an object detection task, multiple objects may be detected in a given data sample (e.g., a 2D image), and therefore multiple activations may be detected (one activation per object detection). In this case, steps 406 through 410 may be repeated for each received activation to obtain multiple minority class scores. Optional step 412 may be performed to reduce the multiple minority class scores to a single minority class score, which will be compared to a minority class threshold 108.

[0120] In an optional step 412, which can be performed by executing the candidate prediction algorithm 110, multiple calculated minority class scores (already calculated for the corresponding multiple received activations) are filtered and / or aggregated. For example, multiple calculated minority class scores can be filtered to retain only the top K detections with the highest confidence (where K is an optional hyperparameter). Alternatively, any suitable aggregation method (e.g., simple averaging) can be used to aggregate the minority class scores to obtain a single minority class score.

[0121] In step 414, this step can be performed by executing candidate prediction algorithm 110, which compares the minority class score with a minority class threshold 108 to determine whether the received activation represents a candidate minority class data sample. For example, if the minority class score is higher than the minority class threshold 108, the corresponding received activation can be labeled as representing a candidate minority class data sample.

[0122] In step 416, candidate minority class data samples (represented by the received activations) are transmitted from minority class mining service 100 to labeling service 30. Alternatively, minority class mining service 100 may also transmit an identifier associated with the received activation to client 20, enabling client 20 to identify the candidate minority class data sample and transmit it to labeling service 30. Alternatively, minority class mining service 100 may also transmit an identifier associated with the received activation to labeling service 30, enabling labeling service 30 to query candidate minority class data samples from client 20.

[0123] Minority mining service 100 does not need to participate in the subsequent operations of labeling service 30 and client 20 to generate labels for candidate minority data samples and rebalance the training dataset 24 with the labeled minority data samples.

[0124] Method 400 can be repeated on multiple data samples from client 20 to rebalance the training dataset 24 with the added labeled minority class data samples.

[0125] It should be noted that the minority class mining service 100 customizes the recalibrated neural network 102 and anomaly detector 104 for each client neural network 22. In the presence of multiple clients 20, or in the case of a single client 20 having multiple client neural networks 22, the minority class mining service 100 performs a training phase to train the recalibrated neural network 102 and anomaly detector 104, and predicts the minority class threshold for each client neural network 22. The minority class mining service 100 then maintains (e.g., in memory) the training weights of the trained recalibrated neural network 102 and trained anomaly detector 104 for each client neural network 22.

[0126] If the recalibrated neural network 102 and the anomaly detector 104 have been trained against a given client neural network 22, and the client neural network 22 is subsequently updated (e.g., retrained with an updated training dataset 24), the minority class mining service 100 performs a training phase operation to retrain the recalibrated neural network 102 and the anomaly detector 104 using activations from the updated client neural network 22.

[0127] In various examples, this invention describes methods and systems for mining minority class data samples, which may help improve training datasets used to train neural networks, thereby improving the performance of trained neural networks. The disclosed methods and systems are able to model information about activation patterns across classes and avoid overfitting problems by using a recalibrated neural network (e.g., a single-layer recalibrated neural network) and modeling the entire activation distribution using an anomaly detector (e.g., an autoencoder). By recalibrating suppressed activations using a recalibrated neural network and modeling the entire activation distribution through a single-class learning process using an anomaly detector, some drawbacks of existing uncertain sampling techniques are addressed. The disclosed methods and systems can have relatively low computational costs because the activations representing data samples are processed in a single process through the recalibrated neural network and the anomaly detector.

[0128] In various examples, this invention describes methods and systems that are better at identifying candidate minority class data samples (e.g., achieving better precision and recall in highly skewed class distributions) compared to some existing methods and systems (e.g., uncertain samples, guided learning, and hybrid methods). The disclosed methods and systems can be implemented at a relatively low computational cost (e.g., requiring less memory resources and / or shorter computation time) compared to some existing methods and systems such as guided learning. The disclosed methods and systems can be implemented at a relatively low monetary cost compared to some existing methods and systems such as guided learning. The disclosed methods and systems are applicable to a wider variety of data domains and data complexities compared to some existing methods and systems (e.g., guided learning and hybrid methods).

[0129] The disclosed methods and systems utilize a trained recalibrated neural network and a trained anomaly detector, which enables modeling of activations (including activation patterns between class activations) in the inner layers (e.g., the penultimate layer) of the client neural network. Specifically, the disclosed methods and systems address at least some of the ways in which uncertain sampling fails to uncover minority class examples, such as the suppression of minority class activations due to class imbalance and information loss due to using a single scalar hard-coded metric to represent the probability distribution of activations. The recalibrated neural network allows distorted class activations in the client neural network to be recalibrated to avoid minority class activation distortion. Using a trained anomaly detector can be considered a more suitable approach for the specific training dataset of the client neural network, rather than using hard-coded metrics (e.g., entropy or maximum score). The trained anomaly detector enables modeling (or internalizing) the entire probability distribution of activations to capture patterns and relationships between class activations.

[0130] For example, the disclosed methods and systems can be used to improve the performance of neural networks trained in the field of medical diagnostics. Disease distribution often follows a long-tail pattern, in which the rarest disease instances tend to be quite dangerous and elusive. This results in these diseases being underrepresented in most training datasets. Client neural networks trained on such imbalanced training datasets may be biased and fail to perform optimally in detecting rare diseases. The disclosed methods and systems can automatically identify rare disease data samples, enabling the labeling of these samples and rebalancing of the training dataset.

[0131] In another example, the disclosed methods and systems can be used to improve the performance of trained neural networks for detecting offensive and sensitive content in media, particularly online media (e.g., online social media and online communities). The proportion of non-offensive content is typically much larger than that of offensive content. However, the offensive nature of offensive content may require well-trained neural networks to detect such content, thus enabling the removal of offensive content as quickly as possible. The disclosed methods and systems can support the automatic identification of offensive content data samples to provide a balanced training dataset for training client-side neural networks to detect offensive content.

[0132] The disclosed methods and systems can be used in any other technical field where similar class imbalances exist in available data (e.g., fraud detection, spam detection, etc.).

[0133] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented by electrical hardware, or a combination of computer software and electrical hardware. Whether the function is executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but should not consider such implementation to be beyond the scope of this invention.

[0134] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the above-described systems, devices, and units can be based on the corresponding processes in the above-described method embodiments, and will not be repeated here.

[0135] It should be understood that the disclosed systems and methods can be implemented in other ways. Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units; they may be located in one location or distributed across multiple network units. Some or all units can be selected according to actual needs to achieve the purpose of the embodiment. Furthermore, functional units in the embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0136] When these functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to instruct a computer device (which may be a personal computer, server, or network device) to execute all or part of the steps of the methods described in the embodiments of this application. The aforementioned storage medium includes any medium capable of storing program code, such as a universal serial bus (USB) flash drive, a removable hard disk, read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0137] The above description is merely a specific implementation of this application and is not intended to limit the scope of protection of this invention. Any variations or substitutions that are readily conceived by those skilled in the art within the scope of the technology disclosed in this invention should fall within the scope of protection of this invention.

Claims

1. A method for identifying candidate minority class data samples, characterized in that, The method includes: The received activation includes values ​​representing the inner activation of a given data sample, the received activation being generated by a client neural network that has been trained to perform classification; The received activations are forward-propagated through a trained recalibration neural network to generate recalibration activations, wherein the trained recalibration neural network has been trained to perform the classification in a manner that avoids overtraining; The recalibrated activations are forward propagated through a trained anomaly detector, wherein the trained anomaly detector has been trained on activations that form a majority of the majority of the majority of the majority of the data samples. Based on the anomaly detector output, the received active minority class score is calculated; Based on the comparison between the minority class score and the minority class threshold, the given data sample is identified as a candidate minority class data sample; The identifier of the given data sample is transmitted as the candidate minority class data sample.

2. The method according to claim 1, characterized in that, There exist multiple received activations representing the given data sample, and for each corresponding received activation among the multiple received activations, the method includes: The received activations are forward-propagated through the trained recalibration neural network to generate corresponding recalibration activations; The corresponding recalibration activation is forward-propagated through the trained anomaly detector to generate the corresponding anomaly detector output; Based on the corresponding anomaly detector output, calculate the corresponding minority class score of the corresponding received activation; The method further includes: The respective minority class scores calculated for the plurality of received activations are filtered and aggregated to obtain a single minority class score that will be used in the comparison with the minority class threshold.

3. The method according to claim 1 or 2, characterized in that, The trained anomaly detector is an autoencoder that has been trained to output reconstructed activation as the output of the anomaly detector, and the minority class score is calculated based on the quality of the reconstructed activation.

4. The method according to claim 1 or 2, characterized in that, The received activation is received from the client computing system, and the minority class threshold is received from the client computing system.

5. The method according to claim 1 or 2, characterized in that, The given data sample is transmitted to the client computing system as the identifier of the candidate minority class data sample.

6. The method according to claim 1 or 2, characterized in that, The given data sample is transmitted to the tagging service as the identifier of the candidate minority class data sample.

7. The method according to claim 1 or 2, characterized in that, The trained anomaly detector is a trained autoencoder that has been trained to perform a reconstruction task, wherein the anomaly detector output is a reconstruction activation, and calculating the minority class score includes: Calculate the mean squared error between the received activation and the reconstructed activation, wherein the calculated mean squared error is used as the minority class score.

8. The method according to claim 7, characterized in that, Before calculating the mean squared error, the softmax function is applied to the received activation and the reconstructed activation.

9. The method according to claim 1 or 2, characterized in that, It also includes training the recalibration neural network and the anomaly detector in the following manner, wherein the anomaly detector is an autoencoder: Receive the inner activation set generated by the client neural network, and the corresponding category label set, where each category label is associated with a corresponding inner activation; The recalibrated neural network is trained using a subset of training activations from the inner activation set in the following manner: For each training activation, the training activation is forward-propagated through the recalibrated neural network to generate a predicted class label; The focus loss is calculated using the predicted class label, the corresponding class label associated with the training activation, and the focus loss function; The weights of the recalibrated neural network are updated by backpropagating the calculated focal loss; The autoencoder is trained using a recalibrated set of training activations generated from the subset of training activations by the recalibrated neural network in the following manner: For each recalibrated training activation, the recalibrated training activation is forward-propagated through the autoencoder to generate a reconstructed training activation; The reconstruction loss is calculated using the reconstructed training activation, the recalibrated training activation, and the reconstruction loss function; The weights of the autoencoder are updated by backpropagating the calculated reconstruction loss.

10. The method according to claim 9, characterized in that, The number of rounds required to train the recalibration neural network is reduced compared to training the client neural network.

11. The method according to claim 9, characterized in that, This also includes calculating the minority class threshold in the following ways: The trained recalibrated neural network and the trained autoencoder are used to forward propagate a subset of the verification activations from the inner activation set to obtain a reconstructed set of verification activations. The minority class score set is calculated based on the reconstruction quality of the reconstructed verification activation set. Pair each minority class score with its corresponding category label; The numerical value of the minority class threshold is identified from the pairings, the minority class threshold representing the boundary between the minority class score of the minority class data sample and the minority class score of the majority class data sample.

12. The method according to claim 11, characterized in that, The calculated minority class threshold is transmitted to the client computing system.

13. A computational system for identifying candidate minority class data samples, characterized in that, The computing system includes: One or more processing devices for performing the method according to any one of claims 1 to 12.

14. The computing system according to claim 13, characterized in that, The computing system is one of the following: server; Server cluster; or Cloud computing platform.

15. A computer-readable medium, characterized in that, The instruction includes instructions that, when executed by a processing device of a computing system, cause the computing system to perform the method according to any one of claims 1 to 12.