Large target key feature recognition method and device based on FPGA
By combining DeepLab v3 Plus and MobileNet V2 network structures on the FPGA platform, key features of large targets are extracted, and hardware acceleration design is performed, which solves the problem of insufficient large target recognition accuracy in the existing technology and achieves efficient target recognition effects.
Patent Information
- Application Number
- CN202410125327.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-29
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-01-29
AI Technical Summary
When the existing Yolo series algorithms identify large targets with complex backgrounds and large volumes, it is difficult to effectively extract key features, resulting in insufficient positioning accuracy, especially in the detection of large ship targets.
Using an FPGA-based method, first perform global contour detection on the image, crop key feature parts and input them into the fine detection network. Combined with DeepLab v3 Plus and MobileNet V2 network structures, features are extracted through dilated convolution and ASPP hole space pyramid pooling methods. , realize the identification of key features of large targets, and perform hardware acceleration design, optimization operators and task deployment on the FPGA platform.
It improves the detection accuracy and positioning accuracy of key features of large targets, reduces the amount of model calculations and parameters, meets the resource, timing and power consumption requirements of the edge computing platform, and achieves efficient target recognition.
Smart Images

Figure CN118279640B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of target recognition and heterogeneous acceleration design, and in particular to a method and device for recognizing key features of a large target based on FPGA. Background Art
[0002] The Yolo (You Only Look Once) series of algorithms are single-stage convolutional neural network target detection algorithms based on regression. They directly detect information such as target categories and locations in images, saving the process of generating candidate regions during feature extraction, and improving the speed of recognition and detection. With the continuous improvement of the network architecture of the Yolo series of algorithms, its detection speed, recognition accuracy, and adaptability to different scenarios are constantly improving. In particular, the Yolo v3 model has demonstrated superior performance in dealing with multi-scale changes and weak target recognition scenarios, making it widely used in engineering applications, such as drone target detection and autonomous driving.
[0003] However, for targets with complex backgrounds and large volumes, it is relatively difficult to extract the core key features of the target. Recognition of the key parts of these targets is an important way to improve positioning accuracy. For example, taking a large ship target as an example: its recognition and detection process is as follows: Figure 1 shown. Summary of the invention
[0004] The present invention provides a large target key feature recognition method, device and storage medium based on FPGA, which can solve at least one of the technical problems in the background technology.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] A large target key feature recognition method based on FPGA includes the following steps:
[0007] Based on the outline of the first detected target, the key feature parts in the image are cropped and input into the fine detection network to detect the key parts of the target. The whole process conforms to the visual characteristics of the human eye from "global to local";
[0008] Subsequently, the key part recognition results are returned to the first stage recognition results to improve the key part target detection and positioning accuracy;
[0009] Finally, the training model results are analyzed through network analysis, the hardware acceleration operator is optimized and designed, the heterogeneous task deployment is dynamically adjusted, the algorithm is transformed into an engineering form on the FPGA heterogeneous platform, and used for key feature recognition of large targets.
[0010] Further, the method specifically includes the following steps:
[0011] S1. Design a transplantation framework system for FPGA heterogeneous platforms;
[0012] S2. Build a large target key feature recognition method based on Yolo v3;
[0013] S3, FPGA-based hardware acceleration design.
[0014] Furthermore, the S1, designing a FPGA heterogeneous platform transplantation framework system, specifically includes:
[0015] According to the characteristics of deep learning network structure and FPGA heterogeneous platform architecture, a target detection system transplantation framework for deep learning algorithms is developed and designed. The software and hardware acceleration design is carried out from a high level without involving the circuit modules of the underlying hardware. The built network model is trained offline using GPU to obtain the optimal weight parameters, and then the lightweight design of the network is achieved through methods such as model quantization and pruning. Finally, the hardware acceleration unit is designed in combination with the resource distribution of the hardware platform to achieve efficient transplantation of deep learning models to embedded heterogeneous platforms.
[0016] Furthermore, the software and hardware development process in step S1 modularizes the routine processing in the deep learning algorithm transplantation process, provides efficient model pruning and quantization algorithms, improves the scalability and high configurability of the deep learning accelerator, and supports the rapid deployment of different deep learning models on FPGA heterogeneous platforms.
[0017] Furthermore, the S2, building a large target key feature recognition method based on Yolo v3, specifically includes:
[0018] Step 1: Subject target recognition based on Yolo v3; the Yolo v3 model consists of the Darknet53 skeleton network, the feature fusion network Neck and the prediction network Prediction; the skeleton network Darknet53 extracts target features based on different image granularities, combines the extracted features through the feature fusion network to improve the adaptability to targets of different scales, and the prediction network uses the fused features for classification and regression to determine the category information and location of the target;
[0019] Step 2: After the large target body is detected, it is cropped according to the position information of the detection frame, resulting in low resolution and diverse scales of the image input to the key part detection network. To this end, based on the DeepLab v3 Plus network as the basic architecture, dilated convolution is used in the final stage of feature extraction to keep the resolution from decreasing, increase the receptive field, and keep the spatial position information and semantic information unchanged. At the same time, the ASPP atrous spatial pyramid pooling method is used to extract feature information of different scales, and a clear object boundary is obtained through an efficient "encoder-decoder" structure.
[0020] Step 3: Analyze the test results.
[0021] Furthermore, in the feature extraction stage of the DeepLab v3 Plus network structure in Step 2, the lightweight network MobileNet V2 is used as the backbone network, and the reverse residual unit is used to solve the gradient diffusion problem that is prone to occur in the ResNet50 structure; the reverse residual structure realizes feature extraction by "first increasing the dimension, then reducing the dimension", solving the serious problem of feature information loss caused by the previous "first compressing, then expanding" method;
[0022] Through the above optimization strategy, the overall structure of the two-stage detection network is as follows:
[0023] Table 1 Two-stage target detection network structure
[0024]
[0025]
[0026] Among them, t is the input expansion multiple, k is the number of output channels, N is the number of module repetitions, and s is the stride step size.
[0027] Furthermore, the analysis of the detection results in Step 3 specifically includes training the data according to the network structure of the improved model, extracting the feature semantic information of the key parts of the large target at the pixel level, and detecting the contour boundary of the main target.
[0028] Furthermore, the S3, FPGA-based hardware acceleration design, specifically includes:
[0029] S31, using the Tensorflow framework interface function to quantize the trained model results; after quantization, the quantization parameters of each layer of network weights, activation function values and eigenvalues are stored in DDR for subsequent quantization domain use;
[0030] S32. In the hardware acceleration design, HLS is used to compile each layer to generate independent hardware acceleration operators. The operators use interface calls to realize layer-to-layer data transmission and calls.
[0031] The design process of the fusion operator does not involve specific parameter configuration. It can fuse independent operators in HLS and reserve the interface configuration of the fusion operator.
[0032] S33. By quantizing the training model parameters and reconfiguring the hardware acceleration operators, the algorithm is divided into heterogeneous tasks in combination with the FPGA hardware platform resource distribution and the target detection network structure.
[0033] S34. Encapsulate the module for acceleration on the PL side into an IP core, update it to the deep learning inference accelerator UMDLA-Yolo, use the Vivado hardware development tool to deploy the acceleration IP core on the PL side of the chip, and generate the corresponding bitstream through comprehensive simulation and layout and routing.
[0034] On the other hand, the present invention further discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the above method.
[0035] On the other hand, the present invention further discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.
[0036] It can be seen from the above technical solutions that the FPGA-based large target key feature recognition method and device of the present invention provide a target recognition method for the key features of large targets, and perform acceleration design optimization on the FPGA heterogeneous acceleration platform. The present invention fully analyzes the structural characteristics of large targets, and proposes to crop the key feature parts in the image based on the contour of the first detected target, and input it into the fine detection network to detect the key parts of the target. The whole process conforms to the visual characteristics of the human eye from "global to local". Subsequently, the key part recognition results are returned to the first stage recognition results to improve the key part target detection and positioning accuracy. Finally, the training model results are subjected to network analysis, the hardware acceleration operator is reasonably optimized and designed, the heterogeneous task deployment is dynamically adjusted, and the engineering transformation of the algorithm is realized on the FPGA heterogeneous platform.
[0037] The present invention proposes a large target key feature recognition method for FPGA. According to the design idea of "overall detection and component positioning", based on the Yolo v3 model framework, MobileNet V2 and Deeplab v3 plus are introduced as the feature extraction network and mask generation network in key feature detection, respectively. While obtaining higher detection accuracy and positioning accuracy, the model calculation amount and parameter amount are reduced.
[0038] Secondly, a transplantation framework system for FPGA heterogeneous platforms is designed to accelerate the model design in both algorithm and hardware aspects. Through model compression, acceleration operator optimization design, and heterogeneous task division, the software algorithm can be efficiently deployed to the FPGA hardware platform to meet the edge computing platform's requirements for resources, timing, and power consumption.
[0039] Specifically, the advantages of the present invention are as follows:
[0040] Advantage 1: Design of UMFDL, a framework system for FPGA heterogeneous platform migration, optimizes the design in terms of software and hardware acceleration design and heterogeneous task partitioning, provides a convenient method for the rapid deployment of deep learning models on embedded heterogeneous platforms, reduces the difficulty of migrating software algorithms to hardware platforms, and shortens the engineering conversion cycle;
[0041] Advantage 2: Based on the Yolo v3 network architecture, the Deeplab v3+ network structure is integrated to perform pixel-level detection in the main target area, determine the contour boundaries of key parts, and improve the detection accuracy and positioning accuracy of key parts of large targets; and use the Linear bottlenecks structure to extract features from low-resolution main targets, reduce feature loss, and reduce model calculation and parameter volume.
[0042] Advantage 3: Based on the characteristics of the algorithm structure, HLS is used to complete the design of hardware acceleration operators for FPGA, and the operator structure is optimized according to the characteristics of data calculation. At the same time, heterogeneous task division is carried out in combination with the resource distribution of heterogeneous platforms, and hardware platforms with different acceleration effects are built to meet the design requirements of embedded platforms in terms of latency, accuracy, hardware resources and power consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 This is a schematic diagram of secondary identification of ships;
[0044] Figure 2 This is a schematic diagram of a large-scale target detection process using a ship as an example in an embodiment of the present invention;
[0045] Figure 3 It is a schematic diagram of the UMFDL structure composition of an embodiment of the present invention;
[0046] Figure 4This is a schematic diagram of the Yolo v3 recognition and detection process according to an embodiment of the present invention;
[0047] Figure 5 This is a schematic diagram of the Yolo v3 network structure according to an embodiment of the present invention;
[0048] Figure 6 It is the improved DeepLab v3 Plus network structure of the embodiment of the present invention;
[0049] Figure 7 is a schematic diagram of the detection results of an embodiment of the present invention;
[0050] Figure 8 It is a schematic diagram of Tensorflow full integer quantization according to an embodiment of the present invention;
[0051] Fig. 9 Schematic diagram of residual hardware acceleration operator design according to an embodiment of the present invention;
[0052] Fig.10 Schematic diagram of task division of target detection algorithm according to an embodiment of the present invention;
[0053] Fig.11 is a schematic diagram of the hardware control flow of the target detection algorithm according to an embodiment of the present invention;
[0054] Fig.12 is a hardware engineering schematic diagram of a single accelerator target detection system according to an embodiment of the present invention;
[0055] Fig.13 is a schematic diagram of resource consumption distribution of each module in an embodiment of the present invention;
[0056] Fig.14 is a schematic diagram of power consumption distribution of a single accelerator target detection system according to an embodiment of the present invention;
[0057] Fig.15 is a schematic diagram of a dual-accelerator target detection system according to an embodiment of the present invention;
[0058] Fig.16 is a schematic diagram of resource consumption of each module of the dual-accelerator target detection system according to an embodiment of the present invention;
[0059] Fig.17 Schematic diagram of power consumption distribution of a dual-accelerator target detection system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0061] Figure 2 This is a schematic diagram of the large-scale target detection process using a ship as an example in an embodiment of the present invention. The embodiment of the present invention fully analyzes the structural features of large targets, proposes to crop the key feature parts in the image based on the contour of the first detected target, and inputs them into a fine detection network to detect the key parts of the target. The whole process conforms to the visual characteristics of the human eye from "global to local". Subsequently, the key part recognition results are returned to the first-stage recognition results to improve the detection and positioning accuracy of key part targets. Finally, the training model results are subjected to network analysis, the hardware acceleration operator is rationally optimized and designed, the heterogeneous task deployment is dynamically adjusted, and the engineering transformation of the algorithm is realized on the FPGA heterogeneous platform.
[0062] The following is a detailed description:
[0063] (I) Designing a Migration Framework for FPGA Heterogeneous Platforms
[0064] In view of the structural characteristics of deep learning networks and the FPGA heterogeneous platform architecture, a target detection system migration framework for deep learning algorithms (Universal Migration Framework for Deep Learning, UMFDL) is developed and designed. The hardware and software acceleration design is carried out from a high level without involving the circuit modules at the bottom of the hardware, which reduces the design difficulty and shortens the cycle of algorithm expansion to engineering applications. Since the acceleration of deep learning models on embedded platforms mainly considers the reasoning process, the built network model can be trained offline using GPU to obtain the optimal weight parameters, and then the lightweight design of the network is achieved through model quantization, pruning and other methods. Finally, combined with the distribution of hardware platform resources, the hardware acceleration unit is reasonably designed to achieve efficient migration of deep learning models to embedded heterogeneous platforms. The hardware and software development process is as follows: Figure 3 As shown; Figure 3 The conventional processing in the deep learning algorithm transplantation process is modularized to provide efficient model pruning and quantization algorithms, improve the scalability and high configurability of the deep learning accelerator, and support the rapid deployment of different deep learning models on FPGA heterogeneous platforms.
[0065] (II) Building a large target key feature recognition method based on Yolo v3
[0066] Step 1: Subject target recognition based on Yolo v3
[0067] The Yolo v3 model consists of a Darknet53 skeleton network, a feature fusion network (Neck), and a prediction network (Prediction). The recognition and detection process is as follows: Figure 4 As shown;
[0068] Among them, the skeleton network Darknet53 extracts target features based on different image granularities, combines the extracted features through the feature fusion network to improve the adaptability to targets of different scales, and the prediction network uses the fusion features for classification and regression to determine the category information and location of the target. The network architecture of yolo v3 is as follows: Figure 5 As shown:
[0069] Step 2: Key feature detection algorithm
[0070] After the large target body is detected, it is cropped according to the position information of the detection frame, resulting in low resolution and diverse scales of the image input to the key part detection network. To this end, based on the DeepLab v3 Plus network, dilated convolution is used in the final stage of feature extraction to keep the resolution from decreasing, increase the receptive field, and keep the spatial position information and semantic information unchanged. At the same time, the ASPP (Atrous Spatialpyramid Pooling) dilated spatial pyramid pooling method is used to extract feature information of different scales, and a clear object boundary is obtained through an efficient "encoder-decoder" structure. The DeepLab v3 Plus network structure is as follows: Figure 6 As shown;
[0071] Figure 6 In the feature extraction stage, the lightweight network MobileNet V2 is used as the backbone network, and the reverse residual unit is used to solve the gradient diffusion problem that is prone to occur in the ResNet50 structure. The reverse residual structure realizes feature extraction by "first increasing the dimension, then reducing the dimension", solving the serious problem of feature information loss caused by the previous "first compressing, then expanding". In addition, the compressed features are prone to secondary feature information loss after passing through the ReLU6 activation function, especially for weak targets with fewer features themselves, while the linear activation function can retain more feature information and improve the semantic expression ability of the model.
[0072] Through the above optimization strategy, the overall structure of the two-stage detection network is as follows:
[0073] Table 1 Two-stage target detection network structure
[0074]
[0075] Among them, t is the input expansion multiple, k is the number of output channels, N is the number of module repetitions, and s is the stride step size.
[0076] Step 3: Analyze the test results
[0077] According to the improved network structure of the model of the present invention, the data is trained to extract the feature semantic information of the key parts of the large target at the pixel level and detect the contour boundary of the main target. The overall result is as follows: Figure 7 As shown;
[0078] Under the condition that the large target detection accuracy remains unchanged, the improved algorithm of the present invention uses the DeepLab v3 Plus semantic segmentation network to accurately extract the key parts of the large target and can accurately segment the contours of the key parts.
[0079] (III) FPGA-based hardware acceleration design
[0080] Combined with the MMFDL hardware acceleration module design, the trained model parameters need to be quantified and the hardware acceleration operators configured so that the resources, energy consumption and latency consumed by the target detection algorithm on the heterogeneous hardware platform meet the system design requirements.
[0081] Step 1: Parameter quantization
[0082] After pruning, the computational complexity and parameter count of the trained model are greatly reduced, but the floating point operations in the calculation process consume a lot of DSP. To this end, the Tensorflow framework interface function is used to quantize the trained model results. The quantization code is as follows: Figure 8 As shown;
[0083] After quantization, the quantization parameters of each layer of network weights, activation function values, and eigenvalues are stored in DDR for use in subsequent quantization domains.
[0084] Step 2: Neural network hardware acceleration operator configuration based on HLS
[0085] Neural networks can be understood as connections between different types of layers, with each layer taking the result of the previous layer's calculation as input and taking the result of the current layer's calculation as input for the next layer of the network. Convolutional layers, pooling layers, fully connected layers, and activation functions are the basic components of convolutional neural networks. The performance of different network architectures varies depending on the convolution kernel, pooling method, network depth, and activation function.
[0086] In the hardware acceleration design, HLS is used to compile each layer to generate independent hardware acceleration operators. The operators are called through interfaces to realize the data transmission and calling between layers. The residual unit in Yolo v3 is taken as an example to design the acceleration operator. The residual unit is composed of convolution operator, BN operator and Leaky ReLU activation function operator. Each operator is called separately and calculated in parallel. The calculation results are cached in the memory. The read and write bandwidth between data restricts the system performance. To this end, combined with the structural characteristics of the compressed target detection algorithm network, operators with high repetition rate and cascadable functions are used to form a deep computing pipeline to directly realize modular functions without writing the intermediate calculation results back to the memory, which greatly reduces the system's bandwidth requirements. The fusion acceleration operators such as Fig. 9 As shown;
[0087] Fig. 9 The acceleration operator designed for the residual unit according to different fusion methods. When each operator is called separately, the intermediate calculation results are cached in DDR. The data read and write rate seriously affects the processing speed of the algorithm and causes a lot of memory consumption. When the operators are continuously fused, the intermediate calculation results are cached in BRAM, and the next step of calculation is directly performed, which greatly improves the processing speed. The design process of the fusion operator does not involve specific parameter configuration. It can fuse each independent operator in HLS and reserve the interface configuration of the fusion operator.
[0088] In addition, a hardware acceleration operator library can be built for the basic operators in the network to meet the requirements of universality, flexibility and scalability of the neural network reasoning process, such as LRN layer acceleration core, Tensor transformation, residual unit acceleration core and batch normalization.
[0089] Step 3: Heterogeneous task division
[0090] By quantizing the training model parameters and reconfiguring the hardware acceleration operators, the algorithm is divided into heterogeneous tasks in combination with the FPGA hardware platform resource distribution and the target detection network structure, such as Fig.10 As shown;
[0091] The inference control process of target detection is as follows Fig.11 As shown;
[0092] The trained model description file is ×.cfg, and the weight parameter file is ×.weights. They are stored in DDR through file parsing. The model can be deployed according to the above heterogeneous design process to complete the target detection reasoning task. The PS is responsible for file loading, self-check scheduling and other tasks for the entire system operation. The tasks have the ability to execute sequentially, and the main network architecture is mainly accelerated on the PL side.
[0093] The input image source is loaded into the DDR memory for preprocessing before image detection, such as decoding the image format and cropping the image to a uniform size. After the image data is ready, the network structure parameters and model information are read into the memory. Among them, the model structure parameters include the operation composition of each layer, the number of convolution kernel channels, the scale and other information, so as to determine the hardware acceleration operator required for the corresponding operation. The network parameters mainly include weight values, offset values and model quantization parameters.
[0094] Subsequently, the network parameters are transmitted to the BRAM unit of the systolic array module inside the FPGA. For example, the model parameters of the first layer are sent to BRAM A, and then the activation can be sent to the activation BRAM of the systolic array module. Because the activation is stored in the DDR memory, when sending the activation to the BRAM, the activation parameters need to enter the quantization domain and the im2col conversion, calculate the subscript corresponding to the original activation storage location, and finally combine the block information of the matrix size to send it directly to the corresponding location of the BRAM, avoiding secondary access to the memory. The activation parameter entering the quantization domain is only a simple multiplication and addition operation, which the PS is capable of completing. The communication bandwidth between PL-PS can be reduced by parameter quantization, and the AXI BRAM controller is used to send it to the activation BRAM of the systolic array.
[0095] After sending a certain amount of activations to the BRAM, a control signal is sent to start the systolic array operation. The control signal includes the address of the valid activations on the BRAM and the matrix block information, where the matrix block information determines the working mode of the accumulator at the data output of the systolic array. Each time the systolic array processes the valid activations of the BRAM, it will notify the PS in the form of a flag and wait for the next control signal. The PS has the following tasks while the systolic array is working:
[0096] ①Continuously send activation to BRAM until all current layer activations are sent;
[0097] ②Continuously monitor the completion flag of the systolic array and send corresponding control signals;
[0098] ③Send the weight data of the next layer to the weight BRAM in the inactive state.
[0099] After the matrix multiplication calculation of the current layer is completed, the int32-bit result in the accumulator will be calculated to increase the bias, and then converted to an 8-bit quantized value through Leaky ReLU and returned to the PS. At this time, the newly generated activation needs to exit the quantization domain first. If the current layer is associated with a shortcut, yolo layer, or mask generation layer, the activation needs to be saved in DDR. In most cases, the activation will be input to the next convolution layer, and the amount of calculation can be greatly reduced by fusing in and out of the quantization domain and col2im / im2col mapping.
[0100] In addition, the PS sends a control signal to convert the model parameters required by the key component detection algorithm, and cuts according to the target subject position information detected by the yolo layer, and continues the hardware accelerated reasoning according to the dotted line control flow until jumping to the mask generation network.
[0101] After all layers are calculated, the inference results of the yolo layer or mask layer cached in DDR are calculated on PS, and the credibility and annotation box information are updated to the cached original image to complete the detection and positioning of key components of large targets.
[0102] Step 4: Target detection system construction and performance analysis
[0103] The module accelerated at the PL end is encapsulated into an IP core, updated to the deep learning inference accelerator UMDLA-Yolo of the present invention, and the acceleration IP core is deployed at the PL end of the chip using the Vivado hardware development tool, and the corresponding bitstream is generated through comprehensive simulation and layout and routing. Fig.12 As shown;
[0104] Fig.12 The resource consumption and power consumption of the entire system for the hardware test project built for the present invention are shown in Table 2:
[0105] Table 2 Hardware resource consumption of single accelerator target detection system
[0106]
[0107] From Table 2 and Fig.13 The resource consumption results of each module show that the entire system design consumes the most on-chip storage units BRAM and DSP, which are mainly used by the 32×32 systolic array in the UMDLA-Yolo inference accelerator module. In addition, the runtime power consumption of the entire system is 4.049W, which meets the low power consumption requirements of heterogeneous platforms.
[0108] In addition, the resource consumption analysis of the entire system found that the resource consumption of each UMDLA-Yolo inference accelerator did not exceed 50%. For example, the BRAM cache and LUT modules accounted for 20.29% and 18.46% of the entire on-chip resources respectively. Therefore, combining the design concept of FPGA "space for time", adding a second UMDLA-Yolo module to further improve the hardware acceleration capability of FPGA, such as Fig.15 As shown;
[0109] When accelerating the inference of two UMDLA-Yolo modules, the eigenvalue matrix F(n,m) after im2col is divided into two matrices F1(1:n / 2,m) and F2(n / 2+1:n,m). The multiplication results of the two matrices after division are independent of each other and do not need to be accumulated together. Therefore, they are sent to two UMDLA-Yolo modules for parallel calculation. In addition, since the weight matrices corresponding to the two UMDLA-Yolo modules are the same, the same memory address for storing the weight matrices can be used, greatly reducing the latency caused by data reading and writing. The resource consumption and power consumption of the entire project are as follows:
[0110] Table 3 Hardware resource consumption of dual accelerator target detection system
[0111]
[0112]
[0113] Combination Fig.14 , Fig.15 , Fig.16 and Fig.17 ,Through the resource consumption comparison between the dual accelerator and the single accelerator target ,detection system, it can be seen that the resource consumption and power consumption of the dual accelerator target ,detection system are twice of that of the single accelerator, and the consumption of each hardware ,resource is within the resource range of the chip.
[0114] On the other hand, the present invention further discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the above method.
[0115] On the other hand, the present invention further discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.
[0116] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any one of the large target key feature recognition methods based on FPGA in the above embodiments.
[0117] It is understandable that the system provided by the embodiment of the present invention corresponds to the method provided by the embodiment of the present invention, and the explanation, examples and beneficial effects of the relevant contents can refer to the corresponding parts in the above method.
[0118] The embodiment of the present application also provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus.
[0119] Memory, used to store computer programs;
[0120] The processor is used to implement the above-mentioned large target key feature recognition method based on FPGA when executing the program stored in the memory.
[0121] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc.
[0122] The communication interface is used for communication between the above electronic device and other devices.
[0123] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0124] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components.
[0125] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0126] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0127] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0128] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A large target key feature recognition method based on FPGA, It is characterized in that Features: Based on the outline of the target detected for the first time, the key feature parts in the image are cropped and input into the fine detection network to detect the key parts of the target. The whole process conforms to the visual characteristics of the human eye from "global to local"; Subsequently, the key part recognition results are returned to the first stage recognition results to improve the key part target detection and positioning accuracy; Finally, the training model results are analyzed through the network, the hardware acceleration operator is optimized and designed, the heterogeneous task deployment is dynamically adjusted, the algorithm is transformed into an engineering form on the FPGA heterogeneous platform, and used for the key feature recognition of large targets; The specific steps include: S1. Design a transplantation framework system for FPGA heterogeneous platforms; S2. Build a large target key feature recognition method based on Yolo v3; S3, FPGA-based hardware acceleration design; S1, designing a transplantation framework system for FPGA heterogeneous platforms, specifically including: In view of the characteristics of deep learning network structure and FPGA heterogeneous platform architecture, a target detection system transplantation framework for deep learning algorithms is developed and designed. Software and hardware acceleration design is carried out from a high level without involving the circuit modules of the underlying hardware. The built network model is trained offline using GPU to obtain the optimal weight parameters. Then, the lightweight design of the network is realized through methods such as model quantization and pruning. Finally, the hardware acceleration unit is designed in combination with the hardware platform resource distribution to realize the efficient transplantation of deep learning models to embedded heterogeneous platforms. S2, building a large target key feature recognition method based on Yolo v3, specifically includes: Step 1: Subject target recognition based on Yolo v3; the Yolo v3 model consists of the Darknet53 skeleton network, the feature fusion network Neck and the prediction network Prediction; the skeleton network Darknet53 extracts target features based on different image granularities, combines the extracted features through the feature fusion network to improve the adaptability to targets of different scales, and the prediction network uses the fused features for classification and regression to determine the category information and location of the target; Step 2: After the large target body is detected, it is cropped according to the position information of the detection frame, resulting in low resolution and diverse scales of the image input to the key part detection network. To this end, based on the DeepLab v3 Plus network as the basic architecture, dilated convolution is used in the final stage of feature extraction to keep the resolution from decreasing, increase the receptive field, and keep the spatial position information and semantic information unchanged. At the same time, the ASPP atrous spatial pyramid pooling method is used to extract feature information of different scales, and a clear object boundary is obtained through an efficient "encoder-decoder" structure. Step 3: Analyze the test results.
2. The large target key feature recognition method based on FPGA according to claim 1, Features: The software and hardware development process in step S1 modularizes the routine processing in the deep learning algorithm transplantation process, provides efficient model pruning and quantization algorithms, improves the scalability and high configurability of the deep learning accelerator, and supports the rapid deployment of different deep learning models on FPGA heterogeneous platforms.
3. The large target key feature recognition method based on FPGA according to claim 1, Features: In the feature extraction stage of the DeepLab v3 Plus network structure in Step 2, the lightweight network MobileNet V2 is used as the backbone network, and the reverse residual unit is used to solve the gradient diffusion problem that is prone to occur in the ResNet50 structure; the reverse residual structure realizes feature extraction by "first increasing the dimension, then reducing the dimension", solving the serious problem of feature information loss caused by the previous "first compressing, then expanding".
4. The large target key feature recognition method based on FPGA according to claim 1, Features: The analysis of the detection results in Step 3 specifically includes training the data according to the network structure of the improved model, extracting the feature semantic information of the key parts of the large target at the pixel level, and detecting the contour boundary of the main target.
5. The large target key feature recognition method based on FPGA according to claim 1, Features: The S3, FPGA-based hardware acceleration design, specifically includes: S31, using the Tensorflow framework interface function to quantize the trained model results; after quantization, the quantization parameters of each layer of network weights, activation function values and eigenvalues are stored in DDR for subsequent quantization domain use; S32. In the hardware acceleration design, HLS is used to compile each layer to generate independent hardware acceleration operators. The operators use interface calls to realize layer-to-layer data transmission and calls. The design process of the fusion operator does not involve specific parameter configuration. It can fuse independent operators in HLS and reserve the interface configuration of the fusion operator. S33, by quantizing the training model parameters and reconfiguring the hardware acceleration operators, combining the FPGA hardware platform resource distribution and the target detection network structure, the algorithm is divided into heterogeneous tasks; S34. Encapsulate the module for acceleration on the PL side into an IP core, update it to the deep learning inference accelerator UMDLA-Yolo, use the Vivado hardware development tool to deploy the acceleration IP core on the PL side of the chip, and generate the corresponding bitstream through comprehensive simulation and layout and routing.
6. The large target key feature recognition method based on FPGA according to claim 5, Features: The inference control process of target detection also included in S33 is as follows: The trained model description file is ×.cfg, and the weight parameter file is ×.weights. They are stored in DDR through file parsing. The model can be deployed according to the heterogeneous design process to complete the target detection reasoning task. The PS is responsible for file loading and self-check scheduling for the entire system operation. The tasks have the ability to execute sequentially, while the main network architecture is accelerated on the PL side. The input image source is loaded into the DDR memory for preprocessing before image detection. After the image data is ready, the network structure parameters and model information are read into the memory; the model structure parameters include the operation composition of each layer, the number of convolution kernel channels, and the scale, so as to determine the hardware acceleration operator required for the corresponding operation. The network parameters include weight values, offset values, and model quantization parameters. Subsequently, the network parameters are transmitted to the BRAM unit of the systolic array module inside the FPGA, including sending the model parameters of the first layer to BRAM A, and then the activation can be sent to the activation BRAM of the systolic array module. Because the activation is stored in the DDR memory, when sending the activation to the BRAM, the activation parameters need to enter the quantization domain and the im2col conversion, calculate the subscript corresponding to the original activation storage position, and finally combine the block information of the matrix size to send it directly to the corresponding position of the BRAM to avoid secondary access to the memory; the activation parameters entering the quantization domain are only a simple multiplication and addition operation, which the PS is capable of completing. The communication bandwidth between PL-PS can be reduced by parameter quantization, and the AXIBRAM controller is used to send it to the activation BRAM of the systolic array; After sending a certain amount of activations to the BRAM, a control signal is sent to start the systolic array operation. The control signal includes the address of the valid activations on the BRAM and the matrix block information, where the matrix block information determines the working mode of the accumulator at the data output of the systolic array. After each systolic array processes the valid activations of the BRAM, it notifies the PS in the form of a flag and waits for the next control signal. The PS has the following tasks while the systolic array is working: ①Continuously send activation to BRAM until all current layer activations are sent; ②Continuously monitor the completion flag of the systolic array and send corresponding control signals; ③ Send the weight data of the next layer to the weight BRAM in the inactive state; After the matrix multiplication calculation of the current layer is completed, the int32-bit result in the accumulator will be calculated to increase the bias, and then converted to an 8-bit quantized value through Leaky ReLU and returned to the PS. At this time, the newly generated activation needs to exit the quantization domain first; if the current layer is associated with a shortcut, yolo layer, or mask generation layer, the activation needs to be saved in DDR; The activation will be input to the next convolutional layer, which can greatly reduce the amount of computation by fusing the in and out quantization domain and col2im / im2col mapping; In addition, the PS sends a control signal to convert the model parameters required by the key component detection algorithm, and cuts according to the target subject position information detected by the yolo layer, and continues the hardware accelerated reasoning according to the dotted line control flow until jumping to the mask generation network; After all layers are calculated, the inference results of the yolo layer or mask layer cached in DDR are calculated on PS, and the credibility and annotation box information are updated to the cached original image to complete the detection and positioning of key components of large targets.
7. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Instrument image recognition method and device, electronic equipment and computer readable medium
CN113537153A
Joint detection method of unmanned aerial vehicle to ground military target and key part thereof
CN117456391A
