Biological target detection method combining YOLO with Matlab

By combining YOLO model and Matlab in biological behavioral research, high-accuracy detection and visual analysis of biological targets are achieved, and the problem of detection accuracy and reliability of traditional methods in complex environments is solved, and dynamic changes of biological targets are provided. and the basis for research on behavioral patterns.

CN119399536APending Publication Date: 2025-02-07TIANJIN RES INST FOR WATER TRANSPORT ENG M O T
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411498913.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

In traditional biological behavioral research, biological target detection methods are susceptible to factors such as light changes, shadow interference, background impurities, etc., resulting in misjudgment and missed detection, affecting the accuracy of data and the reliability of research conclusions.

Method used

The biological target detection method of YOLO combined with Matlab is used to detect biological target image data through deep learning models. The powerful feature extraction and classification capabilities of the YOLO model are used, and the visual analysis function of Matlab is combined to generate biological target position distribution map.

Benefits of technology

Improve the accuracy of biological target detection, enhance the robustness of interference factors such as light changes, shadows, and occlusion in complex environments, and achieve rapid capture and positioning of biological targets, and dynamic changes and behavioral patterns of biological targets. The research provides a basis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119399536A_ABST
    Figure CN119399536A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of biological behavioristics, and discloses a YOLO and Matlab combined biological target detection method, which comprises the following steps: acquiring biological target image data; labeling frame images in the biological target image data to obtain a target detection data set; training the deep learning model by using the target detection data set to obtain a classification weight file of the trained biological target; wherein the deep learning model is a YOLO model; loading the trained biological target classification weight file to a deep learning model, and detecting the biological target image data to be detected to obtain a target detection result; and drawing a biological target position distribution diagram through Matlab according to a target detection result. According to the invention, the accuracy of biological target detection can be improved, rapid capturing and positioning of the biological target are realized, and a basis is provided for research of dynamic change and behavior pattern of the biological target.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of biobehavioral science, and in particular to a biological target detection method combining YOLO with Matlab. Background Art

[0002] In biobehavioral research, the detection of biological targets is one of the core technologies, which plays an irreplaceable role in accurately analyzing animal behavior patterns, evaluating ecological adaptability, and understanding the interaction mechanism between organisms. This technology not only helps researchers gain a deeper understanding of the behavioral habits of different species and the biological principles behind them, but also promotes our understanding of the complexity of ecosystems and provides a scientific basis for protecting biodiversity.

[0003] Traditionally, target detection of experimental subjects in biobehavioral research widely uses binary image processing methods for target recognition. This method relies on a preset threshold to divide the pixels in the image into foreground (target) and background. However, with the complexity and diversification of the research environment, such as changes in lighting, shadow interference, increased background impurities in the wild natural environment, and the diversity of target morphology, color, and texture, the traditional binary method faces significant challenges and limitations, which can easily lead to misjudgment and missed detection, affecting the accuracy of the data and the reliability of the research conclusions to a certain extent.

[0004] Therefore, there is an urgent need for a biological target detection method that combines YOLO with Matlab, which can improve the accuracy of biological target detection, achieve rapid capture and positioning of biological targets, and provide a basis for the study of dynamic changes and behavior patterns of biological targets. Summary of the invention

[0005] In order to solve the above technical problems, the present invention provides a biological target detection method combining YOLO with Matlab, which can improve the accuracy of biological target detection, realize the rapid capture and positioning of biological targets, and further provide a basis for the study of dynamic changes and behavior patterns of biological targets.

[0006] The present invention provides a biological target detection method combining YOLO with Matlab, comprising the following steps: S1. Acquire biological target image data; S2, labeling the frame images in the biological target image data to obtain a target detection data set; wherein the label includes the category information of the biological target and the coordinate position information of the biological target; S3. Use the target detection data set to train the deep learning model to obtain a trained classification weight file of the biological target; wherein the classification weight file of the biological target includes the parameters of each layer of the deep learning model, and the deep learning model is a YOLO model; S4, loading the trained biological target classification weight file into the deep learning model, detecting the image data of the biological target to be detected, and obtaining the target detection result; wherein the target detection result includes the category information of the biological target and the coordinate position information of the biological target; S5. Draw a biological target location distribution map based on the target detection results using Matlab.

[0007] Furthermore, in S2, labeling the frame images in the biological target image data includes: S21, extracting a number of representative frame images from the image data; The calculation formula for the number of representative frame images extracted is as follows: F e = F t / IFS; Among them, F e Indicates the number of representative frame images extracted, F t It indicates the total number of frames of biological target image data, and IFS indicates the frame interval; S22. Label each representative frame image, and form a target detection data set based on the representative frame images and the corresponding labels.

[0008] Furthermore, in S3, before using the target detection dataset to train the deep learning model to obtain the trained classification weight file of the biological target, it also includes: The parameters of the original deep learning model are adjusted so that the coordinate position information of the biological target generated by the adjusted deep learning model is in the xyxy format, that is, it contains the x-coordinate and y-coordinate information of the two endpoints of the long axis of the contour of the biological target.

[0009] Furthermore, in S4, the trained biological target classification weight file is loaded into the deep learning model, and the biological target image data to be tested is detected to obtain the target detection result, wherein the coordinate position information of the biological target in the target detection result contains i rows of result data, each row of result data corresponds to a frame of image in the biological target image data to be tested, i is the total number of frames of the biological target image data to be tested; each row of result data contains 4×j data, j is the number of biological targets contained in each frame of image.

[0010] Furthermore, in S5, drawing a biological target position distribution map according to the target detection result by Matlab includes: S51, converting the format of the target detection result through Matlab to obtain a target detection matrix; S52. Perform visual analysis based on the target detection matrix through Matlab to generate a biological target position distribution map corresponding to each representative frame image.

[0011] Furthermore, in S51, the target detection result is converted into a format by Matlab, and the target detection matrix obtained includes: S511, creating an empty matrix with i rows and 4×j columns, which has the same number of rows and columns as the coordinate position information of the biological target in the target detection result, in the Matlab environment; S512, filling the data in the coordinate position information of the biological target in the target detection result into the empty matrix to obtain the target detection matrix; Each row of the target detection matrix contains four data in a group, which contains the x-coordinate and y-coordinate information of the two endpoints of the long axis of the biological target's contour, that is, "x 1 ,y 1 ;x 2 ,y 2 ”.

[0012] Further, in S52, a visual analysis is performed by Matlab according to the target detection matrix to generate a biological target position distribution map corresponding to each representative frame image, including: S521, simplifying the contour of the biological target, connecting the two end points of the long axis of the contour of each biological target in the target detection matrix, and obtaining the contour line segment of the biological target represented by the long axis; S522, scaling the contour line segments of the biological target to obtain a scaled target detection matrix; Specifically include: Sa. Calculate the center point coordinates of the contour segment of the biological target: dx=(x 2 –x 1 ) / 2; dy=(y 2 –y 1 ) / 2; Among them, (dx, dy) is the coordinate of the center point of the contour segment of the biological target, (x 1 ,y 1 )、(x 2 ,y 2 ) are the coordinates of the two end points of the major axis of the contour of the biological target; Sb, calculate the coordinates of the two endpoints of the long axis of the contour of the biological target after scaling: new x1 =x 1 +n×dx; new y1 =y 1 +n×dy; new x2 =x 2 -n×dx; newy2 =y 2 -n×dy; Among them, n is the scaling factor, the value range of n is 0-1, and the value of n is negatively correlated with the length of the line segment. x1 ,new y1 )、(new x2 ,new y2 ) are the coordinates of the two end points of the major axis of the contour of the biological target after scaling; Sc, updating the target detection matrix according to the coordinates of the two end points of the contour major axis of the biological target after scaling processing, to obtain the target detection matrix after scaling processing; S523, performing visual analysis based on the target detection matrix after scaling processing through Matlab, and generating a biological target position distribution map corresponding to each representative frame image.

[0013] The present invention also provides a biological target detection system combining YOLO with Matlab, which is used to execute any of the biological target detection methods combining YOLO with Matlab described above, and the system includes the following modules: A data acquisition module, used to acquire biological target image data; The data set construction module is connected to the data acquisition module and is used to label the frame images in the biological target image data to obtain the target detection data set; wherein the label includes the category information of the biological target and the coordinate position information of the biological target; The model training module is connected to the data set construction module and is used to train the deep learning model using the target detection data set to obtain a trained classification weight file of the biological target; wherein the classification weight file of the biological target includes the parameters of each layer of the deep learning model, and the deep learning model is a YOLO model; The target detection module is connected to the model training module and is used to load the trained biological target classification weight file into the deep learning model, detect the image data of the biological target to be tested, and obtain the target detection result; wherein the target detection result includes the category information of the biological target and the coordinate position information of the biological target; The result output module is connected to the target detection module and is used to draw a biological target location distribution map based on the target detection results through Matlab.

[0014] The embodiments of the present invention have the following technical effects: 1. The present invention combines the YOLO model and Matlab to detect and identify biological targets. The image data of the biological target to be tested is detected through the YOLO model. The powerful feature extraction and classification capabilities of the YOLO deep learning model are utilized to automatically learn and identify the characteristics of biological targets under complex backgrounds, and effectively distinguish targets from impurities. This not only improves the accuracy of biological target detection, but also significantly enhances the robustness of the algorithm to interference factors such as illumination changes, shadows, and occlusions, thereby ensuring that high-quality detection results can be obtained in various complex environments, and rapid capture and positioning of biological targets can be achieved; the outline of the biological target is scaled through Matlab, and the real-time positioning of the biological target is visualized. By providing a visualized position distribution map with simple lines and less interference, the spatial distribution characteristics of the biological target can be intuitively observed, thereby providing a basis for the study of dynamic changes and behavior patterns of biological targets.

[0015] 2. The biological target detection method of the present invention has good flexibility and scalability. By adjusting the parameters and training data of the YOLO model, it can easily adapt to the target detection needs of different biological species, different growth stages and different environmental conditions. In addition, the rich toolbox and flexible programming environment of the Matlab platform allow users to optimize algorithms and customize data processing processes according to specific research needs, further enhancing the practicality and flexibility of the method. This highly customizable feature provides a broad space for the diversification and deepening of biobehavioral research.

[0016] 3. The biological target detection method based on YOLO combined with Matlab proposed in the present invention reduces the interference of human factors through an automated and standardized detection process, ensuring the objectivity and consistency of the detection results. In addition, by recording and saving information such as parameter settings and model training data during the detection process, the data can be reused, and the experimental results can be easily reproduced, which promotes the standardization and repeatability of biobehavioral research data and improves the quality and credibility of scientific research. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 It is a flow chart of a biological target detection method combining YOLO and Matlab provided by an embodiment of the present invention; Figure 2It is a schematic diagram of a data format output after adjusting the parameters of an original deep learning model provided by an embodiment of the present invention; Figure 3 is a schematic diagram of scaling a contour line segment of a biological target provided by an embodiment of the present invention; Figure 4 is a schematic diagram of a biological target position distribution map provided by an embodiment of the present invention; Figure 5 It is a structural schematic diagram of a biological target detection system combining YOLO and Matlab provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.

[0020] This paper proposes a biological target detection method combining YOLO with Matlab. Figure 1 is a flowchart of a biological target detection method combining YOLO and Matlab provided by an embodiment of the present invention, see Figure 1 , including: S1. Acquire biological target image data.

[0021] Specifically, a high-definition camera is used to continuously record and collect the behavior state and distribution of biological targets, and the data is stored in a video format. The video acquisition frame rate (fps) depends on the specific behavior intensity of the biological target. The stronger the behavior intensity of the biological target, the higher the video acquisition frame rate. For example, the frame rate can range from 2 to 35 frames per second.

[0022] S2. Label the frame images in the biological target image data to obtain a target detection data set.

[0023] S21, extracting a number of representative frame images from the image data; The calculation formula for the number of representative frame images extracted is as follows: F e = F t / IFS; Among them, F e Indicates the number of representative frame images extracted, F tIndicates the total number of frames of biological target image data, and IFS indicates the frame interval. The frame interval can be set according to actual conditions. The more total number of frames of biological target image data, the longer the frame interval.

[0024] S22, label each representative frame image, and form a target detection data set according to the representative frame image and the corresponding label, wherein the label includes the category information of the biological target and the coordinate position information of the biological target.

[0025] S3. Use the target detection dataset to train the deep learning model and obtain the classification weight file of the trained biological target.

[0026] Among them, the classification weight file of biological targets includes the parameters of each layer of the deep learning model; for example, the weights and bias items of the convolutional layer, fully connected layer, etc.

[0027] The deep learning model is a YOLO model, preferably a YOLOv5 model or a YOLOv8 model.

[0028] Furthermore, since the coordinate position information of the biological target directly generated by the original YOLO model is in the "xywh" format, that is, the x-coordinate and y-coordinate of the center of mass of the biological target, as well as the width and height information of the biological target, it is difficult to meet the requirements of biological target visualization, so the parameters of the original deep learning model need to be adjusted. The method for adjusting the parameters of the original deep learning model is to adjust the parameters responsible for generating the "xywh" format file in the original YOLO model to the parameters for generating the "*xyxy" format.

[0029] Before using the target detection dataset to train the deep learning model and obtain the classification weight file of the trained biological target, it also includes: The parameters of the original deep learning model are adjusted so that the coordinate position information of the biological target generated by the adjusted deep learning model is in the "xyxy" format, that is, it contains the x-coordinate and y-coordinate information of the two endpoints of the long axis of the contour of the biological target.

[0030] S4. Load the trained biological target classification weight file into the deep learning model, detect the image data of the biological target to be tested, and obtain the target detection result.

[0031] Among them, the target detection result can be a file in txt format, and the target detection result includes the category information of the biological target and the coordinate position information of the biological target; the coordinate position information of the biological target in the target detection result contains i lines of result data, each line of result data corresponds to a frame of image in the image data of the biological target to be tested, and i is the total number of frames of the image data of the biological target to be tested; each line of result data contains 4×j data, and j is the number of biological targets contained in each frame of image.

[0032] S5. Draw a biological target location distribution map based on the target detection results using Matlab.

[0033] S51. Convert the target detection result format through Matlab to obtain a target detection matrix.

[0034] S511. In the Matlab environment, create an empty matrix with i rows and 4×j columns, which has the same number of rows and columns as the coordinate position information of the biological target in the target detection result.

[0035] S512, filling the empty matrix with data in the coordinate position information of the biological target in the target detection result to obtain a target detection matrix.

[0036] Each row of the target detection matrix contains four data in a group, which contains the x-coordinate and y-coordinate information of the two endpoints of the long axis of the biological target's contour, that is, "x 1 ,y 1 ;x 2 ,y 2 ”.

[0037] S52. Perform visual analysis based on the target detection matrix through Matlab to generate a biological target position distribution map corresponding to each representative frame image.

[0038] Specifically, in order to avoid the disordered lines of the drawn distribution map due to the long body of the biological target, the length of the long axis segment of the contour of the biological target can be shortened according to the actual situation.

[0039] S521. Simplify the contour of the biological target, connect the two end points of the long axis of the contour of each biological target in the target detection matrix, and obtain the contour line segment of the biological target represented by the long axis.

[0040] S522, scaling the contour line segments of the biological target to obtain a scaled target detection matrix.

[0041] S522 specifically includes the following steps: Sa. Calculate the center point coordinates of the contour segment of the biological target: dx=(x 2 –x 1 ) / 2; dy=(y 2 –y 1 ) / 2; Among them, (dx, dy) is the coordinate of the center point of the contour segment of the biological target, (x 1 ,y 1 )、(x 2 ,y 2) are the coordinates of the two endpoints of the major axis of the biological target’s contour.

[0042] Sb, calculate the coordinates of the two endpoints of the long axis of the contour of the biological target after scaling: new x1 =x 1 +n×dx; new y1 =y 1 +n×dy; new x2 =x 2 -n×dx; new y2 =y 2 -n×dy; Among them, n is the scaling factor, the value range of n is 0-1, and the value of n is negatively correlated with the length of the line segment. x1 ,new y1 )、(new x2 ,new y2 ) are the coordinates of the two endpoints of the major axis of the contour of the biological target after scaling.

[0043] Sc. Update the target detection matrix according to the coordinates of the two end points of the long axis of the contour of the biological target after scaling processing to obtain the target detection matrix after scaling processing.

[0044] S523, performing visual analysis based on the target detection matrix after scaling processing through Matlab, and generating a biological target position distribution map corresponding to each representative frame image.

[0045] The present invention combines the YOLO model and Matlab to detect and identify biological targets. The image data of the biological target to be tested is detected through the YOLO model. The powerful feature extraction and classification capabilities of the YOLO deep learning model are utilized to automatically learn and identify the features of biological targets under complex backgrounds, and effectively distinguish targets from impurities. This not only improves the accuracy of biological target detection, but also significantly enhances the robustness of the algorithm to interference factors such as illumination changes, shadows, and occlusions, thereby ensuring that high-quality detection results can be obtained in various complex environments, and rapid capture and positioning of biological targets can be achieved. The outline of the biological target is scaled through Matlab, and the real-time positioning of the biological target is visualized. By providing a visualized position distribution map with simple lines and less interference, the spatial distribution characteristics of the biological target can be intuitively observed, thereby providing a basis for the study of dynamic changes and behavior patterns of the biological target.

[0046] The biological target detection method of the present invention has good flexibility and scalability. By adjusting the parameters and training data of the YOLO model, it can easily adapt to the target detection needs of different biological species, different growth stages and different environmental conditions. In addition, the rich toolbox and flexible programming environment of the Matlab platform allow users to optimize algorithms and customize data processing processes according to specific research needs, further enhancing the practicality and flexibility of the method. This highly customizable feature provides a broad space for the diversification and deepening of biobehavioral research.

[0047] The biological target detection method based on YOLO combined with Matlab proposed in the present invention reduces the interference of human factors through an automated and standardized detection process, ensuring the objectivity and consistency of the detection results. In addition, by recording and saving information such as parameter settings and model training data during the detection process, the data can be reused, and the experimental results can be easily reproduced, which promotes the standardization and repeatability of biobehavioral research data and improves the quality and credibility of scientific research.

[0048] The following example uses the behavior image data of a fish group consisting of 8 grass carps to illustrate the invention method: A high-definition camera was used to continuously record and collect the behavioral status of 8 grass carps. The data was stored in video format with a frame rate of 10 frames per second for a total of 300 seconds.

[0049] Read all frames of the video image data, extract representative frames of the video image data with a frame interval of IFS = 10, and the number of representative frames obtained is: F = F t / IFS=10×300÷10=300 frames.

[0050] The frame images in the fish group behavior image data are labeled to obtain the target detection dataset, which is further divided into a training set and a validation set in a ratio of 8:2, that is, the training set contains 240 images and the validation set contains 60 images.

[0051] Figure 2 is a schematic diagram of a data format output after adjusting the parameters of an original deep learning model provided by an embodiment of the present invention, see Figure 2 , the parameters of the original deep learning model are adjusted so that the coordinate position information of the biological target generated by the adjusted deep learning model is changed from the original "xywh" format to the "xyxy" format.

[0052] The YOLOv5 model is used for training in the Python environment to generate a classification weight file for biological targets. This embodiment only uses one species, grass carp, so the classification weight file only contains one category, grass carp. The target detection result file in txt format generated after detection in this embodiment contains 3000 rows and 32 columns of data, where 3000 is the total number of frames of video image data, and 32 is the number of grass carp used, 8×4.

[0053] In the Matlab environment, create an empty matrix with i rows and 4×j columns, which is the same as the number of rows and columns of the biological target coordinate position information in the target detection results. Fill the empty matrix with the data in the biological target coordinate position information in the target detection results to obtain the target detection matrix. Among them, each row of the target detection matrix is ​​a group of 4 data, and each group of data contains the x-coordinate and y-coordinate information of the two endpoints of the long axis of a grass carp, that is, "x 1 ,y 1 ;x 2 ,y 2 ”.

[0054] Figure 3 is a schematic diagram of scaling the contour line segments of a biological target provided by an embodiment of the present invention, see Figure 3 , the contour of the biological target is simplified by Matlab, and the two endpoints of the long axis of the contour of each biological target in the target detection matrix are connected to obtain the contour line segment of the biological target represented by the long axis. In this embodiment, according to the actual body size of the grass carp, the line segment is set to be reduced to 1 / 2 of the original body size during drawing. The length reduction process takes a grass carp individual in the 1250th frame of the original video as an example. After target detection, the coordinates of the two ends of the long axis of this grass carp are (217, 486) and (402, 520) respectively.

[0055] Calculate the coordinates of the center point of the contour segment of this grass carp: dx=(402-217) / 2=92.5; dy=(520-486) / 2=17.

[0056] Calculate the coordinates of the two endpoints of the long axis of the outline of the grass carp after scaling: new x1 =217+0.5×92.5=263; new y1 =486+0.5×17=495; new x2 =402-0.5×92.5=356; new y2 =520-0.5×17=512; That is, the coordinates of the two end points of the major axis of the outline of the grass carp after scaling are (263, 495) and (356, 512) respectively.

[0057] The target detection matrix is ​​updated according to the coordinates of the two end points of the major axis of the outline of the grass carp after the scaling process, so as to obtain the target detection matrix after the scaling process. Figure 4 is a schematic diagram of a biological target location distribution map provided by an embodiment of the present invention, see Figure 4 , the grass carp target detection results of each frame of the entire video are plotted in a graph according to the target detection matrix after scaling processing through the Matlab drawing function, and a biological target position distribution map corresponding to each representative frame image is generated. This embodiment uses gray solid lines for drawing. For example, images with specific requirements can also be drawn by modifying the line type, color and width.

[0058] Figure 5 is a schematic diagram of the structure of a biological target detection system combining YOLO and Matlab provided in an embodiment of the present invention, and the system is used to execute a biological target detection method combining YOLO and Matlab described in the above embodiment, such as Figure 5 As shown, the system includes the following modules: A data acquisition module, used to acquire biological target image data; The data set construction module is connected to the data acquisition module and is used to label the frame images in the biological target image data to obtain the target detection data set; wherein the label includes the category information of the biological target and the coordinate position information of the biological target; The model training module is connected to the data set construction module and is used to train the deep learning model using the target detection data set to obtain a trained classification weight file of the biological target; wherein the classification weight file of the biological target includes the parameters of each layer of the deep learning model, and the deep learning model is a YOLO model; The target detection module is connected to the model training module and is used to load the trained biological target classification weight file into the deep learning model, detect the image data of the biological target to be tested, and obtain the target detection result; wherein the target detection result includes the category information of the biological target and the coordinate position information of the biological target; The result output module is connected to the target detection module and is used to draw a biological target location distribution map based on the target detection results through Matlab.

[0059] It should be noted that the terms used in the present invention are only for describing specific embodiments, rather than limiting the scope of the present application. As shown in the present specification, unless the context clearly indicates an exception, the words "one", "a", "a kind of" and / or "the" do not specifically refer to the singular, but may also include the plural. The terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method or device. In the absence of more restrictions, the elements defined by the sentence "include one..." do not exclude the presence of other identical elements in the process, method or device including the elements.

[0060] It should also be noted that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. Unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", etc. should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0061] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the technical solutions of the embodiments of the present invention.

Claims

1. A biological target detection method combining YOLO and Matlab, characterized in that: The steps include: S1. Acquire biological target image data; S2, labeling the frame images in the biological target image data to obtain a target detection data set; wherein the label includes category information of the biological target and coordinate position information of the biological target; S3, using the target detection data set to train the deep learning model to obtain a trained classification weight file of the biological target; wherein the classification weight file of the biological target includes parameters of each layer of the deep learning model, and the deep learning model is a YOLO model; S4, loading the trained biological target classification weight file into the deep learning model, detecting the image data of the biological target to be detected, and obtaining the target detection result; wherein the target detection result includes the category information of the biological target and the coordinate position information of the biological target; S5. Draw a biological target location distribution map according to the target detection results using Matlab.

2. According to claim 1, a biological target detection method combining YOLO and Matlab, characterized in that: In S2, labeling the frame images in the biological target image data includes: S21, extracting a number of representative frame images from the image data; The calculation formula for the number of representative frame images extracted is as follows: F e = F t / IFS; Among them, F e Indicates the number of representative frame images extracted, F t represents the total number of frames of the biological target image data, and IFS represents the frame interval; S22, labeling each of the representative frame images, and forming a target detection data set according to the representative frame images and corresponding labels.

3. According to claim 2, a biological target detection method combining YOLO and Matlab, characterized in that: In S3, before using the target detection data set to train the deep learning model to obtain the trained classification weight file of the biological target, it also includes: The parameters of the original deep learning model are adjusted so that the coordinate position information of the biological target generated by the adjusted deep learning model is in the xyxy format, that is, it includes the x-coordinate and y-coordinate information of the two endpoints of the long axis of the contour of the biological target.

4. According to claim 3, a biological target detection method combining YOLO and Matlab, characterized in that: In S4, the trained biological target classification weight file is loaded into the deep learning model, and the biological target image data to be tested is detected to obtain the target detection result, wherein the coordinate position information of the biological target in the target detection result includes i rows of result data, each row of result data corresponds to a frame of image in the biological target image data to be tested, i is the total number of frames of the biological target image data to be tested; each row of result data includes 4×j data, j is the number of biological targets contained in each frame of image.

5. According to claim 4, a biological target detection method combining YOLO and Matlab, characterized in that: In S5, drawing a biological target position distribution map according to the target detection result by Matlab includes: S51, converting the format of the target detection result through Matlab to obtain a target detection matrix; S52, performing visual analysis based on the target detection matrix through Matlab to generate a biological target position distribution map corresponding to each frame of the representative frame image.

6. A biological target detection method combining YOLO and Matlab according to claim 5, characterized in that: In S51, the target detection result is formatted by Matlab to obtain a target detection matrix including: S511, creating an empty matrix of i rows and 4×j columns in the Matlab environment, which has the same number of rows and columns as the coordinate position information of the biological target in the target detection result; S512, filling the empty matrix with data in the coordinate position information of the biological target in the target detection result to obtain a target detection matrix; Among them, each row of the target detection matrix contains 4 data as a group, which contains the x-coordinate and y-coordinate information of the two end points of the long axis of the contour of the biological target, that is, "x1, y1; x2, y2".

7. A biological target detection method combining YOLO and Matlab according to claim 6, characterized in that: In S52, the visual analysis is performed according to the target detection matrix by Matlab to generate a biological target position distribution map corresponding to each representative frame image, including: S521, simplifying the contour of the biological target, connecting two end points of the long axis of the contour of each biological target in the target detection matrix, and obtaining a contour line segment of the biological target represented by the long axis; S522, scaling the contour line segments of the biological target to obtain a scaled target detection matrix; Specifically include: Sa. Calculate the center point coordinates of the contour line segment of the biological target: dx=(x2–x1) / 2; dy=(y2–y1) / 2; Among them, (dx, dy) is the coordinate of the center point of the contour segment of the biological target, (x1, y1) and (x2, y2) are the coordinates of the two end points of the long axis of the contour of the biological target; Sb, calculate the coordinates of the two endpoints of the major axis of the contour of the biological target after scaling: newx1=x1+n×dx; newy1=y1+n×dy; newx2=x2-n×dx; newy2=y2-n×dy; Wherein, n is the scaling factor, the value range of n is 0-1, the value of n is negatively correlated with the length of the line segment, (newx1, newy1) and (newx2, newy2) are the coordinates of the two end points of the contour major axis of the biological target after scaling; Sc, updating the target detection matrix according to the coordinates of the two endpoints of the major axis of the contour of the biological target after scaling processing to obtain the target detection matrix after scaling processing; S523, performing visual analysis based on the target detection matrix after the scaling process using Matlab to generate a biological target position distribution map corresponding to each representative frame image.

8. A biological target detection system combining YOLO and Matlab, used to implement a biological target detection method combining YOLO and Matlab as described in any one of claims 1 to 7, characterized in that: The system includes the following modules: A data acquisition module, used to acquire biological target image data; A data set construction module, connected to the data acquisition module, is used to label the frame images in the biological target image data to obtain a target detection data set; wherein the label includes the category information of the biological target and the coordinate position information of the biological target; A model training module, connected to the data set construction module, for training a deep learning model using the target detection data set to obtain a trained classification weight file of a biological target; wherein the classification weight file of the biological target includes parameters of each layer of the deep learning model, and the deep learning model is a YOLO model; A target detection module, connected to the model training module, is used to load the trained biological target classification weight file into the deep learning model, detect the image data of the biological target to be detected, and obtain the target detection result; wherein the target detection result includes the category information of the biological target and the coordinate position information of the biological target; The result output module is connected to the target detection module and is used to draw a biological target position distribution map according to the target detection result through Matlab.

Citation Information

Patent Citations

  • Marine typical artificial target recognition system and method for high-resolution remote sensing image

    CN111079596A

  • Target detection method in static scene

    CN111753693A

  • Yolov5-segnet insulator string contour extraction method based on depth feature fusion

    CN112907614A

  • Unmanned vehicle carried camera target detection method based on YOLOv5

    CN114548363A

  • Novel yellow croaker detection and tracking method

    CN116468952A