Gastric precancerous lesion AI image grading method and system
By employing a self-supervised pre-training and imaging domain adaptation grading mechanism, the instability of gastric precancerous lesion grading under different imaging conditions is resolved, achieving stability and consistency in the grading results of gastric precancerous lesions and improving the reliability and interpretability of the model in multi-device and multi-mode applications.
Patent Information
- Application Number
- CN202512037220.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-14
AI Technical Summary
Existing basic models exhibit post-transfer output instability in the task of grading precancerous lesions of the stomach, making it difficult to maintain consistency and reproducibility of grading results under different imaging conditions. In particular, under conditions of white light endoscopy versus narrow-band imaging endoscopy, and magnified versus non-magnified observation, the grading probability distribution drifts due to differences in color response, texture contrast, and structural significance.
By combining self-supervised pre-training with a grading mechanism that adapts imaging domain conditions, gastric endoscopic image data from multiple imaging domains are acquired, a basic representation network is established, and lightweight incremental parameters are loaded under frozen main parameters for domain condition fine-tuning. Grading consistency constraints and confidence calibration are applied to cross-imaging domain samples to generate grading results for precancerous lesions of the stomach.
It improves the stability and consistency of gastric precancerous lesion grading results under different imaging modes and equipment conditions, enhances the repeatability and reliability of the model in multi-device and multi-mode application scenarios, and provides stable confidence information to support clinical risk assessment.
Smart Images

Figure CN121860978A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image analysis technology, and in particular to an AI-based image grading method and system for precancerous lesions of the stomach. Background Technology
[0002] Precancerous lesions of the stomach typically progress stepwise along mucosal changes associated with chronic gastritis. Clinically, risk assessment and follow-up management are crucial, focusing on gastric mucosal atrophy, intestinal metaplasia, and intraepithelial neoplasia. Endoscopically, a relatively mature grading and staging system has been established. For example, the Kimura Takemoto atrophy boundary classification is used to assess the extent of atrophy, magnifying endoscopy combined with narrow-band imaging is used to observe microsurface and microvascular characteristics, and the endoscopic grading system for intestinal metaplasia (EGGIM) is used to reflect the extent and degree of intestinal metaplasia. Pathologically, the updated Sydney system is used for sampling, and OLGA and OLGIM are used for staging, thus supporting the establishment of follow-up intervals and the identification of high-risk populations. Recent studies have developed artificial intelligence systems to identify chronic atrophic gastritis under white light endoscopy and perform risk stratification according to the Kimura Takemoto classification, suggesting that endoscopic grading tasks have an algorithmic symptom basis.
[0003] Meanwhile, research on artificial intelligence for gastric mucosal intestinal metaplasia has shifted from detection to grading and risk stratification. Systematic reviews and meta-analyses show that artificial intelligence-assisted endoscopy has high overall accuracy in the diagnosis of intestinal metaplasia, but differences between studies suggest that the image source and acquisition conditions have a significant impact on the results.
[0004] A clear recent trend is to advance intelligent endoscopic image analysis from task-specific models to a foundational model paradigm. This involves using large-scale endoscopic images for self-supervised pre-training to obtain more general representations, which are then transferred to downstream tasks with a small amount of labeled data. Journal studies in the field of medical image analysis have systematically evaluated in-domain self-supervised pre-training in the endoscopic domain, indicating that in-domain pre-training can obtain more suitable representations than pre-training on natural images, improve performance on various downstream tasks, and demonstrate stronger robustness to perturbations such as noise, blur, and contrast changes.
[0005] In line with this, the data resources for basic models of gastrointestinal endoscopy are also expanding. For example, the multi-center, ultra-large-scale general endoscopic image dataset GastroNet 5M has been used to train basic models and has shown better data efficiency and robustness against cross-vendor image heterogeneity in evaluations covering multiple tasks, providing a new training foundation for small sample transfer.
[0006] Regarding clinical staging goals, the latest guideline update further emphasizes the objective recording of the presence and severity of atrophy and intestinal metaplasia in the precancerous state of the stomach, and uses OLGA and OLGIM as important criteria for staging and stratification, indicating that the output of the staging task is becoming more closely linked to risk management strategies.
[0007] Despite the advancements in domain-supervised pre-training and multi-center big data to improve transfer learning capabilities, existing basic models still face a critical obstacle of unstable output after transfer learning for fine-grained mucosal phenotypic discrimination tasks such as grading of precancerous lesions of the stomach. This stems from the high sensitivity of the microsurface and microvascular details upon which grading depends to acquisition conditions. Specifically, the same subject exhibits systematic differences in color response, texture contrast, and structural saliency under white light endoscopy versus narrow-band imaging endoscopy, and under magnified versus non-magnified observation conditions. Furthermore, different manufacturers' optical systems and image signal processing links further amplify these differences, making the transfer model prone to grading probability distribution drift when applied across conditions, resulting in inconsistent grading of the same lesion under different imaging conditions. The mainstream evaluation tasks for related basic models remain primarily general tasks such as polyp segmentation and vascular malformation detection. While demonstrating overall gains in domain pre-training, these models do not adequately cover the sign levels and grading scales required for precancerous lesion grading of the stomach. Consequently, when transferring to tasks such as gastric mucosal atrophy classification, intestinal metaplasia endoscopic grading, and pathological staging mapping, a grading stability constraint mechanism for differences in imaging conditions is still lacking.
[0008] In addition, guidelines and studies have indicated that the extent and degree of intestinal metaplasia, as well as staging and stratification, are directly related to follow-up decisions. However, existing protocols mostly focus on stratification under single acquisition conditions, making it difficult to guarantee the reproducibility and consistency of stratification conclusions across devices and imaging modes. Summary of the Invention
[0009] To overcome the shortcomings of existing technologies, the present invention aims to provide an AI-based image grading method and system for precancerous lesions of the stomach. Through a grading mechanism that combines self-supervised learning of basic representations with imaging domain condition adaptation, the stability and consistency of grading results for precancerous lesions of the stomach are effectively improved under different imaging modes and equipment conditions.
[0010] To achieve the above objectives, the present invention provides the following solution: An AI-based imaging grading method for precancerous lesions of the stomach includes: Acquire gastric endoscopic image data from at least two imaging domains and form a pre-training dataset for basic training; the imaging domains are jointly determined by imaging mode identifiers and device identifiers; Based on the pre-training dataset, the initial network is self-supervised pre-training to obtain the endoscopic basic representation network, and the endoscopic basic representation network is able to output the basic feature vector of the endoscopic image. Obtain a target grading dataset with grading annotations for precancerous lesions of the stomach, establish a grading label mapping relationship, unify the grading annotations for precancerous lesions of the stomach to a preset grading sequence, and obtain the target grading dataset with unified annotations. Lightweight incremental parameters are loaded while freezing the main parameters of the endoscopic basic characterization network, and domain condition fine-tuning is performed based on the target hierarchical dataset; wherein the domain conditions are encoded by the imaging mode identifier and the device identifier to obtain a set of domain adaptation parameters that correspond one-to-one with the imaging domain. During the fine-tuning of the domain conditions, a grading consistency constraint is applied to cross-imaging domain samples of the same part of the same case, so that the grading prediction distribution corresponding to the cross-imaging domain samples meets a preset stability threshold, and confidence calibration is performed on the grading prediction distribution to obtain a calibrated grading discriminator. The imaging mode identifier and the device identifier are obtained by analyzing the gastric endoscopic image to be tested. The domain adaptation parameter set that matches the imaging mode identifier and the device identifier is called to generate the feature vector to be tested. The feature vector to be tested is input into the calibrated grading discriminator and the grading result of gastric precancerous lesions and the corresponding confidence level are output.
[0011] Preferably, gastric endoscopic image data from at least two imaging domains are acquired, and a pre-training dataset for basic training is formed, including: Acquire the metadata corresponding to each frame of the gastrointestinal endoscopic image data; Extract the imaging mode identifier and the device identifier from the acquired metadata; Standardized encoding is performed on the imaging mode identifier and the device identifier to eliminate duplicate names; Based on the standardized imaging mode identifier and the device identifier, the gastrointestinal endoscopic image data is divided into multiple imaging domains, and a corresponding domain label is written for each imaging domain to form the pre-trained dataset.
[0012] Preferably, acquiring gastric endoscopic image data from at least two imaging domains and forming a pre-training dataset for basic training further includes: The gastrointestinal endoscopic image data is subjected to quality screening to remove image frames that do not meet the preset sharpness threshold or the preset exposure threshold. Patient information de-identification processing is performed on the filtered gastric endoscopic image data; Image frames are extracted from the endoscopic video at preset sampling intervals and associated with the corresponding imaging mode identifier and device identifier to form the pre-training dataset.
[0013] Preferably, the initial network is subjected to self-supervised pre-training based on the pre-trained dataset to obtain the endoscopic basic representation network, including: Two preset image enhancement methods are applied to the same gastric endoscopic image data to obtain a first enhanced image and a second enhanced image; The first enhanced image and the second enhanced image are respectively input into the initial network to obtain the first basic feature vector and the second basic feature vector; A self-supervised training objective is constructed based on the first basic feature vector and the second basic feature vector, so that the first basic feature vector and the second basic feature vector satisfy a preset similarity constraint in the feature space, and at the same time, the basic feature vectors corresponding to different images satisfy a preset separability constraint. The parameters of the initial network are iteratively updated according to the self-supervised training objective to obtain the endoscopic basic representation network.
[0014] Preferably, a hierarchical label mapping relationship is established to unify the hierarchical labeling of the precancerous lesions of the stomach into a preset hierarchical sequence, resulting in a uniformly labeled target hierarchical dataset, including: The preset grading sequence is determined to be an ordered integer sequence arranged in ascending order of lesion severity; Obtain the original classification label for each sample in the target classification dataset; Establish mapping rules from the original hierarchical labels to the ordered integer sequence and form the hierarchical label mapping relationship; Based on the hierarchical label mapping relationship, the original hierarchical annotations are converted into sequence labels in the preset hierarchical sequence, and the sequence labels are associated with and stored with the corresponding image samples to obtain the target hierarchical dataset with unified annotation.
[0015] Preferably, lightweight incremental parameters are loaded while freezing the main parameters of the endoscopic basic characterization network, and domain-conditional fine-tuning is performed based on the target hierarchical dataset, including: A lightweight incremental parameter layer is inserted after the preset network layer of the endoscopic basic representation network; the lightweight incremental parameter layer includes a first trainable parameter for linearly transforming the basic feature vector and a second trainable parameter for nonlinearly mapping the result of the linear transformation. Freeze the network parameters of the endoscopic basic characterization network except for the lightweight incremental parameter layer; Only the first trainable parameter and the second trainable parameter are updated to complete the domain condition fine-tuning.
[0016] Preferably, the domain conditions are determined as follows: The imaging mode identifier is mapped to a first domain encoding vector, and the device identifier is mapped to a second domain encoding vector; Generate the vector of the domain conditions based on the first domain encoding vector and the second domain encoding vector; Based on the vector of the domain conditions, select the set of domain adaptation parameters that correspond one-to-one with the imaging domain from the preset parameter index table, and load the set of domain adaptation parameters into the lightweight incremental parameters for fine-tuning of the domain conditions.
[0017] Preferably, during the fine-tuning of the domain conditions, a hierarchical consistency constraint is applied to cross-imaging domain samples of the same location in the same case, including: Establish cross-imaging domain pairing relationships for samples belonging to the same part of the same case in the target hierarchical dataset to obtain cross-imaging domain sample pairs; The cross-imaging domain sample pairs are respectively input into the network that has been fine-tuned by the domain conditions to obtain the corresponding hierarchical prediction distribution; The distributional differences between the hierarchical prediction distributions are calculated as the consistency loss. The consistency loss and hierarchical supervision loss are combined to form the training objective, and the training objective is optimized so that the distribution difference is not greater than the preset stability threshold.
[0018] Preferably, confidence calibration is performed on the hierarchical prediction distribution to obtain a calibrated hierarchical discriminator, including: A calibration dataset is obtained by dividing the target hierarchical dataset; the calibration dataset includes image samples and the preset hierarchical sequence annotations corresponding to the image samples; Based on the calibration dataset, confidence calibration parameters are determined so that the hierarchical prediction distribution transformed by the confidence calibration parameters and the preset hierarchical sequence label meet the threshold condition under the preset calibration error index. The confidence level calibration parameters are embedded into the grading discriminator to obtain the calibrated grading discriminator, and the corresponding confidence level is determined by the calibrated grading prediction distribution.
[0019] An AI-based imaging grading system for precancerous lesions of the stomach includes: An imaging domain data acquisition unit is used to acquire gastric endoscopic image data from at least two imaging domains and form a pre-training dataset for basic training; the imaging domain is determined by both the imaging mode identifier and the device identifier. The basic representation self-supervised training unit is used to perform self-supervised pre-training on the initial network based on the pre-training dataset to obtain the endoscopic basic representation network, and enable the endoscopic basic representation network to output the basic feature vector of the endoscopic image. The hierarchical labeling and mapping unit is used to obtain a target hierarchical dataset with hierarchical labels for precancerous lesions of the stomach, establish a hierarchical label mapping relationship, unify the hierarchical labels for precancerous lesions of the stomach into a preset hierarchical sequence, and obtain the target hierarchical dataset with unified labeling. The domain condition fine-tuning and parameter adaptation unit is used to load lightweight incremental parameters under the condition of freezing the main parameters of the endoscopic basic characterization network, and to perform domain condition fine-tuning based on the target hierarchical dataset; wherein the domain condition is encoded by the imaging mode identifier and the device identifier to obtain a set of domain adaptation parameters that correspond one-to-one with the imaging domain. A cross-imaging domain grading consistency constraint and calibration unit is used to apply grading consistency constraints to cross-imaging domain samples of the same part of the same case during the fine-tuning of the domain conditions, so that the grading prediction distribution corresponding to the cross-imaging domain samples meets a preset stability threshold, and to perform confidence calibration on the grading prediction distribution to obtain a calibrated grading discriminator. The hierarchical reasoning and result output unit is used to analyze the gastric endoscopic image to be tested to obtain the imaging mode identifier and the device identifier, call the domain adaptation parameter set that matches the imaging mode identifier and the device identifier to generate the feature vector to be tested, and input the feature vector to be tested into the calibrated hierarchical discriminator to output the hierarchical result of gastric precancerous lesion and the corresponding confidence level.
[0020] The present invention discloses the following technical effects: This invention introduces a self-supervised pre-training mechanism based on multi-imaging-domain endoscopic images, enabling the endoscopic basic representation network to fully learn the general structural features and texture representations of gastric mucosal images without relying on manual grading and annotation. This reduces the dependence on specific imaging modes or specific equipment data distributions at the source, avoids feature bias caused by training only for a single acquisition condition, and improves the transferability and stability of basic features across different imaging domains.
[0021] This invention, based on the basic representation network, performs domain condition fine-tuning by freezing the main parameters and introducing lightweight incremental parameters. This concentrates the hierarchical adaptation capability into a small number of adjustable parameters, thereby achieving targeted compensation for the differences in imaging domains corresponding to different imaging mode identifiers and device identifiers while maintaining the consistency of the basic representation. This avoids catastrophic shifts in the overall network driven by small sample hierarchical data and helps maintain the consistency of hierarchical discrimination logic in different imaging domains.
[0022] This invention constructs cross-imaging domain sample constraint relationships for the same site in the same case during the domain condition fine-tuning process, and applies consistency constraints to its grade prediction distribution, so that the grading results given by the model for the same actual lesion under different imaging conditions tend to be consistent. This suppresses the grading fluctuations caused by changes in imaging mode or equipment differences from a mechanism level, and effectively improves the repeatability and reliability of the grading results of gastric precancerous lesions in clinical multi-device and multi-mode application scenarios.
[0023] This invention introduces confidence calibration in the grading prediction process, enabling the confidence level output by the grading discriminator to reflect the credibility of the grading prediction results. This avoids overconfidence or confidence distortion when the grading model is applied across imaging domains, ensuring that the output not only contains grading conclusions but also has stable and interpretable confidence information, which is beneficial for assisting clinicians in risk assessment and follow-up decisions.
[0024] This invention parses the imaging mode identifier and device identifier corresponding to the image under test during the inference stage, and calls the matching domain adaptation parameter set to complete feature generation and classification discrimination. This enables the same classification model to operate adaptively under different imaging domain conditions without having to build an independent model for each device or imaging mode. Thus, while ensuring classification consistency, it significantly improves the model's versatility and deployment feasibility in actual endoscopic examination environments. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 A flowchart of the method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram comparing the field of view of white light endoscopy and narrow-band imaging (NBI) provided in an embodiment of the present invention; Figure 3 The microstructure of the gastric mucosa under white light endoscopy and its corresponding magnified endoscopic image are provided in the embodiments of the present invention. Figure 4 This is a schematic diagram of intestinal tissue features under narrow-band imaging (M-NBI) provided in an embodiment of the present invention; Figure 5 This is a schematic diagram illustrating the appearance of different gastric microvessels and microsurface structures under NBI according to an embodiment of the present invention. Figure 6 This is a schematic diagram of the network structure provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of the system structure provided in an embodiment of the present invention. Detailed Implementation
[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0028] The purpose of this invention is to provide an AI-based image grading method and system for precancerous lesions of the stomach, which, while ensuring the accuracy of grading, reduces the impact of imaging domain differences on the grading results, thereby making the AI-based image grading of precancerous lesions of the stomach more reliable and scalable in real clinical applications.
[0029] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0030] Figure 1 The method flowchart provided in the embodiments of the present invention is as follows: Figure 1 As shown, this invention provides an AI-based imaging grading method for precancerous lesions of the stomach, comprising: Step 100: Acquire gastric endoscopic image data from at least two imaging domains and form a pre-training dataset for basic training; the imaging domain is determined by the imaging mode identifier and the device identifier. Step 200: Perform self-supervised pre-training on the initial network based on the pre-trained dataset to obtain the endoscopic basic representation network, and enable the endoscopic basic representation network to output the basic feature vector of the endoscopic image. Step 300: Obtain the target grading dataset with gastric precancerous lesion grading annotations, establish a grading label mapping relationship, unify the gastric precancerous lesion grading annotations to a preset grading sequence, and obtain a unified labeled target grading dataset. Step 400: Load lightweight incremental parameters under the condition of freezing the main parameters of the endoscopic basic characterization network, and perform domain condition fine-tuning based on the target hierarchical dataset; wherein, the domain conditions are obtained by encoding the imaging mode identifier and the device identifier to obtain a set of domain adaptation parameters that correspond one-to-one with the imaging domain. Step 500: During the fine-tuning of domain conditions, apply a grading consistency constraint to cross-imaging domain samples of the same part of the same case, so that the grading prediction distribution corresponding to the cross-imaging domain samples meets the preset stability threshold, and perform confidence calibration on the grading prediction distribution to obtain the calibrated grading discriminator. Step 600: Analyze the gastric endoscopic image to be tested to obtain the imaging mode identifier and device identifier, call the domain adaptation parameter set that matches the imaging mode identifier and device identifier to generate the feature vector to be tested, and input the feature vector to be tested into the calibrated grading discriminator to output the grading result of gastric precancerous lesions and the corresponding confidence level.
[0031] Specifically, in step 100 of this embodiment, gastric endoscopy image data from at least two imaging domains are first acquired to form a pre-training dataset for basic training, wherein the number of imaging domains is not less than two. An imaging domain refers to a set of image acquisition conditions defined by the same imaging mode identifier and the same device identifier. The imaging mode identifier characterizes the imaging mode category of the image, and the device identifier characterizes the endoscopic device source of the image. In this embodiment, corresponding acquisition metadata is acquired synchronously for each frame of gastric endoscopy image data. The acquisition metadata contains at least two types of information fields: an imaging mode information field and a device information field; and the imaging mode identifier and device identifier are extracted from the acquisition metadata. To avoid duplication or misgrouping of the same acquisition condition due to naming differences, this embodiment performs standardized encoding processing on the imaging mode identifier and device identifier, so that identifiers with the same name but different spellings are uniformly mapped to a unique standardized encoding value; for example, different spellings of the same narrowband imaging mode in different data sources are uniformly mapped to the same standardized encoding, and different spellings of the same device in different sequence number expressions are uniformly mapped to the same standardized encoding, thereby ensuring the stability and consistency of subsequent domain division.
[0032] After completing the standardized encoding, this embodiment divides the gastric endoscopic image data into imaging domains based on the standardized imaging mode identifier and device identifier. Specifically, image frames with the same standardized imaging mode identifier and the same standardized device identifier are grouped into the same imaging domain, and a domain label is written for each imaging domain to form a pre-training dataset. The domain label is used to indicate the imaging domain category to which the image frame belongs in the subsequent training stage. To ensure the traceability of the pre-training dataset at the imaging condition level, this embodiment maintains the correspondence between the image frame and its acquired metadata, so that any image frame can be traced back to the corresponding standardized imaging mode identifier and standardized device identifier through the domain label. Preferably, this embodiment sets the domain label as a combined label consisting of two segments, where the first segment corresponds to the standardized encoding of the imaging mode identifier, and the second segment corresponds to the standardized encoding of the device identifier; for example, the first segment takes a value range of 1 to 8 to distinguish different imaging modes, and the second segment takes a value range of 1 to 50 to distinguish different devices, so that different imaging domains are distinguishable from each other and do not overlap in the label space.
[0033] Preferably, to improve the effectiveness of the pre-training dataset, this embodiment further performs quality screening, patient information de-identification processing, and image frame extraction processing on the gastrointestinal endoscopic image data. The quality screening removes image frames that do not meet a preset sharpness threshold or a preset exposure threshold. The sharpness threshold limits the discernibility of image details, preferably with a sharpness rating of at least 0.30. The exposure threshold limits the overall brightness of the image to within an usable range, preferably with an effective brightness range covering 20 to 80 of the image's grayscale range. The screened image frames undergo further patient information de-identification processing to delete or obscure information fields in the image frames and their acquired metadata that can directly or indirectly identify the patient. Subsequently, this embodiment extracts image frames from the endoscopic video at preset sampling intervals to control sample redundancy. Preferably, the preset sampling interval is 1 to 10 frames per frame, more preferably 5 frames per frame. The extracted image frames are then associated and stored with their corresponding imaging mode identifiers and device identifiers, ensuring that the extracted image frames retain the identification information required for imaging domain division, thereby forming a pre-training dataset for basic training.
[0034] Figures 2 to 5 The illustrations together depict gastric endoscopic images used to construct a multi-imaging domain pre-training dataset in an embodiment of the present invention. Figure 2 The image shows a comparison of the field of view of the same gastric region under different imaging modes. The left side is the field of view of white light endoscopy, and the right side is the field of view of narrow band imaging. There are significant differences between the two in overall color distribution, mucosal texture contrast and vascular visualization. This illustrates that gastric endoscopy images acquired under different imaging mode labeling conditions constitute different imaging domains. Figure 3 The diagram shows the correspondence between white light endoscopic images and corresponding magnified endoscopic images. Figure 3 The images marked (a) and (b) represent the gastric mucosa under white light endoscopy, while the images marked (c) and (d) represent the corresponding regions under magnified endoscopy. It can be observed that the details of the mucosal microstructure and surface texture are enhanced under magnification, thus demonstrating that images acquired by the same device under different imaging modes or magnification conditions can form different imaging domains, which are used for imaging domain division in this embodiment.
[0035] Figure 4 and Figure 5 This further demonstrates the differences in gastric mucosal microstructure and microvascular features under narrow-band imaging conditions. Figure 4 The image shows a magnified narrowband imaging region of the gastric mucosa, with the left side showing the overall field of view and the right side showing a magnified partial image of a selected area. The arrows in the image are used to indicate the mucosal surface structural features revealed under narrowband imaging conditions, illustrating the technical advantages of narrowband imaging in highlighting microsurface textures. Figure 5This diagram illustrates the appearance of different gastric microvessels and microsurface structures under narrowband imaging conditions. Each sub-image is labeled "Regular," "Irregular," and "Absent" to distinguish the different structural states. Arrows indicate the corresponding microvascular or microsurface structure regions. This diagram illustrates the significant differences between images acquired under the same imaging modality but with different mucosal structures. This embodiment collects and organizes gastric endoscopic images under different imaging modalities, magnification conditions, and device labels to form a pre-training dataset for basic training, thereby providing multi-imaging domain data support for the subsequent self-supervised learning of the endoscopic basic representation network.
[0036] In step 200 of this embodiment, the initial network is subjected to self-supervised pre-training based on the pre-training dataset formed in step 100 to obtain an endoscopic basic representation network, which is then able to output a basic feature vector for the input gastric endoscopic image. Specifically, this embodiment performs two preset image enhancement processes on the same gastric endoscopic image data in the pre-training dataset to obtain a first enhanced image and a second enhanced image, respectively. The preset image enhancement types are no less than two, preferably including brightness perturbation and local cropping. The intensity of the brightness perturbation is preferably fluctuating by 10 to 30% above and below the original brightness to create a controllable difference in overall brightness between the first enhanced image and the second enhanced image; the cropping ratio of the local cropping is preferably 60% to 90% of the original image area to create a controllable difference in local visual field between the first enhanced image and the second enhanced image. Subsequently, in this embodiment, the first enhanced image and the second enhanced image are respectively input into the initial network to obtain the first basic feature vector and the second basic feature vector. The dimension of the basic feature vector is preferably 128 to 1024, which is used to characterize the mucosal texture structure and micro-surface information of the gastric endoscopy image and serve as the general representation output for subsequent graded training.
[0037] After obtaining the first and second basic feature vectors, this embodiment constructs a self-supervised training objective based on them, ensuring that the first and second basic feature vectors corresponding to the same original image satisfy a preset similarity constraint in the feature space, while ensuring that the basic feature vectors corresponding to different original images satisfy a preset separability constraint. The preset similarity constraint is used to limit the difference between the basic feature vectors of the same image under different enhancement conditions to a preset similarity threshold, which is preferably 0.10 to 0.30. The preset separability constraint is used to maintain a preset interval between the basic feature vectors corresponding to different images, which is preferably 0.20 to 0.60, thereby avoiding characterization collapse and maintaining the ability to distinguish mucosal differences. In this embodiment, the parameters of the initial network are iteratively updated according to the self-supervised training objective. The number of training rounds is preferably 50 to 300, and the number of batch samples is preferably 16 to 128. When the change of the self-supervised training objective is less than 0.01 within 10 consecutive evaluation periods, it is determined that the convergence condition is met and the endoscopic basic representation network is obtained. Then, the endoscopic basic representation network is solidified into a network model for outputting basic feature vectors for subsequent steps.
[0038] Optionally, in step 300 of this embodiment, a target grading dataset with grading annotations for precancerous lesions of the stomach is obtained, and the grading annotations in the target grading dataset are standardized to obtain a standardized target grading dataset. The target grading dataset consists of gastric endoscopic image samples and original grading annotations corresponding one-to-one with each image sample. The original grading annotations are the grading results of precancerous lesions of the stomach used in existing clinical practice or research, and their expression can be in the form of text level, category name, or number identifier. To make the grading annotations from different sources and under different standards comparable and computable, this embodiment first determines a preset grading sequence. The preset grading sequence is defined as an ordered integer sequence arranged in ascending order of severity of precancerous lesions of the stomach. The number of values in the ordered integer sequence is not less than 3, preferably 3 to 6, to cover the grading range of precancerous lesions of the stomach from low-risk to high-risk states.
[0039] After determining the preset grading sequence, this embodiment reads the corresponding original grading annotations for each image sample in the target grading dataset and establishes a mapping rule for the original grading annotations to the ordered integer sequence, thereby forming a grading label mapping relationship. The mapping rule is based on the principle of consistency in lesion severity, mapping original grading annotations representing the same or similar lesion severity to the same integer sequence number. For example, in the original grading annotations, the annotation representing no or slight precancerous changes in the gastric cancer is mapped to the smallest sequence number in the ordered integer sequence, the annotation representing moderate precancerous changes in the gastric cancer is mapped to an intermediate sequence number, and the annotation representing severe precancerous changes in the gastric cancer or a highly abnormal state is mapped to the largest sequence number in the ordered integer sequence. When the original grading annotations contain multi-level descriptions, it is preferable to map them sequentially to continuously increasing integer sequences according to the order of lesion severity from mild to severe, thereby ensuring that the size relationship of the mapped sequence numbers reflects the progressive relationship of lesion severity. Through the above method, this embodiment ensures that original grading annotations with different expressions all fall into the same ordered integer sequence after mapping.
[0040] After establishing the hierarchical label mapping relationship, this embodiment converts the original hierarchical labels corresponding to each image sample in the target hierarchical dataset into sequence labels in the preset hierarchical sequence based on the hierarchical label mapping relationship, and associates and stores the sequence labels with the corresponding image samples to form a target hierarchical dataset with unified labels. Preferably, the sequence labels are stored in integer form along with the index information of the image samples, so that any image sample can directly reflect the corresponding gastric precancerous lesion grade through its sequence label; at the same time, by maintaining the fixed definition of the ordered integer sequence, this embodiment can ensure that the hierarchical labels of different image samples have a consistent scale and clear order relationship in the subsequent training and inference process, thereby providing a reliable data foundation for subsequent model training and discrimination based on hierarchical sequences.
[0041] Optionally, in step 400 of this embodiment, under the condition of freezing the main parameters of the endoscopic basic representation network, lightweight incremental parameters are introduced and domain-conditional fine-tuning is performed based on the target grading dataset to obtain grading capabilities adapted to different imaging domains. Specifically, in this embodiment, a lightweight incremental parameter layer is inserted after the preset network layer of the endoscopic basic representation network. The preset network layer is a network layer that outputs a basic feature vector, the output of which is the basic feature vector obtained in step 200. The lightweight incremental parameter layer includes a first trainable parameter and a second trainable parameter. The first trainable parameter is used to perform a linear transformation on the basic feature vector to compensate for the overall shift in feature distribution under different imaging domains. The second trainable parameter is used to perform a nonlinear mapping on the feature result after the linear transformation to enhance the ability to express local feature changes caused by differences in imaging domains. Preferably, the parameter size of the lightweight incremental parameter layer is significantly smaller than the main parameter size of the endoscopic basic representation network, so that the subsequent training process focuses on imaging domain adaptation without destroying the learned general representation capabilities.
[0042] After loading the lightweight incremental parameter layer, this embodiment performs a parameter freezing process on the parameters of the endoscopic basic representation network, that is, freezing all network parameters in the endoscopic basic representation network except for the lightweight incremental parameter layer, so that they remain unchanged during the domain condition fine-tuning process. Subsequently, only the first trainable parameter and the second trainable parameter are updated, and the target grading dataset obtained in step 300 is used as training data to perform grading-supervised parameter adjustment, thereby completing the domain condition fine-tuning. In this way, this embodiment achieves feature adaptation for different imaging domain conditions without changing the main structure and parameters of the endoscopic basic representation network, so that the grading-related information is mainly adjusted by the lightweight incremental parameter layer, thereby avoiding the representation degradation that may be caused by updating the entire network on a small-scale target grading dataset.
[0043] Preferably, in this embodiment, the domain conditions are jointly determined by the imaging mode identifier and the device identifier. Specifically, the imaging mode identifier is mapped to a first domain encoding vector, and the device identifier is mapped to a second domain encoding vector. The first domain encoding vector is used to characterize the imaging mode differences of the image, and the second domain encoding vector is used to characterize the device source differences of the image. Based on this, the first domain encoding vector and the second domain encoding vector are combined to generate a vector of domain conditions, which is used to uniquely identify an imaging domain. Subsequently, in this embodiment, based on the vector of domain conditions, a set of domain adaptation parameters corresponding one-to-one with the imaging domain is selected from a preset parameter index table, and the set of domain adaptation parameters is loaded into the lightweight incremental parameters, so that the lightweight incremental parameters participate in feature transformation and hierarchical training under the current imaging domain conditions. Through the above-described domain condition determination and parameter selection method, this embodiment can form mutually independent sets of domain adaptation parameters for different imaging modes and different device combinations, thereby achieving stable adaptation of hierarchical models under multiple imaging domain conditions.
[0044] like Figure 6 As shown, Figure 6This invention illustrates a schematic flow and network structure for obtaining an endoscopic basic characterization network in an embodiment of the invention. The terms "Locally advanced rectal cancer patient," "Pre-treatment endoscopy examination," "Neoadjuvant chemoradiotherapy," "Radical surgery," "Evaluation for tumor regression," and "GR or non-GR" on the left represent an exemplary clinical examination and result labeling flow, illustrating that endoscopic image data and label data originate from the examination and evaluation stages. This invention does not limit the disease type of the examined subject or the specific meaning of the labels, but rather illustrates that image data can be obtained from endoscopic examinations and used to form samples for training. The right side shows a schematic diagram of the endoscopic basic representation network structure. The network receives endoscopic images in RGB format as input, generates channel weights through Channel Attention to obtain a weighted feature map, and then enters the Feature Extraction stage where features are extracted step by step by the ResNet residual structure. The residual module is represented by Residual k, which contains 3×3 k and 1×1 k feature transformation structures. At different stages, Residual 64, Residual 128, Residual 256, and Residual 512 represent feature abstraction processes of different channel scales. After that, the features are aggregated through Dropout and Full Connect and the results are output in Output. In this embodiment of the invention, the ResNet and its residual stage are only used as a structural example of the endoscopic basic representation network to illustrate that in step 200, the endoscopic basic representation network that can output basic feature vectors is obtained through self-supervised pre-training, and provides a general representation for the domain condition fine-tuning and gastric precancerous lesion grading in subsequent steps.
[0045] Further, step 500 of this embodiment includes: In step 500 of this embodiment, during the domain condition fine-tuning process, cross-imaging domain pairing relationships are established for the same location of the same case to obtain cross-imaging domain sample pairs. Specifically, for the same location of the same case, image samples from at least two imaging domains are selected as a set of cross-imaging domain sample pairs, and the cross-imaging domain sample pairs are respectively input into the domain condition-fine-tuned network to obtain the corresponding probability distributions. The hierarchical prediction distribution can be represented as the probability output of each level of the preset hierarchical sequence, denoted as the first hierarchical prediction distribution and the second hierarchical prediction distribution, respectively, and their expressions are:
[0046] in, The hierarchical prediction distribution corresponding to the first image sample in a cross-imaging domain sample pair; The hierarchical prediction distribution corresponding to the second image sample in a cross-imaging domain sample pair; The first image sample was determined to be the first Level of prediction probability The second image sample was determined to be the first The predicted probability at the level; The number of levels in the preset hierarchical sequence is given, and each predicted probability satisfies the normalization condition that the sum of all levels is 1 and the value range is 0 to 1.
[0047] After obtaining the first hierarchical prediction distribution and the second hierarchical prediction distribution, this embodiment calculates the distribution difference between the two as the consistency loss, and combines the consistency loss with the hierarchical supervision loss to form the training objective. Preferably, the distribution difference is calculated using symmetric divergence, and the expression for its consistency loss is:
[0048] in, This results in a loss of consistency. For natural logarithm operations; To prevent stable terms with a denominator of 0, the value should be a constant greater than D, preferably 10. -6 ; , and The meaning is the same as above. Furthermore, in this embodiment, the consistency loss and hierarchical supervision loss are jointly used to constitute the training objective, and the distribution difference is optimized to ensure it is no greater than a preset stability threshold. The expression for the joint training objective is:
[0049] in, For joint training objectives; This is the hierarchical supervision loss, used to constrain the consistency between the hierarchical prediction distribution and the preset hierarchical sequence labeling; This represents a loss of consistency. Preferably, in this embodiment, the preset stability threshold is denoted as... and with As a criterion for satisfying hierarchical stability across imaging domains:
[0050] in, A preset stability threshold is used to limit the upper limit of the hierarchical prediction distribution difference of sample pairs across imaging domains, and The value is a constant greater than 0. Preferably, in this embodiment, after completing the consistency constraint training, confidence calibration is performed on the hierarchical prediction distribution to obtain the calibrated hierarchical discriminator. Specifically, a calibration dataset is obtained from the target hierarchical dataset. The calibration dataset includes image samples and the corresponding preset hierarchical sequence labels; and confidence calibration parameters are determined based on the calibration dataset so that the hierarchical prediction distribution transformed by the confidence calibration parameters and the preset hierarchical sequence labels meet the threshold condition under the preset calibration error index. Preferably, this embodiment uses a temperature scaling method for confidence calibration. First, the network outputs the unnormalized score vectors of each level, denoted as:
[0051] in, This is an unnormalized score vector; For the first The unnormalized score corresponding to the level; The number of levels in the preset hierarchical sequence is given. The unnormalized score vector is transformed by the temperature parameter and then normalized to obtain the calibrated hierarchical prediction distribution, whose expression is:
[0052] in, The first after confidence level calibration Level prediction probability; For exponentiation; It is a temperature parameter and a real number greater than 0, used to adjust the confidence level of the predicted distribution; For the first The unnormalized score of the level; The number of levels in the preset hierarchical sequence; For the level index. The temperature parameter is determined based on the calibration dataset, such that the calibrated prediction result meets a threshold condition under a preset calibration error index. The preset calibration error index is preferably negative log-likelihood, and its expression is:
[0053] in, For calibration error indicators; To calibrate the number of samples in the dataset; For sample index; For the first The level number of the preset hierarchical sequence labeling corresponding to each sample; For the first Each sample, after confidence level calibration, is assigned a true rating. The predicted probability; This is a natural logarithm operation. Ultimately, in this embodiment, the temperature parameter is embedded into the grading discriminator, so that the corresponding confidence level is determined by the calibrated grading prediction distribution. Preferably, the corresponding confidence level is the maximum probability value in the calibrated grading prediction distribution, and its expression is:
[0054] in, For the corresponding confidence level; The first after confidence level calibration Level prediction probability; The number of levels in the preset hierarchical sequence.
[0055] In step 600 of this embodiment, a hierarchical inference process is performed on the gastric endoscopic image to be tested to output the grading result of precancerous lesions of the stomach and the corresponding confidence level. Specifically, this embodiment first parses the corresponding acquisition metadata of the gastric endoscopic image to be tested, and extracts the imaging mode identifier and device identifier from the acquisition metadata. The imaging mode identifier is used to characterize the imaging mode category of the gastric endoscopic image to be tested, and the device identifier is used to characterize the source of the endoscopic equipment that acquired the gastric endoscopic image to be tested. Through the above parsing process, this embodiment can determine the imaging domain to which the gastric endoscopic image to be tested belongs, providing a basis for the selection of subsequent domain adaptation parameters.
[0056] After determining the imaging mode identifier and the device identifier, this embodiment, based on the imaging mode identifier and the device identifier, calls a domain adaptation parameter set matching the current imaging domain from a pre-constructed domain adaptation parameter set, and loads the domain adaptation parameter set into the lightweight incremental parameter position in the endoscopic basic representation network. Subsequently, the gastric endoscopic image to be tested is input into the endoscopic basic representation network after loading the domain adaptation parameter set to generate the test feature vector corresponding to the gastric endoscopic image to be tested. The test feature vector is the basic representation result of the gastric endoscopic image to be tested under the current imaging domain conditions, and its dimension is consistent with the basic feature vector obtained in step 200, thereby ensuring the input consistency of the subsequent grading and discrimination process.
[0057] After obtaining the feature vector to be tested, this embodiment inputs the feature vector to be tested into the calibrated grading discriminator obtained in step 500 to perform grading discrimination of gastric precancerous lesions. The calibrated grading discriminator outputs the grading result of gastric precancerous lesions corresponding to the tested gastric endoscopic image based on the grading prediction distribution calibrated with confidence, and simultaneously outputs the confidence level corresponding to the grading result, wherein the confidence level is used to characterize the credibility of the grading result. By introducing a set of domain adaptation parameters matching the imaging domain in the inference stage and using a calibrated grading discriminator, this embodiment can stably output grading results and confidence levels of a consistent scale under different imaging modes and different device conditions, thereby completing the AI image grading of gastric precancerous lesions of the tested gastric endoscopic image.
[0058] Corresponding to the above methods, such as Figure 7 As shown, this embodiment also provides an AI-based imaging grading system for precancerous lesions of the stomach, including: The imaging domain data acquisition unit is used to acquire gastric endoscopic image data from at least two imaging domains and form a pre-training dataset for basic training; the imaging domain is determined by the imaging mode identifier and the device identifier. The basic representation self-supervised training unit is used to perform self-supervised pre-training on the initial network based on the pre-training dataset to obtain the endoscopic basic representation network, and enable the endoscopic basic representation network to output the basic feature vector of the endoscopic image. The hierarchical labeling unified mapping unit is used to obtain the target hierarchical dataset with hierarchical labels of gastric precancerous lesions, establish hierarchical label mapping relationship, unify the hierarchical labels of gastric precancerous lesions into a preset hierarchical sequence, and obtain the target hierarchical dataset with unified labeling. The domain condition fine-tuning and parameter adaptation unit is used to load lightweight incremental parameters under the condition of freezing the main parameters of the endoscopic basic characterization network and perform domain condition fine-tuning based on the target hierarchical dataset; wherein, the domain condition is encoded by imaging mode identifier and device identifier to obtain a set of domain adaptation parameters that correspond one-to-one with the imaging domain. The cross-imaging domain grading consistency constraint and calibration unit is used to apply grading consistency constraints to cross-imaging domain samples of the same site of the same case during the domain condition fine-tuning process, so that the grading prediction distribution corresponding to the cross-imaging domain samples meets the preset stability threshold, and performs confidence calibration on the grading prediction distribution to obtain the calibrated grading discriminator. The hierarchical reasoning and result output unit is used to analyze the gastric endoscopic image to obtain the imaging mode identifier and device identifier, call the domain adaptation parameter set that matches the imaging mode identifier and device identifier to generate the feature vector to be tested, and input the feature vector to be tested into the calibrated hierarchical discriminator to output the hierarchical result of gastric precancerous lesion and the corresponding confidence level.
[0059] The beneficial effects of this invention are as follows: (1) This invention addresses the problem of unstable grading results in endoscopic images of precancerous gastric lesions under different imaging modes and equipment conditions. It proposes a grading method centered on an endoscopic basic representation network, combined with self-supervised pre-training across multiple imaging domains and domain condition adaptation. By performing self-supervised training on endoscopic images across multiple imaging domains without relying on manual grading annotation, this invention enables the endoscopic basic representation network to learn general representations that are weakly correlated with specific imaging conditions but strongly correlated with gastric mucosal structural features. This reduces the interference of imaging mode and equipment differences on grading discrimination from the source, providing a stable and reliable feature foundation for subsequent grading tasks.
[0060] (2) This invention does not adopt the conventional technical approach of fine-tuning the entire basic network. Instead, it introduces lightweight incremental parameters and performs targeted fine-tuning based on imaging domain conditions, while freezing the main parameters of the endoscopic basic representation network. This concentrates the adaptation capability of imaging domain differences into a small number of parameters. This structural separation method avoids the feature drift problem caused by repeated adjustments to the entire network under limited graded sample conditions. It decouples the basic representation capability from the imaging domain adaptation capability at the network structure level, demonstrating a technical concept that is different from traditional transfer learning methods.
[0061] (3) This invention further introduces cross-imaging domain grading consistency constraints during the domain condition fine-tuning process, explicitly associating image samples of the same case and the same location in different imaging domains, and using the difference between the grading prediction distributions as the constraint target, thereby suppressing the fluctuation of grading results with changes in imaging conditions from the training mechanism. This consistency constraint is not a simple data augmentation or sample duplication, but rather directly embeds the medical prior that "the same real lesion should have a consistent grading" into the model optimization process, thereby significantly improving the consistency and reproducibility of grading results in multi-device, multi-modal endoscopic environments.
[0062] (4) After completing the training of the grading model, this invention performs confidence calibration on the grading prediction distribution to ensure that the confidence level of the model output can truly reflect the uncertainty level of the grading results, avoiding high-confidence but unreliable grading outputs. This design enables the grading results of this invention to not only have clear grading determinations but also have reliable quantification capabilities, thereby providing more robust auxiliary information for clinical risk assessment and follow-up decisions, which is different from conventional grading methods that only output grading labels and cannot reflect the reliability of predictions.
[0063] (5) This invention parses the imaging mode identifier and device identifier of the image under test during the inference stage and calls the matching domain adaptation parameter set to complete feature generation and classification discrimination. This enables the same classification model to operate adaptively under different imaging domain conditions without having to build an independent model for each device or imaging mode. This overall technical solution significantly reduces the complexity of model deployment and maintenance while ensuring the consistency and stability of classification discrimination, demonstrating significant technological advancement in real clinical endoscopic application scenarios.
[0064] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.
[0065] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A gastric precancerous lesion AI image grading method, characterized by, include: Acquire gastric endoscopic image data from at least two imaging domains and form a pre-training dataset for basic training; the imaging domains are jointly determined by imaging mode identifiers and device identifiers; Based on the pre-training dataset, the initial network is self-supervised pre-training to obtain the endoscopic basic representation network, and the endoscopic basic representation network is able to output the basic feature vector of the endoscopic image. Obtain a target grading dataset with grading annotations for precancerous lesions of the stomach, establish a grading label mapping relationship, unify the grading annotations for precancerous lesions of the stomach to a preset grading sequence, and obtain the target grading dataset with unified annotations. Lightweight incremental parameters are loaded while freezing the main parameters of the endoscopic basic characterization network, and domain condition fine-tuning is performed based on the target hierarchical dataset; wherein the domain conditions are encoded by the imaging mode identifier and the device identifier to obtain a set of domain adaptation parameters that correspond one-to-one with the imaging domain. During the fine-tuning of the domain conditions, a grading consistency constraint is applied to cross-imaging domain samples of the same part of the same case, so that the grading prediction distribution corresponding to the cross-imaging domain samples meets a preset stability threshold, and confidence calibration is performed on the grading prediction distribution to obtain a calibrated grading discriminator. The imaging mode identifier and the device identifier are obtained by analyzing the gastric endoscopic image to be tested. The domain adaptation parameter set that matches the imaging mode identifier and the device identifier is called to generate the feature vector to be tested. The feature vector to be tested is input into the calibrated grading discriminator and the grading result of gastric precancerous lesions and the corresponding confidence level are output.
2. The AI imaging grading method for precancerous lesions of the stomach according to claim 1, characterized in that, Acquire gastric endoscopic image data from at least two imaging domains and form a pre-training dataset for basic training, including: Acquire the metadata corresponding to each frame of the gastrointestinal endoscopic image data; Extract the imaging mode identifier and the device identifier from the acquired metadata; Standardized encoding is performed on the imaging mode identifier and the device identifier to eliminate duplicate names; Based on the standardized imaging mode identifier and the device identifier, the gastrointestinal endoscopic image data is divided into multiple imaging domains, and a corresponding domain label is written for each imaging domain to form the pre-trained dataset.
3. The AI imaging grading method for precancerous lesions of the stomach according to claim 1, characterized in that, Acquire gastric endoscopic image data from at least two imaging domains and form a pre-training dataset for basic training, including: The gastrointestinal endoscopic image data is subjected to quality screening to remove image frames that do not meet the preset sharpness threshold or the preset exposure threshold. Patient information de-identification processing is performed on the filtered gastric endoscopic image data; Image frames are extracted from the endoscopic video at preset sampling intervals and associated with the corresponding imaging mode identifier and device identifier to form the pre-training dataset.
4. The AI imaging grading method for precancerous lesions of the stomach according to claim 1, characterized in that, Based on the pre-trained dataset, the initial network is subjected to self-supervised pre-training to obtain the endoscopic basic representation network, including: Two preset image enhancement methods are applied to the same gastric endoscopic image data to obtain a first enhanced image and a second enhanced image; The first enhanced image and the second enhanced image are respectively input into the initial network to obtain the first basic feature vector and the second basic feature vector; A self-supervised training objective is constructed based on the first basic feature vector and the second basic feature vector, so that the first basic feature vector and the second basic feature vector satisfy a preset similarity constraint in the feature space, and at the same time, the basic feature vectors corresponding to different images satisfy a preset separability constraint. The parameters of the initial network are iteratively updated according to the self-supervised training objective to obtain the endoscopic basic representation network.
5. The AI imaging grading method for precancerous lesions of the stomach according to claim 1, characterized in that, Establish a hierarchical label mapping relationship, unify the hierarchical labeling of the precancerous lesions of the stomach into a preset hierarchical sequence, and obtain the target hierarchical dataset with unified labeling, including: The preset grading sequence is determined to be an ordered integer sequence arranged in ascending order of lesion severity; Obtain the original classification label for each sample in the target classification dataset; Establish mapping rules from the original hierarchical labels to the ordered integer sequence and form the hierarchical label mapping relationship; Based on the hierarchical label mapping relationship, the original hierarchical annotations are converted into sequence labels in the preset hierarchical sequence, and the sequence labels are associated with and stored with the corresponding image samples to obtain the target hierarchical dataset with unified annotation.
6. The AI imaging grading method for precancerous lesions of the stomach according to claim 1, characterized in that, Lightweight incremental parameters are loaded while freezing the principal parameters of the endoscopic baseline representation network, and domain-conditional fine-tuning is performed based on the target hierarchical dataset, including: A lightweight incremental parameter layer is inserted after the preset network layer of the endoscopic basic representation network; the lightweight incremental parameter layer includes a first trainable parameter for linearly transforming the basic feature vector and a second trainable parameter for nonlinearly mapping the result of the linear transformation. Freeze the network parameters of the endoscopic basic characterization network except for the lightweight incremental parameter layer; Only the first trainable parameter and the second trainable parameter are updated to complete the domain condition fine-tuning.
7. The AI imaging grading method for precancerous lesions of the stomach according to claim 1, characterized in that, The domain conditions are determined as follows: The imaging mode identifier is mapped to a first domain encoding vector, and the device identifier is mapped to a second domain encoding vector; Generate the vector of the domain conditions based on the first domain encoding vector and the second domain encoding vector; Based on the vector of the domain conditions, select the set of domain adaptation parameters that correspond one-to-one with the imaging domain from the preset parameter index table, and load the set of domain adaptation parameters into the lightweight incremental parameters for fine-tuning of the domain conditions.
8. The AI imaging grading method for precancerous lesions of the stomach according to claim 1, characterized in that, During the fine-tuning of the domain conditions, hierarchical consistency constraints are applied to cross-imaging domain samples of the same site in the same case, including: Establish cross-imaging domain pairing relationships for samples belonging to the same part of the same case in the target hierarchical dataset to obtain cross-imaging domain sample pairs; The cross-imaging domain sample pairs are respectively input into the network that has been fine-tuned by the domain conditions to obtain the corresponding hierarchical prediction distribution; The distributional differences between the hierarchical prediction distributions are calculated as the consistency loss. The consistency loss and hierarchical supervision loss are combined to form the training objective, and the training objective is optimized so that the distribution difference is not greater than the preset stability threshold.
9. The AI imaging grading method for precancerous lesions of the stomach according to claim 1, characterized in that, Perform confidence calibration on the hierarchical prediction distribution to obtain a calibrated hierarchical discriminator, including: A calibration dataset is obtained by dividing the target hierarchical dataset; the calibration dataset includes image samples and the preset hierarchical sequence annotations corresponding to the image samples; Based on the calibration dataset, confidence calibration parameters are determined so that the hierarchical prediction distribution transformed by the confidence calibration parameters and the preset hierarchical sequence label meet the threshold condition under the preset calibration error index. The confidence level calibration parameters are embedded into the grading discriminator to obtain the calibrated grading discriminator, and the corresponding confidence level is determined by the calibrated grading prediction distribution.
10. An AI-based imaging grading system for precancerous lesions of the stomach, characterized in that, include: An imaging domain data acquisition unit is used to acquire gastric endoscopic image data from at least two imaging domains and form a pre-training dataset for basic training; the imaging domain is determined by both the imaging mode identifier and the device identifier. The basic representation self-supervised training unit is used to perform self-supervised pre-training on the initial network based on the pre-training dataset to obtain the endoscopic basic representation network, and enable the endoscopic basic representation network to output the basic feature vector of the endoscopic image. The hierarchical labeling and mapping unit is used to obtain a target hierarchical dataset with hierarchical labels for precancerous lesions of the stomach, establish a hierarchical label mapping relationship, unify the hierarchical labels for precancerous lesions of the stomach into a preset hierarchical sequence, and obtain the target hierarchical dataset with unified labeling. The domain condition fine-tuning and parameter adaptation unit is used to load lightweight incremental parameters under the condition of freezing the main parameters of the endoscopic basic characterization network, and to perform domain condition fine-tuning based on the target hierarchical dataset; wherein, the domain condition is encoded by the imaging mode identifier and the device identifier to obtain a set of domain adaptation parameters that correspond one-to-one with the imaging domain. A cross-imaging domain grading consistency constraint and calibration unit is used to apply grading consistency constraints to cross-imaging domain samples of the same part of the same case during the fine-tuning of the domain conditions, so that the grading prediction distribution corresponding to the cross-imaging domain samples meets a preset stability threshold, and to perform confidence calibration on the grading prediction distribution to obtain a calibrated grading discriminator. The hierarchical reasoning and result output unit is used to analyze the gastric endoscopic image to be tested to obtain the imaging mode identifier and the device identifier, call the domain adaptation parameter set that matches the imaging mode identifier and the device identifier to generate the feature vector to be tested, and input the feature vector to be tested into the calibrated hierarchical discriminator to output the hierarchical result of gastric precancerous lesion and the corresponding confidence level.