ComFormer: Combination of CNN and Transformer Multidimensional Attention Mechanisms for Chest X‐Ray Image Classification
Abstract
COVID‐19 is an acute respiratory infectious disease that has infected millions of people worldwide. Large‐scale COVID‐19 infections in less developed countries are poised to exert a significant strain on the local healthcare infrastructure. The integration of AI‐assisted diagnosis and treatment can help to mitigate this burden, reduce the backlog of cases and facilitate the implementation of cutting‐edge medical advancements. Many convolutional neural network‐based X‐ray image recognition networks have been introduced, however, many neural networks cannot extract the deep information structure of X‐ray images well and lack the reconstruction and reasonable mapping of deep semantic information of X‐ray images. In this paper, we adopt the traditional CNN architecture at the front end of the neural network and add our newly proposed convolutional kernel‐space‐channel attention mechanism. Unlike the traditional attention mechanism, we adopt an adaptive attention mechanism from small kernels to large kernels to facilitate the neural network to select the appropriate convolutional kernels on feature maps of different sizes and add a space‐channel attention mechanism to the selected convolutional kernels so that the model has a high concentration of attention weights in all directions. Additionally, we suggest employing the MLG‐weighted cross‐entropy loss function, designed to effectively address the challenges posed by highly unbalanced data set samples to a great extent. We train on the newly proposed database, and the results show that the network has precision of 98.840%, recall of 99.021%, specificity of 99.558%, and F1 score of 98.930% for COVID‐19 classification.