An improved mosaic sample enhancement method for deep learning object detection

By establishing an index file set in Mosaic data augmentation and filtering error marks using the aspect ratio and area constraint rules, the problem of target box coordinate changes and edge effects in traditional Mosaic methods is solved, and the model accuracy and stability of small object detection in remote sensing images are improved.

CN120107547BActive Publication Date: 2025-08-26MINISTRY OF NATURAL RESOURCES LAND SATELLITE REMOTE SENSING APPL CENT
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510165850.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-14
Publication Date
2025-08-26
Estimated Expiration
2045-02-14

AI Technical Summary

Technical Problem

The traditional Mosaic data enhancement method may lead to the change of coordinates of the target box to increase detection difficulty during the image stitching process, and the processing boundary situation is not flexible enough, which can easily lead to the edge effect and the introduction of error samples at the image stitching, especially in remote sensing images.

Method used

By creating a sample index file set, applying the aspect ratio and area constraint rules to filter the sample set enhanced by Mosaic, delete tags that do not meet the constraints, and fill the image samples with 0 values ​​to clear the pseudo-marking information to ensure the integrity and reliability of the marking target.

Benefits of technology

It effectively solves the problem of error sample marking during Mosaic enhancement process, improves the stability and accuracy of the object detection model, especially in remote sensing images, the effect of small object detection is significant.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120107547B_ABST
    Figure CN120107547B_ABST
Patent Text Reader

Abstract

The present invention discloses an improved deep learning target detection Mosaic sample enhancement method, comprising establishing a sample index file set I for the original target detection sample set S S ; Perform Mosaic enhancement operation on the original target detection sample set S to generate enhanced sample set S mosaic , and the sample index file set I S Synchronize and associate to generate Mosaic index file set I mosaic ; Improve the enhanced sample set S based on aspect ratio constraint rules and area constraint rules mosaic , and edit the enhanced sample set S mosaic The modified sample image data information in the SF is integrated with the improved sample label information and sample image data to construct the final optimized Mosaic sample set SF. mosaic The advantages are: for the target detection sample set processed with Mosaic enhancement, on the basis of retaining the basic enhanced sample features of Mosaic, the introduction of erroneous labels after Mosaic enhancement can be eliminated, and the integrity and correctness of the label information of each object after enhancement can be effectively preserved, providing a more reliable Mosaic enhanced sample set for subsequent model training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of deep learning target detection technology for remote sensing data, and in particular to an improved deep learning target detection mosaic sample enhancement method. Background Art

[0002] With the continuous development of machine vision technology, deep learning-based object detection has been widely used in a variety of fields, including security monitoring, autonomous driving, remote sensing monitoring, and medical image analysis. Sample augmentation technology can provide a large amount of data input, further improving the detection accuracy and generalization ability of the model within the constraints of a limited sample set.

[0003] The core of sample augmentation technology lies in a series of transformations on the original sample set data, gradually evolving from radiation and geometric transformations of single samples to multi-sample sets. Mosaic data augmentation is an emerging augmentation technology based on multi-sample combinations. First proposed in the YOLOv4 paper, it generates new training samples by randomly combining three, four, or nine sample images. This not only expands the number of new sample sets but also ensures that each new training sample contains different information from multiple images, greatly increasing data diversity and helping to improve the model's generalization ability. It has now become an essential algorithm for the training augmentation process in single-stage object detection algorithms.

[0004] Model training with mosaic data enhancement has significant advantages: first, through mosaic data enhancement, the batch size during training is theoretically increased, and more global sample features can be learned, thus greatly improving the generalization ability and accuracy of the model; second, the feature expression of small targets in the sample is enhanced, improving the model's ability to detect small targets. However, traditional mosaic data enhancement methods also have some shortcomings. For example, during the stitching process, the random scaling and cropping of the image may cause large changes in the coordinates of the target frame, thereby increasing the difficulty of target detection. This is obvious in remote sensing image target samples. In addition, traditional mosaic data enhancement methods may not be flexible enough when dealing with boundary conditions, which can easily lead to edge effects at the image stitching, and even destroy the original complete target label frame, further leading to the addition of erroneous samples and causing sample set contamination.

[0005] Therefore, to further enhance the effectiveness of mosaic data augmentation, we propose an improved mosaic sample augmentation method for deep learning object detection. This method optimizes and improves upon traditional mosaic data augmentation, aiming to address the aforementioned issues and improve the performance and accuracy of object detection models, particularly in remote sensing imagery applications where the scale of the target is non-unique and the background is complex. Summary of the Invention

[0006] The purpose of the present invention is to provide an improved deep learning target detection mosaic sample enhancement method to solve the aforementioned problems existing in the prior art.

[0007] In order to achieve the above object, the technical solution adopted by the present invention is as follows:

[0008] An improved deep learning target detection Mosaic sample enhancement method includes the following steps:

[0009] S1, Mosaic enhancement:

[0010] Create a sample index file set I for the original target detection sample set S S ; Perform Mosaic enhancement operation on the original target detection sample set S to generate enhanced sample set S mosaic , and the sample index file set I S Synchronize and associate to generate Mosaic index file set I mosaic ;

[0011] S2, Mosaic enhancement optimization:

[0012] Improved enhanced sample set S based on aspect ratio constraint rule and area constraint rule mosaic , and edit the enhanced sample set S mosaic The modified sample image data information;

[0013] S3. Final optimization of Mosaic sample set acquisition:

[0014] Integrate the improved sample labeling information and sample image data to construct the final optimized Mosaic sample set SF mosaic .

[0015] Preferably, the sample index file set I S The area of ​​each labeled object sample in the original target detection sample set S is stored in ref and aspect ratio R ref And the width of the image ref and high H ref , their calculation units are all pixels;

[0016] Area ref =W ref ×H ref

[0017] R ref =min(W ref ,H ref ) / max(W ref ,H ref )

[0018] Among them, R ref ∈(0,1];min(W ref ,H ref ) and max(W ref ,H ref ) mark the minimum and maximum sides of the rectangle of the target object respectively.

[0019] Preferably, the enhanced sample set S mosaic Including 1*3 mosaic, 2*2 mosaic and 3*3 mosaic, which respectively mean that 3 samples, 4 samples and 9 samples are mosaicked and merged into 1 sample. At the same time, the background part of the unfilled image samples is filled with the default value.

[0020] Preferably, the enhanced sample index file set I mosaic The width, height and area information of the image are recorded in the new mosaic sample set S mosaic The information of the image in is recorded as W m 、H m and Area m .

[0021] Preferably, in step S2, the enhanced sample set S is improved based on the aspect ratio constraint rule and the area constraint rule. mosaic include,

[0022] S21, Combined I mosaic And the newly generated enhanced sample set S mosaic , use the aspect ratio constraint rule to traverse one by one, and delete the sample labels NR after Mosaic enhancement that do not meet the labeling requirements rect , and record its spatial position information NR p ;

[0023] S22, combined with I mosaic And the newly generated enhanced sample set S mosaic , use the area constraint rule to traverse one by one, delete the sample mark NA after Mosaic enhancement that does not meet the marking requirements rect , and record its spatial position information NA p .

[0024] Preferably, the aspect ratio constraint rule is,

[0025]

[0026] Among them, R m For S mosaic The aspect ratio of the target mark in the image. If it is 1, the information is retained. If it is 0, it is automatically deleted. At the same time, L mr = 0 when the position information NRp (x LTR ,y LTR ,x RBR ,y RBR ), x LTR ,y LTR ,x RBR ,y RBR are respectively the upper left corner coordinate and the lower right corner coordinate of the rectangular mark information of the target object in the new mosaic sample image deleted by the aspect ratio constraint rule; ratio The effective pass rate for marking the aspect ratio of mosaic sample target objects.

[0027] Preferably, the area constraint rule is,

[0028]

[0029] Where r = min(W m / W ref ,H m / H ref ), L ma If it is 1, it means S mosaic The target mark information in is retained, and automatically deleted when it is 0. At the same time, L ma = 0 when the position information NA p (x LTA ,y LTA ,x RBA ,y RBA ), x LTA ,y LTA ,x RBA ,y RBA are the upper left corner coordinates and lower right corner coordinates of the rectangular mark information of the target object in the new mosaic sample image deleted by the area rule; σ area It is the effective passing rate of marking area of ​​target objects in mosaic samples.

[0030] Preferably, the enhanced sample set S is edited mosaic The modified sample image data information is as follows:

[0031] The pairs are located in NA p and NR p The image pixel part is filled with 0 value to remove the interference of the pseudo-labeled image information in the Mosaic enhancement sample set.

[0032] Preferably, the enhanced sample set S mosaic The image pixel values ​​follow the following expression,

[0033]

[0034] Among them, P mis the pixel value of the sample image after Mosaic; P image The original sample set pixel value; p is the specific position of the pixel after mosaic enhancement, which is expressed as (x, y) is the point coordinate; V P is the pixel value data at position p.

[0035] Preferably, in step S3, the integrated and improved tag information output format is txt or json format, the mosaic enhanced sample image data is in jpg format, and is redistributed in a ratio of 8:2 according to train and val to form a complete and usable Mosaic target detection enhanced sample set SF mosaic .

[0036] The beneficial effects of the present invention are: 1. The method of the present invention effectively solves the problem of introducing erroneous object labels into the target detection sample set through Mosaic enhancement and expansion. By establishing an index of the original sample set and the enhanced sample set, the relevant attribute information of the marked objects in the mosaic sample set can be quickly queried and fused, and the labeled samples are filtered according to the area and aspect ratio constraint rules, and the image samples are synchronously repaired. It can achieve and ensure the information integrity and reliability of all marked targets in the target detection sample after Mosaic enhancement, reduce the possibility of contaminating the original sample, and is a technical innovation in sample enhancement and enhanced expansion in the field of deep learning target detection technology. 2. The method of the present invention provides a certain reference model for the solution strategy of sample contamination caused by other sample enhancement technologies for target detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 1 is a flowchart of an improved deep learning target detection mosaic sample enhancement method according to an embodiment of the present invention;

[0038] Figure 2 Figure 1 is a schematic diagram of the results after conventional mosaic enhancement in an embodiment of the present invention. A is the original sample set, B, C, and D are the 1*3 mosaic, 2*2 mosaic, and 3*3 mosaic results, respectively. ① is the problem of introducing incorrect labels, and ② is the problem of the mosaic result background filling being inconsistent with the remote sensing image background.

[0039] Figure 3 Schematic diagram of introducing erroneous labeling and improved processing in mosaic samples according to an embodiment of the present invention;

[0040] Figure 4 2 is a schematic diagram of the improvement of mosaic image samples and the consistency with the invalid background in an embodiment of the present invention. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0042] Example 1

[0043] like Figure 1 As shown, in order to overcome the sample contamination problem caused by the Mosaic-based sample enhancement algorithm, an improved deep learning target detection Mosaic sample enhancement method is provided in this embodiment. The deep learning target detection training sample Mosaic enhancement algorithm first establishes a sample index for the original training sample set and stores the geographic attribute information of each labeled object (including area and aspect ratio, etc.); secondly, when performing Mosaic enhancement, the enhanced sample set is subjected to geographic spatial statistics to obtain the relevant attribute information of the labeled object in the Mosaic sample set; again, the results of the previous two times are combined to make a judgment, and the sample is filtered and cleaned with a certain attribute threshold. At the same time, the image sample part of the unqualified labeled object is masked, and finally a Mosaic enhanced sample set with complete labeled objects after combined enhancement is obtained. The method of the present invention analyzes the incomplete target sample labeling information caused by splicing and segmentation in the conventional Mosaic algorithm, and successively formulates sample attribute index, aspect ratio and area constraint rules, improves the problem of introducing erroneous samples after Mosaic enhancement, and improves the stability and usability of the conventional Mosaic enhancement algorithm, especially for the enhancement of small target detection samples in large remote sensing scenes, with better effects.

[0044] The method of the present invention specifically includes the following parts:

[0045] 1. Mosaic Enhancement

[0046] Create a sample index file set I for the original target detection sample set S S ; Perform Mosaic enhancement operation on the original target detection sample set S to generate enhanced sample set S mosaic , and the sample index file set I S Synchronize and associate to generate Mosaic index file set I mosaic .

[0047] In this embodiment, the sample index file set I S The area of ​​each labeled object sample in the original target detection sample set S is stored in ref and aspect ratio R ref And the width of the image ref and high H ref , their calculation units are all pixels; and the aspect ratio R refInstead of simply using the w÷h of each target object’s marking rectangle (w, h are the width and height of the marking rectangle respectively), it is the ratio of the smallest side / largest side of the marking rectangle, so R ref ∈(0,1].

[0048] Area ref =W ref ×H ref

[0049] R ref =min(W ref ,H ref ) / max(W ref ,H ref )

[0050] Among them, min(W ref ,H ref ) and max(W ref ,H ref ) mark the minimum and maximum sides of the rectangle of the target object respectively.

[0051] In this embodiment, the enhanced sample set S mosaic Including 1*3 mosaic, 2*2 mosaic and 3*3 mosaic, which respectively mean that 3 samples, 4 samples and 9 samples are mosaicked and merged into 1 sample. At the same time, the background part of the unfilled image samples is filled with the default value.

[0052] In this embodiment, the enhanced sample index file set I mosaic The image width, height and area information are recorded in the new mosaic sample set S mosaic The information of the image in is recorded as W m 、H m and Area m . Index File Set I mosaic , in addition to being able to index S mosaic In addition to the original attribute information of each marked object, S is added synchronously based on geographic statistics. mosaic Attribute information of each marker object in .

[0053] 2. Mosaic Enhancement and Optimization

[0054] Improved enhanced sample set S based on constraint rules mosaic , and edit the enhanced sample set S mosaic The modified sample image data information in . Constraint rules include aspect ratio constraint and area constraint.

[0055] (1) The aspect ratio constraint is: Combined with I mosaic And the newly generated enhanced sample set S mosaic, use the aspect ratio constraint rule to traverse one by one, and delete the sample labels NR after Mosaic enhancement that do not meet the labeling requirements rect , and record its spatial position information NR p The relevant formula is,

[0056]

[0057] Among them, R m For S mosaic The aspect ratio of the target mark in the image. If it is 1, the information is retained. If it is 0, it is automatically deleted. At the same time, L mr = 0 when the position information NR p (x LTR ,y LTR ,x RBR ,y RBR ), x LTR ,y LTR ,x RBR ,y RBR are respectively the upper left corner coordinate and the lower right corner coordinate of the rectangular mark information of the target object in the new mosaic sample image deleted by the aspect ratio constraint rule; ratio The effective pass rate for marking the aspect ratio of mosaic sample target objects is usually set to 0.22.

[0058] (2) Area constraint: Combined with I mosaic And the newly generated enhanced sample set S mosaic , use the area constraint rule to traverse one by one, delete the sample mark NA after Mosaic enhancement that does not meet the marking requirements rect , and record its spatial position information NA p The relevant formula is,

[0059]

[0060] Where r = min(W m / W ref ,H m / H ref ), L ma If it is 1, it means S mosaic The target mark information in is retained, and automatically deleted when it is 0. At the same time, L ma = 0 when the position information NA p (x LTA ,y LTA ,x RBA ,y RBA ), x LTA ,y LTA ,x RBA ,y RBAare respectively the upper left corner coordinate and the lower right corner coordinate of the target object rectangle mark information in the new mosaic sample image deleted by the area rule; σ area The effective pass rate for marking the target object area of ​​the mosaic sample is usually set to 0.75.

[0061] In this embodiment, the enhanced sample set S is edited. mosaic The modified sample image data information is as follows:

[0062] The pairs are located in NA p and NR p The pixel part of the image is filled with 0 values ​​to remove the interference of the pseudo-labeled image information in the Mosaic enhanced sample set. The pixel value of the sample image after Mosaic enhancement follows the following expression:

[0063]

[0064] Among them, P m is the pixel value of the sample image after Mosaic, P image The original sample set pixel value, p is the specific position of the pixel after mosaic enhancement, which is expressed as (x, y) is the point coordinate, V P is the pixel value data at position p.

[0065] 3. Final optimization of Mosaic sample set acquisition

[0066] Integrate the improved sample labeling information and sample image data to construct the final optimized Mosaic sample set SF mosaic .

[0067] In this embodiment, the integrated and improved label information output format is usually txt or json format, the mosaic enhanced sample image data is usually jpg format, and is redistributed in a ratio of 8:2 according to train and val to form a complete and usable Mosaic target detection enhanced sample set SF mosaic .

[0068] Example 2

[0069] In this embodiment, the execution process of the method of the present invention is specifically described by taking remote sensing wind turbine target detection as an example.

[0070] 1. Mosaic Enhancement

[0071] The original sample set S selects true color images in jpg format with a size of 1024*1024px as image samples. The wind turbine target label information is in txt format, where each line of the text records the rectangular frame label information of a wind turbine target, represented by the center point (cx, cy) and width and height (w, h). The data is expressed as (cx, cy, w, h). For each sample image and label, an index file set I is established. S , the specific file format is text txt, the first line records the W of the image sample ref =1024,H ref =1024, each subsequent line records a wind turbine target and calculates its area ref and aspect ratio R ref .

[0072] For the original sample set S, 1*3, 2*2 and 3*3 mosaic enhancements are performed respectively to obtain the enhanced sample set S mosaic ,like Figure 2 As shown in the figure, we can see that different Mosaic enhancement methods may introduce different degrees of error samples, and the index file after mosaic enhancement is updated synchronously. mosaic , update the area, aspect ratio and other information of all targets in the mosaic sample set.

[0073] in, Figure 2 A is the original sample set, B is the sample enhanced by 1*3 mosaic, C is the sample enhanced by 2*2 mosaic, and D is the sample enhanced by 3*3 mosaic. It can be seen that the conventional Mosaic algorithm will introduce erroneous samples as indicated by the arrows, which in turn cause pollution: ① The mosaic operation divides the original sample set, resulting in incomplete target labeling information; ② The 114 pixel value used to fill invalid values ​​after mosaic processing conflicts with the invalid value 0 in the remote sensing image background.

[0074] Utilize I mosaic You can quickly query the corresponding original sample in each mosaic sample, such as Figure 3 As shown in the figure, taking 2*2 mosaic enhancement as an example, it can be seen that the original sample 1 is at the lower left corner of the mosaic enhancement sample, and the original sample 2 is at the upper left corner of the mosaic enhancement sample. By counting the relative positions of the wind turbine target and the image sample, after traversal, it is found that there are 2 error samples in the original sample 1 after mosaicking; there is 1 error sample in the original sample 2 after mosaicking.

[0075] 2. Mosaic Enhancement and Optimization

[0076] After statistical analysis, the target NR in the original sample 1 rect_1The aspect ratio is 0.951, and the size after mosaicking is 0.143. According to the aspect ratio constraint rule, since σ is less than 0.22, ratio , so delete it directly and record its four corner positions NR p_rect1 (x LTA ,y LTA ,x RBA ,y RBA )=(0,603,6,637); target NR in original sample 1 rect_2 The aspect ratio of the mosaic is 0.4, which is temporarily retained. Similarly, the target NR in 2 is the same. rect_1 After inlaying, it is 0.458, so it is also temporarily retained.

[0077] The area constraint rule is used to process the target labels of the mosaic label samples that do not meet the requirements. Figure 3 As shown, the target NA in the original sample 1 rect_1 has been deleted, so for NA rect_2 The area is 4725px 2 , the area after mosaic is 490px 2 According to the area constraint rule, we can know that r = min (387 / 1024, 548 / 1024) = 0.378, NA m_rect_2 =r×NA rect_2 ×0.75=1339, so at this time L ma_rect2 =0, then NA rect_2 Also introduced as an error, it is also deleted and its NA in the mosaic is recorded. p_rect2 (x LTA ,y LTA ,x RBA ,y RBA )=(0,847,13,883), similarly for the target NA in the original sample 2 2_rect_1 , after calculation, we get L ma2_rect1 = 0, which is also an error sample and needs to be deleted, and its NA in the mosaic is recorded. p2_rect1 (x LTA ,y LTA ,x RBA ,y RBA )=(0,97,11,118). After the above processing, the comparison of the effects of conventional Mosaic and improved Mosaic is shown in Table 1.

[0078] Table 1 Target statistics before and after Mosaic enhancement and improvement algorithm

[0079] Serial number algorithm Enhancement method Target Marking Statistics Valid target markers Effective proportion 1 Regular Mosaic 2*2 22 19 86.4% 2 Mosaic of the present invention 2*2 19 19 100%

[0080] According to the coordinates of the target frame that does not meet the aspect ratio and area constraint rules obtained by the above process, the image sample pixels within its coordinate range are filled with 0 values ​​(such as Figure 4 At the same time, the values ​​of 114 in the three RGB bands are replaced with 0, so that the invalid pixel values ​​in the sample set image are consistent with the invalid background values ​​of the remote sensing image, as shown in Figure 4 As shown by the arrow in (2), the interference and instability factors in the sample are further reduced.

[0081] 3. Final optimization of Mosaic sample set acquisition

[0082] After the above steps, based on the conventional mosaic sample enhancement technology, the aspect ratio and area constraint rules are used to reduce the number of erroneous samples introduced by the mosaic, and the mosaic image samples are modified simultaneously. Through zero-value masking and filling, the enhanced samples after the mosaic are finally obtained. On the basis of the original sample size of 10044, 2511 2*2 mosaic samples and 1116 3*3 mosaic samples are added to form the SF mosaic The sample set, totaling 13,671, is divided into 10,937 training sample sets and 2,734 validation sample sets with an 8:2 ratio.

[0083] By adopting the above technical solution disclosed in the present invention, the following beneficial effects are obtained:

[0084] The present invention provides an improved deep learning target detection mosaic sample enhancement method. The method of the present invention effectively solves the problem of introducing erroneous object labels in the target detection sample set through mosaic enhancement and expansion. By establishing an index of the original sample set and the enhanced sample set, the relevant attribute information of the labeled objects in the mosaic sample set is quickly queried and fused, and the labeled samples are filtered according to the area and aspect ratio constraints, and the image samples are synchronously repaired. This can achieve and ensure the information integrity and reliability of all labeled targets in the target detection sample after mosaic enhancement, reduce the possibility of contamination of the original sample, and is a technical innovation in sample enhancement and enhanced expansion in the field of deep learning target detection technology. The method of the present invention provides a certain reference model for the solution strategy of sample contamination caused by other sample enhancement technologies for target detection.

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

Claims

1. An improved deep learning object detection mosaic sample enhancement method, characterized by: The following steps are included: S1, Mosaic enhancement: Create a sample index file set I for the original target detection sample set S S ; Perform Mosaic enhancement operation on the original target detection sample set S to generate enhanced sample set S mosaic , and the sample index file set I S Synchronize and associate to generate Mosaic index file set I mosaic ; S2, Mosaic enhancement optimization: Improved enhanced sample set S based on aspect ratio constraint rule and area constraint rule mosaic , and edit the enhanced sample set S mosaic The modified sample image data information; In step S2, the enhanced sample set S is improved based on the aspect ratio constraint rule and the area constraint rule. mosaic include, S21, Combined I mosaic And the newly generated enhanced sample set S mosaic , use the aspect ratio constraint rule to traverse one by one, and delete the sample labels NR after Mosaic enhancement that do not meet the labeling requirements rect , and record its spatial position information NR p ; The aspect ratio constraint rule is, Among them, R m For S mosaic The aspect ratio of the target mark in the image. If it is 1, the information is retained. If it is 0, it is automatically deleted. At the same time, L mr = 0 when the position information NR p (x LTR ,y LTR ,x RBR ,y RBR ), x LTR ,y LTR ,x RBR ,y RBR are respectively the upper left corner coordinates and the lower right corner coordinates of the rectangular mark information of the target object in the new mosaic sample image deleted by the aspect ratio constraint rule; ratio The effective pass rate of marking the aspect ratio of mosaic sample target objects; S22, combined with I mosaic And the newly generated enhanced sample set S mosaic , use the area constraint rule to traverse one by one, delete the sample mark NA after Mosaic enhancement that does not meet the marking requirements rect , and record its spatial position information NA p ; The area constraint rule is: Where r = min(W m / W ref ,H m / H ref ), L ma If it is 1, it means S mosaic The target mark information in is retained, and automatically deleted when it is 0. At the same time, L ma = 0 when the position information NA p (x LTA ,y LTA ,x RBA ,y RBA ), x LTA ,y LTA ,x RBA ,y RBA are respectively the upper left corner coordinates and the lower right corner coordinates of the rectangular mark information of the target object in the new mosaic sample image deleted by the area rule; σ area The effective passing rate of marking area for target objects of mosaic samples; S3. Final optimization of Mosaic sample set acquisition: Integrate the improved sample labeling information and sample image data to construct the final optimized Mosaic sample set SF mosaic .

2. The improved deep learning target detection mosaic sample enhancement method according to claim 1, characterized in that: Sample Index File Set I S The area of ​​each labeled object sample in the original target detection sample set S is stored in ref and aspect ratio R ref And the width of the image ref and high H ref , their calculation units are all pixels; Area ref =W ref ×H ref R ref =min(W ref ,H ref ) / max(W ref ,H ref ) Among them, R ref ∈(0,1];min(W ref ,H ref ) and max(W ref ,H ref ) mark the minimum and maximum sides of the rectangle of the target object respectively.

3. The improved deep learning target detection mosaic sample enhancement method according to claim 1, characterized in that: Enhanced sample set S mosaic Including 1*3 mosaic, 2*2 mosaic and 3*3 mosaic, which respectively mean that 3 samples, 4 samples and 9 samples are mosaicked and merged into 1 sample. At the same time, the background part of the unfilled image samples is filled with the default value.

4. The improved deep learning target detection mosaic sample enhancement method according to claim 1, characterized in that: Enhanced sample index file set I mosaic The width, height and area information of the image are recorded in the new mosaic sample set S mosaic The information of the image in is recorded as W m 、H m and Area m .

5. The improved deep learning target detection mosaic sample enhancement method according to claim 1, characterized in that: Edit Enhanced Sample Set S mosaic The modified sample image data information is as follows: The pairs are located in NA p and NR p The image pixel part is filled with 0 value to remove the interference of the pseudo-labeled image information in the Mosaic enhancement sample set.

6. The improved deep learning target detection mosaic sample enhancement method according to claim 5, characterized in that: Enhanced sample set S mosaic The image pixel values ​​follow the following expression, Among them, P m is the pixel value of the sample image after Mosaic; P image The original sample set pixel value; p is the specific position of the pixel after mosaic enhancement, which is expressed as (x, y) is the point coordinate; V P is the pixel value data at position p.

7. The improved deep learning target detection mosaic sample enhancement method according to claim 1, characterized in that: In step S3, the integrated and improved tag information is output in txt or json format, the mosaic enhanced sample image data is in jpg format, and the train and val are redistributed in a ratio of 8:2 to form a complete and usable Mosaic target detection enhanced sample set SF mosaic .

Citation Information

Patent Citations

  • Meteorite crater detection method based on image enhancement and YOLOv5 improvement

    CN115661622A

  • Ground penetrating radar underground drainage pipe network image detection method based on improved YOLOv5

    CN116452982A