A method and device for analyzing feeding behavior of fruit flies

By setting different environmental parameter groups and using a spatiotemporal attention network model to analyze video feature segments, and combining this with changes in food surface structure features, the problems of interference and environmental sensitivity in fruit fly feeding behavior research were solved, achieving efficient and accurate analysis of fruit fly feeding behavior.

CN121121869BActive Publication Date: 2026-03-24YANAN UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-16
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing technologies for studying fruit fly feeding behavior suffer from several problems: significant interference with the natural behavior patterns of fruit flies, low sensitivity to changes in environmental parameters, low temporal resolution, and inability to distinguish between feeding and contact behaviors.

Method used

By setting different environmental parameter groups, video equipment is used to record the movement of fruit flies. The spatiotemporal attention network model is used to analyze video feature segments, and the feeding behavior of fruit flies is judged by combining changes in food surface structure features, thus achieving non-invasive and chemically labeled behavior monitoring.

Benefits of technology

This study improves the temporal resolution and accuracy of fruit fly feeding behavior analysis, reduces interference with the experimental environment and behavior, and enables multi-dimensional research on fruit fly feeding behavior, revealing the influence of environmental factors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121121869B_ABST
    Figure CN121121869B_ABST
Patent Text Reader

Abstract

The application discloses a fruit fly feeding behavior analysis method and device, and relates to the technical field of insect behavior analysis, and comprises the following steps: setting different environment parameter groups, performing a fruit fly feeding monitoring test, collecting the motion video of a single fruit fly at a feeding device, and dividing the video frames into continuous characteristic segments. By analyzing the characteristic segments, the starting point and the ending point of each round of suspected feeding process are determined, and the food surface images before and after the suspected feeding are obtained. The structural feature changes of the surface images before and after the suspected feeding are compared to determine whether the feeding behavior occurs, if the feeding behavior occurs, the round of process is defined as the feeding process, and the feeding amount is represented based on the surface feature changes. The feeding times, the average feeding interval and the average feeding amount of the fruit fly under different environment parameters are analyzed, and the influence of the environment parameters on the fruit fly feeding behavior is output. The scheme has significant advantages in time resolution and result accuracy, and can especially analyze the short-time feeding behavior of the fruit fly.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of insect behavior analysis, in particular to a fruit fly feeding behavior analysis method and device. BACKGROUND

[0002] Currently, the research methods for fruit fly feeding behavior mainly rely on video monitoring, behavior trajectory analysis and other means. Traditional fruit fly feeding behavior research methods mainly rely on a micro-feeding experimental device called "CAFÉ system". This method indirectly calculates the feeding behavior of fruit flies by measuring the volume change of food liquid in a capillary tube. Although this technology can provide certain quantitative results, its limitations are also obvious: first, this method requires additional experimental intervention and equipment installation, which can easily interfere with the natural behavior patterns of fruit flies; in addition, this measurement method is less sensitive to environmental parameter changes and cannot dynamically record the real-time response of fruit flies under various environmental factors; finally, the time resolution of the measurement is low, which cannot capture the short-time characteristics of fruit fly feeding behavior, especially the specific performance of single feeding behavior.

[0003] In addition, in recent years, with the rapid development of computer vision and deep learning technology, behavior tracking methods based on video monitoring have been gradually applied to animal behavior research. For example, by monitoring the activity trajectory of fruit flies in the experimental site, the behavior patterns of fruit flies can be indirectly analyzed; by recording the interaction between fruit flies and the feeding device with a high-resolution camera, the feeding behavior of fruit flies can be inferred. However, this kind of method often lacks specific optimization for feeding behavior, especially in how to effectively distinguish between feeding behavior and simple staying behavior of fruit flies.

[0004] In the prior art, the publication number CN111009000A discloses an insect feeding behavior analysis method, device and storage medium. The method comprises the following steps: using a neural network to detect insects in a video through a deep learning method, wherein the video records the feeding state of multiple insects; obtaining the trajectory of the insects according to the detection result; and obtaining the analysis result according to the trajectory of the insects. The present application can detect and analyze the video through a neural network through a deep learning method, and obtain the trajectory and analysis result of the insects according to the detection result, without the need for manual observation, recording and analysis, which is efficient and accurate. Although this scheme can exclude subjective speculation by manual observation through a neural network, it does not consider the influence of environmental factors, resulting in large fluctuations in the behavior data of fruit flies, and only relying on video cannot distinguish between contact behavior and feeding behavior, thus reducing the accuracy and effectiveness of detection and analysis.

[0005] The information disclosed in the background section is only intended to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0006] The purpose of this invention is to provide a method and apparatus for analyzing fruit fly feeding behavior, so as to solve the problems mentioned in the background art.

[0007] To achieve the above objectives, the present invention provides the following technical solution:

[0008] A method for analyzing fruit fly feeding behavior, comprising the following steps:

[0009] Different environmental parameter groups were set up, and fruit fly feeding monitoring experiments with the same experimental variables were conducted on different groups of environmental parameters. The movement of fruit flies at the fruit fly feeding device was monitored during the behavioral test period. The collected video information was divided into equal frames to form several continuous feature segments, with a single fruit fly target set at each fruit fly feeding device.

[0010] The feature segments were analyzed to identify the feature segments of the suspected feeding process in each round of suspected feeding by the fruit fly, and surface images of the food in the fruit fly feeding device before and after suspected feeding were obtained. Each round of suspected feeding started when the fruit fly landed on the food and ended when the fruit fly left the food.

[0011] By comparing surface images before and after suspected feeding during the same round of suspected feeding, the changes in surface structure features of the two images are used to determine whether the fruit fly target has engaged in feeding behavior during the round of suspected feeding. If so, the round of suspected feeding is defined as a feeding process, and the amount of food consumed during the round of feeding is characterized based on the changes in surface structure features.

[0012] Analyze the number of feeding behaviors, average feeding interval, and average food intake of fruit flies under different environmental parameter groups at the same time, and output the influence of different environmental parameters on fruit fly feeding behavior.

[0013] Furthermore, the environmental parameters include ambient temperature, ambient humidity, and ambient light intensity. The specific method for setting different environmental parameter groups is as follows: determine the survival environment requirement range of fruit flies, and randomly generate multiple environmental parameter groups within the environmental requirement range to conduct fruit fly feeding monitoring experiments. The survival environment requirement range includes the ambient temperature range, ambient humidity range, and ambient light intensity range.

[0014] The "same experimental variables" specifically refer to the fact that, apart from environmental parameters, all other variables are the same across different experimental groups.

[0015] Furthermore, a camera device is used to record the movement of fruit flies in the fruit fly feeding device in real time. The camera device is specifically installed directly above the fruit fly feeding device, looking vertically down at the fruit fly's activity area. At the same time, the camera resolution and video frame rate are set, and the movement of fruit flies at the fruit fly feeding device is recorded during the behavioral test period through the set camera device.

[0016] The specific steps for dividing the acquired video information into several continuous feature segments are as follows: convert the acquired video data into an encoding format, use computer vision algorithms to remove the static background, and enhance the contrast of the fruit fly target in the image; and divide the processed video image information into several continuous feature segments evenly.

[0017] Furthermore, the specific logic for determining the feature segments corresponding to each round of suspected feeding process of fruit flies is as follows: by analyzing feature segments through a deep learning network model, all feature segments from the time the fruit fly stays on the food until it leaves are identified and recorded as detected feature segments. Then, the detected feature segments are preliminarily screened to determine the feature segments that match the suspected feeding duration, which are then used as suspected feeding process feature segments.

[0018] The specific method for determining the detection feature segments using a deep learning network model is as follows: the feature segments are input into a trained spatiotemporal attention network model, which is based on a Long Short-Term Memory (LSTM) network model. The Tanh function is selected as the activation function, and Adam is selected as the optimization algorithm for the LSTM model. At the same time, the hyperparameters of the LSTM model are set, including: the number of network layers, the number of iterations, the learning rate, the batch size, the number of training iterations, the number of batches, and the number of hidden layer neurons.

[0019] The network is set to a 5-layer network structure, the number of iterations is set to 300, the learning rate is set to 0.001, the batch size is set to 32, the number of training iterations is set to 100, the batch size is set to 256, and the number of hidden layer neurons is set to 32.

[0020] Input continuous feature segments into the trained spatiotemporal attention network model, and output the detected feature segments.

[0021] Furthermore, the logic for preliminary screening of the detected feature segments is as follows: the duration of each detected feature segment is determined by the start and end timestamps; the duration of each detected feature segment is compared with the set feeding reference threshold; and the feature segments of the suspected feeding process of the fruit fly in each round are determined based on the comparison results. The specific screening method is as follows:

[0022] like When the time of detection of the feature segment meets the requirements for feeding, the feature segment is recorded as a feature segment of the suspected feeding process.

[0023] like If the time length of the detected feature segment does not meet the requirements for eating, the detected feature segment will not be further analyzed.

[0024] in To detect the time length of the feature segment, The set reference threshold for the duration of eating.

[0025] Furthermore, the changes in the surface structure characteristics of the food are analyzed, including the vertical height of the food surface, texture contrast, and surface gloss.

[0026] The logic behind judging fruit fly feeding behavior using food surface structure feature data is as follows: based on the changes in food surface structure features before and after a suspected feeding process, a feeding judgment coefficient is formed. This coefficient is then used to determine whether feeding behavior has occurred. The formula used to calculate the feeding judgment coefficient is as follows:

[0027] ;

[0028] In the formula, Let be the feeding judgment coefficient of the q-th suspected feeding process feature segment. Let be the root mean square value of the change in food surface height within the q-th suspected feeding process segment. Let be the normalized value of the texture contrast change within the q-th suspected feeding process feature fragment. This represents the normalized value of the change in food surface gloss within the q-th suspected feeding process feature segment. and The weighting coefficients are as follows: and and All are greater than 0, where q is the index of the suspected feeding process feature segment;

[0029] in The formula used for the calculation is:

[0030] ;

[0031] In the formula, Let i represent the height change at the i-th sampling point on the food surface, where i is the index of the randomly selected sampling point. ,in This represents the total number of randomly selected sampling points;

[0032] Where calculation The formula used is:

[0033] ;

[0034] In the formula, Let be the height of the i-th sampling point on the food surface after each round of suspected feeding. The height of the i-th sampling point on the food surface before each round of suspected food consumption;

[0035] Calculate the normalized value of the texture contrast change within the feature fragment of the q-th suspected feeding process. The formula used is:

[0036] ;

[0037] In the formula, and The contrast of food surface texture before and after each round of suspected feeding;

[0038] calculate The formula used is:

[0039] ;

[0040] In the formula, and The glossiness of the food surface before and after each round of suspected feeding is shown.

[0041] Based on the feeding judgment coefficient, the logic underlying the comprehensive judgment of fruit fly feeding behavior is as follows:

[0042] like If the qth suspected feeding process feature segment exists, then the suspected feeding process feature segment is recorded as a feature segment containing feeding behavior.

[0043] like Then it is determined that there is no fruit fly feeding behavior in the qth suspected feeding process feature segment, but there is contact or tentative feeding behavior;

[0044] In the formula, The threshold for determining feeding.

[0045] Furthermore, the average amount of food consumed per meal is characterized by changes in the surface structure characteristics of the food. The formula used to calculate the amount of food consumed per meal is as follows:

[0046] ;

[0047] In the formula, Let p be the average amount of food consumed per feeding in the p-th segment containing feeding behavior characteristics. Let p be the area of ​​the region of height variation on the food surface in the p-th segment containing the feeding behavior feature. Let be the height change value of the area with height change on the food surface in the p-th segment containing feeding behavior characteristics, where p is the index of the segment containing feeding behavior characteristics and P is the total number of segments containing feeding behavior characteristics in a set of environmental parameters.

[0048] The frequency of fruit fly feeding behavior is characterized by determining the number of detection segments containing feeding behavior. The average feeding interval is characterized by the timestamp difference between adjacent detection segments containing feeding behavior. The influence of different environmental parameters on the frequency of feeding behavior, average feeding interval, and average amount of food consumed per feeding is analyzed. The specific analysis method is as follows: fix two parameters in the environmental parameters and monitor the influence of the remaining environmental change on the frequency of feeding behavior, average feeding interval, and average amount of food consumed per feeding. The environmental parameter with the greatest influence corresponding to the frequency of feeding behavior, average feeding interval, and average amount of food consumed per feeding is determined respectively.

[0049] The present invention also provides a fruit fly feeding behavior analysis device, which is used to perform the above-described fruit fly feeding behavior analysis method, comprising:

[0050] The experimental environment group setting module is used to set different environmental parameter groups and conduct fruit fly feeding monitoring experiments with the same experimental variables for different environmental parameters. It monitors the movement of fruit flies at the fruit fly feeding device during the behavioral test period and divides the collected video information into equal frames to form several continuous feature segments. A single fruit fly target is set at each fruit fly feeding device.

[0051] The feature segmentation module is used to analyze feature segments to determine the feature segments of the suspected feeding process in each round of suspected feeding process of fruit flies, and to acquire surface images of food in the fruit fly feeding device before and after suspected feeding. Each round of suspected feeding process starts when the fruit fly lands on the food and ends when the fruit fly leaves the food.

[0052] The feeding behavior analysis module is used to compare surface images before and after suspected feeding in the same round of suspected feeding. By comparing the changes in surface structure features of the two images, it determines whether the fruit fly target has engaged in feeding behavior during the round of suspected feeding. If so, the round of suspected feeding is defined as a feeding process, and the amount of food consumed in the round of feeding is characterized based on the changes in surface structure features.

[0053] The environmental impact analysis module is used to analyze the number of feeding behaviors, average feeding interval, and average food intake of fruit flies under the same time period in different environmental parameter groups, and outputs the impact of different environmental parameters on fruit fly feeding behavior.

[0054] Compared with the prior art, the beneficial effects of the present invention are:

[0055] By processing feature fragments using a trained spatiotemporal attention network model, fruit fly targets at the feeding device can be efficiently identified. Preliminary screening of contact behavior is achieved at the temporal level by filtering feature fragments that match the feeding duration. Furthermore, by acquiring surface images of the food in the feeding device and analyzing changes in surface structure features, non-invasive, chemically labeled behavioral monitoring is realized. This method not only reduces interference with the experimental environment and fruit fly behavior but also allows for the extraction of multi-dimensional information during data acquisition, facilitating the study of complex patterns in fruit fly feeding behavior.

[0056] Secondly, by analyzing high-resolution images of food surfaces, the system captures minute changes in the height, texture contrast, and gloss of the food surface before and after fruit flies feed. Furthermore, it calculates the amount of food consumed in a single feeding by measuring changes in structural features. This method has significant advantages in terms of temporal resolution and result accuracy, especially in analyzing the short-term feeding behavior of fruit flies.

[0057] In addition, different combinations of environmental parameters were set, including temperature, humidity and light. By comparing and analyzing the experimental results of different environmental groups, key behavioral characteristics of fruit flies under different environmental conditions, such as the number of feedings, average feeding interval and feeding amount, can be obtained, thereby revealing the specific impact of environmental factors on the feeding behavior of fruit flies. Attached Figure Description

[0058] Figure 1 This is a schematic diagram of the overall method flow of the present invention;

[0059] Figure 2 This is a curve fitting the surface height variation versus texture contrast.

[0060] Figure 3 The fitted curve of texture contrast change versus feeding judgment coefficient;

[0061] Figure 4 A fitted curve of texture contrast change versus gloss change;

[0062] Figure 5 A statistical comparison chart of changes in texture contrast versus changes in gloss.

[0063] Figure 6 This is a schematic diagram of the overall device structure of the present invention. Detailed Implementation

[0064] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.

[0065] It should be noted that, unless otherwise defined, the technical or scientific terms used in this invention should have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0066] Example:

[0067] Please see Figures 1-5 The present invention provides a technical solution:

[0068] A method for analyzing fruit fly feeding behavior, comprising the following steps:

[0069] Step 1: Set up different environmental parameter groups and conduct fruit fly feeding monitoring experiments with the same experimental variables for different groups of environmental parameters. Monitor the movement of fruit flies at the feeding device during the behavioral test period, and divide the collected video information into equal frames to form several continuous feature segments. A single fruit fly is set at each fruit fly feeding device.

[0070] The environmental parameters include ambient temperature, ambient humidity, and ambient light intensity. The specific method for setting different environmental parameter groups is as follows: determine the range of environmental requirements for fruit flies to survive, and randomly generate multiple environmental parameter groups within the range of environmental requirements to conduct fruit fly feeding monitoring experiments. The range of environmental requirements for survival includes the range of ambient temperature, the range of ambient humidity, and the range of ambient light intensity. Specifically, there are three types of experimental groups, each of which includes several sub-experimental groups. Each sub-experimental group contains one free variable and two fixed variables. For example, in the first experimental group, the ambient humidity and ambient light intensity are fixed variables in each sub-experimental group, and the ambient temperature is a free variable, which is set sequentially from the minimum temperature to the maximum temperature. The fixed values ​​of ambient humidity and ambient light intensity are different in different sub-experimental groups. The same applies to the second and third types of experimental groups.

[0071] Temperature is a core parameter affecting the survival and behavior of fruit flies. It significantly influences the physiological activities, metabolic rate, and behavioral performance of fruit flies. We searched existing scientific research literature to understand the survival rate, activity level, and reproduction of fruit flies at different temperatures. We collected research results on the optimal temperature, minimum tolerance temperature, and maximum tolerance temperature of fruit flies, and set the environmental temperature range based on the research results.

[0072] Humidity directly affects the water balance, metabolic needs, and feeding behavior of fruit flies, and is crucial to their survival and behavioral performance. This study retrieved research literature on fruit fly adaptation to humidity, analyzed their survival rate, activity level, and feeding behavior under different humidity conditions, and noted the impact of humidity on the risk of dehydration and behavioral inhibition in fruit flies. The range of environmental humidity was determined through the research literature.

[0073] Light intensity and photoperiod affect the circadian rhythm, behavioral activity, and feeding behavior of fruit flies, and are key parameters to focus on in experiments. This study aims to retrieve research on the light requirements and adaptations of fruit flies, especially to analyze the impact of light intensity on fruit fly behavior, such as activity and feeding, to investigate the circadian rhythm regulation mechanism of fruit flies, the influence of photoperiod and intensity on their behavior, and to set specific ranges of ambient light intensity.

[0074] The "same experimental variables" specifically refer to the fact that all variables except environmental parameters are the same across different experimental groups. These other variables include fruit fly population and individual conditions, such as species, age, and starvation status. The specific method for controlling the starvation status is as follows: before the experiment begins, all fruit flies in all experimental groups should be under the same starvation treatment, such as fasting for 8 hours, to ensure that the physiological state of the fruit flies in each group is consistent at the start of the experiment. The type of food used in all experimental groups must be the same, the experiments in all experimental groups must start at the same time, and the experimental time for each group of fruit flies must be consistent, for example, all experimental groups are monitored for 10 hours or a specific fixed time period.

[0075] The movement of fruit flies within a feeding device is recorded in real time using a camera. The camera is specifically installed directly above the feeding device, providing a vertical view of the fly activity area. The camera resolution and video frame rate are set accordingly. The camera records the fly movement at the feeding device during the experimental period. A camera with a suitable viewing angle, such as a wide-angle lens, is selected to ensure coverage of the entire feeding area. The captured image should encompass the entire food area. The camera should be securely mounted to prevent image shake due to vibration or movement. A single-color background, such as white or black, is used to enhance the contrast between the fly and the background, facilitating subsequent video analysis. Exposure time and brightness are adjusted to ensure the captured image is neither too bright nor too dark. Automatic exposure is avoided to prevent changes in lighting during the experiment from affecting the image quality.

[0076] The specific steps for dividing the acquired video information into several continuous feature segments are as follows: convert the acquired video data into an encoding format, use computer vision algorithms to remove the static background, and enhance the contrast of the fruit fly target in the image; and divide the processed video image information into several continuous feature segments evenly.

[0077] The purpose of static background removal is to separate fruit flies from the background, retain the moving target fruit flies, and remove static interference. Commonly used methods include: background subtraction, a classic static background removal method suitable for moving target detection of fruit flies in video sequences or images with fixed backgrounds; and Gaussian mixture models, a dynamic background modeling method suitable for scenes with background noise or changing lighting.

[0078] The purpose of contrast enhancement is to make the fruit fly target stand out more in the image, facilitating subsequent analysis. The following are specific contrast enhancement methods: Histogram equalization: enhances the contrast between the target and the background by adjusting the pixel intensity distribution of the image; Image filtering enhancement: enhances the salience of the fruit fly target through image filtering operations.

[0079] Step 2: Analyze the feature segments to determine the feature segments of the suspected feeding process in each round of suspected feeding by the fruit fly, and obtain surface images of the food in the fruit fly feeding device before and after suspected feeding. Each round of suspected feeding starts when the fruit fly lands on the food and ends when the fruit fly leaves the food.

[0080] The specific logic for determining the feature segments corresponding to each round of suspected feeding process of fruit flies is as follows: the feature segments are analyzed by a deep learning network model to determine all feature segments from when the fruit fly stays on the food until it leaves, which are recorded as detected feature segments. Then, the detected feature segments are preliminarily screened to determine the feature segments that match the suspected feeding time, which are taken as suspected feeding process feature segments.

[0081] The specific method for determining the detection feature segments using a deep learning network model is as follows: the feature segments are input into a trained spatiotemporal attention network model, which is based on a Long Short-Term Memory (LSTM) network model. The Tanh function is selected as the activation function, and Adam is selected as the optimization algorithm for the LSTM model. At the same time, the hyperparameters of the LSTM model are set, including: the number of network layers, the number of iterations, the learning rate, the batch size, the number of training iterations, the number of batches, and the number of hidden layer neurons.

[0082] The network is set to a 5-layer network structure, the number of iterations is set to 300, the learning rate is set to 0.001, the batch size is set to 32, the number of training iterations is set to 100, the batch size is set to 256, and the number of hidden layer neurons is set to 32.

[0083] Input continuous feature segments into the trained spatiotemporal attention network model, and output the detected feature segments.

[0084] The specific training method for the spatiotemporal attention network model is as follows: Historical video clips from within the fruit fly feeding device are collected as the training dataset for the model, ensuring that all fruit fly behaviors are included, such as flight, landing, and departure. Each clip is a continuous frame sequence of a certain duration, and each clip needs to be labeled with the fruit fly's behavior category, such as: flight, landing (starting point), hovering, and departure (ending point). The start and end points of each round of suspected feeding behavior are also labeled: start point: the fruit fly lands on the food surface, end point: the fruit fly leaves the food surface. Each clip from the start point to the end point is labeled with the target clip label. The training dataset is divided into a training set and a validation set. The model is trained by inputting the training set into the model and outputting clips with target clip labels. The cross-entropy loss function is used to handle the classification task, and the model performance is evaluated on the validation set by calculating metrics such as accuracy, recall, and F1 score. If the accuracy, recall, and F1 score meet the requirements, the training is complete; otherwise, the training is repeated.

[0085] The logic for preliminary screening of detected feature segments is as follows: The duration of each detected feature segment is determined by its start and end timestamps. The duration of each segment is then compared to a set feeding reference threshold. Based on the comparison results, the feature segments suspected of being part of the fruit fly's feeding process in each round are identified. The specific screening method is as follows:

[0086] like When the time of detection of the feature segment meets the requirements for feeding, the feature segment is recorded as a feature segment of the suspected feeding process.

[0087] like If the time length of the detected feature segment does not meet the requirements for eating, the detected feature segment will not be further analyzed.

[0088] in To detect the time length of the feature segment, The set reference threshold for the duration of eating can be set based on expert experience.

[0089] Step 3: Compare the surface images before and after suspected feeding during the same round of suspected feeding. Determine whether the fruit fly target has engaged in feeding behavior during the round of suspected feeding by the changes in surface structure features. If so, define the round of suspected feeding as a feeding process and characterize the amount of food consumed during the round of feeding based on the changes in surface structure features.

[0090] Analyze the changes in the surface structure features of food, including the vertical height of the food surface, texture contrast, and surface gloss.

[0091] The vertical height reflects the height changes of different areas on the food surface and can directly characterize the volume changes of the food after it is ingested by fruit flies. The food surface was photographed using a binocular camera (approximately before and after feeding), and a three-dimensional point cloud was generated using stereo vision. The height difference of the surface was calculated by comparing the two point clouds.

[0092] Texture contrast is used to describe the texture details of food surfaces, such as whether the surface texture has been damaged or changed due to fruit fly feeding. Specifically, it can be achieved by extracting texture features from images using texture analysis algorithms and calculating texture contrast features based on the gray-level co-occurrence matrix. The specific steps are: converting surface images taken before and after food feeding into grayscale images, calculating the gray-level co-occurrence matrix, and extracting texture contrast.

[0093] Surface gloss refers to the brightness characteristics formed by the reflection of light on the surface of food. After fruit flies feed on food, the surface of the food may become rougher or duller, thus affecting the surface gloss. Based on gloss analysis of the image color space, the image is converted from RGB space to HSV color space, the luminance channel (V channel) is extracted, and the changes in the luminance channel of the image before and after feeding are compared.

[0094] The logic behind judging fruit fly feeding behavior using food surface structure feature data is as follows: based on the changes in food surface structure features before and after a suspected feeding process, a feeding judgment coefficient is formed. This coefficient is then used to determine whether feeding behavior has occurred. The formula used to calculate the feeding judgment coefficient is as follows:

[0095] ;

[0096] In the formula, Let be the feeding judgment coefficient of the q-th suspected feeding process feature segment. Let be the root mean square value of the change in food surface height within the q-th suspected feeding process segment. Let be the normalized value of the texture contrast change within the q-th suspected feeding process feature fragment. This represents the normalized value of the change in food surface gloss within the q-th suspected feeding process feature segment. and The weighting coefficients are as follows: and and All are greater than 0, where q is the index of the suspected feeding process feature segment.

[0097] It should be noted that the feeding judgment coefficient is based on the surface structural features of food, including changes in surface height, texture contrast, and gloss, to quantitatively determine feeding behavior. The feeding judgment coefficient for the q-th suspected feeding process feature segment is... The larger the value, the greater the probability that feeding behavior occurs within the qth suspected feeding process feature segment.

[0098] Among these, height change is a direct physical characteristic of fruit fly feeding. Because fruit fly feeding causes the food surface to be sucked or eroded, resulting in significant changes in surface height, the direct result of feeding behavior is the erosion or decay of food, leading to a decrease in surface height or the appearance of localized pits. Therefore, height change is the most direct and reliable characteristic for judging feeding behavior. The root mean square value is used to comprehensively assess the magnitude of overall height change within the feature segment, rather than relying solely on single-point changes. The natural logarithm function is used... The design increases rapidly when the input value is small, but slows down when the input value is large. This design can enhance the sensitivity to small feeding behaviors, while avoiding weight imbalance caused by excessive height changes.

[0099] After food is eaten, the surface texture may become smoother or more irregular. This change can be quantified by texture contrast, which is supplementary information to height variation and is used to increase the accuracy of judgment, especially when the height variation is not obvious, such as in cases of minute feeding behavior. Normalization is used to eliminate the interference of data scale differences between different segments and facilitate unified analysis.

[0100] Feeding behavior can alter the reflective properties of food surfaces, leading to changes in gloss, which is closely related to the reflective properties of food surfaces. Fruit fly feeding may increase surface roughness, thus affecting gloss. Changes in gloss provide supplementary information for identifying feeding behavior, especially when changes in texture and height are not significant. The form is similar to Euclidean distance, and its purpose is to comprehensively measure the changes in texture contrast and gloss. This design can balance the contribution of the two features. Whether the changes in texture contrast or gloss are significant, they will have a significant impact on the judgment coefficient.

[0101] Height variation is the primary basis for judging feeding behavior; it is the most direct and reliable feature for identifying feeding behavior. Texture contrast and gloss variations play a secondary role, mainly assisting height variation in the judgment. Therefore, [the following settings are used]. and and All are greater than 0.

[0102] in The formula used for the calculation is:

[0103] ;

[0104] In the formula, Let i represent the height change at the i-th sampling point on the food surface, where i is the index of the randomly selected sampling point. ,in This represents the total number of randomly selected sampling points;

[0105] Where calculation The formula used is:

[0106] ;

[0107] In the formula, Let be the height of the i-th sampling point on the food surface after each round of suspected feeding. The height of the i-th sampling point on the food surface before each round of suspected food consumption;

[0108] Calculate the normalized value of the texture contrast change within the feature fragment of the q-th suspected feeding process. The formula used is:

[0109] ;

[0110] In the formula, and The textural contrast of the food surface before and after each round of suspected feeding is represented by the absolute difference in the textural contrast of the food surface. This represents the changes in texture on the surface of food, where The greater the change, the greater the probability of feeding behavior occurring. The form is unified and normalized, eliminating the influence of dimensions.

[0111] calculate The formula used is:

[0112] ;

[0113] In the formula, and The gloss levels of the food surface are measured before and after each suspected feeding round. The logic behind using gloss levels to determine feeding behavior is similar to that of the texture contrast of the food surface, and will not be elaborated upon here.

[0114] Based on the feeding judgment coefficient, the logic underlying the comprehensive judgment of fruit fly feeding behavior is as follows:

[0115] like If the qth suspected feeding process feature segment exists, then the suspected feeding process feature segment is recorded as a feature segment containing feeding behavior.

[0116] like Then it is determined that there is no fruit fly feeding behavior in the qth suspected feeding process feature segment, but there is contact or tentative feeding behavior;

[0117] In the formula, The threshold for determining feeding is set based on expert experience.

[0118] The average amount of food consumed per meal is characterized by changes in the surface structure characteristics of the food. The formula used to calculate the amount of food consumed per meal is as follows:

[0119] ;

[0120] In the formula, Let p be the average amount of food consumed per feeding in the p-th segment containing feeding behavior characteristics. Let p be the area of ​​the region of height variation on the food surface in the p-th segment containing the feeding behavior feature. Let be the height change value of the area with height change on the food surface in the p-th segment containing feeding behavior characteristics, where p is the index of the segment containing feeding behavior characteristics and P is the total number of segments containing feeding behavior characteristics in a set of environmental parameters.

[0121] Among the p-th segment containing feeding behavior characteristics, the height change value of the region with height variation on the food surface is... Specifically, the average height change value of the height change area is taken, and the specific height value is obtained in the same way as above.

[0122] Step 4: Analyze the number of feeding behaviors, average feeding interval, and average food intake of fruit flies under the same time period in different environmental parameter groups, and output the impact of different environmental parameters on fruit fly feeding behavior.

[0123] The frequency of fruit fly feeding behavior is characterized by determining the number of detection segments containing feeding behavior. The average feeding interval is characterized by the timestamp difference between adjacent detection segments containing feeding behavior. The influence of different environmental parameters on the frequency of feeding behavior, average feeding interval, and average amount of food consumed per feeding is analyzed. The specific analysis method is as follows: fix two parameters in the environmental parameters and monitor the influence of the remaining environmental change on the frequency of feeding behavior, average feeding interval, and average amount of food consumed per feeding. The environmental parameter with the greatest influence corresponding to the frequency of feeding behavior, average feeding interval, and average amount of food consumed per feeding is determined respectively.

[0124] A more comprehensive analysis requires combining traditional statistical methods with advanced data analysis techniques, including correlation analysis, regression analysis, and machine learning modeling. This involves studying the impact of individual environmental parameters on the frequency, average feeding interval, and average amount of food consumed per feeding. Sensitivity analysis measures the degree of influence of changes in a particular environmental parameter on feeding behavior indicators. The specific formula used for sensitivity calculation is as follows:

[0125] ;

[0126] In the formula, Let be the sensitivity coefficient of the 0th feeding behavior indicator to the jth environmental parameter. The data for the 0th feeding behavior indicator is given at the minimum value of the jth environmental parameter. The data represents the 0th feeding behavior indicator at the maximum value of the jth environmental parameter. For the j-th environmental parameter, Let be the minimum value of the j-th environmental parameter, and o and j be the indices of the feeding behavior index and the environmental parameter, respectively. The feeding behavior index includes the number of feeding behaviors, the average feeding interval, and the average amount of food consumed per feeding.

[0127] Sensitivity analysis can determine the maximum environmental impact parameters corresponding to the frequency of feeding behavior, average feeding interval, and average amount of food consumed per feeding. The specific logic is as follows:

[0128] By comparing the sensitivity coefficients of the same feeding behavior index to different environmental parameters, the environmental parameter corresponding to the maximum sensitivity coefficient is taken as the environmental parameter with the greatest influence on the feeding behavior index.

[0129] Please see Figure 6 The present invention also provides a fruit fly feeding behavior analysis device, which is used to perform the above-described fruit fly feeding behavior analysis method, including:

[0130] The experimental environment group setting module is used to set different environmental parameter groups and conduct fruit fly feeding monitoring experiments with the same experimental variables for different environmental parameters. It monitors the movement of fruit flies at the fruit fly feeding device during the behavioral test period and divides the collected video information into equal frames to form several continuous feature segments. A single fruit fly target is set at each fruit fly feeding device.

[0131] The feature segmentation module is used to analyze feature segments to determine the feature segments of the suspected feeding process in each round of suspected feeding process of fruit flies, and to acquire surface images of food in the fruit fly feeding device before and after suspected feeding. Each round of suspected feeding process starts when the fruit fly lands on the food and ends when the fruit fly leaves the food.

[0132] The feeding behavior analysis module is used to compare surface images before and after suspected feeding in the same round of suspected feeding. By comparing the changes in surface structure features of the two images, it determines whether the fruit fly target has engaged in feeding behavior during the round of suspected feeding. If so, the round of suspected feeding is defined as a feeding process, and the amount of food consumed in the round of feeding is characterized based on the changes in surface structure features.

[0133] The environmental impact analysis module is used to analyze the number of feeding behaviors, average feeding interval, and average food intake of fruit flies under the same time period in different environmental parameter groups, and outputs the impact of different environmental parameters on fruit fly feeding behavior.

[0134] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.

[0135] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented in software, the above embodiments can be implemented, in whole or in part, as a computer program product. Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution.

[0136] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0137] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A method for analyzing fruit fly feeding behavior, characterized in that, The specific steps include: Different environmental parameter groups were set up, and fruit fly feeding monitoring experiments with the same experimental variables were conducted on different groups of environmental parameters. The movement of fruit flies at the fruit fly feeding device was monitored during the behavioral test period. The collected video information was divided into equal frames to form several continuous feature segments, with a single fruit fly target set at each fruit fly feeding device. The feature segments were analyzed to identify the feature segments of the suspected feeding process in each round of suspected feeding by the fruit fly, and surface images of the food in the fruit fly feeding device before and after suspected feeding were obtained. Each round of suspected feeding started when the fruit fly landed on the food and ended when the fruit fly left the food. By comparing surface images before and after suspected feeding during the same round of suspected feeding, the changes in surface structure features of the two images are used to determine whether the fruit fly target has engaged in feeding behavior during the round of suspected feeding. If so, the round of suspected feeding is defined as a feeding process, and the amount of food consumed during the round of feeding is characterized based on the changes in surface structure features. Analyze the number of feeding behaviors, average feeding interval, and average food intake of fruit flies under different environmental parameter groups at the same time, and output the influence of different environmental parameters on fruit fly feeding behavior. Analyze the changes in the surface structure features of food, including the vertical height of the food surface, texture contrast, and surface gloss. The logic behind judging fruit fly feeding behavior using food surface structure feature data is as follows: based on the changes in food surface structure features before and after a suspected feeding process, a feeding judgment coefficient is formed. This coefficient is then used to determine whether feeding behavior has occurred. The formula used to calculate the feeding judgment coefficient is as follows: In the formula, Let be the feeding judgment coefficient of the q-th suspected feeding process feature segment. Let be the root mean square value of the change in food surface height within the q-th suspected feeding process segment. Let be the normalized value of the texture contrast change within the q-th suspected feeding process feature fragment. This represents the normalized value of the change in food surface gloss within the q-th suspected feeding process feature segment. and The weighting coefficients are as follows: and and All are greater than 0, where q is the index of the suspected feeding process feature segment; in The formula used for the calculation is: In the formula, Let i represent the height change at the i-th sampling point on the food surface, where i is the index of the randomly selected sampling point. ,in This represents the total number of randomly selected sampling points; Where calculation The formula used is: In the formula, Let be the height of the i-th sampling point on the food surface after each round of suspected feeding. The height of the i-th sampling point on the food surface before each round of suspected food consumption; Calculate the normalized value of the texture contrast change within the feature fragment of the q-th suspected feeding process. The formula used is: In the formula, and The contrast of food surface texture before and after each round of suspected feeding; calculate The formula used is: In the formula, and The glossiness of the food surface before and after each round of suspected feeding is shown. Based on the feeding judgment coefficient, the logic underlying the comprehensive judgment of fruit fly feeding behavior is as follows: like If the qth suspected feeding process feature segment contains fruit fly feeding behavior, then the suspected feeding process feature segment is recorded as a feature segment containing feeding behavior. like Then it is determined that there is no fruit fly feeding behavior in the qth suspected feeding process feature segment, but there is contact or tentative feeding behavior; In the formula, The threshold for determining feeding; The average amount of food consumed per meal is characterized by changes in the surface structure characteristics of the food. The formula used to calculate the amount of food consumed per meal is as follows: In the formula, Let p be the average amount of food consumed per feeding in the p-th segment containing feeding behavior characteristics. Let p be the area of ​​the region of height variation on the food surface in the p-th segment containing the feeding behavior feature. Let be the height change value of the area with height change on the food surface in the p-th segment containing feeding behavior characteristics, where p is the index of the segment containing feeding behavior characteristics and P is the total number of segments containing feeding behavior characteristics in a set of environmental parameters. The frequency of fruit fly feeding behavior is characterized by determining the number of detection segments containing feeding behavior. The average feeding interval is characterized by the timestamp difference between adjacent detection segments containing feeding behavior. The influence of different environmental parameters on the frequency of feeding behavior, average feeding interval, and average amount of food consumed per feeding is analyzed. The specific analysis method is as follows: fix two parameters in the environmental parameters and monitor the influence of the remaining environmental change on the frequency of feeding behavior, average feeding interval, and average amount of food consumed per feeding. The environmental parameter with the greatest influence corresponding to the frequency of feeding behavior, average feeding interval, and average amount of food consumed per feeding is determined respectively.

2. The method for analyzing fruit fly feeding behavior according to claim 1, characterized in that: The environmental parameters include ambient temperature, ambient humidity, and ambient light intensity. The specific method for setting different environmental parameter groups is as follows: determine the range of the survival environment requirements for fruit flies, and randomly generate multiple environmental parameter groups within the range of environmental requirements to conduct fruit fly feeding monitoring experiments. The range of the survival environment requirements includes the range of ambient temperature, the range of ambient humidity, and the range of ambient light intensity. The "same experimental variables" specifically refer to the fact that, apart from environmental parameters, all other variables are the same across different experimental groups.

3. The method for analyzing fruit fly feeding behavior according to claim 2, characterized in that: The movement of fruit flies in the fruit fly feeding device is recorded in real time using a camera device. The camera device is specifically installed directly above the fruit fly feeding device, looking vertically down at the activity area of ​​the fruit flies. At the same time, the camera resolution and video frame rate are set, and the movement of fruit flies at the fruit fly feeding device is recorded during the behavioral test period using the set camera device. The specific steps for dividing the acquired video information into several continuous feature segments are as follows: convert the acquired video data into an encoding format, use computer vision algorithms to remove the static background, and enhance the contrast of the fruit fly target in the image; and divide the processed video image information into several continuous feature segments evenly.

4. The method for analyzing fruit fly feeding behavior according to claim 3, characterized in that: The specific logic for determining the feature segments corresponding to each round of suspected feeding process of fruit flies is as follows: the feature segments are analyzed by a deep learning network model to determine all feature segments from when the fruit fly stays on the food until it leaves, which are recorded as detected feature segments. Then, the detected feature segments are preliminarily screened to determine the feature segments that match the suspected feeding time, which are taken as suspected feeding process feature segments. The specific method for determining the detection feature segments using a deep learning network model is as follows: the feature segments are input into a trained spatiotemporal attention network model, which is based on a Long Short-Term Memory (LSTM) network model. The Tanh function is selected as the activation function, and Adam is selected as the optimization algorithm for the LSTM model. At the same time, the hyperparameters of the LSTM model are set. Continuous feature segments are input into the trained spatiotemporal attention network model, and the output is the detection feature segment.

5. The method for analyzing fruit fly feeding behavior according to claim 4, characterized in that: The logic for preliminary screening of detected feature segments is as follows: The duration of each detected feature segment is determined by its start and end timestamps. The duration of each segment is then compared to a set feeding reference threshold. Based on the comparison results, the feature segments suspected of being part of the fruit fly's feeding process in each round are identified. The specific screening method is as follows: like When the time of detection of the feature segment meets the requirements for feeding, the feature segment is recorded as a feature segment of the suspected feeding process. like If the time length of the detected feature segment does not meet the requirements for eating, the detected feature segment will not be further analyzed. in To detect the time length of feature segments, The set reference threshold for the duration of eating.

6. A device for analyzing fruit fly feeding behavior, characterized in that: The aforementioned fruit fly feeding behavior analysis device is used to execute the fruit fly feeding behavior analysis method according to any one of claims 1-5, comprising: The experimental environment group setting module is used to set different environmental parameter groups and conduct fruit fly feeding monitoring experiments with the same experimental variables for different environmental parameters. It monitors the movement of fruit flies at the fruit fly feeding device during the behavioral test period and divides the collected video information into equal frames to form several continuous feature segments. A single fruit fly target is set at each fruit fly feeding device. The feature segmentation module is used to analyze feature segments to determine the feature segments of the suspected feeding process in each round of suspected feeding process of fruit flies, and to acquire surface images of food in the fruit fly feeding device before and after suspected feeding. Each round of suspected feeding process starts when the fruit fly lands on the food and ends when the fruit fly leaves the food. The feeding behavior analysis module is used to compare surface images before and after suspected feeding in the same round of suspected feeding. By comparing the changes in surface structure features of the two images, it determines whether the fruit fly target has engaged in feeding behavior during the round of suspected feeding. If so, the round of suspected feeding is defined as a feeding process, and the amount of food consumed in the round of feeding is characterized based on the changes in surface structure features. The environmental impact analysis module is used to analyze the number of feeding behaviors, average feeding interval, and average food intake of fruit flies under the same time period in different environmental parameter groups, and outputs the impact of different environmental parameters on fruit fly feeding behavior.

Citation Information

Patent Citations

  • Insect feeding behavior analysis method and device and storage medium

    CN111009000A

  • Farm feed monitoring method and device, electronic equipment and storage medium

    CN114724067A

  • High-throughput fruit fly food intake measuring method and application thereof

    CN119509643A