CN-122023887-A - Image recognition method and system based on node attention and feature fusion
Abstract
The invention belongs to the field of image processing, and relates to an image recognition method and system based on node attention and feature fusion, which comprises the steps of preprocessing an image, combining gray level normalization and random overturning rotation enhancement data, accurately capturing focus areas and edge textures in an X-ray image through CNN after pretraining to generate deep semantic feature vectors, avoiding key information omission, completing structuring processing and preliminary classification through CNN channels, constructing hypergraph, node attention hypergraph convolution and mean-maximum value aggregation through a HGNN channel through hyperbolic distances, accurately capturing node association and fine granularity features, complementarily covering more feature dimensions, integrating dominant features through double-channel fusion and combining Softmax classification to map high-dimensional features into probability distribution, guaranteeing detection accuracy, reducing parameter quantity and overfitting risk, integrally improving detection robustness, and providing high-efficiency and reliable technical support for clinical pneumonia auxiliary diagnosis.
Inventors
- SUN JUNDING
- Zhi Xinke
- XU ZHAOZHAO
- WU XIAOSHENG
- HOU BEIBEI
- TANG CHAOSHENG
- ZHANG LIHONG
Assignees
- 河南理工大学
Dates
- Publication Date
- 20260512
- Application Date
- 20260120
Claims (10)
- 1. The image recognition method based on node attention and feature fusion is characterized by comprising the following steps of: preprocessing the acquired X-ray image to acquire standardized image data; inputting the standardized image data into a pretrained convolutional neural network, capturing potential focus area and edge texture information in the image, and generating a feature vector containing deep semantics Wherein B is the batch size, N is the channel number, and C is the sequence length after the space dimension is flattened; respectively importing deep semantic feature vectors into CNN channels and a super-graph neural network HGNN channels to respectively obtain feature vectors output by the corresponding channels; And complementing the features output by the two channels through a two-channel feature fusion module DCF, inputting the fused features into a Softmax classifier, and outputting an image recognition result.
- 2. The method for recognizing the image based on the node attention and the feature fusion according to claim 1, wherein the preprocessing of the collected X-ray images is specifically that the collected X-ray images are uniformly adjusted to a preset pixel size, and the image enhancement processing is performed on the adjusted image data, and the image enhancement processing includes gray scale normalization, random flip and rotation operations.
- 3. The image recognition method based on node attention and feature fusion according to claim 2, wherein the step of respectively guiding deep semantic feature vectors into a CNN channel and a hyperspectral neural network HGNN channel to respectively obtain feature vectors output by corresponding channels is specifically as follows: The feature vector output by the CNN channel is that the deep semantic feature vector is directly convolved, pooled and subjected to structuring treatment and preliminary classification to obtain CNN preliminary classification features ; The feature vector output by HGNN channels is that deep semantic feature vectors sequentially pass through a hypergraph construction module HCHD based on hyperbolic distance, a hypergraph convolution module NAHGC based on node attention and a mean-maximum feature aggregation module MMNA to output aggregated features 。
- 4. The image recognition method based on node attention and feature fusion according to claim 3, wherein the deep semantic feature vector is constructed by a hypergraph construction module HCHD based on hyperbolic distance, specifically: Taking node characteristics in the deep semantic characteristic vector as input, calculating hyperbolic distances between nodes through geometric characteristics of hyperbolic space, and passing through The neighborhood algorithm screens the associated nodes and builds a superside set Generating hypergraph structure Wherein, the method comprises the steps of, For a set of nodes, Is a set of hyperedge weights; Based on hypergraph Calculating an association matrix Node degree matrix And a superside matrix And output the associated matrix Node degree matrix And a superside matrix Is input to a node attention based hypergraph convolution module NAHGC.
- 5. The image recognition method based on node attention and feature fusion according to claim 4, wherein the computing the hyperbolic distance between nodes by the geometric characteristics of the hyperbolic space using the node features in the deep semantic feature vector as input is specifically: Two nodes are arranged And Within unit discs, i.e. , The distance between nodes is calculated as follows: Wherein, the Is an inverse hyperbolic cosine function, Is a node Sum node Is used for the distance of euclidean distance, And Is a node Sum node The Euclidean distance to the circle center; The passage The neighborhood algorithm screens the associated nodes and builds a superside set Generating hypergraph structure The method specifically comprises the following steps: Is a hyper-parameter indicating that each node is to find The most strongly associated neighbors are, for each central node in the set of nodes Computing center node The hyperbolic distance between the node and all other nodes is selected, and the hyperbolic distance is the smallest Individual nodes, center node A kind of electronic device A neighbor node passing through a superside Repeating the above steps to build supersides for all central nodes, wherein the set of the supersides is , wherein, Is the number of supersides and weight For quantifying the importance of the superside; Super-edge weight Positive correlation with average relevance of nodes in a superb, namely if the average hyperbolic distance of all nodes in a superb is smaller, the weight of the superb The larger the weight is, the smaller the weight is, and finally the hypergraph is generated 。
- 6. The method for image recognition based on node attention and feature fusion of claim 5, wherein the hypergraph-based image recognition is performed by a computer system Calculating an association matrix Node degree matrix And a superside matrix The method specifically comprises the following steps: Wherein, the And Are diagonal matrices; diagonal elements in (a) Representing each node in the hypergraph The number of connected superedges, i.e. ; Diagonal elements in (a) Representing each hyperedge in the hypergraph The number of connected nodes, i.e. 。
- 7. The method for recognizing an image based on a combination of attention and features of nodes according to claim 6, wherein the output-to-be-outputted correlation matrix Node degree matrix And a superside matrix Input to the hypergraph convolution module NAHGC based on node attention, specifically: based on the incidence matrix Node degree matrix And a superside matrix Calculation of the Laplacian matrix of the hypergraph ; Will Laplace matrix And feature matrix The hypergraph convolution module NAHGC is input, and the preliminary convolution characteristic is obtained through convolution operation ; Will go through the figure Is input to the attention module to obtain an attention-enhanced hypergraph ; Will preliminary convolution characteristics And attention-enhancing hypergraph Inputting the hypergraph convolution module NAHGC again to obtain the final convolution characteristic And will ultimately convolve the features Input to MMNA module.
- 8. The method for identifying an image based on node attention and feature fusion of claim 7, wherein said correlation matrix based Node degree matrix And a superside matrix Calculation of the Laplacian matrix of the hypergraph The method specifically comprises the following steps: Wherein, the Representing a normalized version of the node degree matrix, The weight matrix representing the hyperedge, initialized to an identity matrix, Representing a normalized form of the superside matrix; The Laplace matrix And feature matrix The hypergraph convolution module NAHGC is input, and the preliminary convolution characteristic is obtained through convolution operation The calculation flow is specifically as follows: In NAHGC, the calculation flow is as follows: Wherein, the And Is a learnable parameter of the convolution kernel, for controlling the weighted contributions of the different parts, To adjust the contribution of the node's own characteristics, For controlling the contribution of feature propagation of neighboring nodes, to reduce the parameters of the model and reduce the risk of overfitting, separate variables are used Instead of And The definition is: Then, the hypergraph convolution reduces to: Wherein, the And Is a feature vector of a single node, Represented as a super-edge weight, Initially as a unitary matrix And then (b) then About 2 And, thus, from To the point of The eigenvalue matrix convolution of the layer is calculated as: Wherein, the Is the Relu activation function of the device, The information on the original node is passed and aggregated onto the edge nodes, Representing a feature matrix Then the method is used for reintegrating the side node information back to the original node; And Is characteristic of all nodes; Then, the hypergraph is to be exceeded Input to the attention module to obtain a hypergraph with enhanced attention The attention module calculation flow is as follows: Will go through the figure Generating query vectors by linear transformation, respectively Key vector Sum vector Calculating attention score, scaling square root of key vector dimension, normalizing by Softmax function to obtain attention weight, and weighting value vector by attention weight Obtaining the attention-enhancing hypergraph ; Wherein, the By supergraph of The linear transformation is performed to obtain the product, The attention score is indicated as such, Is an operation of scaling the dot product result, wherein the scaling factor is the dimension of the key vector Finally, the method comprises the steps of, finally, Representing a vector of values by attention weight The output obtained after weighted summation; Finally, will And Input into the hypergraph convolution for calculation, and the obtained characteristic output is And convolve the features Input to MMNA module.
- 9. The method for image recognition based on node attention and feature fusion of claim 8, wherein the convolving features Input to MMNA module, specifically: Will convolve the features Respectively inputting the average value aggregation module and the maximum value aggregation module to obtain average value aggregation characteristics And maximum aggregation feature The calculation formula is as follows: Wherein, the Represents the result of the mean value aggregation of the node characteristics, Is the result of maximum aggregation of node features, The characteristic of the ith node is that N is the total number of nodes; next, the features are aggregated for the mean And maximum aggregation feature Element-level averaging to obtain MMNA aggregate features : Wherein, the Is by means of alignment of And An aggregation result of average calculation is carried out; finally, MMNA aggregate features Preliminary classification features with CNN channels Average fusion is carried out to obtain the final output characteristics of the model , Final output characteristics of the output And mapping the high-dimensional fusion feature vector into probability distribution of positive pneumonia and negative pneumonia through a Softmax classifier, and taking the category with the maximum probability value as a final recognition result.
- 10. HGNN pneumonia identification system based on node attention and feature fusion, characterized by comprising: The pretreatment module is used for collecting an X-ray image of a patient suffering from pneumonia, and carrying out pretreatment on the collected X-ray image to obtain standardized image data; the generation module inputs the standardized image data into a pre-trained convolutional neural network, captures potential focus areas and edge texture information in the image and generates feature vectors containing deep semantics Wherein B is the batch size, N is the channel number, and C is the sequence length after the space dimension is flattened; The acquisition module is used for respectively importing deep semantic feature vectors into a CNN channel and a hyperspectral neural network HGNN channel to respectively obtain feature vectors output by the corresponding channels; And the output module complements the features output by the two channels through the two-channel feature fusion module DCF, inputs the fused features into the Softmax classifier and outputs an image recognition result.
Description
Image recognition method and system based on node attention and feature fusion Technical Field The invention belongs to the field of image processing, and relates to an image recognition method and system based on node attention and feature fusion. Background Pneumonia is an infectious disease caused by bacteria, viruses or a few fungi, and the like, and infection injury and host immune response can lead to lung damage and interfere with normal respiratory function. Chest X-ray examination CXR is taken as a simple, economical and widely applied lung infection diagnosis means, and can provide support for diagnosis, but a large number of pathological pictures of patients bring heavy pressure to image interpretation of professional doctors, and the problem of missed diagnosis and misdiagnosis is easy to occur, so that the computer-aided diagnosis tool has important application value in pneumonia diagnosis. In recent years, a medical image processing method based on a hypergraph neural network HGNN is widely focused, high-order relation information in a graph structure can be effectively mined, good feature modeling capability is shown in medical images, an important thought is provided for pneumonia auxiliary diagnosis research, however, in the existing HGNN in medical image processing, on one hand, complex geometric and nonlinear relations among nodes are difficult to express due to the fact that hyperedges are built by means of Euclidean distances, multi-channel multi-level feature fusion is often ignored by means of single structural design, the representation capability of the hypergraph and the representation capability of a model in complex medical image scenes are respectively influenced, on the other hand, the hypergraph construction is highly sensitive to data quality, noise or feature extraction errors are prone to causing wrong hyperedge connection, and meanwhile, the problems of insufficient global information capture, noise sensitivity and local feature loss exist when the existing node aggregation method processes high-dimensional graph structure data, and the common problems restrict the application of the method in the pneumonia auxiliary diagnosis. Disclosure of Invention The invention aims to solve the problems that HGNN in the prior art is difficult to express complex geometric and nonlinear relations among nodes and neglect multi-channel multi-level feature fusion, and meanwhile, global information capture is insufficient, noise sensitivity and local feature loss exist. In order to achieve the purpose, the invention is realized by adopting the following technical scheme: the image recognition method based on node attention and feature fusion comprises the following steps: preprocessing the acquired X-ray image to acquire standardized image data; inputting the standardized image data into a pretrained convolutional neural network, capturing potential focus area and edge texture information in the image, and generating a feature vector containing deep semantics Wherein B is the batch size, N is the channel number, and C is the sequence length after the space dimension is flattened; respectively importing deep semantic feature vectors into CNN channels and a super-graph neural network HGNN channels to respectively obtain feature vectors output by the corresponding channels; And complementing the features output by the two channels through a two-channel feature fusion module DCF, inputting the fused features into a Softmax classifier, and outputting an image recognition result. The invention further improves that: further, the preprocessing of the collected X-ray images is specifically that the collected X-ray images are uniformly adjusted to a preset pixel size, and image enhancement processing is carried out on the adjusted image data, wherein the image enhancement processing comprises gray scale normalization, random overturning and rotation operation. Further, the deep semantic feature vectors are respectively led into a CNN channel and a hypergraph neural network HGNN channel to respectively obtain feature vectors output by the corresponding channels, which specifically comprises: The feature vector output by the CNN channel is that the deep semantic feature vector is directly convolved, pooled and subjected to structuring treatment and preliminary classification to obtain CNN preliminary classification features ; The feature vector output by HGNN channels is that deep semantic feature vectors sequentially pass through a hypergraph construction module HCHD based on hyperbolic distance, a hypergraph convolution module NAHGC based on node attention and a mean-maximum feature aggregation module MMNA to output aggregated features。 Further, the deep semantic feature vector passes through a hypergraph construction module HCHD based on hyperbolic distance, specifically: Taking node characteristics in the deep semantic characteristic vector as input, calculating hyperbolic distances between nodes