# Deep Learning for Audio Event Detection and Tagging on Low-Resource Datasets
## 2 Task Factorisation
### Audio Event Detection (WHEN)
#### 2.2.2 Multi Instance Learning  
When used for training audio event detectors, low-resource datasets present the issue of weak-to-strong prediction. Low-resource datasets only provide the user with weak labels, labels that don't include any temporal information about the events but only denote the presence or absence of a specific class in a recording. However, audio event detectors produce instance labels referred to as strong labels, hence providing full temporal information about the events in a recording. The most common way to train a network for weak-to-strong prediction is the multi instance learning (MIL) setting. The concept of MIL was first properly developed in [23] for drug activity detection. MIL is described in terms of _bags_, with a bag being a collection of instances. The existing weak labels are attached to the bags, rather than the individual instances within them. Positive bags have at least one positive instance, an instance for which the target class is active. On the other hand, negative bags contain negative instances only, the target class is not active in them. A negative bag is thus pure while a positive bag is presumably impure, since the latter most likely contains both positive and negative instances. Hence, all instances in a negative bag can be uniquely assigned a negative label but for a positive bag this cannot be done. There is no direct knowledge of whether an instance in a positive bag is positive or negative. Thus, it is the bag-label pairs and not the instance-label pairs which form the training data, and from which a classifier that classifies individual instances must be learned. Let the training data be composed of \(N\) bags, i.e., \(\left\{B_{1},B_{2},\ldots,B_{N}\right\}\), the \(i\)-th bag is composed of \(M_{i}\) instances, i.e., \(\left\{B_{i1},B_{i2},\ldots,B_{iM_{i}}\right\}\), where each instance is a \(p\)-dimensional feature vector, e.g., the \(j\)-th instance of the \(i\)-th bag is \(\left[B_{i1},B_{i2},\ldots,B_{ijp}\right]^{T}\). We represent the bag-label pairs as \(\left(B_{i},Y_{i}\right)\), where \(Y_{i}\in\left\{0,1\right\}\) is the bag label for bag \(B_{i}\). \(Y_{i}=0\) denotes a negative bag and \(Y_{i}=1\) denotes a positive bag. One naive but commonly used way of inferring the individual instances' labels from the bag labels is assigning the bag label to each instance of that bag: we refer to this method as _false strong labelling_. During training, a neural network in the MIL setting with false strong labels tries to minimise the average divergence between the network output for each instance and the false strong labels assigned to them, identically to an ordinary supervised learning scenario. However, it is evident that the false strong labelling approach is an approximation of the loss for a strong label prediction task, hence it has some disadvantages. When using false strong labels, some kind of early stopping is necessary since, when perfect accuracy is achieved, this would mean all positive instance predictions for a positive bag. However, there is no clear way of defining a specific point for early stopping. This is the same issue that all methods in the MIL setting face. As mentioned before, a positive bag might include both positive and negative instances; however, false strong labels will force the network towards positive predictions for both. Additionally, by using strong false labels, there is an imbalance of positive and negative instance labels compared to the true strong labels, since a substantial amount of negative instances are considered as positive during training. Finally, a negative instance may appear in both a negative and positive recording; however, due to the false labelling of negative instances as positive in positive bags, the network may not learn the proper prediction for this kind of instance. As an alternative to false strong labels, one can attempt to infer labels of individual instances in bag \(B_{i}\) by making a few educated assumptions.