A contactless zebrafish heart rate measurement system based on optical flow estimation algorithm

Through optical coherence tomography technology and optical flow estimation algorithm, combined with the adaptive container and water pump system, the problem of low efficiency and injury of zebrafish heart rate measurement is solved, non-contact and damage-free heart rate measurement is achieved, and the accuracy and efficiency of measurement are improved. .

CN118576171BActive Publication Date: 2024-10-11FUJIAN POLYTECHNIC OF INFORMATION TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411074738.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-10-11
Estimated Expiration
2044-08-07

AI Technical Summary

Technical Problem

Existing zebrafish heart rate measurement methods are inefficient and harmful to zebrafish. They lack non-contact, non-injury, fast and accurate quantitative statistical methods.

Method used

Using optical coherence tomography technology combined with the optical flow estimation algorithm, the zebrafish is placed in a transparent material container through an adaptive container and water pump system, and OCT images of the abdominal heart are collected, preprocessed and processed with an optical flow estimation algorithm, and the heartbeat waveform is fitted. and calculate heart rate.

Benefits of technology

It achieves non-contact and damage-free zebrafish heart rate measurement, avoids physical and chemical damage, improves the accuracy and efficiency of measurement, and meets the needs of scientific research.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118576171B_ABST
    Figure CN118576171B_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image data processing, and in particular to a contactless zebrafish heart rate measurement system based on an optical flow estimation algorithm. The system comprises a water tank containing zebrafish; an adaptation container, which is used for adaptive training, and is a rectangular parallelepiped and made of transparent material. When the system is working, the system comprises: placing the zebrafish in the water tank into the adaptation container; using an optical coherence tomography device to collect an OCT image of the heart of the zebrafish in the adaptation container; preprocessing the OCT image; using an optical flow estimation algorithm to process the preprocessed OCT image; fitting the zebrafish heart waveform; and calculating the zebrafish heart value. The invention realizes non-destructive evaluation of the zebrafish heart function and avoids physical and chemical damages through OCT, an optical flow estimation algorithm, an adaptive container made of transparent material and adaptive training; and corrects the motion trajectory to an approximate straight line through univariate linear regression fitting, so as to be suitable for detecting zebrafish swimming naturally.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image data processing, and in particular to a contactless zebrafish heart rate measurement system based on an optical flow estimation algorithm. Background Art

[0002] The heart is the core organ of the human cardiovascular system, responsible for pumping blood and maintaining circulation, ensuring that tissues throughout the body receive adequate oxygen and nutrition. As a powerful biological model, zebrafish are highly similar to humans in genetics and development, and have the same internal organ development mechanisms as humans, including the development mechanisms of organs such as the heart, kidneys, bones, fat, and neurons, and can be used in genetics and disease research in many fields. Therefore, the zebrafish model has become an ideal choice for research on the heart and related fields.

[0003] Heart rate is an extremely important indicator for judging whether heart function is normal. Although zebrafish have great advantages in heart research, there is no good method for quantifying zebrafish heart rate. The traditional manual counting method is very inefficient. In addition, due to the small heart of zebrafish, it needs to be placed under a stereo microscope for observation. Inserted heart electrodes will cause significant damage to zebrafish. Therefore, a non-destructive, non-contact, fast and accurate method is needed to quantify it. Summary of the invention

[0004] In order to overcome the defects of the prior art mentioned above, the technical problem to be solved by the present invention is to provide a non-contact zebrafish heart rate measurement system based on an optical flow estimation algorithm which combines optical coherence tomography technology and an optical flow estimation algorithm.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0006] A non-contact zebrafish heart rate measurement system based on optical flow estimation algorithm, comprising:

[0007] A water tank, wherein a plurality of zebrafish are contained;

[0008] An adaptation container, wherein the interior of the adaptation container has a storage space that can only accommodate one zebrafish, the adaptation container is a rectangular parallelepiped and made of a transparent material, the front end of the adaptation container has a water inlet, the rear end of the adaptation container has a water outlet connected to a water tank, and the top of the adaptation container has an opening; the water inlet is connected to the water tank for breeding zebrafish through a water pump; during training, the adaptation container is used to train the zebrafish to enter the adaptation container through the opening;

[0009] Optical coherence tomography device;

[0010] The contactless zebrafish heart rate measurement system based on optical flow estimation algorithm works as follows:

[0011] Step S0: placing the zebrafish in the water tank into the adaptation container through the opening and continuously operating the water pump until the zebrafish adapt to the environment of the adaptation container;

[0012] Step S1: using an optical coherence tomography device to collect OCT images of the abdomen, heart, and surrounding tissues of the zebrafish in the container;

[0013] Step S2: preprocessing the OCT image;

[0014] Step S3: Processing the preprocessed OCT image using an optical flow estimation algorithm;

[0015] Step S4: zebrafish heartbeat waveform fitting includes:

[0016] S41: for each frame of image completed in step S3, all images are arranged in chronological order, the tracking points in the image are extracted and their sequential numbers and corresponding coordinates in the image are recorded; a discrete distribution diagram of these coordinate points is drawn in a two-dimensional coordinate axis to obtain the distribution of the motion trajectory of the tracking points;

[0017] S42: Approximate the motion trajectory as a straight line, and use the following formula to perform univariate linear regression fitting on these discrete points:

[0018] Formula (1)

[0019] The parameters a and b can be obtained from equations (2) and (3):

[0020] Formula (2)

[0021] Formula (3)

[0022] in, is the horizontal coordinate of each discrete point, is the mean of the horizontal coordinates of all discrete points, is the ordinate of each discrete point, is the mean value of the ordinates of all discrete points. Substituting equations (2) and (3) into equation (1), we can obtain the approximate motion trajectory equation of the discrete points.

[0023] S43: quantify the motion trajectories of all discrete points of the tracking points distributed in two-dimensional space using an omnidirectional linear motion trajectory analysis method;

[0024] S44: after obtaining the discrete motion displacement value in step S43, performing waveform fitting on the distribution of the displacement value with respect to time, and fitting it again using a cubic spline interpolation method to obtain a heartbeat waveform fitting image;

[0025] Step S5: Calculating the heart rate value of the zebrafish includes:

[0026] S51: performing peak detection on the obtained waveform of the heart beat;

[0027] S52: While obtaining each heartbeat waveform peak, record its image frame number value, calculate the number of image frames between adjacent peaks, multiply by the time used to collect each image, which is the time interval between two heartbeats, and calculate the average time interval between all peaks and adjacent peaks, which is the average heartbeat interval, so that the heartbeat frequency can be calculated. The specific calculation method is given by the following formula:

[0028] Formula (4)

[0029] in, is the peak detected by the algorithm, is the number of image frames between adjacent peaks, is the number of peak intervals, is the time to collect a single image frame data, is the frequency of zebrafish heartbeat, in beats / minute;

[0030] S53: Comprehensively calculate the heartbeat data of the zebrafish during the detection time to analyze and calculate the heart rate of the zebrafish.

[0031] Preferably, step S43 further comprises:

[0032] S431: All discrete points distributed in the two-dimensional space by the tracking point are recorded as points according to the order of the image frames. , , …, , calculate the projection points of all discrete points on the previously calculated linear regression equation line , , …, And record its coordinates;

[0033] S432: Divide the longest line segment formed by the projection points into two segments, and count the number of projection points on each of the two segments. and Num2, and compare the two. The segment with more projection points is defined as the resting position of the heart, and the segment with fewer projection points is defined as the contraction position of the heart. The farthest point of the resting position is recorded as , the farthest point of the contraction position is recorded as ;

[0034] S433: Calculate projection points respectively according to the order of frame arrangement , , …, The farthest point to the retracted position The two-dimensional Euclidean distance of the original discrete point , , …, The motion displacement fitting value between .

[0035] Preferably, the step S2 further comprises:

[0036] S21: Use Gaussian kernel to perform high-pass filtering on the entire OCT image;

[0037] S22: using the convolution kernel to perform median filtering on the OCT image;

[0038] S23: converting all filtered OCT images into grayscale images;

[0039] S24: Manually select tracking points of the initial frame image of each group of data on the filtered grayscale image.

[0040] Preferably, the S21 further comprises: using a 3×3 Gaussian kernel to perform high-pass filtering on the entire OCT image.

[0041] Preferably, the S22 further comprises: performing median filtering on the OCT image using a 5×5 convolution kernel;

[0042] Preferably, the step S3 further comprises:

[0043] S31: Based on the Farneback algorithm, Gaussian smoothing is used to smooth the displacement values ​​in the optical flow field;

[0044] S32: Introduce the inertia coefficient and set the tracking point position of the current frame to a part of the position of the previous frame;

[0045] S33: For the tracking point selected in step S2, use the designed optical flow estimation algorithm to track the position of the tracking point in each subsequent frame image and mark it.

[0046] Preferably, S51 further includes: using an automatic multi-scale peak search algorithm to perform peak detection on the obtained heart beat waveform.

[0047] Preferably, during training, the adaptation container is placed in a water tank for breeding zebrafish.

[0048] Preferably, step S1 further comprises: taking out the adaptation container from the water tank, and using an optical coherence tomography device to collect OCT images of the abdomen, heart and surrounding tissues of the zebrafish in the adaptation container.

[0049] Preferably, the outer surface of the adaptive container has a hydrophobic layer.

[0050] The beneficial effects of the present invention are as follows: the present application provides a contactless zebrafish heart rate measurement system, which avoids the zebrafish heart rate detection under the condition of causing physical and chemical damage to the zebrafish; by utilizing optical coherence tomography (OCT) technology, combined with an optical flow estimation algorithm, a non-destructive evaluation of the zebrafish heart function is achieved, avoiding physical damage; by adapting to the design of a rectangular container and a transparent material, the zebrafish is safely placed in a controlled environment, and the accommodating space that can only accommodate one zebrafish prevents the zebrafish from turning around and reduces external interference. The acquisition of OCT images combined with the preprocessing steps can be achieved through the transparent material and the flat surface of the rectangular block without being disturbed by reflection. If a curved surface is used, the light will be distorted and not suitable for OCT imaging, thereby avoiding traditional anesthesia that causes changes in the zebrafish's heart rate and chemical damage, thereby ensuring that the zebrafish is in self-anaesthesia. The heart rate in the natural state can meet the needs of scientific research; through univariate linear regression fitting, the motion trajectory of the zebrafish heart can be corrected to an approximate straight line, which is suitable for detecting zebrafish in a natural swimming state and simplifies the difficulty of analyzing complex motion patterns. The approximate motion trajectory equation of discrete points provides necessary parameters for fitting the straight line, ensuring that the straight line equation can accurately reflect the motion law of the zebrafish heart and then obtain the heartbeat waveform fitting image, which improves the readability of the data; the time interval between adjacent heartbeat peaks is calculated through the heartbeat waveform fitting image to determine the heart rate of the zebrafish; through the joint action of these formulas, a complete mathematical model is formed for analyzing and understanding the movement and function of the zebrafish heart; the combination with these formulas improves the accuracy of heart rate measurement while avoiding physical and chemical damage, and avoids the interference of various interference factors on the heartbeat. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 It is a schematic diagram of the working process of a non-contact zebrafish heart rate measurement system based on an optical flow estimation algorithm according to a specific embodiment of the present invention;

[0052] Figure 2 The figure shows a schematic diagram of the effect of an optical flow estimation algorithm of a non-contact zebrafish heart rate measurement system based on an optical flow estimation algorithm according to a specific embodiment of the present invention; wherein (a) is an original OCT image of the zebrafish heart region; (b) is an OCT image after median filtering; (c) is a schematic diagram of grayscale image markers; (d) is a schematic diagram of sequential frame arrangement of optical flow estimation result images;

[0053] Figure 3 The figure shows a schematic diagram of the two-dimensional distribution of discrete points and linear fitting of a non-contact zebrafish heart rate measurement system based on an optical flow estimation algorithm according to a specific embodiment of the present invention; x, y are the coordinates of the pixel point in the image (i.e., the displacement in the horizontal axis direction and the displacement in the vertical axis direction), in micrometers;

[0054] Figure 4 It is a schematic flow chart of a method for analyzing omnidirectional linear motion trajectory of a contactless zebrafish heart rate measurement system based on an optical flow estimation algorithm in accordance with a specific embodiment of the present invention, which quantifies the motion trajectory of all discrete points of tracking points distributed in a two-dimensional space;

[0055] Figure 5 The figure shows a schematic diagram of a zebrafish fitted heartbeat waveform of a contactless zebrafish heart rate measurement system based on an optical flow estimation algorithm in a specific embodiment of the present invention; wherein the cubic spline interpolation is the waveform obtained by fitting, and the original data is the discrete motion displacement value that switches with the image frame.

[0056] Figure 6 Shown is a first angle structural schematic diagram of a non-contact zebrafish heart rate measurement system based on an optical flow estimation algorithm according to a specific embodiment of the present invention;

[0057] Figure 7 Shown is a second angle structural schematic diagram of a non-contact zebrafish heart rate measurement system based on an optical flow estimation algorithm according to a specific embodiment of the present invention;

[0058] Explanation of reference numerals: 1. Water tank; 2. Adaptive container; 21. Accommodating space; 22. Water inlet; 23. Water outlet; 3. Optical coherence tomography device. DETAILED DESCRIPTION

[0059] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in conjunction with the implementation modes and the accompanying drawings.

[0060] Please refer to Figures 1 to 7 As shown, a non-contact zebrafish heart rate measurement system based on an optical flow estimation algorithm of the present invention comprises:

[0061] A water tank, wherein a plurality of zebrafish are contained;

[0062] An adaptation container, wherein the interior of the adaptation container has a storage space that can only accommodate one zebrafish, the adaptation container is a rectangular parallelepiped and made of a transparent material, the front end of the adaptation container has a water inlet, the rear end of the adaptation container has a water outlet connected to a water tank, and the top of the adaptation container has an opening; the water inlet is connected to the water tank for breeding zebrafish through a water pump; during training, the adaptation container is used to train the zebrafish to enter the adaptation container through the opening;

[0063] Optical coherence tomography device;

[0064] The contactless zebrafish heart rate measurement system based on optical flow estimation algorithm works as follows:

[0065] Step S0: placing the zebrafish in the water tank into the adaptation container through the opening and continuously operating the water pump until the zebrafish adapt to the environment of the adaptation container;

[0066] Step S1: using an optical coherence tomography device to collect OCT images of the abdomen, heart, and surrounding tissues of the zebrafish in the container;

[0067] Step S2: preprocessing the OCT image;

[0068] Step S3: Processing the preprocessed OCT image using an optical flow estimation algorithm;

[0069] Step S4: zebrafish heartbeat waveform fitting includes:

[0070] S41: for each frame of image completed in step S3, all images are arranged in chronological order, the tracking points in the image are extracted and their sequential numbers and corresponding coordinates in the image are recorded; a discrete distribution diagram of these coordinate points is drawn in a two-dimensional coordinate axis to obtain the distribution of the motion trajectory of the tracking points;

[0071] S42: Approximate the motion trajectory as a straight line, and use the following formula to perform univariate linear regression fitting on these discrete points:

[0072] Formula (1)

[0073] The parameters a and b can be obtained from equations (2) and (3):

[0074] Formula (2)

[0075] Formula (3)

[0076] in, is the horizontal coordinate of each discrete point, is the mean of the horizontal coordinates of all discrete points, is the ordinate of each discrete point, is the mean value of the ordinates of all discrete points, n is the number of discrete points, and the approximate motion trajectory equation of the discrete points is obtained by substituting equations (2) and (3) into equation (1);

[0077] S43: quantify the motion trajectories of all discrete points of the tracking points distributed in two-dimensional space using an omnidirectional linear motion trajectory analysis method;

[0078] S44: after obtaining the discrete motion displacement value in step S43, performing waveform fitting on the distribution of the displacement value with respect to time, and fitting it again using a cubic spline interpolation method to obtain a heartbeat waveform fitting image;

[0079] Step S5: Calculating the heart rate value of the zebrafish includes:

[0080] S51: performing peak detection on the obtained waveform of the heart beat;

[0081] S52: While obtaining each heartbeat waveform peak, record its image frame number value, calculate the number of image frames between adjacent peaks, multiply by the time used to collect each image, which is the time interval between two heartbeats, and calculate the average time interval between all peaks and adjacent peaks, which is the average heartbeat interval, so that the heartbeat frequency can be calculated. The specific calculation method is given by the following formula:

[0082] Formula (4)

[0083] in, is the peak detected by the algorithm, is the number of image frames between adjacent peaks, is the number of peak intervals, is the time to collect a single image frame data, is the frequency of zebrafish heartbeat, in beats / minute;

[0084] S53: Comprehensively calculate the heartbeat data of the zebrafish during the detection time to analyze and calculate the heart rate of the zebrafish.

[0085] From the above description, it can be seen that the present application provides a contactless zebrafish heart rate measurement system, which avoids the detection of zebrafish heart rate in the case of physical and chemical damage to the zebrafish; by utilizing optical coherence tomography (OCT) technology, combined with an optical flow estimation algorithm, a non-destructive evaluation of zebrafish cardiac function is achieved, avoiding physical damage; by adapting to the design of a rectangular container and a transparent material, the zebrafish is safely placed in a controlled environment, and the accommodating space that can only accommodate one zebrafish prevents the zebrafish from turning around and reduces external interference. The acquisition of OCT images combined with the preprocessing steps can be achieved through the transparent material and the flat surface of the rectangular block without being disturbed by reflections. If a curved surface is used, the light will be distorted and not suitable for OCT imaging, thereby avoiding traditional anesthesia that causes changes in the zebrafish's heart rate and chemical damage, thereby ensuring that the zebrafish's heart rate is in a natural state and meeting the needs of scientific research; continuous measurement of the zebrafish heart rate by a water pump The work ensures that the environmental variables of zebrafish transformation are small, and the adaptation speed of zebrafish to changes in spatial size is improved; through univariate linear regression fitting, the motion trajectory of the zebrafish heart can be corrected to an approximate straight line, which is suitable for detecting zebrafish in a natural swimming state and simplifies the difficulty of analyzing complex motion patterns. The approximate motion trajectory equation of discrete points provides necessary parameters for fitting the straight line, ensuring that the straight line equation can accurately reflect the movement law of the zebrafish heart and then obtain the heartbeat waveform fitting image, which improves the readability of the data; the time interval between adjacent heartbeat peaks is calculated through the heartbeat waveform fitting image to determine the zebrafish heart rate; through the joint action of these formulas, a complete mathematical model is formed for analyzing and understanding the movement and function of the zebrafish heart; the combination with these formulas improves the accuracy of heart rate measurement while avoiding physical and chemical damage, and avoids interference with the heartbeat by various interference factors.

[0086] Furthermore, step S43 further includes:

[0087] S431: All discrete points distributed in the two-dimensional space by the tracking point are recorded as points according to the order of the image frames. , , …, , calculate the projection points of all discrete points on the previously calculated linear regression equation line , , …, And record its coordinates;

[0088] S432: Divide the longest line segment formed by the projection points into two segments, and count the number of projection points on each of the two segments. and Num2, and compare the two. The segment with more projection points is defined as the resting position of the heart, and the segment with fewer projection points is defined as the contraction position of the heart. The farthest point of the resting position is recorded as , the farthest point of the contraction position is recorded as ;

[0089] S433: Calculate projection points respectively according to the order of frame arrangement , , …, The farthest point to the retracted position The two-dimensional Euclidean distance of the original discrete point , , …, The motion displacement fitting value between .

[0090] From the above description, it can be seen that through steps S431 to S433, the movement of the zebrafish heart during the cardiac cycle can be accurately tracked, thereby obtaining detailed information on the contraction and relaxation of the heart. By comparing the number of projection points on the two segments, the resting position and the contraction position of the heart can be determined. The resting position usually corresponds to the diastolic state of the heart, while the contraction position corresponds to the contraction state of the heart. This distinction is the periodic movement of a normal heart. By calculating the two-dimensional Euclidean distance from the projection point to the farthest point of the contraction position, these distances represent the motion displacement fitting values ​​between the original discrete points. Through this calculation, the specific movement amplitude of the zebrafish heart during contraction and relaxation can be quantified, providing the necessary displacement data for accurate measurement of heart rate.

[0091] Furthermore, the step S2 further comprises:

[0092] S21: Use Gaussian kernel to perform high-pass filtering on the entire OCT image;

[0093] S22: using the convolution kernel to perform median filtering on the OCT image;

[0094] S23: converting all filtered OCT images into grayscale images;

[0095] S24: Manually select tracking points of the initial frame image of each group of data on the filtered grayscale image.

[0096] Furthermore, the S21 further includes: using a 3×3 Gaussian kernel to perform high-pass filtering on the entire OCT image.

[0097] Furthermore, the S22 further includes: performing median filtering on the OCT image using a 5×5 convolution kernel;

[0098] Furthermore, the step S3 further comprises:

[0099] S31: Based on the Farneback algorithm, Gaussian smoothing is used to smooth the displacement values ​​in the optical flow field;

[0100] S32: Introduce the inertia coefficient and set the tracking point position of the current frame to a part of the position of the previous frame;

[0101] S33: For the tracking point selected in step S2, use the designed optical flow estimation algorithm to track the position of the tracking point in each subsequent frame image and mark it.

[0102] From the above description, it can be seen that by introducing the inertia coefficient, the tracking point position of the current frame is set to a part of the position of the previous frame to reduce the sudden change of displacement and improve the effectiveness of the tracking algorithm; and through the tracking algorithm, the zebrafish in the swimming state can be effectively tracked.

[0103] Furthermore, S51 further includes: using an automatic multi-scale peak search algorithm to perform peak detection on the obtained heart beat waveform.

[0104] From the above description, it can be seen that the automatic multi-scale peak search algorithm can quickly calibrate each peak and improve the recognition speed.

[0105] Furthermore, during training, the adaptation container is placed in a water tank for breeding zebrafish.

[0106] From the above description, it can be seen that by setting the adaptation container in the water tank during training, since there is only a spatial change and the water body does not change, when OCT imaging is required, the water used is still the water in the water tank, which can facilitate the zebrafish to quickly adapt to the environment in the adaptation container, shorten the training time, and reduce the occurrence of stress and the like.

[0107] Furthermore, step S1 further includes: taking out the adaptation container from the water tank, and using an optical coherence tomography device to collect OCT images of the abdomen, heart and surrounding tissues of the zebrafish in the adaptation container.

[0108] It can be seen from the above description that by taking the adaptable container out of the water tank before performing OCT imaging, the influence of water flow disturbance in the water tank on OCT can be reduced.

[0109] Furthermore, the outer surface of the adaptive container has a hydrophobic layer.

[0110] It can be seen from the above description that, by providing the hydrophobic layer, the outer surface of the adaptable container will not be stained with water when it is taken out, thereby preventing water droplets from affecting OCT imaging.

[0111] Embodiment 1

[0112] A non-contact zebrafish heart rate measurement system based on optical flow estimation algorithm, comprising:

[0113] A water tank 1, wherein there are a number of zebrafish;

[0114] An adaptation container 2, wherein the interior of the adaptation container has a holding space 21 that can only hold one zebrafish, the adaptation container is a rectangular parallelepiped and made of transparent material (the transparent material is glass, which will not refract light, will not reflect when entering vertically, and the reflected light can pass through the glass, so that during OCT imaging, the OCT lens can be attached to the surface of the adaptation container for imaging), the front end of the adaptation container has a water inlet 22, the rear end of the adaptation container has a water outlet 23 connected to the water tank, the water outlet 23 is connected to the water tank through a hose, and the top of the adaptation container has an opening, which can be opened and closed; the water inlet 22 is connected to the water tank for breeding zebrafish through a water pump and a hose; that is, the environment in the water tank and the environment in the holding space are the same except for the difference in space size; during training, the adaptation container is used to train zebrafish to enter the adaptation container through the opening, and the water pump is always working at this time to ensure that the environment during training is the same as the water flow (the water flow speed can be controlled by controlling the efficiency of the water pump), the water body, etc. in the subsequent steps S0 and S1;

[0115] Optical coherence tomography device 3;

[0116] Reference Figure 1 The contactless zebrafish heart rate measurement system based on the optical flow estimation algorithm works as follows:

[0117] Step S0: placing the zebrafish in the water tank into the adaptation container through the opening and continuously operating the water pump until the zebrafish adapt to the environment of the adaptation container;

[0118] Step S1: using an optical coherence tomography (OCT) device to collect image data of the zebrafish heart;

[0119] Step S2: Refer to Figure 2 , pre-processing the acquired OCT images of the zebrafish abdominal heart and surrounding tissues;

[0120] S21: Use a 3×3 Gaussian kernel to perform high-pass filtering on the entire image;

[0121] S22: Use a 5×5 convolution kernel to perform median filtering on the image;

[0122] S23: convert all filtered images into grayscale images;

[0123] S24: Manually select tracking points of the initial frame image of each group of data on the filtered grayscale image.

[0124] Step S3: Processing the preprocessed OCT image data using an optical flow estimation algorithm;

[0125] S31: Based on the original Farneback algorithm, Gaussian smoothing is used to smooth the displacement values ​​in the optical flow field;

[0126] S32: Introducing the inertia coefficient, the tracking point position of the current frame is considered as a part of the position of the previous frame to reduce the sudden change of displacement;

[0127] S33: For the tracking point selected in step S2, use the designed optical flow estimation algorithm to track the position of the tracking point in each subsequent frame image and mark it.

[0128] Step S4: fitting the zebrafish heartbeat waveform;

[0129] S41: For each frame of image completed in step S3, arrange all images in chronological order, extract the tracking points in the image and record their sequential numbers and corresponding coordinates in the image. Draw a discrete distribution diagram of these coordinate points in the two-dimensional coordinate axis to obtain the distribution of the tracking point motion trajectory.

[0130] S42: Reference Figure 3 , approximate the motion trajectory as a straight line, and use the following formula to perform univariate linear regression fitting on these discrete points:

[0131] Formula (1)

[0132] The parameters a and b can be obtained from equations (1) and (2):

[0133] Formula (2)

[0134] Formula (3)

[0135] in, is the horizontal coordinate of each discrete point, is the mean of the horizontal coordinates of all discrete points, is the ordinate of each discrete point, is the mean of the ordinates of all discrete points, n is the number of discrete points, and the approximate motion trajectory equation of the discrete points is obtained by substituting equations (2) and (3) into equation (1).

[0136] S43: Reference Figure 4 , the motion trajectories of all discrete points of the tracking points distributed in two-dimensional space are quantified using an omnidirectional linear motion trajectory analysis method.

[0137] S431: All discrete points distributed in the two-dimensional space by the tracking point are recorded as points according to the order of the image frames. , , …, , calculate the projection points of all discrete points on the previously calculated linear regression equation line , , …, And record its coordinates;

[0138] S432: Divide the longest line segment formed by the projection points into two segments, and count the number of projection points on each of the two segments. and Num2, and compare the two, define the segment with more projection points as the heart resting position, and the segment with fewer projection points as the heart contraction position. In addition, the farthest point of the resting position is recorded as , the farthest point of the contraction position is recorded as ;

[0139] S433: Calculate projection points respectively according to the order of frame arrangement , , …, The farthest point to the retracted position The two-dimensional Euclidean distance of the original discrete point , , …, The motion displacement fitting value between .

[0140] S44: After the discrete motion displacement values ​​are obtained in step S43, waveform fitting is performed on the distribution of the displacement values ​​with respect to time, and the waveform is fitted again using a cubic spline interpolation method to obtain a heartbeat waveform fitting image.

[0141] Step S5: Refer to Figure 5 , calculate the heartbeat value of zebrafish.

[0142] S51: Use the classic automatic multi-scale peak finding algorithm to perform peak detection on the obtained heart beat waveform.

[0143] S52: While obtaining each heartbeat waveform peak, record its image frame number value, calculate the number of image frames between adjacent peaks, multiply by the time used to collect each image, which is the time interval between two heartbeats, and calculate the average time interval between all peaks and adjacent peaks, which is the average heartbeat interval, so that the heartbeat frequency can be calculated. The specific calculation method is given by the following formula:

[0144] Formula (4)

[0145] in, is the peak detected by the algorithm, is the number of image frames between adjacent peaks, is the number of peak intervals, is the time to collect a single image frame data, is the frequency of zebrafish heartbeat, in beats per minute.

[0146] S53: The zebrafish's heartbeat data for a total of 20 seconds can be comprehensively calculated within 2 seconds to accurately analyze and calculate the zebrafish's heart rate.

[0147] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A non-contact zebrafish heart rate measurement system based on optical flow estimation algorithm, characterized in that: include: A water tank, wherein a plurality of zebrafish are contained; An adaptation container, wherein the interior of the adaptation container has a storage space that can only accommodate one zebrafish, the adaptation container is a rectangular parallelepiped and made of a transparent material, the front end of the adaptation container has a water inlet, the rear end of the adaptation container has a water outlet connected to a water tank, and the top of the adaptation container has an opening; the water inlet is connected to the water tank for breeding zebrafish through a water pump; during training, the adaptation container is used to train the zebrafish to enter the adaptation container through the opening; Optical coherence tomography device; The contactless zebrafish heart rate measurement system based on optical flow estimation algorithm works as follows: Step S0: placing the zebrafish in the water tank into the adaptation container through the opening and continuously operating the water pump until the zebrafish adapt to the environment of the adaptation container; Step S1: using an optical coherence tomography device to collect OCT images of the abdomen, heart, and surrounding tissues of the zebrafish in the container; Step S2: preprocessing the OCT image; Step S3: Processing the preprocessed OCT image using an optical flow estimation algorithm; Step S4: zebrafish heartbeat waveform fitting includes: S41: for each frame of image completed in step S3, all images are arranged in chronological order, the tracking points in the image are extracted and their sequential numbers and corresponding coordinates in the image are recorded; a discrete distribution diagram of these coordinate points is drawn in a two-dimensional coordinate axis to obtain the distribution of the motion trajectory of the tracking points; S42: Approximate the motion trajectory as a straight line, and use the following formula to perform univariate linear regression fitting on these discrete points: Formula (1) The parameters a and b can be obtained from equations (2) and (3): Formula (2) Formula (3) in, is the horizontal coordinate of each discrete point, is the mean of the horizontal coordinates of all discrete points, is the ordinate of each discrete point, is the mean value of the ordinates of all discrete points, n is the number of discrete points, and the approximate motion trajectory equation of the discrete points is obtained by substituting equations (2) and (3) into equation (1); S43: quantify the motion trajectories of all discrete points of the tracking points distributed in two-dimensional space using an omnidirectional linear motion trajectory analysis method; S44: after obtaining the discrete motion displacement value in step S43, performing waveform fitting on the distribution of the displacement value with respect to time, and fitting it again using a cubic spline interpolation method to obtain a heartbeat waveform fitting image; Step S5: Calculating the heart rate value of the zebrafish includes: S51: performing peak detection on the obtained waveform of the heart beat; S52: While obtaining each heartbeat waveform peak, record its image frame number value, calculate the number of image frames between adjacent peaks, multiply by the time used to collect each image, which is the time interval between two heartbeats, and calculate the average time interval between all peaks and adjacent peaks, which is the average heartbeat interval, so that the heartbeat frequency can be calculated. The specific calculation method is given by the following formula: Formula (4) in, is the peak detected by the algorithm, is the number of image frames between adjacent peaks, is the number of peak intervals, is the time to collect a single image frame data, is the frequency of zebrafish heartbeat, in beats / minute; S53: Comprehensively calculate the heartbeat data of the zebrafish during the detection time to analyze and calculate the heart rate of the zebrafish.

2. The non-contact zebrafish heart rate measurement system based on optical flow estimation algorithm according to claim 1, characterized in that: Step S43 further comprises: S431: All discrete points distributed in the two-dimensional space by the tracking point are recorded as points according to the order of the image frames. , , …, , calculate the projection points of all discrete points on the previously calculated linear regression equation line , , …, And record its coordinates; S432: Divide the longest line segment formed by the projection points into two segments, and count the number of projection points on each of the two segments. and Num2, and compare the two. The segment with more projection points is defined as the resting position of the heart, and the segment with fewer projection points is defined as the contraction position of the heart. The farthest point of the resting position is recorded as , the farthest point of the contraction position is recorded as ; S433: Calculate projection points respectively according to the order of frame arrangement , , …, The farthest point to the retracted position The two-dimensional Euclidean distance of the original discrete point , , …, The motion displacement fitting value between .

3. The non-contact zebrafish heart rate measurement system based on optical flow estimation algorithm according to claim 1, characterized in that: The step S2 further comprises: S21: Use Gaussian kernel to perform high-pass filtering on the entire OCT image; S22: using the convolution kernel to perform median filtering on the OCT image; S23: converting all filtered OCT images into grayscale images; S24: Manually select tracking points of the initial frame image of each group of data on the filtered grayscale image.

4. The non-contact zebrafish heart rate measurement system based on optical flow estimation algorithm according to claim 3, characterized in that: The S21 further includes: using a 3×3 Gaussian kernel to perform high-pass filtering on the entire OCT image.

5. The non-contact zebrafish heart rate measurement system based on optical flow estimation algorithm according to claim 3, characterized in that: The S22 further includes: performing median filtering on the OCT image using a 5×5 convolution kernel.

6. The non-contact zebrafish heart rate measurement system based on optical flow estimation algorithm according to claim 1, characterized in that: The step S3 further comprises: S31: Based on the Farneback algorithm, Gaussian smoothing is used to smooth the displacement values ​​in the optical flow field; S32: Introduce the inertia coefficient and set the tracking point position of the current frame to a part of the position of the previous frame; S33: For the tracking point selected in step S2, use the designed optical flow estimation algorithm to track the position of the tracking point in each subsequent frame image and mark it.

7. The non-contact zebrafish heart rate measurement system based on optical flow estimation algorithm according to claim 1, characterized in that: S51 further includes: using an automatic multi-scale peak search algorithm to perform peak detection on the obtained heart beat waveform.

8. The non-contact zebrafish heart rate measurement system based on optical flow estimation algorithm according to claim 1, characterized in that: During training, the adaptation container is placed in a water tank for breeding zebrafish.

9. The non-contact zebrafish heart rate measurement system based on optical flow estimation algorithm according to claim 8, characterized in that: Step S1 further includes: taking out the adaptation container from the water tank, and using an optical coherence tomography device to collect OCT images of the abdomen, heart and surrounding tissues of the zebrafish in the adaptation container.

10. The non-contact zebrafish heart rate measurement system based on optical flow estimation algorithm according to claim 8, characterized in that: The outer surface of the adaptive container has a hydrophobic layer.

Citation Information

Patent Citations

  • Method for measuring the heart rate of zebra fish by using high-speed CCD

    CN101112307A

  • Zebra fish living body imaging system and imaging method based on functional optical coherence tomography

    CN114129139A

  • Intelligent recognition and evaluation method for cardiovascular function of zebra fish

    CN115984202A

  • Transgenic zebra fish embryo model for hematopoiesis and lymphoproliferative disorders

    US20030028909A1