Pathological image recognition system and method
By constructing a spatial mapping matrix and local regions of interest, and using affine transformation and deep neural networks to accurately match multi-region pathological slide images, the problem of insufficient matching accuracy in the analysis of multi-slice and multi-modal pathological slide images is solved, and high-precision multi-region joint identification and quantitative description are achieved.
Patent Information
- Application Number
- CN202511606818.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-05
- Publication Date
- 2026-02-10
AI Technical Summary
Existing technologies struggle to accurately identify and match the complex spatial transformation relationships between multiple pathological slide images, resulting in highly subjective, poorly repeatable, and inefficient diagnostic results. In particular, in the analysis of multi-slice and multimodal pathological slide images, the registration accuracy is insufficient, and the matching error of key pathological regions is large.
By constructing a spatial mapping matrix and local regions of interest, multiple pathological slide images are aligned to the same reference coordinate system using an affine transformation algorithm. Feature point sets are extracted and their relative poses are adjusted through an iterative optimization algorithm. Combined with a deep neural network, geometric, texture, and intensity features are extracted, and three-dimensional surface fitting is performed to achieve joint recognition of multiple regions.
It significantly improves the matching accuracy of multi-region pathological slide images, provides a quantitative description of multi-dimensional pathological region associations, supports precise clinical diagnosis and disease progression assessment, and overcomes the bottlenecks of low matching accuracy and difficulty in multi-region collaboration in the analysis of multi-slice and multi-modal pathological slide images by traditional methods.
Smart Images

Figure CN121504998A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image recognition, in particular to a pathological image recognition system and method. BACKGROUND
[0002] In the field of modern medical pathological diagnosis, especially in the analysis of multi-slice pathological section images, the contrast evaluation before and after treatment, and the application of multi-modal pathological section image fusion, accurately identifying and matching corresponding regions in different pathological section images has important clinical value. Traditional pathological section image analysis methods usually rely on manual experience to observe and diagnose single sections. When it comes to the comparative analysis of multiple pathological section images (such as consecutive sections, pre-treatment and post-treatment contrast images, or different modal images), due to the complex spatial transformation relationship between images, such as translation, rotation, scaling and non-rigid deformation, it is difficult for humans to accurately identify and match corresponding pathological regions in different images, resulting in strong subjectivity, poor repeatability and low efficiency of diagnosis results. In existing digital pathological section image analysis technology, although there are some automatic image registration and feature matching methods, these methods are usually designed for single modal, single section or simple deformation scenarios. When facing multi-source heterogeneous pathological data (such as pathological section images collected by different staining methods or different imaging devices), it is difficult to effectively handle the complex non-linear deformation and small displacement between images, resulting in insufficient registration accuracy, large matching error of key pathological regions, and seriously affecting the accuracy of subsequent lesion identification, disease progression evaluation and treatment effect analysis.
[0003] In view of the importance of precise multi-region matching and joint identification of pathological section images in clinical diagnosis, disease research and treatment monitoring, and the obvious limitations of existing methods in handling fine spatial correspondence between multi-slice and multi-modal pathological section images, the present application proposes a pathological image recognition system and method based on this demand, which realizes precise matching and multi-region joint identification of lesion regions between multiple pathological section images through constructing a spatial mapping matrix, a local region of interest and a three-dimensional morphological expression fitting. SUMMARY
[0004] The purpose of the present application is to provide a pathological image recognition system and method to solve the problems in the background art.
[0005] To achieve the above purpose, the present application provides the following technical scheme: a pathological image recognition method, the recognition method comprising the following steps: S1: Collecting m x n image data of the full image range in a pair of multiple pathological section images, and using image registration technology to construct a spatial mapping matrix between the pathological section images, aligning the multiple pathological section images to the same reference coordinate system through an affine transformation algorithm, and forming an image registration model; S2: extracting feature points in the middle region of multiple pathological section images in the image registration model, forming a feature point set, taking the local deformation parameters between the pathological section images as the optimization variables, taking the weighted comprehensive index between the two feature point sets as the objective function, continuously adjusting the relative poses between the pathological section images through the iterative optimization algorithm until the local deformation parameter combination that minimizes the objective function between the two feature point sets is found; S3: based on the current local deformation parameter combination, gradually reducing the search step, calculating the local region similarity between the pathological section images, locating the local region with the highest similarity, and using the center point of the local region to demarcate the local pathological interest area of A rows above and below and B columns left and right, through multiple iterative local deformation adjustments and combining the minimum tolerance threshold, determining the lesion matching region and the matching point F of the lesion matching region, using a deep neural network to extract the geometric, texture and intensity features of the lesion matching region, performing local fitting of the three-dimensional curved surface to obtain the local morphological expression, and accordingly constructing the general pathological equation and contact equation of the two pathological section images at the matching point F to realize multi-region joint identification.
[0006] Preferably, the weighted comprehensive index is obtained by weighted calculation of structural similarity and pixel gray difference.
[0007] Preferably, S3: based on the current local deformation parameter combination, gradually reducing the search step, calculating the local region similarity between the pathological section images, comprising the following steps: Taking the local deformation parameter combination as the initial reference, gradually reducing the deformation increment accuracy, and traversing each local region between the pathological section images; extracting geometric features, texture features and intensity features for each local region of the current pathological section image, and calculating the comprehensive similarity index of the local region at the corresponding position between the current pathological section image and another pathological section image; By dynamically comparing the similarity index of each local region, the local region with the highest similarity under the current parameters is located.
[0008] Preferably, S3: using the center point of the local region with the highest similarity to demarcate the local pathological interest area of A rows above and below and B columns left and right, enhancing its features through intelligent interpolation, through multiple iterative local deformation adjustments and combining the minimum tolerance threshold, determining the lesion matching region and the matching point F of the lesion matching region, comprising the following steps: Using the center point of the local region with the highest similarity to demarcate the local pathological interest area of A rows above and below and B columns left and right; Based on the gray value and spatial coordinates of the original pixel points in the local pathological interest area, a piecewise cubic polynomial function is constructed, and the gray value of each pixel point in the local pathological interest area is reconstructed through the piecewise cubic polynomial function; The matching accuracy is optimized by iterating the local deformation adjustment. In each iteration, the local deformation parameters are adjusted within the current local pathological region of interest, and the similarity index between the adjusted local pathological region of interest and the target region is recalculated. When the index changes in consecutive iterations are lower than the minimum tolerance threshold, the matching is determined to have reached a stable state, and the lesion matching area and its internal matching point F are determined.
[0009] Preferably, S3: Using a deep neural network, extract the geometric, texture, and intensity features of the matching region of the lesion, perform local fitting of a three-dimensional surface, obtain a local morphological expression, and construct a general pathological equation and contact equation for the two pathological slice images at the matching point F to achieve multi-region joint identification, including the following steps: A deep neural network is used to extract multi-dimensional features of local grid points within the lesion matching region, and a local morphological expression of the lesion matching region is constructed by B-spline surface fitting using the least squares method. Based on local morphological expressions, with the matching point F as the reference point, the structural correspondence between two pathological slide images in the matching region is quantitatively described. The intensity gradient field reflects the contact intensity between cell clusters, characterizing the probability distribution of overlapping tissue regions within the matching area. Complete the joint identification of multiple regions in pathological slide images, taking into account tissue overlap, multi-regional synergistic effects, and the interactive influence of multiple lesions.
[0010] Preferably, S2: The relative poses between pathological slide images are continuously adjusted through an iterative optimization algorithm until the combination of local deformation parameters that minimizes the objective function between the two sets of feature points is found, including the following steps: The local deformation parameter is defined as the optimization variable, the current objective function value is used as the optimization objective, and the local deformation parameter is taken as the initial guess value when the algorithm is initialized; In each iteration, the gradient of the objective function with respect to each deformation parameter is calculated, and the parameter values are adjusted according to the gradient direction. The iterative process continues until the objective function value converges or the maximum number of iterations is reached, obtaining the combination of local deformation parameters that minimizes the objective function value, i.e., the optimized rotation angle, translation amount, scaling factor, and local deformation parameters.
[0011] Preferably, the combination of local deformation parameters includes optimized rotation angle, translation amount, scaling factor, and local deformation parameters.
[0012] Preferably, S1: Constructing a spatial mapping matrix between pathological slide images using image registration technology, and aligning multiple pathological slide images to the same reference coordinate system using an affine transformation algorithm to form an image registration model, including the following steps: Feature regions in multiple pathological slide images are identified using feature detection algorithms, and the spatial correspondence between feature regions is calculated. Based on the calculation results, spatial transformation parameters between pathological slide images are estimated, and a comprehensive set of transformation parameters is constructed. For each pixel coordinate (x, y) in the original image, its new coordinates (x', y') in the reference coordinate system are calculated based on the translation, rotation, and scaling parameters in the spatial mapping matrix, thus forming an image registration model.
[0013] Preferably, the comprehensive transformation parameter set includes translation, rotation, scaling, and non-rigid deformation.
[0014] This application also provides a pathological image recognition system, including an image acquisition and preprocessing module, an iterative adjustment module, a region analysis module, and an image recognition module; Image acquisition and preprocessing module: Acquires m×n image data of the entire image range of multiple pathological slide images, and constructs a spatial mapping matrix between pathological slide images using image registration technology. The multiple pathological slide images are aligned to the same reference coordinate system through affine transformation algorithm to form an image registration model. Iterative adjustment module: Extracts feature points in the middle region of multiple pathological slide images in the image registration model to form a feature point set. Using the local deformation parameters between pathological slide images as optimization variables and the weighted comprehensive index between the two feature point sets as the objective function, the relative pose between pathological slide images is continuously adjusted through iterative optimization algorithm until the combination of local deformation parameters that minimizes the objective function between the two feature point sets is found. Region Analysis Module: Based on the current combination of local deformation parameters, the search step size is gradually reduced, the similarity of local regions between pathological slide images is calculated, the local region with the highest similarity is located, and the local pathological interest region is delineated with the center point of the local region in rows A above and below and columns B to the left and right. Its features are enhanced by intelligent interpolation. After multiple iterations of local deformation adjustment and combined with the minimum tolerance threshold, the lesion matching region and the matching point F of the lesion matching region are determined. Image recognition module: Utilizes deep neural networks to extract the geometric, texture, and intensity features of the matching region of the lesion, performs local fitting of the three-dimensional surface, obtains the local morphological expression, and constructs the general pathological equation and contact equation of the two pathological slice images at the matching point F to achieve joint recognition of multiple regions.
[0015] The technical effects and advantages provided by the present invention in the above technical solution are as follows: 1. In the fine matching and multi-region joint identification stage, this invention, based on the obtained coarse localization parameter combination, accurately locates the local region with the highest similarity by gradually reducing the search step size (reducing the deformation increment accuracy) and recalculating the local region similarity index. Then, a local pathological region of interest (ROI) is delineated with A rows vertically and B columns horizontally using the center point of this region. High-precision interpolation and feature enhancement are performed on the ROI using intelligent interpolation methods (such as spline interpolation) to compensate for information loss and noise interference in the original sampling. After multiple iterations of local deformation adjustment combined with the minimum tolerance threshold, the matching area of the lesion and its internal matching point F are accurately determined. Furthermore, a deep neural network is used to extract the geometric features (shape contour, curvature), texture features (gray-level co-occurrence matrix, etc.), and intensity features (pixel gray-level statistics) of local grid points within this region. A local morphological expression is obtained through local fitting of a three-dimensional surface, and then a general pathological equation (describing the structural correspondence between tissues) and a contact equation (characterizing the probability distribution of tissue overlap areas) are constructed at the matching point F for the two pathological slice images. Finally, by evaluating the participation matching probability of adjacent slices / regions (quantifying multi-region synergy based on rotation angle differences), the contact equation is adaptively optimized to achieve advanced multi-region joint identification that considers "tissue overlap" (overlapping volume of multiple lesions), "multi-region synergy" (association of adjacent tissues), and "multi-lesion interaction" (such as association between metastatic lesions and primary lesions). This stage, through progressive analysis from local features to mathematical models, not only significantly improves the accuracy of key pathological region matching but also provides a quantitative description of multi-dimensional pathological region associations. This provides reliable technical support for precise clinical diagnosis, disease progression assessment, and treatment plan formulation, overcoming the bottlenecks of traditional methods in multi-slice and multi-modal pathological slice image analysis, such as low matching accuracy and difficulty in multi-region synergy.
[0016] 2. In the feature matching and initial localization stage, this invention accurately extracts key pixels or feature points from the central regions (e.g., the corresponding regions of the central row and central column) of multiple pathological slide images from the image registration model, forming a representative feature point set. Using local deformation parameters (e.g., rotation angle, local scaling factor, etc.) as optimization variables and a weighted comprehensive index (combining structural similarity differences and pixel grayscale differences) among the feature point sets as the objective function, iterative optimization algorithms (e.g., gradient descent) dynamically adjust the relative poses (including translation, rotation, and deformation parameters) between images until the combination of local deformation parameters that minimizes the objective function (i.e., coarse localization angle) is found. This mechanism not only achieves coarse-grained precise alignment of global spatial relationships between pathological slide images (solving the problem of large-scale spatial offset), but also, through the matching relationship of feature point sets, preliminarily infers the potential locations where key pathological regions (e.g., lesions, tissue boundaries, cell clusters, etc.) may have spatial overlap or functional associations. This coarse localization result provides a reliable initial estimation benchmark for subsequent refined analysis, significantly narrowing the search range, improving the targeting and computational efficiency of subsequent processing, and avoiding invalid calculations caused by global bias during direct refined analysis.
[0017] 3. In the image preprocessing stage, this invention acquires high-precision m×n pixel-level data (based on a high-resolution scanner or digital pathology equipment) across multiple pathological slide images. It then uses image registration technology to construct a spatial mapping matrix between the pathological slide images and aligns the different images to the same reference coordinate system using an affine transformation algorithm, ultimately forming a standardized image registration model. This step fundamentally solves the core problem of spatial pose deviation (including translation, rotation, scaling, and non-rigid deformation) caused by differences in acquisition equipment, imaging conditions, or physical positional offsets of multiple source pathological slide images (such as images acquired from different devices, with different imaging parameters, or multiple consecutive slides). Through unified spatial mapping and coordinate calibration, all subsequent analysis steps can be performed within a consistent geometric spatial framework, avoiding matching failures caused by spatial misalignment. This lays a precise benchmark for subsequent operations such as feature point extraction and region localization, ensuring a consistent expression of spatial relationships between multiple images. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0019] Figure 1 This is a flowchart of the identification method of the present invention.
[0020] Figure 2 This is a framework diagram of the identification system of the present invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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.
[0022] Example: This example provides a method for identifying pathological images. Please refer to [link / reference]. Figure 1 As shown, the identification method includes the following steps: S1: Based on the pathological slide image pair to be analyzed (e.g., consecutive slide images or pre- and post-treatment comparison images), firstly, high-precision m×n pixel-level image data of the entire image area from multiple images is acquired (this can be obtained through a high-resolution scanner or digital pathology equipment). Using image registration techniques, a spatial mapping matrix between the images is constructed, containing translation, rotation, scaling, and possible deformation parameters. Affine transformation algorithms are then used to precisely align two (or more) pathological slide images to the same reference coordinate system, forming an image registration model. This process achieves universal preprocessing for pathological slide images from different sources, modalities, or slides, ensuring that subsequent analysis is performed in a unified space, laying the foundation for subsequent feature point matching and region localization.
[0023] S2: Based on the image registration, select representative intermediate regions (such as the central row and central column regions of the image) from two (or more) pathological slide images, extract feature points within these intermediate regions, and form a feature point set as seed points for preliminary identification and matching.
[0024] Using local deformation parameters between images as optimization variables and a weighted comprehensive index between two sets of feature points (such as a weighted comprehensive index of structural similarity and pixel grayscale difference) as the objective function, the relative pose between images is continuously adjusted through an iterative optimization algorithm (such as gradient descent) until the combination of local deformation parameters (coarse positioning angle) that minimizes the objective function between the two sets of feature points is found.
[0025] This combination of local deformation parameters (coarse positioning angle) identifies the most likely initial matching state between pathological slide images, and also preliminarily indicates the spatial location where key pathological areas (such as lesions, tissue boundaries, cell clusters, etc.) in the two images may "contact" or overlap, providing an initial estimate for subsequent refined analysis.
[0026] S3: Based on the current combination of local deformation parameters (coarse positioning angle), gradually reduce the search step size (i.e. deformation increment), recalculate the similarity index between local regions of the images, and locate the local region with the highest similarity between the images.
[0027] For each local region with the highest similarity at any given time, a Local Pathological Region of Interest (ROI) is delineated, with the center point of that local region as the core. A rows vertically and B columns horizontally are then used to define the ROI. Intelligent interpolation methods (such as spline interpolation) are employed to perform high-precision interpolation and feature enhancement on these ROIs to compensate for information loss or noise interference in the original sampling. Through multiple iterations of local deformation adjustment, combined with a preset minimum tolerance threshold, the lesion matching regions between images and the matching points F within those regions are finally determined.
[0028] Deep neural networks (such as CNNs) are used to extract the geometric, texture, and intensity features of local grid points within the lesion matching region. A three-dimensional surface is then fitted locally to this lesion matching region to obtain a local morphological expression. Based on this, a general pathological equation (a mathematical model describing the structural correspondence between tissues) and a contact equation (a probability distribution model describing the overlapping areas of tissues) satisfying between two pathological slide images (or different tissue layers / slices) at the matching point F are constructed. This enables advanced multi-region joint recognition of pathological slide images, considering factors such as "tissue overlap," "multi-region synergistic effects," or "interactions between multiple lesions."
[0029] This embodiment also provides a pathological image recognition system; please refer to [link / reference]. Figure 2 As shown, it includes an image acquisition and preprocessing module, an iterative adjustment module, a region analysis module, and an image recognition module; Image acquisition and preprocessing module: Acquires m×n image data of the entire image range of multiple pathological slide images, and constructs a spatial mapping matrix between pathological slide images using image registration technology. The multiple pathological slide images are aligned to the same reference coordinate system through affine transformation algorithm to form an image registration model. The image registration model is sent to the iterative adjustment module, the region analysis module, and the image recognition module. Iterative adjustment module: Extracts feature points in the middle region of multiple pathological slide images in the image registration model to form a feature point set. Using the local deformation parameters between pathological slide images as optimization variables and the weighted comprehensive index between the two feature point sets as the objective function, the relative posture between pathological slide images is continuously adjusted through iterative optimization algorithm until the combination of local deformation parameters that minimizes the objective function between the two feature point sets is found. The deformation parameter combination is then sent to the region analysis module. Region Analysis Module: Based on the current combination of local deformation parameters, the search step size is gradually reduced to calculate the local region similarity between pathological slide images, locate the local region with the highest similarity, and delineate the local pathological region of interest in rows A above and below and columns B to the left and right with the center point of the local region. The features are enhanced by intelligent interpolation. After multiple iterations of local deformation adjustment and combined with the minimum tolerance threshold, the lesion matching region and the matching point F of the lesion matching region are determined. The lesion matching region and the matching point F of the lesion matching region are sent to the image recognition module. Image recognition module: Utilizes deep neural networks to extract the geometric, texture, and intensity features of the matching region of the lesion, performs local fitting of the three-dimensional surface, obtains the local morphological expression, and constructs the general pathological equation and contact equation of the two pathological slice images at the matching point F to achieve joint recognition of multiple regions.
[0030] S1: Based on the pathological slide image pair to be analyzed (e.g., consecutive slide images or pre- and post-treatment comparison images), firstly, high-precision m×n pixel-level image data of the entire image area from multiple images is acquired (this can be obtained through a high-resolution scanner or digital pathology equipment). Using image registration techniques, a spatial mapping matrix between the images is constructed, containing translation, rotation, scaling, and possible deformation parameters. Affine transformation algorithms are then used to precisely align two (or more) pathological slide images to the same reference coordinate system, forming an image registration model. This process achieves universal preprocessing for pathological slide images from different sources, modalities, or slides, ensuring that subsequent analysis is performed in a unified space, laying the foundation for subsequent feature point matching and region localization.
[0031] In one embodiment of this disclosure, for the pathological slide image pairs to be analyzed (including continuous tissue slide images, pre- and post-treatment comparison images, multimodal imaging combination images (such as combined HE staining and immunohistochemistry images), or pathological slide images acquired by different devices), the system first acquires m×n pixel-level high-precision image data (m and n are the number of rows and columns of the image, respectively, with the specific values determined by the original slide size and scanning resolution) from multiple images using a high-resolution scanner (such as a digital pathology scanner with a resolution of 0.23 μm / pixel or higher) or a professional digital pathology imaging device. During the acquisition process, it is necessary to ensure that the image covers the complete pathological area (such as including the target lesion and surrounding normal tissue), and the acquisition parameters of multiple images (such as light intensity and contrast correction parameters) need to be kept relatively consistent or normalized and corrected in subsequent processing to avoid introducing additional interference due to differences in acquisition conditions.
[0032] After acquisition, the system utilizes multimodal image registration technology to construct spatial mapping relationships between images. This process first identifies key feature regions (such as tissue edges, vascular structures, and specific texture regions) in two (or more) images using feature detection algorithms (such as Harris corner detection). Then, it calculates the spatial correspondence between feature regions (e.g., selecting stable matching point pairs through nearest neighbor matching or ratio testing). Based on the calculation results, the system further estimates spatial transformation parameters between images and constructs a comprehensive set of transformation parameters, including translation (Δx, Δy), rotation (θ), scaling (s), and non-rigid deformation (such as local stretching / compression, which can be parameterized by thin-plate spline interpolation TPS or free deformation model FFD). This set is uniformly expressed in the form of a spatial mapping matrix (the matrix dimension depends on the transformation type; for example, affine transformations use a 2×3 matrix, while non-rigid transformations use a higher-dimensional parameter vector).
[0033] Multimodal image registration technology is used to construct spatial mapping relationships between images. This process first identifies key feature regions (such as tissue edges, vascular structures, and specific texture regions) in two (or more) images using feature detection algorithms (e.g., Harris corner detection, which calculates the corner response value R=det(M)-k·trace(M)2 for each pixel in the image, where M is a 2×2 gradient matrix and k is an empirical constant of 0.04~0.06; when R exceeds a preset threshold (e.g., 1000~5000), it is marked as a corner). Then, spatial correspondences between feature regions are calculated using feature descriptors (e.g., SIFT descriptors or geometric distances). For example, nearest neighbor matching filters for Euclidean distance pairs, and ratio testing (e.g., the ratio of nearest neighbor distance to second nearest neighbor distance is less than 0.7~0.8) filters unstable matches. Based on these stable matching pairs, the system further estimates spatial transformation parameters between images using least squares or RANSAC robust estimation algorithms, constructing a mapping that includes translation (e.g., Δx=2). This is a set of transformation parameters for a spatially mapped moment. The parameters include: 0.3 pixels (Δy = -1.1 pixels), rotation (e.g., θ = 0.5° converted to radians constrained to 0.0087 rad), scaling (e.g., s = 1.05 indicating 5% magnification), and non-rigid deformation (e.g., local stretching / compression, with control point mesh defined by thin-plate spline interpolation TPS; assuming the displacement vector of the control point in the 3rd row and 4th column of a 10×10 mesh is (Δx = 0.8 pixels, Δy = -0.5 pixels)). The matrix is uniformly expressed (for example, affine transformation is a 2×3 matrix [[a11,a12,tx],[a21,a22,ty]], where a11≈0.999, a12≈0.0087, tx≈2.3, a21≈-0.0087, a22≈0.999, ty≈-1.1, and non-rigid transformation is a higher-dimensional parameter vector containing the displacement coordinates of each control point), thereby accurately mapping different pathological slice images to the same reference coordinate system.
[0034] In one embodiment of this disclosure, after parameter estimation is completed, the system maps multiple pathological slide images pixel by pixel to the same reference coordinate system using an affine transformation algorithm. The processing logic for the affine transformation is as follows: for each pixel coordinate (x, y) in the original image, its new coordinates (x', y') in the reference coordinate system are calculated according to the translation, rotation, and scaling parameters in the spatial mapping matrix (the specific logic is to achieve linear coordinate transformation and translation superposition through matrix multiplication and vector addition).
[0035] After parameter estimation, the multiple pathological slide images are mapped pixel by pixel to the same reference coordinate system using an affine transformation algorithm. The processing logic for the affine transformation is as follows: for each pixel coordinate (x, y) in the original image, its new coordinates (x', y') in the reference coordinate system are calculated according to the translation, rotation, and scaling parameters in the spatial mapping matrix (the specific logic is to achieve linear coordinate transformation and translation superposition through matrix multiplication and vector addition). For example, suppose the spatial mapping matrix is a standard 2×3 affine transformation matrix [[a11,a12,tx],[a21,a22,ty]], where a11=0.98 (representing 98% scaling along the x-axis with a slight rotation), a12=0.02 (rotation slightly coupled to the y-axis), a21=-0.02 (rotation slightly coupled to the x-axis), a22=0.98 (representing 98% scaling along the y-axis with a slight rotation), tx=3.2 pixels (3.2 pixels to the right), and ty=-1.5 pixels (1.5 pixels upward); for the original image For the pixel (x=100, y=150), first construct homogeneous coordinates [100, 150, 1], then calculate the new coordinates through matrix multiplication: x'=a11×x+a12×y+tx=0.98×100+0.02×150+3.2≈98+3+3.2=104.2, y'=a21×x+a22×y+ty=-0.02×100+0.98×150-1.5≈-2+147-1.5=143.5. Finally, the new position of the pixel in the reference coordinate system is (x'=104.2, y'=143.5). If nearest neighbor interpolation is used, the system assigns the original pixel value to the nearest integer coordinate point (104, 144) in the reference coordinate system; if bilinear interpolation is used, it calculates a weighted average of the pixel values of the four surrounding integer coordinate points (x'=104.2, y'=143.5). By performing such calculations pixel by pixel, the system accurately maps the entire pathological image to a unified reference coordinate system, achieving geometric alignment between multiple images.
[0036] Through the above processing, the system finally forms an image registration model—this model not only includes the precise spatial mapping relationship between images (i.e., spatial mapping matrix or deformation field parameters), but also implicitly includes a unified definition of the reference coordinate system (such as establishing a coordinate system with the center point of the first image as the origin, or with a specific anatomical structure as the reference). The core value of this preprocessing step is to eliminate global spatial pose deviations (including translational offset, rotational misalignment, scale scaling, and local deformation) caused by differences in acquisition equipment (such as the resolution and distortion characteristics of different brands of scanners), imaging modal differences (such as differences in grayscale distribution caused by different staining methods), or differences in the physical position of the slices (such as cutting offset between consecutive slices), thus unifying all input images under the same geometric spatial framework.
[0037] S2: Based on the completed image registration, representative intermediate regions (such as the central row and central column regions of the image) are selected from two (or more) pathological slide images. Feature points within these intermediate regions are extracted to form a feature point set, which serves as seed points for preliminary identification and matching. Using local deformation parameters between the images as optimization variables and a weighted comprehensive index between the two feature point sets (such as a weighted comprehensive index of structural similarity and pixel grayscale difference) as the objective function, an iterative optimization algorithm (such as gradient descent) is used to continuously adjust the relative pose between the images until the combination of local deformation parameters (coarse positioning angle) that minimizes the objective function between the two feature point sets is found. This combination of local deformation parameters (coarse positioning angle) identifies the most likely initial matching state between the pathological slide images and also preliminarily indicates the spatial location where key pathological regions (such as lesions, tissue boundaries, cell clusters, etc.) in the two images may "contact" or overlap, providing an initial estimate for subsequent refined analysis.
[0038] In one embodiment of this disclosure, after image registration (i.e., unifying multiple pathological slide images to the same reference coordinate system through a spatial mapping matrix), the system further performs feature point extraction and initial matching localization of key regions to establish a global spatial relationship benchmark between pathological slide images. Specifically, the system first selects a representative intermediate region from each registered pathological slide image—this region is usually a local region corresponding to the center row and center column of the image (e.g., a rectangular region within 30% to 50% of the geometric center of the image), or a region with high stability determined through a pre-screening strategy (e.g., based on indicators such as tissue density and grayscale consistency) (e.g., a normal tissue region far from the slide edge and without obvious artifacts). The selection logic for such intermediate regions is that they usually contain a relatively uniform tissue structure (e.g., background matrix or low heterogeneity region), which can reduce the interference of local variations (e.g., complex textures at the edge of lesions) on feature extraction, while covering the core spatial location of the image, providing a stable reference benchmark for subsequent matching.
[0039] In one embodiment of this disclosure, after selecting an intermediate region, the system extracts key feature points within that region using a multi-scale feature extraction algorithm to form an initial feature point set. Feature point extraction can employ traditional methods (such as algorithms based on Harris corner detection, SIFT (Scale Invariant Feature Transform), SURF (Speed-Up Robust Feature Transform), or ORB (Oriented Fast and Rotated BRIEF), or lightweight feature point detection networks based on deep learning (such as a simplified version of SuperPoint). Taking the classic SIFT algorithm as an example, its processing logic is as follows: First, the intermediate region image undergoes Gaussian pyramid multi-scale decomposition (generating image layers of different resolutions). Then, local extrema are detected on each image layer (by comparing the gradient direction and magnitude of pixels with their neighboring pixels), and edge response suppression and keypoint precise localization are performed on the extrema (by correcting the position through Taylor expansion). Finally, a set of feature point coordinates with scale invariance and rotation invariance is output. The extracted feature points must meet stability requirements (e.g., they can still be repeatedly detected under slight image perturbations) and discriminability requirements (e.g., they have significant differences from feature points in other regions) to ensure the reliability of subsequent matching.
[0040] After selecting the intermediate region, key feature points within this region are extracted using a multi-scale feature extraction algorithm to form an initial feature point set. Taking the classic SIFT algorithm as an example, its processing logic is as follows: First, the intermediate region image is subjected to Gaussian pyramid multi-scale decomposition (generating image layers of different resolutions). Specifically, by superimposing Gaussian blur kernels of different scales (σ is the standard deviation, usually increasing proportionally, such as 1.0, 1.6, 2.2, etc.) on the original image, a multi-level image pyramid is constructed (generally containing 3 to 5 layers of different resolutions), thereby capturing the feature information of the image at different scales. Subsequently, local extrema are detected on each image layer, that is, by comparing the gradient direction and magnitude of each pixel with its 26 neighboring pixels (corresponding regions of the current layer and the adjacent layers above and below), local extrema are selected in both scale space and spatial domain. All are candidate points for extreme values; then, edge response suppression and key point precise localization are performed on the extreme points. Specifically, the candidate point positions are corrected at the sub-pixel level by Taylor expansion (using the first and second derivative information to optimize the extreme point coordinates to the most stable position), and unstable points located on the edge are removed (judged by the ratio of the principal curvature of the Hessian matrix; if the ratio exceeds the threshold of 10 to 12, it is regarded as an edge response point and removed); finally, a set of feature point coordinates with scale invariance and rotation invariance is output. Each feature point is accompanied by its scale layer information and principal direction (determined by gradient histogram statistics, usually dividing 360° into 8 to 16 directional intervals, and taking the peak direction as the principal direction). The extracted feature points must meet the following requirements: stability (e.g., they can still be repeatedly detected even when there are slight translations, rotations, or brightness changes in the image; usually, the repeatability rate is verified to be higher than 80% to 85% by artificially synthesized transformed images) and discriminability (e.g., the feature point descriptors are significantly different from the feature points in other surrounding areas; usually, the nearest neighbor distance ratio test is used to ensure that the descriptor distance ratio between matching point pairs is less than 0.7 to 0.8) to ensure the reliability of subsequent matching.
[0041] In one embodiment of this disclosure, based on the feature point sets of the intermediate regions extracted from two (or more) pathological slide images, the system constructs feature point matching pairs and calculates a weighted comprehensive similarity index (objective function) between the two feature point sets to quantify the matching quality under the relative pose (defined by local deformation parameters) between the current images. This objective function typically integrates two core dimensions: first, structural similarity (SSIM), which assesses the macroscopic structural similarity of corresponding regions in two images by comparing the brightness, contrast, and structural information (such as local gradient direction consistency) of the feature point neighborhood (e.g., a 16×16 pixel window); second, pixel grayscale difference (or normalized cross-correlation NCC), which measures the local pixel-level intensity consistency by calculating the mean difference (or normalized cross-correlation coefficient) of pixel grayscale values within the feature point neighborhood. The weights of both can be dynamically adjusted according to the image characteristics (for example, for high-contrast images, the weight of grayscale difference can be appropriately reduced; for low-contrast but structurally clear images, the weight of structural similarity can be increased), ultimately forming a comprehensive index (e.g., objective function value = β×NCC-α×SSIM, where α and β are empirical weight coefficients, and α+β=1).
[0042] Based on the feature point sets extracted from the intermediate regions of two (or more) pathological slide images, feature point matching pairs are constructed, and a weighted comprehensive similarity index (i.e., objective function) is calculated between the two feature point sets to quantify the matching quality under the relative pose (defined by local deformation parameters) between the current images. The design logic of this objective function is to comprehensively evaluate the matching degree of local regions of the image in two dimensions: structural organization and pixel intensity, thereby accurately reflecting the overall similarity level under the current combination of deformation parameters. It typically includes two core dimensions: First is structural similarity (SSIM), which assesses the similarity of corresponding regions in two images in terms of macroscopic organizational structure and spatial arrangement by comparing the brightness (local pixel mean reflects the overall brightness), contrast (local pixel standard deviation reflects the grayscale variation) and structural information (such as the consistency of local gradient direction, which measures the structural arrangement pattern through the statistics of the gradient product between pixels) of the neighborhood of feature points (typically a window size of 16×16 pixels). For example, if the brightness distribution trend, contrast strength, and tissue texture direction of the neighborhood of corresponding feature points in two images are highly consistent, the SSIM value will approach 1 (indicating high structural similarity); conversely, if the tissue arrangement direction is disordered or the texture is misaligned, the SSIM value will be significantly reduced. Secondly, there is the pixel grayscale difference (or normalized cross-correlation NCC). This dimension measures the intensity consistency at the local pixel level by calculating the mean difference of pixel grayscale values in the neighborhood of the feature point (directly comparing the mean of the absolute value or square difference of the grayscale difference of corresponding pixels in two images to reflect the absolute difference in intensity) or the normalized cross-correlation coefficient (calculating the linear correlation after standardizing the grayscale values of two neighboring pixels to eliminate the influence of overall brightness difference and highlight the degree of matching of local textures). For example, for high-contrast lesion areas (such as clear grayscale boundaries between tumor boundaries and normal tissues), the absolute value of the grayscale difference may be large, but if the grayscale distribution patterns of corresponding areas in two images are highly matched (such as consistent boundary positions and alternating bright and dark patterns), the NCC value can still remain at a high level (close to 1).
[0043] The weights of α and β are not fixed but dynamically adjusted according to image characteristics. For example, when processing high-contrast images (such as strongly stained HE-stained sections with clear tissue boundaries, where the gray-level differences within the neighborhood of feature points are significant and easily distinguishable), the weight β of gray-level difference (or NCC) can be appropriately reduced (e.g., set to 0.4~0.5) to avoid over-reliance on absolute intensity and neglecting structural misalignment issues. Conversely, for low-contrast but structurally clear images (such as some immunohistochemical sections, where the overall gray-level distribution is flat but the tissue texture arrangement is clearly regular), the weight α of structural similarity (SSIM) can be increased (e.g., set to 0.6~0.7) to strengthen the evaluation of the consistency of tissue arrangement regularity. Finally, the system integrates these dimensions into a quantitative index (e.g., objective function value = β×NCC-α×SSIM, where α and β are empirical weight coefficients and satisfy α+β=1, or other linear / nonlinear combinations are used as a comprehensive similarity measure). The higher the value of this index (or the lower, depending on the specific definition direction), the better the local region matching quality under the relative pose between the current images. By using this objective function as the optimization target, the system can accurately guide the subsequent iterative optimization process, gradually adjusting local deformation parameters (such as rotation angle, translation amount, or local scaling coefficient) until the optimal parameter combination that makes the objective function reach its extreme value (usually the minimum value, indicating that the matching difference is minimized) is found, which is the coarse positioning angle.
[0044] In one embodiment of this disclosure, to optimize the relative pose between images (i.e., adjust local deformation parameters to improve matching quality), the system employs an iterative optimization algorithm (such as gradient descent) as the optimization strategy. Taking gradient descent as an example, its processing logic is as follows: local deformation parameters (such as rotation angle θ, translation increment Δx / Δy, local scaling coefficient s, or control point displacement vector of non-rigid deformation) are defined as optimization variables, and the current objective function value (i.e., the comprehensive similarity index between feature point sets) is used as the optimization target; during algorithm initialization, the local deformation parameters are taken as initial guess values (such as a rough estimate based on the image registration model or zero initialization). Subsequently, in each iteration, the system calculates the gradient of the objective function with respect to each deformation parameter (obtained through the finite difference method), and adjusts the parameter values according to the gradient direction (the negative gradient direction points to the path of fastest descent of the objective function) (such as θ←θ-η×∂f / ∂θ, where η is the learning rate); the iteration process continues until the objective function value converges (such as the function value change in multiple consecutive iterations being less than a preset threshold) or the maximum number of iterations is reached.
[0045] Taking gradient descent as an example, its specific processing logic is as follows: First, the local deformation parameters (including rotation angle θ, translation increment Δx / Δy, local scaling factor s, or control point displacement vector for non-rigid deformation, etc.) are defined as the core variables to be optimized. At the same time, the comprehensive similarity index between the current feature point set (i.e., the objective function value, reflecting the matching quality of local regions between images) is used as the optimization objective—the optimization direction of this objective function is to minimize its value (usually meaning the minimum matching difference, i.e., the highest similarity). During algorithm initialization, the local deformation parameters are usually taken as initial guesses based on the image registration model (such as the coarse parameters after affine transformation alignment in S1), or directly set to zero (indicating adjustment from the original pose), which serves as the starting point for optimization.
[0046] In each iteration, the system first calculates the gradient of the objective function with respect to each deformation parameter (i.e., the rate of change of the objective function value with a small change in the parameter). This calculation is usually achieved by the finite difference method: for each deformation parameter (e.g., rotation angle θ), the system applies a small perturbation (e.g., Δθ = 0.01 radians or Δx = 0.5 pixels) near its current value, calculates the objective function value before and after the perturbation, and then approximates the gradient value of the parameter by using the difference formula (e.g., ∂f / ∂θ≈[f(θ+Δθ)-f(θ)] / Δθ), thereby avoiding the complex analytical differentiation process and ensuring computational feasibility. Subsequently, the system adjusts the current values of each deformation parameter according to the direction of the gradient (the negative gradient direction always points to the path of the fastest descent of the objective function). For example, for the rotation angle θ, the update logic is θ←θ-η×∂f / ∂θ (where η is a pre-set learning rate, typically 0.01~0.1, used to control the step size of parameter adjustment, avoiding oscillation due to too large a step size or slow convergence due to too small a step size). The translation increment Δx / Δy, scaling factor s, or other non-rigid deformation parameters (such as the components of the control point displacement vector) all adopt similar update rules.
[0047] This iterative process is continuously executed in a loop. After each update, the system recalculates the objective function value (i.e., the comprehensive similarity index of the feature point set under the current deformation parameter combination) and monitors its changing trend. The iteration stops when the preset termination conditions are met—typical termination conditions include: the change in the objective function value over multiple consecutive iterations (e.g., 5 to 10 times) is less than a preset threshold (e.g., 1 × 10⁻⁴ or less, indicating that the matching quality has stabilized), or the number of iterations reaches the maximum limit (e.g., 100 to 200 times, to prevent infinite loops). Through this process, the system gradually approaches the optimal combination of local deformation parameters that minimizes the objective function, that is, it precisely adjusts the relative pose between images (e.g., correcting minor rotational deviations, translational misalignments, or local scaling differences), and finally obtains the optimized result that maximizes the feature point set matching similarity (or minimizes the matching difference). This provides a reliable basis for subsequently determining the coarse positioning angle (i.e., the quantitative representation of the initial matching state) and ensures that the global spatial relationship between pathological images is accurately aligned with coarse granularity.
[0048] Through the aforementioned iterative optimization process, the system ultimately finds the combination of local deformation parameters that minimizes the objective function value (i.e., the optimized rotation angle, translation amount, scaling factor, and possible local deformation parameters). This combination is called the coarse localization angle (or coarse matching parameters). Geometrically, this parameter combination identifies the most likely initial matching state between pathological slide images—that is, by adjusting the relative spatial orientation between images (such as slight rotation to align tissue direction and translation to compensate for slide offset), the spatial distribution of feature point sets in the two images achieves optimal matching with the local structure. More importantly, this coarse localization result not only reflects the degree of alignment in global space but also indirectly indicates the possible overlapping positions of key pathological regions (such as lesions, tissue boundaries, cell clusters, etc.) through the matching relationship of feature point sets: for example, if the feature point set contains feature points from the edge of a potential lesion, its matching position can indicate the approximate spatial correspondence of the lesions in the two images.
[0049] S3: Based on the current combination of local deformation parameters (coarse positioning angle), the search step size (i.e., deformation increment) is gradually reduced, and the similarity index between local regions of the images is recalculated to locate the local region with the highest similarity between the images. For the local region with the highest similarity at each time step, a local pathological region of interest (ROI) is delineated with the center point of the local region as the core, with rows A above and below and columns B to the left and right. Intelligent interpolation methods (such as spline interpolation) are used to perform high-precision interpolation and feature enhancement on the local pathological ROI to compensate for information loss or noise interference in the original sampling. Through multiple iterations of local deformation adjustment, combined with a preset minimum tolerance threshold, the lesion matching region between the images and the matching point F within the region are finally determined. Deep neural networks (such as CNNs) are used to extract the geometric, texture, and intensity features of local grid points within the lesion matching region. A three-dimensional surface is then fitted locally to this lesion matching region to obtain a local morphological expression. Based on this, a general pathological equation (a mathematical model describing the structural correspondence between tissues) and a contact equation (a probability distribution model describing the overlapping areas of tissues) satisfying between two pathological slide images (or different tissue layers / slices) at the matching point F are constructed. This enables advanced multi-region joint recognition of pathological slide images, considering factors such as "tissue overlap," "multi-region synergistic effects," or "interactions between multiple lesions."
[0050] In one embodiment of this disclosure, based on the combination of local deformation parameters (i.e. coarse positioning angle) obtained in step S2, the system initiates a multi-level fine matching process. By gradually refining the spatial search accuracy and local feature analysis, the system accurately locates the key lesion matching areas between pathological slide images and constructs a quantitative tissue relationship model, ultimately achieving multi-region collaborative identification.
[0051] Using a combination of local deformation parameters (including rotation angle, translation increment, scaling factor, and possible local deformation parameters) as an initial benchmark, the search step size is gradually reduced (i.e., the precision of the deformation increment is decreased)—for example, the initial search step size might be 1° (rotation), 2 pixels (translation), or 0.1x (scaling), and in subsequent iterations it is gradually reduced to 0.1°, 0.5 pixels, or 0.01x to improve the accuracy of local region matching. During this process, the system traverses each local region between images (such as image blocks divided by a fixed grid or dynamic candidate windows), and re-evaluates the degree of matching between regions through local similarity calculation logic: specifically, for each local region (typically 16×16 to 64×64 pixels), the system extracts its geometric features (such as the curvature distribution of the region boundary contour), texture features (such as gray-level co-occurrence matrix statistics or local binary pattern LBP), and intensity features (such as pixel gray-level mean and variance), and calculates its comprehensive similarity index with the corresponding region in another image (such as the combined value of weighted structural similarity (SSIM) and normalized cross-correlation (NCC)). By dynamically comparing the similarity indices of all local regions, the system locates the local region with the highest similarity under the current parameters (i.e., the region with the smallest objective function value). This region is identified as a potential pathological key matching region (such as a location containing overlapping lesions or tissue boundaries).
[0052] For the local region with the highest similarity, a Local Area of Interest (ROI) is delineated with its center point (pixel coordinates) as the core, consisting of A rows vertically and B columns horizontally. (The values of A and B are adaptively adjusted based on image resolution and pathological feature scale. For example, for high-resolution images (≥0.5μm / pixel), A and B can be set to 10~20 pixels; for low-resolution images, they can be extended to 20~30 pixels). The logic behind this ROI delineation is to cover the core part of the local matching region (ensuring the integrity of key pathological information) while retaining sufficient surrounding contextual information (such as the gradient region of the lesion edge) to support subsequent feature enhancement and accurate analysis.
[0053] In one embodiment of this disclosure, since the original pathological slide image may contain sampling noise (such as scanning artifacts), missing information (such as blurred details in low-contrast areas), or local deformation interference, the system employs an intelligent interpolation method to perform high-precision feature enhancement on the ROI. For example, if cubic spline interpolation is selected, the processing logic is as follows: based on the gray values and spatial coordinates of the original pixels within the ROI, a piecewise cubic polynomial function (satisfying boundary continuity and second derivative continuity) is constructed. This function is used to reconstruct the gray values of each pixel within the ROI (including the original pixels and the interpolated sub-pixels), thereby improving the image's detail resolution. If deep learning-based super-resolution reconstruction (such as ESPCN or FSRCNN networks) is used, the trained model directly predicts the high-resolution feature representation of the ROI, compensating for the structural blurring caused by low resolution. This step significantly reduces the impact of original sampling defects on subsequent analysis, ensuring the clarity and reliability of feature representation within the ROI.
[0054] Based on feature enhancement, the matching accuracy is further optimized through multiple iterations of local deformation adjustment: In each iteration, the system fine-tunes the local deformation parameters within the current ROI range (such as rotation ±0.05°, translation ±0.2 pixels), combined with the preset minimum tolerance threshold (such as similarity difference less than 0.01 or deformation parameter change less than 0.001 pixels). When the objective function value changes below the threshold after multiple consecutive iterations (such as 5 to 10 times), the matching is determined to have reached a stable state, and finally the lesion matching area (i.e., the local area in the two images that corresponds to the structure / function) and its internal matching point F (i.e., the key point corresponding to the inter-tissue space, such as the lesion center point or the tissue boundary vertex) are determined.
[0055] In one embodiment of this disclosure, to quantitatively describe the morphological features and tissue relationships of the lesion-matching region, the system utilizes a deep neural network (such as a convolutional neural network CNN) to extract multi-dimensional features of local grid points (high-density pixels or feature points covering the matching region) within the region: geometric features (such as the curvature of the region boundary, contour concavity and convexity), texture features (such as the energy, contrast, and correlation statistics of the gray-level co-occurrence matrix, or rotation-invariant features of the local binary pattern), and intensity features (such as the pixel gray-level mean, variance, and multi-channel intensity distribution histogram). Based on these features, the system constructs a local morphological expression of the lesion-matching region through a three-dimensional surface local fitting algorithm (such as B-spline surface fitting based on the least squares method)—this expression describes the surface shape, texture distribution, and intensity variation of the matching region in the form of a mathematical function (e.g., it can be represented as a three-dimensional surface function z=f(x,y), or a high-dimensional distribution model in a two-dimensional feature space).
[0056] The extracted features cover three core dimensions: First, geometric features, which analyze the topological structure of the region boundary, quantify its curvature changes (such as the curvature value of the local bending degree) and contour concavity and convexity (such as the outward or inward trend of the connection direction of boundary pixels), reflecting the spatial shape pattern of lesions or tissues; Second, texture features, which calculate the statistics of the gray-level co-occurrence matrix based on the gray-level spatial distribution pattern (such as energy value reflecting texture uniformity, contrast value measuring the intensity of gray-level difference, and correlation value describing the degree of gray-level correlation between pixels), or extract rotation-invariant features of local binary patterns (LBP) (such as binary encoding of local pixel neighborhoods and statistically analyzing the distribution of rotation-invariant texture patterns), characterizing the arrangement pattern of tissue microstructure; Third, intensity features, which characterize the differences and characteristics of tissues in the intensity dimension by statistically analyzing the overall distribution characteristics of pixel gray levels, including gray-level mean (reflecting the overall brightness of the region), variance (reflecting the amplitude of gray-level changes), and multi-channel intensity distribution histograms (such as the intensity ratio of different staining channels in multimodal images).
[0057] The surface shape, texture distribution, and intensity variation of the matching region are parametrically described. For example, for a lesion region in three-dimensional space, its surface morphology can be represented as an explicit surface function z=f(x,y) (where x and y are planar coordinates, and z is the intensity or height value at the corresponding position). A smooth surface patch is constructed using B-spline basis functions, and the least squares method is used to minimize the error between the fitted surface and the actual local grid point features (such as geometric position deviation, texture statistics difference, or intensity distribution deviation), thereby determining the optimal function parameters. For two-dimensional feature spaces (such as those only requiring description of the correlation distribution between grayscale and texture), a high-dimensional distribution model can be constructed (such as describing the joint distribution of feature points through principal component analysis or Gaussian mixture models). This local morphological expression not only quantitatively characterizes the morphological features of the matching region (such as boundary sharpness and internal texture complexity) but also implicitly contains structural correlation information between tissues (such as the transition pattern between the lesion and the surrounding normal tissue).
[0058] For example, consider a 32×32 pixel lesion matching region selected in a pathological slide image. A CNN is used to extract multi-dimensional features from each pixel within this region. For geometric features, the calculated average curvature of the region boundary is 0.05 (indicating a relatively smooth boundary), and the contour concavity index is 0.3 (indicating a slight inward concavity trend). Regarding texture features, the energy value of the gray-level co-occurrence matrix is 0.8 (reflecting relatively uniform texture), the contrast value is 0.6 (indicating moderate gray-level differences), and the correlation value is 0.7 (indicating a certain positive correlation between pixel gray levels). In terms of intensity features, the mean pixel gray level is 120 (reflecting a relatively bright overall region), the variance is 25 (indicating small gray-level variations), and the multi-channel intensity distribution histogram shows that the red channel has the highest intensity proportion (approximately 40%). Based on these features, the system uses a B-spline surface fitting algorithm based on the least squares method to construct a local morphological expression. Assuming the fitted 3D surface function is z = 0.01x² + 0.02y² - 0.5xy + 120 (where x and y are pixel coordinates, and z is the intensity value of the corresponding pixel), this function describes the shape of the lesion area surface (e.g., exhibiting a slight parabolic convexity), texture distribution (reflecting texture direction through changes in surface curvature and intensity), and intensity variation pattern (e.g., higher intensity in the central area that gradually decreases outwards). Through this mathematical expression, the system can accurately quantify the morphological characteristics of the lesion area and provide a foundation for the subsequent construction of general pathological equations and contact equations. For example, in the general pathological equation, the shape and intensity variation patterns described by this expression can be used to determine the spatial mapping relationship of the lesion area in different images (e.g., adjusting translation, rotation, and scaling parameters to make the mathematical expressions of the lesion area in two images match as closely as possible), thereby achieving accurate image registration and lesion identification.
[0059] In one embodiment of this disclosure, a deep neural network (such as a convolutional neural network CNN) is used to extract multi-dimensional features of local grid points (high-density pixels or feature points covering the matching area) within the region, specifically: Region Boundary Extraction: Edge detection algorithms (such as the Canny edge detection algorithm) are used to process the image regions where local grid points are located. The Canny algorithm detects edges by calculating the gradient magnitude and direction of each pixel in the image. For each pixel (x, y), its gradient components Gx and Gy in the x and y directions are calculated (for example, the Sobel operator can be used, Gx=(Z(x+1,y+1)+2Z(x+1,y)+Z(x+1,y-1))-(Z(x-1,y+1)+2Z(x-1,y)+Z(x-1,y-1)), and Gy is calculated similarly), and then the gradient magnitude G=sqrt(Gx2+Gy2) and the gradient direction θ=arctan(Gy / Gx) are calculated. Based on the gradient magnitude and direction, set appropriate thresholds (e.g., low threshold T1=20, high threshold T2=60), and determine pixels with gradient magnitude greater than T2 as strong edge points. Pixels with gradient magnitude between T1 and T2 are also considered edge points if there are strong edge points in their neighborhood, thus obtaining a set of region boundary points.
[0060] Curvature Calculation: For the obtained set of boundary points of the region, the system uses differential geometry to calculate the curvature. For each point p on the boundary, the system fits a polynomial curve (e.g., a quadratic polynomial y = ax² + bx + c, with coefficients a, b, and c obtained by least squares fitting) to its local neighborhood (e.g., containing point p and n points before and after it, n = 5). Then, the curvature is calculated according to the curvature formula k = |y''| / (1 + y'²)^(3 / 2), where y' and y'' are the first and second derivatives of the fitted curve, respectively. For example, for the quadratic polynomial y = ax² + bx + c, y' = 2ax + b, y'' = 2a, substituting these values into the formula yields the curvature at that point.
[0061] Contour Concavity / Concavity Determination: The concavity / convexity of the contour is determined based on the curvature calculation results. If the curvature k is always greater than 0 within a certain region, the contour in that region is convex; if the curvature k is always less than 0, it is concave; if the curvature k has both positive and negative values within the region, there is an alternation between concavity and convexity. The system determines the concavity / convexity characteristics of the contour by sequentially traversing the boundary points and based on the change in the sign of the curvature of adjacent points.
[0062] Gray-level co-occurrence matrix (GLCM) construction: A window of a certain size (e.g., 3×3 or 5×5) is selected, centered on a local grid point. For each pixel within the window, the difference between its gray value and the gray value of the center pixel is calculated, and the difference is quantized according to a set number of gray levels (e.g., 8 gray levels). Then, the frequency of the gray-level difference in each direction (e.g., 0°, 45°, 90°, 135°) within this window is counted to construct the GLCM. For example, for the 0° direction, the frequency of gray-level differences between adjacent pixels in the horizontal direction within the window is counted and filled into the corresponding positions in the GLCM.
[0063] Energy Calculation: Energy is an important statistical measure of the gray-level co-occurrence matrix. The system calculates energy by summing the squares of all elements in the gray-level co-occurrence matrix. That is, E=∑∑M²(i,j), where M(i,j) are elements in the gray-level co-occurrence matrix, and i and j represent the gray-level difference and direction, respectively.
[0064] Contrast Calculation: Contrast reflects the sharpness of image texture. The system calculates the contrast by summing the squares of the differences between the elements in the gray-level co-occurrence matrix and their mean. The formula is C=∑∑(i-μ)²M(i,j), where μ is the mean of the elements in the gray-level co-occurrence matrix.
[0065] Correlation Calculation: Correlation measures the linear correlation between elements in the gray-level co-occurrence matrix. The system calculates the correlation by summing the products of each element and its mean, then dividing by the standard deviation. The formula is Corr=∑∑[(i-μi)(j-μj)M(i,j)] / σiσj, where μi and μj are the row and column means, respectively, and σi and σj are the row and column standard deviations, respectively.
[0066] Local Binary Pattern (LBP) Feature Extraction: For a local grid point and its neighboring pixels (e.g., a 3×3 neighborhood), the grayscale value of the center pixel is used as a threshold. The grayscale values of the neighboring pixels are compared with those of the center pixel. If the grayscale value of a neighboring pixel is greater than or equal to that of the center pixel, the corresponding binary bit is set to 1; otherwise, it is set to 0. The binary bits of the neighboring pixels are combined into an 8-bit binary number in a clockwise or counterclockwise direction, and then converted to a decimal number to obtain the LBP value of the local grid point. By performing LBP calculations on different radii and numbers of neighboring pixels (e.g., radius 1, number of neighboring pixels 8), LBP features at different scales can be obtained. These features are rotation-invariant.
[0067] Pixel grayscale mean calculation: The system sums the grayscale values of all pixels within a small region (such as a 3×3 or 5×5 region) containing a local grid point, and then divides the sum by the number of pixels in that region to obtain the pixel grayscale mean. For example, for a 3×3 region, if the grayscale values of 9 pixels are I1, I2, ..., I9, then the grayscale mean μ = (I1 + I2 + ... + I9) / 9.
[0068] Pixel grayscale variance calculation: First, calculate the square of the difference between the grayscale value of each pixel and the mean grayscale value. Then, sum these squared values and divide by the number of pixels to obtain the pixel grayscale variance. The formula is σ²=(1 / N)∑(Ii-μ)², where N is the number of pixels, Ii is the grayscale value of the i-th pixel, and μ is the mean grayscale value.
[0069] Multi-channel intensity distribution histogram construction: For multi-channel images (such as RGB images), the system statistically analyzes the pixel intensity values of each channel. For each channel, its grayscale range is determined (e.g., 0-255), and then the frequency of each grayscale level in that channel is counted to construct the intensity distribution histogram for that channel. For example, for the red channel, grayscale level 0 appears 10 times, grayscale level 1 appears 15 times, ..., grayscale level 255 appears 8 times, thus obtaining the intensity distribution histogram for the red channel. The same operation is performed for the green and blue channels, ultimately obtaining a multi-channel intensity distribution histogram, which reflects the intensity distribution characteristics of the image across different channels.
[0070] In one embodiment of this disclosure, based on local morphological expressions, the system further constructs two core mathematical models: the first is a general pathological equation, which uses the matching point F as a reference point to quantitatively describe the structural correspondence between two pathological slide images (or different tissue layers / slices) in the matching region (e.g., by a linear combination of translation vector t=(Δx,Δy), rotation matrix R(θ), and scaling factor s, or by a parameterized representation of a nonlinear deformation field, clarifying the spatial mapping rules between tissues); the second is a contact equation, which characterizes the probability distribution or interaction intensity model of the overlapping areas of tissues within the matching region (e.g., by describing the overlap probability density of lesion edges through a Gaussian mixture model, or by reflecting the contact intensity between cell clusters through an intensity gradient field).
[0071] In a pathological slide image, a lesion matching region of size 32×32 pixels was selected. The system extracted multi-dimensional features of each pixel within this region using a CNN. For geometric features, the calculated average curvature of the region boundary was 0.05 (indicating a relatively gentle boundary), and the contour concavity index was 0.3 (indicating a slight inward concavity trend). Regarding texture features, the energy value of the gray-level co-occurrence matrix was 0.8 (reflecting relatively uniform texture), the contrast value was 0.6 (indicating moderate gray-level differences), and the correlation value was 0.7 (indicating a certain positive correlation between pixel gray levels). In terms of intensity features, the mean pixel gray level was 120 (reflecting a relatively bright overall region), the variance was 25 (reflecting small gray-level variations), and the multi-channel intensity distribution histogram showed that the red channel had the highest intensity proportion (approximately 40%). Based on these features, the system employed a B-spline surface fitting algorithm based on the least squares method to construct a local morphological expression. Assuming the fitted 3D surface function is z = 0.01x² + 0.02y² - 0.5xy + 120 (where x and y are pixel coordinates, and z is the intensity value of the corresponding pixel), this function describes the shape of the lesion area surface (e.g., exhibiting a slight parabolic convexity), texture distribution (reflecting texture direction through changes in surface curvature and intensity), and intensity variation pattern (e.g., higher intensity in the central area that gradually decreases outwards). Through this mathematical expression, the system can accurately quantify the morphological characteristics of the lesion area and provide a foundation for the subsequent construction of general pathological equations and contact equations. For example, in the general pathological equation, the shape and intensity variation patterns described by this expression can be used to determine the spatial mapping relationship of the lesion area in different images (e.g., adjusting translation, rotation, and scaling parameters to make the mathematical expressions of the lesion area in two images match as closely as possible), thereby achieving accurate image registration and lesion identification. Suppose that in another image, the mathematical expression for the same lesion region is z'=0.01(x-2)2+0.02(y+1)2-0.5(x-2)(y+1)+125. By minimizing the difference between the two expressions (e.g., calculating the mean square error), the system determines the translation vector t=(2,-1) pixels, the rotation angle θ=0.3° (the corresponding rotation matrix R(θ) is used to adjust the orientation consistency), and the scaling factor s=1.02 (to compensate for imaging scaling differences), thereby constructing a general pathological equation to describe the spatial correspondence of the lesion region in the two images. For the contact equation, if there is a blurred overlap at the edge of the lesion, the system adopts a Gaussian mixture model. Let the two Gaussian components correspond to the tumor and normal tissue respectively, with mean vectors of (120,120) and (110,110) and covariance matrices of [[10,0],[0,10]] and [[15,5],[5,15]] respectively. By calculating the probability that a certain pixel belongs to the overlapping area of tumor and normal tissue, it is found to be 0.75, indicating that the height of this position may be the coexistence area of the two tissues, thus quantitatively describing the probability distribution of the tissue overlap area.
[0072] Finally, based on the obtained precise matching point data (including the coordinates of matching point F, local morphological expressions, and mathematical model parameters), the system dynamically evaluates the synergistic effect of multiple regions: by rotating adjacent slices (or adjusting the spatial position of adjacent tissue layers), it calculates the changes in the matching status between other regions and the target matching region (especially the difference between the theoretical rotation angle required for other regions to achieve matching and the actual observation angle), quantifying the participation probability of "adjacent regions" (such as lesions before and after in continuous slices, or corresponding tissue layers in multimodal images) in the matching process (i.e., the possibility of actual association between this region and the target region). Based on this probability evaluation result, the system adaptively adjusts the contact equation (such as correcting the probability distribution parameters or interaction intensity weights), thereby achieving advanced multi-region joint recognition of pathological slice images that **considers tissue overlap (such as the volume ratio of overlapping areas of multiple lesions), synergistic effects of multiple regions (such as the mechanical / functional association of adjacent tissues), and interactive effects of multiple lesions (such as the spatial association between metastatic lesions and primary lesions).**
[0073] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0074] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to specific implementations. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.
Claims
1. A method for recognizing pathological images, characterized in that: The identification method includes the following steps: S1: Collect m×n image data of the entire image range from multiple pathological slide images, and construct a spatial mapping matrix between pathological slide images using image registration technology. Align multiple pathological slide images to the same reference coordinate system through affine transformation algorithm to form an image registration model. S2: Extract feature points in the middle region of multiple pathological slide images in the image registration model to form a feature point set. Use the local deformation parameters between pathological slide images as optimization variables and the weighted comprehensive index between the two feature point sets as the objective function. Continuously adjust the relative pose between pathological slide images through iterative optimization algorithm until the combination of local deformation parameters that minimizes the objective function between the two feature point sets is found. S3: Based on the current combination of local deformation parameters, the search step size is gradually reduced, the similarity of local regions between pathological slide images is calculated, the local region with the highest similarity is located, and a local pathological interest region with A rows above and B columns to the left and right is delineated with the center point of the local region. After multiple iterations of local deformation adjustment and combined with the minimum tolerance threshold, the lesion matching region and the matching point F of the lesion matching region are determined. The geometric, texture and intensity features of the lesion matching region are extracted using a deep neural network, and a three-dimensional surface is locally fitted to obtain the local morphological expression. Based on this, the general pathological equation and contact equation of the two pathological slide images at the matching point F are constructed to realize the joint recognition of multiple regions.
2. The method for recognizing pathological images according to claim 1, characterized in that: The weighted comprehensive index is obtained by weighted calculation of structural similarity and pixel grayscale difference.
3. The method for recognizing pathological images according to claim 2, characterized in that: S3: Based on the current combination of local deformation parameters, gradually reduce the search step size and calculate the local region similarity between pathological slide images, including the following steps: Using the combination of local deformation parameters as the initial benchmark, the precision of the deformation increment is gradually reduced, and the local regions between pathological slice images are traversed. Geometric features, texture features, and intensity features are extracted from each local region of the current pathological slide image, and the comprehensive similarity index of the local regions at corresponding locations in the current pathological slide image and another pathological slide image is calculated. By dynamically comparing the similarity index of each local region, the local region with the highest similarity under the current parameters is located.
4. The method for recognizing pathological images according to claim 3, characterized in that: S3: Delineate local pathological regions of interest (ROIs) in rows A vertically and columns B horizontally based on the center point of the most similar local regions. Enhance their features through intelligent interpolation. After multiple iterations of local deformation adjustment and incorporating the minimum tolerance threshold, determine the lesion matching region and its matching point F. This includes the following steps: Using the center point of the local region with the highest similarity, delineate the local pathological interest regions in rows A above and below, and columns B to the left and right; Based on the gray values and spatial coordinates of the original pixels in the local pathological region of interest, a piecewise cubic polynomial function is constructed, and the gray values of each pixel in the local pathological region of interest are reconstructed by the piecewise cubic polynomial function. The matching accuracy is optimized by iterating the local deformation adjustment. In each iteration, the local deformation parameters are adjusted within the current local pathological region of interest, and the similarity index between the adjusted local pathological region of interest and the target region is recalculated. When the index changes in consecutive iterations are lower than the minimum tolerance threshold, the matching is determined to have reached a stable state, and the lesion matching area and its internal matching point F are determined.
5. The method for recognizing pathological images according to claim 3, characterized in that: S3: Utilize a deep neural network to extract the geometric, texture, and intensity features of the matching region of the lesion, perform local fitting of a three-dimensional surface, obtain the local morphological expression, and construct the general pathological equation and contact equation for the two pathological slice images at the matching point F to achieve joint recognition of multiple regions, including the following steps: A deep neural network is used to extract multi-dimensional features of local grid points within the lesion matching region, and a local morphological expression of the lesion matching region is constructed by B-spline surface fitting using the least squares method. Based on local morphological expressions, with the matching point F as the reference point, the structural correspondence between two pathological slide images in the matching region is quantitatively described. The intensity gradient field reflects the contact intensity between cell clusters, characterizing the probability distribution of overlapping tissue regions within the matching area. Complete the joint identification of multiple regions in pathological slide images, taking into account tissue overlap, multi-regional synergistic effects, and the interactive influence of multiple lesions.
6. The method for recognizing pathological images according to claim 2, characterized in that: S2: The relative poses between pathological slide images are continuously adjusted through an iterative optimization algorithm until the combination of local deformation parameters that minimizes the objective function between the two sets of feature points is found. This includes the following steps: The local deformation parameter is defined as the optimization variable, the current objective function value is used as the optimization objective, and the local deformation parameter is taken as the initial guess value when the algorithm is initialized; In each iteration, the gradient of the objective function with respect to each deformation parameter is calculated, and the parameter values are adjusted according to the gradient direction. The iterative process continues until the objective function value converges or the maximum number of iterations is reached, obtaining the combination of local deformation parameters that minimizes the objective function value, i.e., the optimized rotation angle, translation amount, scaling factor, and local deformation parameters.
7. The method for recognizing pathological images according to claim 6, characterized in that: The combination of local deformation parameters includes optimized rotation angle, translation amount, scaling factor, and local deformation parameters.
8. The method for recognizing pathological images according to claim 1, characterized in that: S1: Construct a spatial mapping matrix between pathological slide images using image registration techniques, and align multiple pathological slide images to the same reference coordinate system using an affine transformation algorithm to form an image registration model, including the following steps: Feature regions in multiple pathological slide images are identified using feature detection algorithms, and the spatial correspondence between feature regions is calculated. Based on the calculation results, spatial transformation parameters between pathological slide images are estimated, and a comprehensive set of transformation parameters is constructed. For each pixel coordinate (x, y) in the original image, its new coordinates (x', y') in the reference coordinate system are calculated based on the translation, rotation, and scaling parameters in the spatial mapping matrix, thus forming an image registration model.
9. The method for recognizing pathological images according to claim 8, characterized in that: The comprehensive transformation parameter set includes translation, rotation, scaling, and non-rigid deformation.
10. A pathological image recognition system for implementing the recognition method according to any one of claims 1-9, characterized in that: It includes an image acquisition and preprocessing module, an iterative adjustment module, a region analysis module, and an image recognition module; Image acquisition and preprocessing module: Acquires m×n image data of the entire image range of multiple pathological slide images, and constructs a spatial mapping matrix between pathological slide images using image registration technology. The multiple pathological slide images are aligned to the same reference coordinate system through affine transformation algorithm to form an image registration model. Iterative adjustment module: Extracts feature points in the middle region of multiple pathological slide images in the image registration model to form a feature point set. Using the local deformation parameters between pathological slide images as optimization variables and the weighted comprehensive index between the two feature point sets as the objective function, the relative pose between pathological slide images is continuously adjusted through iterative optimization algorithm until the combination of local deformation parameters that minimizes the objective function between the two feature point sets is found. Region Analysis Module: Based on the current combination of local deformation parameters, the search step size is gradually reduced, the similarity of local regions between pathological slide images is calculated, the local region with the highest similarity is located, and the local pathological interest region is delineated with the center point of the local region in rows A above and below and columns B to the left and right. Its features are enhanced by intelligent interpolation. After multiple iterations of local deformation adjustment and combined with the minimum tolerance threshold, the lesion matching region and the matching point F of the lesion matching region are determined. Image recognition module: Utilizes deep neural networks to extract the geometric, texture, and intensity features of the matching region of the lesion, performs local fitting of the three-dimensional surface, obtains the local morphological expression, and constructs the general pathological equation and contact equation of the two pathological slice images at the matching point F to achieve joint recognition of multiple regions.
Citation Information
Cited By
Tissue slice image automatic registration method and device and electronic equipment
CN122049010A
