How the hornet nest localization works using Bait-Stations?
The principle is simple: hornets detect the station, fly to it, collect enough food, and then return directly to their nest. Hornets aren’t “flower-faithful” like bees, but they tend to revisit rewarding sites, showing a relatively high degree of site fidelity. While hornets mainly hunt other insects as a protein source for feeding their brood (especially Asian hornets), they also need sugar-rich liquids, carbohydrates, for adult nutrition.
By using the Bait-Stations, we can capture the approximate approach and departure angles of hornets. After collecting a large amount of data, we can calculate average directions for clusters of flights, which are then used to estimate the nest locations on a map through triangulation from multiple stations. A hornet’s flight range can vary depending on the season and can be manually adjusted with a slider.
Hornet queens begin nest building in early May, and the first workers emerge by early June. This is why we deploy the monitoring stations around this time, to locate primary nests as early as possible. The stations are aligned to the north using a compass and connected to Wi-Fi. You can find instructions on building the stations and details about their function here: Building a Bait-Station.
All sightings are classified by the Raspberry Pi using a trained YOLOv5 AI model. For positive hornet detections, the system records the approach and departure angles, relevant metadata, and a proof image, which are uploaded to Supabase and stored in a database or storage bucket. Hornet-Radar.com then extracts this data and visualizes it on an interactive map.
– This is just an idea and must be evaluated –
Cluster and mean calculations
The main challenge is to detect clusters—representing potential nest locations—and to calculate a reliable mean flight direction from all recorded events at a Bait-Station. We must expect a high angular spread, as only a few hornets will fly straight back to the nest. Additionally, outliers must be taken into account, such as individuals that leave the station and fly elsewhere rather than returning to the nest.
A simple arithmetic mean is unsuitable for angle calculations:
\frac {10°+350°}{2} = 180°→ a set of directions pointing north can suddenly average to south.
The Idea: Sliding Angular Averages and DBSCAN Clustering
1.) Each measured angle θ is converted into a unit vector, making it geometrically comparable as a point on the unit circle.
v_i = {x_i \choose y_i} = { cos(θ) \choose sin(θ)}2.) From these individual vectors over the last x weeks, time-based sliding mean vectors are calculated.
For example, using a window size of w = 10 measurements.
W_k = \{v_k, v_{k+1},...,v_{k+w-1}\} \\ \ \\ \bar v_k={\bar x_k \choose \bar y_k} =\frac 1w \sum _{i=k}^{k+w-1} {\bar x_i \choose \bar y_i}This results in a reduced and smoothed set of mean vectors.
\phi = \{\bar v_1, \bar v_2,..., \bar v_w \}3.) In addition, we compute the coherence r as a quality measure of the flight behavior:
r = \frac {\sqrt {\bar x^2 + \bar y^2}} {n} r ≈ 1 → highly directed flight
r ≈ 0 → chaotic or searching flight
4.) Cluster detection is then performed using the Density-Based Spatial Clustering of Applications with Noise (DBSCAN) algorithm.
Since the number of clusters is unknown beforehand, DBSCAN has a decisive advantage over methods like k-means. It can also identify and exclude outliers (noise) or return them separately.
From Chire – Eigenes Werk, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=17045963
To identify core points (red), only two parameters are required:
- a neighborhood radius ε
- a minimum number of neighbors (minPts) needed for a point to be considered dense enough
Points within ε but not dense enough are considered density-reachable (yellow), while outliers (blue) beyond ε are filtered out.
5.) First, the circular distances between all smoothed mean vectors are calculated.
d_{ij} = arccos (\bar v_i \cdot \bar v_j)6.) Then, the ε-neighborhood is evaluated for each vector.
N_\epsilon(i) = \{j | d_ij \le \epsilon \}7.) A point is considered a core point if it has at least minPts neighbors within ε.
| N_\epsilon(i)| \ge minPts
8.)A cluster C is defined as the maximal set of points where each point is either:
- a core point, or
- reachable from a core point
9.) For each cluster, a cluster mean vector is calculated from all vectors belonging to that cluster and normalized to unit length, since only the direction is relevant.
\bar v_C = \frac {1}{\vert C\vert} \sum_{i \in C} \bar v_i \\ \ \\ \hat c_C = \frac {c_C}{||c_C||} = \Biggl(\frac{x}{\sqrt {x^2 +y^2}},\frac{y}{\sqrt {x^2 +y^2}}\Biggl)10.) Using the two-argument arctangent (atan2), the normalized cluster vector is converted back into a single cluster angle. This angle is valid across all four quadrants and is drawn on the map with a fixed length representing the average hornet flight range.
\bar θ_C=atan2 (\bar c_y,\bar c_x)
11.) Finally, the width of the flight corridor is calculated from the 20% and 80% quantiles of all vectors within a cluster.
High angular spread results in wider and transparent fan shapes, while low spread produces dense, clearly visible smaller fans on the map.
How should this information be used?
Hornet-Radar.com is a monitoring platform designed to assist in locating hornet nests. The decision to remove a nest – especially in the case of the invasive Asian hornet – must always be made by trained beekeepers and experts.
However, anyone can help with the time-consuming task of locating nests. If a nest is found, a photo can be submitted to the official reporting platforms of their country / states. For Germany, an overview is available on the official Bavarian reporting platform BeeWarned: https://beewarned.de/index.php#openModal