Zebrafish attack behavior recognition method and system based on optimized YOLOv8

CN119007247BActive Publication Date: 2026-09-25SOUTHERN MEDICAL UNIVERSITY
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411202135.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2026-09-25
Estimated Expiration
2044-08-29

AI Technical Summary

Technical Problem

然而,目前对斑马鱼攻击行为特征的量化研究几乎空白,且研究主观性较强

Benefits of technology

[0030]本发明实施例还公开了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器可以从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行前面的方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119007247B_ABST
    Figure CN119007247B_ABST
Patent Text Reader

Abstract

The application discloses a zebrafish attack behavior recognition method and system based on an optimized YOLOv8, and the method comprises the following steps: acquiring a zebrafish dynamic image; recognizing the behavior characteristics of the zebrafish from the zebrafish dynamic image according to an optimized YOLOv8 model; extracting multi-dimensional attack behavior indexes according to the recognized behavior characteristics; and evaluating the influence of a to-be-analyzed substance on the attack behavior of the zebrafish by using a multi-level and multi-angle data analysis method according to the extracted attack behavior indexes. The application has high accuracy, can comprehensively and deeply evaluate the attack behavior of the zebrafish, find the correlation between the attack behavior of the zebrafish and the related drug stimulation, and can be widely applied to the field of computer technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method and system for identifying zebrafish attack behavior based on optimized YOLOv8. Background Technology

[0002] Zebrafish share 70% of their genome with humans, and their high-quality genome has provided a clearer understanding of key genomic features. Zebrafish are renowned for their contributions to genetic biology and have become important clinical trial subjects for studying human diseases. Due to the high conservation and clinical relevance of zebrafish disease characteristics, etiologies, progression, and molecular mechanisms, they are rapidly gaining popularity in translational research in neuroscience and behavioral science. Zebrafish play a crucial role not only in microplastic and nanoplastic toxicity, drug discovery, and high-throughput and high-content phenotypic drug screening, but also in behavioral neuroscience, cancer biology and precision cancer treatment, and toxicological effects. Therefore, zebrafish are important model organisms in developmental genetics, neurophysiology, and biomedicine. For example, the identification of aggressive behavior in zebrafish can be used to analyze the effects of relevant drugs on zebrafish, thereby analyzing the potential effects of these drugs on humans. However, quantitative research on the characteristics of aggressive behavior in zebrafish is currently almost nonexistent, and such research is highly subjective. Summary of the Invention

[0003] The main objective of this invention is to propose a highly accurate zebrafish aggression behavior identification method and system based on optimized YOLOv8, which can comprehensively and deeply evaluate zebrafish aggression behavior and find the correlation between relevant drug stimuli and zebrafish aggression behavior.

[0004] To achieve the above objectives, one aspect of this invention proposes a zebrafish attack behavior identification method based on optimized YOLOv8, comprising the following steps: Acquire dynamic images of zebrafish; Behavioral features of zebrafish were identified from the dynamic images of zebrafish based on an optimized YOLOv8 model. Based on the identified behavioral characteristics, extract multi-dimensional attack behavior indicators; Based on the extracted attack behavior indicators, a multi-level, multi-angle data analysis method was used to assess the impact of the substance under analysis on the attack behavior of zebrafish.

[0005] In some embodiments, identifying zebrafish behavioral features from the zebrafish dynamic image based on an optimized YOLOv8 model includes the following steps: The acquired zebrafish dynamic images were preprocessed to resize all images to a uniform size and convert the RGB images to the YUV color space. Data augmentation techniques were used to augment the preprocessed zebrafish dynamic images to obtain training and test sets. Select YOLOv8-m, initialize model weights, set training hyperparameters, train the model using the SGD optimizer with cosine annealing, and validate the trained recognition model to obtain a YOLOv8 model that meets the validation requirements; wherein, the model validation metrics include mean precision, recall, accuracy, and F1 score. The zebrafish's behavioral characteristics are identified by reasoning through the YOLOv8 model on the zebrafish's dynamic images. The expression for the data augmentation is:

[0006] in, For the original image, For a set of data augmentation transformation functions, The enhanced image; The learning rate adjustment strategy for model training is expressed as follows:

[0007] in, The current learning rate, and These are the minimum and maximum learning rates, respectively. This represents the current iteration number. This represents the total number of iterations.

[0008] In some embodiments, the step of inferring zebrafish dynamic images using the YOLOv8 model to identify zebrafish behavioral characteristics includes the following steps: The zebrafish dynamic image is preprocessed and then input into the YOLOv8 model, which outputs bounding box coordinates, confidence scores and class predictions, and uses a non-maximum suppression algorithm to remove redundant detection boxes. The segmentation mask is output using the YOLOv8 segmentation head, and key points of the zebrafish are identified; the key points include the head, tail, and fins. The Hungarian algorithm was used to associate targets, and the Kalman filter was used to smooth the trajectory to extract the behavioral features of zebrafish. The expression for removing redundant detection boxes using the non-maximum suppression algorithm is as follows:

[0009] in, The set of detection boxes to be retained. For the first One detection box, The bounding box with the highest confidence level is [the bounding box]. It is the intersection-union ratio function; The expression for the segmentation mask is: M(x, y) = {1, if S(x, y)>threshold 0, otherwise} in, It is a binary mask. The probability map output by the segmentation head; The expression for identifying key points in zebrafish is:

[0010] in, For the attitude estimation results, For the first The coordinates of the key points Its confidence level, The total number of key points; The expression for target association is:

[0011] in, and The first The first test result and the first The bounding box of a tracked target. and For the corresponding feature vector, These are the weighting coefficients.

[0012] In some embodiments, extracting multi-dimensional attack behavior indicators based on the identified behavioral characteristics includes the following steps: Based on the identified behavioral characteristics, the kinematic parameters of the zebrafish are calculated; the kinematic parameters include instantaneous velocity, acceleration, and turning angle. Based on the identified behavioral characteristics, the space utilization index of zebrafish is calculated using the minimum bounding rectangle method; the space utilization index includes the activity range and the ratio of time spent in the near-scope area. Based on the identified behavioral characteristics, attack action indicators of zebrafish are extracted; the attack action indicators include attack frequency, attack duration, and attack intensity. Based on the identified behavioral characteristics, posture feature indicators are extracted; the posture feature indicators include body curvature and fin spread angle. Based on the identified behavioral characteristics, group behavior indicators are extracted; the group behavior indicators include inter-individual distance and group cohesion. Based on the extracted attack behavior indicators, time series analysis is performed to obtain statistical characteristics; the statistical characteristics include mean, standard deviation, skewness, kurtosis, and autocorrelation coefficient. Based on the extracted attack behavior indicators, a comprehensive index is constructed, and a comprehensive attack behavior score is calculated.

[0013] In some embodiments, the formula for calculating the range of activity is:

[0014] in, Represents the scope of activities; This represents the length of the smallest bounding rectangle; Represents the width of the smallest bounding rectangle; The formula for calculating the near-vision zone dwell time ratio is as follows:

[0015] in, This represents the ratio of time spent in the near-field region; The time zebrafish spend in the near-mirror area. Total observation time; The attack strength The calculation formula is:

[0016] in, and These are the weighting coefficients; This represents the maximum acceleration during the attack process; Represents the impact velocity during the attack; The body curvature The calculation formula is:

[0017] in, Represents the angle formed by the head, torso, and tail; The group cohesion The calculation formula is:

[0018] in, Representing the Article and Section The Euclidean distance between zebrafish; The comprehensive attack behavior score The calculation formula is:

[0019] in, These are the normalized indicators. These are the corresponding weighting coefficients.

[0020] In some embodiments, the step of evaluating the impact of the substance to be analyzed on the attack behavior of zebrafish using a multi-level, multi-angle data analysis method based on the extracted attack behavior indicators includes the following steps: Based on the extracted attack behavior indicators, descriptive statistical analysis, inferential statistical analysis, correlation analysis, time series analysis, multivariate analysis, machine learning model-based analysis, and dose-response relationship analysis were performed respectively. Based on the results of each analysis, a comprehensive score is calculated to determine the impact of the analyzed substance on zebrafish attack behavior.

[0021] In some embodiments, the descriptive statistical analysis specifically includes: calculating basic statistics of the aggressive behavior indicators for each control group and each exposed group, including mean, median, standard deviation, and quartiles; visualizing the distribution characteristics of the data for each group using box plots and histograms; and assessing the dispersion of the indicators by calculating the coefficient of variation. The calculation formula is:

[0022] in, Represents standard deviation; Represents the mean; The inferential statistical analysis specifically involves: first, a normality test is performed using the Shapiro-Wilk test to check whether the data follows a normal distribution; then, Levene's test is used to check whether the variances of each group of data are equal; if the data satisfy normality and homogeneity of variance, one-way ANOVA is used to analyze the impact of exposure to different concentrations of the analyte on various attack behavior indicators, and the degree of impact. The calculation formula is:

[0023] Where MSB is the between-group mean square and MSW is the within-group mean square; The formula for calculating the correlation analysis is as follows:

[0024] in, Represents the Pearson correlation coefficient; The x variable represents the value of the i-th sample; This represents the average value of the variable x. The y variable represents the value of the i-th sample; This represents the average value of the y variable; The time series analysis is used to capture the changing trends and periodicity of attack behavior indicators over time. Specifically, it involves: using moving average or exponential smoothing methods to analyze trends; and applying fast Fourier transform to detect the potential periodicity of the behavior indicators. The multivariate analysis is used to comprehensively evaluate multiple attack behavior indicators. Specifically, principal component analysis is first used to reduce dimensionality and extract the main behavioral features; then discriminant analysis is used to construct a discriminant function to distinguish zebrafish from different exposure concentration groups. The analysis based on the machine learning model specifically involves: constructing a support vector machine nonlinear classifier; constructing a random forest model containing multiple decision trees and determining the final classification result through majority voting; and designing and training a recurrent neural network suitable for time series data to capture the temporal features of attack behavior. The dose-response relationship analysis specifically involves: constructing a dose-response curve and fitting it using a nonlinear regression method. The expression for this fitting process is as follows:

[0025] in, For the reaction, For concentration, The half-number effect concentration, Hill coefficient; The comprehensive scoring results The calculation formula is:

[0026] in, Scoring is given for each standardized indicator. These are the corresponding weighting coefficients.

[0027] Another aspect of this invention provides a zebrafish attack behavior recognition system based on optimized YOLOv8, comprising: The first module is used to acquire dynamic images of zebrafish; The second module is used to identify the behavioral characteristics of zebrafish from the zebrafish dynamic images based on the optimized YOLOv8 model. The third module is used to extract multi-dimensional attack behavior indicators based on the identified behavioral characteristics. The fourth module is used to evaluate the impact of the substance to be analyzed on the attack behavior of zebrafish using multi-level and multi-angle data analysis methods based on the extracted attack behavior indicators.

[0028] Another aspect of the present invention provides an electronic device, including a processor and a memory; The memory is used to store programs; The processor executes the program to implement the method described above.

[0029] Another aspect of this invention provides a computer-readable storage medium storing a program that is executed by a processor to implement the methods described above.

[0030] This invention also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions, causing the computer device to perform the aforementioned method.

[0031] The embodiments of this invention include at least the following beneficial effects: This invention provides a method and system for identifying zebrafish aggressive behavior based on optimized YOLOv8. The method includes: acquiring dynamic images of zebrafish; identifying behavioral characteristics of zebrafish from the dynamic images using an optimized YOLOv8 model; extracting multi-dimensional aggressive behavior indicators based on the identified behavioral characteristics; and evaluating the impact of the analyzed substance on zebrafish aggressive behavior using multi-level, multi-angle data analysis methods based on the extracted aggressive behavior indicators. This invention has high accuracy and can comprehensively and deeply evaluate zebrafish aggressive behavior, finding the correlation between relevant drug stimuli and zebrafish aggressive behavior. Attached Figure Description

[0032] Figure 1 This is a flowchart of the overall steps provided in the embodiments of the present invention; Figure 2 This is an implementation flowchart provided in the embodiments of the present invention; Figure 3 This is a schematic diagram of the normalized confusion matrix during the training of the model in this invention; Figure 4 This is the accuracy-recall curve of machine learning in the method of this invention; Figure 5 This is a schematic diagram of the kinematic parameters of the method of the present invention; Figure 6 This is an instantaneous velocity trajectory diagram of zebrafish chronically exposed to different concentrations of etomidate in an example of the present invention; Figure 7 This is a time-series diagram of the instantaneous velocity and instantaneous angular velocity of zebrafish chronically exposed to different concentrations of etomidate in an example of the present invention. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of this invention; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this invention as detailed in the appended claims.

[0034] It is understood that the terms “first,” “second,” etc., used in this invention may be used herein to describe various concepts, but unless specifically stated otherwise, these concepts are not limited by these terms. These terms are used only to distinguish one concept from another. For example, first information may also be referred to as second information without departing from the scope of embodiments of the invention, and similarly, second information may also be referred to as first information. Depending on the context, the words “if,” “when,” or “in response to determination” as used herein may be interpreted as “when…” or “when…” or “in response to determination.”

[0035] The terms “at least one,” “multiple,” “each,” “any,” etc., used in this invention, “at least one” includes one, two, or more than two; “multiple” includes two or more than two; “each” refers to each of the corresponding multiple; and “any” refers to any one of the multiple.

[0036] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit the invention.

[0037] The zebrafish attack behavior identification method and system based on optimized YOLOv8 provided in this invention relates to the field of computer technology. The zebrafish attack behavior identification method based on optimized YOLOv8 provided in this invention can be applied to terminals, servers, or software running on either terminal or server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or in-vehicle terminal, but is not limited to these. The server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network. The software can be an application implementing the zebrafish attack behavior identification method based on optimized YOLOv8, but is not limited to the above forms.

[0038] This invention can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This invention can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This invention can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0039] Reference Figure 1 , Figure 1 The flowchart illustrates a zebrafish attack behavior identification method based on optimized YOLOv8 applied to a server, as provided in this embodiment of the invention. The executing entity of this method can be any of the aforementioned computer devices (including servers or terminals). (Refer to...) Figure 1 The method may include the following steps: Acquire dynamic images of zebrafish; Behavioral features of zebrafish were identified from the dynamic images of zebrafish using an optimized YOLOv8 model. Based on the identified behavioral characteristics, extract multi-dimensional attack behavior indicators; Based on the extracted attack behavior indicators, a multi-level, multi-angle data analysis method was used to assess the impact of the analyzed substance on the attack behavior of zebrafish.

[0040] The following section uses the construction of a zebrafish model of chronic exposure to the novel psychoactive substance etomidate as an example, taking etomidate as the analyte of this invention. The specific implementation process of this invention will be described in detail below with reference to the accompanying drawings: Preparatory work may include: 1. Etomidate (ETO) was prepared into a high-concentration etomidate stock solution with a concentration of 20 mg / mL using chromatographically pure dimethyl sulfoxide (DMSO) as solvent and stored at -20℃ protected from light. 2. The pre-prepared high-concentration etomidate stock solution was diluted with the system water of the zebrafish farming system to obtain etomidate exposure solutions with concentrations of 0 μg / L, 20 μg / L and 200 μg / L. The solutions were prepared and used immediately. The concentration of the cosolvent dimethyl sulfoxide (DMSO) in each concentration exposure solution was controlled to be ≤0.1% (v / v). 3. Thirty-six uniformly sized, healthy three-month-old female zebrafish were randomly assigned to three groups for an exposure experiment; 4. Each group of zebrafish was placed in a 5L beaker for 28 days of exposure, with a light / dark cycle of 14h / 10h, a temperature of 26±1℃, and a humidity of 70±5%. Every 24 hours, the exposure solution was replaced with a freshly prepared solution of the same concentration, with a solution volume of 3L.

[0041] It is important to note that the overuse of new psychoactive substances poses significant challenges to law enforcement and public health. For example, etomidate, a new psychoactive substance, is increasingly overused due to its widespread use in clinical anesthesia. Abuse of etomidate can lead to neurological dysfunction and neurobehavioral abnormalities such as myoclonus. According to the World Health Organization, overuse increases the likelihood of developing related aggressive behaviors, which has serious negative impacts on an individual's social life and mental health, and is often closely associated with stress, anxiety, and depression. Despite extensive research in clinical settings, our understanding of the pathobiology of violent behavior remains limited, requiring further cross-species translational and evolutionary correlation analyses. Zebrafish are an ideal model organism for translational neurobehavioral research, primarily due to their high genetic and physiological homology with humans, particularly in evolutionarily conserved neurotransmitter systems and central nervous system morphology. Furthermore, zebrafish exhibit many human-related behavioral responses, including aggression, anxiety, fear, stress, and social behavior. However, quantitative research on the characteristics of aggressive behavior in zebrafish is currently almost nonexistent, and existing studies are highly subjective. Based on the improved YOLOv8 algorithm, dynamic zebrafish can be identified and tracked. Through real-time dynamic monitoring and data quantification methods, the dynamic behavior of zebrafish chronically exposed to new psychoactive substances can be comprehensively evaluated.

[0042] like Figure 2 As shown, the overall implementation steps of this embodiment of the invention may include the following steps: A. Acquisition of dynamic images of zebrafish Each zebrafish was placed in a test tank and allowed to acclimatize for five minutes before a 10-minute video recording was made. A rectangular tank measuring 25cm x 17cm x 20cm was constructed using frosted acrylic sheets, with a mirror attached to the inside of one side. The area within 3cm of the mirror was designated as the near-mirror zone.

[0043] B. Zebrafish identification: 1. Model training: First, the pre-acquired raw zebrafish images are preprocessed. Preprocessing steps include image size normalization, color space conversion, and data augmentation. Specifically, all images are resized to a uniform size, such as 640x640 pixels; RGB images are converted to the YUV color space; and data augmentation techniques are applied, including random rotation, horizontal flipping, brightness adjustment, contrast adjustment, and Gaussian noise addition.

[0044] Data augmentation can be represented as:

[0045] in, For the original image, For a set of data augmentation transformation functions, The image is the enhanced version. After preprocessing, the dataset is divided into training and test sets using stratified sampling at a ratio of 8:2.

[0046] Next, select YOLOv8-m, initialize the model weights, and set the training hyperparameters. Train the model using the SGD optimizer with cosine annealing. The learning rate adjustment strategy can be expressed as:

[0047] in, The current learning rate, and These are the minimum and maximum learning rates, respectively. This represents the current iteration number. This represents the total number of iterations.

[0048] 2. Model Validation: The test set is input into the trained zebrafish target recognition video, and the zebrafish target recognition video is evaluated.

[0049] The reserved test set is input into the trained zebrafish target recognition model. For each test image, preprocessing, model forward propagation, and postprocessing steps are performed. The model's performance metrics on the test set are calculated, including mean accuracy (mAP), recall (R), precision (P), and F1 score. The formulas for these metrics are as follows:

[0050]

[0051]

[0052]

[0053] in, It is a true positive. It was a false positive. It was a false negative. This represents the average accuracy at a specific threshold.

[0054] 3. Model Reasoning: 3.1 Target Detection: The input image is preprocessed and then fed into the YOLOv8 model. The model output includes bounding box coordinates, confidence scores, and class predictions. Non-maximum suppression (NMS) is applied to remove redundant detection boxes. The NMS process can be represented as:

[0055] in, The set of detection boxes to be retained. For the first One detection box, The bounding box with the highest confidence level is [the bounding box]. It is the intersection-union ratio function.

[0056] 3.2 Object Detection + Segmentation: Output the segmentation mask using the YOLOv8 segmentation header.

[0057] The binarization process can be represented as: M(x, y) = {1, if S(x, y)>threshold 0, otherwise} in, It is a binary mask. This is the probability map output by the segmentation head.

[0058] 3.3 、 Object detection + pose detection: Key features for identifying zebrafish (such as head, tail, fins, etc.). Pose estimation can be expressed as:

[0059] in, For the attitude estimation results, For the first The coordinates of the key points Its confidence level, This represents the total number of key points.

[0060] 3.4 Target Tracking: Target association is performed using the Hungarian algorithm. Association cost matrix. The elements can be represented as:

[0061] in, and The first The first test result and the first The bounding box of a tracked target. and For the corresponding feature vector, These are the weighting coefficients.

[0062] The trajectory is smoothed using a Kalman filter. The prediction steps of the Kalman filter can be expressed as:

[0063]

[0064] The update steps are as follows:

[0065]

[0066]

[0067] in, For state estimation, Let be the error covariance matrix. Here is the state transition matrix. For process noise covariance, For the observation matrix, To measure the noise covariance, For Kalman gain.

[0068] Through the above steps, this method can comprehensively and dynamically analyze the behavioral characteristics of zebrafish, providing rich and accurate data support for subsequent attack behavior analysis. The application of these mathematical formulas and algorithms ensures the accuracy and repeatability of the analysis process.

[0069] C. Extraction of attack behavior indicators: This invention extracts multi-dimensional attack behavior indicators by analyzing the zebrafish identification and tracking data obtained in step C. The specific steps are as follows: 1. Extraction of kinematic parameters: First, calculate the zebrafish's instantaneous velocity, acceleration, and turning angle.

[0070] 1.1 Instantaneous velocity calculation: Instantaneous velocity is calculated using the change in the zebrafish's center of mass position between adjacent frames. Let... The zebrafish's position at any given time is Then instantaneous velocity It can be represented as:

[0071] in, This represents the time interval between adjacent frames.

[0072] 1.2 Acceleration Calculation: Acceleration calculation based on instantaneous velocity :

[0073] 1.3 Steering Angle calculate:

[0074] 2. Space utilization indicators: 2.1 Activity Range Calculation: The activity range of the zebrafish is calculated using the minimum bounding rectangle (MER) method. Let the length and width of the MER be L and W, respectively. Then the activity range S can be expressed as:

[0075] 2.2. Near-field zone dwell time ratio :

[0076] in, The time zebrafish spend in the near-mirror area. This represents the total observation time.

[0077] 3. Attack behavior feature extraction: 3.1 Attack Frequency Records the number of times a zebrafish attacks a mirror image per unit of time. An attack is detected when the zebrafish rapidly approaches the mirror and makes a collision motion.

[0078] 3.2 Attack Duration Record the duration of each attack and calculate the average attack duration.

[0079] 3.3 Attack Strength Based on the maximum acceleration during the attack process and impact speed definition:

[0080] in, and These are the weighting coefficients.

[0081] 4. Pose Feature Extraction: 4.1 Body curvature Using the key point information obtained in step (c), calculate the angle formed by the head, torso, and tail. :

[0082] 4.2 Fin Deployment Angle : Calculate the opening angle of the pectoral fins relative to the torso.

[0083] 5. Group behavior indicators (applicable to situations where multiple zebrafish are observed simultaneously): 5.1 Inter-individual distance : Calculate the first Article and Section Euclidean distance between zebrafish:

[0084] 5.2 Group Cohesion Defined as the sum of the reciprocals of the distances between all individuals:

[0085] 6. Time series feature extraction: Time series analysis was performed on the extracted indicators to calculate statistical characteristics, including but not limited to: mean. Standard deviation skewness kurtosis Autocorrelation coefficient .

[0086] 7. Construction of comprehensive indicators: Based on the extracted indicators, a comprehensive attack behavior score is constructed. :

[0087] in, These are the normalized indicators. These are the corresponding weighting coefficients. The weighting coefficients can be determined through principal component analysis (PCA) or expert experience.

[0088] Through the above steps, this invention achieves a comprehensive quantitative description of zebrafish aggressive behavior, providing a reliable data foundation for subsequent behavioral analysis and drug effect assessment. These indicators not only reflect individual-level behavioral characteristics but also contain group-level interaction information, contributing to a deeper understanding of the mechanisms by which novel psychoactive substances influence zebrafish aggressive behavior.

[0089] D. Data Analysis After extracting the indicators of aggressive behavior, this invention employs a multi-level, multi-angle data analysis method to comprehensively evaluate the impact of novel psychoactive substances on the aggressive behavior of zebrafish. The specific analysis steps are as follows: 1. Descriptive statistical analysis: First, basic statistics of the attack behavior indicators for each group (control group, 20 μg / L exposure group, and 200 μg / L exposure group) were calculated, including mean (μ), median (Med), standard deviation (σ), and quartiles (Q1, Q3). These statistics provide a foundation for understanding the basic distribution characteristics of the data. Furthermore, visualization methods such as box plots and histograms were used to present the distribution characteristics of the data for each group. The coefficient of variation (CV) was used to assess the dispersion of the indicators, and its calculation formula is as follows:

[0090] 2. Inferential statistical analysis: To further analyze the data, a normality test was first performed using the Shapiro-Wilk test to check whether the data followed a normal distribution. Next, Levene's test was used to check whether the variances of the data groups were equal. If the data satisfied normality and homogeneity of variance, a one-way ANOVA was used to analyze the impact of different concentrations of the novel psychoactive substance etomidate exposure on various aggressive behavior indicators. The calculation formula is as follows:

[0091] Here, MSB represents the between-group mean square, and MSW represents the within-group mean square. If the data do not meet the assumptions of normality or homogeneity of variance, the Kruskal-Wallis H test is used instead of ANOVA. Subsequently, Tukey's HSD (Honestly Significant Difference) method is used for post-hoc multiple comparisons to determine the significance of differences between groups.

[0092] 3. Correlation analysis: To assess the correlation between different attack behavior indicators, the Pearson correlation coefficient (r) or Spearman rank correlation coefficient (ρ) is calculated:

[0093] The correlation results are presented intuitively through a correlation heatmap, showing the strength of the association between indicators.

[0094] 4. Time series analysis: Time series analysis is used to capture the trends and periodicity of attack behavior indicators over time. Moving averages or exponential smoothing are used to analyze trends; Fast Fourier Transform (FFT) is applied to detect potential periodicity in the behavioral indicators.

[0095] In addition, an ARIMA (autoregressive integral moving average) model was constructed to assess the long-term effects of exposure to the novel psychoactive substance etomidate on aggressive behavior in zebrafish.

[0096] 5. Multivariate analysis: Multivariate analysis is used to comprehensively evaluate multiple attack behavior indicators. First, principal component analysis (PCA) is used for dimensionality reduction to extract the main behavioral features, whose eigenvalue equation is:

[0097] Where A is the covariance matrix, λ is the eigenvalue, and v is the eigenvector. Next, discriminant analysis (LDA) is used to construct the discriminant function:

[0098] To distinguish zebrafish from different exposure concentration groups.

[0099] 6. Machine learning models: Machine learning techniques are applied to further analyze the data. A support vector machine (SVM) non-linear classifier is constructed, and the objective function is optimized as follows:

[0100]

[0101] Simultaneously, a random forest model containing multiple decision trees is constructed, and the final classification result is determined by majority voting. A recurrent neural network (RNN) suitable for time series data is designed and trained to capture the temporal characteristics of attack behavior.

[0102] 7. Dose-response relationship analysis: To clarify the relationship between the concentration of the novel psychoactive substance etomidate and indicators of aggressive behavior, a dose-response curve was constructed and fitted using a nonlinear regression method (such as the Hill equation):

[0103] Where R represents the reaction, C represents the concentration, EC50 represents the half-maximal effective concentration, and n represents the Hill coefficient. Simultaneously, the minimum observable effect concentration (LOEC) and the no-observable effect concentration (NOEC) are calculated.

[0104] 8. Comprehensive scoring system: Based on the above analysis results, a comprehensive scoring system was constructed to quantitatively evaluate the overall impact of the new psychoactive substance etomidate on zebrafish aggressive behavior:

[0105] in, Scoring is given for each standardized indicator. These are the corresponding weighting coefficients.

[0106] Through the multi-dimensional and multi-level data analysis methods described above, this invention achieves a comprehensive and in-depth assessment of the effects of the novel psychoactive substance etomidate on zebrafish aggressive behavior. This systematic analytical approach not only reveals the association pattern between chronic exposure to the novel psychoactive substance and zebrafish aggressive behavior, but also provides solid data support and methodological foundation for further research on its mechanism of action.

[0107] refer to Figures 3-7 The embodiments of this invention demonstrate in detail the advantages and effects of the zebrafish attack identification method of this invention: Figure 3 This is a schematic diagram of the normalized confusion matrix during the training of the model of the present invention, which shows the correlation of the accuracy of zebrafish identification; Figure 4 This is the accuracy-recall curve of machine learning in the method of this invention, which shows the performance of the machine learning model under different decision thresholds. Figure 5 This is a schematic diagram of the kinematic indices of the method of the present invention, illustrating the motion parameters extracted by the present invention; Figure 6 This is an instantaneous velocity trajectory diagram of zebrafish chronically exposed to different concentrations of etomidate in an example of the present invention; Figure 7 This is a time-series diagram of the instantaneous velocity and instantaneous angular velocity of zebrafish chronically exposed to different concentrations of etomidate in an example of the present invention.

[0108] This invention also provides a zebrafish attack behavior recognition system based on optimized YOLOv8, comprising: The first module is used to acquire dynamic images of zebrafish; The second module is used to identify the behavioral characteristics of zebrafish from the zebrafish dynamic images based on the optimized YOLOv8 model. The third module is used to extract multi-dimensional attack behavior indicators based on the identified behavioral characteristics. The fourth module is used to evaluate the impact of the substance to be analyzed on the attack behavior of zebrafish using multi-level and multi-angle data analysis methods based on the extracted attack behavior indicators.

[0109] It is understood that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0110] This invention also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned zebrafish attack behavior recognition method based on optimized YOLOv8. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0111] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0112] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described zebrafish attack behavior identification method based on optimized YOLOv8.

[0113] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0114] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0115] The embodiments described in this invention are for the purpose of more clearly illustrating the technical solutions of the embodiments of this invention, and do not constitute a limitation on the technical solutions provided by the embodiments of this invention. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this invention are also applicable to similar technical problems.

[0116] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present invention, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0117] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0118] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0119] The terms "first," "second," "third," "fourth," etc. (if present) in the specification and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0120] It should be understood that in this invention, "at least one (item)" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0121] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0122] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, 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 according to actual needs.

[0123] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0124] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0125] The preferred embodiments of the present invention have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and spirit of the present invention should be within the scope of the claims of the present invention.

Claims

1. A zebrafish attack behavior recognition method based on optimized YOLOv8, characterized in that, Includes the following steps: Acquire dynamic images of zebrafish; Behavioral features of zebrafish were identified from the dynamic images of zebrafish based on an optimized YOLOv8 model. Based on the identified behavioral characteristics, extract multi-dimensional attack behavior indicators; Based on the extracted attack behavior indicators, a multi-level and multi-angle data analysis method was used to evaluate the impact of the substance to be analyzed on the attack behavior of zebrafish. The method of evaluating the impact of the substance to be analyzed on the aggressive behavior of zebrafish using multi-level and multi-angle data analysis based on the extracted attack behavior indicators includes the following steps: Based on the extracted attack behavior indicators, descriptive statistical analysis, inferential statistical analysis, correlation analysis, time series analysis, multivariate analysis, machine learning model-based analysis, and dose-response relationship analysis were performed respectively. Based on the results of each analysis, a comprehensive score is calculated to determine the impact of the analyzed substance on zebrafish attack behavior. The descriptive statistical analysis specifically includes: calculating the basic statistics of the aggressive behavior indicators for each control group and each exposed group, including the mean, median, standard deviation, and quartiles; using box plots and histograms to visualize the distribution characteristics of the data for each group; and assessing the dispersion of the indicators by calculating the coefficient of variation. The calculation formula is: in, Represents standard deviation; Represents the mean; The inferential statistical analysis specifically involves: first, a normality test is performed using the Shapiro-Wilk test to check whether the data follows a normal distribution; then, Levene's test is used to check whether the variances of each group of data are equal; if the data satisfy normality and homogeneity of variance, one-way ANOVA is used to analyze the impact of exposure to different concentrations of the analyte on various attack behavior indicators, and the degree of impact. The calculation formula is: Where MSB is the between-group mean square and MSW is the within-group mean square; The formula for calculating the correlation analysis is as follows: in, Represents the Pearson correlation coefficient; The x variable represents the value of the i-th sample; This represents the average value of the variable x. The y variable represents the value of the i-th sample; This represents the average value of the y variable; The time series analysis is used to capture the changing trends and periodicity of attack behavior indicators over time. Specifically, it involves: using moving average or exponential smoothing methods to analyze trends; and applying fast Fourier transform to detect the potential periodicity of the behavior indicators. The multivariate analysis is used to comprehensively evaluate multiple attack behavior indicators. Specifically, principal component analysis is first used to reduce dimensionality and extract the main behavioral features; then discriminant analysis is used to construct a discriminant function to distinguish zebrafish from different exposure concentration groups. The analysis based on the machine learning model specifically involves: constructing a support vector machine nonlinear classifier; constructing a random forest model containing multiple decision trees and determining the final classification result through majority voting; and designing and training a recurrent neural network suitable for time series data to capture the temporal features of attack behavior. The dose-response relationship analysis specifically involves: constructing a dose-response curve and fitting it using a nonlinear regression method. The expression for this fitting process is as follows: in, For the reaction, For concentration, The half-number effect concentration, Hill coefficient; The comprehensive scoring results The calculation formula is: in, Scoring is given for each standardized indicator. These are the corresponding weighting coefficients.

2. The zebrafish attack behavior recognition method based on optimized YOLOv8 according to claim 1, characterized in that, The step of identifying zebrafish behavioral features from the zebrafish dynamic images based on the optimized YOLOv8 model includes the following steps: The acquired zebrafish dynamic images were preprocessed to resize all images to a uniform size and convert the RGB images to the YUV color space. Data augmentation techniques were used to augment the preprocessed zebrafish dynamic images to obtain training and test sets. Select YOLOv8-m, initialize model weights, set training hyperparameters, train the model using the SGD optimizer with cosine annealing, and validate the trained recognition model to obtain a YOLOv8 model that meets the validation requirements; wherein, the model validation metrics include mean precision, recall, accuracy, and F1 score. The zebrafish's behavioral characteristics are identified by reasoning through the YOLOv8 model on the zebrafish's dynamic images. The expression for the data augmentation is: in, For the original image, For a set of data augmentation transformation functions, The enhanced image; The learning rate adjustment strategy for model training is expressed as follows: in, The current learning rate, and These are the minimum and maximum learning rates, respectively. This represents the current iteration number. This represents the total number of iterations.

3. The zebrafish attack behavior recognition method based on optimized YOLOv8 according to claim 2, characterized in that, The step of inferring from the zebrafish dynamic image using the YOLOv8 model to identify the zebrafish's behavioral characteristics includes the following steps: The zebrafish dynamic image is preprocessed and then input into the YOLOv8 model, which outputs bounding box coordinates, confidence scores and class predictions, and uses a non-maximum suppression algorithm to remove redundant detection boxes. The segmentation mask is output using the YOLOv8 segmentation head, and key points of the zebrafish are identified; the key points include the head, tail, and fins. The Hungarian algorithm was used to associate targets, and the Kalman filter was used to smooth the trajectory to extract the behavioral features of zebrafish. The expression for removing redundant detection boxes using the non-maximum suppression algorithm is as follows: in, The set of detection boxes to be retained. For the first One detection box, The bounding box with the highest confidence level is [the bounding box]. It is the intersection-union ratio function; The expression for the segmentation mask is: M(x, y) = {1, if S(x, y)>threshold 0, otherwise} in, It is a binary mask. The probability map output by the segmentation head; The expression for identifying key points in zebrafish is: in, For the attitude estimation results, For the first The coordinates of the key points Its confidence level, The total number of key points; The expression for target association is: in, and The first The first test result and the first The bounding box of a tracked target. and For the corresponding feature vector, These are the weighting coefficients.

4. The zebrafish attack behavior recognition method based on optimized YOLOv8 according to claim 1, characterized in that, The step of extracting multi-dimensional attack behavior indicators based on the identified behavioral characteristics includes the following steps: Based on the identified behavioral characteristics, the kinematic parameters of the zebrafish are calculated; the kinematic parameters include instantaneous velocity, acceleration, and turning angle. Based on the identified behavioral characteristics, the space utilization index of zebrafish is calculated using the minimum bounding rectangle method; the space utilization index includes the activity range and the ratio of time spent in the near-scope area. Based on the identified behavioral characteristics, attack action indicators of zebrafish are extracted; the attack action indicators include attack frequency, attack duration, and attack intensity. Based on the identified behavioral characteristics, posture feature indicators are extracted; the posture feature indicators include body curvature and fin spread angle. Based on the identified behavioral characteristics, group behavior indicators are extracted; the group behavior indicators include inter-individual distance and group cohesion. Based on the extracted attack behavior indicators, time series analysis is performed to obtain statistical characteristics; the statistical characteristics include mean, standard deviation, skewness, kurtosis, and autocorrelation coefficient. Based on the extracted attack behavior indicators, a comprehensive index is constructed, and a comprehensive attack behavior score is calculated.

5. The zebrafish attack behavior recognition method based on optimized YOLOv8 according to claim 4, characterized in that, The formula for calculating the activity range is: in, Represents the scope of activities; This represents the length of the smallest bounding rectangle; Represents the width of the smallest bounding rectangle; The formula for calculating the near-vision zone dwell time ratio is as follows: in, This represents the ratio of time spent in the near-field region; The time zebrafish spend in the near-mirror area. Total observation time; The attack strength The calculation formula is: in, and These are the weighting coefficients; This represents the maximum acceleration during the attack process; Represents the impact velocity during the attack; The body curvature The calculation formula is: in, Represents the angle formed by the head, torso, and tail; The group cohesion The calculation formula is: in, Representing the Article and Section The Euclidean distance between zebrafish; The comprehensive attack behavior score The calculation formula is: in, These are the normalized indicators. These are the corresponding weighting coefficients.

6. A system for implementing the zebrafish attack behavior recognition method based on optimized YOLOv8 as described in any one of claims 1-5, characterized in that, include: The first module is used to acquire dynamic images of zebrafish; The second module is used to identify the behavioral characteristics of zebrafish from the zebrafish dynamic images based on the optimized YOLOv8 model. The third module is used to extract multi-dimensional attack behavior indicators based on the identified behavioral characteristics. The fourth module is used to evaluate the impact of the substance to be analyzed on the attack behavior of zebrafish using multi-level and multi-angle data analysis methods based on the extracted attack behavior indicators.

7. An electronic device, characterized in that, Including the processor and memory; The memory is used to store programs; The processor executes the program to implement the method as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The storage medium stores a program that is executed by a processor to implement the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Fish attack behavior quantification method and device based on artificial neural network, and storage medium

    CN112395810A

  • Multi-target tracking method based on Mask R-CNN and apparent feature fusion

    CN113506317A

  • Fish school condition location preference-based method for evaluating addiction and neurotoxicity of fentanyl drugs

    CN115777584A

  • SAR image recognition method and system

    CN117523288A