Intelligent identification method for posture, body type and distribution information of spotted seal based on computer vision
Through a computer vision-based method, using drones and YOLOv8 models and combining coastline recognition, the problems of high complexity of seal identification and incomplete data acquisition in the existing technology are solved, and more efficient and accurate seal identification and data analysis are achieved, and a deeper understanding of the living habits and population characteristics of seals are obtained.
Patent Information
- Application Number
- CN202510163122.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-06-06
AI Technical Summary
The prior art has problems incomplete data acquisition, high recognition complexity, low data accuracy and efficiency, and lack of coastline identification in intelligent identification of harbor seals, which has affected the in-depth understanding of the population characteristics and living habits of harbor seals.
Using a computer vision-based method, the image data of the harbor seals was obtained through drones, and the YOLOv8 model was used for preprocessing and identification, and information on individual and key points of the harbor seals was obtained. Combined with coastline recognition, the attitude, body shape, distribution and population relationship of the harbor seals was evaluated.
It improves the accuracy and efficiency of seal identification, reduces artificial interference, and obtains more comprehensive data, helps to deeply understand the living habits and population characteristics of seals.
Smart Images

Figure CN120107998A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of computer vision, and in particular relates to a method for intelligently identifying the posture, body shape and distribution information of a harbor seal based on computer vision. Background Art
[0002] In field research on large marine mammals such as spotted seals, data collection is an indispensable key step, but it often faces many challenges, such as harsh environmental conditions, restrictions on animal protection laws, small species numbers, and random activities. Traditional research methods are not only highly disruptive and inefficient, but also not reproducible. Therefore, current research on the characteristics of spotted seal populations is relatively limited, and understanding of their living habits is not in-depth enough.
[0003] Regarding the identification and detection of wild animals, an improved lightweight YOLOv5s method for real-time detection of wild crested ibis is used. Images of crested ibis in nature reserves are collected, and lightweight real-time detection of wild crested ibis is achieved by improving the YOLOv5s algorithm. An individual leopard identification method based on deep learning is used. Cameras arranged in the wild are used to collect leopard image data. Image data is enhanced by horizontal flipping and random erasing. A convolutional neural network is built to establish a recognition model to achieve individual identification of leopards. A method for calculating and identifying the linear size of Caspian seals in their habitat is used with a multi-rotor aircraft. Image data is acquired by drone flight. Seals are marked with serial numbers in a graphic editor to achieve seal counting. The position status is determined and the starting point and turning point are marked for each seal. The linear size of the seal is obtained by calculating the connecting line of the points. The direction of the transportation location of port seals and gray seals in New York City is obtained by obtaining seal data through ship-based observations, and the relative direction of the seals is obtained by comparing the orientations of adjacent seals.
[0004] There are many detection methods disclosed in the prior art, but if the prior art is used to perform intelligent identification of harbor seals, there are the following shortcomings:
[0005] 1) No relevant population data was obtained, and only the YOLO model was used to identify wild organisms;
[0006] 2) The technical difficulty is increased. The use of convolutional neural networks increases the difficulty of technical implementation, and the data erasure process increases the complexity of recognition, especially when processing images of organisms with protective colors;
[0007] 3) Affecting data accuracy and efficiency. Graphic editors and seal marking measurements rely on manual labor, which is inefficient and the accuracy and consistency of data are easily affected by human factors;
[0008] 4) Data acquisition is limited. Ship-based observations are limited in viewing angle and distance. This may also cause certain interference and impact on organisms and habitats, affecting data collection and analysis.
[0009] 5) There is a lack of recognition of the coastline, and direction judgment relies on the relative positions of the seals. The lack of objective data support makes the collected data relatively limited and difficult to effectively associate with the surrounding environment. Summary of the invention
[0010] In order to solve the above technical problems, the present invention proposes a computer vision-based intelligent recognition method for the posture, body shape and distribution information of harbor seals to solve the problems existing in the above-mentioned prior art.
[0011] To achieve the above object, the present invention provides a method for intelligently identifying the posture, body shape and distribution information of harbor seals based on computer vision, comprising:
[0012] The original data of spotted seals are obtained and preprocessed to obtain a spotted seal individual identification data set, and a spotted seal individual identification model is obtained through data set training;
[0013] Based on the spotted seal individual recognition model, the spotted seal individual images in the spotted seal individual recognition data set are framed and cropped to obtain the spotted seal key point recognition data set and annotate the key points; based on the annotated data set, the spotted seal key point recognition model is obtained;
[0014] Based on the spotted seal individual recognition model, the number of spotted seal individuals and the centroid coordinates of the spotted seal individuals are obtained; based on the spotted seal key point recognition model, the spotted seal individuals and key point marks are obtained; based on the centroid coordinates of the spotted seal individuals and the key point marks, the relationship between the spotted seal and the coastline is obtained; based on the spotted seal individuals and the key point marks, whether it is curved is determined; and the posture distribution is obtained in combination with the spotted seal individual data;
[0015] Based on the key point markings of the harbor seal, the size information of the harbor seal is obtained; based on the size information of the harbor seal, the age composition of the harbor seal is obtained;
[0016] The population relationship of harbor seals was evaluated based on the relationship between harbor seals and the coastline, the number of harbor seal individuals and the centroid coordinates of harbor seal individuals.
[0017] Optionally, the process of obtaining the original data of harbor seals includes:
[0018] The daily tide time was obtained, and the landing point of the spotted seals was found through on-site investigation. The drone was used to take aerial photos based on the daily tides and the landing point of the spotted seals, and image data of different time points and the landing point of the spotted seals were obtained to obtain the original data of the spotted seals. Among them, the altitude of the drone was controlled at 30-50m when taking off, and after arriving at the landing point of the spotted seals, it was photographed at altitudes of 5m, 10m, 15m, 20m and 25m respectively.
[0019] Optionally, the process of obtaining a harbor seal individual identification dataset includes:
[0020] The spotted seal original data are distributed according to height to ensure that the number of image data at each height in the data set is consistent; the rotating box annotation of the annotation tool is used to draw a target boundary box for the spotted seal individuals in the distributed spotted seal original data to obtain a spotted seal individual identification data set.
[0021] Optionally, YOLO v8s is selected as the pre-training model, and the spotted seal individual identification data set is divided into a training set, a test set and a validation set in a ratio of 7:2:1; the pre-training model is trained with the training set, and the training is stopped when the error of the test set begins to converge, so as to obtain a spotted seal individual identification model.
[0022] Optionally, the relationship between the harbor seal and the coastline includes the distance from the shore of the harbor seal individual, the direction of the harbor seal and the angle formed by the harbor seal and the coastline; the key points include three points on the head, two points at the widest part of the body, and the starting point and end point of the tail fin;
[0023] The distance from the shore of the spotted seal individual is obtained based on the coordinates of the center of mass of the spotted seal individual and the coastline equation; the midpoint of the line connecting the key points on both sides of the head is connected to the key point on the top of the head to obtain the vector pointing to the top of the head, and the direction of the spotted seal is obtained based on the vector; the angle formed by the spotted seal and the coastline is obtained based on the direction vector of the coastline and the vector pointing to the top of the head.
[0024] Optionally, the process of determining whether the seal is bent based on the individual seal and key point marks includes:
[0025] Calculate the midpoint of the key points on both sides of the head as the midpoint of the head; calculate the midpoint of the key points on both sides of the body as the midpoint of the body; connect the midpoint of the head and the starting point of the tail fin with the midpoint of the body respectively, and calculate the angle formed by the two obtained line segments. If the angle is less than 150°, the spotted seal is in a bent state.
[0026] Optionally, the process of obtaining harbor seal size information includes:
[0027] Select five key points: the top of the head, the midpoint of the head, the midpoint of the body, the starting point of the tail fin, and the end point of the tail fin. Connect them in sequence to form four line segments. Calculate the sum of the distances of the four line segments to obtain the estimated length of the spotted seal.
[0028] The starting point and end point of the tail fin were selected as the starting points for constructing two contours, and were connected with the remaining five key points to form two spotted seal contours; the average area of the two spotted seal contours was calculated to obtain the area estimation value.
[0029] Optionally, the assessment of the relationship between harbor seal populations includes the distance between harbor seal individuals, the angle between harbor seal individuals, and the density of harbor seals;
[0030] Obtain the point pair combination method of the centroids of all spotted seal individuals and calculate the mutual distances of spotted seal individuals;
[0031] The angle between individual harbor seals is obtained by calculating the vector based on the harbor seal's orientation;
[0032] The distribution length of the spotted seal colony on the shore was calculated, and the area occupied by the spotted seal colony was obtained based on the farthest distance from the shore of the individual spotted seal. The density of spotted seals was obtained based on the area occupied by the spotted seal colony and the number of individual spotted seals.
[0033] Compared with the prior art, the present invention has the following advantages and technical effects:
[0034] The present invention selects multiple population characteristics, including the number, size, area, direction, offshore distance and distribution density of spotted seal individuals; reduces the interference of the background by cropping individual identification images, and improves the recognition rate of biological identification with protective colors; in order to improve efficiency and reduce the influence of human factors, the computer vision algorithm YOLOv8 is used to process and acquire data, thereby improving the efficiency and accuracy of data processing; reduces the interference of human activities on organisms and habitats during field surveys, and chooses to use non-invasive drone photography to acquire image data; increases coastline recognition, and combines objective data to judge the direction, so as to obtain more comprehensive spotted seal distribution and behavior data, thereby better understanding the living habits of spotted seal populations. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0036] Figure 1 is a flow chart of a method according to an embodiment of the present invention;
[0037] Figure 2 A schematic diagram of an individual spotted seal marked in a rotating frame according to an embodiment of the present invention;
[0038] Figure 3 Schematic diagram of the YOLO speed and accuracy comparison curve according to an embodiment of the present invention;
[0039] Figure 4A schematic diagram of a training process of a harbor seal individual recognition model according to an embodiment of the present invention;
[0040] Figure 5 This is a schematic diagram of the recognition results of the harbor seal individual recognition model according to an embodiment of the present invention;
[0041] Figure 6 A schematic diagram of a labeling of a harbor seal key point recognition data set according to an embodiment of the present invention;
[0042] Figure 7 A schematic diagram of a harbor seal key point recognition model training process according to an embodiment of the present invention;
[0043] Figure 8 A schematic diagram of the recognition result of the key point recognition model of the harbor seal according to an embodiment of the present invention;
[0044] Fig. 9 A schematic diagram of an automatic marking window for harbor seals according to an embodiment of the present invention;
[0045] Fig.10 A schematic diagram of a bent posture of a harbor seal according to an embodiment of the present invention;
[0046] Fig.11 A schematic diagram of the orientation of a harbor seal according to an embodiment of the present invention;
[0047] Fig.12 A schematic diagram of the body length of a harbor seal according to an embodiment of the present invention;
[0048] Fig.13 Schematic diagram of the outline of a harbor seal according to an embodiment of the present invention. DETAILED DESCRIPTION
[0049] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0050] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0051] Embodiment 1
[0052] like Figure 1 As shown, in this embodiment, a method for intelligently identifying the posture, body shape and distribution information of a spotted seal based on computer vision is provided, comprising:
[0053] The original data of spotted seals are obtained and preprocessed to obtain a spotted seal individual identification data set, and a spotted seal individual identification model is obtained through data set training;
[0054] In some specific implementations, the process of obtaining the original data of harbor seals includes:
[0055] The daily tide time was obtained, and the landing point of the spotted seals was found through on-site investigation. The drone was used to take aerial photos based on the daily tides and the landing point of the spotted seals, and image data of different time points and the landing point of the spotted seals were obtained to obtain the original data of the spotted seals. Among them, the altitude of the drone was controlled at 30-50m when taking off, and after arriving at the landing point of the spotted seals, it was photographed at altitudes of 5m, 10m, 15m, 20m and 25m respectively.
[0056] In some specific embodiments, the process of obtaining a harbor seal individual identification dataset includes:
[0057] The original data of the spotted seal are distributed according to the height, and the distribution ratio of each height is the same; the rotating box annotation of the annotation tool is used to draw the target boundary box of the spotted seal individual in the distributed original data of the spotted seal, so as to obtain the spotted seal individual identification data set.
[0058] In some specific embodiments, YOLO v8s is selected as the pre-training model, and the spotted seal individual identification data set is divided into a training set, a test set, and a validation set in a ratio of 7:2:1; the pre-training model is trained with the training set until the error of the test set begins to converge, and the training is stopped to obtain a spotted seal individual identification model.
[0059] Specifically, the original data of the spotted seals is obtained, and the spotted seals at the landing point are observed and photographed by drones as the original data of the spotted seals. Furthermore, the specific process includes:
[0060] The shooting equipment selected was a DJI drone, model Mavic 3 Pro, which has high dynamic range and fast imaging capabilities. It is also equipped with a three-axis mechanical gimbal for stable shooting, and its maximum wind resistance speed reaches 12 meters per second, which is conducive to capturing high-definition images of seals under harsh conditions, thereby reducing the errors caused by data collection. Furthermore, DJI Mavic 3 Pro supports multi-satellite navigation systems, has high hovering accuracy, and can ensure the consistency of data acquisition.
[0061] Shooting parameter settings: To ensure clear image data, the resolution is set to 5280×2970; DJI Mavic 3 Pro has different flight modes, including normal mode, sports mode and stable mode; when taking off, the drone's altitude is controlled within the range of 30 to 50 meters to avoid obstacles, and the drone is set to sports mode and flies over the spot where the spotted seals land; after arriving, shoot at altitudes of 5 meters, 10 meters, 15 meters, 20 meters and 25 meters respectively;
[0062] The shooting time and location are obtained, and the daily tide time is obtained through the fishing application. According to the field investigation experience, the landing points of spotted seals are mainly concentrated in the southern waters of Sandaogou at the mouth of the Liaohe River in Liaodong Bay, Bohai Sea; further, according to the known daily tide time and the landing points of spotted seals, drone aerial photography tasks are performed to obtain the image data of spotted seals at specific landing points at different time points as the original data of spotted seals;
[0063] Specifically, for spotted seal individual identification, the raw data of spotted seals is preprocessed to obtain a spotted seal individual identification dataset; then the spotted seal individual identification model is trained using the PyCharm platform and the YOLO v8 network model, and the number of spotted seal individuals and their bounding box coordinates in the raw data of spotted seals are obtained based on the optimal model. The process includes:
[0064] Distribute the data set to avoid data imbalance and improve the generalization ability of the model. Ensure that the number of original data of spotted seals at five different heights in the spotted seal individual identification data set remains consistent, thereby reducing the bias of the model and making its recognition results consistent on spotted seals at different heights. Even at unknown heights, the robustness of the model can be improved.
[0065] Label individual data and use X-anylabeling to draw target bounding boxes for individual spotted seals in the original spotted seal data. Its rotation box labeling function can better describe the directionality of the spotted seal itself, fit the outline of the spotted seal, reduce background interference, and thus improve the accuracy of the detection model. Figure 2 Schematic diagram of individual harbor seals labeled in the rotating box;
[0066] Training the spotted seal individual recognition model, based on the pre-trained model officially provided by YOLO, training the model for spotted seal individual recognition in the present invention example, the pre-trained model has been trained on a large-scale data set, which can provide good initial weights, help accelerate convergence and improve the final performance. The specific process includes:
[0067] Configure the network model, select YOLO v8s as the pre-trained model implemented by the present invention, and configure the network model using default parameters; Figure 3 Comparison curves of speed and accuracy of multiple pre-trained models of different versions of YOLO on the COCO dataset;
[0068] Model training platform: The local training platform used in the example of the present invention has a processor model of Intel Core i7-10875H@2.30GHz eight-core, a graphics card model of NVIDIA GeForce RTX (6GB), a memory of 32GBDDR43200MHz, and a motherboard of Lenovo LNVNB161216 (Intel HM470 chipset);
[0069] Set the network parameters and divide the harbor seal individual identification dataset into training set, test set and validation set in a ratio of 7:2:1. Further, specify the path of the dataset and model configuration files, set the parameter iteration to 100, the batch size to 8, and the input image size to 640.
[0070] Train the network model and use the training set to train the model on PyCharm. Stop training when the error of the test set begins to converge to prevent overfitting. Figure 4 This is the training process of the spotted seal individual recognition model. The horizontal axis is the training round, and the vertical axis is precision, recall, mAP@50 (the weighted average of the average precision when the intersection-over-union ratio is 0.5), and mAP@50-90 (the weighted average of the average precision when the intersection-over-union ratio is between 0.5 and 0.95).
[0071] Based on the spotted seal individual recognition model, the spotted seal individual images in the spotted seal individual recognition data set are framed and cropped to obtain the spotted seal key point recognition data set and annotate the key points; based on the annotated data set, the spotted seal key point recognition model is obtained;
[0072] Specifically, the key point recognition of spotted seals uses the spotted seal individual recognition model to identify the spotted seal individual recognition data set to obtain the bounding box coordinates, and the spotted seal individual image is cropped by the algorithm, which is used as the spotted seal key point recognition data set, and the spotted seal individual key points are manually labeled, and the spotted seal key point recognition model is trained and screened using YOLO v8. Further, it specifically includes:
[0073] The model identifies individuals and automatically frames all harbor seal images based on the harbor seal individual recognition model. When the confidence level exceeds 0.35, the recognized harbor seal individual coordinates are highly consistent with the actual coordinates. Therefore, the recognition results with a confidence level greater than 0.35 will be retained, which is conducive to removing harbor seals in the water. The model recognition results are shown in Figure 2. Figure 5 The final output result is the bounding box coordinates of the individual harbor seal;
[0074] Crop the spotted seal individuals. According to the coordinates of the spotted seal individual bounding box, use the Python algorithm to crop them, and output more than 9,000 image data containing only spotted seal individuals, which constitute the spotted seal key point recognition dataset;
[0075] Labeling the Harbor Seal Key Point Recognition Dataset. Similarly, the labeling software is used to label the key points of the Harbor Seal Key Point Recognition Dataset. There are seven key points in total, including three points for head positioning, two points at the widest part of the body, and the starting and ending points of the tail fin. The schematic diagram of the labeling of the Harbor Seal Key Point Recognition Dataset is shown in the figure below. Figure 6 As shown;
[0076] Train the spotted seal key point recognition model, use the spotted seal key point recognition dataset to train the YOLO v8 model on the PyCharm platform, test and evaluate the model, and select the model with high accuracy as the final spotted seal key point recognition model; configure and train the network model; Figure 7 This is a schematic diagram of the training process of the harbor seal key point recognition model. Figure 8 This is a schematic diagram of the recognition results of the key point recognition model for spotted seals.
[0077] Based on the spotted seal individual recognition model, the number of spotted seal individuals and the centroid coordinates of the spotted seal individuals are obtained; based on the spotted seal key point recognition model, the spotted seal individuals and key point marks are obtained; based on the centroid coordinates of the spotted seal individuals and the key point marks, the relationship between the spotted seal and the coastline is obtained; based on the spotted seal individuals and the key point marks, whether it is curved is determined; and the posture distribution is obtained in combination with the spotted seal individual data;
[0078] In some specific embodiments, the relationship between the harbor seal and the coastline includes the distance from the shore of the harbor seal individual, the direction of the harbor seal, and the angle formed by the harbor seal and the coastline; the key points include three points on the head, two points at the widest part of the body, and the starting point and end point of the tail fin;
[0079] The distance from the shore of the spotted seal individual is obtained based on the coordinates of the center of mass of the spotted seal individual and the coastline equation; the midpoint of the line connecting the key points on both sides of the head is connected to the key point on the top of the head to obtain the vector pointing to the top of the head, and the direction of the spotted seal is obtained based on the vector; the angle formed by the spotted seal and the coastline is obtained based on the direction vector of the coastline and the vector pointing to the top of the head.
[0080] In some specific embodiments, the process of determining whether a seal is bent based on the individual seal and key point marks includes:
[0081] Calculate the midpoint of the key points on both sides of the head as the midpoint of the head; calculate the midpoint of the key points on both sides of the body as the midpoint of the body; connect the midpoint of the head and the starting point of the tail fin with the midpoint of the body respectively, and calculate the angle formed by the two obtained line segments. If the angle is less than 150°, the spotted seal is in a bent state.
[0082] Specifically, the spotted seal posture recognition calls the spotted seal key point recognition model to identify the number of spotted seal individuals and obtain the spatial coordinates of the spotted seal individuals; further, the spotted seal posture and direction are determined based on the relative position of the individual key points, and the relationship with the coastline is obtained, and the distribution of the spotted seal individual postures is counted. The specific process includes:
[0083] (1) Spotted seal target detection: The trained spotted seal key point recognition model is encapsulated into a graphical user interface. Various functions are displayed through the graphical user interface, with the image display area on the left and the function buttons on the right. Specifically, the functions include three parts: image selection, target detection, and data analysis.
[0084] Furthermore, click the automatic marking button in the target detection area to call the spotted seal individual recognition model, identify the number of spotted seal individuals, and calculate the centroid coordinates to use the centroid instead of the bounding box to display the target individual, determine the spatial coordinates of the spotted seal in the image, and facilitate the subsequent distance calculation. The automatic marking window display effect is as follows: Fig. 9 As shown; further, if there are missed or misdetected harbor seal individuals, you can manually correct the identification results by clicking Edit;
[0085] (2) Determine whether the spotted seal is bent. Call the spotted seal key point recognition model to obtain the spotted seal individual and seven key point markers. Calculate the midpoint of the key points on both sides of the head and record it as the head midpoint. Calculate the midpoint of the key points on both sides of the body and record it as the body midpoint. Connect the head midpoint and the starting point of the tail fin to the body midpoint respectively, as shown in Fig.10 As shown, the angle formed by the two line segments is calculated, and when the angle is less than 150°, the harbor seal is considered to be in a bent state;
[0086] (3) Set the coastline. Mark the coastline according to the turning point of the coastline. Connect two adjacent points to form one or more line segments, and calculate the expression of the line segments. These line segments together constitute the coastline. The line segment expression is shown in formula (1), where (X 1 , Y 1 ) and (X 2 , Y 2 ) are the coordinates of the starting point and end point of a line segment.
[0087]
[0088] The equation for constructing the coastline should meet the following two requirements: (1) For each X-coordinate value, there is a unique Y-coordinate value corresponding to it to ensure the accuracy of the coastline outline; (2) The range of X-coordinate values should cover the entire image to ensure the integrity of the coastline outline.
[0089] (4) Obtain the relationship between the harbor seal and the coastline, including the distance from the shore of the individual harbor seal, the direction of the harbor seal, and the angle formed by the harbor seal and the coastline.
[0090] Calculate the offshore distance of individual harbor seals, and determine the calculation method of the offshore distance based on the positional relationship between the centroid and the coastline in the image. In the default setting, the bottom of the image is considered as the ocean area and the top is the land area. Based on this setting, when judging the positional relationship, if the centroid is below the coastline, that is, in the sea, it is ignored; if the centroid coincides with the coastline, the offshore distance is recorded as zero; if the centroid is above the coastline, the shortest distance D from the centroid coordinate to the coastline expression is calculated, as shown in formula (2), where the centroid coordinate is (x 0 ,y 0 ), the coastline expression is shown in formula (1);
[0091]
[0092] Calculate the direction of the seal and the angle formed with the coastline. Determine the direction of the seal based on the three key points of the head. Connect the midpoint of the head with the key point of the top of the head to calculate a vector pointing to the top of the head, which is the direction of the seal. Fig.11 Further, the angle θ between the vector and the adjacent coastline is calculated as shown in formula (3), where ( a 1 , a 2) , ( b 1 , b 20 are the vector representing the direction of the harbor seal and the direction vector of the coastline. When the vector angle is between 0° and 45°, the harbor seal is considered to be parallel to the coastline; when the vector angle is between 45° and 90°, the harbor seal is considered to be pointing to the sea or the land.
[0093]
[0094] (5) Count the distribution of the spotted seals’ postures, the number of bent states and different orientations, and analyze the distribution of different postures based on the distance from the shore.
[0095] Based on the key point markings of the harbor seal, the size information of the harbor seal is obtained; based on the size information of the harbor seal, the age composition of the harbor seal is obtained;
[0096] In some specific embodiments, the process of obtaining harbor seal size information includes:
[0097] Select five key points: the top of the head, the midpoint of the head, the midpoint of the body, the starting point of the tail fin, and the end point of the tail fin. Connect them in sequence to form four line segments. Calculate the sum of the distances of the four line segments to obtain the estimated length of the spotted seal.
[0098] The starting point and end point of the tail fin were selected as the starting points for constructing two contours, and were connected with the remaining five key points to form two spotted seal contours; the average area of the two spotted seal contours was calculated to obtain the area estimation value.
[0099] Specifically, the body composition analysis of the spotted seals determines the size information of the spotted seals, including the body length and relative area of the spotted seals, based on the individual posture information and key points of the spotted seals, and further analyzes the age composition of the spotted seals (juveniles, subadults and adults) with reference to the growth curve of the spotted seals. The process includes:
[0100] (1) Calculate the body length of the spotted seal. Considering that the spotted seal has a bent posture, the length of the recognition frame cannot be directly used as the body length of the spotted seal. Therefore, the body length of the spotted seal is determined by segmentation: the seven key points of the spotted seal are obtained through the spotted seal key point recognition model, and the midpoint of the head and the midpoint of the body are calculated; further, the five key points of the top of the head, the midpoint of the head, the midpoint of the body, the starting point of the tail fin, and the end point of the tail fin are selected and connected in sequence to form four line segments, such as Fig.12 As shown, the distances between the four line segments are denoted as d 1 d 2 d 3 d 4 , calculate the sum of the distances of the four line segments to obtain the estimated length L of the harbor seal, as shown in formula (4);
[0101] L = d 1 +d 2 +d 3 +d 4 (4)
[0102] (2) Calculate the relative area of the spotted seal by connecting different key points of the same spotted seal individual to construct two polygonal contours and calculate their average area to obtain an estimate of the relative area of the spotted seal.
[0103] According to the spotted seal key point recognition model, the seven key points of the spotted seal are obtained. The starting point and the end point of the tail fin are selected as the starting points for the construction of two contours, and they are connected with the remaining five key points to form two spotted seal contours, such as Fig.13 As shown in the figure: Taking the starting point of the tail fin as the starting point, the outline area is slightly smaller than the actual area of the harbor seal, such as Fig.13 As shown above; with the end point of the tail fin as the starting point, the outline area is slightly larger than the actual area of the harbor seal, such as Fig.13 The area S of the corresponding spotted seal contour is calculated by the coordinates of the six key points that form the contour. Further, the average of the two contour areas is calculated to estimate the relative area of the spotted seal. The contour area is calculated as shown in formula (5), where (x i ,y i ) are the coordinates of the six key points, (x 7 ,y 7 ) is (x i ,y i );
[0104]
[0105] (3) Analyze the age composition of spotted seals. According to the research of Zhang Peijun et al., there is a certain regression curve relationship between the body length and age of spotted seals. Substituting the calculated body length data of individual spotted seals into the data, its age (juvenile, subadult and adult) can be further inferred, thereby determining the age structure of the spotted seal population.
[0106] The population relationship of harbor seals was evaluated based on the relationship between harbor seals and the coastline, the number of harbor seal individuals and the centroid coordinates of harbor seal individuals.
[0107] In some specific embodiments, the assessment of the relationship between the harbor seal population includes the distance between the harbor seal individuals, the angle between the harbor seal individuals and the density of the harbor seals;
[0108] Obtain the point pair combination method of the centroids of all spotted seal individuals and calculate the mutual distances of spotted seal individuals;
[0109] The angle between individual harbor seals is obtained by calculating the vector based on the harbor seal's orientation;
[0110] The distribution length of the spotted seal colony on the shore was calculated, and the area occupied by the spotted seal colony was obtained based on the farthest distance from the shore of the individual spotted seal. The density of spotted seals was obtained based on the area occupied by the spotted seal colony and the number of individual spotted seals.
[0111] Specifically, the population relationship of spotted seals is evaluated by calculating the position relationship between spotted seals, including the mutual distance and angle between each other, and the density of spotted seals is evaluated according to the area occupied by the spotted seal group; further, the data analysis function is used to collect statistics on spotted seal information. Furthermore, the specific process includes:
[0112] (1) Obtain the distances between individual harbor seals, obtain all possible point pair combinations of centroids, and calculate the distances of all point pair combinations;
[0113] (2) Calculate the angle between individual spotted seals. According to the vector of the spotted seal’s direction, calculate the angle between two vectors, as shown in formula (3), where (a 1 , a 2 ), (b 1 , b 2 ) are the vectors representing the directions of the two harbor seals;
[0114] (3) Evaluate the density of harbor seals, calculate the distribution length of harbor seal groups on the shore, and combine the farthest distance from the shore to obtain the area occupied by the harbor seal group. Furthermore, the number of harbor seal individuals can be used to obtain the density of harbor seals;
[0115] (4) Collect statistics on harbor seals and use statistical circles, exclusion circles, and statistical information functions for evaluation.
[0116] The present invention uses drone photography and computer vision to acquire images and identify targets, which can achieve non-invasive research, reduce interference and impact on the population and habitat of spotted seals, and reduce interference from human factors on data, thereby improving data accuracy.
[0117] The present invention establishes a complete process from data acquisition, individual identification to population data acquisition, which not only realizes the accurate identification of harbor seal individuals and their postures, but also can obtain the individual and population data of harbor seals, including the number, size, area, direction, offshore distance of individuals, and the distribution density of the population;
[0118] The invention adds the identification of coastlines during the data acquisition process, enriches the research on spotted seals, helps to deeply understand their living habits, explore their habitat utilization patterns, and reveal how they achieve risk avoidance, efficient use of energy, and maintenance of community structure, thereby providing a scientific basis for the protection and management of spotted seals.
[0119] The above are only preferred specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A computer vision-based intelligent recognition method for harbor seal posture, body shape and distribution information, characterized in that: The following steps are involved: The original data of spotted seals are obtained and preprocessed to obtain a spotted seal individual identification data set, and a spotted seal individual identification model is obtained through data set training; Based on the spotted seal individual recognition model, the spotted seal individual images in the spotted seal individual recognition data set are framed and cropped to obtain the spotted seal key point recognition data set and annotate the key points; based on the annotated data set, the spotted seal key point recognition model is obtained; Based on the spotted seal individual recognition model, the number of spotted seal individuals and the centroid coordinates of the spotted seal individuals are obtained; based on the spotted seal key point recognition model, the spotted seal individuals and key point marks are obtained; The relationship between the spotted seal and the coastline is obtained based on the centroid coordinates of the spotted seal individual and the key point marks; whether the spotted seal is curved is determined based on the spotted seal individual and the key point marks; and the posture distribution is obtained in combination with the spotted seal individual data; Based on the key point markings of the harbor seal, the size information of the harbor seal is obtained; based on the size information of the harbor seal, the age composition of the harbor seal is obtained; The population relationship of harbor seals was evaluated based on the relationship between harbor seals and the coastline, the number of harbor seal individuals and the centroid coordinates of harbor seal individuals.
2. The method for intelligently identifying the posture, body shape and distribution information of harbor seals based on computer vision according to claim 1, characterized in that: The process of obtaining the original data of harbor seals includes: The daily tide time was obtained, and the landing point of the spotted seals was found through on-site investigation. The drone was used to take aerial photos based on the daily tides and the landing point of the spotted seals, and image data of different time points and the landing point of the spotted seals were obtained to obtain the original data of the spotted seals. Among them, the altitude of the drone was controlled at 30-50m when taking off, and after arriving at the landing point of the spotted seals, it was photographed at altitudes of 5m, 10m, 15m, 20m and 25m respectively.
3. The method for intelligently identifying the posture, body shape and distribution information of harbor seals based on computer vision according to claim 2, characterized in that: The process of obtaining the harbor seal individual identification dataset includes: The original data of the spotted seal are distributed according to the height, and the distribution ratio of each height is the same; the rotating box annotation of the annotation tool is used to draw the target boundary box of the spotted seal individual in the distributed original data of the spotted seal, so as to obtain the spotted seal individual identification data set.
4. The method for intelligently identifying the posture, body shape and distribution information of harbor seals based on computer vision according to claim 1, characterized in that: YOLO v8s was selected as the pre-training model, and the spotted seal individual identification data set was divided into a training set, a test set, and a validation set in a ratio of 7:2:1; the pre-training model was trained with the training set until the error of the test set began to converge, and the training was stopped to obtain a spotted seal individual identification model.
5. The method for intelligently identifying the posture, body shape and distribution information of harbor seals based on computer vision according to claim 1, characterized in that: The relationship between the spotted seal and the coastline includes the distance from the shore of the spotted seal, the direction of the spotted seal and the angle formed by the spotted seal and the coastline; the key points include three points on the head, two points at the widest part of the body, and the starting point and end point of the tail fin; The distance from the shore of the spotted seal individual is obtained based on the coordinates of the center of mass of the spotted seal individual and the coastline equation; the midpoint of the line connecting the key points on both sides of the head is connected to the key point on the top of the head to obtain the vector pointing to the top of the head, and the direction of the spotted seal is obtained based on the vector; the angle formed by the spotted seal and the coastline is obtained based on the direction vector of the coastline and the vector pointing to the top of the head.
6. The method for intelligently identifying the posture, body shape and distribution information of harbor seals based on computer vision according to claim 5, characterized in that: The process of judging whether a seal is bent based on the individual seal and key point marks includes: Calculate the midpoint of the key points on both sides of the head as the midpoint of the head; calculate the midpoint of the key points on both sides of the body as the midpoint of the body; connect the midpoint of the head and the starting point of the tail fin with the midpoint of the body respectively, and calculate the angle formed by the two obtained line segments. If the angle is less than 150°, the spotted seal is in a bent state.
7. The method for intelligently identifying the posture, body shape and distribution information of harbor seals based on computer vision according to claim 6, characterized in that: The process of obtaining harbor seal size information includes: Select five key points: the top of the head, the midpoint of the head, the midpoint of the body, the starting point of the tail fin, and the end point of the tail fin. Connect them in sequence to form four line segments. Calculate the sum of the distances of the four line segments to obtain the estimated length of the spotted seal. The starting point and end point of the tail fin were selected as the starting points for constructing two contours, and were connected with the remaining five key points to form two spotted seal contours; the average area of the two spotted seal contours was calculated to obtain the area estimation value.
8. The method for intelligently identifying the posture, body shape and distribution information of harbor seals based on computer vision according to claim 5, characterized in that: The assessment of the relationship between harbor seal populations includes the distance between harbor seal individuals, the angle between harbor seal individuals, and the density of harbor seals; Obtain the point pair combination method of the centroids of all spotted seal individuals and calculate the mutual distances of spotted seal individuals; The angle between individual harbor seals is obtained by calculating the vector based on the harbor seal's orientation; The distribution length of the spotted seal colony on the shore was calculated, and the area occupied by the spotted seal colony was obtained based on the farthest distance from the shore of the individual spotted seal. The density of spotted seals was obtained based on the area occupied by the spotted seal colony and the number of individual spotted seals.