River channel target identification method and device based on improved YOLOv8n model

By adding a small object detection layer, SPD-Conv module and ECA attention mechanism in the YOLOv8n model, the problems of low recognition efficiency and low accuracy in river monitoring are solved, efficient river object recognition is achieved, and identification accuracy is improved , providing technical support for intelligent river management.

CN119007018APending Publication Date: 2024-11-22TIANJIN AGRICULTURE COLLEGE

Patent Information

Application Number
CN202411471477.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

In the prior art, in river monitoring, video and picture data processing efficiency is low and the recognition accuracy is not high, which can easily lead to missed detection and missed detection, especially the lack of recognition ability for small targets and the early warning mechanism is lagging.

Method used

Based on the improved YOLOv8n model, a small object detection layer is added, a SPD-Conv module is introduced to reduce the loss of detailed information, and an ECA attention mechanism is added to reduce noise and unnecessary information in the feature map, and improve the ability to identify river targets.

Benefits of technology

Accurate identification of river channel targets has been achieved, the average accuracy average mAP50 to 95.7% has been improved, missed and missed detection has been reduced, and more efficient technical support for intelligent river management has been provided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119007018A_ABST
    Figure CN119007018A_ABST
Patent Text Reader

Abstract

The invention discloses a river channel target identification method and device based on an improved YOLOv8n model, and belongs to the technical field of target identification, and the method comprises the steps: S1, constructing a river channel environment data set: collecting pictures related to the surrounding environment information of a river channel; marking the pictures to obtain a river environment data set; s2, a river channel target recognition network of improved YOLOv8n is built on the YOLOv8n basic model, the river channel target recognition network comprises a small target detection layer, an SPD-Conv space depth conversion convolution module and an ECA attention mechanism, and an improved YOLOv8n model is obtained; s3, the river channel environment data set is imported into the improved YOLOv8n model for training, verification and testing, and an improved YOLOv8n river channel target recognition model is obtained; and S4, utilizing the YOLOv8n river channel target identification model to carry out river channel target identification on a target picture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of target recognition, and in particular relates to a river target recognition method and device based on an improved YOLOv8n model. Background Art

[0002] In terms of information management of rivers and lakes, fixed monitoring equipment on the shore and drone monitoring have become routine inspection methods; however, when processing large amounts of video and image data, how to quickly and accurately identify target images such as buildings, floating objects on the water, and vehicles in the monitoring images is still a difficult problem that needs to be solved. At present, the efficiency of this process is not high, and the early warning mechanism also lags behind. Moreover, most of the existing technologies are based on the YOLOv5 algorithm, and its recognition accuracy is not ideal, which can easily lead to missed detections and false detections. Summary of the invention

[0003] The purpose of the present invention is to meet the actual needs and provide a river target recognition method and device based on the improved YOLOv8n model. First, a small target detection layer is added to improve the detection ability of small targets. Secondly, the SPD-Conv module is introduced to reduce the loss of detail information. Finally, the (Efficient Channel Attention, ECA) ECA attention mechanism is added to reduce the noise and unnecessary information in the feature map. The improved YOLOv8n model can accurately identify river targets and provide technical support for the intelligent management of rivers.

[0004] To achieve the above-mentioned object of the invention, the first object of the present invention is to provide a river target recognition method based on an improved YOLOv8n model, comprising the following steps: S1. Constructing a river environment dataset, including: collecting pictures related to the environment information around the river; annotating the pictures to obtain a river environment dataset; S2. Building an improved YOLOv8n river target recognition network on the YOLOv8n basic model, wherein the river target recognition network includes a small target detection layer, an SPD-Conv module, and an ECA attention mechanism, to obtain an improved YOLOv8n model; S3, importing the river environment dataset into the improved YOLOv8n model for training, verification and testing to obtain an improved YOLOv8n river target recognition model; S4. Use the YOLOv8n river target recognition model to perform river target recognition on the target image.

[0005] Furthermore, S1 specifically includes: S101. Collect pictures related to the river environment by photographing and / or collecting them online; S102, labeling the images using the LabelImg tool to form a preliminary data set; S103, expanding the constructed preliminary data set; S104, dividing the expanded data set into a training set, a validation set and a test set.

[0006] Furthermore, S3 includes: Input the training set into the improved YOLOv8n model for training, iterating multiple times until convergence; The test set is input into the improved YOLOv8n model for testing, using precision P, recall R, and average precision mAP 50 、mAP 50-95 , harmonic mean F1 is used as the evaluation index.

[0007] Furthermore, it also includes: S5. Under the same experimental environment, the YOLOv8n river target recognition model is compared and analyzed with YOLOv3-tiny, YOLOv5s, YOLOv7-tiny, YOLOv8n, and YOLOv10n.

[0008] Furthermore, the small target detection layer includes a 160×160 detection head. Furthermore, the SPD-Conv module consists of two parts: SPD and non-stride convolution. First, the feature map is converted from space to depth. The conversion is performed by slicing according to the set scale size. After obtaining several small feature maps, channel splicing is performed. The spatial dimension of the converted feature map is reduced, but the depth dimension is increased. Then, a convolution operation with a step size of 1 is performed to obtain the final feature map.

[0009] Furthermore, the ECA attention mechanism converts the fully connected layer of SE into a 1×1 convolution to learn channel attention information.

[0010] The second object of the present invention is to provide a river target recognition device based on an improved YOLOv8n model, comprising: The river environment data set construction module includes: collecting pictures related to the river environment information; annotating the pictures to obtain the river environment data set; A model improvement module is used to build an improved YOLOv8n river target recognition network based on the YOLOv8n basic model. The river target recognition network includes a small target detection layer, an SPD-Conv module, and an ECA attention mechanism to obtain an improved YOLOv8n model. A model training module, which imports the river environment dataset into the improved YOLOv8n model for training, verification and testing to obtain an improved YOLOv8n river target recognition model; The target recognition module uses the YOLOv8n river target recognition model to perform river target recognition on the target image.

[0011] The third object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-mentioned river target recognition method based on the improved YOLOv8n model.

[0012] The fourth object of the present invention is to provide a computer program product, including a computer program, which, when executed by a processor, implements the above-mentioned river target recognition method based on the improved YOLOv8n model.

[0013] The advantages and positive effects of this application are: This paper will identify river environment targets based on the improved YOLOv8n model, and the average precision mAP of the recognition is 50 Finally, it reached 95.7%, which can accurately identify river targets and reduce the occurrence of missed detection and false detection. First, a small target detection layer was added to improve the detection ability of small targets. Secondly, the SPD-Conv module was introduced to reduce the loss of detail information. Finally, the Efficient Channel Attention (ECA) ECA attention mechanism was added to reduce noise and unnecessary information in the feature map. The improved YOLOv8n model can accurately identify river targets and provide technical support for smart river management. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Figure 1 A flow chart provided by a preferred embodiment of the present invention is shown; Figure 2 The structure diagram of the improved YOLOv8n model in the preferred embodiment of the present invention is shown; Figure 3 The structure diagram of the SPD-Conv module in the preferred embodiment of the present invention is shown; Figure 4 The structure diagram of the ECA module in the preferred embodiment of the present invention is shown. DETAILED DESCRIPTION

[0015] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0016] See also Figures 1 to 4 ; The first embodiment is a river target recognition method based on an improved YOLOv8n model, which mainly includes: S1. Constructing a river environment dataset, including: collecting pictures related to the river environment information; annotating the pictures to obtain a river environment dataset; specifically: First, we collected pictures of the river environment, removed blurry photos, compressed the pictures, and annotated them with the LabelImg tool to form a preliminary data set. Secondly, we expanded the preliminary data set, for example, we first used image sharpening to enhance the image, and then mixed the original picture with the sharpened enhanced image to achieve data expansion. The number of expanded pictures met the requirements, for example, 11,795 pictures, and the expanded data set was divided into 7:2:1, resulting in 8,256 training sets, 2,359 validation sets, and 1,180 test sets. Finally, we formed the river environment data set.

[0017] Furthermore, the dataset consists of two parts. One part is completed by surveying and patrolling on the first-level and second-level rivers, and the other part is supplemented by online search and public datasets. The public dataset uses the inland floating garbage dataset FloW-Img. Finally, the river environment dataset is composed of five categories: floating objects on the river surface, engineering vehicles, bank slope garbage, greenhouses and houses within the river management scope. Among them, floating objects on the river surface include bottles, packaging bags, branches, plant leaves, and other garbage. The specific classification information is shown in Table 1 below.

[0018] Table 1 shows the attributes and annotation quantity of different categories.

[0019] The river target recognition model can be used to identify targets such as greenhouses, houses, floating objects on the river surface, garbage, and construction vehicles within the river management area.

[0020] S2. Building an improved YOLOv8n river target recognition network on the YOLOv8n basic model, wherein the river target recognition network includes a small target detection layer, an SPD-Conv module, and an ECA attention mechanism, to obtain an improved YOLOv8n model; The improved YOLOv8n model is divided into three parts: Backbone, Neck, and Head. Backbone is responsible for extracting features from the input image, Neck performs feature fusion and enhancement, and Head produces the final detection results. A small target detection layer is added to the basic model to solve the problem of difficulty in identifying small targets in the river. The SPD-Conv module is introduced to reduce the loss of detail information and enhance the extraction of river targets. At the same time, the ECA attention mechanism is added to some C2f to make the model pay more attention to river targets and improve model performance. The improved model structure is as follows: Figure 2 As shown; (1) Small Target Detection Layer The YOLOv8n basic model has three detection heads (Detect), with sizes of 80×80, 40×40, and 20×20 respectively. The smallest size can only detect pixels of 8×8. Therefore, when the target size is smaller than 8×8, it is difficult for the model to detect it. In order to solve the problem of small targets being difficult to identify in river environment targets, this embodiment adds a 160×160 detection head to the basic model to improve the recognition ability of small targets in the river environment. Compared with the basic model, adding a small target detection layer has better detection effects, P, R, and mAP. 50 、mAP 50-95 They increased by 0.3%, 0.8%, 0.7%, 1.3% and 1% respectively.

[0021] (2) SPD-Conv module There are a large number of small targets in the river environment. When there are a large number of small targets, the convolution operation with a stride of 2 will lose some detail information, resulting in the loss of some subtle features, which is not conducive to the detection of small targets. Therefore, the SPD-Conv module is used to replace some convolutions with a stride of 2 to solve the problem of information loss. The SPD-Conv module consists of two parts, namely SPD and non-stride convolution. First, the feature map is converted from space to depth. The conversion is mainly performed by slicing according to the set scale size. After obtaining several small feature maps, channel splicing is performed. Therefore, the spatial dimension of the converted feature map is reduced, but the depth dimension is increased. Then a convolution operation with a stride of 1 is performed to obtain the final feature map. The SPD-Conv module combines space-to-depth conversion and convolution to reduce feature loss and improve model performance. SPD-Conv module such as Figure 3 shown.

[0022] The feature map X with an input size of S×S×C1 is converted from space to depth according to the slicing operation, and the size of the obtained feature map X1 becomes (S / 2)×(S / 2)×(4C1). The feature map X1 is then converted into a feature map X2 with a size of (2 / S)×(2 / S)×C2 through a convolution operation, where S represents the height and width, and C1 and C2 represent the number of channels.

[0023] The SPD-Conv module is introduced to replace some of the convolutions with a step size of 2 in the original model, reducing the loss of detail information and enhancing the extraction of river environment targets. The SPD-Conv module is added on the basis of adding a small target detection layer, and the mAP 50 It reaches 95.6%, which is 1.5% higher than the original model.

[0024] (3) ECA Attention Mechanism The ECA attention mechanism can improve the model's ability to identify and utilize important information, reduce the processing of irrelevant information, and help the model achieve better performance in various tasks. In the river environment, the background of targets such as surface garbage is relatively complex and the targets are relatively small. Therefore, it is very important to reduce the attention to irrelevant information and emphasize key information. ECA converts the fully connected layer of SE (Squeeze-and-Excitation) into a 1×1 convolution to learn channel attention information, and makes improvements on it, which greatly reduces the amount of calculation. The present invention adds the ECA attention mechanism to some C2f modules. The ECA module is as follows Figure 4 shown.

[0025] After feature extraction, a feature map is obtained from the input data X After that, we first perform global average pooling. H × W × C Feature map of size X Convert to 1×1× C The size of the feature, and then through the one-dimensional convolution and Sigmoid The function obtains the weight of each channel and converts the feature map X The features of each channel in are multiplied by the obtained weights to obtain the final feature map X’ .

[0026] The addition of the ECA attention mechanism enables the model to focus more on key information, which can further improve the recognition ability of river environment targets. On the basis of adding the small target detection layer and SPD-Conv module, the ECA attention mechanism is added, and the final P, R, and mAP 50 It reached 96.3%, 91.9%, and 95.7%, which were 1%, 2.5%, and 1.6% higher than the original model respectively.

[0027] S3, importing the river environment dataset into the improved YOLOv8n model for training, verification and testing to obtain an improved YOLOv8n river target recognition model; specifically including: Input the training set into the improved YOLOv8n model for training, iterating multiple times (e.g., 500 times) until convergence; The test set is input into the improved YOLOv8n model for testing, using precision P, recall R, and average precision mAP 50 、mAP 50-95 , harmonic mean F1 is used as the evaluation index.

[0028] Precision P, recall R, average precision mAP 50 、mAP 50-95 , the harmonic mean F1 evaluation index formula is as follows: (1) (2) (3) (4) (5) In the formula, P represents precision, which is the proportion of instances predicted by the model as positive samples that are actually positive samples; R represents recall, which is the proportion of all instances that are actually positive samples that are correctly predicted by the model as positive samples; AP is single-category precision, which represents the area enclosed by the smoothed precision curve and the recall curve; mAP represents mean average precision, which is obtained by calculating the average precision of each category and taking the average; F1 comprehensively considers P and R, balances the two, and takes a value in the range of 0-1. The closer its value is to 1, the better the performance of the model; TP represents the number of correctly predicted positive samples; FP represents the number of incorrectly predicted positive samples; FN represents the number of incorrectly predicted negative samples; N represents the total number of categories; AP i represents the average precision of the i-th category; P(R) represents the precision at a specific recall rate, which is used to indicate the proportion of correct predictions.

[0029] All experiments involved use the river environment dataset, the number of iterations is set to 500, the batch size is set to 32, the SGD optimizer is used, the initial learning rate lr0 is set to 0.01, lrf is set to 0.01, the momentum parameter momentum is set to 0.937, and the weight decay weight_decay is set to 0.0005.

[0030] S4. Use the YOLOv8n river target recognition model to perform river target recognition on the target image.

[0031] S5. Under the same experimental environment, the YOLOv8n river target recognition model is compared and analyzed with YOLOv3-tiny, YOLOv5s, YOLOv7-tiny, YOLOv8n, and YOLOv10n.

[0032] All experiments in the present invention do not use pre-trained weights. The relevant configuration information of the experimental environment used is shown in Table 2.

[0033] Table 2 shows the configuration information of the experimental environment.

[0034] This paper uses YOLOv8n as the basic model and improves it. It adds a small target detection layer in the neck, introduces 6 SPD-Conv modules in the whole network to replace some convolutions with a step length of 2 in the original model, and adds an ECA attention mechanism to the last 4 C2f modules in the network. It is trained and tested on the river environment dataset, and the model performance is measured using evaluation indicators such as precision. The improved model has high precision, recall, and mAP. 50 The results of the experiment show that the improved model pays more attention to many small targets that are difficult to identify, thus improving the recognition accuracy and model performance. The improved algorithm can provide technical support for the intelligent management of rivers.

[0035] In order to verify that the detection effect of the YOLOv8n model is higher than that of other models and that the improved YOLOv8n model has a certain improvement in the recognition effect of river environment targets, under the same experimental conditions, the improved algorithm is compared with YOLOv3-tiny, YOLOv5s, YOLOv7-tiny, YOLOv8n, and YOLOv10n in 6 groups of experiments on 1180 images in the test set. The comparison results are shown in Table 3 below.

[0036] Table 3 shows the comparison of different models on the river target test set

[0037] As shown in Table 3, mAP 50 Represents the mAP obtained under the condition of IOU 0.5; mAP 50-95 Represents the average mAP obtained when the IOU threshold ranges from 0.5 to 0.95 with a step size of 0.05. YOLOv8n has the following advantages in P, R, and mAP: 50 YOLOv10n and YOLOv8n are the highest in R and mAP. 50-95 The detection results on , F1 are the same, both higher than other models, but YOLOv8's P, mAP 50It is 0.4% and 0.4% higher than YOLOv10n. Therefore, YOLOv8n is selected as the basic model for improvement. The improved model has higher P, R, and mAP. 50 、mAP 50-95 and F1 are the highest, which are 1%, 2.5%, 1.6%, 2.7% and 2% higher than the original model respectively.

[0038] In order to verify that various improved methods based on the YOLOv8n model have a certain improvement on the recognition effect of river environment, 5 groups of ablation experiments were set up. The first group is the original model, the second group adds a small target detection layer (Small) to the first group of experiments, the third group adds the SPD-Conv module on the basis of the second group, the fourth group adds the ECA attention mechanism on the basis of the second group, and the fifth group is the algorithm of the present invention, adding all three at the same time. The comparison results are shown in Table 4.

[0039] Table 4 shows the detection effect of different improved methods applied to the YOLOv8n model

[0040] The details of Table 4 are as follows: (1) Using the first set of experiments as a reference makes it easier to compare and verify the performance improvement of the improved model.

[0041] (2) In order to verify the effectiveness of adding the small object detection layer, the second group of experiments was compared with the first group. The results showed that P, R, and mAP 50 、mAP 50-95 , F1 increased by 0.3%, 0.8%, 0.7%, 1.3%, and 1% respectively. This is because there are many small targets in the river environment dataset, and many surface garbage has a small size and fewer pixels, which makes it easy to lose detailed information during the detection process. By adding a small target detection layer, the model can better capture the detailed features of small targets and improve detection accuracy.

[0042] (3) Compared with the second group of experiments, the third group of experiments showed a significant difference in P, R, and mAP. 50 、mAP 50-95 , F1 are improved by 0.6%, 1.4%, 0.8%, 1.4%, and 1% respectively, because SPD-Conv is a spatial deep convolution structure, which can more effectively capture the spatial relationships and features in the image than the traditional deep convolution, and helps the model to more accurately locate and identify targets in complex backgrounds.

[0043] (4) Compared with the second group of experiments, although P decreased by 0.4%, R and mAP 50 、mAP 50-95The improvements of 1.1%, 0.4%, and 0.6% respectively are because the ECA attention mechanism helps to reduce the noise and unnecessary information in the feature map, making the model more robust. This shows that the addition of the ECA attention mechanism enables the model to focus more on key information and can further improve the recognition ability of river environment targets.

[0044] (5) Compare the improved four groups of experiments with the original model, mAP 50 、mAP 50-95 Compared with the original model, the final improved model P, R, and mAP 50 、mAP 50-95 , F1 increased by 1%, 2.5%, 1.6%, 2.7% and 2% respectively.

[0045] After adding the small object detection layer and SPD-Conv module, in order to verify that the ECA attention mechanism performs best on the data set and is effective in improving accuracy, the ECA attention mechanism is compared with other attention mechanisms. The comparison results are shown in Table 5 below.

[0046] Table 5 shows the comparative experiment of attention mechanism

[0047] As can be seen from Table 5, adding the attention mechanism has a significant effect on mAP 50 It has an improvement effect. Because the attention mechanism can dynamically adjust the importance weights of each channel according to the relationship between feature channels, the model can focus more on the feature channels that are particularly important for the target detection task, more accurately capture and express the semantic information of the target, and effectively improve the accuracy of target detection. On the basis of adding a small target detection layer, four attention mechanisms are added respectively. Among them, SimAM and GAM both perform 0.963 on P, ECA performs best on R at 0.913, and SimAM and ECA perform best on mAP 50 The performance of GAM is 0.952. 50-95 The best performance is 0.838. In order to further test the effect of adding the ECA attention mechanism, ECA is compared with other attention mechanisms based on the addition of the small target detection layer and SPD-Conv. The results show that the model with ECA is better than SEAM, GAM, and SimAm. 50 They increased by 0.1%, 0.3%, and 0.3% respectively, eventually reaching 95.7%.

[0048] In order to verify that the improved model has a certain improvement in the recognition effect of river environment, the improved model is compared and analyzed with the basic model YOLOv8n. The results are shown in Table 6 below.

[0049] Table 6 Comparison of the results of the present invention and YOLOv8n model

[0050] It can be seen from Table 6 that the mAP of the model before improvement for engineering vehicle recognition is 50 Reaching 99.5%, mAP for greenhouse recognition 50 Reaching 88.6%, mAP for house recognition 50 Reaching 87.3%, mAP for garbage recognition 50 Reached 99.5%. The mAP of the improved model for engineering vehicles and garbage recognition 50 Remains the same, but the mAP for greenhouse recognition 50 Reaching 90.7%, mAP for house recognition 50 The mAP of the improved model for five types of floating objects on the river surface reached 89.9%, which was increased by 2.1% and 2.6% respectively. 50 The mAP of bottles, packaging bags, branches, plant leaves, and other garbage has been improved. 50 The improvements are 5.9%, 0.2%, 1.3%, 0.6% and 2% respectively. This further proves that the improvement of the model can improve the recognition effect of small targets.

[0051] This paper uses the small target detection layer, SPD-Conv module, and ECA attention mechanism to improve the YOLOv8n model. The improved model has higher precision, recall, and mAP. 50 The accuracy rates reached 96.3%, 91.9%, and 95.7%, respectively, which were 1%, 2.5%, and 1.6% higher than the original model. The average accuracy of the improved model was increased by 5.5%, 2.2%, 2.9%, and 2% respectively compared with YOLOv3-tiny, YOLOv5n, YOLOv7-tiny, and YOLOv10n. The improved algorithm can provide technical support for smart river management.

[0052] The second embodiment is a river target recognition device based on an improved YOLOv8n model, which is used to implement the method of the first embodiment, including: The river environment data set construction module includes: collecting pictures related to the river environment information; annotating the pictures to obtain the river environment data set; A model improvement module is used to build an improved YOLOv8n river target recognition network based on the YOLOv8n basic model. The river target recognition network includes a small target detection layer, an SPD-Conv module, and an ECA attention mechanism to obtain an improved YOLOv8n model. A model training module, which imports the river environment dataset into the improved YOLOv8n model for training, verification and testing to obtain an improved YOLOv8n river target recognition model; The target recognition module uses the YOLOv8n river target recognition model to perform river target recognition on the target image.

[0053] A third embodiment is a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-mentioned river target recognition method based on the improved YOLOv8n model.

[0054] A fourth embodiment, a computer program product, includes a computer program, which, when executed by a processor, implements the above-mentioned river target recognition method based on the improved YOLOv8n model.

[0055] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When the use is implemented in whole or in part in the form of a computer program product, the computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL) or wireless (e.g., infrared, wireless, microwave, etc.) mode) to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk SolidState Disk (SSD)), etc.

[0056] The above is only a preferred embodiment of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A river target recognition method based on an improved YOLOv8n model, characterized in that: include: S1. Constructing a river environment dataset, including: collecting pictures related to the environment information around the river; annotating the pictures to obtain a river environment dataset; S2. Building an improved YOLOv8n river target recognition network on the YOLOv8n basic model, wherein the river target recognition network includes a small target detection layer, an SPD-Conv module, and an ECA attention mechanism, to obtain an improved YOLOv8n model; S3, importing the river environment dataset into the improved YOLOv8n model for training, verification and testing to obtain an improved YOLOv8n river target recognition model; S4. Use the YOLOv8n river target recognition model to perform river target recognition on the target image.

2. The river target recognition method based on the improved YOLOv8n model according to claim 1 is characterized in that: S1 specifically includes: S101. Collect pictures related to the river environment by photographing and / or collecting them online; S102, labeling the images using the LabelImg tool to form a preliminary data set; S103, expanding the constructed preliminary data set; S104, dividing the expanded data set into a training set, a validation set and a test set.

3. The river target recognition method based on the improved YOLOv8n model according to claim 2 is characterized in that: S3 includes: Input the training set into the improved YOLOv8n model for training, iterating multiple times until convergence; The test set is input into the improved YOLOv8n model for testing, using precision P, recall R, and average precision mAP 50 、mAP 50-95 , harmonic mean F1 is used as the evaluation index.

4. The river target recognition method based on the improved YOLOv8n model according to claim 1 is characterized in that: Also includes: S5. Under the same experimental environment, the YOLOv8n river target recognition model is compared and analyzed with YOLOv3-tiny, YOLOv5s, YOLOv7-tiny, YOLOv8n, and YOLOv10n.

5. The river target recognition method based on the improved YOLOv8n model according to claim 1 is characterized in that: The small target detection layer includes a 160×160 detection head.

6. The river target recognition method based on the improved YOLOv8n model according to claim 1 is characterized in that: The SPD-Conv module consists of two parts: SPD and non-stride convolution. First, the feature map is converted from space to depth. The conversion is performed by slicing according to the set scale size. After obtaining several small feature maps, channel splicing is performed. The spatial dimension of the converted feature map is reduced, but the depth dimension is increased. Then a convolution operation with a step size of 1 is performed to obtain the final feature map.

7. The river target recognition method based on the improved YOLOv8n model according to claim 1 is characterized in that: The ECA attention mechanism converts the fully connected layer of SE into 1×1 convolution to learn channel attention information.

8. A river target recognition device based on an improved YOLOv8n model, characterized in that: include: The river environment data set construction module includes: collecting pictures related to the river environment information; annotating the pictures to obtain the river environment data set; A model improvement module is used to build an improved YOLOv8n river target recognition network based on the YOLOv8n basic model. The river target recognition network includes a small target detection layer, an SPD-Conv module, and an ECA attention mechanism to obtain an improved YOLOv8n model. A model training module, which imports the river environment dataset into the improved YOLOv8n model for training, verification and testing to obtain an improved YOLOv8n river target recognition model; The target recognition module uses the YOLOv8n river target recognition model to perform river target recognition on the target image.

9. A computer-readable storage medium storing a computer program, which, when executed by a processor, implements the river target recognition method based on the improved YOLOv8n model as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Unmanned aerial vehicle aerial image river floating object detection method based on improved YOLOv5

    CN115115934A

  • Lightweight pomegranate identification method based on improved YOLOv8s

    CN116958961A

  • Improved YOLOv8n-based garbage identification method for trash rack of hydraulic power plant

    CN118155135A

  • Small target detection method and device and terminal equipment

    CN118397253A

  • Billiard recognition method based on deep learning

    CN118397401A

Cited By

  • Intelligent sea surface ship detection method based on radar RD image under passive jamming condition

    CN119337188A