Target detection method and system, electronic equipment and storage medium
By combining multiple detection algorithms and network structures, efficient detection of image targets is achieved, improving detection accuracy and detection rate, and solving the problem of image target recognition in existing technologies.
Patent Information
- Application Number
- CN202411143850.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2026-03-03
AI Technical Summary
How to effectively detect targets in images, especially in industrial manufacturing, where existing technologies struggle to accurately identify targets in images.
The first and second detection algorithms are used to detect targets in the image to be detected. The target detection results are finally determined by using a backbone network, a feature fusion network and a network output structure, combined with an XOR operator, multiple convolutional layers and an upsampling module to perform feature extraction and aggregation.
It improved the target detection rate, enhanced detection accuracy, and maintained a basically unchanged inference speed.
Smart Images

Figure CN121600282A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of image processing technology, and in particular to a target detection method, system, electronic device and storage medium. Background Technology
[0002] Image preprocessing and object detection represent some of the most significant breakthroughs in the field of artificial intelligence in recent years. They have achieved tremendous success in many areas, including computer vision, image and video analysis, and multimedia. Image preprocessing technology is a crucial research direction in computer vision tasks. Object detection, as a pressing problem in the manufacturing industry, has numerous application needs in industrial manufacturing.
[0003] Effectively detecting targets in images is of great importance. Summary of the Invention
[0004] This invention provides a target detection method, system, electronic device, and storage medium to solve the problem of how to effectively detect targets in images.
[0005] To solve the above-mentioned technical problems, the present invention is implemented as follows:
[0006] In a first aspect, embodiments of the present invention provide a target detection method, comprising:
[0007] Acquire the image to be detected;
[0008] The first detection algorithm is used to perform target detection on the image to be detected, and a first detection result is obtained;
[0009] The second detection algorithm is used to perform target detection on the image to be detected, and a second detection result is obtained;
[0010] Based on the first and second detection results, the final target detection result is obtained.
[0011] Optionally, the first detection algorithm includes a backbone network, a feature fusion network, and a network output structure;
[0012] The backbone network is used to extract features from the input image to be detected and output a first feature, a second feature, and a third feature;
[0013] The feature fusion network is used to aggregate the first feature, the second feature, and the third feature to obtain a first aggregation result, a second aggregation result, and a third aggregation result;
[0014] The network output structure is used to perform target detection based on the first aggregation result, the second aggregation result, and the third aggregation result to obtain a first detection result.
[0015] Optionally, the backbone network includes an input terminal, a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, and an XOR operator. The input terminal of the first convolutional layer is connected to the input terminal of the backbone network, and its output terminal is connected to the input terminal of the second convolutional layer. The output terminal of the second convolutional layer is connected to the input terminal of the third convolutional layer, and the output terminal of the third convolutional layer is connected to one input terminal of the XOR operator. The input terminal of the fourth convolutional layer is connected to the input terminal of the backbone network, and its output terminal is connected to the other input terminal of the XOR operator.
[0016] Optionally, the feature fusion network includes: a first input terminal, a second input terminal, a third input terminal, a first target detection module, a first upsampling module, a first connection module, a second target detection module, a second upsampling module, a second connection module, a third target detection module, a first convolution module, a third connection module, a fourth target detection module, a second convolution module, a fourth connection module, a fifth target detection module, a first output terminal, a second output terminal, and a third output terminal;
[0017] The input terminal of the first target detection module is connected to the first input terminal, and the output terminal is connected to the input terminal of the first upsampling module and the input terminal of the fourth connection module, respectively.
[0018] The input terminal of the first upsampling module is connected to the output terminal of the first target detection module, and the output terminal is connected to the input terminal of the first connection module.
[0019] One input terminal of the first connection module is connected to the output terminal of the first upsampling module, the other input terminal is connected to the second input terminal, and the output terminal is connected to the input terminal of the second target detection module;
[0020] The input terminal of the second target detection module is connected to the output terminal of the first connection module, and the output terminal is connected to the input terminal of the second upsampling module and one input terminal of the third connection module, respectively.
[0021] The input terminal of the second upsampling module is connected to the output terminal of the second target detection module, and the output terminal is connected to one input terminal of the second connection module;
[0022] One input terminal of the second connection module is connected to the output terminal of the second upsampling module, the other input terminal is connected to the third input terminal, and the output terminal is connected to the input terminal of the third target detection module;
[0023] The input end of the third target detection module is connected to the output end of the second connection module, and the output end is connected to the first output end and the input end of the first convolution module, respectively.
[0024] The input of the first convolution module is connected to the output of the third target detection module, and the output is connected to one input of the third connection module.
[0025] One input of the third connection module is connected to the output of the first convolution module, the other input is connected to the output of the second target detection module, and the output is connected to the input of the fourth target detection module.
[0026] The input end of the fourth target detection module is connected to the output end of the third connection module, and the output end is connected to the second output end and the input end of the second convolution module, respectively.
[0027] The input of the second convolution module is connected to the output of the fourth target detection module, and the output is connected to one input of the fourth connection module.
[0028] One input of the fourth connection module is connected to the output of the second convolution module, the other input is connected to the output of the first target detection module, and the output is connected to the input of the fifth target detection module.
[0029] The input terminal of the fifth target detection module is connected to the output terminal of the fourth connection module, and the output terminal is connected to the third output terminal.
[0030] Optionally, the feature fusion network is used to aggregate the first feature, the second feature, and the third feature to obtain a first aggregation result, a second aggregation result, and a third aggregation result, including:
[0031] This is used to aggregate the first feature, the second feature, and the third feature using a first path, a second path, and a third path, to obtain a first aggregation result, a second aggregation result, and a third aggregation result;
[0032] The first path includes: using the first target detection module to perform target detection on the first feature to obtain a first target detection result; using the first upsampling module to upsample the first target detection result to obtain a first upsampling result; using the first connection module to concatenate the first upsampling result and the second feature to obtain a first concatenation result; using the second target detection module to perform target detection on the first concatenation result to obtain a second target detection result; using the second upsampling module to upsample the second target detection result to obtain a second upsampling result; using the second connection module to concatenate the second upsampling result and the third feature to obtain a second concatenation result; and using the third target detection module to perform target detection on the second concatenation result to obtain a first aggregation result.
[0033] The second path includes: performing a convolution operation on the first aggregation result using the first convolution module to obtain a first convolution result; concatenating the first convolution result with the second target detection result using the third connection module to obtain a third concatenation result; and performing target detection on the third concatenation result using the fourth target detection module to obtain a second aggregation result.
[0034] The third path includes: performing a convolution operation on the second aggregation result using the second convolution module to obtain a second convolution result; concatenating the second convolution result with the first target detection result using the fourth connection module to obtain a fourth concatenation result; and performing target detection on the fourth concatenation result using the fifth target detection module to obtain a third aggregation result.
[0035] Optionally, the first detection result output by the network output structure is a four-dimensional feature matrix with dimensions [n,c,h,w], where n is the number of output images, c is the number of output image channels, h is the height of the output image, and w is the width of the output image.
[0036] Optionally, before performing target detection on the image to be detected using the first detection algorithm, the method further includes:
[0037] The first detection algorithm is trained.
[0038] Optionally, training the first detection algorithm includes:
[0039] Obtain a first training image set, which includes multiple first training images;
[0040] The first training image set is augmented to obtain a second training image set, which includes multiple second training images.
[0041] The data augmentation includes at least one of the following:
[0042] The second training image is obtained by linear interpolating the first training image using random weights.
[0043] The first training image is scaled using a random scaling ratio to obtain the scaled image as the second training image, and the position of the ground truth bounding box in the second training image is determined.
[0044] The rotation rate and rotation range are randomly obtained from the cropping ratio threshold, and the candidate cropping regions of the first training image are determined according to the rotation rate and rotation range. The intersection-union ratio (IUR) of the candidate cropping regions and the ground truth bounding boxes in the first training image is calculated. The candidate cropping regions with IUR greater than or equal to a first preset threshold are selected to determine the second training image, and the positions of the ground truth bounding boxes in the second training image are determined.
[0045] Optionally, training the first detection algorithm includes:
[0046] The first detection algorithm is trained using at least one of the following training strategies:
[0047] The first detection algorithm was trained using the exponential moving average method and the DropBlock strategy.
[0048] The first detection algorithm was trained using a batch normalization method;
[0049] A pre-trained model of the backbone network on ImageNet is used as the initial backbone network for the first detection algorithm.
[0050] Optionally, the second detection algorithm includes at least one of the following:
[0051] Smoothing filtering;
[0052] Perform image difference processing between the image after smoothing and the image before smoothing;
[0053] Image thresholding segmentation;
[0054] Image filtering processing;
[0055] Calculate the area of a connected region.
[0056] Optionally, obtaining the final target detection result based on the first detection result and the second detection result includes:
[0057] Obtain the first predicted bounding box of the predicted target in the first detection result, and the second predicted bounding box of the predicted target in the second detection result;
[0058] Calculate the intersection area of the first predicted bounding box and the second predicted bounding box;
[0059] If the intersection area is greater than a second preset threshold, the predicted target in the first detection result and the second detection result is determined to be the real target.
[0060] Optionally, obtaining the final target detection result based on the first detection result and the second detection result further includes:
[0061] Obtain the area of the predicted target in the first detection result;
[0062] If the area of the predicted target is greater than or equal to a third preset threshold, the predicted target in the first detection result is determined to be the real target.
[0063] Optionally, obtaining the final target detection result based on the first detection result and the second detection result further includes:
[0064] Obtain the area of the predicted target from the second detection result;
[0065] If the area of the predicted target is greater than or equal to a fourth preset threshold, the predicted target in the second detection result is determined to be the real target.
[0066] Secondly, embodiments of the present invention provide a target detection system, comprising:
[0067] The acquisition module is used to acquire the image to be detected;
[0068] The first detection module is used to perform target detection on the image to be detected using a first detection algorithm to obtain a first detection result;
[0069] The second detection module is used to perform target detection on the image to be detected using a second detection algorithm to obtain a second detection result;
[0070] The determination module is used to obtain the final target detection result based on the first detection result and the second detection result.
[0071] Thirdly, embodiments of the present invention provide an electronic device, including: a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, it implements the steps of the target detection method as described in the first aspect above.
[0072] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the target detection method as described in the first aspect above.
[0073] Fifthly, a computer program product is provided, including computer instructions that, when executed by a processor, implement the steps of the target detection method as described in the first aspect.
[0074] In this embodiment of the invention, a first detection algorithm and a second detection algorithm are used to perform target detection on the image to be detected, and the final target detection result is determined based on the detection results of the first detection algorithm and the second detection algorithm, thereby improving the target detection rate. Attached Figure Description
[0075] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0076] Figure 1 This is a schematic flowchart of the target detection method according to an embodiment of the present invention;
[0077] Figure 2 This is a schematic diagram of the image to be detected according to an embodiment of the present invention;
[0078] Figure 3 This is a schematic diagram of the backbone network structure according to an embodiment of the present invention;
[0079] Figure 4 This is a schematic diagram of the network structure of the feature fusion network according to an embodiment of the present invention;
[0080] Figure 5 This is a schematic diagram of the network structure of the target detection module in an embodiment of the present invention;
[0081] Figure 6 This is a schematic diagram of the network structure of the convolution module in an embodiment of the present invention;
[0082] Figure 7 This is a schematic diagram of the network structure of the upsampling module in an embodiment of the present invention;
[0083] Figure 8 This is a schematic diagram illustrating some modules of the feature fusion network in an embodiment of the present invention;
[0084] Figure 9 This is a schematic diagram of the prediction results of the first detection algorithm in an embodiment of the present invention;
[0085] Figure 10 This is a schematic diagram of an image after smoothing filtering according to an embodiment of the present invention;
[0086] Figure 11 This is a schematic diagram of an image after image difference processing according to an embodiment of the present invention;
[0087] Figure 12 This is a schematic diagram illustrating the transmission of detection results from a computer vision algorithm according to an embodiment of the present invention.
[0088] Figure 13 This is a schematic diagram of the target detection system according to an embodiment of the present invention;
[0089] Figure 14This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0090] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0091] Please refer to Figure 1 This invention provides a target detection method, comprising:
[0092] Step S1: Acquire the image to be detected;
[0093] The image to be detected in this embodiment of the invention can be a grayscale image (e.g., Figure 2 (as shown) or an RGB image, etc.
[0094] In this embodiment of the invention, the image to be detected can be, for example, an image of the screen to be detected.
[0095] Step S2: Perform target detection on the image to be detected using the first detection algorithm to obtain the first detection result;
[0096] Optionally, the first detection algorithm may be, for example, a deep learning network.
[0097] Optionally, the target detection can be, for example, the detection of black spot defects in an image of the screen to be detected.
[0098] Step S3: Use the second detection algorithm to perform target detection on the image to be detected, and obtain the second detection result;
[0099] Optionally, the second detection algorithm may be different from the first detection algorithm, for example, it may be a traditional computer vision algorithm.
[0100] Step S4: Based on the first detection result and the second detection result, obtain the final target detection result.
[0101] If the target detection is black spot defect detection, then the final target detection result is the black spot defect detection result.
[0102] In this embodiment of the invention, a first detection algorithm and a second detection algorithm are used to perform target detection on the image to be detected, and the final target detection result is determined based on the detection results of the first detection algorithm and the second detection algorithm, thereby improving the target detection rate.
[0103] In this embodiment of the invention, optionally, the first detection algorithm includes a backbone network, a feature fusion network, and a network output structure;
[0104] The backbone network is used to extract features from the input image to be detected and output a first feature, a second feature, and a third feature;
[0105] The feature fusion network is used to aggregate the first feature, the second feature, and the third feature to obtain a first aggregation result, a second aggregation result, and a third aggregation result;
[0106] The network output structure is used to perform target detection based on the first aggregation result, the second aggregation result, and the third aggregation result to obtain a first detection result.
[0107] In this embodiment of the invention, optional details may be found, please refer to [the relevant documentation]. Figure 3 The backbone network includes an input terminal 31, a first convolutional layer 32, a second convolutional layer 33, a third convolutional layer 34, a fourth convolutional layer 35, and an XOR operator 36. The input terminal of the first convolutional layer 32 is connected to the input terminal 31 of the backbone network, and its output terminal is connected to the input terminal of the second convolutional layer 33. The output terminal of the second convolutional layer 33 is connected to the input terminal of the third convolutional layer 34, and the output terminal of the third convolutional layer 34 is connected to one input terminal of the XOR operator 36. The input terminal of the fourth convolutional layer 35 is connected to the input terminal 31 of the backbone network, and its output terminal is connected to the other input terminal of the XOR operator 36.
[0108] In some implementations, the network structure of each convolutional layer (Conv) is shown in Table 1:
[0109] Table 1
[0110]
[0111]
[0112] The first convolutional layer (Conv1) consists of three convolutions, each with a kernel size of 3×3 and strides of 2, 1, and 1 respectively. In this embodiment of the invention, the network depth of the backbone network is increased while the number of parameters remains basically unchanged. At the same time, a 4×4 average pooling layer with a stride of 1 is added to the downsampling module of the backbone network to avoid the input information being ignored.
[0113] In this embodiment of the invention, using the above-mentioned backbone network can improve the target detection accuracy by 1%-2%, while the inference speed remains basically unchanged.
[0114] In this embodiment of the invention, optional details may be found, please refer to [the relevant documentation]. Figure 4The feature fusion network includes: a first input terminal C5, a second input terminal C4, a third input terminal C3, a first target detection module 41, a first upsampling module 42, a first connection module 43, a second target detection module 44, a second upsampling module 45, a second connection module 46, a third target detection module 47, a first convolution module 48, a third connection module 49, a fourth target detection module 410, a second convolution module 411, a fourth connection module 412, a fifth target detection module 414, a first output terminal P3, a second output terminal P4, and a third output terminal P5;
[0115] The input terminal of the first target detection module 41 is connected to the first input terminal C5, and the output terminal is connected to the input terminal of the first upsampling module 42 and the input terminal of the fourth connection module 412, respectively.
[0116] The input terminal of the first upsampling module 42 is connected to the output terminal of the first target detection module 41, and the output terminal is connected to the input terminal of the first connection module 43.
[0117] One input terminal of the first connection module 43 is connected to the output terminal of the first upsampling module 42, the other input terminal is connected to the second input terminal C4, and the output terminal is connected to the input terminal of the second target detection module 44;
[0118] The input terminal of the second target detection module 44 is connected to the output terminal of the first connection module 43, and the output terminal is connected to the input terminal of the second upsampling module 45 and one input terminal of the third connection module 49, respectively.
[0119] The input terminal of the second upsampling module 45 is connected to the output terminal of the second target detection module 44, and the output terminal is connected to one input terminal of the second connection module 46;
[0120] One input terminal of the second connection module 46 is connected to the output terminal of the second upsampling module 45, the other input terminal is connected to the third input terminal C3, and the output terminal is connected to the input terminal of the third target detection module 47;
[0121] The input terminal of the third target detection module 47 is connected to the output terminal of the second connection module 46, and the output terminal is connected to the first output terminal P3 and the input terminal of the first convolution module 48, respectively.
[0122] The input of the first convolution module 48 is connected to the output of the third target detection module 47, and the output is connected to one input of the third connection module 49.
[0123] One input terminal of the third connection module 49 is connected to the output terminal of the first convolution module 48, the other input terminal is connected to the output terminal of the second target detection module 44, and the output terminal is connected to the input terminal of the fourth target detection module 410.
[0124] The input terminal of the fourth target detection module 410 is connected to the output terminal of the third connection module 49, and the output terminal is connected to the second output terminal P4 and the input terminal of the second convolution module 411, respectively.
[0125] The input of the second convolution module 411 is connected to the output of the fourth target detection module 410, and the output is connected to one input of the fourth connection module 412.
[0126] One input terminal of the fourth connection module 412 is connected to the output terminal of the second convolution module 411, the other input terminal is connected to the output terminal of the first target detection module 41, and the output terminal is connected to the input terminal of the fifth target detection module 413.
[0127] The input terminal of the fifth target detection module 413 is connected to the output terminal of the fourth connection module 412, and the output terminal is connected to the third output terminal P5.
[0128] In this embodiment of the invention, optionally, the feature fusion network is used to aggregate the first feature, the second feature, and the third feature to obtain a first aggregation result, a second aggregation result, and a third aggregation result, including:
[0129] This is used to aggregate the first feature, the second feature, and the third feature using a first path, a second path, and a third path, to obtain a first aggregation result, a second aggregation result, and a third aggregation result;
[0130] The first path includes: using the first target detection module 41 to perform target detection on the first feature to obtain a first target detection result; using the first upsampling module 42 to upsample the first target detection result to obtain a first upsampling result; using the first connection module 43 to concatenate the first upsampling result and the second feature to obtain a first concatenation result; using the second target detection module 44 to perform target detection on the first concatenation result to obtain a second target detection result; using the second upsampling module 45 to upsample the second target detection result to obtain a second upsampling result; using the second connection module 46 to concatenate the second upsampling result and the third feature to obtain a second concatenation result; and using the third target detection module 47 to perform target detection on the second concatenation result to obtain a first aggregation result.
[0131] The second path includes: performing a convolution operation on the first aggregation result using the first convolution module 48 to obtain a first convolution result; concatenating the first convolution result with the second target detection result using the third connection module 49 to obtain a third concatenation result; and performing target detection on the third concatenation result using the fourth target detection module 410 to obtain a second aggregation result.
[0132] The third path includes: using the second convolution module 411 to perform a convolution operation on the second aggregation result to obtain a second convolution result; using the fourth connection module 412 to concatenate the second convolution result with the first target detection result to obtain a fourth concatenation result; and using the fifth target detection module 413 to perform target detection on the fourth concatenation result to obtain a third aggregation result.
[0133] In this embodiment of the invention, feature information is aggregated through top-down and bottom-up paths to achieve better feature extraction results.
[0134] In this embodiment of the invention, the features input to the first input terminal C5, the second input terminal C4, and the third input terminal C3 are three different features, with corresponding strides of (8, 16, 32). In this embodiment, pooling features of different scales can be extracted through multiple pooling windows of different scales, and then combined together as the output features, which can effectively increase the receptive field of the features. The three pooling windows used are (5, 9, 13), and the obtained features are concatenated together using a concat module, and finally convolution is performed using a convolution module.
[0135] In this embodiment of the invention, the network structures of the first target detection module 41, the second target detection module 44, the third target detection module 47, the fourth target detection module 410, and the fifth target detection module 413 can be the same and can be collectively referred to as target detection modules (Detection Block). In the figure, 1024, 512, etc. below the Detection Block represent the number of channels of the output image of the Detection Block.
[0136] Please refer to Figure 5 , Figure 5 This is a schematic diagram of the network structure of the target detection module in an embodiment of the present invention. Figure 5As can be seen, the target detection module in this embodiment of the invention may include three convolutional layers (Conv) and three convolutional modules (ConvBlock). The input to the target detection module enters the first convolutional layer (Conv, 1×1 / 1c, c / 2) and the second convolutional layer (Conv, 1×1 / 1c, c / 2), where 1×1 represents the kernel size, the 1 after 1×1 represents the stride, and c and c / 2 represent the number of channels in the input image and the number of channels in the output image, respectively. The output of the second convolutional layer enters the first convolutional module (Conv Block), the output of the first convolutional module enters the second convolutional module, the output of the second convolutional module enters the third convolutional module, and the output of the third convolutional module is concatenated with the output of the first convolutional layer before entering the third convolutional layer (Conv, 1×1 / 1c, c). The output of the third convolutional layer is the output of the target detection module. Please refer to [reference needed]. Figure 6 , Figure 6 This is a schematic diagram of the network structure of the convolution module in an embodiment of the present invention. Figure 6 As can be seen from the above, the convolution module in this embodiment of the invention includes two convolutional layers, one of which is (Conv, 1×1 / 1c,c) and the other is (Conv, 3×3 / 1c,c).
[0137] In this embodiment of the invention, the network structures of the first upsampling module 42 and the second upsampling module 45 can be the same and can be collectively referred to as upsampling modules (Upsample Block).
[0138] Please refer to Figure 7 , Figure 7 This is a schematic diagram of the network structure of the upsampling module in an embodiment of the present invention. Figure 7 As can be seen, the upsampling module in this embodiment of the invention includes a convolutional layer and an upsampling layer, wherein the convolutional layer is (Conv, 1×1 / 1c, c), and the upsampling layer is double upsampling.
[0139] In this embodiment of the invention, the network structures of the first connection module 43, the second connection module 46, the third connection module 49 and the fourth condensation module 412 may be the same and may be collectively referred to as connection modules (Concatenate Block).
[0140] Figure 8 In this context, kernel size refers to the size of the convolution kernel, stride refers to the stride, in channel refers to the number of channels in the input image, and out channel refers to the number of channels in the output image.
[0141] In this embodiment of the invention, the network output structure predicts based on the three features output by the feature fusion network. This network output structure adopts a structure similar to YOLO-v3, that is, using convolution to encode the final features. The first detection result output by the network output structure is a four-dimensional feature matrix with dimensions [n, c, h, w], where n is the number of output images, c is the number of output image channels, h is the height of the output image, and w is the width of the output image. C is specifically in the form of anchor boxes * (4 + 1 + 1 + number of categories). The number of anchor boxes is the number of anchors (an anchor is a set of predefined boxes or regions used to represent the position and size range of possible targets in the image) corresponding to each position. The current value is 3, where 4 represents the attributes of the bounding box (corresponding to the center point and width / height), and 1 represents whether it is an object.
[0142] The first detection algorithm described above can yield more accurate preset results; please refer to the appendix. Figure 9 The red box indicates the target (black spot defect) to be measured.
[0143] In this embodiment of the invention, optionally, before performing target detection on the image to be detected using the first detection algorithm, the method further includes:
[0144] The first detection algorithm is trained.
[0145] In this embodiment of the invention, optionally, training the first detection algorithm includes:
[0146] Obtain a first training image set, which includes multiple first training images;
[0147] The first training image set is augmented to obtain a second training image set, which includes multiple second training images.
[0148] The data augmentation includes at least one of the following:
[0149] 1) The second training image is obtained by linear interpolation of the first training image using random weights.
[0150] In this embodiment of the invention, optionally, the label vector of the second training image can be obtained from the ground truth bounding box and the ground truth class of the first training image;
[0151] Optionally, the label vector is obtained by weighted summation of the ground truth bounding boxes and the ground truth classes. By using random weights to perform linear interpolation on the first training image, the training dataset of the first detection algorithm can be increased, thereby improving the robustness and generalization of the trained first detection algorithm.
[0152] Alternatively, linear interpolation can be performed using the following interpolation formula:
[0153]
[0154]
[0155] λ∈[0,1]
[0156] Where λ represents the weight, ranging from 0 to 1, (x i ,y i (x) represents the pixel coordinates of the first training image. j ,y j ) represents the coordinates of the label vector of the pixels in the first training image.
[0157] 2) Scale the first training image using a random scaling ratio to obtain the scaled image as the second training image, and determine the position of the ground truth bounding box in the second training image;
[0158] Specifically, when the random scaling ratio is greater than 1, the image is enlarged; when the random scaling ratio is less than 1, the image is reduced.
[0159] In some embodiments, after the first training image is enlarged, the original first training image can be pasted onto the enlarged image to obtain a second training image, and the position of the true bounding box in the first training image in the second training image can be determined based on the position of the first training image in the second training image.
[0160] 3) Randomly obtain the rotation rate and rotation range from the cropping ratio threshold, and determine the candidate cropping region of the first training image based on the rotation rate and rotation range. Calculate the intersection-union ratio (IUR) between the candidate cropping region and the ground truth bounding box in the first training image. Select the candidate cropping region with an IUR greater than or equal to the first preset threshold to determine the second training image, and determine the position of the ground truth bounding box in the second training image.
[0161] Optionally, the above-mentioned "randomly obtaining the rotation rate and rotation range from the cropping ratio threshold, determining the candidate cropping region of the first training image based on the rotation rate and rotation range, calculating the intersection-union ratio (IU / R) between the candidate cropping region and the ground truth bounding box in the first training image, selecting the candidate cropping region with an IU / R greater than or equal to a first preset threshold to determine the second training image, and determining the position of the ground truth bounding box in the second training image" may include the following steps:
[0162] Iterate through each element of the cropping ratio threshold of the first training image:
[0163] 31) If the cropping information in the cropping ratio threshold of the first training image is "no cropping (no_crop)", then return the original first training image and the corresponding label vector.
[0164] 32) If the cropping information in the cropping ratio threshold of the first training image is "crop", randomly extract the values of rotation ratio (aspect_ratio, i.e., rotation angle) and rotation range (scaling) from the cropping ratio threshold, and calculate the height, width and starting point of the candidate cropping region based on the values of rotation ratio and rotation range;
[0165] The method for determining the candidate cropping region is as follows: the first training image is rotated according to the values of rotation rate and rotation range, and then the rotated image is cropped to obtain the candidate cropping region.
[0166] Optionally, blank areas in the candidate cropping area can be filled with preset pixel values.
[0167] 33) Calculate the intersection-union ratio (IoU) between the ground truth bounding boxes in the first training image and the candidate cropping regions.
[0168] 34) If the intersection-union ratio of all the ground truth bounding boxes and the candidate cropping regions is less than the first preset threshold, return to step 32); if there is a candidate cropping region with an intersection-union ratio greater than or equal to the first preset threshold, then the candidate cropping region is determined as the second training image.
[0169] 35) If the number of true bounding boxes located in the candidate cropping region is 0, then return to step 32).
[0170] 36) Determine the location of the true bounding boxes within the candidate cropping region of the second training image.
[0171] In this embodiment of the invention, optionally, training the first detection algorithm includes training the first detection algorithm using at least one of the following training strategies:
[0172] 1) The first detection algorithm is trained using the exponential moving average method and the DropBlock strategy;
[0173] The exponential moving average method, also known as exponential smoothing, is a forecasting method that uses the actual and predicted values (estimated values) of the previous period, assigns them different weights, and obtains an exponentially smoothed value as the forecast value for the next period.
[0174] DropBlock is a novel regularization technique that extends the classic dropout method. While dropout typically discards a subset of neurons randomly to prevent overfitting, DropBlock discards feature blocks or contiguous spatial regions, promoting the model's learning of cross-pixel dependencies and thus enhancing its generalization ability.
[0175] By using the exponential moving average method and / or the DropBlock strategy, the convergence and generalization ability of the model can be improved.
[0176] 2) Train the first detection algorithm using the batch normalization method;
[0177] Batch normalization is used to accelerate the training of neural networks and improve model performance. It normalizes the inputs in each hidden layer of the network, making the input distribution of each neuron more uniform, which helps the network converge faster and prevents gradient vanishing.
[0178] 3) The pre-trained model of the backbone network on ImageNet is used as the initial backbone network of the first detection algorithm.
[0179] In scenarios where the image dataset used for training is small, direct training may result in many parameters not fitting well on small data. In this embodiment of the invention, a pre-trained backbone network model on ImageNet is used as the initial backbone network of the first detection algorithm, which can speed up model training and achieve a good fit on small data.
[0180] In this embodiment of the invention, optionally, the second detection algorithm includes at least one of the following:
[0181] 1) Smoothing filtering processing;
[0182] Applying a smoothing filter to an image can eliminate irrelevant noise points.
[0183] In this embodiment of the invention, the image can be smoothed using the following formula:
[0184] S(x,y)={f(x-1,y),f(x,y),f(x+1,y),f(x,y+1),f(x,y-1),f(x-1,y+1),f(x+1,y-1),f(x-1,y-1),f(x+1,y-1)} / 9;
[0185] Where S(x,y) is the smoothing filter result, and f(x,y) is the original image.
[0186] Please refer to Figure 10 , Figure 10This is a schematic diagram of an image after smoothing filtering according to an embodiment of the present invention.
[0187] 2) Perform image difference processing on the image after smoothing and the image before smoothing;
[0188] The formula for image difference processing is as follows:
[0189] G(x,y)=|S(x,y)-f(x,y)|
[0190] Where G(x,y) is the output result after image difference processing, S(x,y) is the smoothing filter result (the image after smoothing filter), and f(x,y) is the original image (the image before smoothing filter).
[0191] Please refer to Figure 11 , Figure 11 This is a schematic diagram of the image after image difference processing according to an embodiment of the present invention.
[0192] 3) Image thresholding segmentation processing.
[0193] Optionally, in this embodiment of the invention, the image thresholding process can be performed using the following formula:
[0194]
[0195] Where T(x,y) is the image after thresholding, G(x,y) is the output result after image differencing, and thr is the segmentation threshold.
[0196] 4) Image filtering processing.
[0197] Optionally, after image thresholding, image filtering can be performed to further highlight the features of the dark spots.
[0198] The formula for image filtering can be as follows:
[0199] R(x,y)={T(x-1,y),T(x,y),T(x+1,y),T(x,y+1),T(x,y-1),T(x-1,y+1),T(x+1,y-1),T(x-1,y-1),T(x+1,y-1)} / 9;
[0200] Where R(x,y) is the filtered image and T(x,y) is the image after thresholding.
[0201] 5) Calculation of the area of connected regions.
[0202] Optionally, determine the area of the connected components R(x,y), give an area threshold, and output the final target. Please refer to [reference needed]. Figure 12 .
[0203] In this embodiment of the invention, optionally, obtaining the final target detection result based on the first detection result and the second detection result includes:
[0204] Obtain the first predicted bounding box of the predicted target in the first detection result, and the second predicted bounding box of the predicted target in the second detection result;
[0205] Calculate the intersection area of the first predicted bounding box and the second predicted bounding box;
[0206] If the intersection area is greater than a second preset threshold, the predicted target in the first detection result and the second detection result is determined to be the real target.
[0207] In this embodiment of the invention, optionally, obtaining the final target detection result based on the first detection result and the second detection result further includes:
[0208] Obtain the area of the predicted target in the first detection result;
[0209] If the area of the predicted target is greater than or equal to a third preset threshold, the predicted target in the first detection result is determined to be the real target.
[0210] In this embodiment of the invention, optionally, obtaining the final target detection result based on the first detection result and the second detection result further includes:
[0211] Obtain the area of the predicted target from the second detection result;
[0212] If the area of the predicted target is greater than or equal to a fourth preset threshold, the predicted target in the second detection result is determined to be the real target.
[0213] Please refer to Figure 13 This invention also provides a target detection system 130, comprising:
[0214] The acquisition module 131 is used to acquire the image to be detected;
[0215] The first detection module 132 is used to perform target detection on the image to be detected using a first detection algorithm to obtain a first detection result;
[0216] The second detection module 133 is used to perform target detection on the image to be detected using a second detection algorithm to obtain a second detection result;
[0217] The determination module 134 is used to obtain the final target detection result based on the first detection result and the second detection result.
[0218] In this embodiment of the invention, a first detection algorithm and a second detection algorithm are used to perform target detection on the image to be detected, and the final target detection result is determined based on the detection results of the first detection algorithm and the second detection algorithm, thereby improving the target detection rate.
[0219] In this embodiment of the invention, optionally, the first detection algorithm includes a backbone network, a feature fusion network, and a network output structure;
[0220] The backbone network is used to extract features from the input image to be detected and output a first feature, a second feature, and a third feature;
[0221] The feature fusion network is used to aggregate the first feature, the second feature, and the third feature to obtain a first aggregation result, a second aggregation result, and a third aggregation result;
[0222] The network output structure is used to perform target detection based on the first aggregation result, the second aggregation result, and the third aggregation result to obtain a first detection result.
[0223] In this embodiment of the invention, optionally, the backbone network includes an input terminal, a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, and an XOR operator. The input terminal of the first convolutional layer is connected to the input terminal of the backbone network, and its output terminal is connected to the input terminal of the second convolutional layer. The output terminal of the second convolutional layer is connected to the input terminal of the third convolutional layer, and the output terminal of the third convolutional layer is connected to one input terminal of the XOR operator. The input terminal of the fourth convolutional layer is connected to the input terminal of the backbone network, and its output terminal is connected to the other input terminal of the XOR operator.
[0224] In this embodiment of the invention, optionally, the feature fusion network includes: a first input terminal, a second input terminal, a third input terminal, a first target detection module, a first upsampling module, a first connection module, a second target detection module, a second upsampling module, a second connection module, a third target detection module, a first convolution module, a third connection module, a fourth target detection module, a second convolution module, a fourth connection module, a fifth target detection module, a first output terminal, a second output terminal, and a third output terminal;
[0225] The input terminal of the first target detection module is connected to the first input terminal, and the output terminal is connected to the input terminal of the first upsampling module and the input terminal of the fourth connection module, respectively.
[0226] The input terminal of the first upsampling module is connected to the output terminal of the first target detection module, and the output terminal is connected to the input terminal of the first connection module.
[0227] One input terminal of the first connection module is connected to the output terminal of the first upsampling module, the other input terminal is connected to the second input terminal, and the output terminal is connected to the input terminal of the second target detection module;
[0228] The input terminal of the second target detection module is connected to the output terminal of the first connection module, and the output terminal is connected to the input terminal of the second upsampling module and one input terminal of the third connection module, respectively.
[0229] The input terminal of the second upsampling module is connected to the output terminal of the second target detection module, and the output terminal is connected to one input terminal of the second connection module;
[0230] One input terminal of the second connection module is connected to the output terminal of the second upsampling module, the other input terminal is connected to the third input terminal, and the output terminal is connected to the input terminal of the third target detection module;
[0231] The input end of the third target detection module is connected to the output end of the second connection module, and the output end is connected to the first output end and the input end of the first convolution module, respectively.
[0232] The input of the first convolution module is connected to the output of the third target detection module, and the output is connected to one input of the third connection module.
[0233] One input of the third connection module is connected to the output of the first convolution module, the other input is connected to the output of the second target detection module, and the output is connected to the input of the fourth target detection module.
[0234] The input end of the fourth target detection module is connected to the output end of the third connection module, and the output end is connected to the second output end and the input end of the second convolution module, respectively.
[0235] The input of the second convolution module is connected to the output of the fourth target detection module, and the output is connected to one input of the fourth connection module.
[0236] One input of the fourth connection module is connected to the output of the second convolution module, the other input is connected to the output of the first target detection module, and the output is connected to the input of the fifth target detection module.
[0237] The input terminal of the fifth target detection module is connected to the output terminal of the fourth connection module, and the output terminal is connected to the third output terminal.
[0238] In this embodiment of the invention, optionally, the feature fusion network is used to aggregate the first feature, the second feature, and the third feature to obtain a first aggregation result, a second aggregation result, and a third aggregation result, including:
[0239] This is used to aggregate the first feature, the second feature, and the third feature using a first path, a second path, and a third path, to obtain a first aggregation result, a second aggregation result, and a third aggregation result;
[0240] The first path includes: using the first target detection module to perform target detection on the first feature to obtain a first target detection result; using the first upsampling module to upsample the first target detection result to obtain a first upsampling result; using the first connection module to concatenate the first upsampling result and the second feature to obtain a first concatenation result; using the second target detection module to perform target detection on the first concatenation result to obtain a second target detection result; using the second upsampling module to upsample the second target detection result to obtain a second upsampling result; using the second connection module to concatenate the second upsampling result and the third feature to obtain a second concatenation result; and using the third target detection module to perform target detection on the second concatenation result to obtain a first aggregation result.
[0241] The second path includes: performing a convolution operation on the first aggregation result using the first convolution module to obtain a first convolution result; concatenating the first convolution result with the second target detection result using the third connection module to obtain a third concatenation result; and performing target detection on the third concatenation result using the fourth target detection module to obtain a second aggregation result.
[0242] The third path includes: performing a convolution operation on the second aggregation result using the second convolution module to obtain a second convolution result; concatenating the second convolution result with the first target detection result using the fourth connection module to obtain a fourth concatenation result; and performing target detection on the fourth concatenation result using the fifth target detection module to obtain a third aggregation result.
[0243] In this embodiment of the invention, optionally, the first detection result output by the network output structure is a four-dimensional feature matrix with dimensions [n,c,h,w], where n is the number of output images, c is the number of output image channels, h is the height of the output image, and w is the width of the output image.
[0244] In this embodiment of the invention, optionally, the target detection system 130 further includes:
[0245] The training module is used to train the first detection algorithm.
[0246] In this embodiment of the invention, optionally, the training module is used to obtain a first training image set, the first training image set including a plurality of first training images; and to perform data augmentation on the first training image set to obtain a second training image set, the second training image set including a plurality of second training images.
[0247] The data augmentation includes at least one of the following:
[0248] The second training image is obtained by linear interpolation of the first training image using random weights, and the label vector is obtained from the ground truth bounding boxes and the ground truth class of the first training image.
[0249] The first training image is scaled using a random scaling ratio to obtain the scaled image as the second training image, and the position of the ground truth bounding box in the second training image is determined.
[0250] The rotation rate and rotation range are randomly obtained from the cropping ratio threshold, and the candidate cropping regions of the first training image are determined according to the rotation rate and rotation range. The intersection-union ratio (IUR) of the candidate cropping regions and the ground truth bounding boxes in the first training image is calculated. The candidate cropping regions with IUR greater than or equal to a first preset threshold are selected to determine the second training image, and the positions of the ground truth bounding boxes in the second training image are determined.
[0251] In this embodiment of the invention, optionally, the training module is used to train the first detection algorithm using at least one of the following training strategies:
[0252] The first detection algorithm was trained using the exponential moving average method and the DropBlock strategy.
[0253] The first detection algorithm was trained using a batch normalization method;
[0254] A pre-trained model of the backbone network on ImageNet is used as the initial backbone network for the first detection algorithm.
[0255] Optionally, the second detection algorithm includes at least one of the following:
[0256] Smoothing filtering;
[0257] Perform image difference processing between the image after smoothing and the image before smoothing;
[0258] Image thresholding segmentation;
[0259] Image filtering processing;
[0260] Calculate the area of a connected region.
[0261] In this embodiment of the invention, optionally, the determining module 134 is used to obtain the first predicted bounding box of the predicted target in the first detection result, and to calculate the intersection area of the first predicted bounding box and the second predicted bounding box of the predicted target in the second detection result; if the intersection area is greater than a second preset threshold, the predicted target in the first detection result and the second detection result is determined to be the real target.
[0262] In this embodiment of the invention, optionally, the determining module 134 is further configured to obtain the area of the predicted target in the first detection result;
[0263] If the area of the predicted target is greater than or equal to a third preset threshold, the predicted target in the first detection result is determined to be the real target.
[0264] In this embodiment of the invention, optionally, the determining module 134 is further configured to obtain the area of the predicted target in the second detection result; if the area of the predicted target is greater than or equal to a fourth preset threshold, the predicted target in the second detection result is determined to be a real target.
[0265] Please refer to Figure 14 The present invention also provides an electronic device 140, including a processor 141, a memory 142, and a computer program stored in the memory 142 and executable on the processor 141. When the computer program is executed by the processor 141, it implements the various processes of the above-described video ringback tone playback method embodiment applied to the terminal and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0266] This invention also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the various processes of the above-described target detection method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0267] This application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the above-described... Figure 1 The various processes of the target detection method embodiments shown are all capable of achieving the same technical effect, and will not be described again here to avoid repetition.
[0268] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0269] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0270] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of the present invention.
Claims
1. A target detection method, characterized in that, include: Acquire the image to be detected; The first detection algorithm is used to perform target detection on the image to be detected, and a first detection result is obtained; The second detection algorithm is used to perform target detection on the image to be detected, and a second detection result is obtained; Based on the first and second detection results, the final target detection result is obtained.
2. The method according to claim 1, characterized in that, The first detection algorithm includes a backbone network, a feature fusion network, and a network output structure; The backbone network is used to extract features from the input image to be detected and output a first feature, a second feature, and a third feature; The feature fusion network is used to aggregate the first feature, the second feature, and the third feature to obtain a first aggregation result, a second aggregation result, and a third aggregation result; The network output structure is used to perform target detection based on the first aggregation result, the second aggregation result, and the third aggregation result to obtain a first detection result.
3. The method according to claim 2, characterized in that, The backbone network includes an input terminal, a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, and an XOR operator. The input terminal of the first convolutional layer is connected to the input terminal of the backbone network, and its output terminal is connected to the input terminal of the second convolutional layer. The output terminal of the second convolutional layer is connected to the input terminal of the third convolutional layer. The output terminal of the third convolutional layer is connected to one input terminal of the XOR operator. The input terminal of the fourth convolutional layer is connected to the input terminal of the backbone network, and its output terminal is connected to the other input terminal of the XOR operator.
4. The method according to claim 2, characterized in that, The feature fusion network includes: a first input terminal, a second input terminal, a third input terminal, a first target detection module, a first upsampling module, a first connection module, a second target detection module, a second upsampling module, a second connection module, a third target detection module, a first convolution module, a third connection module, a fourth target detection module, a second convolution module, a fourth connection module, a fifth target detection module, a first output terminal, a second output terminal, and a third output terminal; The input terminal of the first target detection module is connected to the first input terminal, and the output terminal is connected to the input terminal of the first upsampling module and the input terminal of the fourth connection module, respectively. The input terminal of the first upsampling module is connected to the output terminal of the first target detection module, and the output terminal is connected to the input terminal of the first connection module. One input terminal of the first connection module is connected to the output terminal of the first upsampling module, the other input terminal is connected to the second input terminal, and the output terminal is connected to the input terminal of the second target detection module; The input terminal of the second target detection module is connected to the output terminal of the first connection module, and the output terminal is connected to the input terminal of the second upsampling module and one input terminal of the third connection module, respectively. The input terminal of the second upsampling module is connected to the output terminal of the second target detection module, and the output terminal is connected to one input terminal of the second connection module; One input terminal of the second connection module is connected to the output terminal of the second upsampling module, the other input terminal is connected to the third input terminal, and the output terminal is connected to the input terminal of the third target detection module; The input end of the third target detection module is connected to the output end of the second connection module, and the output end is connected to the first output end and the input end of the first convolution module, respectively. The input of the first convolution module is connected to the output of the third target detection module, and the output is connected to one input of the third connection module. One input of the third connection module is connected to the output of the first convolution module, the other input is connected to the output of the second target detection module, and the output is connected to the input of the fourth target detection module. The input end of the fourth target detection module is connected to the output end of the third connection module, and the output end is connected to the second output end and the input end of the second convolution module, respectively. The input of the second convolution module is connected to the output of the fourth target detection module, and the output is connected to one input of the fourth connection module. One input of the fourth connection module is connected to the output of the second convolution module, the other input is connected to the output of the first target detection module, and the output is connected to the input of the fifth target detection module. The input terminal of the fifth target detection module is connected to the output terminal of the fourth connection module, and the output terminal is connected to the third output terminal.
5. The method according to claim 4, characterized in that, The feature fusion network is used to aggregate the first feature, the second feature, and the third feature to obtain a first aggregation result, a second aggregation result, and a third aggregation result, including: This is used to aggregate the first feature, the second feature, and the third feature using a first path, a second path, and a third path, to obtain a first aggregation result, a second aggregation result, and a third aggregation result; The first path includes: using the first target detection module to perform target detection on the first feature to obtain a first target detection result; using the first upsampling module to upsample the first target detection result to obtain a first upsampling result; using the first connection module to concatenate the first upsampling result and the second feature to obtain a first concatenation result; using the second target detection module to perform target detection on the first concatenation result to obtain a second target detection result; using the second upsampling module to upsample the second target detection result to obtain a second upsampling result; using the second connection module to concatenate the second upsampling result and the third feature to obtain a second concatenation result; and using the third target detection module to perform target detection on the second concatenation result to obtain a first aggregation result. The second path includes: performing a convolution operation on the first aggregation result using the first convolution module to obtain a first convolution result; concatenating the first convolution result with the second target detection result using the third connection module to obtain a third concatenation result; and performing target detection on the third concatenation result using the fourth target detection module to obtain a second aggregation result. The third path includes: performing a convolution operation on the second aggregation result using the second convolution module to obtain a second convolution result; concatenating the second convolution result with the first target detection result using the fourth connection module to obtain a fourth concatenation result; and performing target detection on the fourth concatenation result using the fifth target detection module to obtain a third aggregation result.
6. The method according to claim 2, characterized in that, The first detection result of the network output structure is a four-dimensional feature matrix with dimensions [n,c,h,w], where n is the number of output images, c is the number of output image channels, h is the height of the output image, and w is the width of the output image.
7. The method according to claim 1, characterized in that, Before performing target detection on the image to be detected using the first detection algorithm, the following steps are also included: The first detection algorithm is trained.
8. The method according to claim 7, characterized in that, The training of the first detection algorithm includes: Obtain a first training image set, which includes multiple first training images; The first training image set is augmented to obtain a second training image set, which includes multiple second training images. The data augmentation includes at least one of the following: The second training image is obtained by linear interpolating the first training image using random weights. The first training image is scaled using a random scaling ratio to obtain the scaled image as the second training image, and the position of the ground truth bounding box in the second training image is determined. The rotation rate and rotation range are randomly obtained from the cropping ratio threshold, and the candidate cropping regions of the first training image are determined according to the rotation rate and rotation range. The intersection-union ratio (IUR) of the candidate cropping regions and the ground truth bounding boxes in the first training image is calculated. The candidate cropping regions with IUR greater than or equal to a first preset threshold are selected to determine the second training image, and the positions of the ground truth bounding boxes in the second training image are determined.
9. The method according to claim 7, characterized in that, The training of the first detection algorithm includes: The first detection algorithm is trained using at least one of the following training strategies: The first detection algorithm was trained using the exponential moving average method and the DropBlock strategy. The first detection algorithm was trained using a batch normalization method; A pre-trained model of the backbone network on ImageNet is used as the initial backbone network for the first detection algorithm.
10. The method according to claim 1, characterized in that, The second detection algorithm includes at least one of the following: Smoothing filtering; Perform image difference processing between the image after smoothing and the image before smoothing; Image thresholding segmentation; Image filtering processing; Calculate the area of a connected region.
11. The method according to claim 1, characterized in that, The step of obtaining the final target detection result based on the first detection result and the second detection result includes: Obtain the first predicted bounding box of the predicted target in the first detection result, and the second predicted bounding box of the predicted target in the second detection result; Calculate the intersection area of the first predicted bounding box and the second predicted bounding box; If the intersection area is greater than a second preset threshold, the predicted target in the first detection result and the second detection result is determined to be the real target.
12. The method according to claim 1 or 11, characterized in that, The step of obtaining the final target detection result based on the first detection result and the second detection result further includes: Obtain the area of the predicted target in the first detection result; If the area of the predicted target is greater than or equal to a third preset threshold, the predicted target in the first detection result is determined to be the real target.
13. The method according to claim 1 or 11, characterized in that, The step of obtaining the final target detection result based on the first detection result and the second detection result further includes: Obtain the area of the predicted target from the second detection result; If the area of the predicted target is greater than or equal to a fourth preset threshold, the predicted target in the second detection result is determined to be the real target.
14. A target detection system, characterized in that, include: The acquisition module is used to acquire the image to be detected; The first detection module is used to perform target detection on the image to be detected using a first detection algorithm to obtain a first detection result; The second detection module is used to perform target detection on the image to be detected using a second detection algorithm to obtain a second detection result; The determination module is used to obtain the final target detection result based on the first detection result and the second detection result.
15. An electronic device, characterized in that, include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the target detection method as described in any one of claims 1 to 13.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the target detection method as described in any one of claims 1 to 13.
17. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the steps of the target detection method as described in any one of claims 1 to 13.