# Performance Evaluation of Classification Algorithms to Detect Bee Swarming Events Using Sound
###### Abstract  
This paper presents a machine-learning approach for detecting swarming events. Three different classification algorithms are tested: The k-Nearest Neighbors algorithm (k-NN) and Support Vector Machine (SVM), and a newly proposed by the authors, U-Net Convolutional Neural Network (CNN), developed for biomedical image segmentation. Next, the authors present their experimental scenario of collecting audio data of swarming and non-swarming events and evaluating the results from the k-NN and SVM classifiers and their proposed CNN algorithm. Finally, the authors compare these three methods and present the cross-comparison results of the optimal method for early and late/close-to-the-event detection of swarming.  
beekeeping; bee swarming; decision support systems; IoT; sound analysis; data analysis; classification algorithms; convolutional neural networks +
Footnote †: journal:  
also limited. This causes the bees to flap their wings (buzzing) at a frequency of about 250 Hz [8]. This increases in intensity, day by day, until the day of swarming.  
Swarming events are periodical events that occur mainly in spring and, occasionally, in the first two months of autumn. Swarming events mainly occur on stressed colonies and are hard to detect by the non-experienced eye. The detection of swarming events can be placed into two distinct categories, early and close-to-the-event (late) detection. Early detection is performed 10-15 days before the event, while late detection is performed up to 2-5 days before the event. The difference between those two detection types is in the apiary practices used. Early detection interventions involve the destruction of the newly formed queen-bee cells and the prevention of swarming; while late detection leads to a definite swarming event, which may be desired or not, and the interventions involve close observation and capture of the abandoning swarm. There is also real-time event detection, which most existing apiary IoT sensory systems and implemented algorithms support. Real-time detection is the detection of swarming during the event or a few hours before the event's occurrence.  
Existing IoT monitoring systems, including sensors of temperature, humidity, and sound amplitude (in dB), cannot detect swarming events early. Nevertheless, they can spot the swarming initiation processes (real-time detection) due to the associated humidity and temperature variations. The same applies to weight scales and external cameras monitoring beehive entrances. Specifically, weight scales and cameras can mainly record the swarming incidents during or after the event, significantly reducing the time for interventions. In conclusion, the most capable sensor for accurate late and early detection is sound recording microphones in the bees' acoustic frequency range, which will be described in the next section.  
This paper evaluates existing classification algorithms using sound provided by custom IoT devices with microphones constructed for this purpose. The rest of this manuscript is organized as follows. Section 2 contains the related work on existing systems and sound analysis methods used to detect swarming events. Section 3 contains the materials and methods used for detecting swarming. Section 4 includes the authors' evaluation of the U-Net CNN, k-NN, and SVM classifiers. Finally, Section 5 concludes the paper.