A hybrid neural network method and system integrating local and global information

By designing local large-core convolution blocks and global visual Transformer blocks, combined with large-core convolution attention and lightweight cross-head self-attention, a pyramid-structured SUMMNet neural network is formed, which solves the problem of convolutional neural networks in processing large-scale images. It solves the problem of low computational efficiency in data processing, achieves efficient local and global feature capture, and reduces computational complexity.

CN117993442BActive Publication Date: 2024-10-18SHENZHEN JIAHE XINGYE INFORMATION TECHNOLOGY CO LTD

Patent Information

Application Number
CN202410324239.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-21
Publication Date
2024-10-18
Estimated Expiration
2044-03-21

AI Technical Summary

Technical Problem

Convolutional neural networks have low computational efficiency when processing large-scale image data, especially due to the increased complexity of calculating the attention matrix, which requires a large amount of computing resources when processing large-scale sequences.

Method used

Local large kernel convolutional block (LLCB) and global visual transformer block (GVTB) are designed as the main building blocks of the hybrid neural network. LLCB captures local features through large kernel convolution attention, and GVTB uses lightweight cross-head self-attention and Dynamic position embedding extracts global information and reduces computational complexity by reducing the dimensions of self-attention K and V, forming a pyramid-structured SUMMNet neural network.

Benefits of technology

It achieves efficient capture of local and global features of images, reduces computational complexity, and provides an innovative multi-scale information processing method that combines powerful convolution operations and Transformers to improve the efficiency of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117993442B_ABST
    Figure CN117993442B_ABST
Patent Text Reader

Abstract

The present invention proposes a hybrid neural network method and system for fusing local and global information, and relates to the field of computer vision. The present invention designs a local large kernel convolution block (LLCB) and a global visual transformer block (GVTB) as the main building blocks of the hybrid neural network SUMMNet. LLCB introduces large kernel convolution attention (LKCA) to effectively capture local features of feature maps; GVTB introduces lightweight cross-head self-attention (LCHSA) to enhance the interaction between attention heads, extract global information of feature maps, and reduce computational complexity by reducing the dimensions of self-attention K and V; the synergy of LLCB and GVTB enables SUMMNet to focus on local and global information at different scales and efficiently perform image processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision, and in particular to a hybrid neural network method and system that fuses local and global information. Background Art

[0002] Convolutional Neural Networks (CNNs) and Visual Transformers (ViTs) are core technologies in computer vision. While Convolutional Neural Networks are robust and widely used in traditional computer vision tasks, ViTs represent an emerging trend in Visual Transformers. Convolutional Neural Networks capture local features of images through local dependencies and are computationally efficient, especially when processing large-scale image data. ViTs with self-attention can globally capture the relationship between input image sequences. Nevertheless, calculating the similarity between tokens requires a lot of computing resources, and the complexity of calculating the attention matrix increases quadratically, which leads to a lot of computation when processing large-scale sequences. Summary of the invention

[0003] The present invention provides a hybrid neural network method for fusing local and global information, comprising the following steps:

[0004] S1. Design the local large kernel convolution block (LLCB) and the global visual transformer block (GVTB) as the main building blocks of the hybrid neural network to enable the neural network to efficiently capture the local and global features of the image in image processing tasks and obtain more comprehensive information;

[0005] S2, LLCB introduces large kernel convolution attention (LKCA) to effectively capture the local features of feature maps. The core of LKCA is a 7×7 large kernel convolution;

[0006] S3 and GVTB introduce lightweight cross-head self-attention (LCHSA) to enhance the interaction between attention heads, extract the global information of feature maps, and reduce the computational complexity by reducing the dimensions of self-attention K and V;

[0007] S4. Stacking multiple LLCB and GVTB network modules constitutes the neural network SUMMNet. SUMMNet is a hybrid neural network method that integrates local and global information. SUMMNet includes four stages, each of which is composed of LLCB and GVTB. Image downsampling operations are performed between stages to form a pyramid structure.

[0008] Preferably, the local large kernel convolution block (LLCB) in S1, LLCB consists of two key modules: large kernel convolution attention (LKCA) and MLP. Given an input image , , where H and W are the height and width of the input image, C To embed the dimension, it is input into LLCB, which can be represented by the following process: , .

[0009] Preferably, the Global Visual Transformer Block (GVTB) in S1, GVTB consists of three key modules: Dynamic Position Embedding (DPE), Lightweight Cross-Head Self-Attention (LCHSA) and MLP. Given an input image , which is input into GVTB, can be represented by the following process: , , .

[0010] Preferably, GVTB in S3 introduces lightweight cross-head self-attention (LCHSA) to enhance the interaction between attention heads, extract the global information of feature maps, and reduce the computational complexity by reducing the dimensions of self-attention K and V; given an input image Input into LCHSA, first get Q, K, V for self-attention operation: , , , Conv() represents the use of convolution to reduce the spatial dimension of the image, where the convolution kernel is k and W is the corresponding linear projection parameter; two linear layers are used to enhance the interaction between heads, so that the model can learn to capture different relationships and features in multiple attention heads: , calculate the attention map of the image: , and finally the output of Attention is added to the input image X: .

[0011] Preferably, the neural network SUMMNet in S4, SUMMNet includes four stages, each stage is composed of LLCB and GVTB, and image downsampling operations are performed between stages to form a pyramid structure. Different from the traditional network structure of shallow deployment of convolutional layers and deep deployment of Transformer, each stage of SMMNet fully combines LLCB and GVTB, and each stage fully considers global and local information and interacts with information. LLCB is deployed in front of GVTB in the same stage.

[0012] The present invention also provides a hybrid neural network system that integrates local and global information, characterized in that it includes: a local feature extraction module, which effectively captures local detail features of feature maps by using large kernel convolution; a global feature extraction module, in which lightweight cross-head self-attention is used to capture long-range dependencies while reducing the dimensions of Key and Value to reduce the computational complexity of the self-attention operation; a stacking module, in which multiple LLCB modules and GVTB modules are stacked to form a four-stage neural network, that is, a hybrid neural network system that integrates local and global information.

[0013] Compared with the prior art, the present invention has the following technical effects:

[0014] SUMMNet is an innovative and efficient multi-scale information processing method that combines powerful convolution operations and Transformers to perform local feature extraction and global semantic capture at each stage. SUMMNet consists of two main parts, LLCB and GVTB; LLCB uses LKCA to enhance feature extraction of local information, while GVTB aims to learn and capture the representation of global contextual features with the help of LCHSA. The synergy of these two constructions enables SUMMNet to focus on local and global information at different scales, providing a powerful tool for comprehensive information processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 A neural network architecture diagram provided for an embodiment of the present invention;

[0016] Figure 2 Configuration of a neural network family provided for an embodiment of the present invention;

[0017] Figure 3 This is a graph comparing the classification performance of the method according to an embodiment of the present invention and several different methods on the ImageNet-1k dataset. DETAILED DESCRIPTION

[0018] The present invention aims to propose a hybrid neural network method and system that fuses local and global information. The neural network consists of four stages, each of which consists of a local large kernel convolution block (LLCB) and a global visual transformer block (GVTB). LLCB introduces large kernel convolution attention (LKCA) to effectively capture local features of feature maps, and GVTB adopts lightweight cross-head self-attention (LCHSA) to enhance attention head interaction, extract global information of feature maps, and reduce computational complexity by reducing the dimensions of self-attention K and V.

[0019] See also Figure 1 As shown, a hybrid neural network method and system that integrates local and global information in an embodiment of the present application:

[0020] S1. Design the local large kernel convolution block (LLCB) and the global visual transformer block (GVTB) as the main building blocks of the hybrid neural network to enable the neural network to efficiently capture the local and global features of the image in image processing tasks and obtain more comprehensive information;

[0021] S2, LLCB introduces large kernel convolution attention (LKCA) to effectively capture the local features of feature maps. The core of LKCA is a 7×7 large kernel convolution;

[0022] S3 and GVTB introduce lightweight cross-head self-attention (LCHSA) to enhance the interaction between attention heads, extract the global information of feature maps, and reduce the computational complexity by reducing the dimensions of self-attention K and V;

[0023] S4. Stacking multiple LLCB and GVTB network modules constitutes the neural network SUMMNet. SUMMNet is a hybrid neural network method that integrates local and global information. SUMMNet includes four stages, each of which is composed of LLCB and GVTB. Image downsampling operations are performed between stages to form a pyramid structure.

[0024] Furthermore, the local large kernel convolution block (LLCB) in S1 consists of two key modules: large kernel convolution attention (LKCA) and MLP. Given an input image , N=H×W, where H and W are the height and width of the input image, C To embed the dimension, it is input into LLCB, which can be represented by the following process: , ,First, the large kernel convolution of LKCA is used to extract the local features of the ,feature image, and then the output of LKCA is transferred to MLP to establish global ,perception.,MLP consists of two linear layers, and we add GELU function between the two ,linear layers. This is the output of LLCB

[0025] Furthermore, the Global Visual Transformer Block (GVTB) in S1 consists of three key modules: Dynamic Position Embedding (DPE), Lightweight Cross-Head Self-Attention (LCHSA), and MLP. Given an input image , which is input into GVTB, can be represented by the following process: , , First, Dynamic Position Embedding (DPE) is used to enable the model to more effectively understand the relative position relationship between elements, and then it is input into LCHSA to extract global information. The output of LCHSA is then passed to MLP to establish global perception. This is the output of GVTB.

[0026] Furthermore, the lightweight cross-head self-attention (LCHSA) in S3, given an input image Input into LCHSA, first get Q, K, V for self-attention operation: , , , Conv() represents the use of convolution to reduce the spatial attention of the image, where the convolution kernel is k and W is the corresponding linear projection parameter; two linear layers are used to enhance the interaction between the heads, so that the model can learn to capture different relationships and features in multiple attention heads: , calculate the attention map of the image: , and finally the output of Attention is added to the input image X: , Y is the output of LCHSA.

[0027] Furthermore, the neural network SUMMNet in S4,SUMMNet includes four stages, each stage consists of LLCB and GVTB, and the image is downsampled between stages to form a pyramid structure. Different from the traditional network structure of shallow deployment of convolutional layers and deep deployment of Transformer, each stage of SMMNet fully combines LLCB and GVTB, and each stage fully considers global and local information and interacts with information. LLCB is deployed in front of GVTB in the same stage. In order to make a fair comparison with other ViTs, we instantiate SUMMNet with four different model sizes by setting different numbers of blocks, such as Figure 2 As shown in Figure 1, to obtain hierarchical feature maps, we use 4×4 non-overlapping convolutions at the beginning of the model and use downsampling layers between stages to adjust the different scales of the feature maps. Figure 2 The Blocks in corresponds to the number of blocks in the four stages of SUMMNet, and the number of blocks in each stage is the sum of the number of blocks in LLCB and GVTB.

[0028] This embodiment provides a hybrid neural network system that integrates local and global information, characterized in that: a local feature extraction module effectively captures local detail features of feature maps by using large kernel convolution; a global feature extraction module, lightweight cross-head self-attention is used to capture long-range dependencies, while reducing the dimensions of Key and Value to reduce the computational complexity of self-attention operations; a stacking module, multiple LLCB modules and GVTB modules are stacked to form a four-stage neural network, that is, a hybrid neural network system that integrates local and global information. Inputting an image into the neural network system can extract image features and then perform row prediction and classification.

[0029] The above are only preferred embodiments of the present invention. It should be pointed out that a person skilled in the art can make several modifications and improvements without departing from the inventive concept of the present invention, and these all fall within the protection scope of the present invention.

Claims

1. A hybrid neural network method that integrates local and global information, characterized in that: The following steps are involved: S1. Design the local large kernel convolution block (LLCB) and the global visual transformer block (GVTB) as the main building blocks of the hybrid neural network to enable the neural network to efficiently capture the local and global features of the image in image processing tasks and obtain more comprehensive information; S11. For the local large kernel convolution block (LLCB), LLCB consists of two key modules: large kernel convolution attention (LKCA) and MLP. Given an input image X∈R N×C , N = H × W, where H and W are the height and width of the input image, and C is the embedding dimension. Inputting it into LLCB can be represented by the following process: X1 = X + LKCA (X), Y1 = X1 + MLP (X1); S12. For the Global Visual Transformer Block (GVTB), GVTB consists of three key modules: Dynamic Position Embedding (DPE), Lightweight Cross-Head Self-Attention (LCHSA), and MLP. Given an input image X∈R N×C , which is input into GVTB, can be represented by the following process: X2 = X + DPE (X), Y2 = X2 + LCHSA (X2), Z2 = Y2 + MLP (Y2); S2, LLCB introduces large kernel convolution attention (LKCA) to effectively capture the local features of feature maps. The core of LKCA is a 7×7 large kernel convolution; S3 and GVTB introduce lightweight cross-head self-attention (LCHSA) to enhance the interaction between attention heads, extract the global information of feature maps, and reduce the computational complexity by reducing the dimensions of self-attention K and V; S4. Stacking multiple LLCB and GVTB network modules constitutes the neural network SUMMNet. SUMMNet is a hybrid neural network method that integrates local and global information. SUMMNet includes four stages, each of which is composed of LLCB and GVTB. Image downsampling operations are performed between stages to form a pyramid structure.

2. A hybrid neural network method for fusing local and global information according to claim 1, characterized in that: GVTB in S3 introduces lightweight cross-head self-attention (LCHSA) to enhance the interaction between attention heads, extract the global information of feature maps, and reduce the computational complexity by reducing the dimensions of self-attention K and V; given an input image X∈R N×C Input to LCHSA, first obtain Q, K, V for self-attention operation: Q = Norm (XW Q ), K = Norm(Conυ(X, k)W K ), V = Norm(Conv(X, k)W V ), Conv() represents the use of convolution to reduce the spatial dimension of image X, where the convolution kernel is k and W is the corresponding linear projection parameter; two linear layers are used to enhance the interaction between heads, so that the model can learn to capture different relationships and features in multiple attention heads: score = Linear(GELU(Linear(QK T ))), calculate the attention map of the image: Finally, the output of Attention is added to the input image X: Y = X + Attention (Q, K, V).

3. A hybrid neural network method for fusing local and global information according to claim 1, characterized in that: The neural network SUMMNet in S4, SUMMNet includes four stages, each stage is composed of LLCB and GVTB, and image downsampling operations are performed between stages to form a pyramid structure. Different from the traditional network structure of shallow deployment of convolutional layers and deep deployment of Transformer, each stage of SMMNet fully combines LLCB and GVTB. Each stage fully considers global and local information and interacts with information. LLCB is deployed in front of GVTB in the same stage.

4. A hybrid neural network system integrating local and global information, characterized in that: include: The local feature extraction module effectively captures the local detail features of the feature map by using large kernel convolution; Global Feature extraction module, lightweight cross-head self-attention is used to capture long-range dependencies, while reducing the dimensions of Key and Value to reduce the computational complexity of the self-attention operation; stacking module, multiple LLCB modules and GVTB modules are stacked to form a four-stage neural network, which is a hybrid neural network system that integrates local and global information and implements any method as described in claims 1-3.

Citation Information

Patent Citations

  • Hybrid architecture image reconstruction method of global fusion cross self-attention network

    CN117253126A

  • Brain state advisory system using calibrated metrics and optimal time-series decomposition

    US20160242690A1

Cited By

  • Capsule material visual defect detection method and system based on hybrid neural network

    CN122335728A