Method for detecting houses along banks of rivers and lakes through unmanned aerial vehicle aerial image based on YOLO V8
Through the drone aerial image detection method based on YOLO V8, a house data set along the river and lake shores was constructed and feature fusion was carried out, which solved the problem of untimely information collection and low detection accuracy in traditional river and lake shoreline supervision, and achieved rapid and accurate house detection and distribution map drawing.
Patent Information
- Application Number
- CN202510248431.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-07-18
Smart Images

Figure CN120339871A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of target detection of UAV aerial images, and particularly relates to a method for detecting houses along rivers and lakes in UAV aerial images based on a target detection model. Background Art
[0002] The shorelines of river and lake waters are important components of the ecosystem and important natural resources, which are related to flood control safety, water supply safety, and ecological safety. The Ministry of Water Resources has organized a special action of "cleaning up the four disorders" across the country to clean up and rectify the problems of illegal occupation, illegal mining, illegal piling, and illegal construction within the scope of river and lake management. The spatial supervision of river and sea water shorelines has the characteristics of numerous points, wide areas, and large workloads, and is a complex systematic project.
[0003] Traditional supervision of river and lake shorelines mostly carried out in the forms of manual inspections, hierarchical reporting, and public complaints, etc., with problems such as untimely information collection, single source and form, incomplete coverage, etc., and it is difficult to achieve real-time and normalized comprehensive inspections and overall supervision.
[0004] It is found in the research that UAVs have low construction and use costs, strong mobility, easy takeoff and landing, and small safety risk coefficients, can achieve the collection of high-resolution images, and can be used for the image collection and investigation of house targets along rivers and lakes.
[0005] However, due to the complexity of technical means for river and lake water shoreline supervision, there are still problems of low supervision efficiency and overall supervision level at present. Especially in the supervision of river and lake water shorelines, there is a lack of intelligent recognition and pre-judgment and early warning technologies for suspected problems. Therefore, how to design a more accurate, stable, and fast image detection and processing method is a valuable challenge. Summary of the Invention
[0006] The purpose of the present invention is to address the problems of traditional river and lake shoreline supervision mostly carried out in the forms of manual inspections, hierarchical reporting, public complaints, etc., with problems such as untimely information collection, single source and form, incomplete coverage, and low detection accuracy, and propose a method for detecting houses along rivers and lakes in UAV aerial images based on YOLO V8; it can assist manual detection of houses along rivers and lakes in aerial images and improve the detection accuracy of houses along the shore.
[0007] The technical solution of the present invention is as follows:
[0008] A method for detecting houses along rivers and lakes in UAV aerial images based on YOLO V8, the method comprising the following steps:
[0009] S1. Obtain UAV aerial images of the shorelines of rivers and lakes, and establish an image dataset containing two types of targets, namely permanent houses and temporary houses; label the house targets for each image, and construct a training set;
[0010] S2. Build a house detection model, preprocess the images in the training set, and perform convolution operations on the preprocessed images using a feature extraction unit to obtain multi-scale feature maps;
[0011] Use a feature fusion unit to fuse the multi-scale feature maps to obtain fused multi-scale feature maps, and use the non-maximum suppression method to merge and screen overlapping bounding boxes to obtain the house target detection results and complete the training;
[0012] S3. Use the trained house detection model to process the images of the river and lake banks taken by the drone, obtain the house target detection results, and generate a house distribution map of the river and lake banks according to the position and category information of the detection results.
[0013] Furthermore, the specific steps of S1 include:
[0014] S11. According to the distribution of houses along the river and lake banks, plan the aerial photography route of the drone, conduct aerial photography on the target area, and obtain image data;
[0015] S12. Use the labelImg tool to select the bounding boxes of the house targets and input the classification labels of the selected targets to obtain the labeled house target images;
[0016] S13. Use the labelImg tool to export the labeled information and save it in a folder in the txt format; the txt file stores the categories of the labeled houses and the coordinates of the bounding boxes.
[0017] Furthermore, the house detection model includes a preprocessing unit, a feature extraction part, a feature fusion unit, and a merging and screening unit; among them,
[0018] The preprocessing unit is used to perform data augmentation, normalization processing, and scaling processing on the images, and after expanding the diversity of the graphic data, adjust the images to a fixed size;
[0019] The feature extraction unit includes a cross-stage local module, a separable convolution module, and a composite activation module; it is used to perform convolution on the processed images to obtain multi-scale feature maps;
[0020] The feature fusion unit includes a path aggregation network, a feature pyramid network, and an attention mechanism network. The path aggregation network is used to fuse low-level feature maps and high-level feature maps; the feature pyramid network uses a top-down feature transfer structure to combine high-level feature maps and low-level feature maps to generate feature maps of different scales; the self-attention mechanism is used to enhance the capture of long-range dependencies to obtain the fused multi-scale feature maps;
[0021] The merge and filter unit is used for object classification and bounding box regression, and redundant bounding boxes with high overlap are removed by non-maximum suppression method.
[0022] Furthermore, the preprocessing unit performs data enhancement, normalization and scaling on the image, wherein the scaling uses a bilinear interpolation algorithm to adjust the image to a fixed size, including:
[0023] The original image data of the training set is randomly cut, horizontally flipped, vertically flipped, and rotated to obtain image data with enhanced diversity;
[0024] Normalizing the pixel values of the enhanced image data;
[0025] Use proportional scaling to maintain the aspect ratio of the augmented image, zero-padded the edges after scaling to match the target size, and adjust the augmented input image to the fixed size required by the house detection model.
[0026] Furthermore, the performing of target classification and bounding box regression, and removing redundant bounding boxes with high overlap by a non-maximum suppression method includes:
[0027] Based on the fused multi-scale feature map, prediction boxes of different scales are obtained, including prediction box coordinates, confidence, and probability scores of the categories to which they belong;
[0028] The softmax function is used to normalize the probability scores of the categories to obtain the normalized category probability distribution;
[0029] According to the preset confidence threshold, the prediction boxes with confidence higher than the threshold are filtered out;
[0030] Calculate the intersection-and-union ratio between overlapping prediction frames, and merge the prediction frames whose intersection-and-union ratio is greater than a preset threshold;
[0031] According to the coordinates, confidence and category of the merged prediction box, the final house object detection result is output.
[0032] Furthermore, the prediction box coordinates are represented by the center point coordinates (x, y), width w, and height h of the target.
[0033] Furthermore, generating a house distribution map along the river or lake includes:
[0034] If the house category is a permanent house, store its bounding box position and category label in the permanent house list;
[0035] If the house category is temporary housing, store its bounding box position and category label in the temporary housing list;
[0036] Adopt a coordinate conversion algorithm to convert the image coordinates of the house bounding box into geographical coordinates;
[0037] Draw house marker points on the electronic map and perform category annotation;
[0038] Overlay and display permanent houses and temporary houses to generate a distribution map of houses along the river and lake.
[0039] Furthermore, the method further includes:
[0040] Use the test set to test the trained house detection model, and obtain the precision Precision and recall rate Rcall using the following formula:
[0041]
[0042] Where: TP represents the number of correctly detected houses, FP represents the number of falsely detected houses, and FN represents the number of undetected houses;
[0043] According to the precision and recall rate, obtain the P-R curve, let the area under the curve be AP, obtain the AP value corresponding to each type of house and calculate the average value mAP to measure the precision of the house detection model:
[0044]
[0045] Where: N represents the total number of categories, and i represents the category number.
[0046] A system adopted by a method for detecting houses along the river and lake in UAV aerial images based on YOLO V8, including:
[0047] A data acquisition module, which is used to obtain UAV aerial images of the river and lake coast, establish an image dataset containing two types of targets, permanent houses and temporary houses; label the house targets for each image, and construct a training set;
[0048] A model construction module, which is used to preprocess the images in the training set, perform convolution operations on the preprocessed images using a feature extraction unit to obtain multi-scale feature maps; use a feature fusion unit to perform feature fusion on the multi-scale feature maps to obtain a fused multi-scale feature map, and use the non-maximum suppression method to merge and screen overlapping bounding boxes to obtain the house target detection result and complete the training;
[0049] A result generation module, which is used to process the UAV aerial images of the river and lake coast using the trained house detection model to obtain the house target detection result, and generate a distribution map of houses along the river and lake according to the position and category information of the detection result.
[0050] A computer-readable storage medium stores a computer program, which when executed, implements the method for detecting houses along the river and lake banks in UAV aerial images based on YOLO V8.
[0051] Advantages of the present invention:
[0052] After multiple image preprocessings and data augmentations, the present invention uses a feature extraction module to adapt to the detection of houses along the river and lake banks in UAV aerial images, improving the accuracy of target detection; it can be widely applied in fields such as river and lake management and urban planning, providing data support for relevant decisions, and having important practical value.
[0053] The present invention discloses a method for detecting houses along the river and lake banks in UAV aerial images. By acquiring UAV aerial images, establishing a dataset including permanent and temporary houses, and constructing a house detection model; the model uses multi-scale feature extraction and fusion techniques, combined with the non-maximum suppression method, to achieve accurate detection of houses along the river and lake banks; finally, directly generate a distribution map of houses along the river and lake banks according to the detection results, distinguishing permanent and temporary houses; solving the problem of time-consuming and laborious traditional manual investigation methods, and realizing the rapid and automated detection and distribution map drawing of houses along the river and lake banks.
[0054] The present invention also introduces an accuracy evaluation mechanism to measure the model performance by calculating precision, recall rate, and mean average precision; providing an efficient and accurate solution for the monitoring of houses along the river and lake banks, and helping relevant departments with river and lake management and environmental protection work.
[0055] Other features and advantages of the present invention will be described in detail in the following specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] By describing the exemplary embodiments of the present invention in more detail in conjunction with the drawings, the above and other objects, features, and advantages of the present invention will become more apparent. Among them, in the exemplary embodiments of the present invention, the same reference numerals generally represent the same components.
[0057] Figure 1 Shows the flowchart of the method for detecting houses along the river and lake banks in UAV aerial images of the present invention.
[0058] Figure 2 Shows the detection result diagram of houses along the river and lake banks in UAV aerial images of an embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0059] The following will describe the preferred embodiments of the present invention in more detail with reference to the drawings. Although the preferred embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein.
[0060] Example 1:
[0061] This example discloses a method for detecting house targets on the banks of rivers and lakes by drone aerial photography based on the YOLO V8 object detection model. The technical steps are as follows:
[0062] S1. Obtain drone aerial photography images of the banks of rivers and lakes, and establish an image dataset containing two types of targets: permanent houses and temporary houses; label the house targets for each image and construct a training set; specifically:
[0063] S11. According to the distribution of houses on the banks of rivers and lakes, plan the drone aerial photography route, conduct aerial photography on the target area, and obtain image data;
[0064] S12. Use the labelImg tool to select the bounding boxes of the house targets and input the classification labels of the selected targets to obtain the labeled house target images;
[0065] S13. Use the labelImg tool to export the labeled information and save it in a folder in txt format; the txt file stores the categories of the labeled houses and the coordinates of the bounding boxes;
[0066] S2. Build a house detection model, preprocess the images in the training set, and perform convolution operations on the preprocessed images using a feature extraction unit to obtain multi-scale feature maps;
[0067] Use a feature fusion unit to fuse the multi-scale feature maps, obtain the fused multi-scale feature maps, and use the non-maximum suppression method to merge and filter the overlapping bounding boxes to obtain the house target detection results and complete the training;
[0068] S3. Use the trained house detection model to process the drone aerial photography images of the banks of rivers and lakes, obtain the house target detection results, and generate a house distribution map of the banks of rivers and lakes according to the position and category information of the detection results. Specifically:
[0069] If the house category is a permanent house, store its bounding box position and category label in the permanent house list;
[0070] If the house category is a temporary house, store its bounding box position and category label in the temporary house list;
[0071] Adopt a coordinate conversion algorithm to convert the image coordinates of the house bounding box into geographical coordinates;
[0072] Draw house marker points on the electronic map and perform category labeling;
[0073] Overlay and display permanent houses and temporary houses to generate a distribution map of houses along the river and lake.
[0074] In this embodiment, the aerial images of the river and lake banks captured by the drone are input into the house detection model. The model extracts the feature information in the images, such as the outlines, textures, colors of the houses, etc. According to the extracted feature information, the house targets in the images are located and classified. The model will give the position coordinates and category information of each detected house target. The position coordinates are represented by a bounding box, that is, the 4 coordinates of the house in the image, x, y, width, and height. The category information indicates whether the detected house is a permanent house or a temporary house. According to the house position and category information output by the model, the detection results are drawn on the original aerial image. Generally, different-colored rectangular boxes and text labels are used to represent houses of different categories. For example, a red rectangular box can be used to represent permanent houses, an orange rectangular box can be used to represent temporary houses, and a text label is added next to the rectangular box to display the category. The aerial images with the detection results drawn are stitched together to generate a complete distribution map of houses along the river and lake.
[0075] Post-processing is performed based on the house distribution map to more intuitively display the house information. For example, according to the position information of the houses, the floor area of each house can be calculated and displayed in different colors or sizes to reflect the size of the houses. It is also possible to further analyze the aggregated distribution of the houses, find out the areas with dense houses, and provide a basis for subsequent illegal construction supervision.
[0076] Through the steps of the present invention, the recognition and positioning of house targets along the river and lake can be completed using the house detection model, and the house distribution can be intuitively displayed, greatly reducing the workload of manual detection. The flexible mobility of the drone and the intelligence of the target detection algorithm are fully utilized, improving the efficiency and accuracy of river and lake management. By timely grasping the dynamic of house distribution, relevant departments can plan and manage in a timely manner, avoid the damage of illegal buildings to the river and lake ecological environment, and promote the sustainable development of the river and lake.
[0077] In an example, the house detection model includes;
[0078] A preprocessing unit for performing data augmentation, normalization processing, and scaling processing on the image. After expanding the diversity of graphic data, the image is adjusted to a fixed size;
[0079] A feature extraction unit, including a cross-stage local module, a separable convolution module, and a composite activation module; for performing convolution on the processed image to obtain multi-scale feature maps;
[0080] The feature fusion unit includes a path aggregation network, a feature pyramid network, and an attention mechanism network. The path aggregation network is used to fuse low-level feature maps and high-level feature maps; the feature pyramid network uses a top-down feature transfer structure to combine high-level feature maps and low-level feature maps to generate feature maps of different scales; the self-attention mechanism is used to enhance the capture of long-range dependencies to obtain the fused multi-scale feature maps.
[0081] The merging and screening unit is used for object classification and bounding box regression, and removes redundant bounding boxes with high overlap through the non-maximum suppression method.
[0082] In this embodiment, the role of the preprocessing unit is to perform preliminary processing on the input image data to improve the subsequent feature extraction and object detection effects. First, data augmentation is performed on the image, such as random rotation, flipping, scaling, etc., to expand the diversity of training data and improve the generalization ability of the model. For example, the image can be randomly rotated by ±10°, flipped horizontally or vertically, and scaled by 0.8 to 1.2 times. Secondly, the image is normalized by dividing the original pixel values of the image (0-255) by 255 and scaling them to between 0 and 1 to eliminate the brightness and contrast differences between different images, making the model pay more attention to the image content itself. Finally, the image is scaled to a fixed size to meet the input requirements of the subsequent network and facilitate batch processing.
[0083] In the feature extraction unit, the cross-stage local module enhances the feature expression ability by establishing connections between different convolutional stages and fusing local features with different receptive fields. For example, a connection can be established between the second stage and the fourth stage to combine low-level texture features and high-level semantic features. The separable convolution module splits the standard convolution into depth convolution and point convolution, increasing the feature diversity while reducing the computational amount. For example, 3×3 depth convolution is used to extract spatial features, and then 1×1 point convolution is used to adjust the number of channels. The composite activation module uses a combination of multiple activation functions, such as Relu and Mish, to enhance the non-linear expression ability of the feature map and improve the discriminability of the features.
[0084] The feature fusion unit cleverly combines multiple feature fusion mechanisms to integrate feature maps at different scales and different stages. The path aggregation network adopts a bottom-up feature transfer method. First, it upsamples the fine-grained features of the low layer, then adds them to the coarse-grained features of the high layer, and fuses them layer by layer to finally obtain a feature map with rich details and high-level semantics. The feature pyramid network, on the other hand, adopts a top-down feature transfer method. First, it downsamples the features of the highest layer, then adds them to the features of the low layer to generate feature maps of multiple scales to adapt to targets of different sizes. The attention mechanism network generates spatial attention maps and channel attention maps to adaptively adjust the weights of different regions and different channels in the feature map, highlighting the features of the target region and suppressing the interference of the background region.
[0085] The merging and screening unit generates the final object detection result based on the feature map. First, a classifier is used to classify the object at each position in the feature map to determine whether there is an object at that position and the category of the object. At the same time, a regressor generates a series of candidate bounding boxes for each position to predict the position and size of the object. Then, the non-maximum suppression method is used to screen and merge the candidate boxes. Specifically, the candidate boxes are sorted according to the classification confidence, and the box with the highest confidence is selected as the benchmark to suppress other candidate boxes whose overlap with it exceeds a certain threshold (such as 0.5), and finally a set of target bounding boxes with high confidence and no redundancy is obtained.
[0086] During the specific implementation:
[0087] Step 1: Set the UAV flight path in advance for aerial photography of the river and lake banks, and establish a UAV aerial photography image dataset of the river and lake banks.
[0088] Step 2: Preprocess the established dataset, annotate the house targets in the UAV aerial photography images, export the annotated images, and establish the training set and test set of the model.
[0089] Step 3: Use the tool labelImg to annotate the obtained UAV images. The dataset established in Step 1 contains two types of houses: permanent houses and temporary houses. During the annotation process, experts use the labelImg tool to select the house targets and input the labels of the selected targets. Then, use labelImg to export the annotated information and save it in a specified folder in the txt format. The txt file stores the categories of the annotated houses and the coordinates of the annotation boxes.
[0090] Step 3: Construct an object detection model. The main part of the model consists of an input part, a feature extraction part, a feature fusion part, and a merging and screening part.
[0091] The model takes an input image, usually a color image, as its input. These images come from the image data collected by drones and contain rich geographical and environmental information. The input image is divided into a fixed number of grid cells. For each grid cell, a Cross-Stage Partial Network (CSPNet) is used for feature extraction. These feature maps contain semantic information about the image, such as texture, color, and shape. The CSPNet captures the deep features of the image through a series of convolutional layers and activation functions, helping the model identify the objects in the image.
[0092] The CSP module divides the network into multiple branches. Each branch performs local feature extraction at an earlier stage and then merges them. This structure avoids computational bottlenecks, enables information to flow more efficiently, enhances the learning ability of deep features, reduces the vanishing gradient problem, improves the training efficiency of the network, and obtains multi-scale feature maps.
[0093] Based on the multi-scale feature maps, object classification and bounding box regression are performed. Multiple bounding boxes are predicted simultaneously. Each bounding box consists of the following elements:
[0094] The location of the bounding box, usually represented by 4 coordinates, namely x, y, width, and height;
[0095] The confidence score of the object contained in the bounding box, indicating whether there is an object in the bounding box;
[0096] The probability score of each class in the bounding box, indicating the likelihood that the object in the bounding box belongs to each class.
[0097] For each bounding box, the probability scores of its belonging to different classes are calculated. The softmax function is used to normalize these probability scores so that the sum of the probabilities of all classes is 1, thereby determining the relative probabilities of each class. According to the confidence score of each bounding box, the bounding boxes with scores higher than a certain set threshold are selected, and the bounding boxes with lower confidence are removed to reduce the interference of false detections. The Non-Maximum Suppression (NMS) algorithm is applied to merge and filter the overlapping bounding boxes; redundant detection results are eliminated, and only the bounding box with the highest confidence is retained to avoid the same object being repeatedly detected by multiple bounding boxes. The final detection results include the location, class, and the associated confidence score of each bounding box. This information provides the precise location and class of the objects in the image, providing reliable data support for subsequent analysis and decision-making.
[0098] Step 4: Use the test set to test the performance of the trained object detection model, and then use the model for the recognition of the images of houses along the river and lake taken by drones, and output the recognition results.
[0099] Example 2
[0100] The purpose of this embodiment is to provide a system adopted by a method for detecting houses along the river and lake banks in UAV aerial images based on the YOLO V8 object detection model, including:
[0101] A data acquisition module, which is used to obtain UAV aerial images of the river and lake banks, establish an image dataset containing two types of targets, namely permanent houses and temporary houses; label the house targets for each image, and construct a training set;
[0102] A model construction module, which is used to preprocess the images in the training set, perform convolution operations on the preprocessed images using a feature extraction unit to obtain multi-scale feature maps; use a feature fusion unit to fuse the multi-scale feature maps to obtain a fused multi-scale feature map, and use the non-maximum suppression method to merge and screen overlapping bounding boxes to obtain the house target detection results and complete the training;
[0103] A result generation module, which is used to process the UAV aerial images of the river and lake banks using the trained house detection model to obtain the house target detection results, and generate a distribution map of houses along the river and lake banks according to the position and category information of the detection results.
[0104] Example 3
[0105] The purpose of this embodiment is to provide a computer-readable storage medium with a computer program stored thereon. When the computer program is executed, a method for detecting houses along the river and lake banks in UAV aerial images based on an object detection model is implemented.
[0106] The above has described the embodiments of the present invention. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes are obvious to those of ordinary skill in the art in the technical field without departing from the scope and spirit of the described embodiments.
Claims
1. A method for detecting houses along the river and lake banks in UAV aerial images based on YOLO V8, characterized in that, The method includes the following steps: S1. Obtain the aerial images of the river and lake banks by drones, and establish an image dataset including two types of targets: permanent houses and temporary houses; label the house targets in each image, and construct a training set; S2. Construct a house detection model, preprocess the images in the training set, and perform convolution operations on the preprocessed images using a feature extraction unit to obtain multi-scale feature maps; Use a feature fusion unit to fuse the multi-scale feature maps, obtain the fused multi-scale feature maps, and use the non-maximum suppression method to merge and filter the overlapping bounding boxes to obtain the house target detection results and complete the training; S3. Use the trained house detection model to process the aerial images of the river and lake banks by drones, obtain the house target detection results, and generate a house distribution map of the river and lake banks according to the position and category information of the detection results.
2. The method for detecting houses along the river and lake banks in UAV aerial images based on YOLO V8 according to claim 1, wherein The specific content of S1 includes: S11. According to the distribution of houses on the river and lake banks, plan the aerial route of the drone, conduct aerial photography on the target area, and obtain image data; S12. Use the labelImg tool to select the bounding boxes of the house targets and input the classification labels of the selected targets to obtain the labeled house target images; S13. Use the labelImg tool to export and store the labeled information in a folder in the txt format; the txt file stores the categories of the labeled houses and the coordinates of the bounding boxes.
3. The method for detecting houses along the river and lake banks in UAV aerial images based on YOLO V8 according to claim 1, characterized in that, The house detection model includes a preprocessing unit, a feature extraction part, a feature fusion unit, and a merging and screening unit; among them, The preprocessing unit is used to perform data augmentation, normalization processing, and scaling processing on the images, and after expanding the diversity of the graphic data, adjust the images to a fixed size; The feature extraction unit includes a cross-stage local module, a separable convolution module, and a composite activation module; it is used to perform convolution on the processed images to obtain multi-scale feature maps; The feature fusion unit includes a path aggregation network, a feature pyramid network, and an attention mechanism network. The path aggregation network is used to fuse the low-level feature maps and high-level feature maps; the feature pyramid network uses a top-down feature transfer structure to combine the high-level feature maps and low-level feature maps to generate feature maps of different scales; the self-attention mechanism is used to enhance the capture of long-range dependencies to obtain the fused multi-scale feature maps; The merging and screening unit is used to perform target classification and bounding box regression, and remove redundant bounding boxes with high overlap degrees through the non-maximum suppression method.
4. The method for detecting houses along the river and lake banks in UAV aerial images based on YOLO V8 according to claim 3, wherein The data augmentation, normalization processing, and scaling processing of the images by the preprocessing unit, where the scaling processing uses the bilinear interpolation algorithm to adjust the images to a fixed size, include: Perform random shearing, horizontal flipping, vertical flipping, and rotation on the original image data of the training set to obtain diversified enhanced image data; Perform normalization processing on the pixel values of the enhanced image data; Use equal-proportion scaling to maintain the aspect ratio of the enhanced images, perform zero-padding on the edges after scaling to match the target size, and adjust the enhanced input images to the fixed size required by the house detection model.
5. The method for detecting houses along the river and lake banks in drone aerial images based on YOLO V8 according to claim 3, wherein Performing the target classification and bounding box regression, and removing redundant bounding boxes with high overlap degrees through the non-maximum suppression method includes: Obtaining prediction boxes of different scales based on the fused multi-scale feature maps, including the coordinates of the prediction boxes, the confidence levels, and the probability scores of the categories to which they belong; Using the softmax function to normalize the probability scores of the categories to obtain the normalized category probability distribution; According to a preset confidence level threshold, screening out the prediction boxes with confidence levels higher than this threshold; Calculating the intersection over union (IoU) between overlapping prediction boxes, and merging the prediction boxes with IoU greater than the preset threshold; Outputting the final house target detection results according to the coordinates, confidence levels, and categories of the merged prediction boxes.
6. The method for detecting houses along the river and lake banks in UAV aerial images based on YOLO V8 according to claim 5, wherein The coordinates of the prediction boxes are represented by the center point coordinates (x, y), width w, and height h of the target.
7. The method for detecting houses along the river and lake banks in UAV aerial images based on YOLO V8 according to claim 1, wherein Generating the house distribution map along the river and lake shores includes: If the house category is a permanent house, storing its bounding box position and category label in the permanent house list; If the house category is a temporary house, storing its bounding box position and category label in the temporary house list; Using a coordinate conversion algorithm to convert the image coordinates of the house bounding box into geographic coordinates; Drawing house marker points on the electronic map and performing category annotation; Overlaying and displaying the permanent houses and temporary houses to generate the house distribution map along the river and lake shores.
8. The method for detecting houses along the river and lake banks in UAV aerial images based on YOLO V8 according to claim 1, wherein This method further includes: Using the test set to test the trained house detection model, and obtaining the precision Precision and recall rate Rcall by using the following formula: Where: TP represents the number of correctly detected houses, FP represents the number of incorrectly detected houses, and FN represents the number of undetected houses; According to the precision and recall rate, obtaining the P-R curve, making the area under the curve be AP, obtaining the AP value corresponding to each type of house and calculating the average value mAP to measure the precision of the house detection model: Where: N represents the total number of categories, and i represents the category number.
9. The system adopted by the method for detecting houses along the river and lake banks in aerial images of drones based on YOLO V8 according to any one of claims 1 to 8, characterized in that, Including: A data acquisition module, used to obtain the aerial images of the river and lake shores captured by the drone, and establish an image dataset containing two types of targets, namely permanent houses and temporary houses; Performing house target annotation on each image and constructing a training set; A model construction module, used to preprocess the images in the training set, and perform convolution operations on the preprocessed images by using a feature extraction unit to obtain multi-scale feature maps; Using a feature fusion unit to perform feature fusion on the multi-scale feature maps to obtain the fused multi-scale feature maps, and using the non-maximum suppression method to merge and screen the overlapping bounding boxes to obtain the house target detection results and complete the training; A result generation module, used to process the aerial images of the river and lake shores captured by the drone by using the trained house detection model to obtain the house target detection results, and generate the house distribution map along the river and lake shores according to the position and category information of the detection results.
10. A computer-readable storage medium, characterized in that, It stores a computer program, and when the computer program is executed, it implements the method for detecting houses along the river and lake shores in the aerial images captured by the drone based on YOLO V8 as described in any one of claims 1 to 8.
Citation Information
Cited By
Ecological protection red ray holographic dynamic monitoring and early warning method and system
CN121414188A