Chicken flock state inspection monitoring system and method
Through multimodal data acquisition and fusion technology, combined with deep learning and self-supervised comparative learning models, the existing chicken flock health monitoring technology is solved, and efficient and accurate chicken flock health status monitoring and adaptive early warning are achieved.
Patent Information
- Application Number
- CN202510444048.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-05-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing chicken flock health monitoring technology is inefficient and has poor accuracy, making it difficult to adapt to the differences in different chicken coop environments and growth stages. The existing models lack adaptability, resulting in high cost of false positives, missed reports and model training.
Multimodal data acquisition and fusion technology is adopted, including visual images, sound signals, ambient temperature and humidity and individual activity trajectory data, and features are extracted through convolutional neural networks, recurrent neural networks and feature engineering, and feature fusion is performed using attention mechanisms. The self-supervised comparison learning model is trained based on historical health data, combined with genetic algorithms to optimize the model hyperparameters, dynamically adjust the early warning threshold, and adapt the monitoring models of different chicken coops through transfer learning.
It realizes efficient and accurate monitoring of the healthy status of chickens, reduces false alarms and missed reports, reduces model training and adaptation costs, and improves the reliability and adaptability of the monitoring system.
Smart Images

Figure CN119989281A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of poultry breeding monitoring, and in particular to a chicken flock status inspection monitoring system and method. Background Art
[0002] In the modern chicken farming industry, chicken health management is of vital importance, which is related to farming efficiency and food safety. Traditional chicken health monitoring methods have many limitations and cannot meet the needs of industrial development.
[0003] Manual inspection is a common method. Farmers need to observe the status of each chicken regularly, visually check the appearance and behavior of the chicken, and use hearing to identify whether the chicken's call is abnormal. However, this method is extremely inefficient. A large chicken house usually raises thousands or even tens of thousands of chickens, and manual inspection consumes a lot of manpower and time. Moreover, manual judgment is subjective, and the experience and judgment standards of different farmers vary, which can easily lead to missed inspections or misjudgments. For example, mild respiratory symptoms in the early stage may be difficult to detect manually if you don't listen carefully; some hidden diseases of chickens cannot be detected by external observation alone. Some chicken farms have begun to use simple sensor technology, such as temperature sensors to monitor the ambient temperature of the chicken house and humidity sensors to monitor humidity. However, these single sensors can only obtain environmental information and cannot directly reflect the health status of the chickens themselves. Even if the ambient temperature and humidity are suitable, the chickens may still have health problems due to infection, feed problems, etc. At the same time, these sensor data lack correlation analysis with the behavior and physiological characteristics of the chickens, and cannot provide a comprehensive and accurate basis for breeding decisions.
[0004] With the development of computer vision technology, some chicken monitoring systems based on image recognition have emerged. These systems can identify the number of chickens and some behavioral movements, but their functions are relatively simple and rely only on visual images, ignoring multiple aspects of information such as sound, environmental temperature and humidity, and individual activity trajectories. The health status of chickens is affected by a combination of factors, and it is difficult to accurately judge based on visual information alone. For example, in the early stages of a chicken's illness, there may be no obvious changes in appearance, but the calls and exercise habits will change. A simple image recognition system cannot capture these subtle changes. In addition, existing monitoring technologies are also insufficient in abnormal warning. Most systems use fixed thresholds to determine whether the chickens are abnormal, which cannot adapt to the differences in different chicken house environments and chickens at different growth stages. In different seasons and different breeding densities, the parameter range of the normal state of the chickens will fluctuate, and fixed thresholds are prone to false alarms or missed alarms. Moreover, when an abnormality is found, the existing system often finds it difficult to quickly locate abnormal individuals or areas, and cannot take targeted measures in a timely manner, delaying the timing of disease prevention and control, and causing economic losses.
[0005] In terms of model adaptability, the environmental conditions, chicken breeds and sizes of different chicken houses vary. Existing monitoring models are usually trained in specific environments and lack the ability to adapt to different chicken house environments. When applied to new chicken houses, a large amount of re-labeled data is required for model training, which is costly, time-consuming and labor-intensive, and seriously restricts the widespread application of monitoring technology in the poultry industry. In summary, it is urgent to develop an efficient, accurate and adaptive chicken status inspection monitoring system and method. Summary of the invention
[0006] The purpose of the present invention is to provide a chicken flock status inspection and monitoring system and method to solve the problems raised in the above background technology.
[0007] To achieve the above object, the present invention provides the following technical solution: a method for inspecting and monitoring the status of a flock of chickens, the method comprising: S1. Collect multimodal data of chickens, including visual images, sound signals, environmental temperature and humidity, and individual activity trajectory data, annotate the data, and clearly define the health status labels of different time periods; perform data preprocessing, including noise filtering, data alignment and normalization, and construct a multimodal data set; S2. The preprocessed visual image is input into the convolutional neural network to extract spatial features, the sound signal is converted into a Mel spectrum and then input into the recurrent neural network to extract temporal features, and the environmental data and activity trajectory data are generated into a joint feature vector through feature engineering; S3. Fusing the spatial features, temporal features and joint feature vectors to construct a multi-dimensional feature matrix, and using an attention mechanism to dynamically assign weights to each modality feature to generate a fused feature vector; S4. Train a self-supervised contrastive learning model based on historical health data to generate a flock status discrimination model by maximizing the similarity between healthy state samples and minimizing the similarity between abnormal samples and healthy samples; S5. Real-time collection of multimodal data of the flock during the monitoring period, repeating steps S1 to S3 to generate a real-time fusion feature vector, and inputting the discriminant model to calculate the health status probability; S6. Generate anomaly scores based on probability distribution, combine with dynamic threshold adjustment algorithm, and update warning thresholds based on sliding window mean and variance of historical anomaly scores; S7. If the anomaly score exceeds the current warning threshold, a graded warning signal is triggered and the abnormal individual or area is located; S8. Adapt the monitoring model of different chicken houses through transfer learning algorithm, and fine-tune the model parameters using a small amount of labeled data of the target chicken house; S9. Combine genetic algorithm to optimize the hyperparameters of the discriminant model, and dynamically adjust the network depth and attention weight dimensions based on the flock size and environment complexity.
[0008] Preferably, in step S1, the following steps are specifically included: S101. Deploy infrared cameras to collect images of the temperature distribution of chickens, microphone arrays to collect pecking and chirping sounds, and inertial sensors to record individual movement acceleration; S102. Label health status including "normal eating", "abnormal group gathering", "respiratory symptoms" and "movement disorder", and associate environmental temperature, humidity and light intensity data; S103. Perform background segmentation and chicken body contour extraction on the visual image, perform noise reduction and frequency band enhancement on the sound signal, and use sliding average filtering on the environmental data to eliminate instantaneous fluctuations.
[0009] Preferably, in step S2, the following steps are specifically included: S201. Using residual convolutional network to extract feather state, eye features and posture angle of visual image, and output 256-dimensional spatial feature vector; S202. Calculate the Mel-frequency cepstral coefficients after framing and windowing the sound signal, capture the temporal dependency of the calling frequency through a bidirectional gated recurrent unit, and output a 128-dimensional acoustic feature vector; S203. Combine the temperature and humidity data with the Hough transform path encoding of the motion trajectory to generate a 32-dimensional joint environment feature vector.
[0010] Preferably, in step S3, the following steps are specifically included: S301. Concatenate the spatial features, acoustic features and environmental features into a 416-dimensional mixed vector according to the dimensions; S302. Design a multi-head attention mechanism, calculate the correlation matrix of each feature subspace, and generate a weighted fusion feature vector; S303. Dynamically suppress redundant modal features through the gating unit and retain feature components that are strongly related to the current health status.
[0011] Preferably, in step S4, the following steps are specifically included: S401. Constructing a positive sample pair as a multimodal data enhancement sample under the same health state, and a negative sample pair as a cross-category sample of a healthy and abnormal state; S402. Optimizing the model using the cosine similarity loss function so that the distance between the positive sample pairs in the embedding space is less than a preset margin value; S403. Introduce a difficult sample mining strategy and give priority to selecting abnormal samples with high similarity to anchor samples to participate in training.
[0012] Preferably, in step S6, the following steps are specifically included: S601. Calculate the sliding mean of the abnormal score of the continuous T-frame data within the monitoring period With standard deviation ; S602. Update the dynamic threshold according to the formula:
[0013] in For the current moment Dynamic warning thresholds, for The sliding mean of the abnormal score at the moment, for The standard deviation of the anomaly score at the moment, It is an adaptive coefficient, which is dynamically adjusted according to the frequency of abnormal events.
[0014] Preferably, in step S8, the following steps are specifically included: S801. Freeze the basic convolutional layers and recurrent neural network layers of the source domain model; S802. Fine-tune only the attention mechanism layer and the fully connected classifier on the target chicken house data; S803. Adopt domain adversarial training strategy to minimize the difference in feature distribution between source domain and target domain.
[0015] Preferably, in step S9, the following steps are specifically included: S901. Define the hyperparameter search space, including the number of network layers, the number of attention heads, and the learning rate range; S902. Generate candidate parameter combinations through crossover and mutation operations of a genetic algorithm; S903. Use the F1 score on the validation set as the fitness function and iterate and optimize until convergence.
[0016] Preferably, in step S7, the following steps are specifically included: S701. If the abnormal score is a local extreme value and lasts for more than 3 monitoring cycles, a first-level warning is triggered and the suspicious individual is marked; S702. If the score does not decrease after the first-level warning, the infection spread area is located by combining the movement trajectory cluster analysis, and the second-level warning is triggered.
[0017] Preferably, the present invention also includes a flock status inspection and monitoring system, the system comprising: Data collection and preprocessing module: used to collect visual images, sound signals, environmental temperature and humidity, and individual activity trajectory data of the chickens, annotate the data, clarify the health status labels of different time periods, and perform preprocessing operations such as noise filtering, data alignment and normalization to build a multimodal data set; Feature extraction module: The preprocessed visual image is input into the convolutional neural network to extract spatial features. The sound signal is converted into a Mel spectrum and then input into the recurrent neural network to extract temporal features. The environmental data and activity trajectory data are combined to generate a joint feature vector through feature engineering. Feature fusion module: fuses the spatial features, temporal features and joint feature vectors to construct a multi-dimensional feature matrix, and uses an attention mechanism to dynamically allocate the weights of each modal feature to generate a fused feature vector; Model training module: A self-supervised comparative learning model is trained based on historical health data. By maximizing the similarity between healthy samples and minimizing the similarity between abnormal samples and healthy samples, a flock status discrimination model is generated. The hyperparameters of the discrimination model can be optimized in combination with a genetic algorithm, and the network depth and attention weight dimensions can be dynamically adjusted based on the flock size and environmental complexity. Real-time monitoring module: collects multimodal data of the chicken flock during the monitoring period in real time, generates real-time fusion feature vectors using the data collection and preprocessing module, feature extraction module, and feature fusion module, and inputs the discriminant model to calculate the health status probability; Early warning module: Generates anomaly scores based on probability distribution, combines dynamic threshold adjustment algorithm, and updates early warning thresholds based on the sliding window mean and variance of historical anomaly scores. If the anomaly score exceeds the current early warning threshold, a graded early warning signal is triggered, and the abnormal individual or area is located. Model adaptation module: Adapt the monitoring models of different chicken houses through the transfer learning algorithm, and fine-tune the model parameters using a small amount of labeled data of the target chicken house.
[0018] Compared with the prior art, the present invention has the following beneficial effects: The present invention constructs a multimodal data set by collecting visual images, sound signals, environmental temperature and humidity, and individual activity trajectory data of the chickens. Data of different modes reflect the health status of the chickens from different angles. The visual image can present the appearance and posture of the chickens, the sound signal can reflect their health and emotions, the environmental temperature and humidity affect the health of the chickens, and the activity trajectory reflects their mobility and habits. The fusion analysis of multiple data avoids the one-sidedness of single data and makes the judgment of the health status of the chickens more accurate. For example, combining the feather status of the chickens in the visual image, the eye characteristics and the chirping frequency in the sound signal can more accurately judge whether the chickens are sick, which greatly improves the accuracy compared to relying solely on a single modality data.
[0019] Convolutional neural networks, recurrent neural networks and feature engineering are used to extract features from different modal data, and then fused through the attention mechanism. This method fully taps the potential value of each modal data, and can also dynamically assign weights according to different health states to highlight key features. When judging whether the chickens have respiratory diseases, the weight of the sound signal features will be automatically increased, so that the model pays more attention to abnormal call information, improves the ability to identify diseases, and enhances the reliability and stability of the monitoring system.
[0020] Based on historical health data, the self-supervised comparative learning model is trained to better distinguish between healthy and abnormal states by maximizing the similarity of healthy samples and minimizing the similarity between abnormal and healthy samples. A difficult sample mining strategy is introduced to prioritize training of difficult-to-distinguish samples, further improving the model's ability to identify complex abnormal situations. The genetic algorithm is combined to optimize the hyperparameters of the discriminant model, and the network depth and attention weight dimensions are dynamically adjusted according to the size of the flock and the complexity of the environment to ensure that the model can achieve optimal performance in different breeding scenarios.
[0021] Anomaly scores are generated based on probability distribution, and the warning threshold is updated in combination with the dynamic threshold adjustment algorithm. The dynamic threshold changes with the mean and variance of the sliding window of historical anomaly scores, and can also be adaptively adjusted according to the frequency of abnormal events to avoid false positives and false negatives. The graded warning mechanism triggers different levels of warnings according to the severity of the anomaly score. If the anomaly score is a local extreme value and lasts for more than 3 monitoring cycles, a first-level warning is triggered. If the score does not drop after the first-level warning, the infection spread area is located in combination with the movement trajectory cluster analysis and a second-level warning is triggered, so that the breeders can take corresponding prevention and control measures in time to reduce economic losses.
[0022] Through the transfer learning algorithm, a small amount of labeled data from the target chicken house is used to fine-tune the model parameters to adapt to the monitoring needs of different chicken houses. The basic layer of the source domain model is frozen, and only the attention mechanism layer and the fully connected classifier are fine-tuned to reduce training time and data labeling. The domain adversarial training strategy is adopted to minimize the difference in feature distribution between the source domain and the target domain and improve the generalization ability of the model. When applied to new chicken houses, there is no need to re-label the data training model in large quantities, which reduces manpower, time and economic costs, and promotes the widespread application of monitoring technology in the poultry industry. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 This is a working principle diagram of the chicken flock status inspection and monitoring method of the present invention; Figure 2 Workflow diagram of feature fusion and attention mechanism for flock monitoring; Figure 3 Workflow diagram for updating abnormal scores and thresholds for flocks; Figure 4 Workflow diagram for transfer learning adaptation of the chicken monitoring model. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] See also Figure 1-4 The present invention provides a technical solution: a method for inspecting and monitoring the status of a flock of chickens, the method comprising: S1. Collect and preprocess data: Collect multimodal data of chickens, including visual images, sound signals, environmental temperature and humidity, and individual activity trajectory data, and label these data to clearly identify the health status labels of chickens at different times. Subsequently, preprocess the collected data, including noise filtering, data alignment, and normalization operations, to construct a multimodal data set.
[0026] S2. Extract multimodal features: The preprocessed visual image is input into the convolutional neural network to extract spatial features. The sound signal is converted into a Mel spectrum and then input into the recurrent neural network to extract temporal features. The environmental data and activity trajectory data are combined to generate a joint feature vector through feature engineering.
[0027] S3. Fusion feature vector: Fusion of the spatial features, temporal features and joint feature vectors obtained above to construct a multi-dimensional feature matrix. Then, the attention mechanism is used to dynamically assign the weights of each modality feature to generate a fusion feature vector.
[0028] S4. Training the discriminant model: A self-supervised contrastive learning model is trained based on historical health data to generate a model for discriminating the status of the flock by maximizing the similarity between healthy state samples and minimizing the similarity between abnormal samples and healthy samples.
[0029] S5. Real-time monitoring and feature generation: Collect multimodal data of the flock during the monitoring period in real time, repeat steps S1 to S3, generate a real-time fusion feature vector, and input it into the discriminant model to calculate the health status probability of the flock.
[0030] S6. Calculate anomaly scores and adjust thresholds: Generate anomaly scores based on probability distribution, combine with dynamic threshold adjustment algorithm, and update warning thresholds based on the sliding window mean and variance of historical anomaly scores.
[0031] S7. Trigger warning and locate anomalies: If the anomaly score exceeds the current warning threshold, a graded warning signal is triggered and the abnormal individual or area is located.
[0032] S8. Model adaptation: The monitoring model of different chicken houses is adapted through transfer learning algorithm, and the model parameters are fine-tuned using a small amount of labeled data of the target chicken house.
[0033] S9. Optimize model hyperparameters: Combine genetic algorithms to optimize the hyperparameters of the discriminant model, and dynamically adjust the network depth and attention weight dimensions according to the flock size and environmental complexity.
[0034] The present invention will be further described below in conjunction with Examples 1 to 5: Embodiment 1: This embodiment mainly describes the steps of data collection and labeling in detail, which aims to obtain comprehensive and accurate multimodal data of chickens and provide data support with accurate health status labels for subsequent analysis and model training. The specific steps include: S101. Deploy equipment to collect data: Infrared cameras are properly deployed in the chicken house to collect images of the temperature distribution of the chickens. The installation location of the infrared camera needs to be carefully planned to ensure that it can cover most of the chicken activity areas in the chicken house to avoid monitoring blind spots. At the same time, a microphone array is arranged to collect the pecking and chirping sounds of the chickens. The design of the microphone array should be able to effectively capture the sounds made by chickens in different positions and have a certain anti-interference ability. In addition, in order to record the acceleration of individual movements, an inertial sensor is worn on each chicken. These sensors need to have the characteristics of low power consumption and high precision, and will not have a significant impact on the normal activities of the chickens.
[0035] S102. Label health status: Label the collected data. The labeled health status labels include "normal eating", "abnormal group gathering", "respiratory symptoms" and "movement disorders". When labeling "normal eating", the judgment is made based on the frequency and duration of the pecking sound of the chickens and the eating posture of the chickens in the visual image. When the chickens make relatively regular pecking sounds and show normal eating movements in the visual image, it is marked as "normal eating". For "abnormal group gathering", by analyzing the temperature distribution image of the chickens and the individual activity trajectory data, if abnormal gathering of the chickens is found, such as excessive concentration in a certain area, and the difference from the normal group distribution pattern is large, it is marked as "abnormal group gathering". When labeling "respiratory symptoms", it is mainly based on the characteristics of the chickens' calls. When the calls are abnormally hoarse or the frequency changes, combined with the environmental temperature, humidity and light intensity data (because environmental factors may affect the health of the chickens), it is judged whether there are respiratory problems and marked. The labeling of "movement disorder" relies on the individual motion acceleration data recorded by the inertial sensor. If the movement acceleration of a chicken is significantly lower than the normal level for a period of time, or if there are abnormalities in the movement trajectory, such as irregular walking route, frequent pauses, etc., it will be marked as "movement disorder".
[0036] S103. Data preprocessing operation: When preprocessing the visual image, the background segmentation algorithm is used to separate the chickens from the chicken house background, and then the chicken body contour extraction algorithm is used to accurately outline the chicken body. This helps to analyze the appearance characteristics of the chickens more accurately in the future. For the sound signal, noise reduction processing is first performed to remove the interference of environmental noise on the sound of the chickens, and then frequency band enhancement is performed to highlight the sound frequency components related to the health status of the chickens. When processing environmental data, since data such as environmental temperature and humidity may have instantaneous fluctuations, the sliding average filtering method is used to process them to eliminate these fluctuations so that the data can better reflect the true stable state of the environment.
[0037] Embodiment 2: This embodiment describes in detail the steps of multimodal feature extraction, which is used to extract features that can effectively characterize the health status of chickens from data of different modalities. The specific steps include: S201. Extracting spatial features of visual images: Residual convolutional networks are used to extract features from preprocessed visual images. Residual convolutional networks have good gradient propagation characteristics and can effectively avoid the problem of gradient disappearance during deep network training. In the network structure, low-level and high-level features of the image are gradually extracted through the combination of multiple convolutional layers and pooling layers. Specifically, the focus is on the feather state, eye features and posture angles of the chickens. For the feather state, the texture, color and other features of the feathers are learned through the convolutional layer to determine whether the feathers are neat and whether they have fallen off. The extraction of eye features focuses on the degree of eye opening, color changes, etc., which may reflect the health of the chickens. When extracting the posture angle, the network is used to analyze the position and posture of the chicken in the image to obtain its posture information such as standing, walking, and lying. After a series of convolution and pooling operations, 256-dimensional spatial feature vectors are finally output, which contain rich visual information of the chickens.
[0038] S202. Extracting the temporal features of the sound signal: First, the sound signal is processed by frame division and windowing, and the continuous sound signal is divided into multiple short frames for subsequent spectrum analysis. Then the Mel-Cepstral coefficients of each frame of sound are calculated. The Mel-Cepstral coefficients can simulate the human ear's perception of sound frequency and highlight the frequency components that are useful for speech and sound feature analysis. The temporal dependency of the chirping frequency is captured by a bidirectional gated recurrent unit (Bi-GRU). Bi-GRU can learn the temporal information of the sound signal from both the forward and reverse directions at the same time to better capture the dynamic changes in the sound signal. After being processed by Bi-GRU, 128-dimensional acoustic feature vectors are output, which can effectively reflect the changing patterns of the sound signals of the chicken flock in the time series.
[0039] S203. Generate a joint environmental feature vector: combine the temperature and humidity data with the Hough transform path coding of the motion trajectory. The temperature and humidity data reflect the environmental conditions of the chickens and have an important impact on the health of the chickens. The Hough transform path coding of the motion trajectory can convert the motion trajectory information of the chickens into a coding form that is easy to analyze. In the specific implementation, the motion trajectory data is first subjected to a Hough transform to obtain the characteristic parameters of the trajectory, and then these parameters are fused with the temperature and humidity data. Through a specific algorithm, a 32-dimensional joint environmental feature vector is generated, which integrates environmental factors and chicken motion information, providing an important component for subsequent feature fusion.
[0040] Embodiment 3: This embodiment is based on the steps of feature fusion and attention mechanism, which is to effectively fuse the features of different modalities and highlight the features that are more important for judging the health status of the chicken flock through the attention mechanism, thereby improving the accuracy and robustness of the model. The specific steps include: S301. Concatenate multimodal feature vectors: Concatenate the spatial features (256 dimensions), acoustic features (128 dimensions), and environmental features (32 dimensions) extracted in step S2 by dimension to form a 416-dimensional mixed vector. This concatenation method is simple and direct, and can integrate feature information of different modalities together to provide a comprehensive data foundation for subsequent processing. However, in practical applications, since the scale and importance of features of different modalities may vary, further processing is required to optimize the feature representation.
[0041] S302. Design a multi-head attention mechanism: In order to better mine the correlation between different feature subspaces, a multi-head attention mechanism is designed. The multi-head attention mechanism processes the mixed vector in parallel through multiple attention heads, and each attention head focuses on a different feature subspace. In the specific implementation, the attention weight of each attention head on each feature dimension in the mixed vector is first calculated. This weight reflects the degree of attention of the attention head to different features. Then, the mixed vector is weighted and summed according to these weights to obtain the output of each attention head. Finally, the outputs of multiple attention heads are spliced to generate a weighted fused feature vector. Through the multi-head attention mechanism, features can be analyzed and fused from multiple angles to improve the richness and accuracy of feature representation.
[0042] S303. Dynamically suppress redundant features: In order to further optimize the fused feature vector, a gating unit is used to dynamically suppress redundant modal features. The gating unit calculates a gating signal based on the current input features and the learned parameters. This gating signal is used to control which feature components can pass and which need to be suppressed. When a feature component is weakly correlated with the current health status of the flock, the gating unit will reduce its weight or even suppress it, thereby retaining the feature component that is strongly correlated with the current health status. This can reduce the interference of redundant information on model judgment and improve the efficiency and accuracy of the model.
[0043] Embodiment 4: This embodiment focuses on the steps of model training and abnormal score calculation. Its core function is to build an accurate chicken flock status discrimination model with the help of scientific training strategies, and to accurately determine the abnormal status of the chicken flock by dynamically adjusting the threshold. The specific steps include: S401. Construct sample pairs: In the process of training the self-supervised contrastive learning model, carefully construct positive sample pairs and negative sample pairs. The positive sample pairs select multimodal data enhancement samples under the same health state. For example, for chickens in the "normal eating" state, data enhancement methods such as rotation and cropping are implemented on their visual images, and the corresponding sound signals are noised and speed-changed, thereby obtaining multiple different versions of multimodal data, which are combined in pairs to form positive sample pairs. The negative sample pairs are composed of cross-category samples in healthy and abnormal states, such as combining samples in the "normal eating" state with samples in the "respiratory symptoms" state to form negative sample pairs. In this way, the model can deeply learn the difference characteristics between samples in different health states.
[0044] S402. Optimize the model loss function: Use the cosine similarity loss function to optimize the model. The expression of this function is: ,in and Represent the feature vectors of the two samples in the embedding space. During training, it is expected that the distance between the positive sample pairs in the embedding space is less than the preset margin value. ,Right now ( Represents a positive sample pair). By continuously adjusting the model parameters, the cosine similarity of the positive sample pair is made as high as possible, and the cosine similarity of the negative sample pair is made as low as possible, so as to improve the model's ability to distinguish samples of different health states.
[0045] S403. Difficult sample mining strategy: In order to further improve the performance of the model, a difficult sample mining strategy is introduced. During the training process, abnormal samples with high similarity to anchor samples are preferentially selected for training. Anchor samples are usually representative samples. Selecting such abnormal samples with high similarity to anchor samples means selecting samples that are easily misjudged by the model. By learning these difficult samples, the model can better identify boundary conditions and enhance its generalization ability.
[0046] S601. Calculate the sliding statistics of abnormal score: When calculating the abnormal score, first calculate the continuous The abnormal scores of the frame data are counted. The anomaly scores of the frame data are , then the sliding mean of the abnormal score The calculation formula is: ; Abnormal score standard deviation The calculation formula is: The abnormal score is derived from the health status probability distribution output by the discriminant model, reflecting the degree of deviation between the current flock status and the normal status. By calculating the sliding mean and standard deviation, the changing trend and fluctuation of the abnormal score can be effectively grasped.
[0047] S602. Update dynamic threshold: Update dynamic threshold according to formula:
[0048] in For the current moment Dynamic warning thresholds, for The sliding mean of the abnormal score at the moment, for The standard deviation of the anomaly score at the moment, It is an adaptive coefficient, which will be adjusted dynamically with the frequency of abnormal events. When the frequency of abnormal events is high, increase it appropriately. The value of makes the warning threshold more sensitive and can quickly detect potential anomalies; when the frequency of abnormal events is low, reduce value to avoid false positives.
[0049] Embodiment 5: This embodiment provides a detailed description of the steps of model adaptation and hyperparameter optimization, which is to enable the monitoring model to better adapt to the environment and characteristics of different chicken houses, and to improve the performance of the model by optimizing hyperparameters. The specific steps include: S801. Freeze some layers of the source domain model: When performing transfer learning to adapt the monitoring model for different chicken houses, first freeze the basic convolutional layers and recurrent neural network layers of the source domain model. The source domain model is a model trained on one or more existing chicken house data, and its basic convolutional layers and recurrent neural network layers have learned some common features and patterns. Freezing these layers can avoid overfitting when fine-tuning on the target chicken house data while retaining the effective features of the source domain model.
[0050] S802. Fine-tune some layers of the target model: On the target chicken house data, only the attention mechanism layer and the fully connected classifier are fine-tuned. The attention mechanism layer can reallocate the weights of different modal features according to the characteristics of the target chicken house to better adapt to the environment and status of the target chicken house. The fully connected classifier directly affects the model's classification results of the health status of the chickens. By fine-tuning these two layers, the model can more accurately judge the health status of the chickens in the target chicken house.
[0051] S803. Adopt domain adversarial training strategy: In order to further improve the adaptability of the model in the target chicken house, a domain adversarial training strategy is adopted. The purpose of the domain adversarial training strategy is to minimize the difference in feature distribution between the source domain and the target domain. By introducing an adversarial training mechanism into the model, the discriminator is allowed to distinguish whether the feature comes from the source domain or the target domain, and the generator is allowed to generate features that are difficult for the discriminator to distinguish, so that the model can learn the common features of the source domain and the target domain, and improve the generalization ability of the model.
[0052] S901. Define the hyperparameter search space: Combined with the genetic algorithm to optimize the hyperparameters of the discriminant model, first define the hyperparameter search space. The hyperparameter search space includes the number of network layers, the number of attention heads, and the range of learning rates. The number of network layers determines the complexity and feature extraction capability of the model, the number of attention heads affects the effect of feature fusion, and the learning rate controls the step size of parameter updates during model training. Reasonable setting of the search range of these hyperparameters can improve search efficiency while ensuring model performance.
[0053] S902. Generate candidate parameter combinations: Generate candidate parameter combinations through crossover and mutation operations of genetic algorithms. Genetic algorithms simulate the biological evolution process and gradually optimize parameter combinations through operations such as selection, crossover and mutation. In the crossover operation, two parent parameter combinations are randomly selected, and some of their parameters are exchanged to generate a child parameter combination. The mutation operation randomly changes some parameters in a parameter combination and introduces new parameter values. By continuously performing crossover and mutation operations, a large number of candidate parameter combinations are generated.
[0054] S903. Iterate and optimize until convergence: The candidate parameter combinations are evaluated using the F1 score on the validation set as the fitness function. The F1 score takes into account the precision and recall of the model and can more comprehensively evaluate the performance of the model. In each iteration, the parameter combination with a higher fitness function value is selected as the parent of the next generation, and crossover and mutation operations are continued until the fitness function value no longer increases, that is, the model converges. In this way, an optimal set of hyperparameters can be found to improve the performance of the model under different flock sizes and environmental complexities.
[0055] S701. Triggering a first-level warning and marking individuals: When the abnormal score is a local extreme value and lasts for more than three monitoring cycles, a first-level warning is triggered and suspicious individuals are marked. A local extreme value indicates that the current abnormal score is at a high level for a period of time. If it lasts for more than three monitoring cycles, it means that this abnormal situation has a certain persistence and needs attention. By marking suspicious individuals, these individuals can be further observed and diagnosed to detect potential health problems in a timely manner.
[0056] S702. Triggering the second-level warning and locating the area: If the score does not decrease after the first-level warning, the infection spread area is located in combination with the movement trajectory cluster analysis, and the second-level warning is triggered. Movement trajectory cluster analysis can find the movement association between chickens. When the score continues to not decrease, there may be a situation of infection spread. Through cluster analysis, it is possible to determine which areas have similar chicken movement trajectories, thereby locating the infection spread area and taking corresponding prevention and control measures to prevent the further spread of the epidemic.
[0057] The present invention also includes a chicken flock status inspection and monitoring system, the system comprising: Data collection and preprocessing module: used to collect visual images, sound signals, environmental temperature and humidity, and individual activity trajectory data of the chickens, annotate the data, clarify the health status labels of different time periods, and perform preprocessing operations such as noise filtering, data alignment and normalization to build a multimodal data set; Feature extraction module: The preprocessed visual image is input into the convolutional neural network to extract spatial features. The sound signal is converted into a Mel spectrum and then input into the recurrent neural network to extract temporal features. The environmental data and activity trajectory data are combined to generate a joint feature vector through feature engineering. Feature fusion module: fuses the spatial features, temporal features and joint feature vectors to construct a multi-dimensional feature matrix, and uses an attention mechanism to dynamically allocate the weights of each modal feature to generate a fused feature vector; Model training module: A self-supervised comparative learning model is trained based on historical health data. By maximizing the similarity between healthy samples and minimizing the similarity between abnormal samples and healthy samples, a flock status discrimination model is generated. The hyperparameters of the discrimination model can be optimized in combination with a genetic algorithm, and the network depth and attention weight dimensions can be dynamically adjusted based on the flock size and environmental complexity. Real-time monitoring module: collects multimodal data of the chicken flock during the monitoring period in real time, generates real-time fusion feature vectors using the data collection and preprocessing module, feature extraction module, and feature fusion module, and inputs the discriminant model to calculate the health status probability; Early warning module: Generates anomaly scores based on probability distribution, combines dynamic threshold adjustment algorithm, and updates early warning thresholds based on the sliding window mean and variance of historical anomaly scores. If the anomaly score exceeds the current early warning threshold, a graded early warning signal is triggered, and the abnormal individual or area is located. Model adaptation module: Adapt the monitoring models of different chicken houses through the transfer learning algorithm, and fine-tune the model parameters using a small amount of labeled data of the target chicken house.
[0058] The implementation of the system refers to the above embodiment and will not be described in detail in the specification.
[0059] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0060] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for inspecting and monitoring the status of a flock of chickens, characterized in that: The steps include: S1. Collect multimodal data of chickens, including visual images, sound signals, environmental temperature and humidity, and individual activity trajectory data, annotate the data, and clearly identify health status labels at different times; Perform data preprocessing, including noise filtering, data alignment and normalization, and construct a multimodal dataset; S2. The preprocessed visual image is input into the convolutional neural network to extract spatial features, the sound signal is converted into a Mel spectrum and then input into the recurrent neural network to extract temporal features, and the environmental data and activity trajectory data are generated into a joint feature vector through feature engineering; S3. Fusing the spatial features, temporal features and joint feature vectors to construct a multi-dimensional feature matrix, and using an attention mechanism to dynamically assign weights to each modality feature to generate a fused feature vector; S4. Based on historical health data, a self-supervised contrastive learning model is trained to generate a flock status discrimination model by maximizing the similarity between healthy state samples and minimizing the similarity between abnormal samples and healthy samples; S5. Real-time collection of multimodal data of the flock during the monitoring period, repeating steps S1 to S3 to generate a real-time fusion feature vector, and inputting the discriminant model to calculate the health status probability; S6. Generate anomaly scores based on probability distribution, combine with dynamic threshold adjustment algorithm, and update warning thresholds based on sliding window mean and variance of historical anomaly scores; S7. If the anomaly score exceeds the current warning threshold, a graded warning signal is triggered and the abnormal individual or area is located; S8. Adapt the monitoring model of different chicken houses through transfer learning algorithm, and fine-tune the model parameters using a small amount of labeled data of the target chicken house; S9. Combine genetic algorithm to optimize the hyperparameters of the discriminant model, and dynamically adjust the network depth and attention weight dimensions based on the flock size and environment complexity.
2. A chicken flock status inspection and monitoring method according to claim 1, characterized in that: In step S1, the following steps are specifically included: S101. Deploy infrared cameras to collect images of the temperature distribution of chickens, microphone arrays to collect pecking and chirping sounds, and inertial sensors to record individual movement acceleration; S102. Label health status including "normal eating", "abnormal group gathering", "respiratory symptoms" and "movement disorder", and associate environmental temperature, humidity and light intensity data; S103. Perform background segmentation and chicken body contour extraction on the visual image, perform noise reduction and frequency band enhancement on the sound signal, and use sliding average filtering on the environmental data to eliminate instantaneous fluctuations.
3. A chicken flock status inspection and monitoring method according to claim 1, characterized in that: In step S2, the following steps are specifically included: S201. Using residual convolutional network to extract feather state, eye features and posture angle of visual image, and output 256-dimensional spatial feature vector; S202. Calculate the Mel-frequency cepstral coefficients after framing and windowing the sound signal, capture the temporal dependency of the calling frequency through a bidirectional gated recurrent unit, and output a 128-dimensional acoustic feature vector; S203. Combine the temperature and humidity data with the Hough transform path encoding of the motion trajectory to generate a 32-dimensional joint environment feature vector.
4. A chicken flock status inspection and monitoring method according to claim 1, characterized in that: In step S3, the following steps are specifically included: S301. Concatenate the spatial features, acoustic features and environmental features into a 416-dimensional mixed vector according to the dimensions; S302. Design a multi-head attention mechanism, calculate the correlation matrix of each feature subspace, and generate a weighted fusion feature vector; S303. Dynamically suppress redundant modal features through the gating unit and retain feature components that are strongly related to the current health status.
5. A chicken flock status inspection and monitoring method according to claim 1, characterized in that: In step S4, the following steps are specifically included: S401. Constructing a positive sample pair as a multimodal data enhancement sample under the same health state, and a negative sample pair as a cross-category sample of a healthy and abnormal state; S402. Optimizing the model using the cosine similarity loss function so that the distance between the positive sample pairs in the embedding space is less than a preset margin value; S403. Introduce a difficult sample mining strategy and give priority to selecting abnormal samples with high similarity to anchor samples to participate in training.
6. A chicken flock status inspection and monitoring method according to claim 1, characterized in that: In step S6, the following steps are specifically included: S601. Calculate the sliding mean of the abnormal score of the continuous T-frame data within the monitoring period With standard deviation ; S602. Update the dynamic threshold according to the formula: ; in For the current moment Dynamic warning thresholds, for The sliding mean of the abnormal score at the moment, for The standard deviation of the abnormal score at the moment, It is an adaptive coefficient, which is dynamically adjusted according to the frequency of abnormal events.
7. A chicken flock status inspection and monitoring method according to claim 1, characterized in that: In step S8, the following steps are specifically included: S801. Freeze the basic convolutional layers and recurrent neural network layers of the source domain model; S802. Fine-tune only the attention mechanism layer and the fully connected classifier on the target chicken house data; S803. Adopt domain adversarial training strategy to minimize the difference in feature distribution between source domain and target domain.
8. A chicken flock status inspection and monitoring method according to claim 1, characterized in that: In step S9, the following steps are specifically included: S901. Define the hyperparameter search space, including the number of network layers, the number of attention heads, and the learning rate range; S902. Generate candidate parameter combinations through crossover and mutation operations of a genetic algorithm; S903. Use the F1 score on the validation set as the fitness function and iterate and optimize until convergence.
9. A chicken flock status inspection and monitoring method according to claim 1, characterized in that: In step S7, the following steps are specifically included: S701. If the abnormal score is a local extreme value and lasts for more than 3 monitoring cycles, a first-level warning is triggered and the suspicious individual is marked; S702. If the score does not decrease after the first-level warning, the infection spread area is located by combining the movement trajectory cluster analysis, and the second-level warning is triggered.
10. A chicken flock status inspection and monitoring system, characterized in that: include: Data collection and preprocessing module: used to collect visual images, sound signals, environmental temperature and humidity, and individual activity trajectory data of the chickens, annotate the data, clarify the health status labels of different time periods, and perform preprocessing operations such as noise filtering, data alignment and normalization to build a multimodal data set; Feature extraction module: The preprocessed visual image is input into the convolutional neural network to extract spatial features. The sound signal is converted into a Mel spectrum and then input into the recurrent neural network to extract temporal features. The environmental data and activity trajectory data are combined to generate a joint feature vector through feature engineering. Feature fusion module: fuses the spatial features, temporal features and joint feature vectors to construct a multi-dimensional feature matrix, and uses an attention mechanism to dynamically allocate the weights of each modal feature to generate a fused feature vector; Model training module: A self-supervised comparative learning model is trained based on historical health data. By maximizing the similarity between healthy samples and minimizing the similarity between abnormal samples and healthy samples, a flock status discrimination model is generated. The hyperparameters of the discrimination model can be optimized in combination with a genetic algorithm, and the network depth and attention weight dimensions can be dynamically adjusted based on the flock size and environmental complexity. Real-time monitoring module: collects multimodal data of the chicken flock during the monitoring period in real time, generates real-time fusion feature vectors using the data collection and preprocessing module, feature extraction module, and feature fusion module, and inputs the discriminant model to calculate the health status probability; Early warning module: Generates anomaly scores based on probability distribution, combines dynamic threshold adjustment algorithm, and updates early warning thresholds based on the sliding window mean and variance of historical anomaly scores. If the anomaly score exceeds the current early warning threshold, a graded early warning signal is triggered, and the abnormal individual or area is located. Model adaptation module: Adapt the monitoring models of different chicken houses through the transfer learning algorithm, and fine-tune the model parameters using a small amount of labeled data of the target chicken house.
Citation Information
Patent Citations
Pig behavior and health method based on deep learning and physiological parameter dynamic monitoring
CN118986303A
Natural environment bird monitoring method based on multi-modal fusion deep learning and computer device
CN119027775A
Self-adaptive intelligent control method and system for poultry breeding environment
CN119126563A
Dynamic health adaptive monitoring method and system using artificial intelligence
CN119480112A
Intelligent pulmonary nodule grading method and system based on multi-modality feature fusion
WO2025020719A1
Cited By
Wild animal channel monitoring method based on infrared induction and AI identification
CN120198742A
Wildlife channel monitoring method based on infrared sensing and AI recognition
CN120198742B
Safety monitoring method and monitoring system for oil well construction
CN120541585A
Livestock and poultry health real-time monitoring method, device and system based on machine learning, and storage medium
CN120544914A
Livestock and poultry health real-time monitoring method and device based on machine learning, storage medium and system
CN120544914B