Method for establishing target detection model, application method, equipment, device and medium

By using depth-separable convolution layers and multi-scale feature fusion mechanisms in the target detection model, combined with NetAdapt and pruning algorithms, the target detection model is optimized, solving the problem of low target detection efficiency on embedded devices, and achieving a better Faster and more accurate detection results.

CN114627282BActive Publication Date: 2024-09-13PING AN TECH (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210254685.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-15
Publication Date
2024-09-13
Estimated Expiration
2042-03-15

AI Technical Summary

Technical Problem

Existing target detection algorithms are difficult to achieve real-time detection on embedded devices, mainly due to the large number of network parameters and insufficient processor performance, resulting in low detection efficiency on mobile phones and other devices.

Method used

By replacing the ordinary convolutional layer of the basic target detection network with a depth-separable convolutional layer, adding a multi-scale feature fusion mechanism, and combining the NetAdapt algorithm and the pruning algorithm, the target detection model is optimized to obtain the final target detection model.

Benefits of technology

It reduces the data processing burden on the processor of the embedded device, improves the efficiency and accuracy of target detection, enables the target detection model to run on different embedded devices, and the overall detection speed is faster.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114627282B
    Figure CN114627282B
Patent Text Reader

Abstract

The present invention discloses a method for establishing a target detection model, an application method, a device, an apparatus and a medium, which can be used in the field of image recognition; the establishment method comprises: obtaining a basic target detection network, replacing the ordinary convolution layer of the basic target detection network with a depth-separable convolution layer, and adding a multi-scale feature fusion mechanism to the basic target detection network to obtain an initial target detection model; obtaining a preset digital image, and inputting the preset digital image into the initial target detection model; extracting features of the preset digital image through the depth-separable convolution layer of the initial target detection model, and outputting a feature map; performing target detection on the feature map through the multi-scale feature fusion mechanism of the initial target detection model to obtain an intermediate target detection model; optimizing the intermediate target detection model using a NetAdapt algorithm and a pruning algorithm to obtain a final target detection model. The present invention can effectively improve the target detection efficiency of embedded devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition, and in particular to a method for establishing a target detection model, an application method, equipment, a device and a medium. Background Art

[0002] Object detection is widely used in many fields such as robot navigation, intelligent video surveillance, industrial inspection, aerospace, etc. At the same time, object detection is also a pre-order algorithm required by many visual tasks, and plays a vital role in subsequent tasks such as face recognition, gait recognition, crowd counting, and instance segmentation. Due to the widespread application of deep learning, object detection algorithms have developed rapidly. Object detection algorithms based on deep learning are mainly divided into (1) two-stage object detection: the first stage generates candidate regions, which contain the approximate location information of the target, and then the second stage classifies the candidate regions and refines the location; (2) single-stage object detection: directly generate the category probability and corresponding location coordinate value of the object.

[0003] The number of network parameters of existing target detection algorithms is relatively large. In practical applications, they rely on large computers such as servers to achieve real-time target detection. However, it is difficult to achieve this effect when the network structure is transplanted to embedded devices such as mobile phones because the processor performance of embedded devices is far inferior to that of servers. 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 embodiments of the present invention provide a method for establishing a target detection model, an application method, a device, an apparatus and a medium, which can effectively improve the target detection efficiency of an embedded device.

[0006] In the first aspect, an embodiment of the present invention provides a method for establishing a target detection model, including: obtaining a basic target detection network, replacing the ordinary convolution layer of the basic target detection network with a depthwise separable convolution layer, and adding a multi-scale feature fusion mechanism to the basic target detection network to obtain an initial target detection model; obtaining a preset digital image, and inputting the preset digital image into the initial target detection model; performing feature extraction on the preset digital image through the depthwise separable convolution layer of the initial target detection model, and outputting a feature map; performing target detection on the feature map through the multi-scale feature fusion mechanism of the initial target detection model to obtain an intermediate target detection model; and optimizing the intermediate target detection model using the NetAdapt algorithm and the pruning algorithm to obtain a final target detection model.

[0007] In some embodiments, the NetAdapt algorithm optimizes the convolution kernel of the depth-separable convolution layer of the intermediate target detection model; and the pruning algorithm optimizes the network structure of the intermediate target detection model.

[0008] In some embodiments, the feature extraction of the preset digital image is performed through the depthwise separable convolutional layer of the initial target detection model, and the output feature map includes: performing channel dimensionality upscaling processing on the preset digital image by pointwise convolution; performing feature extraction processing on the preset digital image after channel dimensionality upscaling by depthwise convolution to obtain multiple initial feature maps; performing channel dimensionality reduction processing on the multiple initial feature maps by pointwise convolution, and outputting the final feature map.

[0009] In some embodiments, the performing target detection on the feature map through the multi-scale feature fusion mechanism of the initial target detection model includes: obtaining the height and width of the first final feature map output by the first depth-separable convolutional layer; obtaining and adjusting the height and width of the second final feature map output by the second depth-separable convolutional layer so that the height and width of the second final feature map are the same as the height and width of the first final feature map; performing channel stitching and convolution on the adjusted second final feature map and the first final feature map to obtain a fused feature; and performing target detection based on the fused feature.

[0010] In some embodiments, the use of the NetAdapt algorithm and the pruning algorithm to optimize the intermediate target detection model includes: the NetAdapt algorithm optimizes the convolution kernel of a layer of the original depth-separable convolutional network to obtain multiple second depth-separable convolutional networks; the NetAdapt algorithm compares the latency and accuracy of one of the second depth-separable convolutional networks with the original depth-separable convolutional network corresponding to the second depth-separable convolutional network, and selects the final depth-separable convolutional network based on the comparison result.

[0011] In some embodiments, the selecting of the final depth-separable convolutional network according to the comparison result includes: when the latency of the second depth-separable convolutional network is greater than the latency of the original depth-separable convolutional network and / or the accuracy of the second depth-separable convolutional network is lower than that of the original depth-separable convolutional network, selecting the original depth-separable convolutional network as the final depth-separable convolutional network; when the latency of the second depth-separable convolutional network is less than the latency of the original depth-separable convolutional network and the accuracy of the second depth-separable convolutional network is higher than that of the original depth-separable convolutional network, selecting the second depth-separable convolutional network as the final depth-separable convolutional network.

[0012] In some embodiments, it also includes: the pruning algorithm prunes the network structure of the intermediate target detection model to remove redundant weight parameters of the network structure; the pruning algorithm fine-tunes the intermediate target detection model after pruning.

[0013] In some embodiments, removing redundant weight parameters of the network structure includes: encoding the network structure based on the number of channels in each layer of the intermediate target detection model after pruning to obtain a number of encoding vectors; inputting the encoding vectors into the intermediate target detection model to generate network weights after pruning; obtaining the performance of the intermediate target detection model after pruning based on the network structure, the network weights and a preset validation set; using an evolutionary algorithm to screen the several encoding vectors to obtain a final encoding vector, and obtaining the final target detection model based on the final encoding vector.

[0014] In some embodiments, the initial target detection model also includes a system loss function, and the system loss function includes a bounding box coordinate error function, a bounding box confidence error function, and a classification error function.

[0015] In second aspect, an embodiment of the present invention provides an application method of a target detection model, including: acquiring an actual digital image, and inputting the actual digital image into a final target detection model; performing feature extraction on the actual digital image through a depth-separable convolutional layer of the target detection model, and outputting a feature map; and performing target detection on the feature map through a multi-scale feature fusion mechanism of the target detection model.

[0016] In the third aspect, an embodiment of the present invention provides a target detection model establishment device, including: a network modification module, used to obtain a basic target detection network, replace the ordinary convolution layer of the basic target detection network with a depth-separable convolution layer, and add a multi-scale feature fusion mechanism to the basic target detection network to obtain an initial target detection model; a digital image acquisition module, used to obtain a preset digital image, and input the preset digital image into the initial target detection model; a feature extraction module, used to extract features of the preset digital image through the depth-separable convolution layer of the initial target detection model, and output a feature map; a target detection module, used to perform target detection on the feature map through the multi-scale feature fusion mechanism of the initial target detection model to obtain an intermediate target detection model; a model optimization module, used to optimize the intermediate target detection model using the NetAdapt algorithm and the pruning algorithm to obtain the final target detection model.

[0017] In a fourth aspect, an embodiment of the present invention provides a target detection device, comprising: a digital image acquisition module, used to acquire an actual digital image and input the actual digital image into a target detection model; a feature extraction module, used to extract features of the actual digital image through a depth-separable convolutional layer of the target detection model and output a feature map; a target detection module, used to perform target detection on the feature map through a multi-scale feature fusion mechanism of the target detection model.

[0018] In a fifth aspect, an embodiment of the present invention provides a target detection device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for establishing a target detection model as described in the first aspect above and / or the method for applying a target detection model as described in the second aspect above are implemented.

[0019] In the sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, characterized in that it stores computer-executable instructions, and the computer-executable instructions are used to execute the method for establishing a target detection model as described in the first aspect above and / or the method for applying the target detection model as described in the second aspect above.

[0020] The beneficial effects of the embodiments of the present invention include: the embodiment obtains a basic target detection network, replaces the ordinary convolution layer of the basic target detection network with a deep separable convolution layer, and adds a multi-scale feature fusion mechanism to the basic target detection network to obtain an initial target detection model; obtains a preset digital image, and inputs the preset digital image into the initial target detection model; extracts features of the preset digital image through the deep separable convolution layer of the initial target detection model, and outputs a feature map; performs target detection on the feature map through the multi-scale feature fusion mechanism of the initial target detection model to obtain an intermediate target detection model; and optimizes the intermediate target detection model using the NetAdapt algorithm and the pruning algorithm to obtain the final target detection model. The present invention replaces the ordinary convolution layer in the basic target detection network with a deep separable convolution layer, and adds a multi-scale feature fusion mechanism to obtain an initial target detection model. The initial target detection model uses deep separable convolution to extract features. Compared with extracting features using ordinary convolution, the number of parameters of deep separable convolution is less, thereby reducing the data processing burden of the processor in the embedded device. Similarly, under the same number of parameters, the number of neural network layers using deep separable convolution can be made deeper. Adding a multi-scale feature fusion mechanism enables the target detection model to learn both deep and shallow features when performing target detection, which will have a better expression effect on the features and enhance the detection accuracy of the target. Obtain a preset digital image and input the preset digital image into the initial target detection model to train the initial target detection model and obtain an intermediate target detection model. The NetAdapt algorithm and pruning algorithm are used to optimize the intermediate target detection model to obtain the final target detection model. The NetAdapt algorithm and pruning algorithm miniaturize the intermediate target detection model to obtain the final target detection model, so as to achieve the purpose of accelerating reasoning. The final target detection model can run on different embedded devices, and the overall detection speed will also be faster, which improves the effect of target detection on embedded devices.

[0021] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the technical solution of the present invention and do not constitute a limitation on the technical solution of the present invention.

[0023] Figure 1 is a schematic diagram of a system architecture platform for establishing a target detection model and applying the target detection model provided by an embodiment of the present invention;

[0024] Figure 2 is a flow chart of a method for establishing a target detection model provided by an embodiment of the present invention;

[0025] Figure 3 is a flow chart of a feature extraction method provided by an embodiment of the present invention;

[0026] Figure 4 is a flow chart of a method for target detection using a multi-scale feature fusion mechanism provided by an embodiment of the present invention;

[0027] Figure 5 is a flow chart of the NetAdapt algorithm optimization process provided by an embodiment of the present invention;

[0028] Figure 6 is a flowchart of the pruning algorithm optimization process provided by an embodiment of the present invention;

[0029] Figure 7 is a flow chart of an application method of a target detection model provided by an embodiment of the present invention;

[0030] Figure 8 is a schematic diagram of the structure of a target detection model building device provided by an embodiment of the present invention;

[0031] Fig. 9 It is a schematic diagram of the structure of a target detection device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention 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 invention and are not used to limit the present invention.

[0033] In the description of the present invention, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed" etc. are understood as not including the number itself, and "above", "below", "within" etc. are understood as including the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.

[0034] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.

[0035] 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.

[0036] First, several nouns involved in the present invention are analyzed:

[0037] Artificial Intelligence (AI): It is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science. AI attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robots, language recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0038] Natural Language Processing (NLP): NLP uses computers to process, understand, and apply human languages ​​(such as Chinese, English, etc.). NLP is a branch of artificial intelligence and an interdisciplinary subject between computer science and linguistics. It is often referred to as computational linguistics. Natural language processing includes grammatical analysis, semantic analysis, and text comprehension. Natural language processing is commonly used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information retrieval, information extraction and filtering, text classification and clustering, public opinion analysis, and opinion mining. It involves data mining related to language processing, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computing.

[0039] Information Extraction (NER): A text processing technology that extracts specified types of entity, relationship, event and other factual information from natural language text and forms structured data output. Information extraction is a technology that extracts specific information from text data. Text data is composed of some specific units, such as sentences, paragraphs, and chapters. Text information is composed of some small specific units, such as characters, words, phrases, sentences, paragraphs, or a combination of these specific units. Extracting noun phrases, names, place names, etc. from text data are all text information extraction. Of course, the information extracted by text information extraction technology can be various types of information.

[0040] In the related technologies, target detection is a hot topic in the field of computer vision and digital image processing, and is widely used in many fields such as robot navigation, intelligent video surveillance, industrial inspection, aerospace, etc. At the same time, target detection is also a pre-order algorithm required by many visual tasks, and plays a vital role in subsequent tasks such as face recognition, gait recognition, crowd counting, and instance segmentation. Due to the widespread application of deep learning, target detection algorithms have developed rapidly. The target detection algorithms based on deep learning are mainly divided into (1) two-stage target detection: the first stage generates candidate regions, which contain the approximate location information of the target, and then the second stage classifies and refines the location of the candidate regions; (2) single-stage target detection: directly generates the category probability and corresponding location coordinate value of the object. Compared with the two-stage algorithm, the existing single-stage algorithm does not need to generate candidate regions, and the overall process is simpler and faster, but the accuracy is not high enough; while the two-stage algorithm guarantees the accuracy, the speed is not fast enough; and the number of network parameters of the existing target detection algorithms is relatively large. In practical applications, it relies on large computers such as servers to achieve the effect of real-time target detection. However, when the network structure is transplanted to embedded devices such as mobile phones, it is difficult to achieve this effect because the processor performance of embedded devices is far inferior to that of servers.

[0041] Based on this, the embodiments of the present invention provide a method for establishing a target detection model, an application method, a device, an apparatus and a medium, which can effectively improve the target detection efficiency of embedded devices.

[0042] The embodiments of the present invention can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0043] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0044] The methods for establishing and applying target detection models provided in the embodiments of the present invention relate to the fields of artificial intelligence and digital medical technology. The methods for establishing and applying target detection models provided in the embodiments of the present invention can be applied to a terminal, or to a server, or can be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server can be configured as an independent physical server, or as a server cluster or distributed system consisting of multiple physical servers, or as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements a target detection model, etc., but is not limited to the above forms.

[0045] The present invention can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present invention can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present invention can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0046] The embodiments of the present invention are further described below with reference to the accompanying drawings.

[0047] like Figure 1 As shown, Figure 1 It is a schematic diagram of a system architecture platform for establishing a target detection model and applying a target detection model provided by an embodiment of the present invention.

[0048] The system architecture platform 100 of the embodiment of the present invention includes one or more processors 110 and a memory 120. Figure 1 In the figure, a processor 110 and a memory 120 are taken as an example.

[0049] The processor 110 and the memory 120 may be connected via a bus or other means. Figure 1 The example of connecting through bus is taken in the following.

[0050] The memory 120, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 120 may optionally include a memory 120 remotely disposed relative to the processor 110, and these remote memories may be connected to the system architecture platform 100 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.

[0051] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation on the system architecture platform 100, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0052] like Figure 2 As shown, Figure 2 It is a flowchart of a method for establishing a target detection model provided in an embodiment of the present invention. The method for establishing a target detection model in an embodiment of the present invention includes but is not limited to step S200, step S210, step S220, step S230, step S240 and step S250.

[0053] Step S200, obtaining a basic target detection network;

[0054] Step S210, replacing the common convolutional layer of the basic object detection network with a depth-wise separable convolutional layer, and adding a multi-scale feature fusion mechanism to the basic object detection network to obtain an initial object detection model;

[0055] Step S220, obtaining a preset digital image, and inputting the preset digital image into an initial target detection model;

[0056] Step S230, extracting features from the preset digital image through the depth-separable convolutional layer of the initial target detection model, and outputting a feature map;

[0057] Step S240, performing target detection on the feature map through the multi-scale feature fusion mechanism of the initial target detection model to obtain an intermediate target detection model;

[0058] Step S250, using the NetAdapt algorithm and the pruning algorithm to optimize the intermediate target detection model to obtain the final target detection model.

[0059] In an embodiment of the present invention, a basic target detection network is obtained, and the backbone structure of the basic target detection network is just replaced by a lightweight neural network, which refers to a neural network model that requires a small number of parameters and a small computational cost. Since the micro neural network has a small computational overhead, the micro neural network model can be deployed on devices with limited computing resources, such as smart phones, tablets, or other embedded devices.

[0060] The common convolution layer of the basic target detection network is replaced with a depthwise separable convolution layer. The depthwise separable convolution is an independent convolution for each channel, and then the feature map is weighted and combined in the depth direction through point-by-point convolution to generate a new feature map. The number of parameters is less than that of the common convolution, which effectively reduces the data processing burden of the embedded device processor. If the number of parameters is the same, the number of neural network layers using the depthwise separable convolution can be made deeper, which greatly improves the feature extraction effect of target detection.

[0061] Adding the multi-scale feature fusion mechanism to the basic target detection network can enable the target detection model to learn both deep and shallow features during target detection, which will have a better feature expression effect, enhance the target detection accuracy, and have a better feature expression effect.

[0062] The common convolutional layer of the basic target detection network is replaced with a deep separable convolutional layer, and a multi-scale feature fusion mechanism is added to the basic target detection network to obtain an initial target detection model. A preset digital image is obtained and input into the initial target detection model for model training. During the model training process, the preset digital image is extracted through the deep separable convolutional layer of the initial target detection model to output a feature map; target detection is performed on the feature map through the multi-scale feature fusion mechanism of the initial target detection model to obtain an intermediate target detection model. Since the intermediate target detection model is too bloated, the intermediate target detection model is optimized by using the NetAdapt (Platform-Aware Neural Network Adaptation for Mobile Applications) algorithm and the pruning algorithm to obtain the final target detection model. The NetAdapt algorithm and the pruning algorithm miniaturize the intermediate target detection model to obtain the final target detection model, so as to achieve the purpose of accelerating reasoning. The final target detection model can run on different embedded devices, and the overall detection speed will also be faster, thereby improving the effect of target detection on embedded devices.

[0063] It should be noted that, in this embodiment, the NetAdapt algorithm optimizes the convolution kernel of the depth-separable convolution layer of the intermediate target detection model; and the pruning algorithm optimizes the network structure of the intermediate target detection model.

[0064] In addition, it should be noted that, in this embodiment, the above-mentioned model training is a conventional model training process.

[0065] like Figure 3 As shown, Figure 3 It is a flow chart of a feature extraction method provided by an embodiment of the present invention. The feature extraction method of the embodiment of the present invention includes but is not limited to step S300, step S310 and step S320.

[0066] Step S300, performing channel dimension enhancement processing on the preset digital image by using point-by-point convolution;

[0067] Step S310, performing feature extraction processing on the preset digital image after channel dimension increase by using deep convolution to obtain multiple initial feature maps;

[0068] Step S320, performing channel dimension reduction processing on multiple initial feature maps using point-by-point convolution, and outputting a final feature map.

[0069] In an embodiment of the present invention, a depthwise separable convolution layer is used to extract features of a preset digital image, and a final feature map is output. The depthwise separable convolution is mainly composed of depthwise convolution and pointwise convolution. Compared with ordinary convolution, the depthwise separable convolution can perform fewer convolution steps but achieve the same feature extraction effect, with fewer parameters. When the number of parameters is the same, it can be deeper than ordinary convolution, greatly improving the feature extraction effect of target detection.

[0070] After the depthwise separable convolution layer obtains the preset digital image, it uses point-by-point convolution to perform channel dimension upscaling on the preset digital image. Because the calculation characteristics of the depthwise convolution itself determine that it has no ability to change the number of channels, it can only output as many channels as the previous layer gives it. Therefore, if the number of channels given by the previous layer is very small, the depthwise convolution can only extract features in a low-dimensional space, so the effect is not good enough. In order to improve this problem, point-by-point convolution is performed before deep convolution to extract features for image dimension upscaling, and the channel dimension upscaling coefficient T is defined. In this way, no matter how many input channels there are, after the point-by-point convolution channel dimension upscaling process, the depthwise convolution can efficiently perform feature extraction in a relatively higher-dimensional space.

[0071] Deep convolution is used to perform feature processing on the preset digital image after channel dimensionality upgrade. Since the convolution kernels of deep convolution correspond to the input channels one by one, one convolution kernel is responsible for one input channel, and one input channel is only convolved by one convolution kernel. Therefore, the number of initial feature maps generated by the output is the same as the number of convolution kernels. Point-by-point convolution is performed to upgrade the channel dimensionality before deep convolution is used for feature extraction. Using deep convolution for feature extraction will obtain multiple initial feature maps.

[0072] Point-by-point convolution is used to perform channel dimensionality reduction processing on multiple initial feature maps, so that the features extracted by deep convolution are combined and the final feature map is output. Dimensionality reduction processing can well maintain network performance and make the network lighter. At the same time, the lower-dimensional features contain all the necessary information.

[0073] like Figure 4 As shown, Figure 4 It is a flow chart of a method for performing target detection using a multi-scale feature fusion mechanism provided in an embodiment of the present invention. The target detection method provided in an embodiment of the present invention includes but is not limited to step S400, step S410, step S420 and step S430.

[0074] Step S400, obtaining a first final feature map output by a first depthwise separable convolutional layer and a height and a width of the first final feature map;

[0075] Step S410, obtaining a second final feature map output by the second depthwise separable convolutional layer and adjusting the height and width of the second final feature map so that the height and width of the second final feature map are the same as the height and width of the first final feature map;

[0076] Step S420, performing channel concatenation and convolution on the adjusted second final feature map and the first final feature map to obtain a fused feature;

[0077] Step S430: Detect the target based on the fused features.

[0078] In an embodiment of the present invention, a multi-scale feature fusion mechanism is used for target detection. The receptive field of the high-level feature network is relatively large and the semantic information representation capability is strong, but the resolution of the feature network is low and the feature representation capability is weak (spatial geometric feature details are lacking); the receptive field of the low-level feature network is relatively small and the feature information representation capability is strong. Although the resolution is high, the semantic information representation capability is weak. The semantic information of the high-level feature network can accurately detect or segment the target. Therefore, in target detection, all these features are added together for detection and segmentation to improve the target detection effect. The small-scale feature network has a large receptive field and is suitable for detecting large objects. The large-scale feature network has a smaller receptive field, so it is suitable for detecting small targets. Several feature networks of different scales are used to detect targets of different sizes to enhance the detection accuracy of target detection.

[0079] By obtaining the first final feature map output by the first depth-wise separable convolutional layer and the height and width of the first final feature map, obtaining the second final feature map output by the second depth-wise separable convolutional layer and adjusting the height and width of the second final feature map so that the height and width of the second final feature map are the same as the height and width of the first final feature map, channel splicing and convolution are performed on the adjusted second final feature map and the first final feature map to obtain fused features, target detection is performed based on the fused features, and the feature map output by the later layer of the network is adjusted to be feature spliced ​​with the feature map output by the front layer of the network, so that deep features and shallow features are detected at the same time, the feature expression effect is improved, and the detection ability of the target detection model for targets of different sizes is improved.

[0080] It should be noted that when the initial target detection model is trained, each feature grid detects 4 bounding boxes. If the center point of the object falls within the feature grid, only the bounding box with the largest IOU (Intersection Over Union) overlap with the true bounding box is selected for detection, and other bounding boxes with smaller IOU values ​​are discarded. This can improve the model's detection ability for targets of different sizes and improve the generalization ability of the bounding box of the feature grid.

[0081] like Figure 5 As shown, Figure 5 4 is a flowchart of the NetAdapt algorithm optimization process provided by the embodiment of the present invention. The NetAdapt algorithm optimization process provided by the embodiment of the present invention includes but is not limited to step S500 and step S510.

[0082] Step S500, optimizing the convolution kernel of a layer of original depth-wise separable convolutional network to obtain multiple second depth-wise separable convolutional networks;

[0083] Step S510, compare the latency and accuracy of a second depthwise separable convolutional network with the original depthwise separable convolutional network corresponding to the second depthwise separable convolutional network, and select the final depthwise separable convolutional network according to the comparison result.

[0084] In the prior art, there are generally two common methods for designing efficient network structures: 1. Designing a single network model regardless of the platform, but this will make the designed network model perform differently on different platforms; 2. Manually designing the corresponding network structure on a given platform hardware device, which requires detailed knowledge of the underlying hardware and requires redesign after changing the platform.

[0085] Both of the above methods fail to meet the requirements of the present invention. The embodiment of the present invention adopts a network compression method NetAdapt algorithm, which deploys the optimized network on the device to directly obtain the actual performance index, and then guides the new network compression strategy based on the actual performance index, so as to perform network compression in such an iterative manner to obtain the final result. NetAdapt network optimization is performed in an automatic manner to gradually reduce the resource consumption of the pre-trained network while maximizing accuracy. The optimization loop runs until the resource budget is met. Through this design, NetAdapt can not only generate a network that meets the budget, but also generate a series of simplified networks with different trade-offs, thereby realizing dynamic network selection and further research.

[0086] In the embodiment of the present invention, the NetAdapt algorithm is used to search for the number of convolution kernels of each depth-separable convolutional network layer. And the number of convolution kernels of each depth-separable convolutional network layer is optimized, and the ultimate goal is to find a network with high accuracy and low delay in the second depth-separable convolutional network set that meets the delay attenuation as the final depth-separable convolutional network. While optimizing the delay of the target detection model, the accuracy is maintained, and the size of the bottleneck in the expansion layer and each depth-separable convolutional network layer is reduced. The NetAdapt algorithm optimizes the convolution kernel of a layer of the original depth-wise separable convolutional network, obtains multiple second depth-wise separable convolutional networks as a second depth-wise separable convolutional network set, selects a second depth-wise separable convolutional network from the second depth-wise separable convolutional network set, and compares the latency and accuracy of the second depth-wise separable convolutional network with the original depth-wise separable convolutional network corresponding to the second depth-wise separable convolutional network, and selects the final depth-wise separable convolutional network according to the comparison result. When the latency of the second depth-wise separable convolutional network is greater than the latency of the original depth-wise separable convolutional network and / or the accuracy of the second depth-wise separable convolutional network is lower than that of the original depth-wise separable convolutional network, the original depth-wise separable convolutional network is selected as the final depth-wise separable convolutional network; when the latency of the second depth-wise separable convolutional network is less than the latency of the original depth-wise separable convolutional network and the accuracy of the second depth-wise separable convolutional network is higher than that of the original depth-wise separable convolutional network, the second depth-wise separable convolutional network is selected as the final depth-wise separable convolutional network.

[0087] like Figure 6 As shown, Figure 6 4 is a flowchart of the pruning algorithm optimization processing provided by an embodiment of the present invention. The pruning algorithm optimization processing provided by an embodiment of the present invention includes but is not limited to step S600 and step S610.

[0088] Step S600, pruning the network structure of the intermediate target detection model to remove redundant weight parameters of the network structure;

[0089] Step S610, fine-tuning the intermediate object detection model after the pruning process.

[0090] In an embodiment of the present invention, the intermediate target detection model is obtained by training the initial target detection model, and has a large number of redundant weight parameters and neurons that are useless for target detection, which makes the overall model too bloated. The network structure of the intermediate target detection model is pruned using a pruning algorithm to remove redundant weight parameters and useless neurons in the network structure, thereby achieving a more compact target detection model.

[0091] The network structure of the intermediate target detection model is pruned to remove the redundant weight parameters of the network structure, including but not limited to the following steps: first, the network structure is encoded with the number of channels of each layer of the pruned network structure, and converted into a set of encoding vectors. In order to search for the best pruned network, various encoding vectors are continuously tried, and the pruned network weights are generated after re-entering the pruned network; then, the performance of the intermediate target monitoring model after pruning is obtained according to the network structure, network weights and the preset verification set. Then, an evolutionary algorithm is used to search for the optimal encoding vector as the final encoding vector, and the final target detection model is obtained according to the final encoding vector. When searching for the final encoding vector with the evolutionary algorithm, a custom objective function is used, and the objective function includes but is not limited to the network accuracy function, delay function and computational function.

[0092] It should be noted that the evolutionary algorithm is used to search for the optimal encoding vector as the final encoding vector, and the final target detection model is obtained according to the final encoding vector. Specific operations include but are not limited to treating the encoding vector as a vector representation of the number of channels of the network on each layer. At this time, the number of channels on each layer can correspond to the genes in the evolutionary algorithm. First, a large number of genes are randomly selected, and the accuracy of the network weights generated by the pruned network on the preset validation set is calculated, and the top K genes with the highest accuracy are taken out, and then new genes are generated using crossover and mutation methods. Mutation is to randomly change the ratio of elements in the gene, and crossover is to randomly recombine the genes of the two parents to produce a new gene combination. By repeatedly iterating this process, the encoding vector can be obtained as the final encoding vector, and the final target detection model can be obtained according to the final encoding vector.

[0093] It should be noted that, in the embodiment of the present invention, AutoML (Auto Machine Learning) is used to find the final encoding vector, and then the final target detection model is obtained according to the final encoding vector. AutoML has the characteristic of automatically finding the optimal structure. By utilizing this characteristic, the embodiment of the present invention can automatically generate a network of pruning weights for each layer, and then evaluate the performance of the pruned network on a preset validation set, thereby selecting the optimal network structure as the final target detection model.

[0094] In addition, it should be noted that in the embodiment of the present invention, the pruning algorithm needs to be trained in advance, and the training pruning network consists of l pruning blocks, each of which consists of two layers of fully connected layers. In the forward process, the training pruning network takes the network coding vector as input to generate a weight matrix. At the same time, the training pruning network takes the numerical value in the network coding vector as the output channel, and clips the generated weight matrix to match the input and output of the training pruning network. For an input image, we can calculate the forward loss of the pruned network. In the reverse process, the weight of the training pruning network, that is, the parameter of the fully connected layer, is updated by calculating the gradient of the training pruning network. During the entire training process, the training system can obtain different training pruning network structures by randomly generating different network coding vectors. With the network structure and network weights, the performance of the network can be tested on the verification set. Finally, the evolutionary algorithm can be used to search for the optimal coding vector to obtain the optimal training pruning network. The specific operation is to regard the network coding as a vector representation of the number of channels in each layer of the network, and the number of channels in each layer can correspond to the genes in the evolutionary algorithm. First, a large number of genes are randomly selected, and the accuracy of the weights generated by the pruned network on the validation set is calculated. The top K genes with the highest accuracy are taken out, and then new genes are generated using crossover and mutation methods. Mutation is the random change of the element ratio in the gene, and crossover is the random recombination of the genes of the two parents to generate new gene combinations. By repeatedly iterating this process, the optimal training pruned network encoding can be obtained.

[0095] In an embodiment of the present invention, the initial target detection model also includes a system loss function for target detection, as shown in the following formula, where the system loss function includes a bounding box coordinate error function, a bounding box confidence error function, and a classification error function.

[0096]

[0097] The first term is the bounding box coordinate error function; the second term is the loss function of the height and width of the bounding box; the third term is the bounding box confidence error function for objects; the fourth term is the bounding box confidence loss function for objects that do not exist; the fifth term is the classification error function for the unit grid where objects exist. S is the unit grid division coefficient of the image; B is the number of bounding boxes predicted for each grid; C is the total number of classifications; p is the class probability; It means that there is an object in the i-th unit grid, and the j-th bounding box in the cell predicts the target; λ coord and λ noobj are the weight coefficients of different loss functions.

[0098] It should be noted that the above system loss function is also included in the intermediate target detection model and the final target detection model.

[0099] like Figure 7 As shown, Figure 7 It is a flow chart of the application method of the target detection model provided by an embodiment of the present invention. The application method of the target detection model provided by an embodiment of the present invention includes but is not limited to step S700, step S710 and step S720.

[0100] Step S700, obtaining an actual digital image, and inputting the actual digital image into a target detection model;

[0101] Step S710, extracting features from the actual digital image through the depth-separable convolutional layer of the target detection model, and outputting a feature map;

[0102] Step S720: Perform target detection on the feature map through the multi-scale feature fusion mechanism of the target detection model.

[0103] In an embodiment of the present invention, an actual digital image is acquired and input into a target detection model; features of the actual digital image are extracted through a depth-separable convolutional layer of the target detection model, and a feature map is output; and target detection is performed on the feature map through a multi-scale feature fusion mechanism of the target detection model.

[0104] like Figure 8 As shown, the embodiment of the present invention also provides a target detection model establishment device, including:

[0105] A network modification module 800 is used to obtain a basic target detection network, replace the common convolutional layer of the basic target detection network with a depth-separable convolutional layer, and add a multi-scale feature fusion mechanism to the basic target detection network to obtain an initial target detection model;

[0106] A digital image acquisition module 810 is used to acquire a preset digital image and input the preset digital image into an initial target detection model;

[0107] A feature extraction module 820 is used to extract features from a preset digital image through a depth-separable convolutional layer of an initial target detection model and output a feature map;

[0108] The target detection module 830 is used to perform target detection on the feature map through the multi-scale feature fusion mechanism of the initial target detection model to obtain an intermediate target detection model;

[0109] The model optimization module 840 is used to optimize the intermediate target detection model using the NetAdapt algorithm and the pruning algorithm to obtain the final target detection model.

[0110] It should be noted that the contents of the method embodiments of the present invention are all applicable to the device embodiments. The functions specifically implemented by the device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method, which will not be repeated here.

[0111] like Fig. 9 As shown, an embodiment of the present invention further provides a target detection device, including:

[0112] The digital image acquisition module 900 is used to acquire the actual digital image and input the actual digital image into the target detection model;

[0113] A feature extraction module 910 is used to extract features from the actual digital image through a depth-separable convolutional layer of the target detection model and output a feature map;

[0114] The target detection module 920 is used to perform target detection on the feature map through the multi-scale feature fusion mechanism of the target detection model.

[0115] It should be noted that the contents of the method embodiments of the present invention are all applicable to the device embodiments. The functions specifically implemented by the device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method, which will not be repeated here.

[0116] In addition, an embodiment of the present invention further provides a target detection device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor.

[0117] The processor and the memory may be connected via a bus or other means.

[0118] 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.

[0119] It should be noted that the target detection device in this embodiment can be applied as the method for establishing a target detection model as in the above-mentioned embodiment and / or the method for applying the target detection model as in the above-mentioned embodiment. The target detection device in this embodiment has the same inventive concept as the method for establishing a target detection model as in the above-mentioned embodiment and / or the method for applying the target detection model as in the above-mentioned embodiment. Therefore, these embodiments have the same implementation principles and technical effects, which will not be described in detail here.

[0120] The non-transient software program and instructions required to implement the method for establishing the target detection model of the above embodiment and / or the method for applying the target detection model of the above embodiment are stored in the memory. When executed by the processor, the method for establishing the target detection model of the above embodiment and / or the method for applying the target detection model of the above embodiment are executed, for example, the above-described Figure 2 Method steps S200 to S250, Figure 3 Steps S310 to S320 of the method, Figure 4 Steps S400 to S430 of the method, Figure 5 Steps S500 to S510 of the method, Figure 6 Steps S600 to S610 of the method, Figure 7 Method steps S700 to S720.

[0121] The target detection device embodiment described above is 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 they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.

[0122] In addition, an embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. The computer-executable instructions are executed by a processor or a controller, for example, by a processor in the above-mentioned target detection device embodiment, so that the above-mentioned processor can execute the method for establishing the target detection model in the above-mentioned embodiment and / or the method for applying the target detection model in the above-mentioned embodiment, for example, to execute the above-mentioned Figure 2 Method steps S200 to S250, Figure 3 Steps S310 to S320 of the method, Figure 4 Steps S400 to S430 of the method, Figure 5 Steps S500 to S510 of the method, Figure 6 Steps S600 to S610 of the method, Figure 7 Method steps S700 to S720.

[0123] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0124] It can be understood by those skilled in the art that Figure 1-9 The technical solutions shown in the figure do not constitute a limitation on the embodiments of the present invention, and may include more or fewer steps than those shown in the figure, 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 invention 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 interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are 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 invention, "at least one (item)" refers to one or more, and "plurality" refers to 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 represent: 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 previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can represent: 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 by the present invention, 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 the above 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 above 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 invention 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 invention, in essence, 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. The computer software product is stored in a storage medium, including multiple instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store programs.

[0133] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions without violating the spirit of the present invention. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present invention.

Claims

1. A method for establishing a target detection model, characterized in that: The method comprises: Obtain a basic object detection network, replace the common convolutional layer of the basic object detection network with a depth-separable convolutional layer, and add a multi-scale feature fusion mechanism to the basic object detection network to obtain an initial object detection model; Acquire a preset digital image, and input the preset digital image into the initial target detection model; Performing feature extraction on the preset digital image through the depthwise separable convolutional layer of the initial target detection model, and outputting a feature map; Performing target detection on the feature map through the multi-scale feature fusion mechanism of the initial target detection model to obtain an intermediate target detection model; The intermediate target detection model is optimized by using the NetAdapt algorithm and the pruning algorithm to obtain a final target detection model; wherein the network structure of the intermediate target detection model is optimized by using the pruning algorithm; The method of optimizing the intermediate target detection model using the NetAdapt algorithm and the pruning algorithm to obtain the final target detection model includes: The NetAdapt algorithm is used to optimize the convolution kernel of a layer of the original depth-wise separable convolutional network to obtain multiple second depth-wise separable convolutional networks; The NetAdapt algorithm is used to compare the latency and accuracy of the second depth-wise separable convolutional network with the original depth-wise separable convolutional network corresponding to the second depth-wise separable convolutional network, and the final depth-wise separable convolutional network is selected according to the comparison result.

2. The method for establishing a target detection model according to claim 1, characterized in that: The step of extracting features from the preset digital image through the depth-separable convolutional layer of the initial target detection model and outputting a feature map comprises: Performing channel dimension-upgrading processing on the preset digital image by using point-by-point convolution; Using deep convolution to perform feature extraction on the preset digital image after channel dimension increase, multiple initial feature maps are obtained; Perform channel dimension reduction processing on the multiple initial feature maps by using point-by-point convolution, and output a final feature map.

3. The method for establishing a target detection model according to claim 1, characterized in that: The performing target detection on the feature map through the multi-scale feature fusion mechanism of the initial target detection model includes: Get the height and width of the first final feature map output by the first depthwise separable convolutional layer; Obtaining and adjusting the height and width of a second final feature map output by the second depthwise separable convolutional layer so that the height and width of the second final feature map are the same as the height and width of the first final feature map; Perform channel concatenation and convolution on the adjusted second final feature map and the first final feature map to obtain a fused feature; Target detection is performed according to the fusion features.

4. The method for establishing a target detection model according to claim 1, characterized in that: The selecting the final depth-separable convolutional network according to the comparison result includes: When the latency of the second depthwise separable convolutional network is greater than the latency of the original depthwise separable convolutional network and / or the accuracy of the second depthwise separable convolutional network is lower than that of the original depthwise separable convolutional network, the original depthwise separable convolutional network is selected as the final depthwise separable convolutional network; When the latency of the second depth-wise separable convolutional network is smaller than the latency of the original depth-wise separable convolutional network and the accuracy of the second depth-wise separable convolutional network is higher than that of the original depth-wise separable convolutional network, the second depth-wise separable convolutional network is selected as the final depth-wise separable convolutional network.

5. The method for establishing a target detection model according to claim 1, characterized in that: The method further comprises: Performing pruning processing on the network structure of the intermediate target detection model based on the pruning algorithm to remove redundant weight parameters of the network structure; The intermediate target detection model after pruning is fine-tuned based on the pruning algorithm.

6. The method for establishing a target detection model according to claim 5, characterized in that: The removing redundant weight parameters of the network structure includes: Encoding the network structure based on the number of channels of each layer in the intermediate target detection model after pruning to obtain a plurality of encoding vectors; Inputting the encoding vector into the intermediate target detection model to generate pruned network weights; Obtaining the performance of the intermediate target detection model after pruning according to the network structure, the network weights and a preset validation set; The plurality of encoding vectors are screened by using an evolutionary algorithm to obtain a final encoding vector, and the final target detection model is obtained according to the final encoding vector.

7. The method for establishing a target detection model according to claim 1, characterized in that: The initial target detection model also includes a system loss function, which includes a bounding box coordinate error function, a loss function of the height and width of the bounding box, a bounding box confidence error function where an object exists, a bounding box confidence error function where an object does not exist, and a classification error function of a unit grid where an object exists; the system loss function is as follows: Among them, the first term is the bounding box coordinate error function, the second term is the loss function of the height and width of the bounding box, the third term is the bounding box confidence error function of the object, the fourth term is the bounding box confidence loss function of the object, and the fifth term is the classification error function of the unit grid with the object. S is the unit grid division coefficient of the image, B is the number of bounding boxes predicted for each grid, C is the total number of classifications, and p is the category probability. It means that there is an object in the i-th unit grid, and the j-th bounding box in the cell predicts the target. and are the weight coefficients of different loss functions.

8. An application method of a target detection model, characterized in that: The method comprises: Acquire an actual digital image, and input the actual digital image into a target detection model; wherein the target detection model is established according to the target detection model establishment method according to any one of claims 1 to 7; Performing feature extraction on the actual digital image through the depth-separable convolutional layer of the target detection model, and outputting a feature map; Target detection is performed on the feature map through the multi-scale feature fusion mechanism of the target detection model.

9. A device for establishing a target detection model, characterized in that: The device comprises: A network modification module, used to obtain a basic target detection network, replace the common convolutional layer of the basic target detection network with a depth-separable convolutional layer, and add a multi-scale feature fusion mechanism to the basic target detection network to obtain an initial target detection model; A digital image acquisition module, used for acquiring a preset digital image and inputting the preset digital image into the initial target detection model; A feature extraction module, used to extract features from the preset digital image through the depth-separable convolutional layer of the initial target detection model and output a feature map; A target detection module, configured to perform target detection on the feature map through the multi-scale feature fusion mechanism of the initial target detection model to obtain an intermediate target detection model; A model optimization module, used to optimize the intermediate target detection model using the NetAdapt algorithm and the pruning algorithm to obtain a final target detection model; wherein the pruning algorithm is used to optimize the network structure of the intermediate target detection model; The method of optimizing the intermediate target detection model using the NetAdapt algorithm and the pruning algorithm to obtain the final target detection model includes: The NetAdapt algorithm is used to optimize the convolution kernel of a layer of the original depth-wise separable convolutional network to obtain multiple second depth-wise separable convolutional networks; The NetAdapt algorithm is used to compare the latency and accuracy of the second depth-wise separable convolutional network with the original depth-wise separable convolutional network corresponding to the second depth-wise separable convolutional network, and the final depth-wise separable convolutional network is selected according to the comparison result.

10. A target detection device, characterized in that: The device comprises: A digital image acquisition module, used for acquiring an actual digital image and inputting the actual digital image into a target detection model; wherein the target detection model is established according to the target detection model establishment method according to any one of claims 1 to 7; A feature extraction module, used to extract features from the actual digital image through the depth-separable convolutional layer of the target detection model and output a feature map; The target detection module is used to perform target detection on the feature map through the multi-scale feature fusion mechanism of the target detection model.

11. A target detection device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for establishing a target detection model as described in any one of claims 1 to 7 and / or the method for applying a target detection model as described in claim 8 are implemented.

12. A computer-readable storage medium, characterized in that: Computer-executable instructions are stored, and the computer-executable instructions are used to execute the method for establishing a target detection model as described in any one of claims 1 to 7 and / or the method for applying a target detection model as described in claim 8.

Citation Information

Patent Citations

  • Remote sensing image target detection method based on deep evolution pruning convolutional network

    CN110532859A

  • Multi-scale feature fusion target detection method and system

    CN113313162A

  • Lightweight aircraft detection method based on improved Yolov4-tiny

    CN113780211A

  • Computer vision system and method

    US20200134772A1