Intelligent display and environmental control system for live insects
Patent Information
- Application Number
- CN202611232274.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-14
- Publication Date
- 2026-10-13
AI Technical Summary
[0004]为了弥补以上不足,本发明提供了一种活体昆虫智能展示与环境调控系统,旨在改善环境调控系统大多采用固定的调节速率,主要关注物理环境参数能否快速达到设定目标,缺乏对昆虫实时生理状态的反馈互动的问题
[0042]1、本发明中,通过将活体昆虫的视觉行为特征直接引入环境调控约束中,使温湿度与气体浓度的调节幅度能够随昆虫的实时生理耐受状态进行动态调整,降低了环境参数突变对昆虫造成的生理应激风险。
Smart Images

Figure CN122902805A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of automated control and bio-intelligent display technology, and in particular to a live insect intelligent display and environmental control system. Background Technology
[0002] In the fields of modern science popularization and biological research, intelligent display cases for live insects are widely used. In order to maintain the normal survival and activity of insects, the display system is usually equipped with environmental control equipment. Sensors monitor the temperature, humidity and concentration of gases such as carbon dioxide in the case in real time, and control algorithms drive the corresponding actuators to maintain the relative stability of the physical environmental parameters inside the case.
[0003] However, most existing environmental control systems use a fixed adjustment rate, primarily focusing on whether physical environmental parameters can quickly reach the set target. When the environment deviates from the set value, the system often corrects by a fixed, relatively large margin. This single tracking control method rarely considers the tolerance differences of individual insects under different activity states, and is prone to triggering physiological stress responses in insects when environmental parameters change rapidly. Summary of the Invention
[0004] To overcome the above shortcomings, this invention provides a live insect intelligent display and environmental control system, which aims to improve the problem that most environmental control systems adopt a fixed adjustment rate, mainly focusing on whether physical environmental parameters can quickly reach the set target, and lack feedback and interaction on the real-time physiological state of insects.
[0005] This invention provides the following technical solution: a live insect intelligent display and environmental control system, comprising:
[0006] The environmental sensing module includes sensor components, which collect temperature, humidity, gas concentration and external environmental parameters inside the environmental chamber through the sensor components and convert them into environmental characteristic quantities.
[0007] The online identification module is communicatively connected to the environment perception module, extracts the running state sequence of the environment execution components and receives the environment feature quantities, updates the system model parameters through a recursive algorithm, and generates an evolution matrix;
[0008] The time delay compensation module is communicatively connected to the environment perception module and the online identification module. It constructs a state observer based on the evolution matrix and the environmental feature quantities and generates a state vector.
[0009] The behavior mapping module is communicatively connected to the time delay compensation module and includes an image acquisition component inside the environmental chamber. The image acquisition component acquires image data, extracts behavioral features, and jointly analyzes the change rate thresholds of temperature, humidity and gas concentration with the state vector to generate a constraint vector containing the behavioral features.
[0010] The collaborative decision-making module is communicatively connected to the online identification module, the time delay compensation module, and the behavior mapping module. Based on the state vector, the evolution matrix, and the constraint vector, it performs decoupled calculations in the rolling time domain to generate system control commands.
[0011] The control and display module is communicatively connected to the collaborative decision-making module and the behavior mapping module. It includes the environmental execution component and the display terminal. According to the system control command, the environmental execution component is driven to adjust the temperature, humidity and gas concentration in the environmental chamber, acquire the image data and extract the behavior features from the constraint vector, fuse the behavior features into the image data, and output to the display terminal.
[0012] Preferably, in the environmental perception module, the conversion into environmental feature quantities specifically includes the following steps:
[0013] Obtain the original sampling sequences of the temperature, humidity, gas concentration, and external environmental parameters;
[0014] A filtering algorithm is applied to remove high-frequency interference signals from the original sampling sequence and extract the effective values.
[0015] The effective values are normalized without dimensions and then concatenated according to a preset matrix dimension to generate environmental feature quantities.
[0016] Preferably, in the online identification module, the step of updating the system model parameters and generating the evolution matrix via a recursive algorithm specifically includes the following steps:
[0017] Obtain the pre-stored historical evolution matrix and calculate the theoretically predicted feature quantity in combination with the running state sequence;
[0018] Calculate the identification error between the environmental feature quantity and the theoretically predicted feature quantity;
[0019] The weight coefficients of the system model parameters are updated based on the identification error and the preset forgetting factor to generate an evolution matrix.
[0020] Preferably, in the time delay compensation module, the step of constructing the state observer and generating the state vector specifically includes the following steps:
[0021] The pure time lag constants of temperature, humidity, and gas concentration are calculated based on the evolution matrix.
[0022] An internal prediction model is constructed in the state observer using the pure time delay constant as a parameter to calculate the advance prediction value;
[0023] The environmental features are used to correct the error in the predicted values, and a state vector is generated.
[0024] Preferably, in the behavior mapping module, the step of extracting behavioral features and jointly analyzing the rate of change thresholds of temperature, humidity, and gas concentration with the state vector to generate a constraint vector containing the behavioral features specifically includes the following steps:
[0025] The image data is identified using a computer vision model, and behavioral characteristics including the insect's movement state are output.
[0026] Retrieve a preset biological tolerance database and match the benchmark constraint interval corresponding to the behavioral characteristics;
[0027] Using the aforementioned baseline constraint interval as the boundary, and combining the state vector, the upper limit of the adjustment slope is calculated as the threshold for the rate of change of temperature, humidity, and gas concentration, and then encapsulated to generate a constraint vector.
[0028] Preferably, the step of identifying the image data using a computer vision model and outputting behavioral features containing the insect's movement state specifically includes the following steps:
[0029] Extract the continuous contour deformation and pixel displacement velocity of the live insects from the image data;
[0030] The continuous contour deformation and the pixel displacement velocity are input into a spatiotemporal graph convolutional network, which outputs a behavior classification probability vector.
[0031] The extreme value operation is performed on the behavior classification probability vector to extract the corresponding state label as the insect movement state, and the corresponding sensitive weight factor is assigned to the insect movement state to generate behavior features.
[0032] Preferably, in the collaborative decision-making module, the step of generating system control commands by decoupling the state vector, the evolution matrix, and the constraint vector in the rolling time domain specifically includes the following steps:
[0033] Construct a quadratic programming model that includes a cost function, the cost function being established based on the tracking error between the target preset sequence and the state vector;
[0034] The evolution matrix is used as the coefficients of the prediction model, and the rate of change threshold in the constraint vector is used as the hard constraint boundary and substituted into the quadratic programming model.
[0035] A multi-step control sequence is obtained by solving in the rolling time domain, and the first step action of the multi-step control sequence is extracted as the system control command.
[0036] Preferably, constructing the quadratic programming model including the cost function specifically includes the following steps:
[0037] Obtain the tracking error between the target preset sequence and the state vector, and calculate the estimated action increment;
[0038] The biological sensitivity weight factor is determined based on the behavioral characteristics in the constraint vector;
[0039] Obtain a preset error penalty matrix and control penalty matrix, increase the off-diagonal elements of the control penalty matrix according to the functional relationship of the biological sensitivity weight factor, and correct the error penalty matrix and the control penalty matrix;
[0040] The cost function is generated by weighting and summing the tracking error and the estimated action increment using the corrected error penalty matrix and the control penalty matrix.
[0041] The present invention has the following beneficial effects:
[0042] 1. In this invention, by directly incorporating the visual behavioral characteristics of live insects into environmental regulation constraints, the adjustment range of temperature, humidity and gas concentration can be dynamically adjusted according to the real-time physiological tolerance state of the insects, thereby reducing the risk of physiological stress to insects caused by sudden changes in environmental parameters.
[0043] 2. In this invention, by combining online recursive model updates with time-delay observation compensation calculations, the actual environmental change response progress, which is obscured by physical inertia, is effectively restored, and the over-output of environmental regulation components and parameter oscillation overshoot caused by sensor measurement lag are reduced.
[0044] 3. In this invention, the insect behavior status tags and biological sensitivity weights obtained from the underlying analysis are superimposed on the insect activity screen in real time, enabling observers to obtain a quantitative assessment of the biological status while intuitively viewing the live display, thus improving the popular science interactive experience and data visualization effect of the intelligent display system. Attached Figure Description
[0045] Figure 1 This is an architectural diagram of a live insect intelligent display and environmental control system proposed in this invention. Detailed Implementation
[0046] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0047] This invention provides a live insect intelligent display and environmental control system, such as Figure 1 As shown, it includes the following steps:
[0048] The environmental sensing module includes sensor components, which collect temperature, humidity, gas concentration and external environmental parameters inside the environmental chamber and convert them into environmental characteristic quantities.
[0049] Furthermore, in the environmental perception module, the conversion into environmental feature quantities specifically includes the following steps:
[0050] Obtain the raw sampling sequences of temperature, humidity, gas concentration, and external environmental parameters;
[0051] A filtering algorithm is applied to remove high-frequency interference signals from the original sampling sequence and extract the effective values.
[0052] The effective numerical values are normalized without dimensions and then concatenated according to the preset matrix dimensions to generate environmental feature quantities.
[0053] Specifically, the environmental sensing module acquires physical environment data in real time through sensor components distributed inside and outside the environmental chamber. The sensor components include temperature and humidity sensors and gas concentration sensors, installed inside the environmental chamber to collect temperature, humidity, and carbon dioxide gas concentration. Simultaneously, corresponding sensors are installed outside the environmental chamber to collect external environmental parameters such as temperature, humidity, and atmospheric pressure, forming a total of six sensor acquisition channels. The system continuously reads the electrical signals from these sensors according to a set sampling period, converts these physical quantities into digital signals, and arranges them in chronological order to obtain the raw sampling sequence of temperature, humidity, gas concentration, and external environmental parameters.
[0054] Because the sensor is susceptible to high-frequency interference signals from electromagnetic oscillations and local airflow fluctuations during data acquisition, the system employs a first-order low-pass filtering algorithm to independently smooth the original sampling sequence and extract valid values. The calculation formula for this filtering algorithm is as follows: In the formula, This is the index number of the sensor acquisition channel, with a value ranging from natural numbers 1 to 6; is the sequence number of the discrete sampling time, and it is a positive integer; Indicates the first The first sampling period obtained The original sampled values of each channel; Indicates the first The sampling period The effective values extracted from each channel after filtering; Indicates the first The sampling period The effective values of each channel; These are preset filter coefficients, with values greater than 0 and less than 1. Since temperature, humidity, and gas concentration signals are slowly varying physical quantities, the system... The preferred value is 0.1, which can effectively suppress transient noise abrupt changes with amplitude exceeding 1% of the true range while preserving the effective environmental trend.
[0055] Considering that temperature, humidity, gas concentration, and air pressure have different physical units and orders of magnitude, directly mixing them in calculations would lead to an imbalance in matrix weights during subsequent model solving. Therefore, the system performs dimensionless normalization on the extracted effective values of each channel. The normalization formula is as follows: In the formula, Indicates the first The sampling period The normalized dimensionless values of each channel have a range of 0 to 1. and They represent the first The physical parameters of each channel are defined within the preset operating range of the equipment, with the lower and upper limits of their respective ranges as follows: The lower limit for the internal temperature channel is 5℃, and the upper limit is 45℃; the lower limit for the internal humidity channel is 20%RH, and the upper limit is 95%RH; the lower limit for the carbon dioxide concentration channel is 400ppm, and the upper limit is 5000ppm; the lower limit for the external temperature channel is 0℃, and the upper limit is 50℃; the lower limit for the external humidity channel is 10%RH, and the upper limit is 90%RH; the lower limit for the external atmospheric pressure channel is 85kPa, and the upper limit is 106kPa.
[0056] After normalization, the system constructs a 6x1 column vector from the dimensionless values of all six channels within the same sampling period, arranged in a fixed channel order. Then, it concatenates the column vectors from ten consecutive sampling periods horizontally along the time dimension, ultimately generating an environmental feature quantity according to a preset 6x10 matrix dimension. The matrix expression formula for this environmental feature quantity is as follows:
[0057] ;
[0058] In the formula, Indicates the current number The environmental feature matrix generated in each sampling period; elements within the matrix Indicates the first The first channel in the The dimensionless value after normalization of each sampling period, where the channel index Values 1 to 6 correspond to the following channels: internal temperature, internal humidity, carbon dioxide concentration, external temperature, external humidity, and atmospheric pressure, respectively; time offset. Values range from 0 to 9. to These represent consecutive time points covering the current moment and the past nine historical sampling periods. The row dimension of the matrix is determined by the number of sensor channels, and the column dimension is determined by the time step window. A 10-step time window covers 10 seconds of historical environmental change information at a 1-second sampling period, which can completely capture a typical dynamic response process of the main physical quantities within the environmental chamber.
[0059] This eliminates random noise interference during multi-channel low-level acquisition, unifies heterogeneous physical parameters from multiple sources to the same numerical scale, and outputs them as structured matrices, providing a standardized data foundation for subsequent identification and control.
[0060] The online identification module communicates with the environment perception module, extracts the running state sequence of the environment execution components and receives environmental feature quantities, updates the system model parameters through a recursive algorithm, and generates an evolution matrix.
[0061] Furthermore, in the online identification module, updating the system model parameters and generating the evolution matrix via a recursive algorithm specifically includes the following steps:
[0062] Obtain the pre-stored historical evolution matrix and calculate the theoretically predicted feature quantities by combining it with the running state sequence;
[0063] The identification error between calculated environmental characteristics and theoretically predicted characteristics;
[0064] The weight coefficients of the system model parameters are updated based on the identification error and the preset forgetting factor to generate the evolution matrix.
[0065] Specifically, the online identification module is communicatively connected to the environment perception module and receives the 6-row, 10-column environmental feature matrix generated in the previous step. This is a positive integer representing the sequence number of the discrete sampling time, used to identify the data time within each sampling period. The module extracts the 10th column from this matrix as the actual environmental state vector for the current time, denoted as... And extract the 9th column as the historical environment state vector of the previous time step, denoted as Both are 6-row, 1-column column vectors. Simultaneously, the module extracts the runtime state sequence of the environmental execution components at the previous moment. This sequence is recorded in alignment according to the sampling period, and the record count corresponding to the most recent sampling moment is taken to construct a 3-row, 1-column control input vector. The three elements of this vector represent, in order, the operating duty cycle of the temperature control component (ranging from -1 to 1), the operating duty cycle of the humidity control component (ranging from 0 to 1), and the speed ratio of the carbon dioxide ventilation fan (ranging from 0 to 1). The module combines the historical environmental state vector with the control input vector... The data is concatenated vertically to construct a 9-row, 1-column regression vector. In the formula, the superscript... This represents the transpose operation of a vector. and These are the row vectors obtained by transposing the corresponding column vectors. The outermost transpose sign restores the concatenated row vectors to their column vector form. The first 6 rows of the regression vector correspond to... The normalized values for each environmental channel, the last 3 rows correspond to The running status variables of each execution component.
[0066] After obtaining the regression vector, the module calls the pre-stored historical evolution matrix in its internal memory. The history evolution matrix is a 6-row, 9-column parameter matrix that represents the physical mapping relationship between the system's internal environmental parameters and the actions of the executing components at the previous moment. The initial values of the history evolution matrix are as follows when the system first starts. The data was populated based on pre-calibrated environmental chamber data acquired offline. Specifically, under controlled conditions, step excitations were applied to temperature, humidity, and carbon dioxide concentration, and the responses were recorded. The initial mapping coefficients for each channel were estimated using batch least squares and then filled in. If no pre-calibration data is available, Alternatively, it can be initialized as an all-zero matrix, and the system will automatically correct it to a reasonable parameter range through recursive iteration during the initial stage of operation. The module combines the regression vector and the historical evolution matrix to calculate the theoretically predicted features, and the calculation formula is as follows: In the formula, This represents the theoretically predicted feature quantities of the six environmental channels at the current moment, calculated by the model based on historical states, with a dimension of 6 rows and 1 column. Subsequently, the module calculates the identification error between the actual environmental feature quantities and the theoretically predicted feature quantities, using the following formula: In the formula, The identification error vector, consisting of 6 rows and 1 column, quantifies the deviation between the current actual physical environment and the system's mathematical model.
[0067] To address system characteristic drift caused by aging of environmental components or sudden changes in external climate, the module employs a recursive least squares algorithm with a forgetting factor to dynamically update the weight coefficients of the system model parameters based on the identification error. The update process first calculates the gain vector and the error covariance matrix, as shown in the formulas below. and Finally, the evolution matrix is updated and generated based on the gain vector, as shown in the formula: In the formula, It is a gain vector with 9 rows and 1 column; The current error covariance matrix is 9 rows and 9 columns, and it is the first error covariance matrix during the initial system runtime. The initial value is set to a diagonal matrix with 10,000 diagonal elements and 0 off-diagonal elements. This initial value reflects the high degree of uncertainty in the initial estimation of the parameters. Let be the error covariance matrix of the previous time step; This is a scalar result with one row and one column obtained by multiplying the regression vector by the covariance matrix; This represents the transpose of the gain vector, with dimensions of 1 row and 9 columns; This is the latest evolution matrix generated after the update; The preset forgetting factor is used to reduce the interference of outdated historical data on the current model weights. The feasible implementation data is set to 0.98. This value ensures that the algorithm can quickly track small environmental changes caused by the metabolic heat or respiration of live insects, while maintaining the numerical stability of the matrix update process.
[0068] By using recursive calculations, the mathematical model parameters are adaptively corrected in real time as they change with the real physical environment. This overcomes the problem of accuracy degradation in traditional static models and provides a high-precision dynamic system model for subsequent time delay compensation and rolling optimization control.
[0069] The time delay compensation module communicates with the environmental perception module and the online identification module, and constructs a state observer based on the evolution matrix and environmental features to generate a state vector;
[0070] Furthermore, in the time delay compensation module, the construction of the state observer and the generation of the state vector specifically include the following steps:
[0071] The pure time lag constants for temperature, humidity, and gas concentration are calculated based on the evolution matrix.
[0072] An internal prediction model is constructed in the state observer with the pure time delay constant as a parameter to calculate the advance prediction value;
[0073] Environmental features are used to correct errors in the predicted values and generate a state vector.
[0074] Specifically, the time delay compensation module is communicatively connected to the environmental perception module and the online identification module, and receives the 6-row, 1-column actual environmental state vector generated in the previous step. 3 rows and 1 column control input vector And the latest evolutionary matrix with 6 rows and 9 columns ,in This represents the sequence number of the discrete sampling time and is a positive integer. The module first processes the evolution matrix... Divide the data by column dimension and extract the first 6 columns to construct a 6x6 state transition matrix. Extract the last 3 columns to construct a 6x3 control input matrix. .
[0075] Subsequently, the module is based on the control input matrix. The pure time delay constant of each controllable channel was calculated. Specifically, a unit step simulation excitation was applied sequentially to the three controllable channels, and the simulation iteration formula was used. The step response sequence of each channel is calculated step by step. Where, The step index of the simulation iteration is a positive integer, representing the current sampling time. Local variables that are independently recursively applied internally; Indicates the first The simulation environment state vector obtained from each simulation step is a 6-row, 1-column vector. This is the state vector from the previous simulation step; Set as a 6-row, 1-column vector of all zeros; This is a 3x1 unit excitation vector. When testing the temperature, humidity, and carbon dioxide channels respectively, this vector takes the following values: , , ; superscript This indicates a transpose operation. The simulation step limit is set to 60 steps. In a single test, the output line sequence corresponding to the current test channel is extracted. If the change in the corresponding output line is less than 0.5% of the steady-state threshold within 5 consecutive steps, the average of those 5-step responses is taken as the steady-state final value. If the condition is not met within 60 steps, the average of the last 5 responses is taken as the steady-state final value. subscript This is the index number of the controllable test channel, with values of 1, 2, and 3. After calculating the steady-state final value, the minimum number of simulation steps corresponding to the first time the absolute value of the simulated response sequence exceeds five percent of the absolute value of the steady-state final value is recorded as the pure time delay constant of that channel. In typical implementation data, the hysteresis constant of the temperature control channel inside the chamber... The hysteresis constant of the humidity channel inside the chamber is approximately 8 sampling periods. The hysteresis constant of the carbon dioxide channel is approximately 5 sampling periods. Approximately 3 sampling periods. External temperature, external humidity, and atmospheric pressure are uncontrollable external disturbances, and their corresponding hysteresis constants... to All are set to 0.
[0076] After obtaining the pure time delay constant of each channel, the time delay compensation module constructs an internal prediction model to calculate the lead prediction value. The calculation formula is as follows: In the formula, This represents the 6-row, 1-column advanced prediction state vector calculated at the current moment, which represents the theoretical state that the environment should reach after eliminating physical transmission delay; This represents the advanced prediction state vector from the previous sampling period. When the system starts up for the first time... Initialized to the initial measurements obtained by the sensor To support subsequent time-delay alignment, the module maintains a capacity of Circular cache queue, Pick to The maximum value in the queue is 8 in a typical embodiment. The queue stores the most recent data in chronological order. The advance prediction vector for each sampling period is used to fill in the actual measured values at the corresponding time points in the historical gaps during the initial stage of system startup. .
[0077] The internal prediction model inevitably contains accumulated errors, so the module further utilizes actual measurements for closed-loop correction. The module extracts historical data from the circular cache queue and constructs a 6-row, 1-column estimation vector with lag that aligns with the actual measurement progress. The first of the vectors. Each channel component satisfies the formula In the formula, This is the index number for the environmental data acquisition channel, with a value ranging from 1 to 6, which is a positive integer. For the corresponding number The pure time delay constant of each channel; Indicates the first The first channel in the The historical advance prediction values for each sampling period are then used. Observation error correction is then performed, calculated using the following formula: In the formula, The 6-row, 1-column state vector generated for the final correction is output as a time-delay-free feature parameter. The actual observation error vector consists of 6 rows and 1 column; The observer feedback gain matrix is a 6x6 matrix with diagonal elements ranging from 0.4 to 0.7 and off-diagonal elements all being 0. Values that are too large will introduce high-frequency oscillations, while values that are too small will result in slow correction. For feasible implementation data, it is preferable that all diagonal elements are 0.6 to achieve a balance between correction speed and numerical stability.
[0078] By separating the pure time delay element in the system's mathematical model and combining it with time-aligned observation error feedback, the impact of sensor measurement hysteresis on environmental regulation can be effectively reduced, as well as the excessive output of environmental actuators and environmental parameter oscillations.
[0079] The behavior mapping module and the communication connection time delay compensation module include an image acquisition component inside the environmental chamber. The image acquisition component acquires image data, extracts behavioral features, and jointly analyzes the rate of change thresholds of temperature, humidity and gas concentration with the state vector to generate a constraint vector containing behavioral features.
[0080] Furthermore, in the behavior mapping module, extracting behavioral features and jointly analyzing the rate of change thresholds of temperature, humidity, and gas concentration with the state vector to generate a constraint vector containing behavioral features specifically includes the following steps:
[0081] The computer vision model is used to identify image data and output behavioral features that include the insect's movement state.
[0082] Retrieve a pre-defined biological tolerance database and match the baseline constraint intervals corresponding to the behavioral characteristics;
[0083] Using the baseline constraint interval as the boundary, the upper limit of the adjustment slope is calculated in combination with the state vector as the threshold of the rate of change of temperature, humidity and gas concentration, and then the constraint vector is generated.
[0084] Furthermore, the process of identifying image data using computer vision models and outputting behavioral features containing the insect's movement state specifically includes the following steps:
[0085] Extract continuous contour deformation and pixel displacement velocity of live insects from image data;
[0086] Input continuous contour deformation and pixel displacement velocity into a spatiotemporal graph convolutional network to output a behavior classification probability vector.
[0087] The extreme value operation is performed on the behavior classification probability vector to extract the corresponding state label as the insect's movement state, and the corresponding sensitive weight factor is assigned to the insect's movement state to generate behavioral features.
[0088] Specifically, the behavior mapping module is communicatively connected to the time delay compensation module and receives the 6-row, 1-column time-delay-free state vector output from the previous step. ,in The sequence number used to control the sampling period must be a positive integer. This module includes an image acquisition component installed in an environmental enclosure. The resolution of the image acquisition component is set to 1280×720, the frame rate is set to 10 frames per second, and the control sampling period is set to 1 second. Within each control sampling period, the system acquires 10 frames of live insect images. After target extraction from each of the 10 frames, the average of the 10 results is taken as the insect outline area corresponding to that control sampling period. and centroid coordinates , This allows the image behavior data to be linked to the state vector. Aligned in time.
[0089] The system first performs grayscale processing on each frame of image, then uses background subtraction to extract the suspected insect movement region. The background model uses a mean-based update method with an update coefficient of 0.02, and the background subtraction grayscale threshold is set to 25. For the subtracted binary image, a morphological opening operation of a 3×3 structuring element is performed to remove isolated noise. Then, Canny edge detection is used to extract the target boundary, with a low threshold of 50 and a high threshold of 150. Subsequently, connected component analysis is performed, and connected components with an area less than 50 pixels are removed. The largest connected component in the remaining region is selected as the target region for the live insect. Based on this target region, the system calculates the insect outline pixel area and centroid coordinates. The centroid coordinates are obtained by averaging the coordinates of all foreground pixels within the target region.
[0090] After obtaining the target region of adjacent control sampling periods, the system calculates the continuous contour deformation and pixel displacement velocity, using the following formulas:
[0091] and ;
[0092] In the formula, For the first A continuous contour deformation variable with a control sampling period is used to characterize the relative change of the insect's body outline over time; This indicates the absolute value operation; and The first The and the first The area of the insect outline pixels after averaging 10 frames within a control sampling period; This represents the total number of pixels corresponding to the image resolution, which is 921600 at a resolution of 1280×720. For the first The pixel displacement velocity of each control sampling period; and The first The horizontal and vertical pixel coordinates of the centroid of the insect target region within each control sampling period; and These are the centroid coordinates of the previous control sampling period, respectively; The time interval between two adjacent control sampling periods is 1 second in practice.
[0093] The system constructs a two-dimensional temporal feature matrix by combining the continuous contour deformation of 10 consecutive control sampling periods with the pixel displacement velocity. Its expression is:
[0094] ;
[0095] In the formula, The system uses a 10x2 row temporal input matrix. The first column represents the continuous contour deformation sequence, and the second column represents the pixel displacement velocity sequence. The time range covers the current control sampling period and the past 9 control sampling periods. This row temporal input matrix is fed into a pre-trained spatiotemporal graph convolutional network. The network has two input nodes, corresponding to the continuous contour deformation node and the pixel displacement velocity node, respectively. The network structure includes two graph convolutional layers, one temporal one-dimensional convolutional layer, and one fully connected layer. The graph convolutional layer extracts the correlation features between contour changes and displacement velocity, while the temporal one-dimensional convolutional layer extracts the motion change trend within the 10 control sampling periods. The fully connected layer outputs a 4x1 row classification score vector. In the formula, the superscript... Represents the transpose operation of a vector or matrix; to These represent the raw score values for the four state categories output by the fully connected layer.
[0096] The classification score vector is converted into a behavior classification probability vector using a normalized exponential function, and the calculation formula is as follows: In the formula, Indicates the first The control sampling period belongs to the first The probability of insect-like movement states; Represented by natural constant An exponential function with base 0; Represents the classification score vector The first in Each score; The summation index takes values from 1 to 4; For the first Each score; The behavior classification probability vector is 4 rows and 1 column, with the four elements corresponding to resting, foraging, active, and stress states, respectively. The system performs an extreme value operation on the behavior classification probability vector, calculated using the following formula: In the formula, The value is a label for the insect's movement status, ranging from 1 to 4, representing rest, foraging, activity, and stress, respectively. When multiple probability values are equal, the status label with the smallest number is taken as the output result.
[0097] The system assigns biosensitive weighting factors based on insect movement status tags. subscript This indicates the status label identified during the current control sampling period. Feasible implementation data is as follows: Resting state corresponds to... Foraging status corresponds to Active state corresponds to Stress state correspondence The system combines state labels and corresponding sensitivity weight factors to generate behavioral feature vectors. In the formula, It is a 2x1 vector. Write in integer encoding format. Write in continuous numerical form.
[0098] After generating behavioral characteristics, the module retrieves a pre-set biological tolerance database and sorts them according to the status tags. Match the baseline constraint interval corresponding to the current behavior state. This database stores the upper limits of the allowable baseline change rate for three controllable environmental channels—temperature, humidity, and carbon dioxide—under different behavior states, in normalized units per control sampling period. Feasible implementation data includes: temperature channel under resting state. Humidity channel Carbon dioxide channels Temperature channels during foraging Humidity channel Carbon dioxide channels Temperature channel in active state Humidity channel Carbon dioxide channels Temperature channels under stress Humidity channel Carbon dioxide channels .in, Indicates the current behavior state Next The upper limit of the baseline rate of change for each controllable environmental channel. The values range from 1 to 3, corresponding to the chamber temperature, chamber humidity, and carbon dioxide concentration channels, respectively.
[0099] To avoid adjusting with a large slope when the environmental conditions are close to the range boundary, the module uses the matched reference constraint interval as the boundary and combines it with the time-delay-free state vector. Calculate the upper limit of the adjustment slope. The calculation formula is as follows: In the formula, Indicates the first The first control sampling period The rate of change threshold for each controllable channel; This indicates taking the larger of the two values within the curly braces; Indicates the first The minimum rate of change threshold for each controllable channel is used to prevent control from stalling due to excessively small constraints; feasible implementation data is for the temperature channel. Humidity channel Carbon dioxide channels ; The biological sensitivity weight factor corresponding to the current behavioral state; This represents the upper limit of the baseline rate of change obtained by matching from a biological tolerance database; The state vector generated in the previous step The Middle The time-delay-free normalized value of each controllable channel; the value 0.5 indicates the middle position of the normalized range; This is the boundary protection coefficient, which takes a value greater than 0 and not greater than 2, and is preferably 1.5 in practice.
[0100] Finally, the system encapsulates the behavioral features and rate of change thresholds into a constraint vector, calculated using the following formula: In the formula, This is a 5x1 constraint vector. The first element is the integer code of the insect's movement state, the second element is the corresponding biological sensitivity weight factor, and the third to fifth elements are the rate-of-change thresholds for temperature, humidity, and carbon dioxide concentration, respectively. This constraint vector is output to the subsequent collaborative decision-making module to limit the adjustment range of the environmental execution component during the rolling optimization process.
[0101] By using both insect behavioral states and time-delay-free environmental states for constraint calculations, the adjustment ranges of temperature, humidity, and gas concentration can be adjusted according to changes in insect states, reducing the impact of sudden environmental changes on living insects.
[0102] The collaborative decision-making module communicates with the online identification module, time delay compensation module, and behavior mapping module. Based on state vectors, evolution matrices, and constraint vectors, it performs decoupled calculations in the rolling time domain to generate system control commands.
[0103] Furthermore, in the collaborative decision-making module, the generation of system control commands based on the decoupled calculation of state vectors, evolution matrices, and constraint vectors in the rolling time domain specifically includes the following steps:
[0104] Construct a quadratic programming model that includes a cost function, which is established based on the tracking error of the target preset sequence and the state vector;
[0105] The evolution matrix is used as the coefficients of the prediction model, and the rate of change threshold in the constraint vector is used as the hard constraint boundary and substituted into the quadratic programming model.
[0106] The multi-step control sequence is obtained by solving in the rolling time domain, and the first step action of the multi-step control sequence is extracted as the system control command.
[0107] Furthermore, constructing a quadratic programming model that includes a cost function specifically includes the following steps:
[0108] Obtain the tracking error of the target preset sequence and state vector, and calculate the estimated action increment;
[0109] Determine the biological sensitivity weight factor based on the behavioral characteristics in the constraint vector;
[0110] Obtain the preset error penalty matrix and control penalty matrix, increase the off-diagonal elements of the control penalty matrix according to the functional relationship of the biological sensitivity weight factor, and correct the error penalty matrix and control penalty matrix;
[0111] By using the corrected error penalty matrix and control penalty matrix, a weighted sum is calculated on the tracking error and the predicted action increment to generate a cost function.
[0112] Specifically, the collaborative decision-making module communicates with the online identification module, the time delay compensation module, and the behavior mapping module to obtain the latest updated state transition matrix and control input matrix, a 6x1 time delay-free state vector, and a 5x1 constraint vector. The system first sets the prediction time domain length and control time domain length for rolling optimization, with feasible implementation data set at 10 steps and 3 steps respectively. The system obtains an externally set target preset sequence and calculates the tracking error between the target preset sequence and the state vector within the future prediction time domain. The calculation formula is as follows: In the formula, This is the sequence number of the current control sampling period; The index is the prediction step number and its value ranges from 1 to 10; Indicates the current number The first cycle for the future The predicted tracking error value for each cycle (6 rows and 1 column); This represents the future state vector obtained recursively based on the current model; This represents the pre-defined target sequence of 6 rows and 1 column for the future. When initializing the prediction starting point, the system substitutes the time-delay-free state vector passed from the time-delay compensation module, and the calculation formula is as follows: In the formula, This represents the initial state vector when the prediction step count is zero. This represents the current, real, time-delay-free observation state. Simultaneously, the system calculates the estimated action increment within the control time domain, using the following formula: In the formula, To control the step index, with a value range of 0 to 2; Indicates the first The estimated action increment for each cycle is represented by a 3-row, 1-column chart. and These represent the 3 rows and 1 column of absolute control motion quantities for the corresponding period; specifically, when hour, That is, the actual system control commands executed at the previous moment. To ensure closed-loop prediction calculations, when the prediction step count exceeds the control time domain, the system assumes that subsequent control commands remain constant; that is, it stipulates that when the prediction step index... When the value is greater than 3, the corresponding action increment is forcibly set to a zero vector.
[0113] The system extracts the second element from the constraint vector as the currently determined biological sensitivity weight factor, denoted as... The system obtains the preset initial error penalty matrix. With the initial control penalty matrix .in, It is a 6x6 diagonal matrix. The first 3 diagonal elements correspond to the penalty weights of temperature, humidity and carbon dioxide concentration inside the chamber, and the feasible implementation values are all set to 10. The last 3 diagonal elements correspond to uncontrollable external disturbances and the values are set to 0. This is a 3x3 diagonal matrix, with its diagonal elements corresponding to the motion cost penalties for the three control channels, all set to 1. To achieve decoupling and flexible control, the system modifies these two penalty matrices according to a functional relationship with the biosensitive weight factor. The formula for calculating the modified error penalty matrix is as follows: The corrected control penalty matrix diagonal elements and The diagonal elements remain consistent, and the formula for calculating its off-diagonal elements is: In the formula, This is the corrected 6x6 error penalty matrix; The corrected 3x3 control penalty matrix; express The Middle Line 1 The non-diagonal elements of the column; and All are row and column indices ranging from 1 to 3 and Not equal to ; To decouple the penalty gain coefficient, a value of 2.0 is preferred during implementation. When insects are in a sensitive state such as stress, resulting in a small weighting factor, the off-diagonal elements of the control penalty matrix increase significantly, imposing a huge penalty on the drastic multi-channel synchronous adjustment, forcing the system to enter a univariate mild decoupling adjustment mode.
[0114] The system uses the corrected error penalty matrix and control penalty matrix to perform a weighted summation of the tracking error and the estimated action increment, generating a quadratic programming model that includes a cost function. The formula for calculating the cost function is as follows:
[0115] In the formula, The scalar value of the comprehensive cost function generated at the current moment; superscript Represents the transpose operation of a vector or matrix; This represents a summation operation; the first part of the formula is the summation of state tracking deviation penalties in the prediction time domain, and the second part is the summation of penalties for the severity of action output in the control time domain. The optimization objective of the quadratic programming model is to solve for a set of multi-step control sequences such that the cost function... It reaches a minimum value.
[0116] When solving the quadratic programming model, the system uses the evolution matrix generated by the online identification module as the coefficients of the prediction model, and applies equality constraint formulas. The future state is calculated recursively. In the formula, and These are the state transition matrix and control input matrix at the current moment, respectively. The system extracts the 3rd to 5th elements from the constraint vector as hard constraint boundaries for the rate of change of the environmental state and substitutes them into the model. The hard constraint formula is: In the formula, It is a controllable channel index with values of 1, 2, and 3; This represents the upper limit of the adjustment slope for the corresponding channel in the constraint vector; and These represent the nth element in the predicted state vector. The values of each channel in two adjacent prediction steps. To prevent saturation failure of the underlying actuator, the system synchronously introduces physical hard constraints on the absolute motion quantities, with the constraint formula being: In the formula, the inequality sign indicates that the corresponding elements of the vector satisfy the boundary constraints term by term; and These are the lower and upper bound vectors of the physical output of the execution components, arranged in a 3x1 matrix. Considering the actual characteristics of the equipment, the lower bound for the temperature duty cycle is -1 and the upper bound is 1; the lower bound for the humidity and carbon dioxide fan duty cycles is 0 and the upper bound is 1. and .
[0117] The system uses the interior-point method to optimize a quadratic programming model with configured cost functions, equality constraints, and hard constraint boundaries within the current rolling time domain, obtaining a multi-step optimal predicted action increment sequence within the control time domain. The expression for this sequence is:
[0118] ;
[0119] In the formula, the superscript asterisk is used.
[0120] To obtain the 9x1 globally optimal increment matrix;
[0121] These are the transposes of the optimal action increments corresponding to the first to third control steps in the control time domain of the sequence. The system extracts only the action increment of the first step of this multi-step control sequence as the current actual action, and combines it with the actual execution instruction from the previous time step to generate the system control instruction. The calculation formula is as follows: In the formula, This results in a final 3x1 system control command vector. The actual system control command from the previous moment; This is the extracted optimal action increment for the first step. The system sends this instruction to the subsequent control and display module for execution, and pushes the overall rolling time domain window forward one step when the next sampling period arrives. After obtaining the new observation state, the above optimization and decoupling calculation process is repeated.
[0122] By organically integrating the system dynamic model, multi-channel tracking error, and insect physiological tolerance characteristics into the optimization solution framework, and by adaptively adjusting the penalty matrix and strictly limiting the physical boundary, the oscillation overshoot during the coupled regulation of multiple environmental parameters can be suppressed, thereby improving the stability and safety of environmental regulation.
[0123] The control and display module, communication connection collaborative decision-making module and behavior mapping module, includes an environmental execution component and a display terminal. According to the system control command, the environmental execution component is driven to adjust the temperature, humidity and gas concentration in the environmental chamber, acquire image data and extract behavioral features from the constraint vector, fuse the behavioral features into the image data, and output to the display terminal.
[0124] Specifically, the control and display module communicates with the collaborative decision-making module and the behavior mapping module, and receives the 3-row, 1-column system control command vector generated in the previous step. 5 rows and 1 column constraint vector It also acquires image data for the current control sampling period. The system control command vector is represented as follows: In the formula, the superscript... Indicates the transpose operation; For the control quantity of the temperature regulation component, For the control parameters of the humidity control component, This is the control quantity for the carbon dioxide ventilation fan.
[0125] To avoid actuator overshooting due to communication errors or numerical overflow, the module performs amplitude limiting on the control commands before driving them. The calculation formula is as follows: In the formula, This represents the input value to be limited; and These represent the lower and upper allowable limits, respectively. The formula for calculating the control quantity after limiting is as follows: , , In the formula, , and These are the temperature, humidity, and carbon dioxide regulation and control values after the limit is set.
[0126] The module converts the limited control quantity into a low-level pulse width modulation drive count value. The temperature regulation component adopts a heating and cooling interlocked output method, and the calculation formula is as follows:
[0127] ;
[0128] ;
[0129] In the formula, This is the duty cycle count value for the heating channel. This is the duty cycle count value for the refrigeration aisle. The maximum count value of the microcontroller's timer is used; a feasible implementation would be 1000. The calculated count value is rounded and then written to the pulse width modulation register. At that time, both the heating and cooling channels are 0; when When the value is positive, only the heating channel outputs; when... When the value is negative, only the cooling channel outputs. The calculation formula for humidity and gas regulation drive is as follows: and In the formula, This is the duty cycle count value for the ultrasonic humidifier. This is the duty cycle count value of the carbon dioxide ventilation fan. The module outputs the above count value to the corresponding actuator at a 20 kHz pulse width modulation frequency to adjust the temperature, humidity, and gas concentration inside the environmental chamber.
[0130] While performing environmental regulation, the module operates from the constraint vector:
[0131] Extract the first element and the second element , which serves as the behavioral feature that needs to be fused into the image. In the formula, Integer encoding of insect movement states, For the corresponding biological sensitivity weighting factor, , and These are the threshold values for the rate of change of temperature, humidity, and carbon dioxide concentration, respectively. The module maps state codes 1 to 4 to the text for resting, foraging, active, and stressed states, respectively. The resting and foraging states are configured with a green mask, the active state with a yellow mask, and the stressed state with a red mask. The corresponding sensitivity weight factors are also displayed in the text.
[0132] The module maps the insect's centroid coordinates recorded by the behavior mapping module. and Determine the text box overlap position for the anchor point. The text box size is 160 pixels by 40 pixels. The formula for calculating the top-left corner coordinates is: and In the formula, and These are the horizontal and vertical pixel coordinates of the top left corner of the text box, respectively; 80 is half the width of the text box (160), used to center the text box horizontally relative to the centroid of the insect; 50 is the vertical upward offset of the text box relative to the centroid of the insect; 1120 is obtained by subtracting the width of the text box (160) from the image width (1280), and 680 is obtained by subtracting the height of the text box (40) from the image height (720), used to prevent the text box from exceeding the image boundary.
[0133] The module performs transparency blending within the text box area, calculated using the following formula: In the formula, and These are the pixel coordinates within the text box area; This is the color channel index, with values of 1, 2, and 3, corresponding to the red, green, and blue channels respectively. The fused output image is at the first The pixel values of each color channel; The mask image generated by combining the behavior state text, sensitive weight text, and corresponding color blocks is in the first... The pixel values of each color channel, and the mask image size is consistent with a 160-pixel by 40-pixel text box; For the original image in the first The pixel values of each color channel; the pixel values of each color channel range from 0 to 255; This is the transparency blending factor, ranging from 0 to 1, and set to 0.7 in practice. Pixels outside the text box area retain their original image values.
[0134] After image fusion is completed, the module outputs image frames with behavioral status, sensitivity weights and real-time insect images to the display terminal. The display refresh rate is consistent with the image acquisition frequency, which is 10 frames per second in practice.
[0135] This enables the conversion of system control commands into actuator drive signals, and overlays insect behavioral characteristics onto real-time images, allowing observers to simultaneously view the insect's behavioral state and the results of environmental regulation.
[0136] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A live insect intelligent display and environmental control system, characterized in that, include: The environmental sensing module includes sensor components, which collect temperature, humidity, gas concentration and external environmental parameters inside the environmental chamber through the sensor components and convert them into environmental characteristic quantities. The online identification module is communicatively connected to the environment perception module, extracts the running state sequence of the environment execution components and receives the environment feature quantities, updates the system model parameters through a recursive algorithm, and generates an evolution matrix; The time delay compensation module is communicatively connected to the environment perception module and the online identification module. It constructs a state observer based on the evolution matrix and the environmental feature quantities and generates a state vector. The behavior mapping module is communicatively connected to the time delay compensation module and includes an image acquisition component inside the environmental chamber. The image acquisition component acquires image data, extracts behavioral features, and jointly analyzes the change rate thresholds of temperature, humidity and gas concentration with the state vector to generate a constraint vector containing the behavioral features. The collaborative decision-making module is communicatively connected to the online identification module, the time delay compensation module, and the behavior mapping module. Based on the state vector, the evolution matrix, and the constraint vector, it performs decoupled calculations in the rolling time domain to generate system control commands. The control and display module is communicatively connected to the collaborative decision-making module and the behavior mapping module. It includes the environmental execution component and the display terminal. According to the system control command, the environmental execution component is driven to adjust the temperature, humidity and gas concentration in the environmental chamber, acquire the image data and extract the behavior features from the constraint vector, fuse the behavior features into the image data, and output to the display terminal.
2. The intelligent display and environmental control system for live insects according to claim 1, characterized in that, In the environmental perception module, the conversion into environmental feature quantities specifically includes the following steps: Obtain the original sampling sequences of the temperature, humidity, gas concentration, and external environmental parameters; A filtering algorithm is applied to remove high-frequency interference signals from the original sampling sequence and extract the effective values. The effective values are normalized without dimensions and then concatenated according to a preset matrix dimension to generate environmental feature quantities.
3. The intelligent display and environmental control system for live insects according to claim 1, characterized in that, In the online identification module, updating the system model parameters and generating the evolution matrix via a recursive algorithm specifically includes the following steps: Obtain the pre-stored historical evolution matrix and calculate the theoretically predicted feature quantity in combination with the running state sequence; Calculate the identification error between the environmental feature quantity and the theoretically predicted feature quantity; The weight coefficients of the system model parameters are updated based on the identification error and the preset forgetting factor to generate an evolution matrix.
4. The intelligent display and environmental control system for live insects according to claim 1, characterized in that, In the time delay compensation module, the process of constructing the state observer and generating the state vector specifically includes the following steps: The pure time lag constants of temperature, humidity, and gas concentration are calculated based on the evolution matrix. An internal prediction model is constructed in the state observer using the pure time delay constant as a parameter to calculate the advance prediction value; The environmental features are used to correct the error in the predicted values, and a state vector is generated.
5. The intelligent display and environmental control system for live insects according to claim 1, characterized in that, In the behavior mapping module, the extraction of behavior features and their joint analysis with the state vector to resolve the rate of change thresholds of temperature, humidity, and gas concentration, generating a constraint vector containing the behavior features, specifically includes the following steps: The image data is identified using a computer vision model, and behavioral characteristics including the insect's movement state are output. Retrieve a preset biological tolerance database and match the benchmark constraint interval corresponding to the behavioral characteristics; Using the aforementioned baseline constraint interval as the boundary, and combining the state vector, the upper limit of the adjustment slope is calculated as the threshold for the rate of change of temperature, humidity, and gas concentration, and then encapsulated to generate a constraint vector.
6. The intelligent display and environmental control system for live insects according to claim 5, characterized in that, The step of identifying the image data using a computer vision model and outputting behavioral features including the insect's movement state specifically includes the following steps: Extract the continuous contour deformation and pixel displacement velocity of the live insects from the image data; The continuous contour deformation and the pixel displacement velocity are input into a spatiotemporal graph convolutional network, which outputs a behavior classification probability vector. The extreme value operation is performed on the behavior classification probability vector to extract the corresponding state label as the insect movement state, and the corresponding sensitive weight factor is assigned to the insect movement state to generate behavior features.
7. The intelligent display and environmental control system for live insects according to claim 1, characterized in that, In the collaborative decision-making module, the step of generating system control commands by decoupling the state vector, the evolution matrix, and the constraint vector in the rolling time domain specifically includes the following steps: Construct a quadratic programming model that includes a cost function, the cost function being established based on the tracking error between the target preset sequence and the state vector; The evolution matrix is used as the coefficients of the prediction model, and the rate of change threshold in the constraint vector is used as the hard constraint boundary and substituted into the quadratic programming model. A multi-step control sequence is obtained by solving in the rolling time domain, and the first step action of the multi-step control sequence is extracted as the system control command.
8. The intelligent display and environmental control system for live insects according to claim 7, characterized in that, The construction of the quadratic programming model containing the cost function specifically includes the following steps: Obtain the tracking error between the target preset sequence and the state vector, and calculate the estimated action increment; The biological sensitivity weight factor is determined based on the behavioral characteristics in the constraint vector; Obtain a preset error penalty matrix and control penalty matrix, increase the off-diagonal elements of the control penalty matrix according to the functional relationship of the biological sensitivity weight factor, and correct the error penalty matrix and the control penalty matrix; The cost function is generated by weighting and summing the tracking error and the estimated action increment using the corrected error penalty matrix and the control penalty matrix.