Target detection method and system in complex environment and storage medium

By detecting and correcting the detection frame confidence of the images collected by the drone in complex environments, combining the convolutional neural network and attention mechanism, the problem of low accuracy of target detection of communication cables in complex environments is solved, and the improvement is achieved High recognition accuracy.

CN119206550APending Publication Date: 2024-12-27GUANGXI ZHUANG AUTONOMOUS REGION COMM IND SERVICE CO LTD ENG BRANCH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411279117.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

In complex environments, the image quality of the communication cables collected by the drone is low, which affects the accuracy of target detection, especially caused by rain, snow, clouds and dust.

Method used

Using the object detection method in a complex environment, by acquiring the basic image, the detection box with confidence less than the threshold is eliminated, and the detection box with confidence greater than the threshold is corrected, and the semantic features and multiple are extracted using the first and second object detection models respectively. Scale characteristics, target detection combined with attention mechanism.

Benefits of technology

It improves the accuracy of communication cable identification in complex environments, reduces interference from environmental factors, and improves the accuracy of target detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119206550A_ABST
    Figure CN119206550A_ABST
Patent Text Reader

Abstract

The invention relates to a target detection method and system in a complex environment and a storage medium, and the method comprises the steps: carrying out the detection of the confidence degree of a detection frame of a basic image photographed by an unmanned plane under a complex condition, if the probability of a target object in the detection frame is greater than a first threshold value, reserving the detection frame with the small probability of the target object, and carrying out the detection of the confidence degree of the detection frame; according to the target object detection method, the detection frames with the probability of the target object larger than the first threshold value are removed if the detection frames do not meet the requirement, the detection frames with the probability of the target object larger than the first threshold value are corrected, the corrected image is obtained, and then the target object is detected through the corrected image. The interference of factors (such as rain, snow, cloud and dust) such as environment is reduced, and the target detection accuracy of the corrected image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of target detection technology, and in particular, to a target detection method, system, and storage medium in a complex environment. Background Art

[0002] With the development of information technology, the laying of communication cables has basically been fully realized by fiber optic cables, and the laying length and range of fiber optic cables are also constantly increasing, increasing the workload of maintenance personnel.

[0003] At present, drones are often used to inspect communication cables, and computer vision technology is used to detect targets in the collected images to identify safety hazards of communication cables. However, since drones are disturbed by rain, snow, fog and dust during inspection, the quality of the collected images is low, which in turn affects the accuracy of target detection. Summary of the invention

[0004] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.

[0005] The present application aims to at least solve the technical problems existing in the prior art. To this end, the present application proposes a target detection method, system and storage medium in a complex environment, which can improve the accuracy of communication cable recognition in a complex environment.

[0006] A first aspect of an embodiment of the present application provides a method for detecting an object in a complex environment, the method comprising:

[0007] Obtain the basic image of the area to be measured collected by the drone;

[0008] Input the basic image into a first target detection model, and obtain a plurality of detection frames detected by the first target detection model in the basic image and a target object confidence of each detection frame; wherein the target object confidence of the detection frame refers to the probability that the target object exists in the detection frame; and the target object refers to a communication cable;

[0009] Eliminate all the detection frames in the base image whose confidence of the target object is less than a first threshold, and correct the detection frames whose confidence of the target object is greater than the first threshold according to the pixels in the detection frames whose confidence of the target object is greater than the first threshold, to obtain a corrected image;

[0010] The corrected image is input into a second target detection model to obtain the target object in the area to be detected detected by the second target detection model.

[0011] An embodiment of the present application provides a target detection method in a complex environment. The method first detects the confidence of a detection frame of a basic image taken by a drone in a complex environment. If the probability of the target object existing in the detection frame is greater than a first threshold, the detection frame is retained. If the probability of the target object existing in the detection frame is small, it is eliminated. The detection frame with a probability of the target object existing in the detection frame greater than the first threshold is corrected to obtain a corrected image, and then the corrected image is used to detect the target object. Because the confidence comparison is performed in advance, the detection frames that do not meet the requirements are eliminated and the detection frames that meet the requirements are corrected, thereby reducing the interference of environmental factors (such as rain, snow, clouds, fog, and dust), and improving the accuracy of target detection on the corrected image.

[0012] In some embodiments of the present application, the step of correcting the detection frame having a target object confidence greater than the first threshold according to pixels in the detection frame having a target object confidence greater than the first threshold includes:

[0013] Constructing a first pixel block in a boundary area of ​​the detection frame where the target object confidence is greater than the first threshold;

[0014] Constructing a second pixel block in the central area of ​​the detection frame where the target object confidence is greater than the first threshold, wherein the central pixel of the second pixel block is the central pixel of the central area, and the size of the second pixel block is the same as that of the first pixel block;

[0015] Calculating a similarity between the first pixel block and the second pixel block;

[0016] According to the similarity between the first pixel block and the second pixel block, the detection frame whose confidence level of the target object is greater than the first threshold is modified.

[0017] In some embodiments of the present application, the step of modifying the detection frame having a target object confidence level greater than the first threshold value according to the similarity between the first pixel block and the second pixel block includes:

[0018]

[0019] in, is the average value of Q of multiple detection boxes whose confidence of the target object is greater than the first threshold, m*m is the size of the first pixel block and the second pixel block, i,j are the coordinate values ​​of the pixels, is any pixel of the first pixel block, is any pixel of the second pixel block, is the pixel of the first pixel block The pixel features of is the pixel of the second pixel block , s1 and s2 are the preset interval boundary values. is the detection frame whose confidence of the target object after correction is greater than the first threshold, and S is the detection frame whose confidence of the target object before correction is greater than the first threshold.

[0020] In some embodiments of the present application, the first target detection model includes: a first convolutional neural network, a feature fusion module and a first output module;

[0021] The step of inputting the base image into a first target detection model to obtain a plurality of detection frames detected by the first target detection model in the base image and a target object confidence of each detection frame includes:

[0022] Extracting semantic features and texture features from the base image according to the first convolutional neural network;

[0023] fusing the semantic features and the texture features according to the feature fusion module to obtain pixel features;

[0024] A plurality of detection frames and a target object confidence of each of the detection frames are detected from the pixel features according to the first output module.

[0025] In some embodiments of the present application, the second target detection model includes: a second convolutional neural network, an attention module, and a second output module;

[0026] The step of inputting the corrected image into a second target detection model to obtain the target object in the area to be detected detected by the second target detection model includes:

[0027] extracting multi-scale features from the corrected image according to the second convolutional neural network;

[0028] Performing an attention mechanism on the multi-scale features according to the attention module to obtain enhanced features;

[0029] The target object is output from the enhanced features according to the second output module.

[0030] In some embodiments of the present application, the second convolutional neural network includes multiple convolutional layers and corresponding pooling layers and activation functions of the convolutional layers; the sizes of the convolution kernels between the multiple convolutional layers are different.

[0031] In some embodiments of the present application, performing an attention mechanism on the multi-scale features according to the attention module to obtain enhanced features includes:

[0032] Inputting the multi-scale features into the SA channel attention mechanism to obtain a first enhanced feature;

[0033] Multiplying the first enhanced feature with the multi-scale feature to obtain a first multiplied feature;

[0034] Inputting the first multiplied feature into a multi-head attention mechanism to obtain a second enhanced feature;

[0035] Connecting the second enhanced feature with the first multiplied residual to obtain a first connected feature;

[0036] Inputting the first connection feature into a multi-layer perceptron to obtain a first intermediate feature;

[0037] The first connection feature and the first intermediate feature residual are connected to obtain an enhanced feature.

[0038] A second aspect of an embodiment of the present application provides a target detection system in a complex environment, the system comprising:

[0039] An image acquisition unit, used to acquire a basic image of the area to be tested collected by the drone;

[0040] A first processing unit is configured to input the basic image into a first target detection model to obtain a plurality of detection frames detected by the first target detection model in the basic image and a target object confidence of each detection frame; wherein the target object confidence of the detection frame refers to a probability that the target object exists in the detection frame; and the target object refers to a communication cable;

[0041] a model correction unit, configured to remove all the detection frames in the base image whose target object confidence is less than a first threshold, and correct the detection frames whose target object confidence is greater than the first threshold according to the pixels in the detection frames whose target object confidence is greater than the first threshold, so as to obtain a corrected image;

[0042] The second processing unit is used to input the corrected image into a second target detection model to obtain the target object in the area to be detected detected by the second target detection model.

[0043] The electronic device provided in the third aspect of an embodiment of the present application includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the target detection method in a complex environment.

[0044] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the target detection method in a complex environment.

[0045] It can be understood that the beneficial effects of the second to fourth aspects compared with the related art are the same as the beneficial effects of the first aspect compared with the related art. Please refer to the relevant description in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0047] Figure 1 It is a flowchart of a target detection method in a complex environment provided by an embodiment of the present application;

[0048] Figure 2 yes Figure 1 A specific flow chart of step 120 in FIG.

[0049] Figure 3 yes Figure 1 A specific flow chart of step 130 in FIG.

[0050] Figure 4 yes Figure 1 A specific flow chart of step 140 in FIG.

[0051] Figure 5 yes Figure 4 Flow chart of step S520;

[0052] Figure 6 It is a flowchart of a target detection method in a complex environment provided by an embodiment of the present application;

[0053] Figure 7 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0055] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0057] With the development of information technology, the laying of communication cables has basically been fully realized by fiber optic cables, and the laying length and range of fiber optic cables are also constantly increasing, increasing the workload of maintenance personnel.

[0058] At present, drones are often used to inspect communication cables, and computer vision technology is used to detect targets in the collected images to identify safety hazards of communication cables. However, since drones are disturbed by rain, snow, fog and dust during inspection, the quality of the collected images is low, which in turn affects the accuracy of target detection.

[0059] like Figure 1 An embodiment of the present application provides a method for detecting a target in a complex environment. The method for detecting a target in a complex environment includes steps S110 to S140:

[0060] Step S110: Acquire a basic image of the area to be measured collected by the drone.

[0061] Step S120: input the basic image into the first target detection model to obtain multiple detection frames detected by the first target detection model in the basic image and the target object confidence of each detection frame; wherein the target object confidence of the detection frame refers to the probability that the target object exists in the detection frame; the target object refers to the communication cable.

[0062] Step S130, eliminate all detection frames in the basic image whose target object confidence is less than a first threshold, and correct the detection frames whose target object confidence is greater than the first threshold according to the pixels in the detection frames whose target object confidence is greater than the first threshold to obtain a corrected image.

[0063] Step S140: input the corrected image into the second target detection model to obtain the target object in the detection area detected by the second target detection model.

[0064] In this embodiment, the area to be tested refers to the laying area of ​​communication cables, for example, communication cables laid along railway tracks. The drone is equipped with a camera and can inspect the cables through a pre-set moving path. The basic image is the image taken by the drone. Due to the performance of the drone, the clarity of the image is limited, and aerial operations will inevitably encounter rain, snow, clouds and fog, which will result in poor image effects.

[0065] like Figure 2 ,In some embodiments of the present application, the first target detection model includes: a first convolutional neural network, a feature fusion module and a first output module;

[0066] In step S120, the base image is input into the first target detection model to obtain multiple detection frames detected by the first target detection model in the base image and the target object confidence of each detection frame, including steps S210 to S230:

[0067] Step S210: extracting semantic features and texture features from the base image according to the first convolutional neural network.

[0068] Step S220: The semantic features and texture features are fused according to the feature fusion module to obtain pixel features.

[0069] Step S230: Detect multiple detection frames and the target object confidence of each detection frame from the pixel features according to the first output module.

[0070] The first convolutional neural network (CNN) may include a convolution layer, a pooling layer, and a linear activation layer, and then semantic features and texture features may be extracted from the base image. Semantic features refer to features used to represent the meaning of an image in fields such as computer vision. These features capture the semantic information in the data, that is, the meaning or significance of the data. Texture features are explicit features. The feature fusion module is implemented using Concat, and texture and semantic features may be combined through feature fusion, so that the subsequent first output module may learn rich semantic features and texture features from the fused pixel features, and then may output a more accurate detection frame and the confidence of the target object corresponding to the detection frame. The first output module may be a classifier and a regressor, wherein the classifier performs classification, and the regressor is used to detect multiple detection frames and the confidence of the target object of each detection frame.

[0071] like Figure 3 In some embodiments of the present application, the step S130 of correcting the detection frame having a target object confidence greater than the first threshold according to the pixels in the detection frame having a target object confidence greater than the first threshold includes: steps S310 to S340:

[0072] Step S310: construct a first pixel block in the boundary area of ​​the detection frame where the confidence of the target object is greater than a first threshold, for example, an m×m pixel block.

[0073] Step S320: construct a second pixel block in the central area of ​​the detection frame where the confidence of the target object is greater than the first threshold, the central pixel of the second pixel block is the central pixel of the central area, and the size of the second pixel block is the same as that of the first pixel block. Here, the central pixel of the detection frame is used as the center point, and then a pixel block of size mm is constructed.

[0074] Step S330: Calculate the similarity between the first pixel block and the second pixel block. The calculation formula of the similarity is referred to in the subsequent formula and will not be described in detail here.

[0075] Step S340: According to the similarity between the first pixel block and the second pixel block, the detection frame whose confidence level of the target object is greater than the first threshold is corrected.

[0076] In some embodiments of the present application, according to the similarity between the first pixel block and the second pixel block, the detection frame whose confidence of the target object is greater than the first threshold is corrected, including:

[0077]

[0078] in, is the average value of Q of multiple detection boxes whose confidence of the target object is greater than the first threshold, m*m is the size of the first pixel block and the second pixel block, i,j are the coordinate values ​​of the pixels, is any pixel of the first pixel block, is any pixel of the second pixel block, is the pixel of the first pixel block The pixel features of is the pixel of the second pixel block , Q is the first pixel block and the second pixel block, s1 and s2 are the preset interval boundary values, is the detection box whose confidence of the target object after correction is greater than the first threshold, and S is the detection box whose confidence of the target object before correction is greater than the first threshold.

[0079] Among them and It can be calculated by the LBP operator. In this embodiment, because the second pixel block is a pixel block constructed with the central pixel in the detection frame as the center point, the second pixel block is the pixel block closest to the standard pixel block (that is, the pixel block in the standard image corresponding to the standard communication cable), then by determining the proximity probability between the first pixel block and the second pixel block, that is, according to the similarity between the first pixel block and the second pixel block, this similarity can be used as a basis for correcting the first pixel block. If the similarity is relatively high, it is considered that the probability of the first pixel block being close to the standard pixel block is relatively high, and the probability of the information contained therein being successfully recognized is relatively high, and no correction is required. If the similarity is relatively low, it is considered that the probability of the first pixel block being close to the standard pixel block is relatively low, and the probability of the information contained therein being successfully recognized is relatively low, then correction is performed to increase the probability of the information contained in the first pixel block being successfully recognized.

[0080] In this embodiment, the confidence of the detection frame is detected for the basic image taken by the drone in complex conditions. If the probability of the target object existing in the detection frame is greater than a first threshold, the detection frame is retained, and the detection frame with a small probability of the target object existing is removed, and the detection frame with a probability of the target object existing greater than the first threshold is corrected. The correction process includes:

[0081] Constructing a first pixel block in a boundary area of ​​a detection frame where the confidence of the target object is greater than a first threshold;

[0082] Constructing a second pixel block in the central area of ​​the detection frame where the confidence of the target object is greater than the first threshold, wherein the central pixel of the second pixel block is the central pixel of the central area, and the size of the second pixel block is the same as that of the first pixel block;

[0083] Calculating the similarity between the first pixel block and the second pixel block;

[0084] Then, using the pixels of the first pixel block The pixel features of the second pixel block The detection frames with confidence greater than the threshold are enhanced by taking the average of the ratios of the pixel features of each detection frame with confidence greater than the threshold, which can provide the accuracy of target detection in the enhanced image.

[0085] In some embodiments, the second target detection model includes: a second convolutional neural network, an attention module, and a second output module;

[0086] like Figure 4 , input the corrected image into the second target detection model to obtain the target object of the target area to be detected by the second target detection model, including steps S510 to S530:

[0087] Step S510, extracting multi-scale features from the corrected image according to the second convolutional neural network;

[0088] Step S520: performing an attention mechanism on the multi-scale features according to the attention module to obtain enhanced features;

[0089] Step S530: Output the target object from the enhanced features according to the second output module.

[0090] Through multi-scale features, richer features can be extracted from the corrected image, and then these features can be used to enhance the attention mechanism, so that the purpose of enhancing key information can be achieved through attention, and finally the target object can be output from the enhanced features.

[0091] In some embodiments, the second convolutional neural network includes multiple convolutional layers and corresponding pooling layers and activation functions of the convolutional layers; the sizes of the convolution kernels between the multiple convolutional layers are different. The second convolutional neural network can extract convolutional features of different scales, and then use the Concat function to achieve fusion to obtain multi-scale features.

[0092] like Figure 5 In some embodiments, the attention module performs an attention mechanism on the multi-scale features to obtain enhanced features, including steps S410 to S460:

[0093] Step S410: input the multi-scale features into the SA channel attention mechanism to obtain the first enhanced features.

[0094] Step S420: multiply the first enhanced feature by the multi-scale feature to obtain a first multiplied feature.

[0095] Step S430: input the first multiplied feature into the multi-head attention mechanism to obtain the second enhanced feature.

[0096] Step S440: Connect the second enhanced feature to the first multiplied residual to obtain a first connected feature.

[0097] Step S450: input the first connection feature into the multilayer perceptron to obtain the first intermediate feature.

[0098] Step S460: Connect the first connection feature and the first intermediate feature residual to obtain an enhanced feature.

[0099] In this embodiment, the area in the second image that plays a key role in cable identification is extracted through SA channel attention to achieve local attention enhancement, and then a full multi-layer perceptron calculation is performed. On the basis of the area that plays a key role in cable identification, more global features are introduced for information interaction, so as to achieve complementary global and local advantages and improve the accuracy of communication cable identification.

[0100] like Figure 6 Some embodiments of the present application provide a target detection system in a complex environment, the system comprising:

[0101] The image acquisition unit 1100 is used to obtain a basic image of the area to be measured collected by the drone;

[0102] The first processing unit 1200 is used to input the basic image into the first target detection model, and obtain multiple detection frames detected by the first target detection model in the basic image and the target object confidence of each detection frame; wherein the target object confidence of the detection frame refers to the probability that the target object exists in the detection frame; the target object refers to the communication cable;

[0103] The model correction unit 1300 is used to remove all detection frames whose target object confidence is less than a first threshold in the basic image, and correct the detection frames whose target object confidence is greater than the first threshold according to the pixels in the detection frames whose target object confidence is greater than the first threshold, so as to obtain a corrected image;

[0104] The second processing unit 1400 is used to input the corrected image into the second target detection model to obtain the target object in the detection area detected by the second target detection model.

[0105] The system drone of the embodiment of the present application performs detection frame confidence detection on the basic image taken in complex situations. If the probability of the target object existing in the detection frame is greater than a first threshold, the detection frame is retained. The detection frame with a small probability of the target object existing is eliminated, and the detection frame with a probability of the target object existing greater than the first threshold is corrected to obtain a corrected image, which is then used to detect the target object. Because the confidence comparison is performed in advance, the detection frames that do not meet the requirements are eliminated and the detection frames that meet the requirements are corrected, thereby reducing the interference of environmental factors (such as rain, snow, clouds, fog, and dust), thereby improving the accuracy of target detection on the corrected image.

[0106] It should be noted that the target detection system in this complex environment and the target detection method in the above-mentioned complex environment are generated based on the same inventive concept. Therefore, the relevant content of the target detection method in the above-mentioned complex environment is also applicable to the content of this target detection system. Therefore, it will not be introduced here, and you can refer to the target detection method in the above-mentioned complex environment.

[0107] In this embodiment, the device embodiment and the above method embodiment are the same inventive concept and will not be described again here.

[0108] like Figure 7 The embodiment of the present application further provides an electronic device, the electronic device comprising:

[0109] at least one memory;

[0110] at least one processor;

[0111] at least one program;

[0112] The program is stored in the memory, and the processor executes at least one program to implement the target detection method in a complex environment described above in the present disclosure.

[0113] The electronic device may be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a vehicle-mounted computer, etc.

[0114] The electronic device according to the embodiment of the present application is described in detail below.

[0115] The processor 1600 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention.

[0116] The memory 1700 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1700 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the program code is stored in the memory 1700, and the processor 1600 calls and executes the target detection method in a complex environment of the embodiment of the present invention.

[0117] Input / output interface 1800, used to implement information input and output;

[0118] The communication interface 1900 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);

[0119] Bus 2000 , which transmits information between various components of the device (e.g., processor 1600 , memory 1700 , input / output interface 1800 , and communication interface 1900 );

[0120] The processor 1600 , the memory 1700 , the input / output interface 1800 , and the communication interface 1900 are connected to each other in communication within the device via the bus 2000 .

[0121] An embodiment of the present invention further provides a storage medium, which is a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the target detection method in a complex environment.

[0122] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0123] The embodiments described in the present invention are intended to more clearly illustrate the technical solutions of the embodiments of the present invention and do not constitute a limitation on the technical solutions provided by the embodiments of the present invention. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present invention are also applicable to similar technical problems.

[0124] Those skilled in the art will appreciate that the technical solutions shown in the figures do not limit the embodiments of the present invention and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0125] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0126] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0127] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0128] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0129] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

[0131] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0132] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable an electronic device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store programs.

[0133] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A target detection method in a complex environment, characterized in that: The target detection method under the complex environment includes: Obtain the basic image of the area to be measured collected by the drone; Input the basic image into a first target detection model, and obtain a plurality of detection frames detected by the first target detection model in the basic image and a target object confidence of each detection frame; wherein the target object confidence of the detection frame refers to the probability that the target object exists in the detection frame; and the target object refers to a communication cable; Eliminate all the detection frames in the base image whose confidence of the target object is less than a first threshold, and correct the detection frames whose confidence of the target object is greater than the first threshold according to the pixels in the detection frames whose confidence of the target object is greater than the first threshold, to obtain a corrected image; The corrected image is input into a second target detection model to obtain the target object in the area to be detected detected by the second target detection model.

2. The target detection method in a complex environment according to claim 1, characterized in that: The step of correcting the detection frame having a target object confidence greater than the first threshold according to pixels in the detection frame having a target object confidence greater than the first threshold comprises: Constructing a first pixel block in a boundary area of ​​the detection frame where the target object confidence is greater than the first threshold; Constructing a second pixel block in the central area of ​​the detection frame where the target object confidence is greater than the first threshold, wherein the central pixel of the second pixel block is the central pixel of the central area, and the size of the second pixel block is the same as that of the first pixel block; Calculating a similarity between the first pixel block and the second pixel block; According to the similarity between the first pixel block and the second pixel block, the detection frame whose confidence level of the target object is greater than the first threshold is modified.

3. The target detection method in a complex environment according to claim 2, characterized in that: The modifying, according to the similarity between the first pixel block and the second pixel block, the detection frame whose confidence level of the target object is greater than the first threshold, comprises: in, is the average value of Q of multiple detection boxes whose confidence of the target object is greater than the first threshold, m*m is the size of the first pixel block and the second pixel block, i,j are the coordinate values ​​of the pixels, is any pixel of the first pixel block, is any pixel of the second pixel block, is the pixel of the first pixel block The pixel features of is the pixel of the second pixel block , Q is the first pixel block and the second pixel block, s1 and s2 are the preset interval boundary values, is the detection frame whose confidence of the target object after correction is greater than the first threshold, and S is the detection frame whose confidence of the target object before correction is greater than the first threshold.

4. The target detection method in a complex environment according to claim 1, characterized in that: The first target detection model includes: a first convolutional neural network, a feature fusion module and a first output module; The step of inputting the base image into a first target detection model to obtain a plurality of detection frames detected by the first target detection model in the base image and a target object confidence of each detection frame includes: Extracting semantic features and texture features from the base image according to the first convolutional neural network; fusing the semantic features and the texture features according to the feature fusion module to obtain pixel features; A plurality of detection frames and a target object confidence of each of the detection frames are detected from the pixel features according to the first output module.

5. The target detection method in a complex environment according to claim 1, characterized in that: The second target detection model includes: a second convolutional neural network, an attention module and a second output module; The step of inputting the corrected image into a second target detection model to obtain the target object in the area to be detected detected by the second target detection model includes: extracting multi-scale features from the corrected image according to the second convolutional neural network; Performing an attention mechanism on the multi-scale features according to the attention module to obtain enhanced features; The target object is output from the enhanced features according to the second output module.

6. The target detection method in a complex environment according to claim 5, characterized in that: The second convolutional neural network includes multiple convolutional layers and corresponding pooling layers and activation functions of the convolutional layers; the sizes of the convolution kernels between the multiple convolutional layers are different.

7. The target detection method in a complex environment according to claim 5, characterized in that: The performing an attention mechanism on the multi-scale features according to the attention module to obtain enhanced features includes: Inputting the multi-scale features into the SA channel attention mechanism to obtain a first enhanced feature; Multiplying the first enhanced feature with the multi-scale feature to obtain a first multiplied feature; Inputting the first multiplied feature into a multi-head attention mechanism to obtain a second enhanced feature; Connecting the second enhanced feature with the first multiplied residual to obtain a first connected feature; Inputting the first connection feature into a multi-layer perceptron to obtain a first intermediate feature; The first connection feature and the first intermediate feature residual are connected to obtain an enhanced feature.

8. A target detection system in a complex environment, characterized in that: The system comprises: An image acquisition unit, used to acquire a basic image of the area to be tested collected by the drone; A first processing unit is configured to input the basic image into a first target detection model to obtain a plurality of detection frames detected by the first target detection model in the basic image and a target object confidence of each detection frame; wherein the target object confidence of the detection frame refers to a probability that the target object exists in the detection frame; and the target object refers to a communication cable; a model correction unit, configured to remove all the detection frames in the base image whose target object confidence is less than a first threshold, and correct the detection frames whose target object confidence is greater than the first threshold according to the pixels in the detection frames whose target object confidence is greater than the first threshold, to obtain a corrected image; The second processing unit is used to input the corrected image into a second target detection model to obtain the target object in the area to be detected detected by the second target detection model.

9. An electronic device, characterized in that: It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the target detection method in a complex environment as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the target detection method in a complex environment as described in any one of claims 1 to 7.