A target detection method and system based on YOLOv9

By optimizing the structure of the YOLOv9 model, especially by adding an attention mechanism and depthwise separable convolution, the problems of high computational resources and insensitivity to small object detection were solved, resulting in more efficient object detection performance.

CN120070870BActive Publication Date: 2026-05-29DONGGUAN CITY COLLEGE

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DONGGUAN CITY COLLEGE
Filing Date
2025-03-10
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

The YOLOv9 model has high computational resource requirements and is not sensitive enough for small target detection, resulting in high hardware configuration requirements and unsatisfactory detection results.

Method used

By optimizing the structure of the YOLOv9 model, adding an attention mechanism and depthwise separable convolution, the feature extraction and fusion process is optimized, reducing computational resource requirements and improving the accuracy of small object detection.

Benefits of technology

While reducing computing resources, it improved the accuracy and efficiency of small target detection, reduced the number of parameters by 9.97%, increased inference speed by 6.29%, and improved mAP50 and mAP50-95 by 0.62% and 0.91%, respectively.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120070870B_ABST
    Figure CN120070870B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of image processing, in particular to a target detection method and system based on YOLOv9. The YOLOv9 model is improved, in particular, the convolution structure design optimization in the feature extraction process and the increase of the attention module in the feature fusion process can reduce the calculation resources in the model processing process, and the high requirement of the existing model for hardware configuration and the sensitivity to small target recognition are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, specifically to a target detection method and system based on YOLOv9. Background Technology

[0002] YOLOv9 is the latest version of the YOLO (You Only Look Once) series, and it represents a significant advancement in object detection. (See also...) Figure 1 The standard structure for the released YOLOv9 model was introduced, incorporating Programmable Gradient Information (PGI) and Generalized Efficient Layer Aggregation Network (GELAN). These two technologies mark a significant advancement in the field of real-time object detection. PGI addresses the information loss problem in deep networks by generating reliable gradients through auxiliary invertible branches, while GELAN optimizes parameter utilization and computational efficiency, enabling YOLOv9 to adapt to various computing environments.

[0003] Although YOLOv9 has made significant progress in object detection, it still has some shortcomings and limitations. Figure 1 It is known that the YOLOv9 network structure is relatively complex. As a large model, it requires a significant amount of computing resources (such as GPU memory and processors) for inference, which may be unfriendly to devices with limited resources. Furthermore, while the large model performs well in general object detection, it is not sensitive enough for detecting smaller targets, resulting in less than ideal detection performance. Summary of the Invention

[0004] To address the technical problems described in the background, this application provides a target detection method and system based on YOLOv9. By making structural changes to the existing YOLOv9 and adding multiple different modules, YOLOv9 can achieve high accuracy in target detection, especially for small targets, with relatively few computing resources.

[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:

[0006] Firstly, a YOLOv9-based object detection method is provided. The method includes: extracting features from an image to be detected using a feature extraction network to obtain multi-scale features of the image; fusing the multi-scale features to obtain a feature map; the feature extraction network includes multiple feature extraction modules, which extract features from the image to be detected at different scales and output feature maps at different scales; the multiple feature maps at different scales are then processed by a downsampling module to obtain broader contextual information; each feature extraction module includes a 1*1 convolutional layer and two feature extraction sub-modules, which receive two feature maps output by the 1*1 convolutional layer; the feature maps are then processed by a feature fusion network for attention fusion, and fused features are obtained through cross-stage connections; the fused features are processed by a detection head to obtain predicted probability values ​​for each category, and the highest probability value among the predicted probability values ​​is selected as the prediction result, which is then displayed as bounding box coordinates in the image to be detected.

[0007] Furthermore, the method also includes resizing the image to be detected, specifically including: adjusting the pixel size of the image to be detected to the target size through affine transformation, and adjusting the resolution of the adjusted image to be detected until it meets the resolution requirements of the feature extraction module.

[0008] Furthermore, the feature extraction network also includes multiple convolutional layers, and the initial feature map after feature extraction through each convolutional layer enters the corresponding feature extraction submodule.

[0009] Furthermore, the feature extraction module receives the feature map processed by the convolutional layer and passes it through a 1*1 convolutional layer to convert the number of input channels from c1 to c3; the feature output by the 1*1 convolutional layer is divided into a first feature map and a second feature map, and the number of channels corresponding to each feature map is c3 / 2; the first feature map and the second feature map are respectively input to two feature extraction sub-modules.

[0010] Furthermore, the feature extraction module also includes a 1*1 convolutional layer connected to the output of the feature extraction submodule.

[0011] Furthermore, the feature extraction submodule includes a first depthwise separable convolution and a second depthwise separable convolution. The first depthwise separable convolution is used to extract features, and the second depthwise separable convolution is used to merge the extracted features with the features extracted by the first depthwise separable convolution in the channel dimension. The merged features are then passed through a 1*1 convolutional layer connected to the output of the feature extraction submodule to transform the number of channels from c3+2*c4 to the number of output channels c2.

[0012] Furthermore, the feature fusion network includes a pooling module, an attention module, and a fusion module; the pooling module is used to divide the feature map into multiple grids of different sizes and perform max pooling operation on each grid to extract features at different scales; the attention module is configured with an attention mechanism to update features at different scales based on attention weights to obtain updated features; the fusion module is used to connect features at different scales and fuse them through convolutional layers to obtain fused features.

[0013] Furthermore, the attention module is a multi-scale channel attention module.

[0014] Secondly, a target detection system based on YOLOv9 is provided. The system includes: an image acquisition end for acquiring an image to be detected within a target area; an image processing device for performing target detection on the image to be detected, obtaining at least one classification result, and displaying bounding box coordinates in the image to be detected; and a result display end for displaying the image to be detected and the bounding box coordinates on the image to be detected.

[0015] Furthermore, the image processing device includes: a feature extraction module, used to extract features from the resized image to be detected through a feature extraction network to obtain multi-scale features of the image to be detected, and to fuse the multi-scale features to obtain a feature map; a feature fusion module, used to perform attention fusion on the feature map through a feature fusion network, and to obtain fused features through cross-stage connections; and a classification module, used to obtain the predicted probability value corresponding to each category, select the highest probability value among the predicted probability values ​​as the prediction result, and display the bounding box coordinates in the image to be detected.

[0016] In the technical solution provided in this application embodiment, by improving the YOLOv9 model, especially by optimizing the convolutional structure design in the feature extraction process and adding an attention module in the feature fusion process, the computational resources in the model processing process can be reduced, which can solve the high hardware configuration requirements of the existing model and improve the sensitivity to small target recognition. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] The methods, systems, and / or procedures shown in the accompanying drawings will be further described with reference to exemplary embodiments. These exemplary embodiments will be described in detail with reference to the drawings. These exemplary embodiments are non-limiting exemplary embodiments, wherein example figures represent similar mechanisms in the various views of the drawings.

[0019] Figure 1 This is a schematic diagram of the YOLOv9 model structure in the existing technology.

[0020] Figure 2 This is a schematic diagram of a target detection method provided in one embodiment of this application.

[0021] Figure 3 This is a schematic diagram of the feature extraction module structure provided in an embodiment of this application.

[0022] Figure 4 This is a schematic diagram of the feature extraction submodule structure provided in an embodiment of this application.

[0023] Figure 5 This is a schematic diagram of the modular structure of the feature fusion network provided in the embodiments of this application.

[0024] Figure 6 This is a schematic diagram of a target detection method provided in another embodiment of this application.

[0025] Figure 7 This is a schematic diagram of the target detection system structure provided in the embodiments of this application.

[0026] Figure 8 This is a schematic diagram of the terminal device structure provided in the embodiments of this application. Detailed Implementation

[0027] To better understand the above technical solutions, the technical solutions of this application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of this application and the specific features in the embodiments are detailed descriptions of the technical solutions of this application, rather than limitations on the technical solutions of this application. In the absence of conflict, the embodiments of this application and the technical features in the embodiments can be combined with each other.

[0028] In the detailed description below, numerous specific details are illustrated with examples to provide a comprehensive understanding of the relevant guidance. However, it will be apparent to those skilled in the art that this application can be practiced without these details. In other instances, well-known methods, procedures, systems, components, and / or circuits have been described at a relatively high level without detail to avoid unnecessarily obscuring aspects of this application.

[0029] This application uses flowcharts to illustrate the execution process performed by a system according to embodiments of this application. It should be clearly understood that the execution processes in the flowcharts may not be executed sequentially. Instead, these execution processes may be executed in reverse order or simultaneously. Additionally, at least one other execution process may be added to the flowchart. One or more execution processes may be deleted from the flowchart.

[0030] Before providing a further detailed description of the embodiments of the present invention, the nouns and terms involved in the embodiments of the present invention will be explained, and the nouns and terms involved in the embodiments of the present invention shall be interpreted as follows.

[0031] (1) In response to, used to indicate the conditions or states on which the operation is performed depends. When the conditions or states on which the operation is performed are met, one or more operations may be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations are performed.

[0032] (2) Based on, used to indicate the conditions or states on which the operation is performed depends. When the conditions or states on which it depends are met, one or more operations can be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order of execution of the multiple operations.

[0033] This application provides an object detection method implemented using an artificial intelligence model. The model employs the YOLO series, specifically the newly released YOLOv9 model. YOLOv9 not only excels in object detection but can also be applied to various computer vision tasks such as instance segmentation and panoptic segmentation. Its versatility makes it an ideal choice for various practical applications, such as autonomous driving, video surveillance, and robot vision. This model incorporates Programmable Gradient Information (PGI) and Generalized Efficient Layer Aggregation Network (GELAN). PGI generates reliable gradients through auxiliary invertible branches, addressing the information loss problem in deep networks, while GELAN optimizes parameter utilization and computational efficiency, enabling YOLOv9 to adapt to various computing environments.

[0034] However, the YOLOv9 model is currently the most complex model in the YOLO family, with the most components. Generally, the more complex the AI ​​model structure, the higher the computational cost, especially the GPU requirements. This means that to achieve optimal performance, the YOLOv9 model requires a high-performance training and runtime environment. Furthermore, large models do not excel in detecting small objects, making them prone to missed or false detections.

[0035] Therefore, in order to reduce the computational resource requirements of the YOLOv9 model and improve its detection accuracy for small targets, this application optimizes the YOLOv9 model and provides a target detection method based on the optimized YOLOv9 model.

[0036] Specifically, in order to reduce the demand for computing resources, this embodiment adds an attention mechanism to enrich the expression of features by combining contextual information while retaining the original architecture of the model. This saves on the original computing costs and ensures the integrity and richness of the model in feature extraction and feature fusion. Furthermore, the convolutional blocks are optimized while retaining the original architecture. Depthwise separable convolutions are added on top of some convolutions, which improves the expression of features in the channels.

[0037] In this embodiment, refer to Figure 2 A target detection method utilizing an optimized YOLOv9 model is provided, comprising the following steps:

[0038] Step S21. Extract features from the image to be detected through a feature extraction network to obtain multi-scale features of the image to be detected, and fuse the multi-scale features to obtain a feature map.

[0039] The optimized model provided in this embodiment mainly includes three structural sub-networks: a feature extraction network, a feature fusion network, and a detection head. The configuration of these three networks is the same in all YOLO series models. The difference lies in the fact that different specific models have different modules in the above three sub-networks, and different components are configured in different modules.

[0040] The feature extraction network is primarily used to extract features from the image to be detected, obtaining multi-scale features about the image. The feature extraction network contains multiple feature extraction modules and corresponding convolutional layers, with each convolutional layer corresponding to a feature extraction module. Feature images not yet processed by the feature extraction modules are called initial feature maps. Each initial feature map is then processed by the convolutional layers to extract features. Each feature extraction module performs feature extraction at different scales on the image to be detected, outputting feature maps of different scales. These multiple feature maps at different scales are then downsampled to obtain broader contextual information.

[0041] In this embodiment, refer to Figure 3Each feature extraction module includes a 1x1 convolutional layer and two feature extraction sub-modules. The two feature extraction sub-modules are used to receive two feature maps output by the 1x1 convolutional layer. The feature maps processed by the convolutional layer first pass through the 1x1 convolutional layer. The 1x1 convolutional layer is used to transform the number of input channels of the initial feature map from c1 to c3. The feature maps processed by the 1x1 convolutional layer are divided into a first feature map and a second feature map, and the number of channels corresponding to each feature map is c3 / 2.

[0042] The segmented first and second feature maps are input into the corresponding feature extraction submodules. For the structure of the feature extraction submodules in this embodiment, please refer to [link / reference needed]. Figure 4 The feature extraction submodule includes a first depthwise separable convolution and a second depthwise separable convolution. The first depthwise separable convolution extracts features from the received first feature map, and the second depthwise separable convolution extracts features from the received second feature map and merges the features extracted by the first depthwise separable convolution to obtain the merged features. The merged features are then passed through a 1*1 convolutional layer connected to the output of the feature extraction submodule. This convolutional layer is used to convert the number of output channels from c3 + 2*c4 to c2. That is, the features obtained by the first and second feature extraction submodules are concatenated and then converted through a 1*1 convolutional layer to change the number of output channels.

[0043] It is worth noting that the feature extraction module mentioned above is... Figure 1 In the RepNCSPELAN4 module, the feature extraction part is optimized in this embodiment, improving the efficiency and completeness of feature extraction.

[0044] Step S22. The feature map is passed through a feature fusion network for attention fusion, and the fused features are obtained through cross-stage connections.

[0045] Step S21 is mainly used to extract multi-scale features. The extracted multi-scale features need to be fused to obtain fused features, which are the final target detection features.

[0046] In this embodiment, a different method than existing models is used for feature fusion to reduce the model's computational resource requirements. See also... Figure 5 In this embodiment, feature fusion is performed using a feature fusion network, that is, multiple features output in step S21 are fused through the feature fusion network; wherein the feature fusion network includes a pooling module, an attention module and a fusion module.

[0047] Specifically, the pooling module is used to divide the features output in step S21 into multiple networks of different sizes, and to perform max pooling operation on each grid to scale the feature map and retain the main features, thereby achieving feature filtering.

[0048] After filtering, the features are fed into the attention module for weight updates, resulting in updated features. Finally, the updated features are connected by the fusion module and fused through convolutional layers to obtain fused features.

[0049] In this embodiment, a multi-scale channel attention module is used for the attention module, and the pooling module includes a global average pooling sub-module and a global max pooling sub-module. Using different global pooling methods enriches the extracted high-level features. Afterwards, a 2D depthwise separable convolution with a kernel of 1 is used to compress the channels to 1 / 8. Following ReLU activation weighting, another 2D depthwise separable convolution with a kernel of 1 is used to restore the channels. Since 2D depthwise separable convolution can effectively reduce the number of parameters, improve computational efficiency, and maintain strong feature representation capabilities, helping the network better focus on details and local information, this embodiment uses 2D depthwise separable convolution as an extractor of information between channels, focusing on the importance of features in different channels.

[0050] The weights output by the global average pooling branch are added to the weights output by the global max pooling branch, and the feature map is reweighted using the Sigmoid function. Finally, the reweighted weights are multiplied by the original feature map through a broadcasting mechanism and then output.

[0051] In this embodiment, the feature fusion network with the above structure can help improve the sparse representation capability of the model, making the model more robust and resistant to noise, and helping to improve the generalization performance of the model.

[0052] The multi-scale features extracted in step S21 need to be fused to obtain fused features, which are then used for final target detection.

[0053] Step S23. The feature fusion method obtains the predicted probability value corresponding to each category through the detection head, selects the highest probability value among the predicted probability values ​​as the prediction result, and displays the bounding box coordinates in the image to be detected.

[0054] In this embodiment, the detection head can be the existing YOLOv9 detection head. The detection head can output the corresponding predicted probability value, and after filtering, the bounding box coordinates are displayed in the image to be detected.

[0055] In summary, the object detection method proposed in this embodiment improves the YOLOv9 model by optimizing the convolutional structure design during feature extraction and adding an attention module during feature fusion, thereby reducing the computational resources required for model processing. This addresses the high hardware requirements of existing models and improves the sensitivity to small target recognition.

[0056] To further demonstrate the performance of the object detection method in this embodiment for image classification and detection, we also conducted experiments on a dataset. The experimental results show that, compared to the existing YOLOv9 model architecture, the improved model reduces the number of parameters by 9.97%, improves inference speed by 6.29%, and achieves improvements of 0.62% and 0.91% in mAP50 and mAP50-95 metrics, respectively. These improvements demonstrate that, under resource-constrained environments, the attention mechanism and network structure designed in the experiments can not only improve the accuracy of the object detection model but also significantly reduce the number of model parameters and improve computational efficiency.

[0057] See Figure 6 In addition to the methods provided in steps S21-S23, a target detection system 60 is also provided, the system comprising:

[0058] Image acquisition end 61 is used to acquire the image to be detected within the target area.

[0059] Image processing device 62 is used to perform target detection on the image to be detected, obtain at least one classification result, and display the bounding box coordinates in the image to be detected.

[0060] The result display terminal 63 is used to display the image to be detected and the coordinates of the bounding box on the image to be detected.

[0061] See Figure 7 Another implementation method is also provided, in which the model needs to resize the image to be detected before processing, so that the pixel size and resolution of the image input to the feature extraction module meet the model's requirements. Specifically, this method includes the following steps:

[0062] Step S71. Adjust the pixel size of the image to be detected to the target size through affine transformation, and adjust the resolution of the adjusted image to be detected until it meets the resolution requirements of the feature extraction module.

[0063] Step S72. The resized image to be detected is processed by a feature extraction network to extract features, thereby obtaining multi-scale features of the image to be detected, and the multi-scale features are fused to obtain a feature map.

[0064] Step S73. The feature map is passed through a feature fusion network for attention fusion, and the fused features are obtained through cross-stage connections.

[0065] Step S74. The feature fusion method obtains the predicted probability value corresponding to each category through the detection head, selects the highest probability value among the predicted probability values ​​as the prediction result, and displays the bounding box coordinates in the image to be detected.

[0066] See Figure 8 The above methods can also be integrated into the provided terminal device 80. Since the device may vary significantly due to different configurations or performance, it may include one or more processors 801 and memories 802. The memories 802 may store one or more application programs or data. The memories 802 can be temporary or persistent storage. The application programs stored in the memories 802 may include one or more modules (not shown in the figure), each module may include a series of computer-executable instructions from the terminal device. Furthermore, the processor 801 may be configured to communicate with the memories 802, and the terminal device may execute the series of computer-executable instructions stored in the memories 802. The terminal device may also include one or more power supplies 803, one or more wired / wireless network interfaces 804, one or more input / output interfaces 805, one or more keyboards 806, etc.

[0067] In one specific embodiment, the terminal device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for use in the terminal device, and is configured to be executed by one or more processors. The one or more programs include computer-executable instructions for performing the following:

[0068] The image to be detected is processed by a feature extraction network to extract features, resulting in multi-scale features of the image. These multi-scale features are then fused to obtain a feature map.

[0069] The feature maps are passed through a feature fusion network for attention fusion, and the fused features are obtained through cross-stage connections.

[0070] The fusion feature obtains the predicted probability value corresponding to each category through the detection head, selects the highest probability value as the prediction result, and displays the bounding box coordinates in the image to be detected.

[0071] It is also used to execute the following computer-executable instructions:

[0072] The pixel size of the image to be detected is adjusted to the target size by affine transformation, and the resolution of the adjusted image to be detected is adjusted until it meets the resolution requirements of the feature extraction module.

[0073] The resized image to be detected is processed by a feature extraction network to extract features, resulting in multi-scale features of the image to be detected. These multi-scale features are then fused to obtain a feature map.

[0074] The feature maps are passed through a feature fusion network for attention fusion, and the fused features are obtained through cross-stage connections.

[0075] The fusion feature obtains the predicted probability value corresponding to each category through the detection head, selects the highest probability value as the prediction result, and displays the bounding box coordinates in the image to be detected.

[0076] The following is a detailed introduction to each component of the processor:

[0077] In this embodiment, the processor is an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application, such as one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs).

[0078] Optionally, the processor can perform various functions, such as the above-mentioned functions, by running or executing software programs stored in memory and by calling data stored in memory. Figure 2 and / or Figure 7 The method shown.

[0079] In a specific implementation, as one example, the processor may include one or more microprocessors.

[0080] The memory is used to store the software program that executes the solution of this application, and the execution is controlled by the processor. The specific implementation method can be referred to the above method embodiment, which will not be repeated here.

[0081] Optionally, the memory can be read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory can be integrated with the processor or exist independently and coupled to the processing unit through the processor's interface circuitry; this application embodiment does not specifically limit this.

[0082] It should be noted that the processor structure shown in this embodiment does not constitute a limitation on the device. The actual device may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0083] Furthermore, the technical effects of the processor can be referred to the technical effects of the methods described in the above-described method embodiments, and will not be repeated here.

[0084] It should be understood that the processor in the embodiments of this application may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0085] It should also be understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0086] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can 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 sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.

[0087] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0088] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0089] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0090] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0091] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0092] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0093] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0094] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0095] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A target detection method based on YOLOv9, characterized in that, The method includes: The image to be detected is processed by a feature extraction network to extract features, resulting in multi-scale features of the image. These multi-scale features are then fused to obtain a feature map. The feature extraction network includes multiple feature extraction modules, which are used to extract features from the image to be detected at different scales and output feature maps at different scales. These feature maps at different scales are then processed by a downsampling module to obtain broader contextual information. Each feature extraction module includes a 1 One convolutional layer and two feature extraction submodules, the two feature extraction submodules being used to receive the features extracted by the convolutional layer. The convolutional layer outputs two feature maps; the feature extraction network also includes multiple convolutional layers. The initial feature map after feature extraction through each convolutional layer enters the corresponding feature extraction submodule. The feature extraction module receives the feature map processed by the convolutional layers and passes it through 1... One convolutional layer is used to transform the number of input channels from c1 to c3; the input channels after passing through layer 1... The features output from the convolutional layer are segmented into a first feature map and a second feature map, with each feature map corresponding to c³ / 2 channels; the first feature map and the second feature map are respectively input to two feature extraction sub-modules; each feature extraction module also includes a 1-channel array connected to the output of the feature extraction sub-module.

1. Convolutional layer: The feature extraction submodule includes a first depthwise separable convolution and a second depthwise separable convolution. The first depthwise separable convolution is used to extract features, and the second depthwise separable convolution is used to merge the extracted features with the features extracted by the first depthwise separable convolution in the channel dimension. The merged features are then connected to the output of the feature extraction submodule via a 1-channel connection. One convolutional layer, increasing the number of channels from c3 + 2 c4 is converted to the number of output channels c2; the feature fusion network includes a pooling module, an attention module, and a fusion module; the pooling module is used to divide the feature map into multiple grids of different sizes and perform max pooling on each grid to extract features at different scales; the attention module is configured with an attention mechanism to update features at different scales based on attention weights to obtain updated features; the fusion module is used to connect features at different scales and fuse them through convolutional layers to obtain fused features; The feature map is passed through a feature fusion network for attention fusion, and the fused features are obtained through cross-stage connections. The fusion feature obtains the predicted probability value corresponding to each category through the detection head, selects the highest probability value among the predicted probability values ​​as the prediction result, and displays the bounding box coordinates in the image to be detected.

2. The target detection method based on YOLOv9 according to claim 1, characterized in that, The method also includes resizing the image to be detected, specifically by: adjusting the pixel size of the image to be detected to the target size through affine transformation, and adjusting the resolution of the adjusted image to meet the resolution requirements of the feature extraction module.

3. The target detection method based on YOLOv9 according to claim 1, characterized in that, The attention module is a multi-scale channel attention module.

4. A target detection system based on YOLOv9, characterized in that, The system includes: Image acquisition end, used to acquire the image to be detected within the target area; An image processing apparatus is configured to perform the target detection method based on YOLOv9 according to any one of claims 1-3, perform target detection on the image to be detected, obtain at least one classification result, and display bounding box coordinates in the image to be detected; The result display terminal is used to display the image to be detected and the coordinates of the bounding box on the image to be detected.

5. The target detection system based on YOLOv9 according to claim 4, characterized in that, The image processing device includes: The feature extraction module is used to extract features from the resized image to be detected through a feature extraction network to obtain multi-scale features of the image to be detected, and to fuse the multi-scale features to obtain a feature map; The feature fusion module is used to perform attention fusion on the feature map through the feature fusion network and obtain fused features through cross-stage connections. The classification module is used to obtain the predicted probability value corresponding to each category, select the highest probability value among the predicted probability values ​​as the prediction result, and display the bounding box coordinates in the image to be detected.