A deep learning-based intelligent monitoring and identification method and system for lizard mating behavior
By combining deep learning methods with lizard behavior feature enhancement modules and temporal attention modules, the real-time and accuracy issues of lizard mating behavior monitoring are solved, achieving efficient and interference-resistant lizard mating behavior recognition, which is suitable for large-scale monitoring in natural habitats and captive environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WENZHOU UNIV
- Filing Date
- 2026-04-21
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies cannot accurately and in real time monitor lizard mating behavior, and cannot adapt to scenarios with scarce samples. They also have weak anti-interference capabilities and cannot integrate environmental parameters, resulting in low monitoring efficiency, low recognition accuracy, and an inability to adapt to the characteristics of lizard mating behavior.
A deep learning-based intelligent monitoring and identification method for lizard mating behavior is adopted. Through multi-dimensional data fusion and sample optimization, an improved deep learning identification model is constructed. The model combines the Lizard Behavior Feature Enhancement Module (LBFE) and the Temporal Attention Module (TAM), and integrates environmental parameters as auxiliary features to achieve real-time monitoring and identification.
It enables accurate, real-time, and all-weather monitoring of lizard mating behavior, with an identification accuracy of ≥98.5% and a recall rate of ≥98%. It has strong anti-interference capabilities, adapts to different environments, and is suitable for large-scale monitoring in both natural habitats and captive environments.
Smart Images

Figure CN122454501A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of animal behavior monitoring and deep learning technology, specifically involving a deep learning-based intelligent monitoring and identification method and system for lizard mating behavior. It is applicable to real-time monitoring, identification and data analysis of mating behavior in lizards' natural habitats and captive environments, providing technical support for lizard behavior research and species conservation. Background Technology
[0002] As an important group of reptiles, lizards' mating behavior is a crucial link in species reproduction and population continuation. Accurate monitoring and identification of lizard mating behavior is of great significance for studying lizard reproductive habits, population dynamics, and ecological adaptability, and can also provide data support for the conservation of endangered lizard species. Currently, the monitoring and identification of lizard mating behavior mainly relies on manual observation and traditional monitoring methods. Manual observation requires staff to be on-site for extended periods, which is not only time-consuming and labor-intensive, but also susceptible to human interference, resulting in low monitoring accuracy and an inability to achieve all-weather, large-scale monitoring. Traditional monitoring methods often use ordinary cameras to collect video, combined with simple image processing techniques for behavior recognition. However, these methods suffer from low recognition accuracy, weak anti-interference capabilities, inability to distinguish mating behavior from similar non-mating behaviors (such as fighting), and inability to capture the temporal characteristics of behavior. Furthermore, they do not consider the influence of environmental parameters on lizard mating behavior, leading to unsatisfactory monitoring results.
[0003] In existing technologies, deep learning-based animal behavior detection methods are mostly applied to common animals such as livestock and poultry. Their model design and behavioral feature extraction are tailored to the behavioral characteristics of these animals and cannot be directly applied to the monitoring and identification of lizard mating behavior. Lizards are small in size, their limb movements are subtle, the duration of mating behavior varies greatly, and their behavior is easily affected by environmental parameters such as light, temperature, and humidity. Existing animal behavior detection models cannot accurately capture the key features of lizard mating behavior, which easily leads to false positives and false negatives. At the same time, existing technologies mostly use single image features for behavior recognition without incorporating environmental parameters to assist in recognition, making it difficult to improve recognition accuracy. In addition, existing models mostly rely on massive amounts of labeled samples. In scenarios where lizard mating behavior samples are scarce, the model training effect is poor, the generalization ability is weak, and the model parameters are large, making it difficult to deploy on embedded terminals and achieve real-time monitoring.
[0004] In view of the shortcomings of the existing technologies, there is an urgent need for a method and system that can accurately, in real time and in all weather conditions monitor and identify lizard mating behavior, adapt to scenarios with scarce samples and be easy to deploy, and integrate environmental parameters to assist in identification. This would solve the problems of low monitoring efficiency, low identification accuracy, weak anti-interference ability and inability to adapt to the characteristics of lizard mating behavior in the existing technologies. Summary of the Invention
[0005] To address the problems of high reliance on manual intervention, low recognition accuracy, weak anti-interference ability, inability to achieve real-time monitoring, lack of integration of environmental parameters, and poor model adaptability in existing technologies for monitoring and identifying lizard mating behavior, this invention provides a deep learning-based intelligent monitoring and identification method and system for lizard mating behavior. Through innovative model design, multi-dimensional data fusion, and sample optimization processing, it achieves accurate, real-time, and all-weather monitoring and identification of lizard mating behavior, while simultaneously recording relevant environmental parameters to provide data support for lizard behavior research.
[0006] The technical solution of this invention is implemented as follows: A method and system for intelligent monitoring and identification of lizard mating behavior based on deep learning, comprising the following steps: Step 1: Lizard Behavioral Data Collection and Preprocessing. A multi-dimensional adaptive collection scenario was constructed. High-definition infrared cameras and environmental sensors were deployed in different areas of the lizard habitat (including simulated natural and captive habitats) under varying lighting conditions. The camera acquisition frequency was set to 25-30 frames / second, and the resolution was adjusted to 1920×1080 pixels. The environmental sensors simultaneously collected environmental parameters such as light intensity, surface temperature, and air humidity in the monitored area. The collection time covered the lizard's active periods (6:00-18:00), with 8:00-14:00 being the key collection period to ensure the collection of complete mating behavior sequences, including chasing, tail biting, belly biting, mating, and separation, as well as non-mating behavior sequences (crawling, resting, foraging, and fighting). The collected video data underwent noise reduction preprocessing using an improved Gaussian filtering algorithm to remove image noise. The calculation formula is as follows:
[0007] in, Image pixel coordinates, The coordinates of the filter kernel center are, The standard deviation of the filter is 0.8-1.2. This formula is used to perform weighted smoothing on each pixel of the image to remove random noise and environmental interference. At the same time, the video frames are aligned and redundant frames are removed. Redundant frames with a similarity greater than 95% between adjacent frames are removed, and valid action frames are retained. The size of the valid frames is normalized and uniformly adjusted to 640×480 pixels to facilitate subsequent model input. Environmental parameters are normalized by mapping light intensity, surface temperature, and air humidity to the [0,1] interval, respectively, as auxiliary features for subsequent action recognition. Step 2: Construct a lizard behavior sample dataset. Manually annotate the preprocessed valid frames, including individual lizard bounding boxes and behavior categories (mating and non-mating behaviors). Mating behaviors are further subdivided into five stages: chasing, tail biting, belly biting, mating, and separation. Non-mating behaviors are subdivided into four stages: crawling, resting, foraging, and fighting. LabelImg is used for annotation, with an accuracy of at least 99%. The annotated sample dataset is divided into training, validation, and test sets in a 7:2:1 ratio. The training set is used for model training, the validation set for adjusting model hyperparameters, and the test set for verifying model recognition performance. To address the imbalanced sample problem, data augmentation is performed on the mating behavior samples in the training set using random flipping, rotation (0-30°), brightness adjustment (±15%), and contrast adjustment (±10%) to achieve a 1:1.2 ratio between mating behavior and non-mating behavior samples, preventing model training from biased towards non-mating behavior recognition. Step 3: Construct an improved deep learning recognition model. Based on YOLOv8 as the backbone network, it abandons the commonly used SPD convolutional module and CA attention mechanism in existing technologies, and innovatively adds a Lizard Behavior Feature Enhancement (LBFE) module and a Temporal Attention (TAM) module. The LBFE module extracts key features such as lizard body contours, limb movements, and individual interactions. It extracts features from the input image using multi-scale convolutional kernels (3×3, 5×5, 7×7), fusing feature maps of different scales to enhance the ability to capture subtle lizard movements (such as tail biting and belly biting). The TAM module captures temporal correlation features in video frame sequences. By calculating the feature differences between adjacent frames, it focuses on the continuity of behavioral actions, reducing misjudgments in a single frame. The model's loss function adopts an improved hybrid loss function, combining cross-entropy loss and cross-union loss, calculated as follows:
[0008] in, This is the total loss value. Cross-entropy loss is used to optimize the accuracy of behavior category recognition. The intersection-union loss is used to optimize the localization accuracy of individual lizard bounding boxes. The weighting coefficient is 0.6-0.7, and this loss function is used to simultaneously optimize the model's localization accuracy and classification accuracy. Step 4: Model Training and Optimization. Input the training set into the improved deep learning recognition model, set the initial learning rate to 0.001, and use the Adaptive Momentum Optimization (AdamW) algorithm for model training. Set the training batch size to 16, and the number of training iterations to 100-120 rounds. Validate the model with a validation set every 10 rounds, and calculate the model's recognition accuracy, recall, and F1 score. If the validation set accuracy does not improve for 10 consecutive rounds, stop training using an early stopping strategy to avoid overfitting. After training, use a test set to test the model's performance, ensuring that the model's recognition accuracy for lizard mating behavior is not less than 98.5%, recall is not less than 98%, and F1 score is not less than 98.2%. Perform lightweight optimization on the model, removing redundant convolutional layers and compressing the model parameters to below 50MB for easy embedded deployment. Step 5: Real-time monitoring and identification. The optimized deep learning identification model is deployed to the monitoring terminal to receive video data from the camera and environmental parameters from the environmental sensors in real time. The video data is processed in real time to extract lizard features and environmental auxiliary features from each frame. These are then input into the model for behavior identification, and the model outputs behavior category, behavior confidence score, number of lizards, and location information. When mating behavior is detected, the start time, end time, behavior stage, and corresponding environmental parameters are automatically recorded. The duration of the mating behavior is calculated, and an early warning signal is triggered when the duration of the mating behavior is abnormal (less than 30 minutes or more than 300 minutes). The identification results are stored in real time to form a lizard mating behavior monitoring log for subsequent data statistics and analysis. Step 6: Correction and feedback of identification results. The identification results output by the monitoring terminal are manually reviewed regularly. Misjudged or missed samples are marked and added to the training set. The model is iteratively optimized using incremental training, with incremental training every 30 days and 20-30 iterations per iteration. This ensures that the model adapts to subtle changes in lizard behavior and environmental changes, continuously improving identification accuracy. At the same time, based on the data in the monitoring logs, the correlation between lizard mating behavior and environmental parameters is analyzed to establish a correlation model, providing data support for lizard behavior research.
[0009] Further, the environmental sensors mentioned in step 1 include a light intensity sensor, a surface temperature sensor, and an air humidity sensor. The light intensity sensor has a measurement range of 0-2000×10²lx and a measurement accuracy of ±5×10²lx; the surface temperature sensor has a measurement range of 0-60℃ and a measurement accuracy of ±0.1℃; the air humidity sensor has a measurement range of 0-100%RH and a measurement accuracy of ±1%RH. The environmental parameter acquisition frequency is consistent with the camera acquisition frequency, both being 25-30 times / second, ensuring that the environmental parameters are synchronized with the video frames in time. The environmental parameter normalization process uses the min-max normalization method, and the calculation formula is as follows:
[0010] in, Here are the normalized environmental parameter values, and x represents the original environmental parameter values. This is the minimum value of the environmental parameter. This is the maximum value of the environmental parameter. This formula maps environmental parameters of different magnitudes to the [0,1] interval, eliminating the influence of dimensions and facilitating fusion with image features.
[0011] Furthermore, the manual annotation described in step 2 adopts a two-person cross-annotation mode, where two annotators annotate the same batch of samples respectively. After the annotation is completed, cross-checking is performed. When the annotations are inconsistent, a third-party professional will review and confirm them to ensure that the annotation accuracy rate is not less than 99%. The sample dataset is divided using stratified sampling to ensure that the proportion of mating behavior and non-mating behavior, as well as the proportion of each sub-behavioral stage, are consistent across the training set, validation set, and test set, thus avoiding model training imbalance caused by dataset partitioning bias. During data augmentation, random flipping is achieved by combining horizontal and vertical flipping with a flipping probability of 50%. The rotation angle is randomly selected from 0 to 30°. Brightness and contrast are adjusted using random perturbation to ensure that the augmented sample retains the key features of lizard behavior without distortion.
[0012] Furthermore, the lizard behavior feature enhancement module (LBFE) described in step 3 includes three parallel multi-scale convolutional units and one feature fusion unit. Each multi-scale convolutional unit consists of three types of convolutional kernels: 3×3, 5×5, and 7×7. Each convolutional kernel is followed by a batch normalization (BN) layer and an activation function (SiLU) to suppress gradient vanishing and accelerate model training. The feature fusion unit adopts an attention-weighted fusion method, which sums the feature maps output by the three multi-scale convolutional units in a weighted manner. The weight coefficients are obtained through adaptive learning during model training, highlighting the features of lizard limb movements and individual interactions. The temporal attention module (TAM) is based on a bidirectional long short-term memory network (Bi-LSTM) and incorporates an attention mechanism to process the feature sequences of adjacent 5-8 frames, calculate the attention weight of each frame's features, focus on the changing trends of behavioral actions, reduce the influence of environmental interference and random actions, and improve the model's ability to recognize continuous behaviors.
[0013] Furthermore, the adaptive momentum optimization algorithm (AdamW) described in step 4 has the following parameters: β1=0.9, β2=0.999, weight decay coefficient of 0.001, and the learning rate is dynamically adjusted using a cosine annealing strategy. The learning rate decay formula is as follows:
[0014] in Let be the learning rate in round t. The initial learning rate is 0.001, t is the current training round, and T is the total number of training rounds (100-120 rounds). The early stopping strategy is based on the following criteria: when the recognition accuracy of the validation set improves by less than 0.1% for 10 consecutive rounds, training is stopped and the current best model is saved. The lightweight model optimization adopts knowledge distillation technology, using the trained complex model as the teacher model to build a lightweight student model. The feature knowledge of the teacher model is transferred to the student model. Under the premise of ensuring that the recognition accuracy does not decrease by more than 0.5%, the model parameters are compressed, which is convenient for deployment on embedded terminals.
[0015] Furthermore, the real-time monitoring and recognition described in step 5 adopts an edge computing mode, deploying the improved deep learning recognition model to the embedded monitoring terminal to avoid the delay caused by data transmission to the cloud and ensure that the recognition delay does not exceed 100ms; The threshold for behavior confidence is set to 0.85. When the behavior confidence of the model output is greater than or equal to 0.85, it is judged as a valid recognition result. When it is less than 0.85, it is judged as an uncertain behavior and triggers a manual review reminder. The criteria for judging abnormal mating behavior warnings are: the duration of mating behavior is less than 30 minutes or more than 300 minutes. The warning signals include audible and visual warnings and remote push warnings. Audible and visual warnings are implemented through indicator lights and speakers on the monitoring terminal, while remote push warnings are sent to relevant staff via SMS and APP push to ensure that staff can handle the situation in a timely manner.
[0016] Furthermore, in the incremental training described in step 6, 5%-10% of the original training set samples are selected from manually reviewed and marked misjudged and missed samples. These samples, along with a portion of the original training set (30% of the original training set samples), form the incremental training set. The parameters of the original model are used as the initial parameters for incremental training. The batch size is set to 8, the learning rate is adjusted to 0.0001, and the number of iterations is 20-30 rounds. After training is completed, the original model is replaced to achieve iterative optimization of the model. A correlation model between lizard mating behavior and environmental parameters was established using multiple linear regression analysis. The duration and frequency of mating behavior were used as dependent variables, and light intensity, surface temperature, and air humidity were used as independent variables. The correlation equation was used to predict the probability and duration of lizard mating behavior under different environmental parameters.
[0017] Furthermore, it includes a data acquisition module, a data preprocessing module, a sample dataset construction module, an improved deep learning recognition model module, a real-time monitoring and recognition module, a result correction and feedback module, a data storage module, and an early warning module. These modules are interconnected and work together. The data acquisition module includes a high-definition infrared camera and a multi-dimensional environmental sensor. The high-definition infrared camera is used to collect video data of lizard behavior, supports a collection frequency of 25-30 frames / second and a resolution of 1920×1080 pixels, and has infrared night vision function, which can collect data normally under low light conditions (light intensity below 50×10²lx). The multi-dimensional environmental sensors include light intensity sensors, surface temperature sensors, and air humidity sensors, which are used to synchronously collect environmental parameters of the monitoring area. The collection frequency is consistent with that of the camera to ensure time synchronization. The data acquisition module can automatically adjust the acquisition mode according to the lizard's active periods. It uses a high-definition acquisition mode during peak periods (8:00-14:00) and an energy-saving acquisition mode during non-peak periods to reduce energy consumption. The data preprocessing module, connected to the data acquisition module, receives video data and environmental parameters output by the data acquisition module. It performs noise reduction, frame alignment, redundant frame removal, and size normalization on the video data, and normalizes the environmental parameters to remove noise and redundant information. It outputs preprocessed effective frame images, temporal feature data, and normalized environmental parameters to provide high-quality data for subsequent sample construction and model recognition. The sample dataset construction module, connected to the data preprocessing module, is used to receive the preprocessed valid data, perform manual annotation, sample segmentation, and data augmentation on the valid frame images, and construct training, validation, and test sets. The annotation content includes the lizard individual bounding boxes, behavior categories, and subdivided behavior stages. Data augmentation uses random flipping, rotation, brightness adjustment, and contrast adjustment to solve the sample imbalance problem and output a standardized lizard behavior sample dataset. An improved deep learning recognition model module, connected to a sample dataset construction module, includes a lizard behavior feature enhancement module (LBFE), a temporal attention module (TAM), and a lightweight optimization unit. Using YOLOv8 as the backbone network, it is trained and optimized through a sample dataset to output a trained lizard mating behavior recognition model. This model can accurately identify lizard mating and non-mating behaviors and output information such as behavior category, confidence level, and individual location. The real-time monitoring and recognition module is connected to the data acquisition module, the data preprocessing module, and the improved deep learning recognition model module, respectively. It is used to receive real-time video data and environmental parameters, and after preprocessing, input them into the recognition model to realize real-time behavior recognition and output recognition results, including behavior category, behavior confidence, number of lizards, location information and corresponding environmental parameters, while recording the time information of the behavior occurrence. The result correction feedback module is connected to the real-time monitoring and recognition module. It is used to receive real-time recognition results, organize manual review, mark misjudged and missed samples, input the marked samples into the sample dataset construction module, trigger incremental model training, realize iterative optimization of the model, and analyze the correlation between recognition results and environmental parameters to establish a correlation model. The data storage module is connected to the real-time monitoring and identification module and the result correction and feedback module. It is used to store the pre-processed effective data, sample datasets, trained model parameters, real-time identification results, monitoring logs and related model data. It adopts a combination of local storage and cloud backup. The local storage uses solid-state drives with a storage capacity of no less than 1TB. The cloud backup uses encrypted storage to ensure data security and the storage time is no less than 1 year. The early warning module, connected to the real-time monitoring and identification module, is used to receive real-time identification results. When the duration of mating behavior is abnormal (less than 30 minutes or more than 300 minutes) or the identification confidence level is lower than 0.85, an early warning signal is triggered, including audible and visual warnings and remote push warnings. The audible and visual warnings are implemented through indicator lights and speakers, while the remote push warnings are sent to staff via SMS and APP push. At the same time, the warning information is recorded for subsequent traceability.
[0018] Furthermore, the high-definition infrared camera in the data acquisition module adopts an adjustable angle gimbal design, with an adjustment angle range of 0-360° horizontal rotation and 0-90° vertical rotation. The acquisition angle can be adjusted remotely to ensure coverage of the entire monitoring area without any blind spots. The camera is waterproof, dustproof, and corrosion-resistant, with a protection rating of no less than IP67, making it suitable for complex outdoor environments. Its operating temperature range is -20℃ to 60℃. The environmental sensor is embedded in the ground, with the installation position 0.5-1.0m above the ground to avoid direct sunlight and immersion in rainwater, ensuring measurement accuracy.
[0019] Furthermore, the real-time monitoring and identification module adopts an edge computing terminal, equipped with an ARM Cortex-A76 processor, with no less than 8GB of memory and no less than 64GB of storage capacity, and supports WiFi and 4G / 5G network connections, enabling real-time data transmission and remote control. The system also includes a human-computer interaction module, which is connected to the real-time monitoring and recognition module and the data storage module. It adopts a touch screen design and can display the monitoring screen, recognition results, environmental parameters and early warning information in real time. It supports manual operation, including parameter setting, model update, data query and manual review functions. The system can flexibly increase or decrease the number of monitoring terminals according to actual monitoring needs, support multi-terminal collaborative work, and achieve full coverage monitoring of a large area of lizard habitat.
[0020] The embodiments of the present invention have the following advantages due to the adoption of the above technical solutions: 1. Abandoning commonly used modules in existing animal behavior detection models (SPD convolution, CA attention mechanism), we innovatively designed a lizard behavior feature enhancement module (LBFE) and a temporal attention module (TAM) to adapt to the characteristics of lizards' small size, subtle limb movements, and strong temporal sequence of mating behavior, thus solving the problem that existing models cannot accurately identify lizard mating behavior; we also integrate environmental parameters as auxiliary features, which work together with image features to improve recognition accuracy, thus differentiating ourselves from existing single image feature recognition technologies.
[0021] 2. High recognition accuracy and strong anti-interference ability: Through improved hybrid loss function, data augmentation, incremental training and other technologies, the accuracy of lizard mating behavior recognition is ≥98.5% and the recall rate is ≥98%. It can effectively distinguish mating behavior from similar non-mating behavior (such as fighting), resist environmental interference such as light and noise, and has low false positive and false negative rates.
[0022] 3. Good real-time performance and easy deployment: Adopting edge computing mode, the model is optimized to have parameters ≤50MB and recognition latency ≤100ms. It can be deployed on embedded terminals to achieve all-weather, real-time monitoring without the need for on-site staff, thus reducing labor intensity.
[0023] 4. Highly practical and with ample data support: It can automatically record the time, stage, and environmental parameters of lizard mating behavior, forming a complete monitoring log and establishing a correlation model between behavior and environmental parameters. This provides accurate and comprehensive data support for lizard behavior research and species conservation, and is suitable for large-scale monitoring of natural habitats and captive environments.
[0024] 5. High adaptability: By using data augmentation and incremental training techniques, the model solves the problem of scarce lizard mating behavior samples. It can adapt to the recognition of mating behavior in different species of lizards and different environments. It has strong generalization ability and can flexibly adjust monitoring parameters to adapt to different monitoring scenarios.
[0025] The above overview is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments, and features described above, further aspects, embodiments, and features of the invention will become readily apparent from the accompanying drawings and the following detailed description. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 This is an overall flowchart of the intelligent monitoring and recognition method for lizard mating behavior according to the present invention; Figure 2 This is a detailed flowchart of the data acquisition and preprocessing process of the present invention. Detailed Implementation
[0028] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope of the invention. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.
[0029] Example 1: A Deep Learning-Based Intelligent Monitoring and Recognition Method for Lizard Mating Behavior
[0030] This embodiment focuses on monitoring and identifying the mating behavior of captive Takydromus (Takydromus septentrionalis). The specific steps are as follows: 1. Data Acquisition and Preprocessing Five high-definition infrared cameras were deployed at the four corners and center of the 3m×2m enclosure. These cameras feature a pan-tilt design, allowing 360° rotation, and a data acquisition frequency of 28 frames per second. The resolution was 1920×1080 pixels, with infrared night vision enabled. Data acquisition was conducted from 6:00 to 18:00, with high-definition acquisition mode used from 8:00 to 14:00, and energy-saving acquisition mode used during the remaining hours. Six environmental sensors were evenly distributed throughout the enclosure to collect data on light intensity, surface temperature, and air humidity. The data acquisition frequency was 28 times per second. The light intensity sensor had a measurement range of 0-2000×10²lx and an accuracy of ±5×10²lx; the surface temperature sensor had a measurement range of 0-60℃ and an accuracy of ±0.1℃; and the air humidity sensor had a measurement range of 0-100%RH and an accuracy of ±1%RH.
[0031] The acquired video data is preprocessed using an improved Gaussian filtering algorithm for noise reduction, with σ=1.0. The calculation formula is as follows:
[0032] Noise removal; frame alignment of video frames to correct offsets caused by gimbal jitter; removal of redundant frames with a similarity ≥95% between adjacent frames; normalization of effective frames to 640×480 pixels. Min-max normalization of environmental parameters; for example, the original range of light intensity is (50-1800)×10²lx, which is normalized and mapped to the [0,1] interval. The calculation formula is:
[0033] 2. Sample Dataset Construction
[0034] The LabelImg tool was used to perform two-person cross-annotation on the preprocessed valid frames, annotating the individual lizard bounding boxes, behavior categories, and subdivision stages, achieving an accuracy of 99.2%. A total of 12,000 frames were annotated, including 5,000 frames of mating behavior (1,000 frames of chasing, 500 frames of tail biting, 800 frames of belly biting, 2,200 frames of mating, and 500 frames of separation) and 7,000 frames of non-mating behavior (2,500 frames of crawling, 2,000 frames of resting, 1,500 frames of foraging, and 1,000 frames of fighting). The frames were divided into a training set of 8,400 frames, a validation set of 2,400 frames, and a test set of 1,200 frames in a 7:2:1 ratio. Data augmentation was performed on the mating behavior samples in the training set, resulting in 6,720 frames of mating behavior and 7,000 frames of non-mating behavior, with a ratio of 1:1.04 to balance the sample size.
[0035] 3. Construction of an improved deep learning recognition model
[0036] Using YOLOv8 as the backbone network, two modules, LBFE and TAM, are added. The LBFE module contains three parallel multi-scale convolutional units, employing 3×3, 5×5, and 7×7 kernels respectively. After convolution, a BN layer and a SiLU activation function are connected. The feature fusion unit uses attention-weighted fusion. The TAM module is based on Bi-LSTM, processing feature sequences from six adjacent frames and calculating attention weights. An improved hybrid loss function, α=0.65, is used, calculated using the following formula: .
[0037] 4. Model Training and Optimization
[0038] The training set is input into the model with an initial learning rate of 0.001. The AdamW optimization algorithm (β1=0.9, β2=0.999, weight decay 0.001) is used, with a batch size of 16 and 110 iterations. Validation is performed every 10 iterations using a validation set. The learning rate employs a cosine annealing strategy, with the following formula:
[0039] Training was stopped and the optimal model was saved when the accuracy on the validation set improved by less than 0.1% for 10 consecutive rounds. Test set results: mating behavior recognition accuracy 98.8%, recall 98.3%, F1 score 98.5%. Lightweight optimization using knowledge distillation technology compressed the model parameters to 48MB, with a 0.3% decrease in accuracy.
[0040] 5. Real-time monitoring and identification
[0041] The model is deployed on an ARM Cortex-A76 edge terminal to receive video and environmental parameters in real time, with a recognition latency of 85ms and a behavior confidence threshold of 0.85. When mating behavior is detected, the start time, end time, sub-stage, and environmental parameters are recorded, and the duration is calculated. When the duration is <30 minutes or >300 minutes, an audible and visual alarm and an app push notification are triggered.
[0042] 6. Recognition Result Correction and Feedback
[0043] The identification results were manually reviewed weekly. 420 frames of misclassified or missed samples were marked and added to the training set, forming an incremental training set with the original training set of 2520 frames. The learning rate was 0.0001, the batch size was 8, and the model was updated after 25 iterations. Based on the monitoring logs, a correlation model between the mating behavior of the Northern Grass Lizard and environmental parameters was established. A positive correlation was found between surface temperature and the duration of mating behavior (r=0.83). Unlike the simple correlation analysis in existing technologies, this correlation model can predict the duration of mating behavior under different surface temperatures.
[0044] Example 2: A Deep Learning-Based Intelligent Monitoring and Recognition System for Lizard Mating Behavior
[0045] The system in this embodiment corresponds to the method in embodiment 1, including: Data acquisition module: 5 high-definition infrared cameras (pan-tilt design, IP67 protection, infrared night vision), 6 environmental sensors (light intensity, ground temperature, air humidity), synchronously acquiring video and environmental parameters.
[0046] Data preprocessing module: Deployed on the edge terminal, it completes video denoising, frame alignment, redundant frame removal, size normalization, and environmental parameter normalization.
[0047] Sample dataset construction module: Equipped with the LabelImg annotation tool, supporting two-person cross-annotation, sample splitting, and data augmentation.
[0048] Improved deep learning recognition model module: includes LBFE module, TAM module, lightweight optimization unit, and stores trained model parameters.
[0049] Real-time monitoring and recognition module: ARM Cortex-A76 edge terminal, 8GB memory, 64GB storage, supports WiFi and 4G connectivity, and outputs recognition results in real time.
[0050] Result correction and feedback module: Supports manual review and labeling, triggers incremental training, and builds a model relating behavior and environmental parameters.
[0051] Data storage module: 1TB solid-state drive for local storage, encrypted cloud backup, storage time of 1.5 years.
[0052] Warning module: indicator lights, speaker (audio-visual warning), supports APP push warnings, and records warning information.
[0053] Human-computer interaction module: 10-inch touch screen, supporting parameter setting, model update, data query, and manual review.
[0054] The system operates stably and can monitor and identify the mating behavior of captive grass lizards in real time around the clock. It has high identification accuracy and timely warnings, providing reliable data support for lizard behavior research.
[0055] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various variations or substitutions within the technical scope disclosed in the present invention, and these should all be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method and system for intelligent monitoring and identification of lizard mating behavior based on deep learning, characterized in that, Includes the following steps: Step 1: Lizard Behavioral Data Collection and Preprocessing. A multi-dimensional adaptive collection scenario was constructed. High-definition infrared cameras and environmental sensors were deployed in different areas of the lizard habitat (including simulated natural and captive habitats) under varying lighting conditions. The camera acquisition frequency was set to 25-30 frames / second, and the resolution was adjusted to 1920×1080 pixels. The environmental sensors simultaneously collected environmental parameters such as light intensity, surface temperature, and air humidity in the monitored area. The collection time covered the lizard's active periods (6:00-18:00), with 8:00-14:00 being the key collection period to ensure the collection of complete mating behavior sequences, including chasing, tail biting, belly biting, mating, and separation, as well as non-mating behavior sequences (crawling, resting, foraging, and fighting). The collected video data underwent noise reduction preprocessing using an improved Gaussian filtering algorithm to remove image noise. The calculation formula is as follows: in, Image pixel coordinates, The coordinates of the filter kernel center are, The standard deviation of the filter is 0.8-1.
2. This formula is used to perform weighted smoothing on each pixel of the image to remove random noise and environmental interference. At the same time, the video frames are aligned and redundant frames are removed. Redundant frames with a similarity greater than 95% between adjacent frames are removed, and valid action frames are retained. The size of the valid frames is normalized and uniformly adjusted to 640×480 pixels to facilitate subsequent model input. Environmental parameters are normalized by mapping light intensity, surface temperature, and air humidity to the [0,1] interval, respectively, as auxiliary features for subsequent action recognition. Step 2: Construct a lizard behavior sample dataset. Manually annotate the preprocessed valid frames, including individual lizard bounding boxes and behavior categories (mating and non-mating behaviors). Mating behaviors are further subdivided into five stages: chasing, tail biting, belly biting, mating, and separation. Non-mating behaviors are subdivided into four stages: crawling, resting, foraging, and fighting. LabelImg is used for annotation, with an accuracy of at least 99%. The annotated sample dataset is divided into training, validation, and test sets in a 7:2:1 ratio. The training set is used for model training, the validation set for adjusting model hyperparameters, and the test set for verifying model recognition performance. To address the imbalanced sample problem, data augmentation is performed on the mating behavior samples in the training set using random flipping, rotation (0-30°), brightness adjustment (±15%), and contrast adjustment (±10%) to achieve a 1:1.2 ratio between mating behavior and non-mating behavior samples, preventing model training from biased towards non-mating behavior recognition. Step 3: Construct an improved deep learning recognition model. Based on YOLOv8 as the backbone network, it abandons the commonly used SPD convolutional module and CA attention mechanism in existing technologies, and innovatively adds a Lizard Behavior Feature Enhancement (LBFE) module and a Temporal Attention (TAM) module. The LBFE module extracts key features such as lizard body contours, limb movements, and individual interactions. It extracts features from the input image using multi-scale convolutional kernels (3×3, 5×5, 7×7), fusing feature maps of different scales to enhance the ability to capture subtle lizard movements (such as tail biting and belly biting). The TAM module captures temporal correlation features in video frame sequences. By calculating the feature differences between adjacent frames, it focuses on the continuity of behavioral actions, reducing misjudgments in a single frame. The model's loss function adopts an improved hybrid loss function, combining cross-entropy loss and cross-union loss, calculated as follows: in, This is the total loss value. Cross-entropy loss is used to optimize the accuracy of behavior category recognition. The intersection-union loss is used to optimize the localization accuracy of individual lizard bounding boxes. The weighting coefficient is 0.6-0.7, and this loss function is used to simultaneously optimize the model's localization accuracy and classification accuracy. Step 4: Model Training and Optimization. Input the training set into the improved deep learning recognition model, set the initial learning rate to 0.001, and use the Adaptive Momentum Optimization (AdamW) algorithm for model training. Set the training batch size to 16, and the number of training iterations to 100-120 rounds. Validate the model with a validation set every 10 rounds, and calculate the model's recognition accuracy, recall, and F1 score. If the validation set accuracy does not improve for 10 consecutive rounds, stop training using an early stopping strategy to avoid overfitting. After training, use a test set to test the model's performance, ensuring that the model's recognition accuracy for lizard mating behavior is not less than 98.5%, recall is not less than 98%, and F1 score is not less than 98.2%. Perform lightweight optimization on the model, removing redundant convolutional layers and compressing the model parameters to below 50MB for easy embedded deployment. Step 5: Real-time monitoring and identification. The optimized deep learning identification model is deployed to the monitoring terminal to receive video data from the camera and environmental parameters from the environmental sensors in real time. The video data is processed in real time to extract lizard features and environmental auxiliary features from each frame. These are then input into the model for behavior identification, and the model outputs behavior category, behavior confidence score, number of lizards, and location information. When mating behavior is detected, the start time, end time, behavior stage, and corresponding environmental parameters are automatically recorded. The duration of the mating behavior is calculated, and an early warning signal is triggered when the duration of the mating behavior is abnormal (less than 30 minutes or more than 300 minutes). The identification results are stored in real time to form a lizard mating behavior monitoring log for subsequent data statistics and analysis. Step 6: Correction and feedback of identification results. The identification results output by the monitoring terminal are manually reviewed regularly. Misjudged or missed samples are marked and added to the training set. The model is iteratively optimized using incremental training, with incremental training every 30 days and 20-30 iterations per iteration. This ensures that the model adapts to subtle changes in lizard behavior and environmental changes, continuously improving identification accuracy. At the same time, based on the data in the monitoring logs, the correlation between lizard mating behavior and environmental parameters is analyzed to establish a correlation model, providing data support for lizard behavior research.
2. The intelligent monitoring and identification method and system for lizard mating behavior based on deep learning according to claim 1, characterized in that: The environmental sensors mentioned in step 1 include a light intensity sensor, a surface temperature sensor, and an air humidity sensor. The light intensity sensor has a measurement range of 0-2000×10²lx and a measurement accuracy of ±5×10²lx; the surface temperature sensor has a measurement range of 0-60℃ and a measurement accuracy of ±0.1℃; and the air humidity sensor has a measurement range of 0-100%RH and a measurement accuracy of ±1%RH. The environmental parameter acquisition frequency is consistent with the camera acquisition frequency, both being 25-30 times / second, ensuring that the environmental parameters are synchronized with the video frames. The environmental parameter normalization process uses the min-max normalization method, and the calculation formula is as follows: in, Here are the normalized environmental parameter values, and x represents the original environmental parameter values. This is the minimum value of the environmental parameter. This is the maximum value of the environmental parameter. This formula maps environmental parameters of different magnitudes to the [0,1] interval, eliminating the influence of dimensions and facilitating fusion with image features.
3. The intelligent monitoring and identification method and system for lizard mating behavior based on deep learning according to claim 1, characterized in that: The manual annotation described in step 2 adopts a two-person cross-annotation mode, in which two annotators annotate the same batch of samples respectively. After the annotation is completed, cross-checking is performed. When the annotations are inconsistent, a third-party professional will review and confirm them to ensure that the annotation accuracy rate is not less than 99%. The sample dataset is divided using stratified sampling to ensure that the proportion of mating behavior and non-mating behavior, as well as the proportion of each sub-behavioral stage, are consistent across the training set, validation set, and test set, thus avoiding model training imbalance caused by dataset partitioning bias. During data augmentation, random flipping is achieved by combining horizontal and vertical flipping with a flipping probability of 50%. The rotation angle is randomly selected from 0 to 30°. Brightness and contrast are adjusted using random perturbation to ensure that the augmented sample retains the key features of lizard behavior without distortion.
4. The intelligent monitoring and identification method and system for lizard mating behavior based on deep learning according to claim 1, characterized in that: The lizard behavior feature enhancement module (LBFE) described in step 3 includes three parallel multi-scale convolutional units and one feature fusion unit. Each multi-scale convolutional unit consists of three types of convolutional kernels: 3×3, 5×5, and 7×7. Each convolutional kernel is followed by a batch normalization (BN) layer and an activation function (SiLU) to suppress gradient vanishing and accelerate model training. The feature fusion unit adopts an attention-weighted fusion method, which sums the feature maps output by the three multi-scale convolutional units in a weighted manner. The weight coefficients are obtained through adaptive learning during model training, highlighting the features of lizard limb movements and individual interactions. The temporal attention module (TAM) is based on a bidirectional long short-term memory network (Bi-LSTM) and incorporates an attention mechanism to process the feature sequences of adjacent 5-8 frames, calculate the attention weight of each frame's features, focus on the changing trends of behavioral actions, reduce the influence of environmental interference and random actions, and improve the model's ability to recognize continuous behaviors.
5. The intelligent monitoring and identification method and system for lizard mating behavior based on deep learning according to claim 1, characterized in that: The adaptive momentum optimization algorithm (AdamW) described in step 4 has the following parameters: β1=0.9, β2=0.999, weight decay coefficient of 0.001, and the learning rate is dynamically adjusted using a cosine annealing strategy. The learning rate decay formula is as follows: in Let be the learning rate in round t. The initial learning rate is 0.001, t is the current training round, and T is the total number of training rounds (100-120 rounds). The early stopping strategy is based on the following criteria: when the recognition accuracy of the validation set improves by less than 0.1% for 10 consecutive rounds, training is stopped and the current best model is saved. The lightweight model optimization adopts knowledge distillation technology, using the trained complex model as the teacher model to build a lightweight student model. The feature knowledge of the teacher model is transferred to the student model. Under the premise of ensuring that the recognition accuracy does not decrease by more than 0.5%, the model parameters are compressed, which is convenient for deployment on embedded terminals.
6. The intelligent monitoring and identification method and system for lizard mating behavior based on deep learning according to claim 1, characterized in that: The real-time monitoring and recognition described in step 5 adopts an edge computing mode, which deploys the improved deep learning recognition model to the embedded monitoring terminal to avoid the delay caused by data transmission to the cloud and ensures that the recognition delay does not exceed 100ms. The threshold for behavior confidence is set to 0.
85. When the behavior confidence of the model output is greater than or equal to 0.85, it is judged as a valid recognition result. When it is less than 0.85, it is judged as an uncertain behavior and triggers a manual review reminder. The criteria for judging abnormal mating behavior warnings are: the duration of mating behavior is less than 30 minutes or more than 300 minutes. The warning signals include audible and visual warnings and remote push warnings. Audible and visual warnings are implemented through indicator lights and speakers on the monitoring terminal, while remote push warnings are sent to relevant staff via SMS and APP push to ensure that staff can handle the situation in a timely manner.
7. The intelligent monitoring and identification method and system for lizard mating behavior based on deep learning according to claim 1, characterized in that: In the incremental training described in step 6, 5%-10% of the original training set samples are selected from manually reviewed and marked misjudged and missed samples. These samples are combined with a portion of the original training set (30% of the original training set samples) to form the incremental training set. The parameters of the original model are used as the initial parameters for incremental training. The batch size is set to 8, the learning rate is adjusted to 0.0001, and the number of iterations is 20-30 rounds. After training is completed, the original model is replaced to achieve iterative optimization of the model. A correlation model between lizard mating behavior and environmental parameters was established using multiple linear regression analysis. The duration and frequency of mating behavior were used as dependent variables, and light intensity, surface temperature, and air humidity were used as independent variables. The correlation equation was used to predict the probability and duration of lizard mating behavior under different environmental parameters.
8. A method and system for intelligent monitoring and identification of lizard mating behavior based on deep learning according to any one of claims 1-7, characterized in that: It includes a data acquisition module, a data preprocessing module, a sample dataset construction module, an improved deep learning recognition model module, a real-time monitoring and recognition module, a result correction and feedback module, a data storage module, and an early warning module. These modules are interconnected and work together. The data acquisition module includes a high-definition infrared camera and a multi-dimensional environmental sensor. The high-definition infrared camera is used to collect video data of lizard behavior, supports a collection frequency of 25-30 frames / second and a resolution of 1920×1080 pixels, and has infrared night vision function, which can collect data normally under low light conditions (light intensity below 50×10²lx). The multi-dimensional environmental sensors include light intensity sensors, surface temperature sensors, and air humidity sensors, which are used to synchronously collect environmental parameters of the monitoring area. The collection frequency is consistent with that of the camera to ensure time synchronization. The data acquisition module can automatically adjust the acquisition mode according to the lizard's active periods. It uses a high-definition acquisition mode during peak periods (8:00-14:00) and an energy-saving acquisition mode during non-peak periods to reduce energy consumption. The data preprocessing module, connected to the data acquisition module, receives video data and environmental parameters output by the data acquisition module. It performs noise reduction, frame alignment, redundant frame removal, and size normalization on the video data, and normalizes the environmental parameters to remove noise and redundant information. It outputs preprocessed effective frame images, temporal feature data, and normalized environmental parameters to provide high-quality data for subsequent sample construction and model recognition. The sample dataset construction module, connected to the data preprocessing module, is used to receive the preprocessed valid data, perform manual annotation, sample segmentation, and data augmentation on the valid frame images, and construct training, validation, and test sets. The annotation content includes the lizard individual bounding boxes, behavior categories, and subdivided behavior stages. Data augmentation uses random flipping, rotation, brightness adjustment, and contrast adjustment to solve the sample imbalance problem and output a standardized lizard behavior sample dataset. An improved deep learning recognition model module, connected to a sample dataset construction module, includes a lizard behavior feature enhancement module (LBFE), a temporal attention module (TAM), and a lightweight optimization unit. Using YOLOv8 as the backbone network, it is trained and optimized through a sample dataset to output a trained lizard mating behavior recognition model. This model can accurately identify lizard mating and non-mating behaviors and output information such as behavior category, confidence level, and individual location. The real-time monitoring and recognition module is connected to the data acquisition module, the data preprocessing module, and the improved deep learning recognition model module, respectively. It is used to receive real-time video data and environmental parameters, and after preprocessing, input them into the recognition model to realize real-time behavior recognition and output recognition results, including behavior category, behavior confidence, number of lizards, location information and corresponding environmental parameters, while recording the time information of the behavior occurrence. The result correction feedback module is connected to the real-time monitoring and recognition module. It is used to receive real-time recognition results, organize manual review, mark misjudged and missed samples, input the marked samples into the sample dataset construction module, trigger incremental model training, realize iterative optimization of the model, and analyze the correlation between recognition results and environmental parameters to establish a correlation model. The data storage module is connected to the real-time monitoring and identification module and the result correction and feedback module. It is used to store the pre-processed effective data, sample datasets, trained model parameters, real-time identification results, monitoring logs and related model data. It adopts a combination of local storage and cloud backup. The local storage uses solid-state drives with a storage capacity of no less than 1TB. The cloud backup uses encrypted storage to ensure data security and the storage time is no less than 1 year. The early warning module, connected to the real-time monitoring and identification module, is used to receive real-time identification results. When the duration of mating behavior is abnormal (less than 30 minutes or more than 300 minutes) or the identification confidence level is lower than 0.85, an early warning signal is triggered, including audible and visual warnings and remote push warnings. The audible and visual warnings are implemented through indicator lights and speakers, while the remote push warnings are sent to staff via SMS and APP push. At the same time, the warning information is recorded for subsequent traceability.
9. The intelligent monitoring and identification method and system for lizard mating behavior based on deep learning according to claim 8, characterized in that: The high-definition infrared camera in the data acquisition module adopts an adjustable angle gimbal design, with an adjustment angle range of 0-360° horizontal rotation and 0-90° vertical rotation. The acquisition angle can be adjusted remotely to ensure coverage of the entire monitoring area without any blind spots. The camera is waterproof, dustproof, and corrosion-resistant, with a protection rating of no less than IP67, making it suitable for complex outdoor environments. Its operating temperature range is -20℃ to 60℃. The environmental sensor is embedded in the ground, with the installation position 0.5-1.0m above the ground to avoid direct sunlight and immersion in rainwater, ensuring measurement accuracy.
10. The intelligent monitoring and identification method and system for lizard mating behavior based on deep learning according to claim 8, characterized in that: The real-time monitoring and identification module uses an edge computing terminal, equipped with an ARM Cortex-A76 processor, no less than 8GB of memory, no less than 64GB of storage capacity, and supports WiFi and 4G / 5G network connections, enabling real-time data transmission and remote control. The system also includes a human-computer interaction module, which is connected to the real-time monitoring and recognition module and the data storage module. It adopts a touch screen design and can display the monitoring screen, recognition results, environmental parameters and early warning information in real time. It supports manual operation, including parameter setting, model update, data query and manual review functions. The system can flexibly increase or decrease the number of monitoring terminals according to actual monitoring needs, support multi-terminal collaborative work, and achieve full coverage monitoring of a large area of lizard habitat.