Digestive endoscopy image assisted identification and grading method and system for inflammatory bowel disease

By constructing a spatial bilinear attention network, a pyramid feature fusion framework and a hybrid high-order asymmetric convolutional network, combined with a generative adversarial network, the problem of relying on doctors' experience in the diagnosis of inflammatory bowel disease is solved, and the inflammatory bowel disease is improved Accuracy and efficiency of subtype identification and severity assessment.

CN118736283AInactive Publication Date: 2024-10-01CHINESE PEOPLES LIBERATION ARMY ARMY SPECIAL MEDICAL CENTER

Patent Information

Application Number
CN202410766203.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-10-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art relies on the subjective experience of endoscopy in the diagnosis of inflammatory bowel disease, resulting in inaccuracy and inefficiency of diagnosis, especially in the absence of experienced doctors in primary hospitals or remote areas, and it is difficult to accurately distinguish ulcerative colitis and Crohn's disease and assess its severity.

Method used

Using a method based on spatial bilinear attention network, pyramid feature fusion framework and hybrid high-order asymmetric convolutional network, the pyramid feature fusion framework is identified by constructing a spatial bilinear attention network. Assess the severity of ulcerative colitis, mixed higher order asymmetric convolutional networks evaluate the severity of Crohn's disease, and combined with generative adversarial networks for data enhancement.

Benefits of technology

It improves the accuracy of subtype identification and meticulousness of severity assessment of inflammatory bowel disease, reduces the work burden of doctors, and improves the diagnostic efficiency and accuracy of grassroots hospitals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118736283A_ABST
    Figure CN118736283A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of medical equipment, and particularly discloses an inflammatory bowel disease digestive endoscopy image auxiliary identification and grading method and system.The inflammatory bowel disease digestive endoscopy image auxiliary identification and grading system is established according to the method and comprises a space attention module, a bilinear attention module, an image processing module and a classification module, constructing a spatial bilinear attention network for identifying ulcerative colitis and Crohn's disease; based on two feature extractors of CNN and a full attention model Transform, establishing a pyramid feature fusion framework for identifying the severity of ulcerative colitis; and based on an asymmetric convolution module and a mixed high-order module, constructing a mixed high-order asymmetric convolution network for evaluating the severity of the Crohn disease under CT small intestine radiography. By adopting the technical scheme, the attention mechanism is added to improve the classification performance of the model, high operation efficiency is achieved while high-resolution representation is learned, identification of UC and CD is achieved, and the severity of UC and CD is graded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of medical device technology and relates to a method and system for endoscopic imaging-assisted identification and grading of inflammatory bowel disease. Background Art

[0002] Inflammatory bowel disease (IBD) is a group of chronic, nonspecific inflammatory diseases of the gastrointestinal tract with unclear etiologies. It mainly includes two subtypes: ulcerative colitis (UC) and Crohn's disease (CD).

[0003] In the diagnosis, treatment, and follow-up monitoring of IBD, endoscopists differentiate between ulcerative colitis (UC) and Crohn's disease (CD) via colonoscopy and assess their severity in order to determine effective subsequent treatment strategies and clinical care plans. However, this differentiation and assessment model heavily relies on the subjective experience and skill of endoscopists, increasing their workload, and prolonged review fatigue can also affect the accuracy of diagnosis.

[0004] The uneven distribution of medical resources in my country, particularly in grassroots hospitals and remote areas, poses a significant challenge to the accurate diagnosis and assessment of these diseases due to a lack of experienced endoscopists. Therefore, it is necessary to develop auxiliary diagnostic tools to differentiate between ulcerative colitis (UC) and chronic discordant dysplasia (CD) and to classify their severity.

[0005] The following difficulties exist in the differential diagnosis and severity assessment of IBD subtypes based on deep learning:

[0006] (1) The lesions of UC and CD are spatially diffuse on static colonoscopy images, and the boundaries between them and normal tissues are unclear. The inter-class similarity and intra-class differences exacerbate the difficulty of diagnosis.

[0007] (2) UC severity assessment is a fine-grained classification, and subclass differentiation often requires more detailed and comprehensive feature extraction.

[0008] (3) In the fine-grained classification task of CD severity assessment, unlike UC which is mainly mucosal lesion, the characteristics of CD-induced transmural inflammation and ulceration are not easily reflected by colonoscopy images. CT small bowel imaging can better reflect the degree of inflammation of the intestinal wall and is helpful to judge the activity of CD, but CT images lack color information. Summary of the Invention

[0009] The purpose of this invention is to provide a method and system for the identification and grading of inflammatory bowel disease using digestive endoscopy images, enabling the differentiation between UC and CD, and the grading of their severity.

[0010] To achieve the above objectives, the basic solution of the present invention is: a method for the endoscopic-assisted identification and grading of inflammatory bowel disease, comprising the following steps:

[0011] Establish a system for the identification and grading of inflammatory bowel disease using digestive endoscopy, specifically including:

[0012] Based on spatial attention modules and bilinear attention modules, a spatial bilinear attention network is constructed to identify ulcerative colitis and Crohn's disease;

[0013] A pyramid feature fusion framework is established based on two feature extractors: CNN and the full attention model Transformer, to identify the severity of ulcerative colitis.

[0014] Based on asymmetric convolutional modules and hybrid higher-order modules, a hybrid higher-order asymmetric convolutional network is constructed to evaluate the severity of Crohn's disease under CT small bowel contrast imaging.

[0015] To obtain the dataset, specifically:

[0016] Colonoscopy images of multiple samples were acquired, including images of multiple UC patients, multiple CD patients, and multiple normal examinees. These colonoscopy images served as a dataset for a spatial bilinear attention network.

[0017] Multiple colonoscopy images from multiple patients with ulcerative colitis were collected as a dataset for a pyramid feature fusion framework; multiple cross-sectional CTE images from multiple patients with Crohn's disease were collected to delineate the intestinal wall portion, which was used as a dataset for a hybrid high-order asymmetric convolutional network.

[0018] The three datasets are randomly divided into training and test sets, and their corresponding networks are trained.

[0019] Endoscopic medical images of the patients to be tested are acquired, preprocessed, and then input into a spatial bilinear attention network to distinguish between ulcerative colitis and Crohn's disease. If it is ulcerative colitis, the preprocessed image is input into a pyramid feature fusion framework to determine the severity of ulcerative colitis; if it is Crohn's disease, the preprocessed image is input into a hybrid high-order asymmetric convolutional network to determine the severity of Crohn's disease.

[0020] The working principle and beneficial effects of this basic scheme are as follows: This technical scheme uses a spatial bilinear attention network, a pyramid feature fusion framework, and a hybrid high-order asymmetric convolutional network to distinguish between UC and CD, and to classify the severity of the two.

[0021] To address the inter-class similarity and intra-class differences between UC and CD, and the spatially diffuse nature of their lesions in static colonoscopy images, a spatial bilinear attention network was proposed. The attention mechanism and the effect of using second-order information on improving the performance of convolutional neural networks were explored.

[0022] Furthermore, in response to the requirement for more detailed and comprehensive feature extraction due to fine-grained classification in UC severity assessment, a pyramid hybrid feature fusion framework was proposed, exploring the complementary advantages of Transformer global representation and convolutional neural network local induction.

[0023] Meanwhile, considering that CD easily induces transmural inflammation and ulcers, a hybrid high-order asymmetric convolutional network was proposed to assess the severity of CD based on CTE images. The network explored the use of high-order information representation to capture subtle differences between classes, as well as data augmentation applications based on generative adversarial networks.

[0024] Furthermore, the method for constructing a spatial bilinear attention network is as follows:

[0025] On the backbone network, spatial attention module SAM and bilinear attention module BAM are introduced to construct spatial bilinear attention network SABA-ResNet;

[0026] The backbone network consists of an input processing stage (Stem), four feature extraction stages, and adaptive Avgpool and FC layers.

[0027] The Stem consists of one 7×7 convolutional layer, one BatchNorm layer, one ReLU activation function, and one Maxpool layer.

[0028] The four feature extraction stages have 3, 4, 6, and 3 Bottleneck modules respectively. The first Bottleneck module is a downsampling block, which includes 3 convolutional layers, 3 BatchNorm layers, and 1 ReLU activation function. The second convolutional layer is a 3×3 convolution with a stride of 1, and the other two convolutional layers are 1×1 convolutions with a stride of 1. In the downsampling block, the stride of the 3×3 convolution is 2, and the residual connection of the downsampling block has a 1×1 convolution with a stride of 2 and a BatchNorm layer.

[0029] After the output of the first three feature extraction stages of the backbone network, a spatial attention module (SAM) is introduced to focus on the diffuse lesion area by weighting the spatial features.

[0030] The Bilinear Attention Module (BAM) captures second-order statistical information before final classification, constructs the interdependence between second-order global and local information, and uses this interrelationship to channel-weight the original feature map, thereby enhancing the model's ability to identify inter-class discriminative features.

[0031] A spatial bilinear attention network was designed, and a spatial attention module was introduced to adaptively select the spatial region of the lesion during the feature extraction stage of the network. The features captured by the bilinear attention module were weighted to improve their discriminability and were used to identify endoscopic images of three categories: CD, UC, and normal.

[0032] Furthermore, in the Spatial Attention Module (SAM), let the channel, height, and width of the feature mapping in the i-th stage be C, respectively. i H i and W i Then the input feature mapping of SAM is Use 1×1 convolution pairs for input Channel dimensionality reduction is performed to reduce computational cost; the size of the intermediate feature map after dimensionality reduction is... Where r is the channel dimensionality reduction factor;

[0033] After the intermediate feature maps are spatially encoded by two branches, ordinary convolution and dilated convolution, subsequent channel compression is achieved by 3×3 ordinary convolution, resulting in the following spatial maps: and At this point, the channel dimension is reduced to 1, and M1 and M2 are:

[0034]

[0035] Where Conv(·) represents the convolution operator, and d is the dilation coefficient;

[0036] To aggregate the original spatial information from the input feature map, average pooling is performed along the channel dimension (the network's input data itself has multiple channels) to obtain a single-channel feature map. This feature map is then concatenated with M1 and M2 along the channel dimension to obtain a feature map with a size of [size missing].

[0037] Spatial attention maps are generated using 5×5 convolutions and a sigmoid activation function. M s A is:

[0038]

[0039] A = Sig(Conv) 5×5 (M s ))

[0040] Where Concat(·) is the concatenation operation, Avg(·) represents average pooling, and Sig(·) is the Sigmoid activation;

[0041] Using spatial attention mapping A on the original input The final output is obtained by weighting, multiplying element-wise, and then adding them together. At the same time, it serves as input for the next stage;

[0042] Let ⊙ be the Hadamard product. For tensor addition, for:

[0043]

[0044] The Spatial Attention Module (SAM) can better encode spatial feature information. Its dilated convolution has a larger receptive field, which can capture feature information from relatively far away and helps to model the features of diffuse lesions. Meanwhile, the relatively compact ordinary convolution is better at summarizing local details and has a stronger adaptability to sporadic lesions.

[0045] Furthermore, in the bilinear attention module BAM, it is set that... For the input feature mapping of BAM, the vector at spatial location (m,n) is: Where m∈{1,2,...,H} i}, n∈{1,2,...,W i};

[0046] right Channel reduction is performed, and after 1×1 convolution, a value of [size missing] is obtained. The intermediate feature map, the vector at spatial location (m,n) can be represented as

[0047] Bilinear operations are performed by vectors Multiplying it by its transpose:

[0048]

[0049] in, C i Let k be the number of channels in the feature mapping of the i-th stage, and k be the channel dimensionality reduction factor.

[0050] Y is a symmetric matrix. Extracting the upper triangular region of Y and performing vectorization expansion yields a vector. Extracting the upper triangular region reduces the channel dimension from the original... Reduce to

[0051]

[0052] Where Triu(·) represents the operation of extracting the upper triangular region, and Vec(·) represents the vectorization operation;

[0053] Let the intermediate feature map obtained after the feature operation function Bi(·) be set as Vectors in U Covering Second-order information;

[0054] After global average pooling, the feature map U is transformed to match the input feature map's channel dimensions using a 1×1 convolution, and then multiplied with the second-order feature map. The resulting channel attention map is subsequently activated by a sigmoid function and applied to... Weighted average

[0055]

[0056] Where Conv(·) represents the convolution operator, Avg(·) represents average pooling, and Sig(·) is the Sigmoid activation.

[0057] Bilinear Attention (BAM) can improve computational efficiency and reduce feature redundancy. BAM can capture second-order statistical information and establish the interdependence between local and global second-order information to achieve effective feature selection and enhance the network's ability to identify discriminative features.

[0058] Furthermore, the pyramid feature fusion framework includes a pyramid visual full attention model PVT branch, a CNN branch, three feature fusion modules FFM, two single-branch classifiers, and a fusion classifier based on second-order pooling SOP. The feature fusion module FFM is set between the PVT branch and the CNN branch. The two single-branch classifiers are connected to the outputs of the PVT branch and the CNN branch, respectively. The fusion classifier is connected to the outputs of the PVT branch and the CNN branch.

[0059] The pyramid feature fusion framework has three outputs. In both the PVT and CNN branches, average pooling is used, and the outputs are used as auxiliary outputs after passing through a fully connected layer. The outputs of the fourth stage of the two branches are first concatenated at the channel level, and then passed through SOP and a fully connected layer to become the main output of the model.

[0060] The overall loss function of the model is: Loss all =αLoss pvt +βLoss cnn +γLoss combine All losses are calculated using the labeled smoothed cross-entropy loss function, where α, β, and γ correspond to the weight coefficients of the three losses, respectively.

[0061] Let y be the true label corresponding to the nth sample.n ∈{1,2,...,K}, v=(v1,v2,...v K The final output of the network is the prediction result for sample n, and the loss function is:

[0062]

[0063] Where N is the number of samples, K is the number of categories, ε is the label smoothing coefficient, Ω can represent pvt, cnn or combine, and e is the natural constant.

[0064] The pyramid feature fusion framework can improve the classification performance of the model, with higher overall accuracy than single-branch ResNet50 and PVT.

[0065] Furthermore, the PVT branch adopts an input mode of overlapping patch embedding OPE, and DW convolution is introduced in the encoder's MLP to form a convolutional feedforward network CFF. Each stage of the PVT branch consists of an overlapping patch embedding OPE, a block, and a normalization layer. Each block contains N basic component blocks. The output of the OPE is connected to the input of the block, and the output of the block is connected to the input of the normalization layer.

[0066] In the PVT branch, let H i 、W i and d i Given the height, width, and embedding dimension of the feature in stage i, reshape the flattened token output in stage i-1, and then perform OPE.

[0067] When i=1, the kernel size in OPE is 7 and the stride is 3. When i=2, 3, 4, the kernel size in OPE is 3 and the stride is 2. First, spatial reduction SR is performed, and then the MHA mechanism is implemented.

[0068] The MHA mechanism accepts a query Q, a key K, and a value V as input:

[0069]

[0070] Among them, h i This represents the number of heads in the i-th attention layer, and Concat(·) is the concatenation operation. and The parameters are linear mapping parameters, and the SR(·) operation is as follows:

[0071]

[0072] in, Given the input sequence, RP1(·) and RP2(·) are feature reshaping operations (Reshape). This represents the feature following RP1(·). This represents the space reduction ratio, and is also the size and stride of the convolution kernel in the Conv(·) operation;

[0073] At the end of the spatial decay operation, RP2(·) will Remodeling LN(·) represents the LayerNorm layer. For linear mappings, the attention function Attention(·) is:

[0074]

[0075] Where q, k, and v represent the query, key, and value, respectively, DW convolution is introduced in the convolutional feedforward network to capture the local continuity of the input tensor; in stage i, the dimensionality decay factor between two fully connected layers is...

[0076] The PVT branch can learn high-resolution representations while maintaining high efficiency and is easy to use.

[0077] Furthermore, the feature fusion module FFM receives the feature maps of the PVT branch and the CNN branch, fuses them at the channel scale, and then transmits the fused features back to the two main branches to enhance complementary representations.

[0078] set up and It is the intermediate feature mapping between the i-th stage PVT and CNN, through G fuse Aggregation yields:

[0079]

[0080] Where Concat(·) is the concatenation operation, and Split(·) is the tensor splitting operation; G fuse It consists of a 1×1 convolution and a ReLU activation function;

[0081] The fused features are split along the channel dimension to obtain and Two features, whose sizes are respectively with and The same, then respectively through G pvt and G cnn G pvt and G cnn Each consists of a 3×3 convolution, a 1×1 convolution, and an activation function, which remaps the fused features.

[0082] The processed features are fed back to the PVT and CNN branches and added to the original input features. FFM only aggregates local features and global representations in the first to third stages. In the fourth stage, the outputs of the two branches are concatenated and the final classification is achieved after SOP.

[0083] The feature fusion module solves the feature fusion problem of ResNet50 and PVT as the feature resolution pyramid changes, effectively combining local features with global representations in an interactive manner.

[0084] Furthermore, the fusion classifier based on second-order pooling SOP employs second-order pooling to enrich the final discriminative features. and The output features of the PVT and CNN branches in the fourth stage are respectively obtained by cascading operations along the channel dimension. F final Reconstructed into a feature matrix Where S = H4W4, then the covariance matrix B is:

[0085]

[0086] Where E and I represent an identity matrix and a matrix of all ones of size S×S, respectively;

[0087] The Newton-Schulz iterative method is used to accelerate the covariance normalization process. To ensure the convergence of the Newton-Schulz iteration, B is first pre-normalized to obtain A:

[0088]

[0089] Where tr(B) represents the trace of B; λ i Let i be the i-th element on the main diagonal of B;

[0090] Given Y0 = A and Z0 = E, when l = 1,...,L, the Newton-Schulz iteration is expressed as:

[0091]

[0092] After the Newton-Schulz iteration, post-compensation is required to obtain the final normalized covariance matrix, which is:

[0093]

[0094] in, Since it is a symmetric matrix, the upper triangular region of the matrix is ​​directly extracted as the input of the final FC layer.

[0095] Second-order statistics are used to enrich the identification information, and the operation is simple.

[0096] Furthermore, the hybrid high-order asymmetric convolutional network includes a first convolutional layer, a first max pooling layer, a second convolutional layer, a third convolutional layer, a second max pooling layer, asymmetric convolutional module a, asymmetric convolutional module b, a third max pooling layer, asymmetric convolutional module c, a hybrid high-order module, asymmetric convolutional module d, asymmetric convolutional module e, a fourth max pooling layer, asymmetric convolutional module f, asymmetric convolutional module g, an average pooling layer, a Dropout layer, and a Linear layer, all connected in sequence.

[0097] The asymmetric convolution module consists of four branches, two of which are asymmetric convolution branches, using 1×3 and 3×7 convolutions horizontally and 3×1 and 7×3 convolutions vertically, respectively; the other two branches use 1×1 convolution to achieve channel dimensionality reduction, and one of the branches adds max pooling for information condensation.

[0098] The input and output feature maps are respectively and The output dimension of the first branch is C. conv The hidden dimension of the two asymmetric convolutional branches is C. hid The output dimension is C asy The output dimension of the fourth branch is C. maxc C is obtained by concatenating the feature maps from different branches along the channel dimension. out =C conv +C maxc +2C asy ;

[0099] In the mixed higher-order module, a linear polynomial predictor a(x) is defined with respect to x. For feature mapping For a one-dimensional tensor at spatial location (m,n), a(x) is expressed as:

[0100]

[0101] Where <·,·> represents the inner product of two tensors of the same size. Let w be the r-th order tensor product of x, which contains all r-th order terms of x. r Let R be the r-th order tensor to be learned, containing the weights of the r-th order combination of variables in x, where R is the order.

[0102] Let w be when r > 1. r Through tensor decomposition of D r Approximated by a rank-1 tensor of dimension:

[0103]

[0104] in, For vectors, For the outer product, α r,d Let a(x) be the weight of the d-th rank-1 tensor.

[0105]

[0106] in, For the weight vector, set up Let a be a row vector of all 1s, and let ⊙ be the Hadamard product. Simplify a(x) by introducing an auxiliary matrix P. r To obtain vector:

[0107]

[0108] in, When r > 1 Because of P r w 1 and α r All are learnable parameters, and {P} can be obtained through matrix algebra. 1 ,w 1 Merge into a new matrix In the middle, {P r ,w r} merged into

[0109] set up It can be approximated by the multiplication of two matrices, i.e. but:

[0110]

[0111] a(x) can be modeled and used The higher-order statistics are obtained by introducing a nonlinear relationship using the ReLU function and achieving a higher-order mapping through the Sigmoid function.

[0112]

[0113] A(x) is defined on a local one-dimensional tensor in space, such that Weights are shared across different spatial locations, i.e.

[0114] When R=1 and Each is output by channel D r The 1×1 convolution implementation with C, when R>1 and r>1, This is also accomplished using a 1×1 convolution. For a series of output channels D r A 1×1 convolution generates a series of feature maps. Generated Obtained through element-level multiplication

[0115] Asymmetric convolution modules are used for intestinal wall feature extraction, and high-order hybridization modules are used to achieve true high-order information representation, resulting in higher accuracy and better performance.

[0116] This invention also provides a system for the identification and grading of inflammatory bowel disease using digestive endoscopy images, comprising a spatial bilinear attention network, a pyramid feature fusion framework, and a hybrid high-order asymmetric convolutional network;

[0117] The spatial bilinear attention network includes a spatial attention module and a bilinear attention module, used to identify ulcerative colitis and Crohn's disease;

[0118] The pyramid feature fusion framework incorporates a CNN and a Transformer feature extractor with full attention model to identify the severity of ulcerative colitis.

[0119] The hybrid high-order asymmetric convolutional network comprises, in sequence, a first convolutional layer, a first max-pooling layer, a second convolutional layer, a third convolutional layer, a second max-pooling layer, asymmetric convolutional module a, asymmetric convolutional module b, a third max-pooling layer, asymmetric convolutional module c, a hybrid high-order module, asymmetric convolutional module d, asymmetric convolutional module e, a fourth max-pooling layer, asymmetric convolutional module f, asymmetric convolutional module g, an average pooling layer, a dropout layer, and a linear layer, used to assess the severity of Crohn's disease under CT small bowel contrast imaging.

[0120] This system utilizes a spatial bilinear attention network, a pyramid feature fusion framework, and a hybrid high-order asymmetric convolutional network to achieve subtype identification and severity assessment of IBD. BRIEF DESCRIPTION OF THE DRAWINGS

[0121] Figure 1 This is a flowchart illustrating the method for endoscopic imaging-assisted identification and grading of inflammatory bowel disease according to the present invention.

[0122] Figure 2 This is a schematic diagram of the spatial bilinear attention network structure of the inflammatory bowel disease digestive endoscopy-assisted identification and grading method of the present invention;

[0123] Figure 3 This is a schematic diagram of the spatial attention module of the endoscopic imaging-assisted identification and grading method for inflammatory bowel disease of the present invention;

[0124] Figure 4This is a schematic diagram of the receptive field of the dilated convolution expansion of the spatial attention module in the inflammatory bowel disease digestive endoscopy-assisted identification and grading method of the present invention.

[0125] Figure 5 This is a schematic diagram of the bilinear attention module in the endoscopic imaging-assisted identification and grading method for inflammatory bowel disease of the present invention.

[0126] Figure 6 This is a flowchart illustrating the pyramid feature fusion framework of the method for endoscopic imaging-assisted identification and grading of inflammatory bowel disease according to the present invention.

[0127] Figure 7 This is a schematic diagram of the pyramid feature fusion framework of the endoscopic imaging-assisted identification and grading method for inflammatory bowel disease of the present invention;

[0128] Figure 8 This is a schematic diagram of the PVT branch of the pyramid feature fusion framework of the inflammatory bowel disease digestive endoscopy image-assisted identification and grading method of the present invention;

[0129] Figure 9 This is a schematic diagram of the feature fusion module of the pyramid feature fusion framework of the method for assisted identification and grading of inflammatory bowel disease using digestive endoscopy images according to the present invention;

[0130] Figure 10 This is a schematic diagram of the hybrid high-order asymmetric convolutional network structure of the method for assisted identification and grading of inflammatory bowel disease using digestive endoscopy images according to the present invention.

[0131] Figure 11 This is a schematic diagram of the asymmetric convolution module of the hybrid high-order asymmetric convolutional network in the method for assisted identification and grading of inflammatory bowel disease using digestive endoscopy images of the present invention.

[0132] Figure 12 This is a schematic diagram of the hybrid high-order module of the hybrid high-order asymmetric convolutional network in the method for assisted identification and grading of inflammatory bowel disease using digestive endoscopy images of the present invention.

[0133] Figure 13 This is a schematic diagram of the generative adversarial network structure of the inflammatory bowel disease digestive endoscopy-assisted identification and grading method of the present invention. DETAILED DESCRIPTION

[0134] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0135] In the description of this invention, it should be understood that the terms "longitudinal", "lateral", "up", "down", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0136] In the description of this invention, unless otherwise specified and limited, it should be noted that the terms "installation", "connection" and "linking" should be interpreted broadly. For example, they can refer to mechanical or electrical connections, or internal connections between two components. They can be direct connections or indirect connections through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.

[0137] This invention discloses a method for the identification and grading of inflammatory bowel disease using digestive endoscopy images, such as... Figure 1 As shown, it includes the following steps:

[0138] Establish a system for the identification and grading of inflammatory bowel disease using digestive endoscopy, specifically including:

[0139] To address the inter-class similarity and intra-class differences between ulcerative colitis (UC) and Crohn's disease (CD), and the spatially diffuse nature of their lesions in static colonoscopy images, a spatial bilinear attention network was constructed based on spatial attention and bilinear attention modules to identify ulcerative colitis and Crohn's disease. By introducing a spatial attention module, the network adaptively selects spatial lesion regions, suppresses irrelevant information, and focuses on the most important local differential features. The bilinear attention module captures second-order statistical information and establishes the interdependence between local and global second-order information to achieve effective feature selection, thereby enhancing the network's ability to identify discriminative features.

[0140] To address the fine-grained classification requirements for assessing the severity of ulcerative colitis (UC), a pyramid feature fusion framework is established based on two feature extractors: CNN (Convolutional Neural Network) and the Transformer full-attention model. This framework combines PVT (Pyramid Vision Transformer) and ResNet50. PVT can learn high-resolution representations while maintaining high operational efficiency. The feature fusion module solves the feature fusion problem of ResNet50 and PVT as the feature resolution pyramid changes, effectively combining local features with global representations in an interactive manner. Finally, second-order statistics are used to enrich the discriminative information.

[0141] Given that Crohn's disease (CD) easily induces transmural inflammation and ulceration, and the intestinal mucosal information provided by endoscopic images is not comprehensive, this paper proposes a hybrid high-order asymmetric convolutional network (H2OM) based on CT small bowel imaging. This network is used to assess the severity of Crohn's disease under CT small bowel imaging. The intestinal wall portion of the CT images is extracted as input to the neural network to capture features such as intestinal wall thickness, enhancement pattern, and enhancement degree. The proposed model uses the asymmetric convolutional module for intestinal wall feature extraction and the high-order hybrid module to achieve true high-order information representation.

[0142] To obtain the dataset, specifically:

[0143] Colonoscopy images from multiple samples were acquired, including images from multiple patients with ulcerative colitis (UC), multiple patients with Crohn's disease (CD), and multiple normal examiners. The colonoscopy images served as a dataset for a spatial bilinear attention network. Preferably, the SES-CD (Simpleendoscopic score) and CDAI (Crohn's disease activity index) scores were used to assess CD, and the Mayo score was used to assess UC. Patients with unclassified IBD (IBD-U) were excluded.

[0144] Multiple colonoscopy images from multiple patients with ulcerative colitis were collected as a dataset for the pyramid feature fusion framework; multiple cross-sectional CTE (Computed-tomography enterography) images from multiple patients with Crohn's disease were collected to delineate the intestinal wall portion, which was used as a dataset for a hybrid high-order asymmetric convolutional network.

[0145] The three datasets were randomly divided into training and test sets (with the test set accounting for approximately 15%), and their corresponding networks were trained.

[0146] Endoscopic medical images of the patients to be tested are acquired, preprocessed, and then input into a spatial bilinear attention network to distinguish between ulcerative colitis and Crohn's disease. If it is ulcerative colitis, the preprocessed image is input into a pyramid feature fusion framework to determine the severity of ulcerative colitis; if it is Crohn's disease, the preprocessed image is input into a hybrid high-order asymmetric convolutional network to determine the severity of Crohn's disease.

[0147] In a preferred embodiment of the present invention, the method for preprocessing the image is as follows:

[0148] Image quality control was performed on the images to exclude stained images, non-colonoscopy images, and images with poor quality due to halos, blurring, defocusing, mucus, and poor air filling.

[0149] The images are labeled and data augmentation is performed based on the torchvision.transforms library, such as random horizontal and vertical flipping, with the execution probability set to 0.3 for each.

[0150] During training of the spatial bilinear attention network, randomly cropping a 224×224 region from the original image as input enhances the diversity of input data and avoids overfitting. However, during testing, the original image must first be scaled proportionally to a minimum side length of 256, and then a 224×224 region is cropped from the center as input. The loss function is the cross-entropy loss function, and the SGD optimizer is used to optimize the model parameters, with momentum and weight_decay set to 0.9 and 1×10⁻⁶, respectively. -4 The training batch size was set to 128, the initial learning rate to 0.01, and the epochs to 50. The learning rate was adjusted by decreasing it to 0.1 times the current value every 10 epochs. Furthermore, to accelerate model convergence, all models were loaded with pre-trained weights from the ImageNet dataset. The patient and image features in the training and testing sets of the spatial bilinear attention network are shown in Table 1.

[0151] Table 1. Patient and image features in the training and test sets of the spatial bilinear attention network

[0152]

[0153]

[0154] During the training of the pyramid feature fusion framework, a 224×224 region is randomly cropped as input. During testing, the colonoscopy image is first scaled proportionally to its minimum side length of 256, and then a 224×224 region is cropped from the center and fed into the network. For data augmentation, random horizontal and vertical flipping are used, both with a probability of 0.3. The model is trained using the SGD optimizer, with weight_decay and momentum set to 1×10⁻⁵ and 0.9, respectively. The initial learning rate is set to 0.001, and over 50 epochs, the learning rate decreases to 0.1 times the current rate every 10 epochs. The training batch size is set to 128, and the label smoothing coefficient ε is set to 0.1. Furthermore, the model is loaded with pre-trained weights from the ImageNet dataset.

[0155] During the training of the hybrid high-order asymmetric convolutional network, the cross-entropy loss function and SGD optimizer are used, and the weight_decay is set to 1×10. -4 The momentum is 0.9. Furthermore, the batch size is set to 32, the initial learning rate is set to 0.01, and an exponential decay strategy is used to adjust the learning rate, with the function set to lr = 0.01 × e. -epoch / 5 The training lasted for 30 epochs. Data augmentation included random horizontal and vertical flipping, with a probability of 0.3 for both. Due to the limited amount of data and the relatively simple task, the models were not loaded with ImageNet pre-trained parameters to avoid overfitting.

[0156] In a preferred embodiment of the present invention, a spatial bilinear attention network incorporates a spatial attention module to adaptively select lesion spatial regions during the network feature extraction stage. The features captured by the bilinear attention module are weighted to improve their discriminability, enabling the identification of endoscopic images in three categories: CD, UC, and normal. A comparison of the differences between UC and CD is shown in Table 2.

[0157] Table 2. Comparison of differences between UC and CD

[0158]

[0159] Although ulcerative colitis (UC) and Crohn's disease (CD) both belong to the category of intradermal diseases (IBD), they are not entirely the same in terms of clinical symptoms, disease progression, and endoscopic findings. Treatment varies depending on the severity of the patient's condition. For example, patients with severe UC require timely fluid resuscitation, and intravenous corticosteroids are the first-line treatment, along with prevention of thrombosis and treatment of opportunistic infections. In contrast, patients with severe CD often receive systemic corticosteroids orally or intravenously, while monitoring for complications, including abscesses, intestinal obstruction, and opportunistic infections.

[0160] Therefore, accurate identification of UC and CD is of great significance for timely clinical treatment decisions and prevention of disease progression.

[0161] like Figure 2 As shown, the method for constructing a spatial bilinear attention network is as follows:

[0162] On the backbone network (such as ResNet), a spatial attention module (SAM) and a bilinear attention module (BAM) are introduced to construct the spatial bilinear attention network SABA-ResNet;

[0163] The backbone network consists of an input processing stage (Stem), four feature extraction stages, and adaptive Avgpool and FC layers.

[0164] The Stem consists of one 7×7 convolutional layer, one BatchNorm layer, one ReLU activation function, and one Maxpool layer.

[0165] The four feature extraction stages have 3, 4, 6, and 3 Bottleneck modules respectively. The first Bottleneck module is a downsampling block (Bottleneck Downsample). The Bottleneck module includes 3 convolutional layers, 3 BatchNorm layers, and 1 ReLU activation function. The second convolutional layer is a 3×3 convolution with a stride of 1, and the other two convolutional layers are 1×1 convolutions with a stride of 1. In the downsampling block, the stride of the 3×3 convolution is 2. In order to match the reduction of the feature map size, the residual connection of the downsampling block has a 1×1 convolution with a stride of 2 and a BatchNorm layer.

[0166] Since the input feature map has been downsampled by 4 times by the 7×7 convolutional layer and max pooling layer before the four stages, the first module of the first stage, although it has downsampled residual connections, does not have downsampling function.

[0167] After the output of the first three feature extraction stages of the backbone network, a spatial attention module (SAM) is introduced to focus on the diffuse lesion area by weighting the spatial features.

[0168] The Bilinear Attention (BAM) module captures second-order statistical information before final classification, constructing the interdependence between second-order global and local information. This interdependence is used to channel-weight the original feature map, enhancing the model's ability to identify inter-class discriminative features. Table 3 shows the feature map details of SABA-ResNet:

[0169] Table 3. Feature Mapping Details of SABA-ResNet

[0170]

[0171]

[0172] In a preferred embodiment of the present invention, such as Figure 3 As shown, in the Spatial Attention Module (SAM), let the channel, height, and width of the feature mapping in the i-th stage be C, respectively. i H i and W i Then the input feature mapping of SAM is Use 1×1 convolution pairs for input Channel dimensionality reduction is performed to reduce computational cost; the size of the intermediate feature map after dimensionality reduction is... Where r is the channel dimensionality reduction factor, which can be set to 4 based on engineering experience;

[0173] To better encode spatial feature information, SAM employs a 3×3 dilated convolution with a dilation coefficient of 2. For example... Figure 4 As shown, compared to ordinary convolution, dilated convolution has a larger receptive field, which can capture feature information from relatively far distances and helps to model the features of diffuse lesions. Meanwhile, ordinary convolution, with its relatively compact structure, is better at summarizing local details and has a stronger adaptability to sporadic lesions.

[0174] After the intermediate feature maps are spatially encoded by two branches, ordinary convolution and dilated convolution, subsequent channel compression is achieved by 3×3 ordinary convolution, resulting in the following spatial maps: and At this point, the channel dimension is reduced to 1, and M1 and M2 are:

[0175]

[0176] Where Conv(·) represents the convolution operator, and d is the dilation coefficient;

[0177] To aggregate the original spatial information from the input feature map, average pooling is performed along the channel dimension (the network's input data itself has multiple channels) to obtain a single-channel feature map. This feature map is then concatenated with M1 and M2 along the channel dimension to obtain a feature map with a size of [size missing].

[0178] Spatial attention maps are generated using 5×5 convolutions and a sigmoid activation function. M s A is:

[0179]

[0180] A = Sig(Conv) 5×5 (M s ))

[0181] Where Concat(·) is the concatenation operation, Avg(·) represents average pooling, and Sig(·) is the Sigmoid activation;

[0182] Using spatial attention mapping A on the original input The final output is obtained by weighting, multiplying element-wise, and then adding them together. At the same time, it serves as input for the next stage;

[0183] Let ⊙ be the Hadamard product. For tensor addition, for:

[0184]

[0185] In a preferred embodiment of the present invention, such as Figure 5 As shown, in the bilinear attention module BAM, let... For the input feature mapping of BAM, the vector at spatial location (m,n) is: Where m∈{1,2,...,H} i}, n∈{1,2,...,W i};

[0186] right Channel reduction is performed, and after 1×1 convolution, a value of [size missing] is obtained. The intermediate feature map, the vector at spatial location (m,n) can be represented as

[0187] Bilinear operations are performed by vectors Multiplying it by its transpose:

[0188]

[0189] in, C i Let k be the number of channels in the feature mapping of the i-th stage, and k be the channel dimensionality reduction factor.

[0190] Y is a symmetric matrix. Extracting the upper triangular region of Y and performing vectorization expansion yields a vector. Extracting the upper triangular region reduces the channel dimension from the original... Reduce to

[0191]

[0192] Where Triu(·) represents the operation of extracting the upper triangular region, and Vec(·) represents the vectorization operation;

[0193] Let the intermediate feature map obtained after the feature operation function Bi(·) be set as Vectors in U Covering Second-order information;

[0194] To establish the local and global dependencies of second-order information and adaptively reweight the second-order channel information responses, BAM adopts a similar approach to the SE module. After global average pooling, the feature map U is transformed by a 1×1 convolution to match the channel dimension of the input feature map, and then multiplied with the second-order feature map. The generated channel attention map is subsequently activated by a Sigmoid function and applied to... Weighted average

[0195]

[0196] Where Conv(·) represents the convolution operator, Avg(·) represents average pooling, and Sig(·) is the Sigmoid activation.

[0197] In BAM, the channel dimensionality reduction factor k determines the computational cost of bilinear operations. A smaller k preserves a larger channel dimension, encompassing more second-order information, but also increases the computational overhead of bilinear operations. Conversely, a larger k preserves a smaller channel dimension, resulting in less second-order information and higher computational efficiency. K can be 4, 8, 16, or 32, yielding channel dimensions of 512, 256, 128, and 64 respectively after dimensionality reduction. A k value of 16 is preferred.

[0198] The spatial bilinear attention network is used to identify UC and CD. It suppresses irrelevant information in a concise and efficient way and enhances the ability to capture key features. The network has achieved advanced experimental results in the performance comparison of different models, providing new technical support for the differential diagnosis of IBD subtypes.

[0199] In a preferred embodiment of the present invention, such as Figure 6 and Figure 7 As shown, the Pyramid Hybrid Feature Fusion Framework (PHF) 3The model includes a pyramid visual full attention model (PVT) branch, a CNN branch (built based on ResNet50), three feature fusion modules (FFM), two single-branch classifiers, and a fusion classifier based on second-order pooling (SOP). The feature fusion module (FFM) is located between the PVT and CNN branches. The two single-branch classifiers are connected to the outputs of the PVT and CNN branches, respectively. The fusion classifier is electrically connected to the outputs of the PVT and CNN branches.

[0200] PHF 3 The model employs a dual-branch hybrid architecture combining ResNet50 and Pyramid Vision Transformer (PVT). Targeting the characteristics of intestinal mucosal damage in ulcers (UC), ResNet50 captures local ulcer and bleeding features, while PVT offers high computational efficiency while learning high-resolution representations, effectively characterizing the overall fragility and erosion degree of the intestinal lumen. Furthermore, this invention incorporates a Feature Fusion Module (FFM) to combine local features with global representations, and employs Second-order pooling (SOP) during classification to enrich discriminative information.

[0201] In colonoscopy images, local features extracted by CNN can characterize the relationship between the intestinal wall and its coaxial extension at the close-up point, while the global representation modeled by PVT captures similarity information in the cross-sectional space of the intestinal lumen. FFM combines local features and global representations in an interactive manner, enhancing visual representation capabilities. Both PVT and CNN branches contain four stages. In the first to third stages, FFM fuses the features from the outputs of the two branches. Subsequently, the fused features are backpropagated to the two main branches and continue to be passed down.

[0202] The pyramid feature fusion framework has three outputs. In both the PVT and CNN branches, average pooling is used, and the outputs are used as auxiliary outputs after passing through a fully connected layer. The outputs of the fourth stage of the two branches are first concatenated at the channel level, and then passed through SOP and a fully connected layer to become the main output of the model.

[0203] The overall loss function of the model is: Loss all =αLoss pvt +βLoss cnn +γLoss combine All losses are expressed using the label-smoothed cross-entropy loss function, where α, β and γ correspond to the weight coefficients of the three losses, respectively. Preferably, α:β:γ = 1:1:1, 1:1:2, 1:1:3, 1:1:4 or 1:1:5, as shown in Table 4.

[0204] Table 4. The impact of different proportions of α, β, and γ in the loss function on model performance

[0205] α:β:γ 1:1:1 1:1:2 1:1:3 1:1:4 1:1:5 Total ACC 88.55% 88.91% 88.78% 88.45% 88.05%

[0206] Let y be the true label corresponding to the nth sample. n ∈{1,2,…,K}, v=(v1,v2,…v K The final output of the network is the prediction result for sample n, and the loss function is:

[0207]

[0208] Where N is the number of samples, K is the number of categories, ε is the label smoothing coefficient, Ω can represent pvt, cnn or combine, and e is the natural constant.

[0209] In a preferred embodiment of the present invention, such as Figure 8 As shown, the PVT branch adopts an Overlapping Patch Embedding (OPE) input mode. DW convolution is introduced into the encoder's MLP (Multi-layer Perceptron) to form a Convolutional Feed-Forward (CFF) network. Each stage of the PVT branch consists of an Overlapping Patch Embedding (OPE), a Block, and a Normalization layer. Each Block contains N basic component blocks. The output of the OPE is connected to the input of the Block, and the output of the Block is electrically connected to the input of the Normalization layer.

[0210] In the PVT branch, let H i 、W i and d i Given the height, width, and embedding dimension of the feature in stage i, reshape the flattened token output in stage i-1, and then perform OPE.

[0211] When i=1, the kernel size in OPE is 7 and the stride is 3. When i=2, 3, 4, the kernel size in OPE is 3 and the stride is 2. Spatial reduction (SR) is performed first, and then MHA (Multi-head attention) mechanism is implemented. The SR operation greatly reduces the size of K and V, effectively reduces the computational overhead, and is conducive to the model learning higher resolution representations.

[0212] The MHA mechanism accepts a query Q, a key K, and a value V as input:

[0213]

[0214] Among them, h i This represents the number of heads in the i-th attention layer, and Concat(·) is the concatenation operation. and The parameters are linear mapping parameters, and the SR(·) operation is as follows:

[0215]

[0216] in, Given the input sequence, RP1(·) and RP2(·) are feature reshaping operations (Reshape). This represents the feature following RP1(·). This represents the space reduction ratio, and is also the size and stride of the convolution kernel in the Conv(·) operation;

[0217] At the end of the spatial decay operation, RP2(·) will Remodeling LN(·) represents the LayerNorm layer. For linear mappings, the attention function Attention(·) is:

[0218]

[0219] Where q, k, and v represent the query, key, and value, respectively, DW convolution is introduced in the convolutional feedforward network to capture the local continuity of the input tensor; in stage i, the dimensionality decay factor between two fully connected layers is... Preferably, the four stages d, h, R s and R m The values ​​can be set to [64, 128, 320, 512], [1, 2, 5, 8], [8, 4, 2, 1] and [8, 8, 4, 4] respectively, with the number of basic component blocks in the four stages being 3, 8, 27 and 3 respectively.

[0220] In a preferred embodiment of the present invention, such as Figure 9 As shown, the feature fusion module FFM receives the feature maps of the PVT branch and the CNN branch, fuses them at the channel scale, and then transmits the fused features back to the two main branches to enhance complementary representations.

[0221] set up and It is the intermediate feature mapping between the i-th stage PVT and CNN, through G fuse Aggregation yields:

[0222]

[0223] Where Concat(·) is the concatenation operation, and Split(·) is the tensor splitting operation; G fuse Composed of 1×1 convolutions and ReLU activation functions, it is designed specifically for channel-level fusion;

[0224] The fused features are split along the channel dimension to obtain and Two features, whose sizes are respectively with and The same, then respectively through G pvt and G cnn G pvt and G cnn Each consists of a 3×3 convolution, a 1×1 convolution, and an activation function, which remaps the fused features.

[0225] The processed features are fed back to the PVT and CNN branches and added to the original input features. FFM only aggregates local features and global representations in the first to third stages. In the fourth stage, the outputs of the two branches are concatenated and the final classification is achieved after SOP.

[0226] In a preferred embodiment of the present invention, the fusion classifier based on second-order pooling SOP employs a second-order pooling method to enrich the final discriminative features. and The output features of the PVT and CNN branches in the fourth stage are respectively obtained by cascading operations along the channel dimension. F final Reconstructed into a feature matrix Where S = H4W4, then the covariance matrix B is:

[0227] Where E and I represent an identity matrix and a matrix of all ones of size S×S, respectively;

[0228] Covariance normalization is beneficial for enhancing discriminative representations, but this normalization typically relies on eigenvalue decomposition or singular value decomposition of the matrix. Since GPUs (Graphics Processing Units) are not well-suited for implementing eigenvalue decomposition, the Newton-Schulz iterative method is used to accelerate the covariance normalization process. To ensure the convergence of the Newton-Schulz iteration, A is first pre-normalized from B:

[0229]

[0230] Where tr(B) represents the trace of B; λi Let i be the i-th element on the main diagonal of B;

[0231] Given Y0 = A and Z0 = E, when l = 1,...,L, the Newton-Schulz iteration is expressed as:

[0232]

[0233] Pre-normalization has a detrimental effect on the network because it does not consistently change the data size. Therefore, after the Newton-Schulz iteration, post-compensation is required to obtain the final normalized covariance matrix, which is:

[0234]

[0235] in, Since it is a symmetric matrix, the upper triangular region of the matrix is ​​directly extracted as the input to the final FC layer. Table 5 shows the feature mapping details for each stage of the PVT and CNN branches in the Pyramid Feature Fusion Framework PHF3, as well as the interaction operations between branches:

[0236] Table 5. PHF 3 Feature mapping details

[0237]

[0238]

[0239] In a preferred embodiment of the present invention, such as Figure 10 As shown, the Hybrid High-Order Asymmetric Convolutional Network (H2O-ACN) comprises, in sequence, a first convolutional layer, a first max-pooling layer, a second convolutional layer, a third convolutional layer, a second max-pooling layer, asymmetric convolutional module a, asymmetric convolutional module b, a third max-pooling layer, asymmetric convolutional module c, a hybrid high-order module, asymmetric convolutional module d, asymmetric convolutional module e, a fourth max-pooling layer, asymmetric convolutional module f, asymmetric convolutional module g, an average pooling layer, a Dropout layer, and a Linear layer. The feature mapping details of the Hybrid High-Order Asymmetric Convolutional Network are shown in Table 6.

[0240] Table 6. Feature Mapping Details of H2O-ACN

[0241]

[0242]

[0243] like Figure 11As shown, the asymmetric convolution module consists of four branches, two of which are asymmetric convolution branches, using 1×3 and 3×7 convolutions horizontally and 3×1 and 7×3 convolutions vertically, respectively; the other two branches use 1×1 convolution to achieve channel dimensionality reduction, and one of the branches adds max pooling for information condensation.

[0244] The input and output feature maps are respectively and The output dimension of the first branch is C. conv The hidden dimension of the two asymmetric convolutional branches is C. hid The output dimension is C asy The output dimension of the fourth branch is C. maxc C is obtained by concatenating the feature maps from different branches along the channel dimension. out =C conv +C maxc +2C asy ;

[0245] like Figure 12 As shown, in the hybrid higher-order module (hybrid third-order module), a linear polynomial predictor a(x) is defined with respect to x. For feature mapping For a one-dimensional tensor at spatial location (m,n), a(x) is expressed as:

[0246]

[0247] Where <·,·> represents the inner product of two tensors of the same size. Let w be the r-th order tensor product of x, which contains all r-th order terms of x. r Let R be the r-th order tensor to be learned, containing the weights of the r-th order combination of variables in x, where R is the order.

[0248] When r is large, w r This introduces too many parameters, causing overfitting. Let's assume r > 1, w r Through tensor decomposition of D r Approximated by a rank-1 tensor of dimension:

[0249]

[0250] in, For vectors, For the outer product, α r,d Let a(x) be the weight of the d-th rank-1 tensor.

[0251]

[0252] in, For the weight vector, set up Let a be a row vector of all 1s, and let ⊙ be the Hadamard product. Simplify a(x) by introducing an auxiliary matrix P. r To obtain vector:

[0253]

[0254] in, When r > 1 Because of P r w 1 and α r All are learnable parameters, and {P} can be obtained through matrix algebra. 1 ,w 1 Merge into a new matrix In the middle, {P r ,w r} merged into

[0255] set up It can be approximated by the multiplication of two matrices, i.e. but:

[0256]

[0257]

[0258] a(x) can be modeled and used The higher-order statistics are obtained by introducing a nonlinear relationship using the ReLU function and achieving a higher-order mapping through the Sigmoid function.

[0259]

[0260] A(x) is defined on a local one-dimensional tensor in space, such that Weights are shared across different spatial locations, i.e.

[0261] In the construction of H2OM, when R=1, and Each is output by channel D r The 1×1 convolution implementation with C, when R>1 and r>1, This is also accomplished using a 1×1 convolution. For a series of output channels D r A 1×1 convolution generates a series of feature maps. Generated Obtained through element-level multiplication Preferably, the feature mapping channel C of the input H2OM is 512, and D is set...r It is 128.

[0262] In a preferred embodiment of the present invention, such as Figure 13 As shown, a Generative Adversarial Network (GAN) is designed to generate images from scratch, thereby expanding the training samples.

[0263] The generator consists of seven transposed convolutional sequences, employing BatchNorm and ReLU activation functions. The final layer uses the Tanh activation function, whose function expression is as follows:

[0264]

[0265] The discriminator consists of 7 ordinary convolutional sequences, employing BatchNorm and LeakyReLU activation functions. LeakyReLU improves the ReLU function for the x < 0 portion by adding a smaller slope ξ. Its function is:

[0266] LeakyReLU(x) = max(ξx,x)

[0267] Preferably, ξ = 0.2 is set. The feature mapping details of the generative adversarial network are shown in Table 7:

[0268] Table 7. Feature Mapping Details of Generative Adversarial Networks

[0269] Generator Output feature map size Discriminator Output feature map size Input size 64×1×1 Input size 3×224×224 ConvTranspose 1 256×4×4 Conv 1 64×112×112 ConvTranspose 2 256×7×7 Conv 2 64×56×56 ConvTranspose 3 128×14×14 Conv 3 128×28×28 ConvTranspose 4 128×28×28 Conv 4 128×14×14 ConvTranspose 5 64×56×56 Conv 5 256×7×7 ConvTranspose 6 64×112×112 Conv 6 256×3×3 ConvTranspose 7 3×224×224 Conv 7 1×1×1

[0270] Generative adversarial networks were trained using 364 lightly damaged images and 293 moderately damaged images from the training set, respectively. The loss function used was BCEWithLogitsLoss, where y n ∈{1,2,…,K} are the true labels of sample n, and v=(v1,v2,…,v K ) represents the network output, N is the batch size, K is the number of categories in the classification task, and the loss function is:

[0271]

[0272] Where σ is the Sigmoid activation function. The optimizer chosen is Adam, with parameters β1 and β2 set to 0.5 and 0.999, respectively. Data augmentation includes random horizontal and vertical flipping, both with a probability of 0.3. N is set to 8, the initial learning rate is set to 0.001, and a StepLR learning rate adjustment strategy is used, with a step size of 10 and gamma of 0.5. Training is performed for a total of 100 epochs.

[0273] The present invention also provides a system for the identification and grading of inflammatory bowel disease using digestive endoscopy images, comprising a spatial bilinear attention network, a pyramid feature fusion framework, and a hybrid high-order asymmetric convolutional network.

[0274] The spatial bilinear attention network includes a spatial attention module and a bilinear attention module, which are used to identify ulcerative colitis and Crohn's disease.

[0275] The pyramid feature fusion framework incorporates CNN and a full-attention model Transformer feature extractor to identify the severity of ulcerative colitis.

[0276] The hybrid high-order asymmetric convolutional network comprises, in sequence, a first convolutional layer, a first max-pooling layer, a second convolutional layer, a third convolutional layer, a second max-pooling layer, asymmetric convolutional module a, asymmetric convolutional module b, a third max-pooling layer, asymmetric convolutional module c, a hybrid high-order module, asymmetric convolutional module d, asymmetric convolutional module e, a fourth max-pooling layer, asymmetric convolutional module f, asymmetric convolutional module g, an average pooling layer, a dropout layer, and a linear layer, used to assess the severity of Crohn's disease under CT enterography. This system utilizes a spatial bilinear attention network, a pyramid feature fusion framework, and a hybrid high-order asymmetric convolutional network to achieve subtype identification and severity assessment of IBD.

[0277] This invention addresses the inter-class similarity and intra-class differences between UC and CD, as well as the spatially diffuse nature of their lesions in static colonoscopy images. It proposes a spatial bilinear attention network and explores the effects of attention mechanisms and the application of second-order information on improving the performance of convolutional neural networks.

[0278] To address the requirement for more detailed and comprehensive feature extraction in fine-grained classification for UC severity assessment, a pyramid hybrid feature fusion framework is proposed, exploring the complementary advantages of Transformer global representation and convolutional neural network local induction.

[0279] In response to the characteristic that CD easily induces transmural inflammation and ulceration, a hybrid high-order asymmetric convolutional network was proposed to assess the severity of CD based on CTE images. The study explored the use of high-order information representation to capture subtle differences between classes, as well as data augmentation applications based on generative adversarial networks.

[0280] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0281] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims

1. A method for digestive endoscopy-assisted identification and grading of inflammatory bowel disease, characterized in that: The steps include: Establish a digestive endoscopy image-assisted identification and grading system for inflammatory bowel disease, including: Based on the spatial attention module and the bilinear attention module, a spatial bilinear attention network is constructed to identify ulcerative colitis and Crohn's disease; Based on two feature extractors, CNN and full-attention model Transformer, a pyramid feature fusion framework was established to identify the severity of ulcerative colitis; Based on asymmetric convolutional modules and hybrid high-order modules, a hybrid high-order asymmetric convolutional network was constructed to assess the severity of Crohn's disease under CT enterography. Get the data set, specifically: Collecting multiple sample colonoscopic images, wherein the colonoscopic images include multiple UC patient images, multiple CD patient images, and multiple normal examiner images, and the colonoscopic images are used as a data set of a spatial bilinear attention network; Collect multiple colonoscopy images of multiple patients with ulcerative colitis as the data set of the pyramid feature fusion framework; collect multiple cross-sectional CTE images of multiple patients with Crohn's disease to outline the intestinal wall part, and the intestinal wall part is used as the data set of the hybrid high-order asymmetric convolutional network; The three data sets are randomly divided into training sets and test sets, and the corresponding networks are trained; Endoscopic medical images of the patients to be tested are collected, preprocessed and input into the spatial bilinear attention network to identify whether it is ulcerative colitis or Crohn's disease. If it is ulcerative colitis, the preprocessed images are input into the pyramid feature fusion framework to determine the severity of ulcerative colitis; if it is Crohn's disease, the preprocessed images are input into the mixed high-order asymmetric convolutional network to determine the severity of Crohn's disease.

2. The method for digestive endoscopy-assisted identification and grading of inflammatory bowel disease according to claim 1, characterized in that: The method to construct a spatial bilinear attention network is as follows: In the backbone network, the spatial attention module SAM and the bilinear attention module BAM are introduced to construct the spatial bilinear attention network SABA-ResNet; The backbone network consists of an input processing stage Stem, four feature extraction stages, and adaptive Avgpool layer and FC layer; Stem includes 1 7×7 convolution layer, 1 BatchNorm batch normalization layer, 1 ReLU rectified linear unit activation function and 1 Maxpool maximum pooling layer; The four feature extraction stages have 3, 4, 6, and 3 Bottleneck modules respectively. The first Bottleneck module is a downsampling block. The Bottleneck module includes 3 convolutional layers, 3 BatchNorm layers, and 1 ReLU activation function. The second convolutional layer is a 3×3 convolution with a stride of 1, and the other two convolutional layers are 1×1 convolutions with a stride of 1. In the downsampling block, the stride of the 3×3 convolution is 2, and the residual connection of the downsampling block has a 1×1 convolution with a stride of 2 and a BatchNorm layer. After the output of the first three feature extraction stages of the backbone network, a spatial attention module SAM is introduced to focus on the diffuse lesion area by weighting the spatial features; The bilinear attention module (BAM) captures second-order statistical information before the final classification, builds the interdependence between the second-order global information and the local information, and uses this interrelationship to perform channel weighting on the original feature map, thereby enhancing the model's ability to recognize inter-class discriminative features.

3. The method for digestive endoscopy-assisted identification and grading of inflammatory bowel disease according to claim 2, characterized in that: In the spatial attention module SAM, let the channel, height and width of the feature map of the i-th stage be C i , H i and W i , then the input feature map of SAM is Use 1×1 convolution to input Channel dimensionality reduction is performed to reduce the amount of computation. The size of the intermediate feature map after dimensionality reduction is Where r is the channel dimensionality reduction factor; After the intermediate feature maps are encoded in different spaces by ordinary convolution and dilated convolution, they are subsequently compressed by 3×3 ordinary convolution to obtain the following spatial maps: and At this time, the channel dimension is reduced to 1, and M1 and M2 are: Where Conv(·) represents the convolution operator, and d is the dilation coefficient; In order to aggregate the original spatial information from the input feature map, an average pooling operation is performed along the channel dimension to obtain a single-channel feature map. The feature map size obtained by concatenating this feature map with M1 and M2 in the channel dimension is Use 5×5 convolution and sigmoid activation function to generate spatial attention map M s and A is: A=Sig(Conv 5×5 (M s )) Among them, Concat(·) is the concatenation operation, Avg(·) represents average pooling, and Sig(·) is the Sigmoid activation; Use spatial attention mapping A to the original input Weighted, element-wise multiplication and summing are performed to get the final output It also serves as input to the next stage; Let ⊙ be the Hadamard product, is tensor addition, for:

4. The method for digestive endoscopy-assisted identification and grading of inflammatory bowel disease according to claim 2, characterized in that: In the bilinear attention module BAM, let is the input feature map of BAM, and the vector at the spatial position (m,n) is where m∈{1,2,...,H i }, n∈{1,2,...,W i }; right Perform channel dimensionality reduction, and after 1×1 convolution, the size is The intermediate feature map of the spatial position (m,n) can be expressed as Bilinear operations are performed by vector Multiplying it with its transpose achieves: in, C i is the number of channels of the feature map in the i-th stage, and k is the channel dimension reduction factor; Y is a symmetric matrix. Extract the upper triangular area of ​​Y and perform vector expansion to obtain the vector The upper triangular area extraction makes the channel dimension change from the original Reduce to Among them, Triu(·) represents the operation of extracting the upper triangular region, and Vec(·) represents the vectorization operation; The intermediate feature map obtained after the feature operation function Bi(·) is set as Vectors in U Covered Second-order information of After the feature map U is globally averaged pooled, the channel dimension is transformed to be consistent with the input feature map by 1×1 convolution and multiplied with the second-order feature map. The generated channel attention map is then activated by Sigmoid and Weighted Among them, Conv(·) represents the convolution operator, Avg(·) represents average pooling, and Sig(·) is the Sigmoid activation.

5. The method for digestive endoscopy-assisted identification and grading of inflammatory bowel disease according to claim 1, characterized in that: The pyramid feature fusion framework includes a pyramid vision full attention model PVT branch, a CNN branch, three feature fusion modules FFM, two single-branch classifiers, and a fusion classifier based on a second-order pooling SOP, wherein the feature fusion module FFM is arranged between the PVT branch and the CNN branch, the two single-branch classifiers are respectively connected to the output ends of the PVT branch and the CNN branch, and the fusion classifier is connected to the output ends of the PVT branch and the CNN branch; The pyramid feature fusion framework has three outputs. Average pooling is used on both PVT and CNN branches, and the outputs of the fourth stage of the two branches are first concatenated at the channel level, and then passed through the SOP and fully connected layers as the main output of the model; The total loss function of the model is: Loss all =αLoss pvt +βLoss cnn +γLoss combine , all losses use the cross entropy loss function with label smoothing, where α, β, and γ correspond to the weight coefficients of the three losses respectively; Suppose the true label corresponding to the nth sample is y n ∈{1,2,…,K}, v=(v1,v2,…v K ) is the final output of the network, that is, the prediction result of sample n, and the loss function is: Among them, N is the number of samples, K is the number of categories, ε is the label smoothing coefficient, Ω can represent pvt, cnn or combine, and e is a natural constant.

6. The method for digestive endoscopy-assisted identification and grading of inflammatory bowel disease according to claim 5, characterized in that: The PVT branch adopts the input mode of overlapping patch embedding OPE, introduces DW convolution in the MLP of the encoder to form a convolutional feedforward network CFF, each stage of the PVT branch consists of an overlapping patch embedding OPE, a Block block and a normalization layer, each Block contains N basic component blocks, the output end of OPE is connected to the input end of the Block block, and the output end of the Block block is connected to the input end of the normalization layer; In the PVT branch, let H i , W i and d i are the height, width, and embedding dimensions of the features in the i-th stage, respectively. Reshape the flattened token output in the i-1th stage and then perform OPE. When i=1, the convolution kernel size in OPE is 7 and the step size is 3, while when i=2, 3, 4, the convolution kernel size in OPE is 3 and the step size is 2. The spatial reduction SR is performed first, and then the MHA mechanism is implemented; The MHA mechanism receives a query Q, a key K, and a value V as input: Among them, h i is the number of heads in the attention layer of the i-th stage, Concat(·) is the concatenation operation, and is the linear mapping parameter, and the SR(·) operation is: in, is the input sequence, RP1(·) and RP2(·) are the feature reshaping operations Reshape; represents the characteristics after RP1(·), Represents the spatial reduction ratio, which is also the size and step length of the convolution kernel in the convolution operation Conv(·); At the end of the spatial attenuation operation, RP2(·) will Reshape LN(·) is the LayerNorm layer, For a linear mapping, the attention function Attention(·) is: Among them, q, k, v are query, key and value respectively. DW convolution is introduced in the convolutional feed-forward network to capture the local continuity of the input tensor. In the i-th stage, the dimension attenuation factor between two fully connected layers is 7. The method for digestive endoscopy-assisted identification and grading of inflammatory bowel disease according to claim 5, characterized in that: The feature fusion module FFM receives feature maps from the PVT branch and the CNN branch, fuses them at the channel scale, and transmits the fused features back to the two main branches to enhance the complementary representation; set up and is the intermediate feature map between PVT and CNN in the i-th stage, through G fuse Aggregation gives: Among them, Concat(·) is a concatenation operation, Split(·) is a tensor splitting operation; G fuse It consists of 1×1 convolution and ReLU activation function; The fused features are split along the channel dimension to obtain and Two features, whose sizes are and Same, then go through G pvt and G cnn , G pvt and G cnn They are composed of a 3×3 convolution, a 1×1 convolution and an activation function to re-map the fused features; The processed features are fed back to the PVT and CNN branches and added to the original input features. FFM only aggregates local features and global representations in the first to third stages. In the fourth stage, the outputs of the two branches are concat-joined and the final classification is achieved after SOP.

8. The method for digestive endoscopy-assisted identification and grading of inflammatory bowel disease according to claim 5, characterized in that: The fusion classifier based on the second-order pooling SOP uses the second-order pooling method to enrich the final identification features. and They are the output features of the PVT and CNN branches in the fourth stage, and the features are obtained after cascading operations along the channel dimension. F final Reconstructed into a feature matrix Where S = H4W4, then the covariance matrix B is: Among them, E and I represent the identity matrix and all-1 matrix of size S×S respectively; The Newton-Schulz iteration method is used to accelerate the covariance normalization process. In order to ensure the convergence of the Newton-Schulz iteration, B is first pre-normalized to obtain A: Where tr(B) represents the trace of B; λ i is the i-th element on the main diagonal of B; Given Y0=A and Z0=E, when l=1,...,L, the Newton-Schulz iteration is expressed as: After the Newton-Schulz iteration, post-compensation is required to obtain the final normalized covariance matrix, which is: in, It is a symmetric matrix, and the upper triangular area of ​​the matrix is ​​directly extracted as the input of the final FC layer.

9. The method for digestive endoscopy-assisted identification and grading of inflammatory bowel disease according to claim 1, characterized in that: The hybrid high-order asymmetric convolutional network includes a first convolutional layer, a first maximum pooling layer, a second convolutional layer, a third convolutional layer, a second maximum pooling layer, an asymmetric convolution module a, an asymmetric convolution module b, a third maximum pooling layer, an asymmetric convolution module c, a hybrid high-order module, an asymmetric convolution module d, an asymmetric convolution module e, a fourth maximum pooling layer, an asymmetric convolution module f, an asymmetric convolution module g, an average pooling layer, a Dropout layer and a Linear layer connected in sequence; The asymmetric convolution module consists of four branches, two of which are asymmetric convolution branches, using 1×3 and 3×7 convolutions in the horizontal direction, and 3×1 and 7×3 convolutions in the vertical direction; the other two branches use 1×1 convolution to achieve channel dimensionality reduction, and one of them adds maximum pooling for information concentration; The input and output feature maps are and The output dimension of the first branch is C conv ; The hidden dimension of the two asymmetric convolution branches is C hid , the output dimension is C asy ; The output dimension of the fourth branch is C maxc , the feature maps of different branches are concat-concatenated in the channel dimension to obtain C out =C conv +C maxc +2C asy ; In the hybrid high-order module, a linear polynomial predictor a(x) is defined for x. For feature mapping A one-dimensional tensor at a spatial position (m,n), then a(x) is expressed as: Among them, <·,·> is the inner product of two tensors of the same size, is the r-order tensor product of x, which contains all r-order single terms of x, w r is the r-order tensor to be learned, containing the weights of the r-order variable combinations in x, where R is the order; Assume r>1, w r By tensor decomposition D r It is approximated by a rank-1 tensor of dimension: in, is a vector, is the outer product, α r,d is the weight of the d-th rank-1 tensor, then a(x) is: in, is the weight vector, set up is a row vector of all 1s, ⊙ is the Hadamard product, a(x) is simplified, and the auxiliary matrix P is introduced r To obtain A vector of: in, When r>1, Because P r , w 1 and α r are all learnable parameters, and can be transformed into {P 1 ,w 1 Merge into a new matrix In {P r ,w r Merge into set up It can be approximated by multiplication of two matrices, namely but: a(x) can be modeled and used The high-order statistics of are obtained by introducing nonlinear relationships using the ReLU function and implementing high-order mapping through the Sigmoid function. A(x) is defined on a spatially local one-dimensional tensor such that The weights are shared at different spatial locations, that is, When R=1, and The output channels are D r and C are realized by 1×1 convolution. When R>1 and r>1, The same is done with 1×1 convolution. For a series of output channels D r A 1×1 convolution, which generates a series of feature maps Generated Combining by element-wise multiplication 10. A digestive endoscopy image-assisted identification and grading system for inflammatory bowel disease, characterized in that: Including spatial bilinear attention network, pyramid feature fusion framework and hybrid high-order asymmetric convolutional network; The spatial bilinear attention network is provided with a spatial attention module and a bilinear attention module for identifying ulcerative colitis and Crohn's disease; The pyramid feature fusion framework is equipped with CNN and full attention model Transformer feature extractors to identify the severity of ulcerative colitis; The hybrid high-order asymmetric convolutional network includes a first convolutional layer, a first maximum pooling layer, a second convolutional layer, a third convolutional layer, a second maximum pooling layer, an asymmetric convolution module a, an asymmetric convolution module b, a third maximum pooling layer, an asymmetric convolution module c, a hybrid high-order module, an asymmetric convolution module d, an asymmetric convolution module e, a fourth maximum pooling layer, an asymmetric convolution module f, an asymmetric convolution module g, an average pooling layer, a Dropout layer and a Linear layer, which are connected in sequence and are used to evaluate the severity of Crohn's disease under CT enterography.

Citation Information

Patent Citations

  • CD severity grading system based on hybrid high-order asymmetric convolutional network

    CN116384448A

Cited By

  • Method for identifying ulcerative colitis inflammatory activity level based on dynamic graph multi-instance learning assistance

    CN120047411A

  • Endoscope image intelligent evaluation method for ulcerative colitis

    CN120198599A

  • An intelligent evaluation method for endoscopic images of ulcerative colitis

    CN120198599B

  • Intelligent gastrointestinal tract postoperative intestinal obstruction diagnosis and intervention decision-making system and method thereof

    CN120376115A

  • Intelligent postoperative ileus diagnosis and intervention decision system for gastrointestinal tract and method thereof

    CN120376115B