Image processing method and device based on hybrid network, equipment, medium and product
By introducing the Transformer model into CNN and integrating convolution features and attention features, the problem of CNN's insufficient perception of long-distance pixel relationships in multi-cell classification is solved, and the classification accuracy is significantly improved.
Patent Information
- Application Number
- CN202410881872.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2024-09-13
AI Technical Summary
CNN's ability to perceive long-distance pixel relationships due to local convolution operations in cell multi-classification or image multi-classification is weak, and the classification accuracy is difficult to improve.
Design an image processing method based on hybrid network, combining the Resnet50 network and Transformer model, and integrating convolutional features and attention features through the Transfer module, local feature embedding module and splicing module to improve the classification accuracy of image processing.
It effectively improves the classification accuracy in the case of multi-cell classification. It combines the advantages of Resnet50 feature extraction and Transformer to handle global relationships, avoiding the shortcomings of separate use and improving the accuracy.
Smart Images

Figure CN118644736A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image processing method, device, equipment, medium and product based on a hybrid network. Background Art
[0002] CNN (Convolutional Neural Networks) is a deep feedforward neural network with characteristics such as local connection and weight sharing. It is one of the representative algorithms of deep learning.
[0003] In related technologies, the Resnet50 network is a type of CNN network, such as Figure 1 As shown in the figure, the Resnet50 network contains 49 convolutional layers and one fully connected layer. The Resnet50 network structure can be divided into seven parts. The first part includes conv1, bn1, relu and maxpool, which mainly perform convolution, regularization, activation function and maximum pooling calculations on the input. The second, third, fourth and fifth parts are from layer1 to layer4, all of which contain residual blocks. The sixth and seventh parts are avgpool average pooling and fc full connection respectively. The residual blocks have three layers of convolution, so the network has a total of 49 convolutional layers, plus the final fully connected layer, a total of 50 layers, which is also the origin of the name Resnet50.
[0004] The input of the network is 3×3224×224. After the convolution calculation of the first five parts, the output is 7×7×2048. The pooling layer will convert it into a feature vector. Finally, the classifier will calculate this feature vector and output the category probability. num_class is the number of categories.
[0005] However, the local convolution operation of CNN makes it less able to perceive long-distance pixel relationships. Therefore, in the case of multi-classification of cells or images, how to improve the classification accuracy needs to be further improved. Summary of the invention
[0006] The present invention provides an image processing method, device, equipment, medium and product based on a hybrid network to solve the problem of how to improve the classification accuracy in the case of multi-classification of cells or multi-classification of images.
[0007] The first aspect of the present invention provides an image processing method based on a hybrid network, comprising the following steps: obtaining an image to be processed; scaling the image to be processed to a target size; inputting the scaled image to be processed into a hybrid network model, and the hybrid network model outputs an image processing result, wherein the hybrid network model includes a Resnet50 network, a Transfer module, a local feature embedding module, a Transformer and a splicing module, the Resnet50 network extracts a convolutional feature map of the scaled image to be processed, the Transfer module adjusts the number of channels of the convolutional feature map, the local feature embedding module extracts an embedding feature map of the convolutional feature map, the Transformer extracts an attention feature map of the embedded feature map, the splicing module splices the convolutional feature map and the attention feature map to obtain a spliced feature map, and the average pooling and fully connected layers of the Resnet50 network output the image processing result according to the spliced feature map.
[0008] Optionally, the Resnet50 network includes a convolution layer, a regularization layer, an activation function layer, a maximum pooling layer, a first to fourth residual network, an average pooling layer and a fully connected layer, wherein the second residual network does not perform a downsampling operation, the second residual network adjusts the number of input channels based on the internal convolution kernel, the convolution feature map output by the fourth residual network is input into the Transfer module, and the splicing feature map output by the splicing module is input into the average pooling layer.
[0009] Optionally, the Transfer module includes a convolution kernel, and the number of channels of the convolution feature map is adjusted based on the convolution kernel.
[0010] Optionally, the image block embedding layer performs linear transformation, flattening and dimensional order adjustment on each image block of the convolution feature map to obtain a first vector for each image block, the position embedding layer generates a second vector for each image block with the same dimension as the first vector, and the output layer outputs the embedded feature obtained by adding the first vector and the second vector of each image block.
[0011] Optionally, Transformer performs a fully connected linear transformation on the embedded features to generate queries, keys, and values respectively, generates attention scores based on the queries and keys, generates attention values based on the normalized attention scores and values, performs a linear transformation on the attention values and adds them to the input of the transformer, then undergoes a multi-layer perceptron feature transformation, and adds them to the input of the feature transformation to obtain the attention feature.
[0012] Optionally, the concatenation module concatenates the convolutional feature map and the attention feature map in the channel dimension.
[0013] The second aspect of the present invention provides an image processing device based on a hybrid network, including: an acquisition module for acquiring an image to be processed; a scaling module for scaling the image to be processed to a target size; a classification module for inputting the scaled image to be processed into a hybrid network model, and the hybrid network model outputs an image processing result, wherein the hybrid network model includes a Resnet50 network, a Transfer module, a local feature embedding module, a Transformer and a splicing module, the Resnet50 network extracts a convolutional feature map of the scaled image to be processed, the Transfer module adjusts the number of channels of the convolutional feature map, the local feature embedding module extracts an embedding feature map of the convolutional feature map, the Transformer extracts an attention feature map of the embedded feature map, the splicing module splices the convolutional feature map and the attention feature map to obtain a spliced feature map, and the average pooling and fully connected layers of the Resnet50 network output the image processing result according to the spliced feature map.
[0014] A third aspect of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement an image processing method based on a hybrid network as described in the above embodiment.
[0015] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, the program being executed by a processor to implement the image processing method based on a hybrid network as described in the above embodiment.
[0016] A fifth aspect of the present invention provides a computer program product, including a computer program or instructions, which, when executed, are used to implement the image processing method based on the hybrid network as described in the above embodiment.
[0017] Thus, the present invention includes the following beneficial effects: The embodiment of the present invention designs a hybrid network Resnet-Former based on the Resnet50 network and Transformer. Based on the fusion method and network structure, it utilizes the respective advantages of the Resnet50 network and the Transformer, solves the problem of classification accuracy in the case of multi-classification of cells, and effectively improves the classification accuracy in the case of multi-classification of cells.
[0018] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which: Figure 1 Resnet 50 network structure diagram of related technology; Figure 2 Layer1 network structure diagram of related technology; Figure 3 Layer2 network structure diagram of related technologies; Figure 4 Layer3 network structure diagram of related technologies; Figure 5 Layer4 network structure diagram of related technologies; Figure 6 Transformer structure diagram of related technologies; Figure 7 is a flowchart of an image processing method based on a hybrid network according to an embodiment of the present invention; Figure 8 is an image to be processed according to an embodiment of the present invention; Fig. 9 A diagram showing the structure of a Resnet-Former network according to an embodiment of the present invention; Fig.10 is a structural diagram of a transfer module according to an embodiment of the present invention; Fig.11 is a structural diagram of an embedding module according to an embodiment of the present invention; Fig.12 is a structural diagram of a transformer module according to an embodiment of the present invention; Fig.13 It is a Resnet50 verification result curve diagram according to an embodiment of the present invention; Fig.14 A curve diagram of the Resnet-Former verification result according to an embodiment of the present invention; Fig.15 is an exemplary diagram of an image processing device based on a hybrid network according to an embodiment of the present invention; Fig.16 FIG. 4 is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0021] In related technologies, such as Figure 1As shown in the figure, the second, third, fourth and fifth parts of the Resnet50 network are from layer1 to layer4, all of which contain residual blocks. The following will explain the network from layer1 to layer4 in detail, as follows: like Figure 2 As shown in the figure, the ellipse is the input and output. The dotted box on the left is a residual block. A residual block is a three-layer convolution. The ×2 on the right indicates that there are two such blocks, which are connected in sequence. Layer 1 is not downsampled. It only needs to use 256 1*1 convolution kernels to change the number of input channels and add them to the output after convolution.
[0022] like Figure 3 As shown in the figure, layer2 has 4 residual blocks. Because of downsampling, before the input is added to the result of the convolution operation, in addition to using 256 1*1 convolution kernels to change the number of input channels, the stride is 2 for downsampling to keep the image size consistent.
[0023] like Figure 4 As shown, Layer3 has 6 residual blocks and also has downsampling. Before adding the input to the result of the convolution operation, the number of channels and downsampling will be changed through convolution to keep the image size consistent.
[0024] like Figure 5 As shown, Layer 4 has 3 residual blocks and is also downsampled.
[0025] Transformer is a deep learning model that is commonly used for image processing, such as tumor image segmentation. Transformer was originally used to solve the translation of word vectors and was later applied to image classification models. Whether it is text translation or computer vision, the structure of Transformer is the same.
[0026] like Figure 6 As shown, the circle has a plus sign to indicate the addition operation. The main steps of Transformer are: (1) Patch embedding means local feature embedding: the feature embedding of a patch. The input of the Transformer is a vector, that is, a token. The image is divided into patches of fixed size. The process of mapping each patch into a vector is called patch embedding. Tokens need to be added with position encoding and added, and the dimension remains unchanged.
[0027] (2) Norm refers to standardization, and the data is standardized according to the layer normalization method.
[0028] (3) Multi-Head Attention refers to a multi-head attention mechanism that can combine information learned from different heads.
[0029] (4) MLP (multi-layer perceptron) performs global perception on the feature maps output by the multi-head attention mechanism.
[0030] However, the local convolution operation of CNN makes it less able to perceive long-distance pixel relationships, and it is not as good as Transformer in dealing with global relationship problems. The self-attention mechanism of the Transformer model requires a lot of computing resources and memory, and its feature extraction ability is relatively weak, not as good as CNN.
[0031] To this end, the embodiment of the present invention designs a fusion method and network structure, utilizing the respective advantages of Resnet50 and Transformer to solve the problem of classification accuracy in the case of multi-classification of cells.
[0032] The following describes the hybrid network-based image processing method, device, equipment, storage, medium and product of the embodiments of the present invention with reference to the accompanying drawings. Specifically, Figure 7 A schematic flow chart of an image processing method based on a hybrid network provided in an embodiment of the present invention.
[0033] like Figure 7 As shown, the image processing method based on the hybrid network includes the following steps: In step S101, an image to be processed is obtained.
[0034] It is understandable that the images to be processed may include cell images or other images, and the embodiments of the present invention may be selected according to actual conditions, for example, classification of images of cells or other contents may be implemented, without specific limitation.
[0035] Cell images, for example, play an important role in biomedical research, clinical diagnosis, and drug development. They can provide detailed information about cell structure, function, and interrelationships. The images to be processed are usually acquired through microscopy techniques, including optical microscopy, electron microscopy, fluorescence microscopy, etc.
[0036] In step S102, the image to be processed is scaled to a target size.
[0037] The target size can be set according to the situation, such as 112*112, etc., without specific limitation.
[0038] by Figure 8Taking the cell image shown as an example, the identified cell, including the surrounding environment, has a small image size of about 100*100. The cell is centered in the image and is uniformly scaled to 112*112 before entering the network.
[0039] In step S103, the scaled image to be processed is input into the hybrid network model, and the hybrid network model outputs the image processing result, wherein the hybrid network model includes a Resnet50 network, a Transfer module, a local feature embedding module, a Transformer and a splicing module, the Resnet50 network extracts the convolution feature map of the scaled image to be processed, the Transfer module adjusts the number of channels of the convolution feature map, the local feature embedding module extracts the embedding feature map of the convolution feature map, the Transformer extracts the attention feature map of the embedding feature map, the splicing module splices the convolution feature map and the attention feature map to obtain a spliced feature map, and the average pooling and fully connected layers of the Resnet50 network output the image processing result according to the splicing feature map.
[0040] It is understandable that hybrid network models such as Fig. 9 As shown, the embodiment of the present invention designs a hybrid network Resnet-Former based on the Resnet50 network and the Transformer. Based on the fusion method and network structure, the respective advantages of the Resnet50 network and the Transformer are utilized to solve the problem of classification accuracy in the case of multi-classification of cells, and effectively improve the classification accuracy in the case of multi-classification of cells.
[0041] In the embodiment of the present invention, the Resnet50 network includes a convolution layer, a regularization layer, an activation function layer, a maximum pooling layer, a first to a fourth residual network, an average pooling layer and a fully connected layer. Since the input image size is only 112*112, the second residual network does not need to perform a downsampling operation, and only adjusts the number of input channels based on the internal convolution kernel. The convolution feature map output by the fourth residual network is input to the Transfer module, and the splicing module ( Fig. 9 The concatenated feature map output by (represented as concat in ) is input into the average pooling layer.
[0042] It is understandable that if Fig. 9 As shown, for the layer2 network, Figure 8 Taking the cell image shown in the figure as an example, since the input size of the image is 112*112, layer2 does not perform downsampling. That is, before the input is added to the result of the convolution operation, only 256 1*1 convolution kernels are used to change the number of input channels, and the stride is 1 without downsampling.
[0043] In an embodiment of the present invention, the Transfer module includes a convolution kernel, and the number of channels of the convolution feature map is adjusted based on the convolution kernel.
[0044] like Fig.10 As shown in the figure, the function of the transfer module is to change the number of channels of the convolutional feature map as the input of the embedding module, where the embedding module is the local feature embedding module.
[0045] In an embodiment of the present invention, the image block embedding layer performs linear transformation, flattening and dimensional order adjustment on each image block of the convolutional feature map to obtain a first vector for each image block, the position embedding layer generates a second vector for each image block with the same dimension as the first vector, and the output layer outputs the embedded feature obtained by adding the first vector and the second vector of each image block.
[0046] like Fig.11 As shown, the local feature embedding module includes an image block embedding layer ( Fig.11 denoted as patchembedding) and position embedding layer ( Fig.11 The image block embedding layer uses a 1*1 convolution kernel to linearly transform the feature map, and generates 49 first vectors by flattening and adjusting the dimensional order. The first vectors are added to the vectors of the same dimension generated by the position embedding layer as the input of the Transformer. For example, in the attached figure, there are 49 512-dimensional first vectors, and the dimension of the second vector is also 512, and the number is also 49. The size of the image block in the attached figure is 1*1. The image block size and the number of vector dimensions are configurable parameters.
[0047] In an embodiment of the present invention, Transformer performs a fully connected linear transformation on the embedded features to generate queries, keys and values respectively, generates an attention score based on the query and the key, generates an attention value based on the normalized attention score and the value, performs a linear transformation on the attention value and adds it to the input of the transformer, then undergoes a multi-layer perceptron feature transformation, and obtains the attention feature after adding it to the input of the feature transformation.
[0048] like Fig.12 As shown in the figure, the number of heads and blocks of the Transformer can be set. Taking a block with 2 heads as an example, the query, key, and value are generated respectively through the fully connected linear transformation ( Fig.12In the example, the multi-head attention is divided into two parts, the query, key and value are represented as query, key and value respectively, the query and key are calculated with attention scores, the normalized attention scores and values are matrix-multiplied to get the attention values, the attention values are dimensionally reshaped, the multi-head attention is restored to a tensor of total size, and then linearly transformed through full connection, added to the input embedding, and then passed through a multi-layer perceptron ( Fig.12 The transformed features are added to the input of the multi-layer perceptron to obtain the output of the Transformer block.
[0049] Data standardization is required before generating queries, keys, and values, as well as before MLP feature transformation.
[0050] In an embodiment of the present invention, the splicing module splices the convolutional feature map and the attention feature map in the channel dimension.
[0051] The classification accuracy of the image processing method based on the hybrid network in the embodiment of the present invention will be verified by using a blood image processing data set. Fig.13 and 14 As shown in the figure, the training and verification results of Resnet50 and Resnet-Former on the blood image processing dataset, the number of epochs is set to 100. Resnet50 has only 2 epochs with a verification accuracy exceeding 90%, while Resnet-Former has 7 epochs with a verification accuracy exceeding 90%, and the highest accuracy has increased from 91% to 94%.
[0052] Therefore, the embodiment of the present invention combines the advantages of Resnet50 feature extraction and Transformer's advantages in processing global relations, avoiding the shortcomings of Resnet50 and Transformer. Since selfTransformer is only calculated on the last feature map, the feature map size is 7*7, the speed is fast, and the problem of Transformer requiring a lot of computing resources and insufficient memory is avoided.
[0053] Next, the image processing device based on a hybrid network according to an embodiment of the present invention is described with reference to the accompanying drawings.
[0054] Fig.15 4 is a block diagram of an image processing device based on a hybrid network according to an embodiment of the present invention.
[0055] like Fig.15 As shown, the hybrid network-based image processing device 10 includes: an acquisition module 100 , a scaling module 200 and a classification module 300 .
[0056] Among them, the acquisition module 100 is used to acquire the image to be processed; the scaling module 200 is used to scale the image to be processed to the target size; the classification module 300 is used to input the scaled image to be processed into the hybrid network model, and the hybrid network model outputs the image processing result, wherein the hybrid network model includes a Resnet50 network, a Transfer module, a local feature embedding module, a Transformer and a splicing module, the Resnet50 network extracts the convolution feature map of the scaled image to be processed, the Transfer module adjusts the number of channels of the convolution feature map, the local feature embedding module extracts the embedding feature map of the convolution feature map, the Transformer extracts the attention feature map of the embedding feature map, the splicing module splices the convolution feature map and the attention feature map to obtain the splicing feature map, and the average pooling and fully connected layers of the Resnet50 network output the image processing result according to the splicing feature map.
[0057] It should be noted that the aforementioned explanation of the embodiment of the image processing method based on the hybrid network is also applicable to the image processing device based on the hybrid network of this embodiment, and will not be repeated here.
[0058] According to the image processing device based on the hybrid network proposed in the embodiment of the present invention, a hybrid network Resnet-Former is designed based on the Resnet50 network and the Transformer. Based on the fusion method and network structure, the respective advantages of the Resnet50 network and the Transformer are utilized to solve the problem of classification accuracy in the case of multiple cell classifications, and the classification accuracy in the case of multiple cell classifications is effectively improved.
[0059] Fig.16 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. The electronic device may include: A memory 1601 , a processor 1602 , and a computer program stored in the memory 1601 and executable on the processor 1602 .
[0060] When the processor 1602 executes the program, the image processing method based on the hybrid network provided in the above embodiment is implemented.
[0061] Furthermore, the electronic device further comprises: The communication interface 1603 is used for communication between the memory 1601 and the processor 1602 .
[0062] The memory 1601 is used to store computer programs that can be executed on the processor 1602 .
[0063] The memory 1601 may include a high-speed RAM (Random Access Memory) memory, and may also include a non-volatile memory, such as at least one disk memory.
[0064] If the memory 1601, the processor 1602 and the communication interface 1603 are implemented independently, the communication interface 1603, the memory 1601 and the processor 1602 can be connected to each other through a bus and communicate with each other. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.16 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0065] Optionally, in a specific implementation, if the memory 1601, the processor 1602 and the communication interface 1603 are integrated on a chip, the memory 1601, the processor 1602 and the communication interface 1603 can communicate with each other through an internal interface.
[0066] The processor 1602 may be a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0067] An embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. The program is executed by a processor to implement the image processing method based on a hybrid network as described in the above embodiment.
[0068] An embodiment of the present invention provides a computer program product, including a computer program or instructions. When the computer program or instructions are executed, they are used to implement the image processing method based on the hybrid network as described in the above embodiment.
[0069] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms are not necessarily directed to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0070] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "N" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0071] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.
[0072] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, the steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array, a field programmable gate array, etc.
[0073] A person of ordinary skill in the art may understand that all or part of the steps carried by the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the above-mentioned program may be stored in a computer-readable storage medium, which, when executed, includes one of the steps of the method embodiment or a combination thereof.
[0074] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. An image processing method based on a hybrid network, characterized in that: The following steps are involved: Get the image to be processed; Scaling the image to be processed to a target size; The scaled image to be processed is input into a hybrid network model, and the hybrid network model outputs an image processing result, wherein the hybrid network model includes a Resnet50 network, a Transfer module, a local feature embedding module, a Transformer and a splicing module, the Resnet50 network extracts a convolutional feature map of the scaled image to be processed, the Transfer module adjusts the number of channels of the convolutional feature map, the local feature embedding module extracts an embedding feature map of the convolutional feature map, the Transformer extracts an attention feature map of the embedding feature map, the splicing module splices the convolutional feature map and the attention feature map to obtain a spliced feature map, and the average pooling and fully connected layers of the Resnet50 network output the image processing result according to the spliced feature map.
2. The image processing method based on hybrid network according to claim 1, characterized in that: The Resnet50 network includes a convolution layer, a regularization layer, an activation function layer, a maximum pooling layer, the first to fourth residual networks, an average pooling layer and a fully connected layer, wherein the second residual network does not perform a downsampling operation, the second residual network adjusts the number of input channels based on the internal convolution kernel, the convolution feature map output by the fourth residual network is input into the Transfer module, and the splicing feature map output by the splicing module is input into the average pooling layer.
3. The image processing method based on hybrid network according to claim 1, characterized in that: The Transfer module includes a convolution kernel, and the number of channels of the convolution feature map is adjusted based on the convolution kernel.
4. The image processing method based on hybrid network according to claim 1, characterized in that: The local feature embedding module includes an image block embedding layer, a position embedding layer and an output layer. The image block embedding layer performs linear transformation, flattening and dimensional order adjustment on each image block of the convolution feature map to obtain a first vector for each image block. The position embedding layer generates a second vector for each image block with the same dimension as the first vector. The output layer outputs the embedded feature obtained by adding the first vector and the second vector of each image block.
5. The image processing method based on hybrid network according to claim 1, characterized in that: The Transformer performs a fully connected linear transformation on the embedded features to generate queries, keys and values respectively, generates an attention score according to the query and the key, generates an attention value based on the normalized attention score and the value, and performs a linear transformation on the attention value and adds it to the input of the transformer, and then undergoes a multi-layer perceptron feature transformation, and then adds it to the input of the feature transformation to obtain the attention feature.
6. The image processing method based on hybrid network according to claim 1, characterized in that: The splicing module splices the convolution feature map and the attention feature map in the channel dimension.
7. An image processing device based on a hybrid network, characterized in that: include: An acquisition module, used for acquiring an image to be processed; A scaling module, used for scaling the image to be processed to a target size; A classification module is used to input the scaled image to be processed into a hybrid network model, and the hybrid network model outputs an image processing result, wherein the hybrid network model includes a Resnet50 network, a Transfer module, a local feature embedding module, a Transformer and a splicing module, the Resnet50 network extracts the convolution feature map of the scaled image to be processed, the Transfer module adjusts the number of channels of the convolution feature map, the local feature embedding module extracts the embedding feature map of the convolution feature map, the Transformer extracts the attention feature map of the embedding feature map, the splicing module splices the convolution feature map and the attention feature map to obtain a spliced feature map, and the average pooling and fully connected layers of the Resnet50 network output the image processing result according to the spliced feature map.
8. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the image processing method based on a hybrid network as described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed, the image processing method based on the hybrid network described in any one of claims 1 to 6 is implemented.
10. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed, the image processing method based on the hybrid network described in any one of claims 1 to 6 is implemented.
