{"id":107,"date":"2025-04-13T21:47:19","date_gmt":"2025-04-13T19:47:19","guid":{"rendered":"https:\/\/colline3.house\/?p=107"},"modified":"2025-04-13T22:04:28","modified_gmt":"2025-04-13T20:04:28","slug":"gallussense-machine-learning-audio-streaming-et-cocoricos","status":"publish","type":"post","link":"https:\/\/colline3.house\/?p=107","title":{"rendered":"GallusSense: machine learning, audio streaming\u2026 et cocoricos"},"content":{"rendered":"\n<p>\ud83d\udc47 <a href=\"#english\" data-type=\"internal\" data-id=\"#english\">English version<\/a><\/p>\n\n\n\n<p>Dans la s\u00e9rie des projets domotiques un peu atypiques, en voici un qui m\u00eale&nbsp;<strong>machine learning, streaming audio et gallinac\u00e9s<\/strong>&nbsp;: <strong>GallusSense<\/strong>, un syst\u00e8me que j\u2019ai d\u00e9velopp\u00e9 pour d\u00e9tecter en temps r\u00e9el les chants de coq.<\/p>\n\n\n\n<p class=\"is-style-text-subtitle is-style-text-subtitle--1\">Pourquoi ?<\/p>\n\n\n\n<p>Les coqs de notre quartier ont un certain succ\u00e8s dans le voisinage ! J\u2019ai eu envie de<strong> comptabiliser<\/strong> leurs cris, juste pour le plaisir, et de voir s\u2019il \u00e9tait possible d\u2019en tirer des statistiques int\u00e9ressantes : heures de chant, fr\u00e9quence, intensit\u00e9\u2026<\/p>\n\n\n\n<p class=\"is-style-text-subtitle is-style-text-subtitle--2\">Premi\u00e8re approche : BirdNET-Pi<\/p>\n\n\n\n<p>Ma premi\u00e8re id\u00e9e a \u00e9t\u00e9 d\u2019utiliser&nbsp;<a href=\"https:\/\/www.birdweather.com\/birdnetpi\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>BirdNET-Pi<\/strong><\/a>, un projet open-source tr\u00e8s complet bas\u00e9 sur le mod\u00e8le BirdNET d\u00e9velopp\u00e9 par l\u2019universit\u00e9 de Cornell. Il permet de d\u00e9tecter et classifier automatiquement les chants d\u2019oiseaux \u00e0 partir de flux audio.<\/p>\n\n\n\n<p>\ud83e\udde9 J\u2019ai opt\u00e9 pour la <a href=\"https:\/\/github.com\/alexbelgium\/hassio-addons\/blob\/master\/birdnet-pi\/README_standalone.md\" target=\"_blank\" rel=\"noreferrer noopener\">version&nbsp;<strong>Docker<\/strong><\/a>&nbsp;(plus rapide \u00e0 d\u00e9ployer sur mon homelab que l\u2019image RPi bare metal), en utilisant un flux <strong>RTSP<\/strong>&nbsp;provenant d\u2019une&nbsp;<strong>cam\u00e9ra IP Reolink<\/strong>&nbsp;install\u00e9e dans le jardin.<\/p>\n\n\n\n<h4 class=\"wp-block-heading is-style-text-subtitle is-style-text-subtitle--3\">Adapter BirdNET pour un coq domestique<\/h4>\n\n\n\n<p>Le&nbsp;<strong>coq domestique<\/strong>&nbsp;est une sous-esp\u00e8ce du coq bankiva, appel\u00e9e&nbsp;<em>Gallus gallus domesticus<\/em>. BirdNET s\u2019appuie sur une base de donn\u00e9es ax\u00e9e sur les esp\u00e8ces&nbsp;<strong>sauvages<\/strong>, et ne distingue pas clairement entre&nbsp;<em>Gallus gallus<\/em>&nbsp;(le coq bankiva d\u2019Asie du Sud-Est) et sa version domestiqu\u00e9e que l\u2019on conna\u00eet dans nos campagnes.<\/p>\n\n\n\n<p>R\u00e9sultat : comme BirdNET suppose que&nbsp;<em>Gallus gallus<\/em>&nbsp;est un oiseau sauvage&nbsp;<strong>rare en Belgique<\/strong>, il a tendance \u00e0&nbsp;<strong>rejeter<\/strong>&nbsp;ce type de d\u00e9tection par d\u00e9faut \u2014 m\u00eame si un coq bien r\u00e9el (<em>Gallus gallus domesticus<\/em>) chante \u00e0 plein poumon dans le quartier.<\/p>\n\n\n\n<p>Pour obtenir des r\u00e9sultats r\u00e9ellement exploitables, j\u2019ai d\u00fb&nbsp;<strong>ajuster deux param\u00e8tres cl\u00e9s<\/strong>&nbsp;dans BirdNET-Pi :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>D\u2019abord, j\u2019ai fix\u00e9 le&nbsp;<strong>Species Occurrence Frequency Threshold<\/strong>&nbsp;\u00e0&nbsp;<code>0.0005<\/code>&nbsp;\u2014 la valeur minimale possible \u2014 pour \u00e9viter que BirdNET&nbsp;<strong>\u00e9carte automatiquement les d\u00e9tections de&nbsp;<em>Gallus gallus<\/em><\/strong>, jug\u00e9es peu probables dans ma r\u00e9gion.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"409\" src=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-2-1024x409.png\" alt=\"\" class=\"wp-image-110\" srcset=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-2-1024x409.png 1024w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-2-300x120.png 300w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-2-768x306.png 768w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-2-1536x613.png 1536w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-2-2048x817.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ensuite, j\u2019ai utilis\u00e9 une&nbsp;<strong>Custom Species List<\/strong>, ne contenant&nbsp;<strong>que&nbsp;<em>Gallus gallus<\/em><\/strong>&nbsp;(le coq bankiva), afin de&nbsp;<strong>filtrer toutes les autres esp\u00e8ces<\/strong>&nbsp;et r\u00e9duire les faux positifs.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"772\" src=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image.png\" alt=\"\" class=\"wp-image-108\" srcset=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image.png 940w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-300x246.png 300w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-768x631.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading is-style-text-subtitle is-style-text-subtitle--4\">Des r\u00e9sultats prometteurs\u2026 mais limit\u00e9s<\/h4>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"780\" src=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-7-1024x780.png\" alt=\"\" class=\"wp-image-128\" srcset=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-7-1024x780.png 1024w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-7-300x228.png 300w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-7-768x585.png 768w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-7-1536x1170.png 1536w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-7-2048x1560.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>R\u00e9sultat :&nbsp;<strong>\u00e7a marchait<\/strong>, mais&nbsp;<strong>pas parfaitement<\/strong>. Tous les chants n\u2019\u00e9taient pas d\u00e9tect\u00e9s, et le&nbsp;<strong>taux de confiance d\u00e9passait rarement 80\u202f%<\/strong>, m\u00eame avec un coq bien actif \u00e0 quelques m\u00e8tres.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"944\" height=\"611\" src=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-4.png\" alt=\"\" class=\"wp-image-112\" srcset=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-4.png 944w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-4-300x194.png 300w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-4-768x497.png 768w\" sizes=\"auto, (max-width: 944px) 100vw, 944px\" \/><\/figure>\n\n\n\n<p>Et surtout,&nbsp;<strong>l\u2019interface ne me convenait pas<\/strong>&nbsp;: pens\u00e9e pour l\u2019observation ornithologique, elle est tr\u00e8s compl\u00e8te mais pas vraiment adapt\u00e9e \u00e0&nbsp;<strong>la d\u00e9tection d\u2019une seule esp\u00e8ce<\/strong>&nbsp;dans un cadre domestique \u2014 encore moins pour un usage un peu ludique ou statistique.<\/p>\n\n\n\n<p>Cela dit,&nbsp;<strong>BirdNET-Pi reste un excellent projet<\/strong>, id\u00e9al pour <strong>identifier les oiseaux pr\u00e9sents dans un jardin<\/strong>, et je le recommande sans h\u00e9siter \u00e0 tous les curieux de biodiversit\u00e9 locale.<\/p>\n\n\n\n<p class=\"is-style-text-subtitle is-style-text-subtitle--5\">Cr\u00e9er GallusSense<\/p>\n\n\n\n<p>C\u2019est \u00e0 ce moment-l\u00e0 que j\u2019ai d\u00e9cid\u00e9 de d\u00e9velopper GallusSense, une solution 100\u202f% d\u00e9di\u00e9e \u00e0 un seul objectif : d\u00e9tecter les cocoricos en temps r\u00e9el.<\/p>\n\n\n\n<p>Comment \u00e7a fonctionne ?<\/p>\n\n\n\n<p>GallusSense repose sur une architecture simple et locale :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Il r\u00e9cup\u00e8re un&nbsp;<strong>flux audio en direct (RTSP)<\/strong>&nbsp;depuis une cam\u00e9ra IP ou un micro r\u00e9seau.<\/li>\n\n\n\n<li>Il&nbsp;<strong>analyse le signal audio en continu<\/strong>&nbsp;\u00e0 l\u2019aide de la biblioth\u00e8que Python&nbsp;<code>librosa<\/code>.<\/li>\n\n\n\n<li>Il en extrait des&nbsp;<strong>caract\u00e9ristiques MFCC<\/strong>&nbsp;(Mel Frequency Cepstral Coefficients), couramment utilis\u00e9es en reconnaissance audio.<\/li>\n\n\n\n<li>Il passe ces donn\u00e9es \u00e0 un&nbsp;<strong>mod\u00e8le de machine learning entra\u00een\u00e9 maison<\/strong>, sp\u00e9cifiquement con\u00e7u pour reconna\u00eetre les chants de coq.<\/li>\n\n\n\n<li>Chaque d\u00e9tection est&nbsp;<strong>enregistr\u00e9e dans une base SQLite<\/strong>.<\/li>\n\n\n\n<li>Le tout est visualis\u00e9 dans une interface&nbsp;<strong>Streamlit<\/strong>, avec&nbsp;<strong>statistiques, courbes et visualisations en temps r\u00e9el<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p>\ud83c\udfaf Le mod\u00e8le est&nbsp;<strong>rapide, local et bien adapt\u00e9 \u00e0 mon environnement sonore<\/strong>. R\u00e9sultat :&nbsp;<strong>d\u00e9tections fiables<\/strong>, tr\u00e8s peu de faux positifs, et surtout une interface beaucoup plus pertinente pour un usage personnel, simple et visuel.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"563\" src=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-5-1024x563.png\" alt=\"\" class=\"wp-image-113\" srcset=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-5-1024x563.png 1024w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-5-300x165.png 300w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-5-768x422.png 768w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-5-1536x844.png 1536w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-5-2048x1126.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"451\" src=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-6-1024x451.png\" alt=\"\" class=\"wp-image-114\" srcset=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-6-1024x451.png 1024w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-6-300x132.png 300w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-6-768x339.png 768w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-6-1536x677.png 1536w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-6-2048x903.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"720\" style=\"aspect-ratio: 1280 \/ 720;\" width=\"1280\" autoplay controls loop src=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/GallusSense_backend.mp4\"><\/video><\/figure>\n\n\n\n<h4 class=\"wp-block-heading is-style-text-subtitle is-style-text-subtitle--6\">En savoir plus<\/h4>\n\n\n\n<p>Si le projet vous intrigue ou vous amuse autant que moi, tout est disponible ici : <br>\ud83d\udce6&nbsp;<strong>Repository GitHub<\/strong>&nbsp;:&nbsp;<a href=\"https:\/\/github.com\/dafal\/gallussense\" target=\"_blank\" rel=\"noreferrer noopener\">github.com\/dafal\/gallussense<\/a><\/p>\n\n\n\n<p>Et pour voir le syst\u00e8me en action, je l&rsquo;ai mis en ligne :<br>\ud83d\udd0e&nbsp;&nbsp;<a href=\"https:\/\/gallussense.dafriser.be\/\" target=\"_blank\" rel=\"noreferrer noopener\">gallussense.dafriser.be<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-xx-large-font-size\" id=\"english\">GallusSense: machine learning, audio streaming\u2026 and roosters<\/h3>\n\n\n\n<p>Among my more unusual smart home projects, here\u2019s one that combines&nbsp;<strong>machine learning, audio streaming, and poultry<\/strong>:&nbsp;<strong>GallusSense<\/strong>, a system I built to detect rooster crowing in real time.<\/p>\n\n\n\n<h4 class=\"wp-block-heading is-style-text-subtitle is-style-text-subtitle--7\">Why ?<\/h4>\n\n\n\n<p>The roosters in our neighborhood have become a bit of a hit with the locals! I thought it would be fun to&nbsp;<strong>keep track of their crowing<\/strong>, just for curiosity\u2019s sake \u2014 and maybe pull out some interesting stats: peak hours, frequency, intensity&#8230;<\/p>\n\n\n\n<h4 class=\"wp-block-heading is-style-text-subtitle is-style-text-subtitle--8\">First attempt: BirdNET-Pi<\/h4>\n\n\n\n<p>My first idea was to try&nbsp;<a href=\"https:\/\/www.birdweather.com\/birdnetpi\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>BirdNET-Pi<\/strong><\/a>, a well-documented open-source project based on Cornell University\u2019s BirdNET model. It can detect and classify bird sounds from an audio stream.<\/p>\n\n\n\n<p>\ud83e\udde9 I deployed the&nbsp;<strong><a href=\"https:\/\/github.com\/alexbelgium\/hassio-addons\/blob\/master\/birdnet-pi\/README_standalone.md\" target=\"_blank\" rel=\"noreferrer noopener\">Docker version<\/a><\/strong>&nbsp;(quicker to get up and running on my homelab than the bare-metal RPi image), using an&nbsp;<strong>RTSP audio feed<\/strong>&nbsp;from a&nbsp;<strong>Reolink IP camera<\/strong>&nbsp;placed in the garden.<\/p>\n\n\n\n<h4 class=\"wp-block-heading is-style-text-subtitle is-style-text-subtitle--9\">Adapting BirdNET to a domestic rooster<\/h4>\n\n\n\n<p>The&nbsp;<strong>domestic rooster<\/strong>&nbsp;is a subspecies of the red junglefowl, known by its scientific name&nbsp;<em>Gallus gallus domesticus<\/em>. BirdNET, however, relies on a taxonomy focused on&nbsp;<strong>wild species<\/strong>, and doesn\u2019t really distinguish between&nbsp;<em>Gallus gallus<\/em>(the junglefowl native to Southeast Asia) and the familiar backyard rooster we all know.<\/p>\n\n\n\n<p>As a result, BirdNET assumes&nbsp;<em>Gallus gallus<\/em>&nbsp;is&nbsp;<strong>unlikely to be found in Belgium<\/strong>, and therefore tends to&nbsp;<strong>discard any detection<\/strong>&nbsp;by default \u2014 even if a very real&nbsp;<em>Gallus gallus domesticus<\/em>&nbsp;is crowing loudly right outside.<\/p>\n\n\n\n<h4 class=\"wp-block-heading is-style-text-subtitle is-style-text-subtitle--10\">Tuning BirdNET-Pi<\/h4>\n\n\n\n<p>To get any usable results, I had to tweak&nbsp;<strong>two key parameters<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>I set the&nbsp;<strong>Species Occurrence Frequency Threshold<\/strong>&nbsp;to&nbsp;<code>0.0005<\/code>&nbsp;\u2014 the lowest value allowed \u2014 so BirdNET wouldn&rsquo;t automatically discard&nbsp;<em>Gallus gallus<\/em>&nbsp;detections as improbable.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"409\" src=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-2-1024x409.png\" alt=\"\" class=\"wp-image-110\" srcset=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-2-1024x409.png 1024w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-2-300x120.png 300w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-2-768x306.png 768w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-2-1536x613.png 1536w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-2-2048x817.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>I also used a&nbsp;<strong>Custom Species List<\/strong>&nbsp;containing&nbsp;<strong>only&nbsp;<em>Gallus gallus<\/em><\/strong>&nbsp;(the red junglefowl), to focus the detection and eliminate background noise from other birds.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"772\" src=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image.png\" alt=\"\" class=\"wp-image-108\" srcset=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image.png 940w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-300x246.png 300w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-768x631.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading is-style-text-subtitle is-style-text-subtitle--11\">Promising results\u2026 with limitations<\/h4>\n\n\n\n<p>It worked \u2014&nbsp;<strong>sort of<\/strong>. Not all crows were detected, and&nbsp;<strong>confidence rarely exceeded 80%<\/strong>&nbsp;even with a very vocal rooster just meters.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"780\" src=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-7-1024x780.png\" alt=\"\" class=\"wp-image-128\" srcset=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-7-1024x780.png 1024w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-7-300x228.png 300w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-7-768x585.png 768w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-7-1536x1170.png 1536w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-7-2048x1560.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"944\" height=\"611\" src=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-4.png\" alt=\"\" class=\"wp-image-112\" srcset=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-4.png 944w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-4-300x194.png 300w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-4-768x497.png 768w\" sizes=\"auto, (max-width: 944px) 100vw, 944px\" \/><\/figure>\n\n\n\n<p>More importantly, the&nbsp;<strong>interface wasn\u2019t ideal<\/strong>: great for ornithology, not so much for tracking a single species or for a playful, home-use case.<\/p>\n\n\n\n<p>That said,&nbsp;<strong>BirdNET-Pi is an excellent project<\/strong>&nbsp;for identifying wild birds in your area, and I highly recommend it for garden biodiversity enthusiasts.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Building GallusSense<\/h3>\n\n\n\n<p>That\u2019s when I decided to build my own system \u2014&nbsp;<strong>GallusSense<\/strong>, focused on one thing only:&nbsp;<strong>detecting roosters in real time<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading is-style-text-subtitle is-style-text-subtitle--12\">How it works<\/h4>\n\n\n\n<p>GallusSense is a lightweight, local solution. It:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>grabs a&nbsp;<strong>live RTSP audio stream<\/strong>&nbsp;from an IP camera or network mic;<\/li>\n\n\n\n<li><strong>processes the audio stream<\/strong>&nbsp;continuously using&nbsp;<code>librosa<\/code>;<\/li>\n\n\n\n<li>extracts&nbsp;<strong>MFCC audio features<\/strong>;<\/li>\n\n\n\n<li>feeds them into a&nbsp;<strong>custom-trained machine learning model<\/strong>&nbsp;that recognizes rooster crows;<\/li>\n\n\n\n<li>logs each detection in a&nbsp;<strong>SQLite database<\/strong>;<\/li>\n\n\n\n<li>displays everything in a&nbsp;<strong>Streamlit dashboard<\/strong>, with real-time stats and visualizations.<\/li>\n<\/ul>\n\n\n\n<p>\ud83c\udfaf The model is&nbsp;<strong>fast, local, and tailored to my environment<\/strong>. It gives&nbsp;<strong>reliable detections<\/strong>, very few false positives, and a much more usable interface for simple monitoring.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"563\" src=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-5-1024x563.png\" alt=\"\" class=\"wp-image-113\" srcset=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-5-1024x563.png 1024w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-5-300x165.png 300w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-5-768x422.png 768w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-5-1536x844.png 1536w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-5-2048x1126.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"451\" src=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-6-1024x451.png\" alt=\"\" class=\"wp-image-114\" srcset=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-6-1024x451.png 1024w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-6-300x132.png 300w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-6-768x339.png 768w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-6-1536x677.png 1536w, https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/image-6-2048x903.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"720\" style=\"aspect-ratio: 1280 \/ 720;\" width=\"1280\" autoplay controls loop src=\"https:\/\/colline3.house\/wp-content\/uploads\/2025\/04\/GallusSense_backend.mp4\"><\/video><\/figure>\n\n\n\n<h4 class=\"wp-block-heading is-style-text-subtitle is-style-text-subtitle--13\">Learn more<\/h4>\n\n\n\n<p>If you\u2019re curious (or amused) by the idea, the whole project is on Github:<br>\ud83d\udce6&nbsp;<strong>GitHub repo<\/strong>:&nbsp;<a href=\"https:\/\/github.com\/dafal\/gallussense\" target=\"_blank\" rel=\"noreferrer noopener\">github.com\/dafal\/gallussense<\/a><\/p>\n\n\n\n<p>And for a live view of it in action:<br>\ud83d\udd0e&nbsp; <a href=\"https:\/\/gallussense.dafriser.be\/\" target=\"_blank\" rel=\"noreferrer noopener\">gallussense.dafriser.be<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dans la s\u00e9rie des projets domotiques un peu atypiques, en voici un qui m\u00eale\u00a0machine learning, streaming audio et gallinac\u00e9s\u00a0: GallusSense, un syst\u00e8me que j\u2019ai d\u00e9velopp\u00e9 pour d\u00e9tecter en temps r\u00e9el les chants de coq.<\/p>\n","protected":false},"author":1,"featured_media":123,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"categories":[22],"tags":[31,33,32],"class_list":["post-107","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-maison","tag-gallussense","tag-ml","tag-reolink"],"_links":{"self":[{"href":"https:\/\/colline3.house\/index.php?rest_route=\/wp\/v2\/posts\/107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/colline3.house\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/colline3.house\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/colline3.house\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/colline3.house\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=107"}],"version-history":[{"count":12,"href":"https:\/\/colline3.house\/index.php?rest_route=\/wp\/v2\/posts\/107\/revisions"}],"predecessor-version":[{"id":129,"href":"https:\/\/colline3.house\/index.php?rest_route=\/wp\/v2\/posts\/107\/revisions\/129"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/colline3.house\/index.php?rest_route=\/wp\/v2\/media\/123"}],"wp:attachment":[{"href":"https:\/\/colline3.house\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/colline3.house\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/colline3.house\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}