Yolov8-based method and system for estimating number of yaks based on high-resolution remote sensing image
By combining high-resolution remote sensing imagery with the YOLOv8 model, the problems of low detection efficiency and poor accuracy in traditional methods are solved, enabling efficient and accurate estimation of yak numbers. This method is suitable for resource management and ecological assessment in plateau pastoral areas.
Patent Information
- Application Number
- CN202511343775.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-09-19
AI Technical Summary
Traditional methods are inefficient and inaccurate when detecting yak numbers in large-scale pastures, and deep learning models lose small target features in remote sensing images, leading to a decrease in detection accuracy.
A yak population estimation method based on high-resolution remote sensing imagery and YOLOv8 was adopted. Through preprocessing, multispectral image overlay, activity area screening, dark spot screening, and confidence level screening, combined with geospatial constraints and radiation feature analysis, the accuracy of yak identification was improved.
It enables efficient and accurate detection of yak numbers in large-scale pastures, improving the reliability and accuracy of identification results, and is suitable for resource surveys and dynamic monitoring in plateau pastoral areas.
Smart Images

Figure CN120823625B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of remote sensing image processing, in particular to a yak quantity estimation method and system based on high-resolution remote sensing images and YOLOv8. BACKGROUND
[0002] The number and distribution of yaks are of great significance to grassland resource management and ecological assessment. Traditional yak survey methods such as manual census or unmanned aerial vehicle visual interpretation have the problems of low efficiency, strong subjectivity and difficulty in large-scale dynamic detection. For example, the application number CN202411599842.3 discloses a high-cold meadow yak quantity calculation method and system based on unmanned aerial vehicle images, which uses the method of counting the number of yak dung in the images taken by the unmanned aerial vehicle at a height of 30-50 m to estimate the number of yaks, which greatly reduces the workload of data collection. However, the pasture area is large, and the unmanned aerial vehicle needs to consume a lot of time to take a large number of pictures, and the motion state of the yak is difficult to fix, and there is a problem that the yaks in the undetected area enter the detected area, so the accuracy of monitoring the number of yaks in a large range of pasture by the unmanned aerial vehicle is low; at the same time, the accuracy of monitoring the continuous moving track of the yak in a small range is also low, which makes it difficult to analyze the distribution of the yak.
[0003] Under the background of the continuous development of remote sensing image detection technology, applying deep learning models to the field of automatic detection of yaks in large atmospheric plateau pastures has become an effective method in ecological protection and smart animal husbandry. However, due to the small shape and weak feature expression of yak targets in remote sensing images, multiple yaks may only occupy a small number of pixels in remote sensing images, and there is a problem of feature loss in the feature sampling process of large models, which leads to a decrease in detection accuracy. Therefore, the present application provides a yak quantity estimation method and system based on high-resolution remote sensing images and YOLOv8, which realizes efficient detection of yaks in large-scale remote sensing images and improves the accuracy of yak quantity monitoring. SUMMARY
[0004] The purpose of the present application is to solve the technical problem of feature loss in large model detection of yak small targets in remote sensing images in the prior art. The yak quantity estimation method and system based on high-resolution remote sensing images and YOLOv8 provided by the embodiments of the present application realize the estimation of the number of yaks in a region and improve the accuracy and reliability of the recognition results.
[0005] In order to achieve the above-mentioned application purpose, the present application provides the following technical solutions:
[0006] The yak quantity estimation method based on high-resolution remote sensing images and YOLOv8 comprises:
[0007] Obtaining high-resolution remote sensing images of red, blue, green and near-infrared bands, and preprocessing the remote sensing images;
[0008] superimpose the remote sensing images corresponding to the red light, blue light, green light and near-infrared wave band, input a first model to obtain a prediction result; obtain a center point coordinate from the prediction result, add the center point coordinate in the geographical coordinate corresponding to the remote sensing image to the prediction result; and map the prediction result to a prediction box in the remote sensing image;
[0009] perform activity area screening on the prediction box based on a preset activity area to obtain a first candidate box;
[0010] perform dark point screening based on a pixel difference between pixels in the first candidate box to obtain a second candidate box;
[0011] perform confidence degree screening on the second candidate box based on a preset first threshold to obtain a third candidate box;
[0012] calculate a real geographical area corresponding to the third candidate box in the remote sensing image, obtain an average area occupied by a single yak, calculate a ratio of the real geographical area to the average area occupied by a single yak, and obtain a number of yaks.
[0013] The application provides a yak number estimation system based on high-resolution remote sensing images and YOLOv8, which comprises:
[0014] a preprocessing module configured to obtain high-resolution remote sensing images of red light, blue light, green light and near-infrared wave band, and pre-process the remote sensing images;
[0015] an identification module configured to superimpose the remote sensing images corresponding to the red light, blue light, green light and near-infrared wave band, input a first model to obtain a prediction result; obtain a center point coordinate from the prediction result, add the center point coordinate in the geographical coordinate corresponding to the remote sensing image to the prediction result; and map the prediction result to a prediction box in the remote sensing image;
[0016] a screening module configured to perform activity area screening on the prediction box based on a preset activity area to obtain a first candidate box; and further configured to perform dark point screening based on a pixel difference between pixels in the first candidate box to obtain a second candidate box; and further configured to perform confidence degree screening on the second candidate box based on a preset first threshold to obtain a third candidate box;
[0017] an estimation module configured to calculate a real geographical area corresponding to the third candidate box in the remote sensing image, obtain an average area occupied by a single yak, calculate a ratio of the real geographical area to the average area occupied by a single yak, and obtain a number of yaks.
[0018] Compared with the prior art, the application has the following beneficial effects:
[0019] 1. The application is based on Gao Fen II and Gao Fen VII multi-spectral remote sensing images, constructs a yak small target remote sensing data set, and uses a YOLOv8 deep learning model to realize automatic recognition of yaks. In view of the similarity of yaks, rocks and grass piles and other static features in remote sensing images in shape and spectrum, a static target screening method combining geographic spatial constraints, multi-temporal image comparison and radiation feature analysis is proposed, which effectively improves the accuracy and reliability of the recognition result; further combining the true geographic area of the prediction box in the remote sensing image and the average area occupied by a single yak, the number of regional yaks is estimated, which provides data support for resource survey and dynamic monitoring of plateau pastoral areas.
[0020] 2. The improved YOLOv8 deep learning model with input channel dimension is used, the spectral band is increased, the feature information of the remote sensing image is more abundant, which is beneficial to increase the recognition accuracy of yaks. YOLOv8 has fast detection speed, low computing resource demand and high data processing efficiency, which is helpful for quickly identifying yak targets in remote sensing images and realizing continuous monitoring of the distribution of yaks. BRIEF DESCRIPTION OF DRAWINGS
[0021] Figure 1 It is a structure schematic diagram of the yak number estimation system;
[0022] Figure 2 It is a flowchart of the yak number estimation method;
[0023] Figure 3 It is a remote sensing image after mapping the label file predicted by the first model;
[0024] Figure 4 It is a remote sensing image after activity area screening in the grass-rich period and the grass-dry period;
[0025] Figure 5 It is a remote sensing image after dark point screening in the grass-rich period and the grass-dry period;
[0026] Figure 6 It is a remote sensing image after confidence screening in the grass-rich period and the grass-dry period;
[0027] Figure 7 It is a YOLOv8 structure schematic diagram used by the first model;
[0028] Figure 8 It is a structure schematic diagram of the basic convolution module and the feature extraction module in the first model;
[0029] Figure 9 It is a structure schematic diagram of the fast spatial pyramid pooling module and the detection head in the first model. DETAILED DESCRIPTION
[0030] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments.
[0031] Therefore, the following detailed description of the embodiments of the present application is not intended to limit the scope of the claimed application, but merely represents some embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0032] It should be noted that the embodiments in the present application and the features and technical solutions in the embodiments can be combined with each other without conflict.
[0033] It should be noted that: similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
[0034] In the description of the present application, it should be noted that the terms "upper", "lower", etc. indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, or the orientation or positional relationship commonly placed when the product of the present application is used, or the orientation or positional relationship commonly understood by those skilled in the art. Such terms are only for the convenience of describing the present application and simplifying the description, and are not intended to indicate or imply that the indicated device or element must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application. In addition, the terms "first", "second", etc. are only used for differentiation and cannot be understood as indicating or implying relative importance.
[0035] For example Figure 1 As shown, a structure schematic diagram of a yak number estimation system based on high-resolution remote sensing images and YOLOv8 provided by the present embodiment is shown, and the estimation system comprises:
[0036] A preprocessing module is configured to acquire high-resolution remote sensing images of multiple wavebands, and pre-process the remote sensing images.
[0037] An identification module is configured to input the remote sensing images corresponding to the multiple wavebands after superposition into a first model to obtain a prediction result, acquire a center point coordinate from the prediction result, add the center point coordinate in the geographic coordinate corresponding to the remote sensing image to the prediction result, and map the prediction result to a prediction box in the remote sensing image based on the center point coordinate.
[0038] The screening module is configured to perform activity region screening on the prediction box based on a preset activity region to obtain a first candidate box; is further configured to perform dark spot screening on the first candidate box based on pixel difference values between pixels in the first candidate box to obtain a second candidate box; and is further configured to perform confidence screening on the second candidate box based on a preset first threshold to obtain a third candidate box.
[0039] The estimation module is configured to calculate a real geographical area of the third candidate box, obtain an average area occupied by a single yak, and calculate a ratio of the real geographical area to the average area occupied by a single yak to obtain the number of yaks.
[0040] The estimation system is configured to perform the method for estimating the number of yaks based on high-resolution remote sensing images and YOLOv8. Figure 2 As shown in the figure, the method comprises the following steps.
[0041] Obtaining high-resolution remote sensing images at different time phases, and preprocessing the remote sensing images.
[0042] Specifically, since the plateau vegetation type where yaks live is mainly alpine meadow and shrub meadow, which has obvious plateau natural geographical features, based on the spectral feature difference and seasonal characteristics of the ground cover, remote sensing images in the dry season and the lush season are mainly obtained. In this embodiment, seven remote sensing images of a preset detection area are obtained from the Gaofen-2 and Gaofen-7 satellite images. All the remote sensing images are multi-spectral high-resolution images with high spatial and spectral quality, including four dry season images and three lush season images. The multi-spectral remote sensing images are preprocessed using geographic information system software such as ENVI, including but not limited to: radiation calibration, atmospheric correction, geometric correction, histogram matching, image fusion, image mosaicking and regional cropping, so as to improve the detection stability and accuracy of the first model for the yak target in the multi-phase remote sensing images, and finally obtain the unified and standardized remote sensing images to be detected.
[0043] In this embodiment, the first model is implemented based on the YOLOv8 network structure. The input channel requirement of the YOLOv8 model is three channels, which corresponds to the remote sensing images of the red, blue and green three bands. In order to enhance the perception ability of the first model for the spectral difference between the yak target and the background ground object, the present application adds the near-infrared band remote sensing image as the input. In a specific embodiment, the present application modifies the input channel dimension of the first model from RGB three channels to four channels, superimposes the remote sensing images of the red, blue, green and near-infrared bands as the input image of the first model, so as to make full use of the information of the red, green, blue and near-infrared bands. Correspondingly, the dimension of the convolution kernel in the first model needs to be modified to meet the condition of matrix multiplication.
[0044] Specifically, YOLOv8 scales the input image to a fixed size, in this embodiment, the size of the input image is set to 256*256 pixels, and at the same time, normalization processing is performed to map the pixel value to between 0 and 1, and the arrangement order of the input channel is adjusted, so that images of different sizes and formats can be extracted features under the same conditions. Next, YOLOv8 uses an improved convolutional neural network to extract multi-scale features, such as the basic convolution module CBS and the feature extraction module C2f. Among them, the shallow features retain detailed information, and the deep features contain abstract contextual semantic information. Then the deep features and shallow features are fused to effectively integrate different scale feature information. In the detection head stage, YOLOv8 uses an anchor-free prediction mechanism to directly predict the offset of each grid point relative to the center of the target bounding box and the target size. For each candidate position, the detection head simultaneously outputs the confidence and class probability of the existence of the target at that position. The final prediction result is a label file, and the label types of the data in the label file include (category, center point x coordinate, center point y coordinate, predicted box width, predicted box height, confidence). Among them, the center point x coordinate and the center point y coordinate are normalized values, which need to be multiplied by the width and height of the remote sensing image to obtain the coordinates of the predicted box in the remote sensing image. In this embodiment, the categories include yaks and static ground objects, wherein the static ground objects include but are not limited to rocks, haystacks, and buildings.
[0045] Optionally, after the prediction is completed, YOLOv8 removes the highly overlapping redundant boxes using non-maximum suppression on the obtained candidate prediction boxes.
[0046] Further, the label file output by the first model contains categories, center point coordinates, predicted box width and height, and confidence. Since the label file lacks geographic spatial reference, in this embodiment, the true geographic coordinates corresponding to the center point coordinates in the remote sensing image are also added to the label file to accurately map the pixel coordinates to the real-world geographic coordinate system, realize accurate positioning and alignment of the remote sensing image in the geographic space, and be used for delineating the activity area of the yak. The pixel where the center point coordinates are located is referred to as the center pixel of the predicted box.
[0047] The label file is mapped to the visual prediction box in the remote sensing image through the predict() function in the python library of YOLOv8 to finally obtain a set of prediction boxes in the original remote sensing image. The remote sensing image after mapping the prediction box is shown in, for example, Figure 3 ; wherein the result of the prediction on the rich grass period remote sensing image is shown in, for example, Figure 3 (a); and the result of the prediction on the dry grass period remote sensing image is shown in, for example, Figure 3 (b). Each prediction box corresponds to a target category and a confidence value predicted by the first model, thereby realizing a complete process from input image to accurate target positioning and recognition.
[0048] Furthermore, since yaks have specific activity areas, and the remote sensing images contain predicted bounding boxes that deviate from these areas—meaning these boxes are definitely not yak targets—these boxes are first removed to reduce the computational load during the box selection process. In this embodiment, multiple historical remote sensing images are obtained through manual screening. Based on the geographic coordinates of multiple predicted bounding boxes identified as yaks in these historical images, combined with terrain boundaries, experts use geographic information system software to select and connect multiple geographic coordinates in the remote sensing images to pre-determine the yak's activity area.
[0049] Furthermore, after mapping the tag file to the remote sensing image, the preset active region is obtained, and other predicted boxes outside the active region are removed. The result of active region filtering for remote sensing images during the lush grass season is as follows: Figure 4 (a) shows the set of active areas selected from remote sensing images during the dry season, as indicated by the yellow box. Figure 4 (b) shows the set of boxes in yellow. After acquiring the yak activity area, the remote sensing image with the predicted bounding boxes mapped to geographic coordinates is spatially overlaid with the activity area. Predicted bounding boxes whose center pixel's geographic coordinates are not within the activity area are deleted; predicted bounding boxes whose center pixel's geographic coordinates are within the activity area are retained. By using the preset yak activity area to spatially constrain the predicted bounding boxes identified in the remote sensing image, non-yak targets are eliminated, which helps to narrow down the candidate range for subsequent predicted bounding box screening, reduces the overall computational load, and improves the accuracy and efficiency of yak target detection.
[0050] Furthermore, within the activity area, typical static features such as yaks, rocks, and dark haystacks exhibit low reflectance in remote sensing images, with reflectance values significantly lower than surrounding pixels. This can lead to confusion between the predicted yak target and the static features in the background. Therefore, in this embodiment, dark spot filtering of the predicted frames is performed by comparing local pixel values. Predicted frames with pixel differences greater than a preset pixel threshold are removed, while those with pixel differences less than or equal to the threshold are retained. The results of dark spot filtering on remote sensing images during the lush pasture period are as follows: Figure 5 (a) shows the set of dark spots in the yellow box, for example, the results of dark spot selection in the remote sensing image during the dry season. Figure 5 (b) shows the set of boxes in yellow.
[0051] Specifically, a fixed size neighborhood window is preset with the center pixel of the prediction box in the active area as the center, and whether there is a dark spot in the neighborhood window is monitored. Preferably, the neighborhood window is set according to the positional error between a plurality of historical remote sensing images. Since the original remote sensing image has an accuracy error, even after geometric correction, the remote sensing image still has an accuracy error with a reduced error value. Therefore, the position of the prediction box in the remote sensing image is different from its true geographical position, which is manifested as the distance between the geographical coordinates of the center pixel of the prediction box and its true geographical coordinates.
[0052] In a specific embodiment, a plurality of historical remote sensing images are acquired, the yak target in the remote sensing image is acquired by manual screening or model recognition, and the geographical coordinates of the center pixel of the prediction box of the yak target in the remote sensing image are read by using a geographic information system software such as ArcGIS. The true geographical coordinates of the yak target are acquired by field measurement or a positioning sensor installed on the yak body, the true geographical coordinates are mapped to the same scene remote sensing image, a first pixel corresponding to the true geographical coordinates is acquired, and the number of deviated pixels between the center pixel of the yak target and the first pixel is calculated. The average value N of the number of deviated pixels in the plurality of remote sensing images is calculated, and the size of the neighborhood window is preset as .
[0053] In another embodiment, further, the size of the neighborhood window also needs to consider the resolution and / or scale setting of the remote sensing image. After calculating the average value N of the number of deviated pixels in the plurality of remote sensing images, a real distance S corresponding to the side length of a single pixel is also acquired, and therefore the real distance corresponding to the side length of the neighborhood window is . In remote sensing images with different resolutions and / or different scales, the number of pixels of the side length of the neighborhood window is obtained by calculating the ratio of the real distance of the neighborhood window to the real distance corresponding to a single pixel.
[0054] The pixel difference value between the center pixel of the neighborhood window and other pixels is calculated. In a specific embodiment, the coordinates of the center pixel of the prediction box are (x, y), the pixel value of the coordinates is I(x, y), and the neighborhood size is , the average pixel value of other pixels in the neighborhood window except the center pixel is calculated , and the formula is as follows:
[0055] ;
[0056] wherein , N is an odd number. Then the pixel difference value between the pixel value of the center pixel and the average pixel value is calculated. If the pixel difference value is greater than the pixel threshold value, it is determined that the center pixel is a dark spot, and then the prediction box corresponding to the center pixel is determined as a static ground object and removed. If the pixel difference value is less than or equal to the pixel threshold value, there is no dark spot in the corresponding neighborhood window, and the category of the corresponding prediction box is determined as a yak and retained.
[0057] By taking the activity area of the yak as a spatial constraint, part of the non-yak targets are removed, but there are still a large number of static ground objects in the remote sensing image. The reflection brightness of these static ground objects is less than that of the yak. By calculating the pixel difference value between the center pixel and the adjacent pixel of the field window, the prediction box with high reflection brightness is identified as a yak, which reduces the false detection rate of static targets and effectively improves the accuracy and stability of the yak identification result.
[0058] Further, under ideal conditions, the remote sensing image quality is good, the ground surface is not blocked, and after dark spot screening, all static ground objects can be effectively removed. However, in actual application, due to the difference in remote sensing image shooting quality, terrain shadow, cloud interference and other factors, part of the static targets have small difference with the surrounding pixel values due to blocking, and do not meet the conditions of dark spot screening. Therefore, after dark spot screening, there are still prediction boxes with the category of static ground objects. To further improve the screening effect, the confidence of the prediction box is also screened as a supplementary means to the dark spot screening.
[0059] Specifically, the static ground object shows a lower confidence in the first model identification. Therefore, a first threshold value is preset. If the confidence of the prediction box is greater than the first threshold value, the category of the prediction box is determined as a yak. In this embodiment, the result of confidence screening of the remote sensing image in the grass growing period is, for example Figure 6 The result of confidence screening of the remote sensing image in the grass growing period is, for example Figure 6 (b) is shown by the set of yellow boxes.
[0060] Further, in this embodiment, considering that the shooting conditions, lighting conditions, background complexity and other factors of different remote sensing images will cause the confidence distribution of the first model predicting the yak to change, directly using a fixed value for the first threshold value will cause the accuracy of the calculated number of yaks to decrease. Therefore, the number of yaks is calculated at least once after confidence screening, and the number of yaks is used as an indirect representation of the image comprehensive quality and detection effect, so that the first threshold value adopts an adaptive threshold adjustment method based on the feedback of the number of yaks.
[0061] Specifically,
[0062] Step S11: Obtain the historical confidence of the prediction box determined as a yak in the multi-scene historical remote sensing image. An initial value of the first threshold is set by an expert based on long-term experience and / or statistical analysis results of multiple historical confidences, such as an average value. Optionally, different first thresholds are set for the prediction boxes of the remote sensing images in the dry grass period and the lush grass period, respectively.
[0063] Step S12: Set an expected interval based on the statistical results of the number of yaks in the historical remote sensing images. For example, an upper limit value is set by adding a value to the average value of the statistical results, and a lower limit value is set by subtracting a value from the average value. Alternatively, the minimum value in the statistical results is directly set as the lower limit value, and the maximum value is directly set as the upper limit value.
[0064] Step S13: Start iteration. Obtain the prediction boxes after dark point screening. Count the number of pixels of all prediction boxes with a confidence greater than the first threshold. Multiply the number of pixels by the geographic area corresponding to a single pixel in the remote sensing image to obtain the real geographic area corresponding to all prediction boxes.
[0065] Step S14: Calculate the ratio of the real geographic area to the average area occupied by a single yak to obtain the number of yaks.
[0066] Step S15: If the number of yaks is within the expected interval, that is, the number of yaks is greater than or equal to the lower limit value of the expected interval and the number of yaks is less than or equal to the upper limit value of the expected interval, keep the prediction boxes with a confidence greater than the first threshold in the current iteration, and end the iteration.
[0067] Step S16: If the number of yaks after confidence screening in the current iteration deviates from the expected interval, adjust the initial value based on a preset proportion to obtain a new first threshold. If the number of yaks is less than the lower limit value of the expected interval, decrease the first threshold by a multiple of (1-preset proportion). If the number of yaks is greater than the upper limit value of the expected interval, increase the first threshold by a multiple of (1+ preset proportion).
[0068] Step S17: Return to step S13. Perform the next round of confidence screening on the prediction boxes after dark point screening based on the new first threshold. Again, compare whether the number of yaks deviates from the expected interval.
[0069] Further, after adjusting the first threshold in step S15, it further includes: recording the number of times of adjusting the first threshold. If the number of times of adjusting the first threshold is greater than a preset adjustment threshold, it indicates that the recognition difficulty of the current remote sensing image is high, the iteration is ended, the last adjusted first threshold is output, and the prediction boxes with a confidence greater than the first threshold in the last adjustment are kept.
[0070] In this embodiment, preferably, the preset proportion is set to 0.01, and the preset adjustment threshold is set to 10 times.
[0071] By comparing the number of yaks after confidence screening and the expected interval, and adjusting the first threshold by a preset ratio when the number of yaks deviates from the expected interval, the first threshold is adaptively optimized for remote sensing images of different qualities, so that the first threshold can be appropriately increased when the image quality is high, thereby improving the final recognition accuracy; while in the case of lower quality or sparse targets, the first threshold should be appropriately reduced to reduce missed detection.
[0072] Further, after dark point screening, there are isolated prediction boxes. However, since yaks are gregarious animals, the confidence of the first model output for these isolated prediction boxes is low, and this part of the prediction box will not be identified as a yak target in the confidence screening. However, because of the gregarious nature of yaks, if the class of the prediction box with high confidence in the predicted remote sensing image is yak, then the other prediction boxes in the surrounding space with close distance to the prediction box are more likely to be classified as yaks. Therefore, in this embodiment, after confidence screening, a preset spatial buffer is set to take the center pixel of the prediction box whose class is determined as yak as the center pixel of the spatial buffer. The class of the prediction box in the spatial buffer whose confidence is less than or equal to the first threshold is also determined as yak and retained. The size of the spatial buffer is set by an expert according to the statistical results of the area of yak group distribution in multiple historical remote sensing images.
[0073] Remote sensing images are limited by differences in image quality, terrain shadows, cloud shadow interference and other factors, resulting in some static targets in the prediction results of the first model. By performing activity area screening, dark point screening and confidence screening on the prediction results, combining the dynamic adjustment of the confidence screening threshold according to the quality of the remote sensing image, and the gregarious distribution characteristics of yaks, further screening of static ground objects and effective retention of real yak targets are realized, thereby significantly improving the reliability and scientificity of the overall recognition result.
[0074] Further, in the dry grass period, the feature contrast between static ground objects and yaks is significant and the yak target is clear, so the identification accuracy of static ground objects is high. In the lush grass period, the remote sensing image is significantly affected by cloud cover and / or shadow interference and / or large-scale fog, resulting in blurred edges of static ground objects, and some static ground objects are mispredicted as yak targets by the first model. Therefore, after activity area screening, dark point screening and confidence screening of the prediction results, to further improve the recognition accuracy, in this embodiment, the prediction results of multiple historical remote sensing images and the prediction results of the current remote sensing image are compared for geographical coordinate consistency: the remaining prediction boxes after screening in the current remote sensing image are compared with the prediction boxes in the multiple historical remote sensing images for geographical position. If the prediction boxes at the same real geographical position are identified multiple times in different remote sensing images, it is determined that the prediction boxes have obvious spatial stability, and the prediction boxes are determined as static ground objects and are removed.
[0075] In another embodiment, the step of performing geographical coordinate consistency comparison between the prediction results of multiple historical remote sensing images and the prediction results of the current remote sensing image can also be performed before the active area screening, dark spot screening, and confidence level screening. The static ground objects with consistent geographical coordinates in the multiple historical remote sensing images are removed in advance, which is beneficial to reduce the calculation amount of the prediction boxes in the screening step and improve the accuracy in the prediction box screening process.
[0076] Since the yaks have migratory nature, while the static ground objects have fixed positions. By taking advantage of the feature that the static ground objects have consistent geographical coordinates in different temporal remote sensing images, the prediction boxes with constant positions are removed, which is beneficial to further reduce the false detection rate and improve the reliability and scientificity of the final recognition result under the complex imaging condition in the grass growing period.
[0077] Further, the specific method for calculating the number of yaks includes: calculating the real geographical area corresponding to all the prediction boxes after multiple screenings in the remote sensing image, calculating the ratio of the real geographical area to the average area occupied by a single yak, and obtaining the number of yaks.
[0078] Specifically, in the present embodiment, the actual overhead length and overhead width of yaks at an overhead angle are obtained by field sample collection, and the sample statistical results are shown in Table 1, for example.
[0079] Table 1 Partial yak length-width statistical data
[0080] ;
[0081] At the same time, since there is a certain interval between yaks, and not close arrangement, and due to the limitation of the spatial resolution of remote sensing images, it is difficult to display the interval of yaks in the remote sensing images. Therefore, in the present embodiment, the average interval between yaks is also taken into account, and the yak interval data is statistically collected by field sample collection, and part of the data is shown in Table 2, for example.
[0082] Table 2 Partial yak interval statistical data
[0083] ;
[0084] According to the statistical data, the average overhead length of yaks in the remote sensing image is about 176 cm, the average overhead width is 70 cm, and the average interval is 65 cm. Considering that the prediction box actually includes multiple yaks, the size difference of the average interval can be ignored under the resolution scale of the remote sensing image. In the present embodiment, the average area A occupied by a single yak in the remote sensing image is calculated as follows: single
[0085] ;
[0086] wherein Lavg is the average horizontal length; W avg is the average horizontal width; D avg is the average interval, and the average area of a single yak is finally calculated as 3.09 m 2 The method for calculating the real geographic area comprises: counting a first quantity of pixels occupied by the prediction box in the remote sensing image; calculating a first ratio of an actual area of the remote sensing image to a total quantity of pixels of the remote sensing image, which is used to represent a pixel geographic area corresponding to a single pixel; and calculating a product of the first quantity and the first ratio to obtain the real geographic area of the prediction box.
[0087] Considering the behavior characteristics of yaks in groups, multiple yaks may be displayed as continuous pixels or single pixels in the remote sensing image due to the influence of satellite resolution or cloud interference, and only one prediction box may appear. At this time, the number of prediction boxes is not one-to-one corresponding to the actual number of yaks. By estimating the number of yaks based on the actual area of the prediction box and the average area of a single yak, the spatial behavior, morphological characteristics, and image resolution limitations of yaks are comprehensively considered, and the relative accurate estimation of the number of yaks can be realized without relying on the labeling of each prediction box in the remote sensing image.
[0088] In this embodiment, the training method of the first model comprises:
[0089] One scene of the remote sensing image at different time phases is selected for sample set construction. The remote sensing images at multiple time phases are used to manually label the markers in the remote sensing image by auxiliary comparison, and yaks and other markers such as herdsman's houses are classified out. The labeling results are saved in vector form and uniformly converted into a text format label file required by the YOLO target detection model.
[0090] To improve the detection capability of the first model on small targets, further, the labeled remote sensing image samples are subjected to image standardization and enhancement processing, which comprises: normalizing and stretching the remote sensing image to enhance the contrast and texture features; cutting the remote sensing image into multiple small block images with a size of 32x32 pixels, interpolating each small block image to obtain a sample image with a size of 256x256 pixels. The sample image obtained after cutting is saved as a PNG (Portable Network Graphic) format file for model training and verification. After the enhancement processing of the remote sensing image, the relative scale of the target to be detected in the remote sensing image is improved, which is conducive to enhancing the perception capability of the first model on small targets.
[0091] Finally, among the obtained multiple sample images, 237 images of the grass-rich period and 279 images of the withered grass period were constructed, and the images of the grass-rich period and the withered grass period were divided into a training set and a verification set according to a 7:3 ratio to improve the generalization ability of the model training.
[0092] In this embodiment, the first model adopts a YOLOv8 model to detect real yaks and static ground objects in high-resolution remote sensing images. YOLOv8 is a single-stage regression type target detection algorithm, which has fast detection speed, high accuracy, strong adaptability to small targets, and is suitable for the detection of ground objects such as yak-like targets, which are small in size and sparsely distributed. The overall network structure of YOLOv8 is shown in, for example, Figure 7 which includes a backbone network, a neck, and a detection head.
[0093] Specifically, the backbone network is stacked by multiple basic convolution modules (Convolutions-Batch Normalization-Sigmoid weighted Linear Unit, CBS) and multiple feature extraction modules (Concatenate Two-waysplit fuse, C2f). The CBS adopts a convolution layer, a batch normalization layer, and an activation function layer, as shown in, for example, Figure 8 The structure of C2f is shown in, for example, Figure 8 wherein X in C2f_X is the number of bottleneck blocks in the C2f structure, C2f includes multiple CBS and multiple bottleneck blocks, and a multi-branch bottleneck block is used to enhance the feature extraction capability and computational efficiency. The structure of the bottleneck block is shown in, for example, Figure 8 The structure of the SPPF is shown in, for example, Figure 9 The structure of the detection head is shown in, for example, Figure 9(b) as shown, including 2 branches, each branch including a plurality of CBS and a convolutional layer, wherein one branch uses a prediction box loss function (Bbox loss) and the other branch uses a class loss function (Cls loss) for outputting detection results at different scales, including prediction box center point position, box size, class, class probability and confidence. In terms of detection accuracy, YOLOv8 introduces optimized structure and loss function while maintaining real-time detection capability, making it have excellent target detection performance in the remote sensing scene.
[0094] In this embodiment, the research area of the remote sensing image is the Sibu Pasture. The Sibu Pasture is located in the Lhasa City of the Tibet Autonomous Region, located in the hinterland of the Qinghai-Tibet Plateau, with geographical coordinates of , north latitude . Optionally, for seasonal differences, in an embodiment of the present application, a first model is established for the grass growing season and the grass withering season respectively.
[0095] Two training data sets are constructed for the grass growing season (3 images, 237 pictures) and the grass withering season (4 images, 279 pictures) respectively. To better test the performance of the first model, 45 grass growing season pictures and 63 grass withering season pictures are added as independent test sets for model performance evaluation. YOLOv8 is used for model training, the input data is four-band multispectral image, the model structure keeps the original backbone and feature extraction network of YOLOv8, and only the input layer is adjusted to four channels to adapt to remote sensing data. During the training process, standard parameter configuration is adopted, and precision, recall rate, average precision and other indicators are introduced to evaluate the first model. In order to comprehensively evaluate the influence of each step on the recognition effect and further verify the actual value of static target screening, it is necessary to analyze the accuracy and accuracy of the results after static target screening from the quantitative point of view. The statistics of the prediction box in part of the multi-scene remote sensing image, part of the results of recognizing yaks in the grass growing season image, the statistical data are shown in Table 3 for example, the average precision of the first model is calculated as 0.92, the average recall rate is 0.74,
[0096] Table 3 Partial yak data statistics results of grass growing season image
[0097] ;
[0098] Part of the results of recognizing yaks in the grass withering season image, the statistical data are shown in Table 4 for example, the average precision is calculated as 0.92, the average recall rate is 0.75,
[0099] Table 4 Partial yak data statistics results of grass withering season image
[0100] ;
[0101] The application preliminarily identifies yaks based on a YOLOv8 model, and effectively eliminates static interference targets such as rocks and grass piles by introducing a plurality of static target screening methods. The identification result after screening shows that the average accuracy in the rich grass period and the dry grass period reaches a high level of 0.92, and the average recall rates are 0.74 and 0.75 respectively, indicating that the application can identify yak targets from remote sensing images, effectively eliminate non-yak targets such as rocks and grass piles, and improve the accuracy of estimating the number of yaks.
[0102] Those of ordinary skill in the art can understand that all or some of the steps in the method disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those of ordinary skill in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information such as computer readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage, or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media generally includes computer readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and can include any information delivery medium.
[0103] The above examples are only used to illustrate the application and not to limit the technical solutions described in the application. Although the application has been described in detail with reference to the above embodiments, the application is not limited to the above specific embodiments, and any modification or equivalent replacement of the application; all technical solutions and improvements that do not deviate from the spirit and scope of the application are covered in the scope of the claims of the application.
Claims
1. A method for estimating the number of yaks based on high-resolution remote sensing images and YOLOv8, characterized in that, The application comprises the following steps: Inputting remote sensing images of red, blue, green and near-infrared bands into a first model after superimposition to obtain a prediction result; The first model is a YOLOv8 model with an adjusted input channel dimension of four dimensions; Obtaining a center point coordinate from the prediction result and adding the center point coordinate in the corresponding geographic coordinate of the remote sensing image to the prediction result; Mapping the prediction result to a prediction box in the remote sensing image based on the center point coordinate; Performing activity region screening on the prediction box based on a preset activity region to obtain a first candidate box; Performing dark point screening based on pixel difference values between pixels in the first candidate box to obtain a second candidate box; Performing confidence screening on the second candidate box based on a preset first threshold to obtain a third candidate box; Calculating a real geographic area corresponding to the third candidate box, obtaining an average area occupied by a single yak, and calculating a ratio of the real geographic area to the average area occupied by a single yak to obtain a number of yaks; The activity region screening comprises the following steps: The activity region is determined by the geographic coordinates of the prediction box in historical remote sensing images; the activity region and the remote sensing image currently mapped with the prediction box are superimposed; the prediction box with the geographic coordinates in the activity region is retained and recorded as a first candidate box; The dark point screening comprises the following steps: A preset neighborhood window is set, and the center point coordinate of the first candidate box is used as the coordinate of the center pixel of the neighborhood window; the average pixel value of other pixels in the neighborhood window except the center pixel is calculated; the pixel difference value between the pixel value of the center pixel and the average pixel value is calculated; the first candidate box with a pixel difference value less than or equal to a preset pixel threshold is retained and recorded as a second candidate box.
2. The method of claim 1, wherein, The confidence screening comprises the following steps: The second candidate box with a confidence value greater than the first threshold is retained and recorded as a third candidate box.
3. The method of claim 2, wherein, The first threshold is dynamically adjusted based on the number of yaks, comprising the following steps: Based on the statistical results of the number of yaks in historical remote sensing images, a desired interval is preset; After the confidence screening, the number of yaks is calculated at least once based on the real geographic area and the average area occupied by the third candidate box; If the number of yaks deviates from the desired interval, the first threshold is adjusted based on a preset ratio, and the confidence screening is performed again.
4. The method of claim 2, wherein, Further comprising the following steps: A preset spatial buffer area is set, and the center pixel of the third candidate box is used as the center pixel of the spatial buffer area; The second candidate box with a confidence value less than or equal to the first threshold in the buffer area is retained and recorded as a third candidate box.
5. The method according to any one of claims 1 to 4, characterized in that, Further comprising the following steps: The geographic coordinates of the prediction box in the current remote sensing image are obtained, and if the geographic coordinates in multiple historical remote sensing images correspond to the prediction box, the prediction box in the current remote sensing image is excluded.
6. The method of claim 1, wherein, The average area occupied by a single yak is obtained, comprising the following steps: The actual overhead length, the actual overhead width and the interval distance between adjacent yaks are obtained through field sample collection; the average overhead length, the average overhead width and the average interval of multiple yaks are calculated, the average overhead length superimposed with the average interval is multiplied by the average overhead width superimposed with the average interval, and the average occupied area is obtained.
7. A yak population estimation system based on high-resolution remote sensing images and YOLOv8, characterized in that, Comprise: The identification module is configured to input the remote sensing image of red, blue, green and near-infrared wave bands after superposition into the first model to obtain a prediction result; The first model is a YOLOv8 model with an input channel dimension of four; the center point coordinates are obtained from the prediction result, and the center point coordinates corresponding to the geographic coordinates of the remote sensing image are added to the prediction result; The prediction result is mapped into a prediction box in the remote sensing image based on the center point coordinates; The screening module is configured to perform activity area screening on the prediction box based on a preset activity area to obtain a first candidate box; and is further configured to perform dark point screening based on the pixel difference between pixels in the first candidate box to obtain a second candidate box; It is further configured to perform confidence screening on the second candidate box based on a preset first threshold to obtain a third candidate box; The activity area screening comprises: The activity area is determined by the geographic coordinates of the prediction box in the historical remote sensing image; the activity area and the remote sensing image currently mapped with the prediction box are superimposed, and the prediction box with the geographic coordinates in the activity area is retained as a first candidate box; The dark point screening comprises: A preset neighborhood window, the center point coordinates of the first candidate box as the coordinates of the center pixel of the neighborhood window; calculate the average pixel value of other pixels in the neighborhood window except the center pixel, calculate the pixel difference between the pixel value of the center pixel and the average pixel value; retain the first candidate box with the pixel difference less than or equal to the preset pixel threshold, and record it as the second candidate box; The estimation module is used for calculating the real geographic area of the third candidate box, obtaining the average occupied area of a single yak, calculating the ratio of the real geographic area to the average occupied area, and obtaining the number of yaks.
Citation Information
Patent Citations
Method and system for calculating number of yaks in alpine meadow based on unmanned aerial vehicle images
CN119477866A
SPD-YOLOv8-based remote sensing image ship detection method
CN119229309A
Remote sensing image small target identification method based on improved YOLOv8 algorithm
CN120564031A