A computer vision-based image processing method and system
By using standardized rules and domain adaptation driven by device domain labels, the problems of insufficient clarity and domain drift caused by the mixed use of devices in mobile fundus screening are solved, and unified processing and reliable segmentation results of fundus images under different devices are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHICHUANGYUN (BEIJING) TECH CO LTD
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-09
Smart Images

Figure CN122175942A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, specifically to an image processing method and system based on computer vision. Background Technology
[0002] In mobile fundus screening applications, primary healthcare institutions commonly use multiple brands and models of equipment, resulting in insufficient clarity due to inconsistent shooting postures and lighting conditions, differences in field of view and imaging color between different devices, and domain drift caused by inconsistencies between training data and the distribution of real populations and devices. These issues lead to inconsistent output results for the same subject under different devices and quality conditions.
[0003] Current technologies typically assess the quality of acquired fundus images based on metrics such as sharpness, exposure, and field of view coverage. Images below a certain threshold are marked as unusable and prompted for re-taking. For usable images, traditional enhancements such as contrast-limited adaptive histogram equalization, histogram equalization, and brightness and color correction are applied. Learning-based enhancement networks are used to improve visibility, and the images are normalized. Deep models such as Transformer are used to classify, detect, and segment lesions.
[0004] However, in grassroots screening scenarios where multiple devices are used, low-quality images coexist, and domain drift exists, the quality assessment often uses a single threshold rule, which cannot distinguish the impact of device imaging differences on the actual lesion surface. This leads to inconsistent usability judgments for the same lesion on different devices. At the same time, enhancement and normalization often aim to improve visibility without establishing constraints on color and field of view consistency across devices. When the enhancement process changes the local texture and color distribution, it directly changes the downstream detection input distribution, thereby exacerbating the domain drift problem. Summary of the Invention
[0005] In view of the existing problems mentioned above, a computer vision-based image processing method and system are proposed.
[0006] The technical solution adopted by the present invention to at least partially solve the above-mentioned technical problems is: an image processing method based on computer vision, comprising:
[0007] Acquire fundus images and device metadata from different devices, perform visual field localization, black border cropping and resolution normalization on the fundus images to obtain preprocessed images;
[0008] Based on the device metadata, device feature vectors are extracted, and device identification is performed in combination with preprocessed images to generate device domain labels. Sharpness, exposure uniformity, glare intensity, and field of view coverage are calculated. Based on the device domain labels, a set of device-related thresholds is established to generate quality control scores.
[0009] Based on the device domain label and quality control score, the preprocessed image is standardized, and the standardized image and artifact mask are output. The device domain label is used as the domain condition input to adapt the execution conditions of the basic representation encoder, and the domain robust features are output.
[0010] Based on standardized images and domain robust features, anatomical structure and lesion features are generated, and the joint segmentation results of anatomical structure and lesion features are output through a cross-branch feature fusion mechanism.
[0011] Confidence scores are calculated based on quality control scores, artifact masks, and joint segmentation results. Conformal prediction is used to determine the usability threshold. When the confidence score does not meet the threshold, a retake instruction is output. When the threshold is met, the segmentation result and clinical decision are output. Image distribution drift is monitored in real time. When the drift exceeds the threshold, the domain adaptation parameters are updated.
[0012] As a preferred embodiment, the acquisition of fundus images and device metadata collected by different devices includes:
[0013] The system receives raw fundus image data and corresponding device metadata from a fundus imaging device. It binds the raw fundus image data and device metadata into a single acquisition record, unifies the pixel format of the raw fundus image data, decodes the input JPEG-compressed image into an RGB three-channel matrix, and converts it into a unified color space to obtain a color fundus image. It calculates a brightness map on the color fundus image and performs visual field localization on the brightness map. It generates a candidate binary mask for the visual field on the entire image, performs connected component analysis on the mask, selects the connected component with the largest area as the main visual field region, and calculates the bounding rectangle of the main visual field region.
[0014] The visual field cropping map is obtained by cropping the circumscribed rectangle on the color fundus image. Before cropping, a fixed boundary protection is applied to the circumscribed rectangle. After obtaining the visual field cropping map, black edge cropping is performed. The visual field cropping map is scanned row by row and column by column around its four edges to identify edge rows and edge columns with a continuous low brightness pixel ratio exceeding a preset ratio. Edge rows and edge columns that meet the conditions are determined as black edges. Black edge rows and black edge columns are removed in order from the outside to the inside to obtain the black edge removed image.
[0015] As a preferred embodiment, the process of performing visual field localization, black border cropping, and resolution normalization on the fundus image includes:
[0016] Resolution normalization is performed, and a scaling factor is determined based on the width and height of the black-bordered image. The black-bordered image is scaled proportionally and then padded or truncated to ensure that the output image meets the target input resolution requirements, resulting in a preprocessed image. The preprocessed image and the device metadata bound to it are output, and the bounding rectangle obtained from the field of view localization is output as the index for subsequent localization. If the field of view localization fails to obtain a connected component or the bounding rectangle is empty, the acquisition record is marked as a field of view localization failure, and an empty preprocessed image placeholder is output to terminate the subsequent processing link.
[0017] In a preferred embodiment, the generation of device domain labels and quality control scores respectively include:
[0018] The device metadata is parsed by field parsing and structure parsing. Discrete fields are converted into numerical expressions of uniform length according to preset encoding rules, and continuous fields are converted into numerical expressions according to preset normalization rules. The data are then concatenated to form a device feature vector based on the metadata.
[0019] Based on the preprocessed image, device-related image-side features are generated. These features include brightness distribution features, color channel statistical features, and view boundary morphology features obtained statistically within the view area. The device feature vector based on metadata is fused with the image-side features to obtain a joint device feature vector. This joint device feature vector is then input into a device recognition model to obtain a device domain label, and a device domain label is generated simultaneously. When the device metadata contains a usable device identifier, the device domain label is used as a constraint for consistency verification. If the verification is inconsistent, the image is marked as a device domain pending confirmation.
[0020] After obtaining the device domain label, image quality control calculations are performed to obtain sharpness, illumination consistency, occlusion artifact, and field of view integrity indices. These four indices are combined into a quality index set, which is then bound to the device domain label and written into the current quality control record. Based on the device domain label, a device-related threshold set corresponding to that label is retrieved from the threshold library. The quality index set is then subjected to device-related normalization mapping based on the device-related threshold set, yielding sharpness, illumination consistency, artifact, and field of view integrity sub-scores. These sub-scores are then synthesized into a quality control score according to a preset fusion rule. The quality control score formula is as follows:
[0021] ,
[0022] in This indicates the overall quality control score. This indicates the score for the clarity sub-item. This indicates the score for the exposure uniformity sub-item. This indicates the score for glare intensity. This indicates the score for the field of view coverage item.
[0023] In a preferred embodiment, the step of adapting the device domain label as a domain condition input to the basic representation encoder to perform conditional adaptation, and outputting domain robust features, includes:
[0024] Based on the device domain label, the standardized configuration items corresponding to the device domain are retrieved from the pre-set standardized rule base. The standardized configuration items include color mapping method, brightness correction method and vignetting correction method. The standardized processing is divided into preset processing levels according to the quality control score. The processing level and the standardized configuration items are jointly determined as the standardized process for this processing. The processing level is set as light standardization level, medium standardization level and strong standardization level.
[0025] Brightness correction is performed on the preprocessed image, converting it into a separate representation of the brightness and chroma channels. Background field estimation is performed on the brightness channel within the field of view, generating an illumination field map. The brightness channel is then normalized according to the brightness field map to suppress non-uniform illumination. After brightness correction, color normalization is performed. Based on the color mapping rules corresponding to the device domain label, each color channel is linearly mapped according to channel gain and bias, and the mapped pixel values are truncated to maintain a consistent numerical range. Vignetting correction is performed by generating a vignetting compensation factor map based on radial distance within the field of view, and using this compensation factor map to multiplicatively correct the image brightness, resulting in a normalized image.
[0026] High-brightness reflection artifacts and low-brightness occlusion artifacts are detected within the field of view of a standardized image. The high-brightness reflection artifact regions and low-brightness occlusion artifact regions are merged into a unified artifact candidate region to obtain an artifact mask. Domain robust feature adaptation is performed. The basic representation encoder model is called to perform forward encoding on the standardized image to obtain a basic feature map. The device domain label is embedded and mapped to obtain a domain condition vector. The domain condition vector is input into the condition adaptation model, and the basic feature map is subjected to channel-wise scaling and translation modulation to obtain domain robust features. The condition adaptation model maps the device domain label to the domain condition vector, generates channel-wise scaling and translation coefficients through a fully connected layer, and performs scaling and translation modulation on the basic feature map channel by channel to output domain robust features.
[0027] The output includes a standardized image, artifact mask, and domain robust features. The device domain label and quality control score are written into the processing record as binding information for this output.
[0028] As a preferred implementation, the generation of anatomical structures and lesion features based on standardized images and domain robust features includes:
[0029] The system receives a standardized image and domain robust features, and outputs a joint segmentation result including anatomical structure and lesion features through a two-branch joint segmentation network. The two-branch joint segmentation network includes an anatomical structure segmentation branch and a lesion segmentation branch. The anatomical structure features are obtained by inputting the standardized image into the anatomical structure segmentation branch, and the lesion features are obtained by inputting the domain robust features into the lesion segmentation branch.
[0030] A cross-branch feature fusion mechanism is executed at each corresponding scale. The cross-branch feature fusion mechanism includes bidirectional information exchange and fusion alignment. For anatomical structures and lesion features at the same scale, spatial size alignment is first performed, and then they are stitched together in the channel dimension. The stitched features are then mapped to a unified number of channels through a point convolution layer to obtain fused features. In the decoding path of the structure branch, the fused features are used as skip connection inputs and merged with upsampled features to restore spatial resolution step by step and output a probability map of structure segmentation. In the decoding path of the lesion branch, the fused features are also used as skip connection inputs and merged with upsampled features to restore spatial resolution step by step and output a probability map of lesion segmentation.
[0031] As a preferred embodiment, the joint segmentation result of the output structure and the lesion includes:
[0032] A joint output header is set after the two-branch output to jointly stitch the structure probability map and the lesion probability map, and generate a joint category probability map through a convolutional mapping layer. Pixel-wise category selection is performed on the joint category probability map to obtain a joint segmentation label map, and the structure segmentation result, lesion segmentation result, and joint segmentation label map are output. Connectivity unification processing is performed on the output. Connectivity filtering and hole filling are performed on the structure segmentation result according to the preset structure category, and small region removal and boundary smoothing are performed on the lesion segmentation result according to the preset lesion category. When the structure segmentation result is missing or the area of the structure region is abnormal, a missing label is output.
[0033] In a preferred embodiment, the calculation of the confidence score includes:
[0034] Receive quality control scores, artifact masks, and joint segmentation results. Calculate the artifact coverage ratio based on the artifact mask and the field of view mask. Extract the probability concentration index from the segmentation probability map. Calculate the set of structural consistency indicators from the joint segmentation label map. Calculate the set of lesion consistency indicators from the lesion segmentation label.
[0035] The quality control score, artifact coverage ratio, probability concentration index, and structural and lesion constraint violations are used to generate a confidence score according to a preset fusion rule. This confidence score is then bound to the segmentation output and written into the running record. The preset fusion rule converts the quality control score, artifact coverage ratio, probability concentration index, and structural and lesion constraint violations into sub-items within the same value range, and performs linear weighted summation with fixed weights to form an inconsistency score. The inconsistency score is then converted into a confidence score according to a fixed mapping.
[0036] As a preferred embodiment, the real-time monitoring of image distribution drift includes:
[0037] A conformal prediction calibration table is pre-built offline. For each sample in the calibration dataset, a confidence score is calculated using the same process as online. A usability threshold is determined on the inconsistency score sequence of the calibration samples according to a preset coverage level. The usability threshold is bound to a device domain label and stored as a corresponding threshold entry for the device domain. During online execution, the corresponding usability threshold is retrieved based on the device domain label, and the confidence score of the current sample is compared with the usability threshold. If the confidence score does not meet the usability threshold, a retake instruction is output. If the confidence score meets the usability threshold, the structural segmentation result, lesion segmentation result, and joint segmentation label map are output, along with a clinical decision result based on preset clinical decision rules. Indicators are compared item by item with a fixed grading threshold table in the configuration file. When the area ratio of any lesion reaches a high-risk threshold or the structural measurement exceeds the abnormal threshold range, a referral decision is output. When the high-risk threshold is not reached but the follow-up threshold is reached, a follow-up decision is output. When all indicators are below the follow-up threshold and the structural measurement is within the normal threshold range, a pass decision is output. The grading threshold table is maintained separately for lesion category and device domain label.
[0038] Real-time monitoring of image distribution drift is performed. Within a sliding time window, the device domain label distribution, quality control score distribution, artifact coverage ratio distribution, and confidence score distribution of recent samples are summarized. The distribution distance between the current distribution and the baseline distribution is calculated. When the distribution distance exceeds the drift threshold, the domain adaptation parameter update process is triggered. During the update, samples whose confidence meets the availability threshold are selected from the sliding time window as self-training samples. Their segmentation results are used as pseudo-supervision signals to iteratively update the domain adaptation parameters. The updated domain adaptation parameters are written to the parameter repository and running records in the form of version numbers. After the update is completed, the latest version of the domain adaptation parameters is used to participate in the confidence calculation and availability determination of subsequent samples until the next drift is triggered.
[0039] As a preferred embodiment, the computer vision-based image processing system specifically includes:
[0040] The acquisition and preprocessing module is used to acquire fundus images and device metadata from different devices. It sequentially performs pixel format unification, visual field localization, black border cropping, and resolution normalization on the fundus images, and outputs the preprocessed image and the bound device metadata. When visual field localization fails, the record is marked and the subsequent processing link is terminated.
[0041] The device identification and image quality control module is used to integrate device metadata and image-side statistical features to construct a joint device feature vector. The device identification model generates device domain labels, and the corresponding threshold set is retrieved based on the device domain labels. Device-related normalization mapping is performed on four types of indicators: sharpness, illumination consistency, artifacts and field of view integrity, and the quality control score is weighted and synthesized. The device domain labels and quality control scores are output.
[0042] The constraint-guided domain adaptation module is used to determine the standardization level and configuration items based on the device domain label and quality control score. It sequentially performs brightness correction, color standardization and vignetting correction on the preprocessed image to obtain a standardized image, detects artifacts to generate an artifact mask, and uses the device domain label as a domain condition to perform channel scaling and translation modulation on the basic feature map output by the basic representation encoder, outputting a standardized image, artifact mask and domain robust features.
[0043] The structure and lesion joint segmentation module is used to input standardized images and domain robust features into a two-branch joint segmentation network, perform cross-branch feature fusion at each scale, decode and output structure segmentation probability maps and lesion segmentation probability maps respectively, generate a joint segmentation label map through the joint output head, and perform connected component unification processing on the output results.
[0044] The confidence-driven adaptive module is used to calculate the confidence score by fusing quality control scores, artifact coverage ratio, probability concentration, and constraint violation count. Based on the conformal prediction calibration table, it determines the availability threshold corresponding to the device domain. When the confidence score does not meet the threshold, it outputs a retake instruction; when it does, it outputs the segmentation result and clinical decision. At the same time, it monitors image distribution drift within the sliding time window. When the drift exceeds the threshold, it updates the domain adaptation parameters using high-confidence samples as pseudo-supervision signals.
[0045] Beneficial effects
[0046] Compared with the prior art, the present invention has the following advantages:
[0047] 1. Device domain labels are generated through device identification, and the device domain labels drive the standardized rule base retrieval and domain condition adaptation, so that fundus images from different devices and different acquisition modes can enter the segmentation and interpretation process under unified constraints, reducing output fluctuations caused by device differences.
[0048] 2. The confidence score is obtained by fusing quality control scores, artifact masks and segmentation consistency indices, and conformal prediction is used to determine the availability threshold related to the device domain, so that the system can make calibrable judgments on output availability. When the threshold is not met, a retake instruction is output; when the threshold is met, the segmentation result is output and clinical decisions are output according to the threshold rules, thus realizing a closed loop from algorithm output to process action. Attached Figure Description
[0049] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation on the scope of this application.
[0050] Figure 1 This is a flowchart illustrating the present invention;
[0051] Figure 2 This is a block diagram of the present invention;
[0052] Figure 3 This is a comparison diagram of the effects of the present invention and the prior art, where gray bars represent the prior art and black bars represent the present invention. Detailed Implementation
[0053] To make the technical means, creative features, objectives, and effects of this invention easier to understand, the invention is further described below with reference to specific embodiments. However, the following embodiments are merely preferred embodiments of this invention and not all of them. Other embodiments obtained by those skilled in the art based on the embodiments described herein without creative effort are all within the protection scope of this invention.
[0054] Example 1:
[0055] To achieve the above objectives, please refer to Figure 1 This invention provides an image processing method based on computer vision, the method comprising:
[0056] Image acquisition and preprocessing: Acquire fundus images and device metadata from different devices, perform visual field localization, black border cropping and resolution normalization on the fundus images to obtain preprocessed images;
[0057] Equipment identification and image quality control: Based on the equipment metadata, extract the equipment feature vector, combine it with the preprocessed image to identify the equipment and generate equipment domain labels; calculate sharpness, exposure uniformity, glare intensity and field of view coverage, establish a set of equipment-related thresholds based on the equipment domain labels, and generate quality control scores;
[0058] Standardization and Domain Robust Feature Extraction: Based on the device domain label and quality control score, the preprocessed image is standardized to output a standardized image and artifact mask; the device domain label is used as the domain condition input to adapt the execution conditions of the basic representation encoder and output domain robust features.
[0059] Joint segmentation of structure and lesion: Based on standardized images and domain robust features, anatomical structure and lesion features are generated, and the joint segmentation results of anatomical structure and lesion features are output through a cross-branch feature fusion mechanism;
[0060] Confidence assessment and adaptive output: Confidence scores are calculated based on quality control scores, artifact masks, and joint segmentation results. Conformal prediction is used to determine the usability threshold. When the confidence score does not meet the threshold, a retake instruction is output. When the threshold is met, the segmentation result and clinical decision are output. Image distribution drift is monitored in real time. When the drift exceeds the threshold, the domain adaptation parameters are updated.
[0061] The system receives raw fundus image data and corresponding device metadata from a fundus imaging device, such as a handheld fundus camera or a desktop non-mydriatic fundus camera. The device metadata includes device identification, device model, acquisition timestamp, and imaging resolution. The raw fundus image data and device metadata are bound together and written into a single acquisition record. The raw fundus image data is then formatted using a unified pixel format. Specifically, the input image compressed in JPEG format is decoded into an RGB three-channel matrix and converted to a unified color space to obtain a color fundus image. A brightness map is calculated on the color fundus image, and visual field localization is performed on the brightness map. A candidate binary mask for the visual field is generated on the entire image. Connectivity analysis is performed on the mask, and the connected component with the largest area is selected as the main visual field region. The bounding rectangle of the main visual field region is then calculated.
[0062] Specifically, the generated candidate binary mask uses an adaptive thresholding strategy to determine the threshold on the brightness map. This adaptive thresholding strategy involves using the brightness histogram of all pixels in the brightness map as the statistical object, calculating the 10th percentile value P10 and the 90th percentile value P90 of the brightness, and setting the threshold accordingly. After obtaining the threshold, the brightness map is compared pixel by pixel. Pixels greater than or equal to the threshold are marked as foreground, and the remaining pixels are marked as background, thus obtaining a candidate binary mask for the field of view. To ensure the continuity of the mask boundary, a morphological closing operation is performed to fill small holes inside the field of view, and a morphological opening operation is performed to remove scattered small foreground patches. Connected component labeling is performed on the processed candidate binary mask for the field of view. The area of each connected component is calculated, and the connected component with the largest area is selected as the main area of the field of view. The binary mask corresponding to this connected component is output as the final candidate binary mask for the field of view. When the area of the largest connected component is less than a preset ratio of the total image area, the frame is marked as having insufficient candidates for the field of view and a retake prompt is entered. The preset ratio of the total image area is set to 0.2.
[0063] A visual field cropping map is obtained by cropping the color fundus image using an circumscribed rectangle. Before cropping, a fixed boundary protection is applied to the circumscribed rectangle. The boundary protection is as follows: when any boundary of the circumscribed rectangle exceeds the boundary, the boundary that exceeds the boundary is truncated to the effective coordinate range of the image. After obtaining the visual field cropping map, black border cropping is performed. Specifically, the visual field cropping map is scanned row by row and column by column around its four edges to identify edge rows and edge columns where the proportion of continuous low-brightness pixels exceeds a preset ratio. Edge rows and edge columns that meet the conditions are determined as black borders. Black border rows and black border columns are removed in order from the outside to the inside to obtain a black border-free image. The preset ratio is fixed at 0.8.
[0064] Resolution normalization is performed, and a scaling factor is determined based on the width and height of the black-bordered image. The black-bordered image is scaled proportionally and padded or truncated as necessary to ensure that the output image meets the target input resolution requirements, resulting in a preprocessed image. During normalization, the main field of view is kept in the center of the output image, which is achieved by aligning the center of the cropping box with the center of the target resolution. The preprocessed image and the device metadata bound to it are output, and the bounding rectangle obtained from the field of view localization is output as a subsequent localization index. When the field of view localization fails to obtain a connected component or the bounding rectangle is empty, the acquisition record is marked as a field of view localization failure, and an empty preprocessed image placeholder is output to terminate the subsequent processing link.
[0065] The device metadata is parsed to extract fields such as device model, device identifier, imaging resolution, acquisition mode, and light source mode. The device metadata is then structured and parsed, converting discrete fields such as device model, acquisition mode, and light source mode into numerical expressions of uniform length according to a preset encoding rule. Continuous fields such as acquisition resolution are also converted into numerical expressions according to a preset normalization rule. These numerical expressions are then concatenated to form a device feature vector based on the metadata. The preset encoding rule maps discrete fields such as device model, acquisition mode, and light source mode to fixed numbers, and expands these fixed numbers into numerical vectors of uniform length using a fixed-length one-hot encoding method. The preset normalization rule linearly scales and normalizes continuous fields such as acquisition resolution between pre-registered minimum and maximum values, ensuring that the normalized values fall within the 0 to 1 range.
[0066] Based on the preprocessed image, device-related image-side features are generated. These features include brightness distribution features, color channel statistical features, and visual field boundary morphology features obtained statistically within the visual field. The brightness distribution features are obtained through histogram quantile statistics of the brightness map; the color channel statistical features are obtained through the statistical analysis of the mean and channel ratio of each color channel; and the visual field boundary morphology features are obtained by fitting the visual field boundary contour and extracting the major and minor axes and center offset. The device feature vector based on metadata is fused with the image-side features to obtain a joint device feature vector. This joint device feature vector is then input into a device recognition model to obtain a device domain label, and a device domain label is generated simultaneously. When the device metadata contains a usable device identifier, the device domain label is used as a constraint for consistency verification. If the verification is inconsistent, the image is marked as a device domain pending confirmation, and the device domain label is still used as the basis for subsequent threshold indexing.
[0067] Specifically, the device recognition model employs a neural network structure with dual-branch encoding, feature fusion, and multi-head classification. The metadata encoding branch receives vectorized input obtained from device metadata through pre-defined encoding and normalization, and obtains metadata representation through an embedding mapping layer and multiple fully connected layers. The image feature encoding branch receives statistical feature input extracted from a pre-processed image and obtains image representation through multiple fully connected layers. In the fusion layer, the two representations are concatenated and output as a joint representation through a fusion fully connected layer. Parallel device recognition classification heads and device domain label classification heads are set on the joint representation to output device category and device domain label, respectively. The device domain label is used for subsequent retrieval of device-related threshold sets and as conditional input for domain adaptation. Supervised learning multi-task is employed. The training method involves training samples consisting of fundus images and device metadata acquired by multiple devices. First, preprocessed images are generated, and two input vectors are created according to feature rules. The device category obtained by mapping the device metadata is used as the device identification supervision label, and device domain labels are generated according to predefined device domain partitioning rules as domain label supervision signals. The model parameters are jointly optimized by minimizing the cross-entropy loss of the two classifiers. During training, balanced sampling is performed according to device category, and the model parameters and category mapping table are solidified on the validation set. The device domain partitioning rules are based on the device imaging principle and imaging characteristics, dividing the device into three device domains: handheld non-mydriatic, desktop non-mydriatic, and desktop mydriatic. The device domain label is obtained by looking up the device model from the device model and device domain mapping table based on the device model.
[0068] After obtaining the device domain label, image quality control calculations are performed to obtain the sharpness characterization index, illumination consistency index, occlusion artifact characterization index, and field of view integrity index. Specifically, the sharpness characterization index is obtained by performing edge response statistics on the brightness map within the field of view; the illumination consistency index is obtained by dividing the field of view into multiple grid blocks, calculating the brightness statistics of each grid block, and based on the dispersion of the brightness statistics of each grid block; the occlusion artifact characterization index is obtained by detecting bright areas within the field of view and calculating the bright intensity and bright proportion by combining the saturated pixel distribution; and the field of view integrity index is obtained by the ratio of the area of the field of view to the area of the preprocessed image.
[0069] The above four categories of indicators are combined into a quality indicator set, and the quality indicator set is bound to the device domain label and written into the current quality control record. Based on the device domain label, the device-related threshold set corresponding to the device domain label is retrieved from the threshold library. The device-related threshold set sets the threshold and score mapping boundaries for the above four categories of indicators respectively. Based on the device-related threshold set, the quality indicator set is subjected to device-related normalization mapping to obtain the sharpness sub-score, illumination consistency sub-score, artifact sub-score, and field of view integrity sub-score, which are then synthesized into a quality control score according to a preset fusion rule. The quality control score formula is as follows:
[0070] ,
[0071] in This indicates the overall quality control score. This indicates the score for the clarity sub-item. This indicates the score for the exposure uniformity component. This indicates the score for glare intensity. This indicates the score for the field of view coverage item.
[0072] Based on the device domain label, the standardized configuration items corresponding to the device domain are retrieved from a pre-built standardized rule base. These standardized configuration items include color mapping methods, brightness correction methods, and vignetting correction methods. The standardized rule base is constructed offline. First, historical fundus images are grouped into device domains according to device model, acquisition mode, and light source mode. After uniform preprocessing of samples from each device domain, samples with missing visual fields, obvious black borders, and severe reflection occlusion are filtered out to obtain a calibration sample set for each device domain. Then, a set of reference standard samples is selected as the target standard domain. The color channel statistics and radial brightness distribution statistics of each device domain and the target standard domain are calculated respectively. Subsequently, based on the alignment of device domain statistics with target statistics, the standardized parameter entries corresponding to each device domain are solved. The device domain label and level are then used to determine the standardized parameter items. Identifiers, parameter entries, and version numbers are bound and stored, and summarized to form a standardized rule base. Based on the quality control score, the standardization process is divided into preset processing levels. The processing level and the standardization configuration items are jointly determined as the standardization process for this processing. The processing level can be set to light standardization level, medium standardization level, and strong standardization level. If the quality control score is greater than or equal to 0.7, the light standardization level is enabled; if it is greater than or equal to 0.4 but less than 0.7, the medium standardization level is enabled; and if it is less than 0.4, the strong standardization level is enabled. The light standardization level performs basic brightness correction and color linear mapping. The medium standardization level adds vignetting correction and local contrast constraint processing on the basis of the light standardization level. The strong standardization level applies mask constraints to the artifact area and enables standardized parameter combinations on the basis of the medium standardization level.
[0073] Brightness correction is performed on the preprocessed image, converting it into a separate representation of the brightness and chroma channels. Background field estimation is performed on the brightness channel within the field of view, generating an illumination field map. The brightness channel is then normalized according to the brightness field map to suppress non-uniform illumination. After brightness correction, color normalization is performed. Based on the color mapping rules corresponding to the device domain label, each color channel is linearly mapped according to channel gain and bias, and the mapped pixel values are truncated to maintain a consistent numerical range. Vignetting correction is performed by generating a vignetting compensation factor map based on radial distance within the field of view, and using this compensation factor map to multiplicatively correct the image brightness, resulting in a normalized image.
[0074] High-brightness reflection artifacts and low-brightness occlusion artifacts are detected within the field of view of a standardized image. High-brightness reflection artifact detection includes thresholding the luminance channel, marking saturated pixels, and filtering connected regions. Low-brightness occlusion artifact detection includes low-thresholding the luminance channel and supplementing the marking of local contrast anomaly regions. The high-brightness reflection artifact regions and low-brightness occlusion artifact regions are merged into a unified artifact candidate region. Morphological closing operations are performed on the artifact candidate region to fill holes, and morphological opening operations are performed to remove isolated small patches, resulting in an artifact mask. This artifact mask is pixel-aligned with the standardized image and output. Domain robust feature adaptation is performed by calling a basic representation encoder model to perform forward encoding on the standardized image to obtain a basic feature map. The device domain label is then embedded and mapped to obtain the domain. The conditional vector is input into the conditional adaptation model. Channel-wise scaling and translation modulation are applied to the basic feature map to obtain robust features. The basic representation encoder model employs an encoder architecture with a backbone network to extract multi-scale features. The backbone is a residual convolutional network. The input is a standardized fundus image, which is sequentially downsampled and feature aggregated to output a set of feature maps at different resolutions. During inference, a fixed model file is loaded, and a forward computation is completed to obtain the basic feature map, which is then output. The conditional adaptation model uses a lightweight architecture consisting of a domain label embedding layer, a parameter generation layer, and a feature modulation layer. It maps device domain labels to domain conditional vectors, generates channel-wise scaling and translation coefficients through a fully connected layer, and performs channel-wise scaling and translation modulation on the basic feature map to output robust features. During inference, it is cascaded with the encoder to complete the conditional adaptation.
[0075] The output includes a standardized image, artifact mask, and domain robust features. The device domain label and quality control score are written into the processing record as binding information for this output.
[0076] The system receives a standardized image and domain robust features, and outputs a joint segmentation result of structures and lesions through a dual-branch joint segmentation network. The dual-branch joint segmentation network includes an anatomical structure segmentation branch and a lesion segmentation branch, each containing an encoding path and a decoding path. First, the standardized image is input into the encoding path of the anatomical structure segmentation branch, where convolutional feature extraction and downsampling are performed level by level to obtain a multi-scale structural feature sequence. The encoding paths of both branches use the same number of downsampling layers and the same scale indexing rule; the corresponding scale is the feature scale of the two branches after the same number of downsampling operations. Simultaneously, the domain robust features are input as conditional features into the encoding path of the lesion segmentation branch, where convolutional feature extraction and downsampling are performed level by level to obtain a multi-scale lesion feature sequence. The domain robust features are two-dimensional feature maps in the same coordinate system as the standardized image, and their spatial dimensions are consistent with the first-layer input size of the lesion branch. When the dimensions are inconsistent, the domain robust features are first downsampled to the specified size before being input into the lesion branch encoding path.
[0077] A cross-branch feature fusion mechanism is executed at each corresponding scale. The cross-branch feature fusion mechanism includes bidirectional information exchange and fusion alignment. Specifically, for structural features and lesion features at the same scale, spatial size alignment is first performed, and then they are concatenated in the channel dimension. The concatenated features are then mapped to a unified number of channels through a point convolution layer to obtain fused features. In the decoding path of the structural branch, the fused features are used as skip connection inputs and merged with upsampled features to restore spatial resolution step by step and output a probability map of structural segmentation. In the decoding path of the lesion branch, the fused features are also used as skip connection inputs and merged with upsampled features to restore spatial resolution step by step and output a probability map of lesion segmentation.
[0078] A joint output header is set after the two-branch output to jointly stitch the structural probability map and the lesion probability map, and generate a joint category probability map through a convolutional mapping layer. Pixel-by-pixel category selection is performed on the joint category probability map to obtain a joint segmentation label map. The structural segmentation result, the lesion segmentation result, and the joint segmentation label map are then output. In the inference process, connected component unification processing is performed on the output. For the structural segmentation result, connected component filtering and hole filling are performed according to preset structural categories, such as optic disc, optic cup, macula, and blood vessels. For the lesion segmentation result, small region removal and boundary smoothing are performed according to preset lesion categories, such as... Hemorrhage, exudation, microaneurysms, cotton wool spots, etc.; when the structural segmentation result is missing or the area of the structural region is abnormal, a missing identifier is output and the frame is marked as needing review. The preset structural categories are jointly determined by the fundus screening business specifications and training annotation specifications. The anatomical structures to be segmented are defined one by one according to the annotation guidelines and solidified in the training dataset with corresponding structural mask labels. The preset lesion categories are jointly determined by the clinical interpretation points corresponding to the screening target disease and training annotation specifications. The lesion types to be identified are defined one by one according to the annotation guidelines and solidified in the training dataset with corresponding lesion mask labels.
[0079] Specifically, the dual-branch joint segmentation network constructs a dataset that simultaneously includes anatomical structure annotation masks and lesion annotation masks. For each training sample, a standardized image and domain robust features are generated. The standardized image is input into the encoding path of the anatomical structure segmentation branch, and the domain robust features are input into the encoding path of the lesion segmentation branch. The output of the anatomical structure segmentation branch is supervised by the structure annotation mask, the output of the lesion segmentation branch is supervised by the lesion annotation mask, and the output of the joint output head is supervised by the merged labels of structure and lesion. The parameters of the two branches and the joint output head are iteratively updated using a joint training method. After training, the network parameters are fixed, and a forward computation is performed at the inference end to output the anatomical structure segmentation result, the lesion segmentation result, and the joint segmentation result.
[0080] First, the system receives the quality control score, artifact mask, and segmentation results from the previous stage. The segmentation results include an anatomical structure segmentation probability map, a lesion segmentation probability map, and a joint segmentation label map. The lesion segmentation label is generated from the lesion segmentation probability map by selecting a pixel-by-pixel category. The artifact coverage ratio is calculated based on the artifact mask and the field-of-view mask, specifically as the ratio of the number of pixels marked as artifacts in the artifact mask to the number of pixels marked as field-of-view pixels in the field-of-view mask. A probability concentration index is extracted from the segmentation probability map, obtained by averaging the maximum class probability for each pixel. The structure is calculated from the joint segmentation label map. The consistency index set includes: determination of the inclusion relationship between the optic disc region and the optic cup region, statistics on the connectivity of the blood vessel region, and statistics on the area ratio of each structural category region. Pixels or regions that do not meet the preset structural relationship are recorded as structural constraint violations. Then, a lesion consistency index set is calculated from the lesion segmentation labels. The lesion consistency index set includes the number of connected components for each lesion category, the total area ratio of the lesion region, and statistics on boundary roughness. Abnormal connected components or abnormal area ratios are recorded as lesion constraint violations. For example, a blood vessel area ratio greater than or equal to 0.02 is considered an abnormal area ratio.
[0081] The quality control score, artifact coverage ratio, probability concentration index, and structural and lesion constraint violations are used to generate a confidence score according to a preset fusion rule. The confidence score is then bound to the segmentation output and written into the running record. Specifically, the preset fusion rule converts the quality control score, artifact coverage ratio, probability concentration index, and structural and lesion constraint violations into sub-items within the same value range, and performs linear weighted summation with fixed weights to form an inconsistency score. The inconsistency score is then converted into a confidence score according to a fixed mapping.
[0082] A conformal prediction calibration table is pre-constructed offline. For each sample in the calibration dataset, a confidence score is calculated using the same process as online. An availability threshold is determined on the inconsistency score sequence of the calibration samples according to a preset coverage level. The preset coverage level is selected based on the constraint that the release rate of diagnosable samples in the offline validation set reaches a predetermined target while the false release rate of undiagnosable samples does not exceed a predetermined upper limit. The availability threshold is bound to device domain labels and stored as a threshold entry corresponding to the device domain. During online execution, the corresponding availability threshold is retrieved based on the device domain label, and the confidence score of the current sample is compared with the availability threshold. Specifically, when the confidence score does not meet the availability threshold, a retake instruction is output; when the confidence score meets the availability threshold, the structural segmentation result, lesion segmentation result, and joint segmentation label map are output, and a clinical decision result is output based on preset clinical decision rules. The system takes the lesion area ratio and number of lesions calculated from the joint segmentation label map, and the structural measurements calculated from the structural segmentation results as inputs. It then makes decisions according to preset threshold rules and writes them into the operation record. These preset threshold rules calculate the ratio of the total lesion area to the visual field area and the number of lesion connected domains for each lesion category in the joint segmentation label map, and calculate structural measurements from the structural segmentation results, including the optic disc area, optic cup area and their ratio, and macular region coverage. The system compares these indicators with the fixed grading threshold table in the configuration file. When any lesion area ratio reaches the high-risk threshold or the structural measurement exceeds the abnormal threshold range, a referral decision is output. When the high-risk threshold is not reached but the follow-up threshold is reached, a follow-up decision is output. When all indicators are below the follow-up threshold and the structural measurement is within the normal threshold range, a pass decision is output. The grading threshold table is maintained separately for lesion categories and device domain labels.
[0083] Real-time monitoring of image distribution drift is performed. Within a sliding time window, the distribution of device domain labels, quality control scores, artifact coverage ratios, and confidence scores of recent samples are summarized. The actual statistical distribution formed by recent samples within the current sliding time window is taken as the current distribution. The distribution distance between the current distribution and the baseline distribution is calculated. The baseline distribution is a reference statistical distribution of device domain labels, quality control scores, artifact coverage ratios, and confidence scores obtained from reference data at the time of system release and is fixed with each version. When the distribution distance exceeds the drift threshold, a domain adaptation parameter update process is triggered. The update process limits the update objects to the parameters of the domain conditional mapping layer and feature modulation layer in the conditional adaptation model, while keeping the parameters of the basic representation encoder and the joint segmentation network backbone unchanged. During the update, samples whose confidence meets the availability threshold are selected from the sliding time window as self-training samples. Their segmentation results are used as pseudo-supervision signals to perform iterative updates to the domain adaptation parameters. The updated domain adaptation parameters are written to the parameter repository and running record in the form of version numbers. After the update is completed, the latest version of the domain adaptation parameters is used to participate in the confidence calculation and availability determination of subsequent samples until the next drift is triggered.
[0084] like Figure 3 This is a comparison chart of the effects of a computer vision-based image processing method and system. The horizontal axis represents the pre-selected evaluation dimensions, and the vertical axis represents the numerical range of each dimension index after normalization according to unified rules. The existing technology bars represent the normalized scores obtained by the traditional processing link without introducing a standardized rule base driven by device domain labels, domain condition adaptation, and conformal prediction usability threshold. The present invention bars represent the normalized scores after enabling the device domain labels, quality control score grading standardization, artifact mask constraints, domain robust feature output, and confidence-driven adaptive mechanism of the present invention under the same dataset and the same statistical caliber. Cross-device consistency is obtained by statistically analyzing the output consistency of similar samples under different device domains. Low-quality usability is obtained by statistically analyzing the proportion of samples with poor quality control under the condition of passing usability judgment. The effectiveness of artifact suppression is obtained by statistically analyzing the segmentation probability distribution and artifact mask coverage within the artifact region. The false retake rate is obtained by statistically analyzing the comparison between the output retake command and the manual review result. The drift stability is obtained by statistically analyzing the distribution distance and trigger update frequency within the sliding time window.
[0085] Example 2, as Figure 2 This is a computer vision-based image processing system, including an acquisition and preprocessing module, a device recognition and image quality control module, a constraint-guided domain adaptation module, a structure and lesion joint segmentation module, and a confidence-driven adaptive module. The specific implementation steps are as follows:
[0086] The acquisition and preprocessing module is used to acquire fundus images and device metadata from different devices. It sequentially performs pixel format unification, visual field localization, black border cropping, and resolution normalization on the fundus images, and outputs the preprocessed image and the bound device metadata. When visual field localization fails, the record is marked and the subsequent processing link is terminated.
[0087] The device identification and image quality control module is used to integrate device metadata and image-side statistical features to construct a joint device feature vector. The device identification model generates device domain labels, and the corresponding threshold set is retrieved based on the device domain labels. Device-related normalization mapping is performed on four types of indicators: sharpness, illumination consistency, artifacts and field of view integrity, and the quality control score is weighted and synthesized. The device domain labels and quality control scores are output.
[0088] The constraint-guided domain adaptation module is used to determine the standardization level and configuration items based on the device domain label and quality control score. It sequentially performs brightness correction, color standardization and vignetting correction on the preprocessed image to obtain a standardized image, detects artifacts to generate an artifact mask, and uses the device domain label as a domain condition to perform channel scaling and translation modulation on the basic feature map output by the basic representation encoder, outputting a standardized image, artifact mask and domain robust features.
[0089] The structure and lesion joint segmentation module is used to input standardized images and domain robust features into a two-branch joint segmentation network, perform cross-branch feature fusion at each scale, decode and output structure segmentation probability maps and lesion segmentation probability maps respectively, generate a joint segmentation label map through the joint output head, and perform connected component unification processing on the output results.
[0090] The confidence-driven adaptive module is used to calculate the confidence score by fusing quality control scores, artifact coverage ratio, probability concentration, and constraint violation count. Based on the conformal prediction calibration table, it determines the availability threshold corresponding to the device domain. When the confidence score does not meet the threshold, it outputs a retake instruction; when it does, it outputs the segmentation result and clinical decision. At the same time, it monitors image distribution drift within the sliding time window. When the drift exceeds the threshold, it updates the domain adaptation parameters using high-confidence samples as pseudo-supervision signals.
[0091] The embodiments of the present invention described above are subject to modification and change of method by those skilled in the art without departing from the embodiments and broader aspects of the present invention. The appended claims are intended to include all such modifications and changes of method that do not depart from the present invention.
Claims
1. An image processing method based on computer vision, characterized in that, include: Acquire fundus images and device metadata from different devices, perform visual field localization, black border cropping and resolution normalization on the fundus images to obtain preprocessed images; Based on the device metadata, device feature vectors are extracted, and device identification is performed by combining them with preprocessed images to generate device domain labels. Calculate sharpness, exposure uniformity, glare intensity, and field of view coverage; establish a set of device-related thresholds based on device domain labels; and generate a quality control score. Based on the device domain label and quality control score, the preprocessed image is standardized, and the standardized image and artifact mask are output. The device domain label is used as the domain condition input to adapt the execution conditions of the basic representation encoder, and the domain robust features are output. Based on standardized images and domain robust features, anatomical structure and lesion features are generated, and the joint segmentation results of anatomical structure and lesion features are output through a cross-branch feature fusion mechanism. Confidence scores are calculated based on quality control scores, artifact masks, and joint segmentation results. Conformal prediction is used to determine the usability threshold. When the confidence score does not meet the threshold, a retake instruction is output. When the threshold is met, the segmentation result and clinical decision are output. Image distribution drift is monitored in real time. When the drift exceeds the threshold, the domain adaptation parameters are updated.
2. The image processing method according to claim 1, characterized in that: The acquisition of fundus images and device metadata from different devices includes: The system receives raw fundus image data and corresponding device metadata from a fundus imaging device. It binds the raw fundus image data and device metadata into a single acquisition record, unifies the pixel format of the raw fundus image data, decodes the input JPEG-compressed image into an RGB three-channel matrix, and converts it into a unified color space to obtain a color fundus image. It calculates a brightness map on the color fundus image and performs visual field localization on the brightness map. It generates a candidate binary mask for the visual field on the entire image, performs connected component analysis on the mask, selects the connected component with the largest area as the main visual field region, and calculates the bounding rectangle of the main visual field region. The visual field cropping map is obtained by cropping the circumscribed rectangle on the color fundus image. Before cropping, a fixed boundary protection is applied to the circumscribed rectangle. After obtaining the visual field cropping map, black edge cropping is performed. The visual field cropping map is scanned row by row and column by column around its four edges to identify edge rows and edge columns with a continuous low brightness pixel ratio exceeding a preset ratio. Edge rows and edge columns that meet the conditions are determined as black edges. Black edge rows and black edge columns are removed in order from the outside to the inside to obtain the black edge removed image.
3. The image processing method according to claim 1, characterized in that: The aforementioned processes for performing visual field localization, black border cropping, and resolution normalization on fundus images include: Resolution normalization is performed, and a scaling factor is determined based on the width and height of the black-bordered image. The black-bordered image is scaled proportionally and then padded or truncated to ensure that the output image meets the target input resolution requirements, resulting in a preprocessed image. The preprocessed image and the device metadata bound to it are output, and the bounding rectangle obtained from the field of view localization is output as the index for subsequent localization. If the field of view localization fails to obtain a connected component or the bounding rectangle is empty, the acquisition record is marked as a field of view localization failure, and an empty preprocessed image placeholder is output to terminate the subsequent processing link.
4. The image processing method according to claim 1, characterized in that: The generated device domain label and quality control score respectively include: The device metadata is parsed by field parsing and structure parsing. Discrete fields are converted into numerical expressions of uniform length according to preset encoding rules, and continuous fields are converted into numerical expressions according to preset normalization rules. The data are then concatenated to form a device feature vector based on the metadata. Based on the preprocessed image, device-related image-side features are generated. These features include brightness distribution features, color channel statistical features, and view boundary morphology features obtained statistically within the view area. The device feature vector based on metadata is fused with the image-side features to obtain a joint device feature vector. This joint device feature vector is then input into a device recognition model to obtain a device domain label, and a device domain label is generated simultaneously. When the device metadata contains a usable device identifier, the device domain label is used as a constraint for consistency verification. If the verification is inconsistent, the image is marked as a device domain pending confirmation. After obtaining the device domain label, image quality control calculations are performed to obtain sharpness, illumination consistency, occlusion artifact, and field of view integrity indices. These four indices are combined into a quality index set, which is then bound to the device domain label and written into the current quality control record. Based on the device domain label, a device-related threshold set corresponding to that label is retrieved from the threshold library. The quality index set is then subjected to device-related normalization mapping based on the device-related threshold set, yielding sharpness, illumination consistency, artifact, and field of view integrity sub-scores. These sub-scores are then synthesized into a quality control score according to a preset fusion rule. The quality control score formula is as follows: , in This indicates the overall quality control score. This indicates the score for the clarity sub-item. This indicates the score for the exposure uniformity sub-item. This indicates the score for glare intensity. This indicates the score for the field of view coverage item.
5. The image processing method according to claim 1, characterized in that: The process of adapting the basic representation encoder to perform conditional adaptation by using device domain labels as domain condition input, and outputting domain robust features, includes: Based on the device domain label, the standardized configuration items corresponding to the device domain are retrieved from the pre-set standardized rule base. The standardized configuration items include color mapping method, brightness correction method and vignetting correction method. The standardized processing is divided into preset processing levels according to the quality control score. The processing level and the standardized configuration items are jointly determined as the standardized process for this processing. The processing level is set as light standardization level, medium standardization level and strong standardization level. Brightness correction is performed on the preprocessed image, converting it into a separate representation of the brightness and chroma channels. Background field estimation is performed on the brightness channel within the field of view, generating an illumination field map. The brightness channel is then normalized according to the brightness field map to suppress non-uniform illumination. After brightness correction, color normalization is performed. Based on the color mapping rules corresponding to the device domain label, each color channel is linearly mapped according to channel gain and bias, and the mapped pixel values are truncated to maintain a consistent numerical range. Vignetting correction is performed by generating a vignetting compensation factor map based on radial distance within the field of view, and using this compensation factor map to multiplicatively correct the image brightness, resulting in a normalized image. High-brightness reflection artifacts and low-brightness occlusion artifacts are detected within the field of view of a standardized image. The high-brightness reflection artifact regions and low-brightness occlusion artifact regions are merged into a unified artifact candidate region to obtain an artifact mask. Domain robust feature adaptation is performed. The basic representation encoder model is called to perform forward encoding on the standardized image to obtain a basic feature map. The device domain label is embedded and mapped to obtain a domain condition vector. The domain condition vector is input into the condition adaptation model, and the basic feature map is subjected to channel-wise scaling and translation modulation to obtain domain robust features. The condition adaptation model maps the device domain label to the domain condition vector, generates channel-wise scaling and translation coefficients through a fully connected layer, and performs scaling and translation modulation on the basic feature map channel by channel to output domain robust features. The output includes a standardized image, artifact mask, and domain robust features. The device domain label and quality control score are written into the processing record as binding information for this output.
6. The image processing method according to claim 1, characterized in that: The generation of anatomical structure and lesion features based on standardized images and domain robust features includes: The system receives a standardized image and domain robust features, and outputs a joint segmentation result including anatomical structure and lesion features through a two-branch joint segmentation network. The two-branch joint segmentation network includes an anatomical structure segmentation branch and a lesion segmentation branch. The anatomical structure features are obtained by inputting the standardized image into the anatomical structure segmentation branch, and the lesion features are obtained by inputting the domain robust features into the lesion segmentation branch. A cross-branch feature fusion mechanism is executed at each corresponding scale. The cross-branch feature fusion mechanism includes bidirectional information exchange and fusion alignment. For anatomical structures and lesion features at the same scale, spatial size alignment is first performed, and then they are stitched together in the channel dimension. The stitched features are then mapped to a unified number of channels through a point convolution layer to obtain fused features. In the decoding path of the structure branch, the fused features are used as skip connection inputs and merged with upsampled features to restore spatial resolution step by step and output a probability map of structure segmentation. In the decoding path of the lesion branch, the fused features are also used as skip connection inputs and merged with upsampled features to restore spatial resolution step by step and output a probability map of lesion segmentation.
7. The image processing method according to claim 6, characterized in that: The combined segmentation results of the output structure and lesions include: A joint output header is set after the two-branch output to jointly stitch the structure probability map and the lesion probability map, and generate a joint category probability map through a convolutional mapping layer. Pixel-wise category selection is performed on the joint category probability map to obtain a joint segmentation label map, and the structure segmentation result, lesion segmentation result, and joint segmentation label map are output. Connectivity unification processing is performed on the output. Connectivity filtering and hole filling are performed on the structure segmentation result according to the preset structure category, and small region removal and boundary smoothing are performed on the lesion segmentation result according to the preset lesion category. When the structure segmentation result is missing or the area of the structure region is abnormal, a missing label is output.
8. The image processing method according to claim 1, characterized in that: The calculation of the confidence score includes: Receive quality control scores, artifact masks, and joint segmentation results. Calculate the artifact coverage ratio based on the artifact mask and the field of view mask. Extract the probability concentration index from the segmentation probability map. Calculate the set of structural consistency indicators from the joint segmentation label map. Calculate the set of lesion consistency indicators from the lesion segmentation label. The quality control score, artifact coverage ratio, probability concentration index, and structural and lesion constraint violations are used to generate a confidence score according to a preset fusion rule. This confidence score is then bound to the segmentation output and written into the running record. The preset fusion rule converts the quality control score, artifact coverage ratio, probability concentration index, and structural and lesion constraint violations into sub-items within the same value range, and performs linear weighted summation with fixed weights to form an inconsistency score. The inconsistency score is then converted into a confidence score according to a fixed mapping.
9. The image processing method according to claim 1, characterized in that: The real-time monitoring image distribution drift includes: A conformal prediction calibration table is pre-built offline. For each sample in the calibration dataset, a confidence score is calculated using the same process as online. A usability threshold is determined on the inconsistency score sequence of the calibration samples according to a preset coverage level. The usability threshold is bound to a device domain label and stored as a corresponding threshold entry for the device domain. During online execution, the corresponding usability threshold is retrieved based on the device domain label, and the confidence score of the current sample is compared with the usability threshold. If the confidence score does not meet the usability threshold, a retake instruction is output. If the confidence score meets the usability threshold, the structural segmentation result, lesion segmentation result, and joint segmentation label map are output, along with a clinical decision result based on preset clinical decision rules. Indicators are compared item by item with a fixed grading threshold table in the configuration file. When the area ratio of any lesion reaches a high-risk threshold or the structural measurement exceeds the abnormal threshold range, a referral decision is output. When the high-risk threshold is not reached but the follow-up threshold is reached, a follow-up decision is output. When all indicators are below the follow-up threshold and the structural measurement is within the normal threshold range, a pass decision is output. The grading threshold table is maintained separately for lesion category and device domain label. Real-time monitoring of image distribution drift is performed. Within a sliding time window, the device domain label distribution, quality control score distribution, artifact coverage ratio distribution, and confidence score distribution of recent samples are summarized. The distribution distance between the current distribution and the baseline distribution is calculated. When the distribution distance exceeds the drift threshold, the domain adaptation parameter update process is triggered. During the update, samples whose confidence meets the availability threshold are selected from the sliding time window as self-training samples. Their segmentation results are used as pseudo-supervision signals to iteratively update the domain adaptation parameters. The updated domain adaptation parameters are written to the parameter repository and running records in the form of version numbers. After the update is completed, the latest version of the domain adaptation parameters is used to participate in the confidence calculation and availability determination of subsequent samples until the next drift is triggered.
10. An image processing system based on computer vision, characterized in that, include: The acquisition and preprocessing module is used to acquire fundus images and device metadata from different devices. It sequentially performs pixel format unification, visual field localization, black border cropping, and resolution normalization on the fundus images, and outputs preprocessed images and bound device metadata. When the field of view localization fails, the record is marked and the subsequent processing link is terminated. The device identification and image quality control module is used to integrate device metadata and image-side statistical features to construct a joint device feature vector. The device identification model generates device domain labels, and the corresponding threshold set is retrieved based on the device domain labels. Device-related normalization mapping is performed on four types of indicators: sharpness, illumination consistency, artifacts and field of view integrity, and the quality control score is weighted and synthesized. The device domain labels and quality control scores are output. The constraint-guided domain adaptation module is used to determine the standardization level and configuration items based on the device domain label and quality control score. It sequentially performs brightness correction, color standardization and vignetting correction on the preprocessed image to obtain a standardized image, detects artifacts to generate an artifact mask, and uses the device domain label as a domain condition to perform channel scaling and translation modulation on the basic feature map output by the basic representation encoder, outputting a standardized image, artifact mask and domain robust features. The structure and lesion joint segmentation module is used to input standardized images and domain robust features into a two-branch joint segmentation network, perform cross-branch feature fusion at each scale, decode and output structure segmentation probability maps and lesion segmentation probability maps respectively, generate a joint segmentation label map through the joint output head, and perform connected component unification processing on the output results. The confidence-driven adaptive module is used to calculate the confidence score by fusing quality control scores, artifact coverage ratio, probability concentration, and constraint violation count. Based on the conformal prediction calibration table, it determines the availability threshold corresponding to the device domain. When the confidence score does not meet the threshold, it outputs a retake instruction; when it does, it outputs the segmentation result and clinical decision. At the same time, it monitors image distribution drift within the sliding time window. When the drift exceeds the threshold, it updates the domain adaptation parameters using high-confidence samples as pseudo-supervision signals.