A method and system for constructing an endoscope-assisted disease body recognition model
Patent Information
- Application Number
- CN202610907130.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-23
- Publication Date
- 2026-10-23
AI Technical Summary
[0003]针对现有技术中所存在的不足,本发明提供了一种基于内窥镜辅助的病体识别模型的构建方法,其解决了现有技术中存在的内窥镜检查结果依赖内镜医师的肉眼观察和临床经验判断发现并评估病变,容易出现漏诊的问题
本发明截取部分YOLOv5模型的架构构成的三尺度特征提取模块对输入的内窥镜训练图像进行特征提取,之后使用三尺度重组模块以三种不同的空洞卷积分支来对三尺度特征提取模块提取的三个特征图进行特征提取,扩大感受野,然后将提取的特征进行重组,之后对重组后的特征进行空间注意力增强,增强小病灶特征响应,并使用解耦检测头解决了分类与回归的特征冲突,使病体的识别更加准确,同时不再依赖内镜医师的肉眼观察和临床经验判断发现并评估病变。
Smart Images

Figure CN122966526A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image processing technology, and in particular to a method and system for constructing an endoscopic-assisted disease identification model. Background Technology
[0002] Electronic endoscopy is currently the gold standard for diagnosing diseases of the digestive and respiratory tracts, and is widely used in clinical settings such as early cancer screening, lesion diagnosis, and treatment evaluation. However, the traditional endoscopic examination method currently used in clinical practice relies entirely on endoscopists to visually observe and assess lesions based on clinical experience under real-time video feedback. The diagnostic sensitivity and specificity vary significantly among endoscopists with different years of experience and professional backgrounds, making it easy to miss small lesions, flat lesions, and early lesions. Furthermore, visual fatigue and distraction caused by prolonged continuous operation further reduce the accuracy of judgment and significantly increase the probability of missed diagnoses. This method has significant technical bottlenecks and clinical challenges. Summary of the Invention
[0003] To address the shortcomings of existing technologies, this invention provides a method for constructing an endoscopic-assisted lesion identification model. This method solves the problem that existing technologies rely on endoscopists' visual observation and clinical experience to identify and assess lesions, which can easily lead to missed diagnoses.
[0004] According to an embodiment of the present invention, a method for constructing an endoscopic-assisted lesion identification model includes: S1: Obtain endoscope training images, construct a YOLOv5 model and crop the YOLOv5 model to obtain a three-scale feature extraction module. Use the three-scale feature extraction module to extract features from the endoscope training images to obtain feature maps of three different scales. S2: Construct a three-scale recombination module, and use the three-scale recombination module to recombine the features of the three feature maps respectively to obtain the corresponding recombined features; S3: Spatial-channel attention enhancement is performed on each convolutional feature to obtain the corresponding enhanced feature. Then, all enhanced features are input into the decoupling head to obtain the lesion recognition box. S4: Adjust the parameters of the three-scale feature extraction module, the three-scale reconstruction module and the decoupling head according to the lesion recognition box, change the endoscope training image, and repeat steps S2-S4 to obtain the lesion recognition model.
[0005] Preferably, the YOLOv5 model includes a CSPDarknet backbone network, an FPN+PAN neck network, and a coupled detection head. The coupled detection head is removed, and the CSPDarknet backbone network and the FPN+PAN neck network are combined into a three-scale feature extraction module.
[0006] Preferably, the method of using a three-scale reconstruction module to reconstruct the features of the three feature maps respectively to obtain the corresponding reconstructed features includes: The feature maps are fed into three dilated convolution branches of different scales to generate three convolutional features. The three convolutional feature eye channels are concatenated to generate concatenated features; The reconstructed features are obtained by using 1x1 convolution and convolution processing on the spliced features.
[0007] Preferably, the three dilated convolution branches have the same number of channels, the convolution kernels are all 3x3, the dilation rates are 1, 2, and 3, and the padding is 1, 2, and 3, respectively.
[0008] Preferably, the method for spatial-channel attention enhancement of the recombined features to obtain enhanced features includes: Global average pooling and global max pooling are performed on the recombined features to obtain the first pooling feature and the second pooling feature; MLP is used to extract features from the first pooling feature and the second pooling feature respectively to generate the first perceptual feature and the second perceptual feature. Channel weights are generated based on the first and second perceptual features. Then, the channel weights are multiplied by the recombined features channel by channel to obtain the channel features. Average pooling and max pooling are performed on the channel features along the channel dimension to obtain the third pooling feature and the fourth pooling feature. Spatial weights are generated based on the third and fourth pooling features. Then, the spatial weights are multiplied by the channel features one channel at a time to obtain the enhanced features.
[0009] Preferably, the method for generating channel weights based on the first and second perceptual features includes: The first perceptual feature is obtained by adding the second perceptual feature; The first intermediate feature is processed using the Sigmoid function to obtain the channel weights.
[0010] Preferably, the method for generating spatial weights based on the third pooling feature and the fourth pooling feature includes: The third pooling feature and the fourth pooling feature are concatenated, and the concatenated feature is then convolved to obtain the second intermediate feature; The second intermediate feature is processed using the Sigmoid function to obtain spatial weights. Then, the spatial weights are multiplied with the channel features channel by channel to obtain the enhanced features.
[0011] On the other hand, according to embodiments of the present invention, a system for constructing an endoscopic-assisted lesion identification model is also provided. This system uses the aforementioned method for constructing an endoscopic-assisted lesion identification model, comprising: Data collection module, which is used to acquire endoscopic training images; The functional module generation module is used to construct a YOLOv5 model and prune the YOLOv5 model to obtain a three-scale feature extraction module, as well as to construct a three-scale recombination module and a decoupling head. The training module is used to extract features from the endoscopic training images using a three-scale feature extraction module to obtain three feature maps at different scales. The three feature maps are then aggregated using a three-scale reconstruction module to obtain reconstructed features. Spatial-channel attention enhancement is applied to the reconstructed features to obtain enhanced features. The enhanced features are then input into the decoupling head to obtain the lesion recognition box. The parameter tuning module is used to adjust the parameters of the three-scale feature extraction module, the three-scale reconstruction module, and the decoupling head according to the disease identification box.
[0012] Compared with the prior art, the present invention has the following beneficial effects: This invention utilizes a three-scale feature extraction module, constructed from a portion of the YOLOv5 model architecture, to extract features from input endoscopic training images. A three-scale reconstruction module then employs three different dilated convolution branches to extract features from the three feature maps extracted by the three-scale feature extraction module, expanding the receptive field. The extracted features are then reconstructed, and spatial attention enhancement is applied to the reconstructed features to improve the response to small lesions. Furthermore, a decoupled detection head resolves the feature conflict between classification and regression, making lesion identification more accurate. This eliminates the reliance on endoscopists' visual observation and clinical experience for lesion detection and assessment. Attached Figure Description
[0013] Figure 1 This diagram illustrates the method for constructing a disease identification model according to an embodiment of the present invention. Detailed Implementation
[0014] The technical solutions of the present invention will be further described below with reference to the accompanying drawings and embodiments.
[0015] like Figure 1 As shown in the figure, this invention proposes a method for constructing an endoscopic-assisted lesion identification model, including: S1: Obtain endoscope training images, construct a YOLOv5 model and crop the YOLOv5 model to obtain a three-scale feature extraction module. Use the three-scale feature extraction module to extract features from the endoscope training images to obtain feature maps of three different scales. The original YOLOv5s network structure is: input → CSPDarknet backbone network → FPN+PAN neck network → coupling detection head → output. In this invention, after constructing the YOLOv5s model, the CSPDarknet backbone network and FPN+PAN neck network in the YOLOv5 model are retained and a three-scale feature extraction module is generated, while the coupling detection head is removed.
[0016] After the acquired endoscopic training images are processed by the CSPDarknet backbone network and FPN+PAN neck network in the three-scale feature extraction module, three feature maps of different scales are generated: P3 (80×80×128), P4 (40×40×256), and P5 (20×20×512).
[0017] S2: Construct a three-scale recombination module, and use the three-scale recombination module to perform feature aggregation on the three feature maps to obtain the recombined features; The three-scale reconstruction module consists of three parallel dilated convolutional branches, each with a 3×3 kernel, dilation rates of 1, 2, and 3, a stride of 1, and padding of 1, 2, and 3 to ensure a constant output size. Each branch outputs C channels. The outputs of the three branches are concatenated along the channels to obtain a 3C×H×W feature map, which is then passed through a 1×1 convolutional layer to reduce the number of channels to C, outputting F_multi(C×H×W).
[0018] Taking feature map P3 as an example, P3 (128×80×80) is input into the three-scale reconstruction module. Three parallel 3×3 dilated convolutions (d=1,2,3) are used to output 128 channels, resulting in three 128×80×80 convolutional features. Then, the three convolutional features are concatenated along the channels to form a 384×80×80 concatenated feature. Finally, a 1×1 convolution is used to reduce the dimension to 128, resulting in a 128×80×80 reconstructed feature.
[0019] S3: Spatial-channel attention enhancement is performed on the recombined features to obtain enhanced features. Then, the enhanced features are input into the decoupling head to obtain the lesion recognition box. (1) Channel attention: For each recombined feature, global average pooling and global max pooling are performed respectively to obtain two 128-dimensional first pooling features and second pooling features. Then, the first pooling features and second pooling features are fed into a shared MLP (first layer neuron number C / 16, ReLU; second layer C, 128→8→128) to generate first perceptual features and second perceptual features. The generated first perceptual features and second perceptual features are added together to obtain the first intermediate feature. Then, the first intermediate feature is processed using the Sigmoid function to obtain 128×1×1 channel weights. The channel weights are multiplied by the recombined features channel by channel to obtain the channel features (128×80×80).
[0020] (2) Spatial attention Average pooling and max pooling are performed on the channel features along the channel dimension to obtain two 80×80 third pooling features and fourth pooling features. The third pooling features and fourth pooling features are concatenated to form a 2×80×80 feature. This feature is then subjected to a 7×7 convolution (input 2, output 1, padding=3) to obtain a 1×80×80 second intermediate feature. The second intermediate feature is then processed using a sigmoid function to obtain spatial weights. The spatial weights are then multiplied element-wise with the channel features to obtain a 128×80×80 enhanced feature.
[0021] The enhancement features corresponding to the three feature maps (P3, P4, P5) are input into the decoupling head, which contains a classification branch and a regression branch. The classification branch consists of a 3×3 depthwise separable convolution (128→128, stride=1, padding=1) → BN → ReLU → 1×1 convolution (128→K, K=8 lesion types). The regression branch has a similar structure, with a 1×1 convolution outputting 4 channels.
[0022] After the enhanced feature map P3 is input into the decoupling head, the decoupling head outputs a classification feature map (8×80×80) and a regression feature map (4×80×80) for each enhanced feature. P4 and P5 have similar scales, with 256 and 512 channels respectively. Then, based on all the classification and regression feature maps, the lesion is located to obtain the lesion identification box.
[0023] S4: Adjust the parameters of the three-scale feature extraction module, the three-scale reconstruction module and the decoupling head according to the lesion recognition box, change the endoscope training image, and repeat steps S2-S4 to obtain the lesion recognition model.
[0024] The three-scale feature extraction module, the three-scale recombination module, and the decoupling head are combined into a training model, and the loss functions are set as classification loss BCE, regression loss CIoU, and confidence loss BCE. Then, the optimizer Adam is used to tune the parameters of the three-scale feature extraction module, the three-scale recombination module, and the decoupling head in the training model. The initial learning rate of the optimizer Adam is 0.001, and the batch size is 32.
[0025] Replace the endoscopic training image and repeat steps S2-S4, setting the maximum number of iterations to 200. After training, the lesion recognition model is obtained.
[0026] On the other hand, embodiments of the present invention also provide a system for constructing an endoscopic-assisted lesion identification model. This system uses the aforementioned method for constructing an endoscopic-assisted lesion identification model, including: Data collection module, which is used to acquire endoscopic training images; The functional module generation module is used to construct a YOLOv5 model and prune the YOLOv5 model to obtain a three-scale feature extraction module, as well as to construct a three-scale recombination module and a decoupling head. The training module is used to extract features from the endoscopic training images using a three-scale feature extraction module to obtain three feature maps at different scales. The three feature maps are then aggregated using a three-scale reconstruction module to obtain reconstructed features. Spatial-channel attention enhancement is applied to the reconstructed features to obtain enhanced features. The enhanced features are then input into the decoupling head to obtain the lesion recognition box. The parameter tuning module is used to adjust the parameters of the three-scale feature extraction module, the three-scale reconstruction module, and the decoupling head according to the disease identification box.
[0027] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for constructing an endoscopic-assisted lesion identification model, characterized in that: include: S1: Obtain endoscope training images, construct a YOLOv5 model and crop the YOLOv5 model to obtain a three-scale feature extraction module. Use the three-scale feature extraction module to extract features from the endoscope training images to obtain feature maps of three different scales. S2: Construct a three-scale recombination module, and use the three-scale recombination module to recombine the features of the three feature maps respectively to obtain the corresponding recombined features; S3: Spatial-channel attention enhancement is performed on each convolutional feature to obtain the corresponding enhanced feature. Then, all enhanced features are input into the decoupling head to obtain the lesion recognition box. S4: Adjust the parameters of the three-scale feature extraction module, the three-scale reconstruction module and the decoupling head according to the lesion recognition box, change the endoscope training image, and repeat steps S2-S4 to obtain the lesion recognition model.
2. The method for constructing an endoscopy-assisted lesion identification model as described in claim 1, characterized in that: The YOLOv5 model includes a CSPDarknet backbone network, an FPN+PAN neck network, and a coupled detection head. The coupled detection head is removed, and the CSPDarknet backbone network and the FPN+PAN neck network are combined into a three-scale feature extraction module.
3. The method for constructing an endoscopic-assisted lesion identification model as described in claim 1, characterized in that: The method of using a three-scale reconstruction module to reconstruct features from three feature maps to obtain the corresponding reconstructed features includes: The feature maps are fed into three dilated convolution branches of different scales to generate three convolutional features. The three convolutional feature eye channels are concatenated to generate concatenated features; The reconstructed features are obtained by using 1x1 convolution and convolution processing on the spliced features.
4. The method for constructing an endoscopic-assisted lesion identification model as described in claim 3, characterized in that: The three dilated convolution branches have the same number of channels, 3x3 kernels, dilation rates of 1, 2, and 3, and padding of 1, 2, and 3, respectively.
5. The method for constructing an endoscopic-assisted lesion identification model as described in claim 1, characterized in that: Methods for spatial-channel attention enhancement of recombined features to obtain enhanced features include: Global average pooling and global max pooling are performed on the recombined features to obtain the first pooling feature and the second pooling feature; MLP is used to extract features from the first pooling feature and the second pooling feature respectively to generate the first perceptual feature and the second perceptual feature. Channel weights are generated based on the first and second perceptual features. Then, the channel weights are multiplied by the recombined features channel by channel to obtain the channel features. Average pooling and max pooling are performed on the channel features along the channel dimension to obtain the third pooling feature and the fourth pooling feature. Spatial weights are generated based on the third and fourth pooling features. Then, the spatial weights are multiplied by the channel features one channel at a time to obtain the enhanced features.
6. The method for constructing an endoscopic-assisted lesion identification model as described in claim 5, characterized in that: Methods for generating channel weights based on first and second perceptual features include: The first perceptual feature is obtained by adding the second perceptual feature; The first intermediate feature is processed using the Sigmoid function to obtain the channel weights.
7. The method for constructing an endoscopic-assisted lesion identification model as described in claim 5, characterized in that: Methods for generating spatial weights based on the third and fourth pooling features include: The third pooling feature and the fourth pooling feature are concatenated, and the concatenated feature is then convolved to obtain the second intermediate feature; The second intermediate feature is processed using the Sigmoid function to obtain spatial weights. Then, the spatial weights are multiplied with the channel features channel by channel to obtain the enhanced features.
8. A system for constructing an endoscopic-assisted disease identification model, characterized in that: The system uses a method for constructing an endoscopic-assisted lesion identification model as described in any one of claims 1-7, comprising: Data collection module, which is used to acquire endoscopic training images; The functional module generation module is used to construct a YOLOv5 model and prune the YOLOv5 model to obtain a three-scale feature extraction module, as well as to construct a three-scale recombination module and a decoupling head. The training module is used to extract features from the endoscopic training images using a three-scale feature extraction module to obtain three feature maps at different scales. The three feature maps are then aggregated using a three-scale reconstruction module to obtain reconstructed features. Spatial-channel attention enhancement is applied to the reconstructed features to obtain enhanced features. The enhanced features are then input into the decoupling head to obtain the lesion recognition box. The parameter tuning module is used to adjust the parameters of the three-scale feature extraction module, the three-scale reconstruction module, and the decoupling head according to the disease identification box.