Three-dimensional electric iron tower detection method and equipment based on SECOND model
Through the improved SECOND model, the Transformer model and the region proposal network are used, combined with the GeLu activation function and partial convolution, to solve the problems of low recognition accuracy and slow speed in 3D power tower detection, achieving higher detection accuracy and faster speed. speed.
Patent Information
- Application Number
- CN202410764771.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-09-03
AI Technical Summary
Existing three-dimensional power tower detection algorithms have problems such as low recognition accuracy and slow speed, especially when reconstructing a three-dimensional model from two-dimensional design drawings, the target detection accuracy is low.
A three-dimensional power tower detection method based on the SECOND model is adopted. The three-dimensional point cloud is obtained and input into the improved SECOND model for target detection. The Transformer model is used to extract features and combined with the region proposal network for target detection. Partial convolutions are replaced to reduce computational complexity. The GeLu activation function is used to improve the model convergence speed.
The detection accuracy is improved by about 10% and the detection speed is accelerated by about 10ms. Compared with traditional methods, it has higher accuracy and faster speed.
Smart Images

Figure CN118587382A
Abstract
Description
Technical Field
[0001] The invention relates to the field of power tower detection, and in particular to a large model-driven three-dimensional power tower detection method. Background Art
[0002] In recent years, the detection algorithm based on two-dimensional model has become more and more mature and has been widely used. With the development of social economy, more and more towers have been built, and the development of tower model detection algorithm will become a very thorny problem. However, the recognition and processing of three-dimensional models are still at a relatively primary stage. The acquisition of three-dimensional models of some transmission lines still remains in the way of first designing into two-dimensional drawings and then manually making three-dimensional models by professionals. The existing three-dimensional algorithms have problems such as low recognition accuracy and slow speed. In addition, with the improvement of large models and the advancement of related electronic technologies, there will be an increasingly large market for three-dimensional tower detection.
[0003] After searching, Chinese invention patent publication number CN117974929A discloses a method for automatically reconstructing a three-dimensional model of a transmission line tower from a design drawing, comprising: step 1, through a deep learning network, representing the design drawing of the transmission line tower at the pixel level as a set of vector primitives; step 2, performing vector classification on the set of vector primitives extracted in step 1, and dividing it into two categories: contour vectors and internal structure vectors; step 3, for the set of contour vectors obtained in step 2, obtaining the viewing angle of each plane through a classification network, using a method of graphical boundary representation, using the correspondence between points and edges between planes, restoring the spatial body information of the shape, and constructing a three-dimensional contour framework of each section of the high-voltage tower; step 4, on the basis of the three-dimensional contour framework constructed in step 3, combined with the internal structure vectors of each two-dimensional plane extracted in step 2, assembling the internal structure vectors of each section of the local component onto the three-dimensional contour framework of the section, obtaining the contour model of each section of the high-voltage tower, and finally combining and assembling the contour models of all sections of the high-voltage tower, and storing them in a point cloud format, to obtain a three-dimensional model of the high-voltage tower. This existing patent has the problem of constructing a three-dimensional contour from the vectors of a two-dimensional design drawing, resulting in low target detection accuracy.
[0004] How to achieve accurate and fast three-dimensional power tower detection has become a technical problem that needs to be solved. Summary of the invention
[0005] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a three-dimensional power tower detection method and equipment based on the SECOND model.
[0006] The purpose of the present invention can be achieved by the following technical solutions:
[0007] According to one aspect of the present invention, a three-dimensional power tower detection method based on a SECOND model is provided, the method comprising:
[0008] First, the 3D point cloud of the power tower is obtained, and then the 3D point cloud is input into the trained improved SECOND model for target detection and the prediction results are output;
[0009] The improved SECOND model includes a backbone network and a region proposal network that are sequentially connected, and the backbone network includes a Transformer model for extracting features of all regions;
[0010] The region proposal network realizes target detection of three-dimensional power towers based on the features of all regions, and the convolution in the region proposal network is a partial convolution.
[0011] Preferably, the Transformer model is a Swim-Transformerv2 model.
[0012] More preferably, the Transformer captures global context information through a self-attention mechanism.
[0013] Preferably, the process of inputting the three-dimensional point cloud into the trained improved SECOND model for target detection and outputting the prediction result includes:
[0014] Step S201, voxelizing the three-dimensional point cloud of the power tower;
[0015] Step S202, extracting voxel features from the voxelized output result, and then inputting them into the backbone network;
[0016] Step S203, the backbone network performs feature extraction with the help of Transformer;
[0017] Step S204: The region proposal network performs target detection and outputs a prediction result.
[0018] More preferably, the process of voxelizing the three-dimensional point cloud of the power tower includes:
[0019] Iterate through the point cloud to determine the voxel to which each point is assigned;
[0020] The position coordinates of the voxels and the number of points are recorded in the hash table to obtain the position information of all voxels and the number of points they contain.
[0021] More preferably, the activation function used to extract voxel features is a GeLu activation function.
[0022] More preferably, the backbone network uses Transformer to perform feature extraction, including inserting a patch merging layer after a convolutional sparse layer, and then halving the depth of the feature map by downsampling and splicing.
[0023] Preferably, the improved SECOND model is trained using an EIoU loss function.
[0024] According to another aspect of the present invention, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the method described above is implemented when the processor executes the program.
[0025] According to a third aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the program implements the method described above when executed by a processor.
[0026] Compared with the prior art, the present invention has the following beneficial effects:
[0027] 1) In the improved model of the present invention, the backbone network uses Transformer to perform feature extraction, and can consider the information of all regions in the image to perform feature extraction, so that the network can more accurately control the generation of image details, so the detection accuracy is higher; the region proposal network uses partial convolution to replace the original 3×3 convolution, and only applies conventional convolution to a part of the input channels and keeps other channels unchanged, which can obtain more spatial information, reduce the dimension to reduce the amount of calculation, and have lower computational complexity; therefore, compared with the traditional two-dimensional target detection algorithm, the detection method of the present invention has higher accuracy and faster speed.
[0028] 2) In the convolution structure of the voxel feature extraction module of the present invention, the original ReLu activation function is replaced by a GeLu activation function, which improves the model convergence speed and further accelerates the detection speed.
[0029] 3) The experimental data of the present invention show that the detection accuracy of defects such as bird nests, damage and corrosion of insulators and damage to basic parts of power towers can be improved by about 10% and the detection speed can be improved by about 10ms compared with traditional detection methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a structural diagram of an improved SECOND model in an embodiment of the present invention;
[0031] Figure 2 Schematic diagram of the detection method in an embodiment of the present invention;
[0032] Figure 3 The figure is a schematic diagram of the process of using the improved SECOND model for detection in an embodiment of the present invention. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0034] This embodiment relates to a three-dimensional power tower detection method based on the SECOND model, such as Figure 2 The method is implemented based on the improved SECOND model and includes the following steps:
[0035] Step S1, using laser radar to obtain a three-dimensional point cloud of the power tower;
[0036] Step S2, input the 3D point cloud of step S1 into the trained improved SECOND model for detection, and output the prediction result, such as Figure 1 and Figure 3 ,include:
[0037] Step S201, converting the three-dimensional point cloud of step S1 into voxels, specifically:
[0038] Initialize a fixed-size tensor and set it to 0, traverse the point cloud to determine the voxel assigned to each point. Record the voxel position coordinates (batch_id, x, y, z) and the number of points, the position information of all voxels and the number of points they contain through the hash table, and input this information into the voxel feature extraction structure of the improved SECOND network; batch_id is the batch index of the voxel, and x, y, z are the three-dimensional position coordinates of the voxel.
[0039] Step S202, extracting voxel features based on the output result of step S201;
[0040] The voxel feature extraction (VFE) module includes a voxel feature encoding layer, which takes the information of all points in each voxel as input and designs a network to extract voxel-by-voxel features. The network consists of a fully connected network consisting of a linear connection layer, a batch normalization layer, and an activation function layer. In this process, each voxel is max-pooled to obtain local features, and these local features are tiled and concatenated with the features of each point. After that, a fully connected network is used to transform these concatenated point-by-point features to achieve point cloud voxelization. After the conversion, the voxelized features are input into the backbone network.
[0041] In the convolution structure of the voxel feature extraction module, the original ReLu activation function is replaced with the GeLu activation function to improve the model convergence speed.
[0042] Step S203, the backbone network uses Transformer to extract features, including: the Transformer model can capture global context information through the self-attention mechanism. When processing images, Transformer can consider the information of all areas in the image, rather than just the local area. Inserting a patch merging layer, and halving the depth of the feature map by downsampling and splicing, can improve model performance while minimizing computational costs. At the end of the backbone network, dimensionality reduction is performed by downsampling, and the result is sent to the region proposal network for prediction, such as Figure 1 .
[0043] In view of the characteristics of power tower detection, a swim-transformerv2 submodule was added to the original SECOND backbone network. The swim-transformerv2 submodule selected a block as the submodule of this article based on the swim-transformerv2 network.
[0044] Step S204: Part of the convolution replaces the ordinary 3×3 convolutional region proposal network (RPN) to perform target detection and output the prediction results, including:
[0045] Partial convolution takes advantage of the fact that feature maps between different channels are highly similar. It applies conventional convolution only to a part of the input channels and keeps other channels unchanged to extract spatial features. At the same time, since partial convolution only performs convolution on some channels without affecting other channels, the computational complexity of partial convolution is lower than that of traditional convolution methods.
[0046] Considering that the above operations may increase the computational overhead, in the region proposal network module, partial convolution (PConv) is used to partially replace the original 3×3 convolution to reduce the computational overhead and improve the detection speed; the EIoU loss function is used to consider the shape and size differences of the target box to complete the model detection.
[0047] The EIoU loss function expression is shown in formula (1):
[0048]
[0049] Among them, L IoU represents the overlap loss, L dis represents the center distance loss, L asp represents the width and height loss. IoU is the intersection over union ratio of the predicted box and the true box, ρ is the Euclidean distance between the two points, b and b gtRepresents the center point coordinates of the predicted box and the real box, c w and c h Respectively represent the width and height of the minimum bounding box covering the predicted box and the real box, w and w gt , h and h gt Represent the width and height of the predicted box and the true box respectively.
[0050] For the detection of defects such as bird nests, damage and corrosion of insulators and damage to basic parts of power towers, the improved model can improve the detection accuracy by up to about 10% and the detection speed by up to about 10ms compared with traditional detection methods.
[0051] While maintaining the advantage of the original SECOND network's faster detection speed, the improved SECOND model replaces the ordinary 3×3 convolution with partial convolution in the region proposal network to further improve the detection accuracy. In the backbone network part, with the help of Transformer, the Swim-Transformerv2 sub-module is designed, so that the network can more accurately control the generation of image details.
[0052] Example 2
[0053] The electronic device of the present invention includes a central processing unit (CPU), which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) or loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for device operation can also be stored. The CPU, ROM and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0054] Multiple components in the device are connected to the I / O interface, including: input units, such as keyboards, mice, etc.; output units, such as various types of displays, speakers, etc.; storage units, such as disks, optical disks, etc.; and communication units, such as network cards, modems, wireless communication transceivers, etc. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunication networks.
[0055] The processing unit performs the various methods and processes described above, such as methods S1 to S2. For example, in some embodiments, methods S1 to S2 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on the device via a ROM and / or a communication unit. When the computer program is loaded into the RAM and executed by the CPU, one or more steps of methods S1 to S2 described above may be performed. Alternatively, in other embodiments, the CPU may be configured to execute methods S1 to S2 in any other appropriate manner (e.g., by means of firmware).
[0056] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0057] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0058] Example 3
[0059] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0060] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A three-dimensional power tower detection method based on the SECOND model, characterized in that: The method includes: First, the 3D point cloud of the power tower is obtained, and then the 3D point cloud is input into the trained improved SECOND model for target detection and the prediction results are output; The improved SECOND model includes a backbone network and a region proposal network that are sequentially connected, and the backbone network includes a Transformer model for extracting features of all regions; The region proposal network realizes target detection of three-dimensional power towers based on the features of all regions, and the convolution in the region proposal network is a partial convolution.
2. A three-dimensional power tower detection method based on SECOND model according to claim 1, characterized in that: The Transformer model is a Swim-Transformerv2 model.
3. A three-dimensional power tower detection method based on SECOND model according to claim 2, characterized in that: The Transformer captures global context information through a self-attention mechanism.
4. A three-dimensional power tower detection method based on SECOND model according to claim 1, characterized in that: The process of inputting the three-dimensional point cloud into the trained improved SECOND model for target detection and outputting the prediction result includes: Step S201, voxelizing the three-dimensional point cloud of the power tower; Step S202, extracting voxel features from the voxelized output result, and then inputting them into the backbone network; Step S203, the backbone network performs feature extraction with the help of Transformer; Step S204: The region proposal network performs target detection and outputs a prediction result.
5. A three-dimensional power tower detection method based on SECOND model according to claim 4, characterized in that: The process of voxelizing the three-dimensional point cloud of the power tower includes: Iterate through the point cloud to determine the voxel to which each point is assigned; The position coordinates of the voxels and the number of points are recorded in the hash table to obtain the position information of all voxels and the number of points they contain.
6. A three-dimensional power tower detection method based on SECOND model according to claim 4, characterized in that: The activation function used to extract voxel features is the GeLu activation function.
7. A three-dimensional power tower detection method based on SECOND model according to claim 4, characterized in that: The backbone network uses Transformer to extract features, including inserting a patch merging layer after a convolutional sparse layer, and then halving the depth of the feature map by downsampling and splicing.
8. A three-dimensional power tower detection method based on SECOND model according to claim 1, characterized in that: The improved SECOND model is trained using the EIoU loss function.
9. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the program, the method according to any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
