{"id":152,"date":"2026-01-09T10:43:51","date_gmt":"2026-01-09T09:43:51","guid":{"rendered":"https:\/\/hornet-radar.com\/?page_id=152"},"modified":"2026-02-13T09:54:20","modified_gmt":"2026-02-13T08:54:20","slug":"nestlocalization","status":"publish","type":"page","link":"https:\/\/hornet-radar.com\/en\/information\/nestlocalization","title":{"rendered":"Nest localization"},"content":{"rendered":"\n<p class=\"has-medium-font-size\">How the hornet nest localization works using Bait-Stations?<\/p>\n\n\n\n<p>The principle is simple: hornets detect the station, fly to it, collect enough food, and then return directly to their nest. Hornets aren\u2019t \u201cflower-faithful\u201d 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.<\/p>\n\n\n\n<p>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\u2019s flight range can vary depending on the season and can be manually adjusted with a slider.<\/p>\n\n\n\n<p>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: <a href=\"https:\/\/hornet-radar.com\/en\/informationen\/bait-station\" data-type=\"page\" data-id=\"153\">Building a Bait-Station<\/a>.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>&#8211; <strong>This is just an idea and must be evaluated<\/strong> &#8211;<\/p>\n\n\n\n<p class=\"has-medium-font-size\">Cluster and mean calculations<\/p>\n\n\n\n<p>The main challenge is to detect clusters\u2014representing potential nest locations\u2014and 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.<\/p>\n\n\n\n<p>A simple arithmetic mean is unsuitable for angle calculations:<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre> \\frac {10\u00b0+350\u00b0}{2} = 180\u00b0<\/pre><\/div>\n\n\n\n<p>\u2192 a set of directions pointing north can suddenly average to south.<\/p>\n\n\n\n<p>The Idea: Sliding Angular Averages and DBSCAN Clustering<\/p>\n\n\n\n<p>1.) Each measured angle \u03b8 is converted into a unit vector, making it geometrically comparable as a point on the unit circle.<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>v_i = {x_i \\choose y_i} = { cos(\u03b8) \\choose sin(\u03b8)}<\/pre><\/div>\n\n\n\n<p>2.) From these individual vectors over the last <em>x<\/em> weeks, time-based sliding mean vectors are calculated.<br>For example, using a window size of <em>w = 10<\/em> measurements.<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>W_k = \\{v_k, v_{k+1},...,v_{k+w-1}\\}  \\\\ \\ \\\\ \\bar v_k\u200b={\\bar x_k \\choose \\bar y_k} =\\frac 1w \\sum _{i=k}^{k+w-1} {\\bar x_i \\choose \\bar y_i}<\/pre><\/div>\n\n\n\n<p>This results in a reduced and smoothed set of mean vectors.<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>\\phi = \\{\\bar v_1, \\bar v_2,..., \\bar v_w   \\}<\/pre><\/div>\n\n\n\n<p>3.) In addition, we compute the coherence <em>r<\/em> as a quality measure of the flight behavior:<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>r = \\frac {\\sqrt {\\bar x^2 + \\bar y^2}} {n}  <\/pre><\/div>\n\n\n\n<p>r \u2248 1 \u2192 highly directed flight<br>r \u2248 0 \u2192 chaotic or searching flight<\/p>\n\n\n\n<p>4.) Cluster detection is then performed using the <strong>Density-Based Spatial Clustering of Applications with Noise (DBSCAN)<\/strong> algorithm.<br>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.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/a\/af\/DBSCAN-Illustration.svg\" alt=\"\" style=\"aspect-ratio:1.383841249038354;width:295px;height:auto\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-center has-x-small-font-size\">From Chire &#8211; Eigenes Werk, CC BY-SA 3.0, https:\/\/commons.wikimedia.org\/w\/index.php?curid=17045963<\/p>\n\n\n\n<p>To identify core points (red), only two parameters are required:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>a neighborhood radius <em>\u03b5<\/em><\/li>\n\n\n\n<li>a minimum number of neighbors (<em>minPts<\/em>) needed for a point to be considered dense enough<\/li>\n<\/ul>\n\n\n\n<p>Points within \u03b5 but not dense enough are considered density-reachable (yellow), while outliers (blue) beyond \u03b5 are filtered out.<\/p>\n\n\n\n<p>5.) First, the circular distances between all smoothed mean vectors are calculated.<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>d_{ij} = arccos (\\bar v_i \\cdot \\bar v_j)<\/pre><\/div>\n\n\n\n<p>6.) Then, the \u03b5-neighborhood is evaluated for each vector.<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>N_\\epsilon(i) = \\{j | d_ij \\le \\epsilon \\}<\/pre><\/div>\n\n\n\n<p>7.) A point is considered a core point if it has at least <em>minPts<\/em> neighbors within \u03b5.<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>| N_\\epsilon(i)| \\ge minPts<\/pre><\/div>\n\n\n\n<p>8.)A cluster <em>C<\/em> is defined as the maximal set of points where each point is either:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>a core point, or<\/li>\n\n\n\n<li>reachable from a core point<\/li>\n<\/ul>\n\n\n\n<p>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.<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>\\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)<\/pre><\/div>\n\n\n\n<p>10.) Using the two-argument arctangent (<em>atan2<\/em>), 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.<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>\\bar \u03b8_C=atan2 (\\bar c_y\u200b,\\bar c_x)<\/pre><\/div>\n\n\n\n<p>11.) Finally, the width of the flight corridor is calculated from the 20% and 80% quantiles of all vectors within a cluster.<br>High angular spread results in wider and transparent fan shapes, while low spread produces dense, clearly visible smaller fans on the map.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\">How should this information be used?<\/p>\n\n\n\n<p>Hornet-Radar.com is a monitoring platform designed to assist in locating hornet nests. The decision to remove a nest &#8211; especially in the case of the invasive Asian hornet &#8211; must always be made by trained beekeepers and experts.<\/p>\n\n\n\n<p>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 <strong>BeeWarned<\/strong>: <a href=\"https:\/\/beewarned.de\/index.php#openModal\">https:\/\/beewarned.de\/index.php#openModal<\/a><br><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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\u2019t \u201cflower-faithful\u201d like bees, but they tend to revisit rewarding sites, showing a relatively high degree of site fidelity. While hornets mainly hunt other insects &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/hornet-radar.com\/en\/information\/nestlocalization\" class=\"more-link\">Read more<span class=\"screen-reader-text\"> &#8220;Nest localization&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":139,"menu_order":5,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":"[]"},"class_list":["post-152","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/hornet-radar.com\/en\/wp-json\/wp\/v2\/pages\/152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hornet-radar.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/hornet-radar.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/hornet-radar.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hornet-radar.com\/en\/wp-json\/wp\/v2\/comments?post=152"}],"version-history":[{"count":33,"href":"https:\/\/hornet-radar.com\/en\/wp-json\/wp\/v2\/pages\/152\/revisions"}],"predecessor-version":[{"id":567,"href":"https:\/\/hornet-radar.com\/en\/wp-json\/wp\/v2\/pages\/152\/revisions\/567"}],"up":[{"embeddable":true,"href":"https:\/\/hornet-radar.com\/en\/wp-json\/wp\/v2\/pages\/139"}],"wp:attachment":[{"href":"https:\/\/hornet-radar.com\/en\/wp-json\/wp\/v2\/media?parent=152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}