dataesr/scientific-paragraphs-categorization huggingface dataset:
This methodology facilitates the experimental analysis by converting a multiple response optimization problem into a single response that is easier to interpret  [87, 88]. The optimized conditions for Recovery Yield of Lipids and Recovery Yield of Polar molecules were assessed with Desirability Function (DF) in the software Minitab V17 (Table  4 ). Given the optimal experiment to simultaneously maximize RYL with DF of 1. 0000 and RYP with DF of 0. 9123, the RYL + RYP desirability function of 0. 9551 was obtained in the following experimental conditions: 265 bars, 55 • C, and 55 wt% moisture content. The RYL for measured and predicted data are reported as 92. 68 and 93. 97 wt%, resulting in p-values of 0. 0137 (p < 0. 05). The RYP for measured and predicted data are 5. 3591 and 6. 2039 wt%, resulting in a p-value of 0.
The selected images were then annotated and used to retrain Mask R-CNN, and this was repeated for a number of sampling iterations. In our study, MaskAL was compared to a random sampling method on a broccoli dataset with five visually similar classes. MaskAL performed significantly better than the random sampling. In addition, MaskAL had the same performance after sampling 900 images as the random sampling had after 2300 images. Compared to a Mask R-CNN model that was trained on the entire training set (14,000 images), MaskAL achieved 93. 9% of that model's performance with 17. 9% of its training data. The random sampling achieved 81. 9% of that model's performance with 16. 4% of its training data. We conclude that by using MaskAL, the annotation effort can be reduced for training Mask R-CNN on a broccoli dataset with visually similar classes.
The image selection is carried out with a sampling method. Commonly used sampling methods are diversity sampling, uncertainty sampling, and hybrid sampling (which combines diversity and uncertainty sampling)  (Ren et al. , 2020). With diversity sampling, images are selected that represent the diversity that exists in the set of unlabelled images. With uncertainty sampling, images are selected about which the CNN is most uncertain. To date, most active learning methods have been developed for image classification, semantic segmentation, and object detection  (Ren et al. , 2020). There have also been two studies on active learning for agricultural purposes. Zahidi and Cielniak (2021)  researched active learning for image classification of crops and weeds, and it was shown that with active learning only 60% of the images were needed to achieve a performance comparable to that of a CNN trained on the complete dataset.
(2014). With PAL, the expected performance gain was calculated for the unlabelled images, and the images with the highest gain were selected for retraining. The second active learning method for Mask R-CNN was developed by  Wang et al. (2020) , and used a learning loss method. With this method, three additional loss prediction modules were added to the Mask R-CNN network to predict the loss of the class, box and mask of the unlabelled images. Images with a high loss were selected and labelled in a semi-supervised way using the model's output. The third active learning method for Mask R-CNN was developed by López Gómez (2019). In this work, the image sampling was done with Monte-Carlo dropout. Monte-Carlo dropout was introduced by  Gal and Ghahramani (2016)  and it is a frequently used sampling technique in active learning, because of its straightforward implementation.
The active learning framework was based on the uncertainty calculation of  Morrison et al. (2019) , but changes were made to the semantic certainty calculation to make the active learning more suitable for use on datasets with visually similar classes (like our broccoli dataset). We hypothesised that by using uncertainty-based active learning, the performance of Mask R-CNN can be improved faster and thereby the annotation effort can be reduced compared to a random sampling method. This hypothesis was tested on a dataset containing 16,000 images of field-grown broccoli (Brassica oleracea var. italica). The broccoli dataset contained images of healthy, diseased and defective broccoli heads. The first contribution of our research is a new active learning framework that can reduce annotation effort for training Mask R-CNN.
Broccoli images Our dataset consisted of 16,000 red, green, blue (RGB) colour images of field-grown broccoli. 4622 of the 16,000 images were downloaded from three online available broccoli image datasets  (Bender et al. , 2019; Blok et al. , 2021b; Kusumam et al. , 2016). The images in these datasets were acquired with a Ladybird robot (Fig. 1a ), a stationary camera frame (Fig. 1b ) and a tractor-mounted acquisition box (Fig. 1c ). The other 11,378 images were acquired with an image acquisition system that was attached to a broccoli harvesting robot (Fig. 1d )  (Blok et al. , 2021a). The detailed information about the broccoli fields, crop conditions, and camera systems can be found in Table  1. The 16,000 images contained a total of 31,042 broccoli heads. The majority of the broccoli heads (25,704) were healthy, see one example in Fig.
MaskAL The MaskAL procedure consisted of four sequential steps. First, a subset of images was selected from the training pool, and annotated. Second, Mask R-CNN was trained on these images. Third, the trained Mask R-CNN model was evaluated on the independent test set to determine its performance. Fourth, a new subset of images was selected from the training pool with either random sampling or uncertainty sampling (the active learning). After the fourth step, the selected images were annotated and added to the previous training set. Mask R-CNN was retrained on this combined set of images, after which it was evaluated and used to sample new images. This entire procedure was repeated for a number of sampling iterations. The MaskAL procedure is explained in more detail in the pseudo-code of Algorithm 1 (the blue-coloured functions highlight the four consecutive steps).
MaskAL was built as a software shell on top of the Mask R-CNN code of Detectron2 (version 0. 4)  (Wu et al. , 2019). In our research, Mask R-CNN was equipped with the ResNeXt-101 (32x8d) backbone  (Xie et al. , 2017). Before the training and sampling could be performed, dropout had to be applied to several network layers of Mask R-CNN. In the box head of Mask R-CNN, dropout was applied to each fully connected layer, see Fig. 3. This dropout placement was in line with  Gal and Ghahramani (2016)  and would allow us to capture the variation in the predicted classes and the bounding box locations. Dropout was also applied to the last two convolutional layers in the mask head of Mask R-CNN to be able to capture the variation in the pixel segmentation, see Fig. 3. The severity of the dropout was made configurable in MaskAL by means of the dropout probability.
Step 1 -Annotate The first step in MaskAL involved the annotation of the selected images. At algorithm initialisation, this annotation was done on a subset of images that was randomly sampled from the training pool. The images were annotated by two crop experts, who used the LabelMe software (version 4. 5. 6) (Wada, 2016). In our research, all images were annotated beforehand, as this allowed us to conduct three experiments without being interrupted for doing the image annotations. In addition, by annotating all images, we were able to train Mask R-CNN on the entire training pool (see paragraph 2. 3. 3).
The training was performed with dropout as a regularisation technique to enhance the generalisation performance. This procedure was in line with the training procedure of  Gal and Ghahramani (2016). At MaskAL initialisation, the network weights of Mask R-CNN were initialised with the weights of a Mask R-CNN model that was pretrained on the Microsoft Common Objects in Context (COCO) dataset  (Lin et al. , 2014). After the first training procedure, the transfer learning was done with the weights of the previously trained Mask R-CNN model to minimise the effects of catastrophic forgetting. In our training pool, there was a severe class imbalance (healthy: disease/defect = 27:1). Due to this class imbalance, the random sampling was more likely to sample images with healthy broccoli heads than images with damaged, matured, cat-eye or head rot broccoli heads.
2. 2. 4. 3. Step 4. 3 -Certainty calculation. Three certainty values were calculated for each instance set: the semantic certainty, the spatial certainty, and the occurrence certainty. The certainty calculations were adopted from  Morrison et al. (2019) , but changes were made to the semantic certainty calculation to make it more suitable for use on datasets with visually similar classes (like our broccoli dataset). The semantic certainty, c sem , was a measure of the consistency of Mask R-CNN to predict the class labels within an instance set. The c sem value was close to zero when there was a low semantic certainty, and close to one when there was a high semantic certainty. Morrison et al. (2019)  calculated the c sem value by taking the difference between the average confidence score of the first and the second most probable class of the instance set.
This method is known as margin sampling, but a disadvantage is that it does not take into account the confidence scores of the less probable classes. This is undesirable when the dataset has a high degree of inter-class similarity, because then Mask R-CNN has a tendency to hesitate between more than two classes. This multi-class hesitation was also expected in our broccoli dataset. To overcome the disadvantage of the margin sampling, the c sem calculation was upgraded with an entropy-based equation, which took the confidence scores, P, of all classes, K = {k 1 , …, k n }, into account, see Eq. 2. However, with the entropy calculation, the c sem value would be low when there was class certainty, and this was opposite of Morrison's c sem value. Also, the entropy calculation could result in values higher than one, which deviated from Morrison's c sem value that was bound between zero and one.
6. The c box and the c mask values were the mean IoU values between the average box and mask of the instance set (respectively denoted as B and M) and each individual box and mask prediction within that instance set (respectively denoted as B and M), refer to Eq. 7 and 8. The average box, B, was formed from the centroids of the corner points of the individual boxes in the instance set (see the white boxes in Fig. 4d ). The average mask, M, represented the segmented pixels that appeared in at least 25% of the individual masks in the instance set (see the white masks in Fig. 4d ). The value of 25% was found to produce the most consistent average masks for our broccoli dataset. c spl (S) = c box (S)⋅c mask (S) with S = {s 1 , …, s r } (6) c box (S) = 1 r ⋅ ∑ r i=1 IoU(B(S), B(s i )) with S = {s 1 , …, s r } (7) c mask (S) = 1 r ⋅ ∑ r i=1 IoU(M(S), M(s i )) with S = {s 1 , …, s r } (8) The occurrence certainty, c occ , was a measure of the consistency of Mask R-CNN to predict instances on the same object during the repeated image analysis.
The setup and results of the preliminary experiment are described in Appendix A. Based on the results in Appendix A, two numbers of forward passes were chosen: 20 and 40. The three dropout probabilities, two certainty calculation methods, and two numbers of forward passes were combined into 12 unique combinations of certainty calculation parameters. We assessed the effect of each of these 12 combinations on the active learning performance. All combinations were tested with the same initial dataset of 100 images, which were randomly sampled from the training pool. After training Mask R-CNN on the initial dataset, the trained model was used to select 200 images from the remaining training pool about which Mask R-CNN was most uncertain. The selected images were used together with the initial training images to retrain Mask R-CNN.
This procedure was repeated 12 times, such that in total 13 image sets were trained (containing respectively, 100, 300, 500, …, 2500 sampled images). After training Mask R-CNN on each image set, the performance of the trained model was determined on the images of the first test set. The 13 resulting mAP values were stored. The experiment was repeated five times to account for the randomised initial dataset and the randomness in the Monte-Carlo dropout method. A three-way analysis of variance (ANOVA) with a significance level of 5% was employed for the mAP values to test whether there were significant performance differences between the three dropout probabilities, the two certainty calculation methods, and the two numbers of forward passes. The ANOVA was performed per mAP value, because the mAP was not independent between the different image sets (for instance, the set of 2500 images contained the 2300 images from the previous sampling iteration).
Experiment 2 The optimal setting for the dropout probability, certainty calculation method, and number of forward passes was obtained from experiment 1 and used in experiments 2 and 3. The objective of experiment 2 was to test the effect of the sample size on the active learning performance. This experiment would reveal the optimal sample size for annotating the images and retraining Mask R-CNN. A smaller sample size would possibly be better for the active learning performance, because Mask R-CNN would then have more chances to retrain on the images it was uncertain about. A larger sample size will reduce the total sampling time. Four sample sizes were tested: 50, 100, 200, and 400 images. These four sample sizes were considered the most practical in terms of annotation and training time. For all sample sizes, the initial dataset size was 100 images and the maximum number of training images was 2500 images.
The number of sampling iterations for the four sample sizes was respectively, 48, 24, 12, and 6. The performances of the trained Mask R-CNN models were determined on the images of the second test set. The experiment was repeated five times to account for the randomised initial dataset and the randomness in the Monte-Carlo dropout method. A one-way ANOVA with a significance level of 5% was employed for the mAP values to test whether there were significant performance differences between the four sample sizes. The ANOVA was performed on the mAP values that shared a common number of training images (the common numbers were 500, 900, 1300, 1700, 2100, and 2500 images). The ANOVA was not performed on the mAP value of the initial dataset, as this value was the same between the four sample sizes (since the training was performed with the same dropout probability).
Experiment 3 The objective of experiment 3 was to compare the performance of the active learning with the performance of the random sampling. The initial dataset size was 100 images, and both sampling methods used the same sample size that was chosen from experiment 2. The performances of the trained Mask R-CNN models were determined on the images of the third test set. The experiment was repeated five times to account for the randomised initial dataset and the randomness in the Monte-Carlo dropout method. A one-way ANOVA with a significance level of 5% was employed to test whether there were significant performance differences between the active learning and the random sampling. The ANOVA was not performed on the mAP value of the initial dataset, as this value was the same between the two sampling methods (since the training was performed with the same dropout probability).
Performance comparison between active learning and random sampling (experiment 3) Fig. 6  visualises the performance of the active learning and the random sampling for the thirteen sampling iterations (100, 300, …, 2500 sampled images). The coloured areas around the lines represent the 95% confidence intervals around the means. For all sampling iterations, the active learning had a significantly higher mAP than the random sampling (the ANOVA was not performed on the mAP value of the initial dataset (100 images)). The performance differences were between 4. 2 and 8. 3 mAP. Fig. 7  visualises the possible cause of the performance differences. With the random sampling, there was a lower percentage of sampled instances of the four minority classes. As a result, the classification performance on these minority classes was lower.
Discussion By using active learning, the performance of Mask R-CNN improved faster, and thereby the annotation effort could be reduced compared to a random sampling method. Although this outcome was only demonstrated on one dataset, our results suggest that better performance can be achieved when retraining Mask R-CNN on images about which the model was most uncertain. On our class imbalanced dataset, the better performance of the active learning was due to the sampling of a higher fraction of images containing the four minority classes. It was expected that the sampled images had a low semantic certainty due to the difficulty in correctly classifying the class labels. On the other hand, it was probably easier for Mask R-CNN to learn the masks of the five broccoli classes, since they Fig. 6.
Performance means of the active learning (orange line) and the random sampling (blue line). The coloured areas around the lines represent the 95% confidence intervals around the means. For all sampling iterations, the active learning had a significantly higher mAP than the random sampling (the ANOVA was not performed on the mAP value of the initial dataset (100 images)). The black solid line represents the performance of the Mask R-CNN model that was trained on the entire training pool (14,000 images). The black dashed line is an extrapolation of the maximum performance of the random sampling to the performance curve of the active learning. The dashed line can be interpreted as the number of annotated images that could have been saved by the active learning while maintaining the maximum performance of the random sampling.
had a similar shape. As such, the spatial certainty might have been higher. There was probably also a higher occurrence certainty, as the broccoli heads were generally well visible in the image. Thus, in our dataset, the overall image certainty was probably more influenced by the semantic certainty than by spatial or occurrence certainty. This outcome was opposite to López Gómez (2019), who found that the spatial certainty contributed most to the active learning performance. The difference is that López Gómez tested the active learning on a dataset with bicycles and motorcycles, and the shapes of these classes were probably more difficult for Mask R-CNN to learn. Thus, depending on the specific variation and challenges in a dataset, the active learning can emphasise the optimisation of a specific certainty.
Since MaskAL is the first active learning framework with three certainty calculations, we expect that it can also be used on datasets with instances with a difficultto-learn shape or datasets with small and unclear instances. There are several ways in which MaskAL could be further improved. First, weighting factors could be integrated into the certainty equation to tune the relative importance of either semantic, spatial, or occurrence certainty. We believe that this could have improved the MaskAL performance on our broccoli dataset, as prioritisation of semantic certainty could have led to faster optimisation of the classification performance. Second, the dropout can be further optimised. As demonstrated in experiment 1, the choice of the dropout probability had a large influence on the active learning performance.
To choose the optimal dropout  probability on a different dataset, it may be necessary to redo experiment 1, possibly with more than three tested probabilities. However, it is time consuming to conduct such an experiment for every new dataset. Therefore, we recommend investigating whether the concrete dropout method of  Gal et al. (2017)  can be used as an alternative method to automatically optimise the dropout probability during training. After using the concrete dropout method, the optimised dropout probability can be used for sampling, and this might reduce the experimental time and improve the active learning performance. Although our active learning method and dataset were different, it is possible to qualitatively compare our results with those of López Gómez (2019),Van Dijk (2019), and  Wang et al.
Another reason for this outcome was that Van Dijk (2019) performed the image sampling on such small datasets that the added value of the active learning may have been limited (the datasets contained respectively 61 images and 45 images). In the study of  Wang et al. (2020) , the active learning with a learning loss method was compared to random sampling on two medical datasets. On one dataset, the active learning performed better than the random sampling in the first three sampling iterations, while in the last two iterations the performance was equal. On the other dataset, the active learning performed better than the random sampling in all five sampling iterations. Thus, learning loss can be another promising method for active learning, especially because, unlike MaskAL, it can predict the image uncertainty in one forward pass.
In future research, MaskAL should be compared quantitatively to other active learning methods for Mask R-CNN. We also recommend comparing MaskAL's uncertainty sampling with sampling methods other than random sampling, such as diversity sampling or hybrid sampling. Such a comparison could give a better impression of how MaskAL would compare to other more advanced sampling methods. We recommend performing such a comparison on a benchmark dataset, such as Microsoft COCO, because this dataset contains more images and more variation than our broccoli dataset. The potential use of MaskAL is greater than sampling images from a fixed dataset in an offline setting. MaskAL can also be applied to an operational robot to immediately select the images about which Mask R-CNN is most uncertain. This image selection can be done with a fixed threshold on the image certainty value.
Conclusions On our broccoli dataset with five visually similar classes, the active learning with MaskAL performed significantly better than the random sampling. Furthermore, MaskAL had the same performance after sampling 900 images as the random sampling had after sampling 2300 images. This means that by using MaskAL, 1400 annotations could have been saved. Compared to a Mask R-CNN model that was trained on the entire training set (14,000 images), MaskAL achieved 93. 9% of that model's performance with 17. 9% of its training data. In comparison, the random sampling achieved 81. 9% of that model's performance with 16. 4% of its training data. We conclude that by using MaskAL, the annotation effort can be reduced for training Mask R-CNN on a broccoli dataset with visually similar classes. In this paper, MaskAL was used for active learning with the purpose of reducing annotation effort.
The research was performed on a dataset in which all classes were known. We think that MaskAL can also be valuable for selecting unknown classes in open-set learning. Furthermore, MaskAL can also be used as an uncertainty estimator in probabilistic robotic frameworks. Our software is available for such purposes. pool (14,000 images). Eighteen numbers of forward passes (fp) were tested: from 2 to 10 in steps of 1 and from 10 to 100 in steps of 10. For each number of forward pass, the certainty value was calculated on each instance set that was predicted on the images of the first test set. Then, the absolute difference was calculated between that certainty value, c h fp , and the certainty value at 100 forward passes, c h100 , see Eq. A. 1. 100 forward passes was the maximum number that could be performed with our graphical processing unit.