A silkworm body recognition method and system based on yolo

CN122176754APending Publication Date: 2026-06-09HECHI CITY METEOROLOGICAL BUREAU OF GUANGXI ZHUANG AUTONOMOUS REGION

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HECHI CITY METEOROLOGICAL BUREAU OF GUANGXI ZHUANG AUTONOMOUS REGION
Filing Date
2026-01-31
Publication Date
2026-06-09

Smart Images

  • Figure CN122176754A_ABST
    Figure CN122176754A_ABST
Patent Text Reader

Abstract

The application provides a silkworm body recognition method and system based on yolo, and belongs to the field of silkworm body recognition.The method comprises the following steps: constructing an adaptive detection model based on several scales of improved YOLO dense scenes, performing several target tracking and behavior quantification based on the detection results of YOLO, constructing an early warning model based on several modal time series graph neural networks, and data closed loop and model evolution recognition.Deploying a spectral sensing network, taking the improved YOLO technology as the core, a cascaded adaptive detection and tracking algorithm for dense, multi-scale and unstructured breeding scenes is developed, and an innovative behavioromics early warning model based on multi-modal time series and space-time graph neural network (ST-GCN) is established.The technical scheme quantifies the growth indicators of silkworms, analyzes abnormal behavior patterns, and forecasts disease transmission risks, fundamentally changing the current situation of traditional silkworm breeding relying on manual experience and disease response lag.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of silkworm body recognition, and more particularly to a method and system for recognizing silkworm bodies based on YOLO. Background Technology

[0002] Huanjiang Maonan Autonomous County and Yizhou District in Hechi City, Guangxi Zhuang Autonomous Region, are core production bases for high-quality cocoons and silk in Southwest my country. The sericulture industry accounts for 42% of the local total agricultural output and is the main source of income for over 300,000 farmers. However, the industry currently faces two major bottlenecks: first, the extensive nature of growth monitoring, as manual observation cannot capture the microscopic morphological changes and behavioral rhythm differences of silkworms from the 1st to the 5th instar, resulting in a lack of quantitative analysis of growth status; second, the lag in disease control. Survey data shows that major silkworm diseases (blood-type septicemia, muscardine rot, and viral diseases) cause an annual yield reduction rate of 15%-25%, while diseases are often discovered manually only after they have entered the transmission stage, causing irreversible losses. Therefore, it is necessary to design a YOLO-based silkworm identification method and system to identify silkworm diseases in advance and promptly notify farmers for rescue efforts. Summary of the Invention

[0003] The purpose of this invention is to provide a YOLO-based method and system for identifying silkworm diseases, addressing the technical problem that existing methods often result in irreversible losses due to the disease already being in its transmission stage when diseases are detected manually in silkworm farming. There is a need to design a system that can more accurately detect diseases before clinical symptoms appear, allowing farmers to be notified for prevention and control.

[0004] The urgent need for industrial upgrading is to build intelligent capabilities of "micro-monitoring + forward-looking early warning": it is necessary to achieve accurate identification and continuous tracking of individual silkworms in high-density scenarios, and to issue disease warnings 48-72 hours before clinical symptoms appear through behavioral pattern analysis.

[0005] Three major technical challenges need to be overcome: first, drastic changes in scale (the size of silkworms varies by up to 20 times); second, high-density shading (the accumulation of 5th instar silkworms leads to a shading rate of over 60%); and third, complex environmental interference (significant fluctuations in light intensity, background noise from mulberry leaf veins and silkworm excrement, and the impact of high temperature and humidity in the silkworm rearing room).

[0006] The ability to continuously track individual identities is crucial. In silkworm colonies with highly similar appearances, it is necessary to maintain the identity of each individual over 24 hours, with a trajectory interruption rate of less than 10%, in order to construct a complete growth profile and behavioral spectrum, and provide data support for individual health status assessment.

[0007] The ability to understand the underlying mechanisms, moving beyond the traditional image recognition method of "lesion detection," requires analyzing over 30 quantitative indicators, such as the silkworm's movement rhythm and feeding patterns, to establish a mapping relationship between behavioral characteristics and health status, thereby achieving a mechanism-level understanding of "abnormal behavior → health risk."

[0008] The ability to reason from data to decision requires the integration of multi-source data (visual monitoring data, environmental IoT data) to build a spatiotemporal reasoning model for disease transmission. This model can not only provide early warning of risks but also locate the source of anomalies and potential spread paths, providing a basis for precise prevention and control decisions.

[0009] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0010] A method for identifying YOLO silkworm-like structures, the method comprising the following steps:

[0011] Step 1: Construct an adaptive detection model for dense scenes at several scales based on the improved YOLO;

[0012] Step 2: Perform target tracking and behavior quantification based on the YOLO detection results;

[0013] Step 3: Construct an early warning model based on a multimodal temporal graph neural network;

[0014] Step 4: Data loop closure and model evolution identification.

[0015] Furthermore, in step 1, considering the specific characteristics of silkworm farming, a cascaded adaptive YOLO detection model is constructed based on the YOLOv8 architecture through in-depth customization and optimization, enabling accurate detection at several scales, under high density and strong occlusion conditions.

[0016] Furthermore, in step 1, the specific process of improving YOLO is as follows:

[0017] Step 1.1: Set up an adaptive anchor generation mechanism, abandoning the default general anchor configuration of YOLO. Based on the size statistics of silkworms from the 1st to 5th instar, use the K-means++ clustering algorithm to generate 6 sets of scene-specific anchors, covering the size range of silkworms throughout the entire instar. At the same time, introduce a dynamic anchor matching strategy, adjust the scaling ratio of the anchor in real time according to the target size distribution in the input image, so as to improve the anchor matching degree between the 1st instar silkworm target and the 5th instar silkworm target.

[0018] Step 1.2: Optimization of several scale detection heads. Based on the three-scale detection heads P3, P4, and P5 of YOLOv8, a new high-resolution detection head P2 is added, which is specifically used to capture millimeter-level ant and silkworm feature information. Through the cross-scale feature fusion module, bidirectional interaction of P2-P5 features is realized. Low-level features P2 and P3 provide target edge details, while high-level features P4 and P5 provide semantic information, effectively solving the problems of insufficient feature extraction for small targets and inaccurate localization of large targets.

[0019] Step 1.3: Improved anti-occlusion in dense scenes. To address the occlusion problem caused by the accumulation of 5th instar silkworms, an occlusion perception module is embedded in the YOLO detection head. The occlusion perception module identifies the local visible region of the occluded target by calculating the overlap rate of the target bounding box and the response intensity of the feature map. It strengthens the feature weight of the visible region using an attention mechanism and introduces a context-aware branch to complete the features based on the neighborhood information of the occluded target, thereby improving the detection mAP in occluded scenes.

[0020] Step 1.4: To adapt to edge deployment, the YOLO backbone network is optimized using model pruning and quantization techniques. Redundant convolutional channels are removed through channel pruning, and the model parameter accuracy is reduced from FP32 to INT8 using INT8 quantization. This reduces the model size and improves inference speed, while retaining the YOLO Focus structure and the efficient feature extraction capability of the C2f module. This ensures that high detection accuracy is maintained even after lightweighting, and the single-frame detection time meets the real-time requirements of edge deployment.

[0021] Step 1.5: Using a combination of transfer learning and incremental training, the YOLO backbone network was first pre-trained on a public insect dataset, and then fine-tuned on a silkworm-specific dataset. The loss function used CIoU Loss to optimize bounding box regression, combined with Focal Loss to solve the problem of imbalance between positive and negative samples, and Label Smoothing was introduced to reduce the impact of labeling errors. Finally, the model achieved the required accuracy in detecting silkworms of all ages on the validation set.

[0022] Furthermore, the specific process of step 2 is as follows:

[0023] Based on the improved detection output of YOLO, a spatiotemporal joint embedding tracking algorithm for appearance motion is constructed to achieve continuous tracking of individual trajectories and behavior quantification;

[0024] YOLO detection results post-processing optimizes the bounding boxes output by YOLO by performing non-maximum suppression optimization. Soft-NMS is used instead of traditional NMS. By adaptively adjusting the suppression threshold, the false deletion of targets in dense scenes is reduced, thereby improving the recall rate of the detection boxes. At the same time, a detection box calibration module is introduced to correct the rectangular bounding boxes output by YOLO based on the morphological features of the silkworm body, thereby improving the target localization accuracy.

[0025] Triple feature embedding and association matching, based on the intermediate features of the YOLO backbone network, adds a lightweight metric learning branch and adopts Triplet Loss optimization to extract silkworm appearance feature vectors that are robust to illumination, pose and occlusion, and solve the problem of identifying silkworms with highly similar appearances;

[0026] Motion embedding utilizes the historical trajectory of YOLO detection boxes and predicts the target's motion state through Kalman filtering. The motion state includes position, velocity, and acceleration, which are encoded into motion feature vectors to improve the stability of short-term tracking.

[0027] Spatiotemporal context embedding encodes the location information of the target in the silkworm tray and the distribution relationship of neighboring targets into graph structure features, solving the identity matching problem of target reappearance after occlusion;

[0028] The association matching adopts a cascaded strategy. First, it performs a fast initial matching based on motion features. Then, for ambiguous targets in the initial matching results, it performs a fine matching by combining appearance features and spatiotemporal context features to ensure the accuracy of long-term tracking.

[0029] The behavioral quantification index system, based on stable trajectory data obtained from YOLO detection and tracking, automatically generates multi-dimensional behavioral indicators, including motor indicators, activity rhythms, feeding-related indicators, and social indicators. Motor indicators include instantaneous speed, acceleration, total path length, motion entropy, and turning frequency. Activity rhythms include the percentage of time spent moving / stationary, activity periodicity intensity, and diurnal activity difference coefficient. Feeding-related indicators include the frequency of head orientation towards mulberry leaves, dwell time, and gnawing motion amplitude. Social indicators include average distance between individuals, local density, contact frequency, and aggregation coefficient.

[0030] Furthermore, the specific process of step 3 is as follows:

[0031] Using the morphological and behavioral characteristics output by YOLO detection and tracking as the core input, and combining multispectral appearance features with environmental data, the ST-GCN early warning model is constructed to achieve early warning of diseases.

[0032] Several modal input codes are used to treat each silkworm as a dynamic node. The node features include: morphological features extracted by YOLO detection, several spectral appearance features, and a time sequence of behavioral features obtained by tracking.

[0033] Spatiotemporal graph construction: At each moment, a k-nearest neighbor graph is constructed based on the spatial location of the silkworms. The edge weights in the graph are determined by the distance between individuals and the similarity of their behaviors, representing the potential influence relationships between individuals. The spatiotemporal graph is dynamically updated over time to capture the movement and aggregation changes of the silkworm population.

[0034] The spatial convolutional layer uses a graph convolutional network to aggregate the feature information of neighboring nodes and introduces an attention mechanism to dynamically adjust the weights of neighborhood features, enabling the model to focus on the neighborhood state of abnormal nodes.

[0035] The temporal convolutional layer, which combines one-dimensional convolution with LSTM, captures the evolution pattern of individual node features over time and identifies trend anomalies in behavioral indicators.

[0036] Multi-scale time series fusion extracts short-term, medium-term, and long-term time series features through time windows of different lengths, comprehensively judges the stability of abnormal patterns, and reduces false alarms;

[0037] The early warning decision-making mechanism uses a model to establish a normal pattern baseline distribution on massive healthy silkworm data through self-supervised learning. When running online, it calculates the deviation between the current spatiotemporal map features and the baseline distribution. When the abnormal score exceeds a preset threshold, the system triggers an early warning and outputs: abnormal level, abnormal area location, and potential disease type prediction.

[0038] Furthermore, the specific process of step 4 is as follows:

[0039] The system automatically filters out difficult scenarios with low YOLO detection confidence and easy tracking loss, prioritizes pushing them to expert annotations, supplements the training dataset, and enables incremental learning at the edge. Edge nodes incrementally fine-tune the improved YOLO detection model and tracking algorithm based on locally added annotation data. Knowledge distillation technology is used to retain the generalization ability of the original model and avoid catastrophic forgetting, allowing the model to gradually adapt to the environment and characteristics of specific silkworm rearing rooms. Under the premise of protecting data privacy, the cloud coordinates multiple edge nodes, only exchanging model parameter updates, and jointly training the global YOLO detection model and early warning model. This achieves intelligent co-growth without data leaving the factory, improving the robustness of the model under different farming scenarios.

[0040] A system for identifying silkworm bodies based on the YOLO algorithm includes a terminal perception layer, an edge analysis layer, and a cloud intelligence layer. The terminal perception layer consists of several high-definition cameras installed in the silkworm rearing room. Each camera feeds into a lightweight neural network optimized based on YOLO, responsible for target detection and key feature extraction from the real-time video stream. It also reduces transmission bandwidth usage through efficient data compression technology and uploads the processed data to edge nodes. The edge analysis layer consists of edge computing devices installed in the silkworm rearing room. It aggregates data from several terminals and uses several target tracking models and a primary early warning model based on the YOLO detection results to achieve localized real-time analysis and abnormal event alarms. The aggregated structured data is uploaded to the cloud every minute. The cloud intelligence layer is built on a regional agricultural data center and adopts a distributed cluster architecture. Its functions include full-domain data fusion, iterative training of YOLO detection and early warning models, spatiotemporal correlation analysis, production status visualization, and management suggestion generation.

[0041] The present invention, by adopting the above-described technical solution, has the following beneficial effects:

[0042] This invention deploys a spectral sensing network and develops a cascaded adaptive detection and tracking algorithm based on improved YOLO technology for intensive, multi-scale, and unstructured aquaculture scenarios. It also innovatively establishes a behavioral omics early warning model based on multimodal time series and spatiotemporal graph neural networks (ST-GCN). This technical solution fundamentally changes the traditional sericulture system's reliance on manual experience and delayed disease response by quantifying silkworm growth indicators, analyzing abnormal behavioral patterns, and anticipating disease transmission risks. It provides a core technological engine for the digital transformation and high-quality development of the sericulture industry in Hechi region (annual breeding scale exceeding 500,000 sheets of silkworm eggs, involving more than 30,000 households), and is expected to reduce disease losses by 15%-20% and increase breeding efficiency by more than 30%. Attached Figure Description

[0043] Figure 1 This is the first diagram showing the initial pathological characteristics of the silkworm body according to the present invention;

[0044] Figure 2 This is the second diagram showing the initial pathological characteristics of the silkworm in this invention;

[0045] Figure 3 This is a later-stage image of the pathological characteristics of the silkworm in this invention;

[0046] Figure 4 This is a diagram showing the initial pathological symptoms of the silkworm in this invention;

[0047] Figure 5 This is a pathological end-stage death diagram of the present invention. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and preferred embodiments. However, it should be noted that many details listed in the specification are merely to provide the reader with a thorough understanding of one or more aspects of the present invention, and these aspects of the invention can be implemented even without these specific details.

[0049] A method for identifying YOLO silkworm bodies, such as Figure 1-5 As shown, the method includes the following steps:

[0050] Step 1: Multi-scale dense scene adaptive detection model based on improved YOLO

[0051] To address the specific challenges of silkworm farming, a cascaded adaptive YOLO detection model (Cascade-AYLO) was developed based on the YOLOv8 architecture and deeply customized and optimized to solve the problem of accurate detection under multi-scale, high-density, and strong occlusion conditions.

[0052] Adaptive Anchor Generation Mechanism: Abandoning YOLO's default generic anchor configuration, this mechanism uses K-means++ clustering to generate six scene-specific anchors (size ratios of 1:1, 1:2, and 2:1) based on the size statistics of silkworms from their 1st to 5th instar stages (2-3mm for the 1st instar to 50-70mm for the 5th instar), covering the entire size range of silkworms throughout their instars. Simultaneously, a dynamic anchor matching strategy is introduced, adjusting the anchor scaling ratio in real-time according to the target size distribution in the input image, improving the anchor matching accuracy between small targets (1st instar silkworms) and large targets (5th instar silkworms) by 35%.

[0053] Multi-scale detection head optimization: Based on the three-scale detection heads (P3, P4, P5) of YOLOv8, a new high-resolution detection head, P2, is added, specifically designed to capture millimeter-level ant and silkworm feature information. A cross-scale feature fusion module (CFM) enables bidirectional interaction between P2 and P5 features. Lower-level features (P2, P3) provide target edge details, while higher-level features (P4, P5) provide semantic information, effectively addressing the issues of insufficient feature extraction for small targets and inaccurate localization of large targets.

[0054] Improved Occlusion Resistance in Dense Scenes: To address the severe occlusion issue caused by the accumulation of 5th instar silkworms, an Occlusion Awareness (OAM) module is embedded into the YOLO detection head. This module identifies the locally visible regions of occluded targets by calculating the overlap rate of the target bounding boxes and the response intensity of the feature maps. It strengthens the feature weights of visible regions using an attention mechanism and introduces a context-aware branch to complete features based on the neighborhood information of the occluded target, resulting in a 28% improvement in detection mAP in occluded scenes.

[0055] Lightweighting and Real-Time Optimization: To adapt to edge deployment, model pruning and quantization techniques were used to optimize the YOLO backbone network. Redundant convolutional channels were removed through channel pruning (30% pruning rate), and INT8 quantization was used to reduce the model parameter accuracy from FP32 to INT8, resulting in a 75% reduction in model size and a 2.3x increase in inference speed. Simultaneously, the YOLO Focus structure and the efficient feature extraction capabilities of the C2f module were retained, ensuring high detection accuracy is maintained even after lightweighting, and the single-frame detection time meets the real-time requirements of edge deployments.

[0056] Customized training strategy: A combination of transfer learning and incremental training was adopted. The YOLO backbone network was first pre-trained on a public insect dataset, and then fine-tuned on a silkworm-specific dataset. CIoU Loss was used to optimize bounding box regression, combined with Focal Loss to address the imbalance between positive and negative samples (negative samples account for over 90% in high-density scenarios). Label Smoothing was introduced to reduce the impact of annotation errors. The final model achieved a 97.8% mAP@0.5 for detecting silkworms of all instars on the validation set, and a 95.2% accuracy for detecting small targets (1st instar silkworms).

[0057] Step 2: Long-term multi-target tracking and behavior quantification based on YOLO detection results

[0058] Based on the improved detection output of YOLO, an appearance-motion-spatiotemporal joint embedding tracking algorithm (AMS-JET) is constructed to achieve continuous tracking of individual trajectories and behavior quantification.

[0059] YOLO detection result post-processing: Non-maximum suppression (NMS) optimization is performed on the bounding boxes output by YOLO. Soft-NMS is used instead of traditional NMS. By adaptively adjusting the suppression threshold (dynamically set from 0.3 to 0.5 according to the target density), false deletion of targets in dense scenes is reduced, improving the recall rate of the detection boxes by 12%. At the same time, a detection box calibration module is introduced to correct the rectangular bounding boxes output by YOLO based on the morphological features (elliptical contour) of the silkworm, improving the target localization accuracy.

[0060] Triple feature embedding and association matching:

[0061] Appearance embedding: Based on the intermediate features of the YOLO backbone network, a lightweight metric learning branch is added and Triplet Loss optimization is adopted to extract a silkworm appearance feature vector (dimensional 256) that is robust to illumination, pose and occlusion, so as to solve the problem of identifying silkworms with highly similar appearances.

[0062] Motion embedding: Utilizing the historical trajectory of YOLO detection boxes, the motion state (position, velocity, acceleration) of the target is predicted by Kalman filtering and encoded into a motion feature vector, thereby improving the stability of short-term tracking.

[0063] Spatiotemporal context embedding: The location information of the target in the silkworm tray and the distribution relationship of neighboring targets are encoded into graph structure features to solve the identity matching problem of target reappearance after occlusion.

[0064] The association matching adopts a cascade strategy: first, a fast initial matching is performed using motion features (with low computational cost), and then a fine matching is performed on the ambiguous targets (with high appearance similarity) in the initial matching results, combining appearance features and spatiotemporal context features to ensure the accuracy of long-term tracking, with an individual identity maintenance rate of ≥90% within 24 hours.

[0065] Behavioral Quantification Indicator System: Based on stable trajectory data obtained from YOLO detection and tracking, multi-dimensional behavioral indicators are automatically generated, including:

[0066] Motion metrics: instantaneous velocity, acceleration, total path length, motion entropy (measures motion randomness), turning frequency;

[0067] Activity rhythm: the percentage of time spent moving / resting per unit of time, the intensity of activity periodicity, and the diurnal activity difference coefficient;

[0068] Feeding-related indicators: frequency of head facing the mulberry leaf, duration of head stay, and amplitude of gnawing movements;

[0069] Social indicators: average distance between individuals, local density, contact frequency, and clustering coefficient.

[0070] Step 3: Early Warning Model Based on Multimodal Temporal Graph Neural Network

[0071] Using the morphological and behavioral characteristics output by YOLO detection and tracking as the core input, and combining multispectral appearance features with environmental data, the ST-GCN early warning model is constructed to achieve early warning of diseases.

[0072] Multimodal input encoding: Each silkworm is regarded as a dynamic node. The node features include: morphological features extracted by YOLO detection (body length, body width, contour compactness, area growth rate), multispectral appearance features (mean and variance of reflectance in 4 bands), and time series of behavioral features obtained by tracking (sliding window statistics of more than 30 behavioral indicators).

[0073] Spatiotemporal graph construction: At each moment, a k-nearest neighbor graph (k=5) is constructed based on the spatial location of the silkworms. The edge weights in the graph are determined by the distance between individuals and the similarity of their behaviors, representing the potential influence relationships between individuals (such as the risk of contact transmission). The spatiotemporal graph is dynamically updated over time to capture the movement and aggregation changes of the silkworm population.

[0074] ST-GCN warning engine optimization:

[0075] Spatial convolutional layer: Graph Convolutional Network (GCN) is used to aggregate the feature information of neighboring nodes. An attention mechanism is introduced to dynamically adjust the weight of neighborhood features, so that the model can focus on the neighborhood state of abnormal nodes (such as the behavioral response of healthy silkworms to diseased silkworms).

[0076] Temporal convolutional layer: It adopts a structure that combines one-dimensional convolution with LSTM to capture the evolution pattern of individual node features over time and identify trend anomalies in behavioral indicators (such as continuous increase in motion entropy and continuous decrease in feeding time).

[0077] Multi-scale time series fusion: Short-term, medium-term and long-term time series features are extracted through time windows of different lengths to comprehensively judge the stability of abnormal patterns and reduce false alarms.

[0078] Early warning decision-making mechanism: The model establishes a "normal pattern" baseline distribution on massive amounts of healthy silkworm data through self-supervised learning. During online runtime, it calculates the deviation (anomaly score) between the current spatiotemporal map features and the baseline distribution. When the anomaly score exceeds a preset threshold, the system triggers an early warning and outputs:

[0079] Anomaly level (low, medium, high);

[0080] Anomaly region localization (based on YOLO detection of spatial coordinates);

[0081] Potential disease type prediction (based on association rules of historical data).

[0082] Step 4: Data Closure and Model Evolution System

[0083] Active learning and difficult example mining: Automatically filter difficult example scenarios with low YOLO detection confidence and easy tracking loss (such as extreme occlusion, dense distribution of first instar ants and silkworms, and morphological mutations during the molting period of silkworms), and push them to experts for annotation to supplement the training dataset.

[0084] Incremental learning at the edge: Edge nodes incrementally fine-tune the improved YOLO detection model and tracking algorithm based on locally labeled data. Knowledge distillation technology is used to retain the generalization ability of the original model, avoid catastrophic forgetting, and enable the model to gradually adapt to the environment and characteristics of specific silkworm rearing rooms.

[0085] Federated learning mechanism: Under the premise of protecting data privacy, the cloud coordinates multiple edge nodes to exchange only model parameter updates (without transmitting raw data) and jointly train the global YOLO detection model and early warning model, so as to achieve "data does not leave the field, intelligence grows together" and improve the robustness of the model in different breeding scenarios.

[0086] Specific Implementation Examples

[0087] Specific implementation and technology adaptation in Huanjiang and Yizhou, localized data collection and benchmark database construction.

[0088] The "Hechi Silkworm Visual Genome" project was launched, collecting over one million images and tens of thousands of hours of video data covering all age stages and physiological states (healthy, early / late stages of various diseases, molting, and emerging from hibernation) under different seasons and farming models in two locations. Under the guidance of entomologists and experienced silkworm farmers, meticulous annotation was performed, including: target bounding boxes required for YOLO detection, key points on the silkworm body (head, tail, spiracles), pixel-level segmentation of diseased areas, and behavioral tags (movement, stillness, feeding, hibernation).

[0089] Localization and model adaptation: The improved YOLO model is fine-tuned based on local datasets, and the anchor configuration and feature extraction module are optimized to adapt it to the morphological characteristics and stocking density of the local main farmed species.

[0090] Interaction Design: Develop a simplified farmer interface to translate early warning information from technical language into agronomic instructions, such as: "In the southeast corner of the third silkworm tray, some silkworms have abnormally high motion entropy and reduced feeding time, which is suspected to be an early risk of stunted growth disease (medium level). It is recommended to immediately isolate the area and strengthen environmental disinfection, and replace the mulberry leaves with fresh ones."

[0091] Environmental Adaptation: Optimize the protective design of terminal equipment and the environmental robustness of algorithms for the high temperature and humidity environment of silkworm rearing rooms (such as the light adaptive adjustment module for YOLO detection).

[0092] By integrating with existing digital systems, the system's YOLO detection data, behavioral quantification data, and early warning information will be seamlessly connected to Yizhou's existing mulberry orchard drone remote sensing monitoring system and environmental IoT system. Through cloud-based knowledge graphs, a correlation rule will be established between "mulberry orchard pathogen load → abnormal silkworm behavior → disease early warning," enabling full traceability and integrated prevention and control from "mulberry orchard to silkworm rearing."

[0093] A system for identifying silkworm bodies based on the YOLO algorithm includes a terminal perception layer, an edge analysis layer, and a cloud intelligence layer. The terminal perception layer consists of several high-definition cameras installed in the silkworm rearing room. Each camera feeds into a lightweight neural network optimized based on YOLO, responsible for target detection and key feature extraction from the real-time video stream. It also reduces transmission bandwidth usage through efficient data compression technology and uploads the processed data to edge nodes. The edge analysis layer consists of edge computing devices installed in the silkworm rearing room. It aggregates data from several terminals and uses several target tracking models and a primary early warning model based on the YOLO detection results to achieve localized real-time analysis and abnormal event alarms. The aggregated structured data is uploaded to the cloud every minute. The cloud intelligence layer is built on a regional agricultural data center and adopts a distributed cluster architecture. Its functions include full-domain data fusion, iterative training of YOLO detection and early warning models, spatiotemporal correlation analysis, production status visualization, and management suggestion generation.

[0094] This technical solution integrates cutting-edge computer vision, deep learning, and edge computing technologies to provide intelligent monitoring and early disease warning for the entire growth cycle of silkworms from the 1st to 5th instar in Huanjiang and Yizhou areas of Hechi, Guangxi Zhuang Autonomous Region. It focuses on constructing a three-tiered deep intelligent system of "perception-cognition-decision," deploying a spectral sensing network, and developing a cascaded adaptive detection and tracking algorithm based on improved YOLO technology for intensive, multi-scale, and unstructured aquaculture scenarios. It also innovatively establishes a behavioral omics early warning model based on multimodal time series and spatiotemporal graph neural networks (ST-GCN). This solution fundamentally changes the traditional reliance on manual experience and delayed disease response in silkworm farming by quantifying silkworm growth indicators, analyzing abnormal behavioral patterns, and anticipating disease transmission risks. It provides a core technological engine for the digital transformation and high-quality development of the silkworm industry in Hechi (with an annual breeding scale exceeding 500,000 sheets of silkworm eggs, involving more than 30,000 households), and is expected to reduce disease losses by 15%-20% and increase breeding efficiency by more than 30%.

[0095] Matters not covered in this invention are common knowledge.

[0096] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for identifying YOLO silkworm bodies, characterized in that: The method includes the following steps: Step 1: Construct an adaptive detection model for dense scenes at several scales based on the improved YOLO; Step 2: Perform target tracking and behavior quantification based on the YOLO detection results; Step 3: Construct an early warning model based on a multimodal temporal graph neural network; Step 4: Data loop closure and model evolution identification.

2. The method for identifying YOLO silkworm bodies according to claim 1, characterized in that: In step 1, taking into account the special characteristics of silkworm farming, a cascaded adaptive YOLO detection model is constructed based on the YOLOv8 architecture through deep customization and optimization. This model can perform accurate detection at several scales, under high density and strong occlusion conditions.

3. The method for identifying YOLO silkworm bodies according to claim 1, characterized in that, In step 1, the specific process of improving YOLO is as follows: Step 1.1: Set up an adaptive anchor generation mechanism, abandoning the default general anchor configuration of YOLO. Based on the size statistics of silkworms from the 1st to 5th instar, use the K-means++ clustering algorithm to generate 6 sets of scene-specific anchors, covering the size range of silkworms throughout the entire instar. At the same time, introduce a dynamic anchor matching strategy, adjust the scaling ratio of the anchor in real time according to the target size distribution in the input image, so as to improve the anchor matching degree between the 1st instar silkworm target and the 5th instar silkworm target. Step 1.2: Optimization of several scale detection heads. Based on the three-scale detection heads P3, P4, and P5 of YOLOv8, a new high-resolution detection head P2 is added, which is specifically used to capture millimeter-level ant and silkworm feature information. Through the cross-scale feature fusion module, bidirectional interaction of P2-P5 features is realized. Low-level features P2 and P3 provide target edge details, while high-level features P4 and P5 provide semantic information, effectively solving the problems of insufficient feature extraction for small targets and inaccurate localization of large targets. Step 1.3: Improved anti-occlusion in dense scenes. To address the occlusion problem caused by the accumulation of 5th instar silkworms, an occlusion perception module is embedded in the YOLO detection head. The occlusion perception module identifies the local visible region of the occluded target by calculating the overlap rate of the target bounding box and the response intensity of the feature map. It strengthens the feature weight of the visible region using an attention mechanism and introduces a context-aware branch to complete the features based on the neighborhood information of the occluded target, thereby improving the detection mAP in occluded scenes. Step 1.4: To adapt to edge deployment, the YOLO backbone network is optimized using model pruning and quantization techniques. Redundant convolutional channels are removed through channel pruning, and the model parameter accuracy is reduced from FP32 to INT8 using INT8 quantization. This reduces the model size and improves inference speed, while retaining the YOLO Focus structure and the efficient feature extraction capability of the C2f module. This ensures that high detection accuracy is maintained even after lightweighting, and the single-frame detection time meets the real-time requirements of edge deployment. Step 1.5: Using a combination of transfer learning and incremental training, the YOLO backbone network was first pre-trained on a public insect dataset, and then fine-tuned on a silkworm-specific dataset. The loss function used CIoU Loss to optimize bounding box regression, combined with Focal Loss to solve the problem of imbalance between positive and negative samples, and Label Smoothing was introduced to reduce the impact of labeling errors. Finally, the model achieved the required accuracy in detecting silkworms of all ages on the validation set.

4. The method for identifying YOLO silkworm bodies according to claim 1, characterized in that, The specific process of step 2 is as follows: Based on the improved detection output of YOLO, a spatiotemporal joint embedding tracking algorithm for appearance motion is constructed to achieve continuous tracking of individual trajectories and behavior quantification; YOLO detection results post-processing optimizes the bounding boxes output by YOLO by performing non-maximum suppression optimization. Soft-NMS is used instead of traditional NMS. By adaptively adjusting the suppression threshold, the false deletion of targets in dense scenes is reduced, thereby improving the recall rate of the detection boxes. At the same time, a detection box calibration module is introduced to correct the rectangular bounding boxes output by YOLO based on the morphological features of the silkworm body, thereby improving the target localization accuracy. Triple feature embedding and association matching, based on the intermediate features of the YOLO backbone network, adds a lightweight metric learning branch and adopts Triplet Loss optimization to extract silkworm appearance feature vectors that are robust to illumination, pose and occlusion, and solve the problem of identifying silkworms with highly similar appearances; Motion embedding utilizes the historical trajectory of YOLO detection boxes and predicts the target's motion state through Kalman filtering. The motion state includes position, velocity, and acceleration, which are encoded into motion feature vectors to improve the stability of short-term tracking. Spatiotemporal context embedding encodes the location information of the target in the silkworm tray and the distribution relationship of neighboring targets into graph structure features, solving the identity matching problem of target reappearance after occlusion; The association matching adopts a cascaded strategy. First, it performs a fast initial matching based on motion features. Then, for ambiguous targets in the initial matching results, it performs a fine matching by combining appearance features and spatiotemporal context features to ensure the accuracy of long-term tracking. The behavioral quantification index system, based on stable trajectory data obtained from YOLO detection and tracking, automatically generates multi-dimensional behavioral indicators, including motor indicators, activity rhythms, feeding-related indicators, and social indicators. Motor indicators include instantaneous speed, acceleration, total path length, motion entropy, and turning frequency. Activity rhythms include the percentage of time spent moving / stationary, activity periodicity intensity, and diurnal activity difference coefficient. Feeding-related indicators include the frequency of head orientation towards mulberry leaves, dwell time, and gnawing motion amplitude. Social indicators include average distance between individuals, local density, contact frequency, and aggregation coefficient.

5. The method for identifying YOLO silkworm bodies according to claim 1, characterized in that, The specific process of step 3 is as follows: Using the morphological and behavioral characteristics output by YOLO detection and tracking as the core input, and combining multispectral appearance features with environmental data, the ST-GCN early warning model is constructed to achieve early warning of diseases. Several modal input codes are used to treat each silkworm as a dynamic node. The node features include: morphological features extracted by YOLO detection, several spectral appearance features, and a time sequence of behavioral features obtained by tracking. Spatiotemporal graph construction: At each moment, a k-nearest neighbor graph is constructed based on the spatial location of the silkworms. The edge weights in the graph are determined by the distance between individuals and the similarity of their behaviors, representing the potential influence relationships between individuals. The spatiotemporal graph is dynamically updated over time to capture the movement and aggregation changes of the silkworm population. The spatial convolutional layer uses a graph convolutional network to aggregate the feature information of neighboring nodes and introduces an attention mechanism to dynamically adjust the weights of neighborhood features, enabling the model to focus on the neighborhood state of abnormal nodes. The temporal convolutional layer, which combines one-dimensional convolution with LSTM, captures the evolution pattern of individual node features over time and identifies trend anomalies in behavioral indicators. Multi-scale time series fusion extracts short-term, medium-term, and long-term time series features through time windows of different lengths, comprehensively judges the stability of abnormal patterns, and reduces false alarms; The early warning decision-making mechanism uses a model to establish a normal pattern baseline distribution on massive healthy silkworm data through self-supervised learning. When running online, it calculates the deviation between the current spatiotemporal map features and the baseline distribution. When the abnormal score exceeds a preset threshold, the system triggers an early warning and outputs: abnormal level, abnormal area location, and potential disease type prediction.

6. The method for identifying YOLO silkworm bodies according to claim 1, characterized in that, The specific process of step 4 is as follows: The system automatically filters out difficult scenarios with low YOLO detection confidence and easy tracking loss, prioritizes pushing them to expert annotations, supplements the training dataset, and enables incremental learning at the edge. Edge nodes incrementally fine-tune the improved YOLO detection model and tracking algorithm based on locally added annotation data. Knowledge distillation technology is used to retain the generalization ability of the original model and avoid catastrophic forgetting, allowing the model to gradually adapt to the environment and characteristics of specific silkworm rearing rooms. Under the premise of protecting data privacy, the cloud coordinates multiple edge nodes, only exchanging model parameter updates, and jointly training the global YOLO detection model and early warning model. This achieves intelligent co-growth without data leaving the factory, improving the robustness of the model under different farming scenarios.

7. A system for identifying YOLO silkworm bodies according to any one of claims 1-6, characterized in that, The system comprises a terminal perception layer, an edge analysis layer, and a cloud intelligence layer. The terminal perception layer consists of several high-definition cameras installed in the silkworm rearing room. Each camera feeds into a lightweight neural network optimized based on YOLO, responsible for real-time target detection and key feature extraction of the video stream. It also reduces transmission bandwidth usage through efficient data compression technology and uploads the processed data to edge nodes. The edge analysis layer consists of edge computing devices installed in the silkworm rearing room. It aggregates data from several terminals and uses several target tracking models and basic early warning models based on YOLO detection results to achieve localized real-time analysis and abnormal event alarms. The aggregated structured data is uploaded to the cloud every minute. The cloud intelligence layer is built on a regional agricultural data center and adopts a distributed cluster architecture. Its functions include full-domain data fusion, iterative training of YOLO detection and early warning models, spatiotemporal correlation analysis, production status visualization, and management suggestion generation.