## 2 Materials and Methods
### Bee Motion Counting and Image Data
#### 2.2.2 BEE1 Dataset  
The first dataset of 54,382 labeled images for this investigation, henceforth referred to as BEE1, was obtained from the videos captured by four BeePi monitors placed on four Langstroth hives with Italian honeybee colonies. Two monitors were deployed in an apiary in North Logan, UT, USA (41.7694\({}^{\circ}\) N, 111.8047\({}^{\circ}\) W) and the other two in an apiary in Logan, UT, USA (41.7370\({}^{\circ}\) N, 111.8338\({}^{\circ}\) W) from April 2017 to September 2017. The two apiaries were approximately 17 km apart. All four honeybee colonies were hired by the first author in late April 2017. We refer to the two hives with BeePi monitors in the first apiary (North Logan) as M\({}^{1}_{17}\) and M\({}^{2}_{17}\) and to the two hives with BeePi monitors in the second apiary (Logan) as M\({}^{3}_{17}\) and M\({}^{4}_{17}\). (The superscripts refer to monitor numbers; the subscripts refer to year 2017.) M\({}^{1}_{17}\) and M\({}^{2}_{17}\) were approximately 10 m apart with M\({}^{1}_{17}\) facing west and M\({}^{2}_{17}\) facing east. M\({}^{1}_{17}\) was under a tree immediately to the north of it and received sunlight only from 15:00 to 18:30. M\({}^{2}_{17}\) had no trees around it. M\({}^{3}_{17}\) and M\({}^{4}_{17}\) were completely under trees with only occasional sun rays penetrating the foliage. Each video had a resolution of 360 \(\times\) 240 with a frame rate of \(\approx\)25 frames per second. We randomly selected 40 videos from June 2017 and July 2017 and then sampled 400 frames from each video. Each selected frame was segmented into 32 \(\times\) 32 images by randomly selecting the start and end coordinates of each region. This image segmentation process generated a total of 54,382 32 \(\times\) 32 images. We used this image curation process, because, in 2017, motion detection was not yet integrated into the BeePi video analysis algorithm. Instead, a window-sliding approach was used on each frame. We obtained the ground truth classification for BEE1 by manually labeling the 54,382 32 \(\times\) 32 images with two categories--BEE (if it contained at least one bee) or NO-BEE (if it contained no bees or only a small part of a bee). The image dataset from the apiary in North Logan, UT (i.e., M\({}^{1}_{17}\) and M\({}^{2}_{17}\)) was used for validation. The image dataset from the apiary in Logan, UT (i.e., from M\({}^{3}_{17}\) and M\({}^{4}_{17}\)) was used for model training and testing. In BEE1, no differentiation was made between 1-superand 2-super images. Figure 6 shows a sample of images from BEE1. There were 19,082 BEE and 19,057 NO-BEE images randomly selected for training, 6362 BEE and 6362 NO-BEE images randomly selected for testing, and 1801 BEE and 1718 NO-BEE images randomly selected for validation. We executed the MANOVA [54] analysis of BEE1 to determine whether its training (class 0), testing (class 1), and validation (class 2) images are statistically significantly different. We used the following image features as independent variables in our analysis: contrast [55], energy [56], and homogeneity [57]. The dependent variables were class 0, class 1, and class 2. The MANOVA analysis gave the Pillai coefficient of 0.018588, the \(F\) value of 107.47, and \(Pr(>F)<2.2\times 10^{-16}\). Since the \(p\)-value is \(<\)0.05, the training, testing and validation datasets of BEE1 are significantly different in terms of contrast, energy, and homogeneity. We would like to note in passing that, while some publications that evaluate various data classification models split their data into training and testing datasets, we prefer to split our data into training, testing, and validation datasets that are statistically significantly different from each other according to the MANOVA analysis. This three-way splitting of the data lowers the chances of the training and testing datasets having a non-empty intersection with the validation dataset. The training and testing datasets are used for model training and testing (i.e., evaluation).