A method and system for correcting staining differences in cervical pathology slides

CN122905912APending Publication Date: 2026-10-13JIANGXI YIZHICHU MEDICAL PATHOLOGICAL DIAGNOSIS MANAGEMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611399590.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-10
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0008]本发明提供一种宫颈病理切片染色差异校正方法及系统,用于解决无法在无参考条件下实现染色差异的自适应校正,且缺乏对局部染色差异的精细处理能力的技术问题

Benefits of technology

以细胞核空间分布为内在参考系,完全摆脱外部参考图像依赖。现有方法需要标准参考图像进行直方图匹配或颜色迁移,利用宫颈病理切片中细胞核的密度分布和空间排列作为内在参考系,通过等灰度等高线的层级嵌套结构提取细胞核位置和轮廓,使校正过程完全自包含、自参照;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122905912A_ABST
    Figure CN122905912A_ABST
Patent Text Reader

Abstract

The application discloses a cervical pathological section staining difference correction method and system, and the method comprises the following steps: constructing a cell nucleus spatial distribution map; determining a nucleus density field and a nucleus spacing distribution feature according to the cell nucleus spatial distribution map; taking the local maximum point of the nucleus density field as an anchor point and taking the nucleus spacing distribution feature as a scale constraint, aligning the cell nucleus spatial distribution maps of all images to a unified spatial reference coordinate system; in the aligned coordinate system, dividing multiple local correction regions with the anchor point as the center, extracting the chroma features of the cell nucleus and cytoplasm regions in each region and calculating the nucleus-cytoplasm chroma difference value; taking the chroma difference value at the anchor point as a reference, obtaining the difference ratio sequence of each pixel position, and determining the staining difference correction coefficient of each local correction region; correcting each pixel value in each region by using the coefficient, and outputting the corrected image. With the cell nucleus spatial distribution as an internal reference system, an external reference image is not needed, and the adaptive correction of the staining difference is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of pathological image processing technology, and in particular relates to a method and system for correcting staining differences in cervical pathological sections. Background Technology

[0002] Microscopic images of cervical pathology slides are crucial for cervical cancer screening and diagnosis. During slide preparation, factors such as batch variations in staining reagents, staining times, uneven slide thickness, and inconsistencies in laboratory operating procedures can lead to significant staining differences between different slides from the same tissue source, and even between different regions of the same slide. These staining differences manifest as variations in the color intensity and contrast between cell nuclei and cytoplasm, directly impacting pathologists' judgment of cell morphology and the accuracy of computer-aided diagnostic systems.

[0003] Existing staining difference correction methods can be mainly classified into the following categories: One method is based on histogram matching. This involves matching the gray-level histogram of the image to be corrected with that of a standard reference image, making the gray-level distribution of the image to be corrected approximate that of the reference image. However, this type of method requires a high-quality reference image and has limited effectiveness in correcting color shifts caused by differences in staining, and it cannot handle cases of localized uneven staining.

[0004] The second method is based on color transfer. This method achieves overall color transfer by establishing a color mapping relationship between the image to be corrected and the reference image in a specific color space. However, this type of method also relies on an external reference image and lacks the ability to distinguish color changes in different tissue structures (such as cell nuclei, cytoplasm, and interstitial tissue), which can easily lead to color confusion between different tissue types.

[0005] Thirdly, there are methods based on dye separation. These methods estimate the dyeing matrix to separate the image into concentration maps of different dyes, and then normalize these concentration maps. However, these methods require prior knowledge of the dye's color basis vectors and are sensitive to dye color changes caused by dyeing differences; the separation accuracy decreases significantly when the dyeing differences are large.

[0006] In summary, existing methods generally rely on external reference images or prior staining models, cannot achieve adaptive correction of staining differences under no-reference conditions, and lack the ability to finely process local staining differences.

[0007] Therefore, there is a need for a method that does not rely on external reference images and can adaptively correct staining differences by utilizing the tissue structure characteristics of the pathological sections themselves. Summary of the Invention

[0008] This invention provides a method and system for correcting staining differences in cervical pathology sections, which solves the technical problems of being unable to achieve adaptive correction of staining differences under no-reference conditions and lacking the ability to finely process local staining differences.

[0009] In a first aspect, the present invention provides a method for correcting staining differences in cervical pathological sections, comprising: Multiple microscopic images of cervical pathology sections are acquired. The position coordinates and contour boundaries of cell nuclei in each microscopic image are extracted according to a preset image analysis strategy. A spatial distribution map of cell nuclei corresponding to each microscopic image is constructed. The spatial distribution map of cell nuclei uses the position coordinates of cell nuclei as nodes and the spatial distance relationship between cell nuclei as edges. Based on the nuclear spatial distribution map, the nuclear density field and internuclear distance distribution characteristics of each microscopic image are determined. The local maxima of the nuclear density field are used as anchor points, and the internuclear distance distribution characteristics are used as scale constraints to align the nuclear spatial distribution maps of each microscopic image to a unified spatial reference coordinate system. In the aligned spatial reference coordinate system, multiple local correction regions are divided with each anchor point as the center and the neighborhood radius determined by the internuclear distance distribution characteristics as the boundary. The chromaticity features of the nucleus region and the chromaticity features of the cytoplasm region are extracted in each local correction region, and the chromaticity difference value between the nucleus region and the cytoplasm region in each local correction region is calculated. Based on the chromaticity difference value at the anchor point, the chromaticity difference values ​​at each pixel position within the same local correction area are compared with the chromaticity difference value at the anchor point to obtain a difference ratio sequence corresponding to each pixel position. The color difference correction coefficient of each local correction area is determined based on the difference ratio sequence. The pixel values ​​of each pixel in each local correction area are corrected using the staining difference correction coefficient, and the corrected cervical pathology slide image is output.

[0010] Secondly, the present invention provides a cervical pathology section staining difference correction system, comprising: The module is configured to acquire microscopic images of multiple cervical pathology slides, extract the position coordinates and contour boundaries of cell nuclei in each microscopic image according to a preset image analysis strategy, and construct a spatial distribution map of cell nuclei corresponding to each microscopic image. The spatial distribution map of cell nuclei uses the position coordinates of cell nuclei as nodes and the spatial distance relationship between cell nuclei as edges. The alignment module is configured to determine the nuclear density field and internuclear distance distribution characteristics of each microscopic image based on the nuclear spatial distribution map, use the local maxima of the nuclear density field as anchor points and the internuclear distance distribution characteristics as scale constraints, and align the nuclear spatial distribution maps of each microscopic image to a unified spatial reference coordinate system. The partitioning module is configured to divide multiple local correction regions in the aligned spatial reference coordinate system, with each anchor point as the center and the neighborhood radius determined by the internuclear distance distribution characteristics as the boundary. In each local correction region, the chromaticity features of the nucleus region and the chromaticity features of the cytoplasm region are extracted respectively, and the chromaticity difference value between the nucleus region and the cytoplasm region in each local correction region is calculated. The determination module is configured to compare the chromaticity difference values ​​at each pixel position within the same local correction area with the chromaticity difference value at the anchor point, based on the chromaticity difference value at the anchor point, to obtain a difference ratio sequence corresponding to each pixel position, and to determine the color difference correction coefficient of each local correction area based on the difference ratio sequence. The correction module is configured to use the staining difference correction coefficient to correct the pixel values ​​of each pixel in each local correction area and output the corrected cervical pathology slide image.

[0011] Thirdly, an electronic device is provided, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the steps of the cervical pathology section staining difference correction method according to any embodiment of the present invention.

[0012] Fourthly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the program instructions are executed by a processor, the processor performs the steps of the cervical pathology section staining difference correction method according to any embodiment of the present invention.

[0013] The method and system for correcting staining differences in cervical pathology sections disclosed in this application have the following beneficial effects: Using the spatial distribution of cell nuclei as an intrinsic reference frame, this method completely eliminates dependence on external reference images. Existing methods require standard reference images for histogram matching or color transfer. This method utilizes the density distribution and spatial arrangement of cell nuclei in cervical pathology sections as an intrinsic reference frame, extracting the cell nucleus position and contour through a hierarchical nested structure of equal grayscale contour lines, making the correction process completely self-contained and self-referential. Anchor point extraction is based on local maxima of the nuclear density field. Nuclear density estimation depends only on the spatial distribution of cell nuclei and is independent of pixel color values. Staining differences alter pixel color values ​​but not the spatial distribution of cell nuclei; therefore, nuclear density field anchor points are naturally immune to staining differences.

[0014] The main peak of the internuclear distance histogram corresponds to the primary distance between cell nuclei, and the secondary peak corresponds to the close distance within the cell nucleus aggregation region. The ratio of the two eigenvalues ​​reflects the non-uniformity of the spatial distribution of cell nuclei and serves as a radius adjustment coefficient to make the size of the local correction region adapt to the cell nucleus aggregation density.

[0015] Using the cell nucleus outline as the seed boundary, the expansion is carried out pixel by pixel along the outer normal direction. The expansion stops adaptively by the grayscale change amplitude, without the need to preset a fixed number of expansion layers or boundary threshold, so that the delineation of the cytoplasmic region can be adapted to local image features.

[0016] Kernel density estimation is used to extract the probability density distribution of the difference ratio sequence. The correction coefficients are determined by peak detection and peak width analysis. It does not rely on any prior correction coefficient range or threshold setting, and is completely data-driven. The correction coefficients are directly used to correct the pixel values ​​of each channel, which is completely different from the existing methods based on histogram matching or color migration in terms of the calculation path. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart of a method for correcting staining differences in cervical pathology sections provided in an embodiment of the present invention; Figure 2 This is a structural block diagram of a cervical pathology section staining difference correction system provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0019] 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.

[0020] Please see Figure 1 The diagram shows a flowchart of a method for correcting staining differences in cervical pathology sections according to this application.

[0021] like Figure 1As shown, the method for correcting staining differences in cervical pathology sections specifically includes the following steps: Step S101: Obtain microscopic images of multiple cervical pathology slides, extract the position coordinates and contour boundaries of cell nuclei in each microscopic image according to a preset image analysis strategy, and construct a spatial distribution map of cell nuclei corresponding to each microscopic image. The spatial distribution map of cell nuclei uses the position coordinates of cell nuclei as nodes and the spatial distance relationship between cell nuclei as edges.

[0022] In this step, a preset number of gray levels is determined based on the dynamic range of gray values ​​of a certain microscopic image, wherein the preset number is the ratio of the dynamic range of gray values ​​to a preset gray level interval. According to a certain preset number of gray levels, the gray values ​​of each pixel in a certain microscopic image are divided into various gray levels. Each gray level corresponds to a gray value range. Pixels whose gray values ​​fall into the same gray value range are grouped into the same gray level set to obtain the set of equal gray pixels corresponding to each gray level. In a set of pixels with the same gray level, adjacent pixels are grouped into the same connected group to obtain multiple connected groups corresponding to a certain gray level. Each connected group consists of pixels whose gray values ​​fall into the same gray level and whose spatial positions are continuous. From all connected groups corresponding to all gray levels, the connected groups that form closed loops are selected, and the connected groups that form closed loops are marked as equal gray level closed contours. The equal gray level closed contours are the lines connecting pixels in the image with the same gray value and connected end to end to form a closed ring structure. The inclusion relationship between the equal grayscale closed contours is detected. The equal grayscale closed contours that are not included by any other equal grayscale closed contours are marked as the first layer contours, the equal grayscale closed contours included by the first layer contours are marked as the second layer contours, the equal grayscale closed contours included by the second layer contours are marked as the third layer contours, and so on, to obtain the nesting level of each equal grayscale closed contour. From all equal-grayscale closed contours, select equal-grayscale closed contours whose nesting levels meet preset level conditions as equal-grayscale contour lines of the cell nucleus. Use the geometric center of the equal-grayscale contour lines as the position coordinates of the cell nucleus. Use the line connecting the pixels of the equal-grayscale contour lines as the contour boundary of the cell nucleus. The preset level condition is that the nesting levels of the equal-grayscale closed contours simultaneously have at least one outer equal-grayscale closed contour and at least one inner equal-grayscale closed contour, that is, the number of levels of the equal-grayscale closed contours is not less than three. Using the position coordinates of all cell nuclei as nodes and the outline boundaries of all cell nuclei as node attributes, a spatial distribution map of cell nuclei corresponding to a certain microscopic image is constructed.

[0023] In one specific embodiment, firstly, multiple microscopic images of cervical pathological sections are acquired. These microscopic images are digital images of cervical exfoliated cells acquired under a microscope after Papanicolaou staining or HE staining. The image format is RGB color images, and each image has the same magnification and resolution. Each microscopic image is converted from the RGB color space to the grayscale color space by taking the weighted average of the red, green, and blue channels of each pixel to obtain the corresponding grayscale image.

[0024] For each grayscale image, the dynamic range of grayscale values ​​is obtained. The dynamic range of grayscale values ​​is the difference between the maximum and minimum grayscale values ​​in the grayscale image. The dynamic range of grayscale values ​​is divided by a preset grayscale interval, and the quotient is used as the preset number of grayscale levels. The preset grayscale interval is determined based on the statistical difference in grayscale values ​​between the nucleus region and the cytoplasm region. Specifically, the preset grayscale interval is set to 5 grayscale levels. When the dynamic range of grayscale values ​​cannot be divided evenly by the preset grayscale interval, the preset number of grayscale levels is rounded up.

[0025] According to a preset number of gray levels, the gray values ​​of each pixel in the grayscale image are divided into various gray levels. Each gray level corresponds to a gray value interval, and the width of the gray value interval is equal to the preset gray interval. The gray value interval corresponding to the first gray level is the sum of the minimum gray value of the grayscale image and the preset gray interval. The gray value interval corresponding to the second gray level is the sum of the endpoint of the previous interval and the preset gray interval. This process continues until the entire gray value range of the grayscale image is covered. Pixels whose gray values ​​fall into the same gray value interval are grouped into the same gray level set, resulting in a set of equal gray values ​​for each gray level. The set of equal gray values ​​contains all pixels in the image whose gray values ​​fall into the corresponding gray value interval.

[0026] For each gray level, the set of pixels with the same gray level is detected. Adjacent pixels are grouped into the same connected group. Adjacent pixels are defined as two pixels whose distance in the horizontal, vertical or diagonal direction is less than or equal to one pixel unit. Each connected group consists of pixels whose gray values ​​fall into the same gray level and whose spatial positions are continuous. The outer boundary of the connected group forms a closed or open curve composed of the boundary pixels in the connected group.

[0027] From all connected groups corresponding to all gray levels, connectable groups that form closed loops are selected. A connected group that forms a closed loop is one whose outer boundary curves are connected end to end to form a closed ring structure. That is, there is no path connecting the inside of the region occupied by the connected group to the outside. Connectable groups that form closed loops are marked as equal gray level closed contours. Equal gray level closed contours are the lines connecting pixels in the image whose gray values ​​fall within the same gray value range and whose boundaries are connected end to end to form a closed ring structure.

[0028] Perform hierarchical nesting analysis on all detected equal grayscale closed contours. For any two equal grayscale closed contours, check whether the first equal grayscale closed contour is completely inside the second equal grayscale closed contour. Completely inside means that all pixels of the first equal grayscale closed contour are located inside the region enclosed by the second equal grayscale closed contour. If the first equal grayscale closed contour is completely inside the second equal grayscale closed contour, then it is determined that the first equal grayscale closed contour is contained by the second equal grayscale closed contour.

[0029] Based on the above inclusion relationship, the grayscale closed contour that is not included by any other grayscale closed contour is marked as the first layer contour, the grayscale closed contour that is included by the first layer contour is marked as the second layer contour, the grayscale closed contour that is included by the second layer contour is marked as the third layer contour, and so on, until all grayscale closed contours are assigned the corresponding layer, thus obtaining the nested layer of each grayscale closed contour.

[0030] From all the closed contours of equal grayscale, closed contours of equal grayscale that meet the preset level conditions are selected as the contours of equal grayscale of the cell nucleus. The preset level conditions are that the closed contours of equal grayscale have at least one outer layer and at least one inner layer of equal grayscale closed contours, that is, the number of levels of the closed contours of equal grayscale is not less than three. The outer layer of equal grayscale closed contour is the closed contour of equal grayscale with a nesting level lower than the closed contour of equal grayscale, and the inner layer of equal grayscale closed contour is the closed contour of equal grayscale with a nesting level higher than the closed contour of equal grayscale. In a cell nucleus region, the outermost contour of the cell nucleus corresponds to the boundary of the nuclear membrane, and the inner contour corresponds to the boundary of the chromatin aggregation region in the nucleus. A ring-shaped region is formed between the outer and inner layers. Closed contours of equal grayscale with both outer and inner layers are located in the middle region of the cell nucleus. This position corresponds to the boundary where the chromatin distribution density inside the cell nucleus changes significantly, that is, the effective contour boundary of the cell nucleus.

[0031] The geometric center of the selected contour lines of equal grayscale is used as the position coordinates of the cell nucleus. The geometric center is the centroid of the region enclosed by the contour lines of equal grayscale, obtained by calculating the arithmetic mean of the coordinates of all pixels within this region. The line connecting the pixels of the contour lines of equal grayscale is used as the outline boundary of the cell nucleus. This outline boundary is a closed loop curve formed by connecting the beginning and end of pixels whose grayscale values ​​fall within the same grayscale value range. Its shape and size are determined by the grayscale distribution.

[0032] Using the position coordinates of all cell nuclei as the node set and the spatial distance relationships between cell nuclei as edges, a cell nucleus spatial distribution map is constructed. The edges between nodes in the cell nucleus spatial distribution map represent that two cell nuclei are spatially adjacent. The adjacent relationship is defined as follows: for each node, the K nodes that are spatially closest to the node are taken as the neighbor nodes of the node, and an edge is formed between the node and each of its neighbor nodes. The value of K is 6 to 10. Using the outline boundary of all cell nuclei as the attribute information of the nodes, the outline boundary is associated with the corresponding position coordinate node and stored. The neighbor nodes are used for the calculation of the internuclear distance set in the subsequent steps. Specifically, the Euclidean distance between each node and its K neighbor nodes is calculated, and the neighbor distances corresponding to all nodes are merged into the internuclear distance set.

[0033] This step achieves automatic extraction of cell nuclei through hierarchical nesting analysis of equal grayscale contour lines. Its technical advantages are reflected in the following aspects: Existing methods for detecting cell nuclei rely on grayscale thresholding. When staining differences cause an overall grayscale shift in the cell nucleus, both fixed and adaptive thresholds may fail. This step discretizes the grayscale values ​​into multiple grayscale levels and identifies cell nuclei by analyzing the nesting hierarchy of iso-grayscale closed contours, completely independent of any grayscale threshold setting. The iso-grayscale closed contours in the cell nucleus region exhibit a multi-layered nested structure due to the distribution of chromatin within the nucleus, and this structural feature remains unchanged as staining lightens or darkens.

[0034] In the nucleus, due to the aggregation of chromatin within the nucleus forming localized extreme gray-level regions, iso-gray-level contour lines exhibit a nested structure of multiple closed loops. The outermost contour line corresponds to the nuclear membrane boundary, the middle contour lines correspond to the boundaries of chromatin density variations, and the innermost contour line corresponds to the boundaries of high-density chromatin aggregation regions. Non-nuclear regions (such as cytoplasm and background) do not possess this multi-layered nested contour line structure. By detecting iso-gray-level closed contours with a nesting level of at least two, the nucleus and non-nuclear regions can be accurately distinguished.

[0035] The pixel connection of the contour lines forms a precise closed loop curve. This curve is formed by connecting adjacent pixels whose gray values ​​fall within the same gray value range, and its geometric position precisely corresponds to the position of the gray-level contour lines at the sub-pixel level. The cell nucleus region extracted based on this contour boundary is unaffected by binarization errors in threshold segmentation in terms of shape and area, providing accurate contour data for subsequent calculation of internuclear distance distribution features. The contour boundary is stored as a node attribute in the cell nucleus spatial distribution map, ensuring the consistency between contour data and positional data, and providing node data containing contour morphology information for anchor point localization of the kernel density field in subsequent step S102.

[0036] Step S102: Based on the nuclear spatial distribution map, determine the nuclear density field and internuclear distance distribution characteristics of each microscopic image, use the local maxima of the nuclear density field as anchor points, and use the internuclear distance distribution characteristics as scale constraints to align the nuclear spatial distribution maps of each microscopic image to a unified spatial reference coordinate system.

[0037] In this step, for each microscopic image corresponding to the cell nucleus spatial distribution map, the Euclidean distance between any two adjacent nodes in the cell nucleus spatial distribution map is calculated to obtain the internuclear distance set corresponding to the cell nucleus spatial distribution map. The frequency distribution of internuclear distances in the internuclear distance set is statistically analyzed to obtain the internuclear distance histogram corresponding to the internuclear distance set. The horizontal axis of the internuclear distance histogram is the range of internuclear distance values, and the vertical axis is the percentage of internuclear distances falling within each value range to the total number of internuclear distances. The interval with the highest percentage in the internuclear distance histogram is extracted as the main peak interval. The median value of the main peak interval is used as the main peak feature value of the internuclear distance in the microscopic image. The interval with the second highest percentage in the internuclear distance histogram is used as the secondary peak interval. The median value of the secondary peak interval is used as the secondary peak feature value of the internuclear distance in the microscopic image. The main peak feature value and the secondary peak feature value of the internuclear distance are combined to form the internuclear distance distribution morphology feature vector of the microscopic image. For the spatial distribution map of cell nuclei corresponding to each microscopic image, the nuclear density estimation is performed with a preset multiple of the main peak feature value of the internuclear distance as the search radius and all node positions in the spatial distribution map of cell nuclei as sample points. The nuclear density estimation value at each node position is obtained. Nodes with nuclear density estimation values ​​greater than a preset density threshold are marked as high-density nodes. Nodes with nuclear density estimation values ​​of local maxima are selected from all high-density nodes as anchor points to obtain the anchor point set corresponding to each microscopic image. Using the main peak feature value of the internuclear distance as the scale constraint parameter, the spatial reference coordinate system of the target microscopic image with the most anchor points in the anchor point set is set as the unified spatial reference coordinate system, and the target microscopic image is used as the reference image. For each microscopic image to be aligned, excluding the reference image, each anchor point in the anchor point set of the reference image is used as a reference point. The anchor point in the anchor point set of the microscopic image to be aligned that is spatially closest to the reference point is searched as a matching point. A one-to-one correspondence between the anchor points of the reference image and the anchor points of the microscopic image to be aligned is established to obtain an anchor point matching set. The anchor point matching set contains multiple matching pairs. Each matching pair contains a reference image anchor point and a corresponding microscopic image anchor point to be aligned. For each matching pair in the anchor point matching set, a first neighbor set is formed by a predetermined number of nearest neighbor anchor points of the reference image anchor point in the anchor point set of the reference image, and a second neighbor set is formed by a predetermined number of nearest neighbor anchor points of the microscopic image anchor point to be aligned in the anchor point set of the microscopic image to be aligned. A first distance set between the reference image anchor point and each nearest neighbor anchor point in the first neighbor set, and a second distance set between the microscopic image anchor point to be aligned and each nearest neighbor anchor point in the second neighbor set are calculated respectively. The distance values ​​corresponding to the first distance set and the second distance set in the nearest neighbor order are divided one by one to obtain the neighbor spacing ratio sequence corresponding to each matching pair. From the sequence of neighbor spacing ratios corresponding to all matching pairs, the ratio with the highest frequency of occurrence is extracted as the optimal scaling factor of the microscopic image to be aligned relative to the reference image. The coordinates of all nodes in the cell nucleus spatial distribution map of the microscopic image to be aligned are scaled using the optimal scaling factor, so that the internuclear distance distribution of the microscopic image to be aligned with the internuclear distance distribution of the reference image at the main peak interval, thus obtaining the scale-normalized cell nucleus spatial distribution map of the microscopic image to be aligned. The difference between the geometric center coordinates of the cell nucleus spatial distribution map of the scale-normalized microscopic image to be aligned and the geometric center coordinates of the cell nucleus spatial distribution map of the reference image is calculated. Using the difference as a translation vector, all node coordinates in the scale-normalized cell nucleus spatial distribution map of the microscopic image to be aligned are translated along the direction of the translation vector, so that the geometric center of the cell nucleus spatial distribution map of the microscopic image to be aligned coincides with the geometric center of the cell nucleus spatial distribution map of the reference image, thus completing the rigid alignment of the cell nucleus spatial distribution map of the microscopic image to be aligned to the unified spatial reference coordinate system.

[0038] In one specific embodiment, for each microscopic image corresponding to the cell nucleus spatial distribution map, the position coordinates of all nodes in the map are obtained. The nodes are the cell nucleus position coordinates extracted in step S101. All nodes in the cell nucleus spatial distribution map are traversed. For each node, the Euclidean distance between the node and its K nearest neighbor nodes is calculated. K is a preset number of neighbors, which takes the value of 6 to 10. The neighbor distances corresponding to all nodes are merged to obtain the internuclear distance set corresponding to the cell nucleus spatial distribution map.

[0039] Frequency statistics are performed on all internuclear distance values ​​in the internuclear distance set. Specifically, the minimum and maximum values ​​in the internuclear distance set are determined. Starting from the minimum value, the range of values ​​between the minimum and the maximum value is divided into multiple consecutive intervals with a preset statistical step size as the interval width. The number of internuclear distances falling into each interval is counted. The number of internuclear distances in each interval is divided by the total number of internuclear distances to obtain the percentage corresponding to each interval. A histogram of internuclear distances is plotted with each interval as the horizontal axis and the percentage corresponding to each interval as the vertical axis.

[0040] The interval with the highest percentage in the internuclear distance histogram is identified and marked as the primary peak interval. The arithmetic mean of the left and right endpoints of the primary peak interval is taken as the median value of the primary peak interval, and this median value is taken as the primary peak feature value of the internuclear distance in the microscopic image. The interval with the second highest percentage in the internuclear distance histogram is identified and marked as the secondary peak interval. The arithmetic mean of the left and right endpoints of the secondary peak interval is taken as the median value of the secondary peak interval, and this median value is taken as the secondary peak feature value of the internuclear distance in the microscopic image. The primary peak feature value and the secondary peak feature value of the internuclear distance are combined to form the internuclear distance distribution morphology feature vector of the microscopic image. The primary peak feature value of the internuclear distance corresponds to the primary distance between cell nuclei in the microscopic image, and the secondary peak feature value of the internuclear distance corresponds to the close distance between cell nuclei in the cell nucleus aggregation region. Together, they reflect the spatial aggregation pattern and distribution scale of cell nuclei.

[0041] For all node locations in the spatial distribution map of cell nuclei, nuclear density estimation is performed with a preset multiple of the main peak characteristic value of internuclear distance as the search radius. The preset multiple is between 1.5 and 2.5. The nuclear density estimation is calculated as follows: for each node location, with the node location as the center and the search radius as the range, the number of other nodes contained within this range is counted. The number is divided by the product of the square of the search radius and pi to obtain the nuclear density estimate at the node location. This process is repeated for all node locations to obtain the nuclear density estimate at each node location.

[0042] Nodes with nuclear density estimates greater than a preset density threshold are marked as high-density nodes. The preset density threshold is determined based on the statistical distribution of nuclear density estimates of all nodes in the microscopic image. The sum of the average and standard deviation of all nuclear density estimates is taken as the preset density threshold. From all high-density nodes, nodes with nuclear density estimates that are local maxima are selected as anchor points. A local maximum is defined as a node whose nuclear density estimate is greater than the nuclear density estimates of all neighboring nodes in the cell nucleus spatial distribution map. Neighboring nodes are nodes whose Euclidean distance from the node is less than the search radius. The selected anchor points correspond to the center of the local region with the highest cell nucleus aggregation density in the microscopic image, that is, the center point of the densest cell nucleus region. These positions have a stable spatial correspondence between different images. All anchor points are combined to form the anchor point set of the microscopic image.

[0043] The number of anchor points in the anchor point set of each microscopic image is counted. The spatial reference coordinate system of the microscopic image with the most anchor points is set as the unified spatial reference coordinate system. This microscopic image is used as the reference image, and the spatial reference coordinate system is the image pixel coordinate system, with the upper left corner of the image as the origin, the horizontal direction as the horizontal axis, and the vertical direction as the vertical axis.

[0044] For each microscopic image to be aligned, excluding the reference image, an anchor point set for that microscopic image is obtained. Taking each anchor point in the anchor point set of the reference image as a reference point, all anchor points in the anchor point set of the microscopic image to be aligned are traversed. The spatial distance between the reference point and the anchor point to be aligned is calculated. The anchor point to be aligned with the smallest spatial distance is selected as the matching point of the reference point. A matching point is assigned to each anchor point of the reference image in the above manner, establishing a one-to-one correspondence between the anchor points of the reference image and the anchor points of the microscopic image to be aligned, resulting in an anchor point matching set. The anchor point matching set contains multiple matching pairs, and each matching pair contains a reference image anchor point and a corresponding microscopic image anchor point to be aligned.

[0045] For each matching pair in the anchor point matching set, perform the following operations: take a preset number of nearest neighbor anchors in the anchor point set of the reference image as the first neighbor set, and take a preset number of nearest neighbor anchors in the anchor point set of the microscopic image to be aligned in the matching pair as the second neighbor set, with the preset number being 4 to 8. Calculate the first distance set between the reference image anchor and each nearest neighbor anchor in the first neighbor set, and the second distance set between the microscopic image anchor and each nearest neighbor anchor in the second neighbor set. Divide the distance values ​​in the first distance set and the second distance set in the nearest neighbor order one by one to obtain the neighbor spacing ratio sequence for each matching pair.

[0046] From the sequence of neighbor spacing ratios corresponding to all matching pairs, the frequency of each ratio is counted. The ratio with the highest frequency is taken as the optimal scaling factor of the microscopic image to be aligned relative to the reference image. The optimal scaling factor reflects the proportional relationship between the microscopic image to be aligned and the reference image in terms of the spatial distribution scale of the cell nucleus. When the internuclear spacing between the microscopic image to be aligned and the reference image is scaled as a whole due to differences in scanning resolution or different degrees of tissue shrinkage, the optimal scaling factor is this scaling ratio.

[0047] The coordinates of all nodes in the spatial distribution map of the cell nuclei of the microscopic image to be aligned are scaled using the optimal scaling factor. Specifically, the horizontal and vertical coordinates of each node are multiplied by the optimal scaling factor so that the internuclear spacing distribution of the microscopic image to be aligned with the internuclear spacing distribution of the reference image at the main peak interval, thus obtaining the scale-normalized spatial distribution map of the cell nuclei of the microscopic image to be aligned.

[0048] The arithmetic mean of all node coordinates in the cell nucleus spatial distribution map of the microscopic image to be aligned after scale normalization is calculated and used as the geometric center coordinates of the distribution map. The arithmetic mean of all node coordinates in the cell nucleus spatial distribution map of the reference image is also calculated and used as the geometric center coordinates of the cell nucleus spatial distribution map of the reference image. The difference between the geometric center coordinates of the cell nucleus spatial distribution map of the microscopic image to be aligned and the geometric center coordinates of the cell nucleus spatial distribution map of the reference image is calculated and used as the translation vector.

[0049] The coordinates of all nodes in the scale-normalized cell nucleus spatial distribution map of the microscopic image to be aligned are translated along the translation vector direction, so that the geometric center of the cell nucleus spatial distribution map of the microscopic image to be aligned coincides with the geometric center of the cell nucleus spatial distribution map of the reference image, thus completing the rigid alignment of the cell nucleus spatial distribution map of the microscopic image to be aligned to a unified spatial reference coordinate system.

[0050] This step achieves precise rigid alignment of the spatial distribution maps of cell nuclei from multiple microscopic images by extracting the main and secondary peak features of the internuclear distance histogram, locating anchor points for kernel density estimation, estimating the scale scaling factor of the neighbor distance ratio sequence, and shifting the geometric center. The technical effects are reflected in the following aspects: In the microscopic images of cervical pathological sections, cell nuclei are not uniformly distributed, but rather form regions of nuclear aggregation (corresponding to the epithelial cell layer) and regions of sparse nuclear distribution (corresponding to the stroma or background). The main peak of the internuclear spacing histogram corresponds to the main spacing within the nuclear aggregation region, and the secondary peak corresponds to the spacing within the sparse nuclear region. The combination of these two features fully describes the bimodal characteristics of the spatial distribution of cell nuclei, providing a data-driven basis for the selection of the search radius in subsequent nuclear density estimation, and avoiding the problem of poor adaptability of a fixed radius in different density regions. Nuclear density estimation transforms discrete cell nucleus location coordinates into a continuous density field. Local maxima correspond to the center of the region with the highest cell nucleus aggregation density. These anchor points have stable spatial existence under staining difference conditions—even if changes in staining intensity lead to changes in the visualization of cell nuclei, the center position of the cell nucleus aggregation region will not change, making the anchor points reliable matching primitives for alignment across image space. In a matching pair, the ratio of the spatial distance between the reference anchor point and its neighbors to the spatial distance between the anchor point to be aligned and its neighbors reflects the scaling relationship between the two images at a local scale. Since the scaling may vary slightly at different locations, the ratio with the highest frequency of occurrence is extracted from the sequence of neighbor spacing ratios of all matching pairs as the optimal scaling coefficient. This is equivalent to selecting the most consistent scaling estimate in the global scope, thus eliminating the interference of scaling estimates from local abnormal matching pairs.

[0051] Step S103: In the aligned spatial reference coordinate system, multiple local correction regions are divided with each anchor point as the center and the neighborhood radius determined by the internuclear distance distribution characteristics as the boundary. The chromaticity features of the nucleus region and the chromaticity features of the cytoplasm region are extracted in each local correction region, and the chromaticity difference value between the nucleus region and the cytoplasm region in each local correction region is calculated.

[0052] In this step, in the aligned spatial reference coordinate system, the anchor point set of each microscopic image is obtained, and the anchor points of all microscopic images are merged to obtain a global anchor point set. Each anchor point in the global anchor point set carries the source identifier of the corresponding microscopic image. Using the main peak feature value of the internuclear spacing as the base radius, and the ratio of the secondary peak feature value of the internuclear spacing to the main peak feature value of the internuclear spacing as the radius adjustment coefficient, the base radius is multiplied by the radius adjustment coefficient to obtain the adaptive neighborhood radius corresponding to each anchor point. Select an undivided anchor point from the global anchor point set as the current anchor point, and delineate the initial local region of the current anchor point with the current anchor point as the center and the adaptive neighborhood radius corresponding to the current anchor point as the boundary. Detect whether the initial local region contains other global anchor points besides the current anchor point; If included, identify the other global anchor point with the largest initial local region kernel density estimate as a competing anchor point, calculate the spatial distance between the current anchor point and the competing anchor point, and when the spatial distance is less than the sum of the adaptive neighborhood radius corresponding to the current anchor point and the adaptive neighborhood radius corresponding to the competing anchor point, classify the current anchor point and the competing anchor point into the same anchor point cluster; when the spatial distance is greater than or equal to the sum of the adaptive neighborhood radii, mark the competing anchor point as an independent anchor point. For each anchor point cluster, calculate the average coordinate of all anchor points in the anchor point cluster to obtain the cluster center coordinates corresponding to the anchor point cluster. Using the cluster center coordinates as the center and the average adaptive neighborhood radius of all anchor points in the anchor point cluster as the boundary, delineate the local correction region corresponding to the anchor point cluster. For each independent anchor point, a local correction region corresponding to the independent anchor point is defined with the coordinates of the independent anchor point as the center and the adaptive neighborhood radius corresponding to the independent anchor point as the boundary. For a pixel that does not fall into any local correction region, calculate the shortest distance from the pixel to the boundary of each local correction region, and assign the pixel to the local correction region corresponding to the shortest distance. When there is an overlapping area between two local correction regions, the area of ​​the overlapping area is calculated. If the area of ​​the overlapping area is less than a preset percentage of the area of ​​the smaller local correction region, the two local correction regions remain independent. If the area of ​​the overlapping area is greater than or equal to the preset percentage, the two local correction regions are merged into one local correction region. The center of the merged local correction region is the weighted average of the centers of the two local correction regions, and the weight is the number of anchor points contained in each local correction region.

[0053] Furthermore, the position coordinates and contour boundaries of all cell nucleus nodes contained within a certain local correction region are obtained, and the pixel region enclosed by the contour boundaries of each cell nucleus node is taken as the initial cell nucleus pixel region corresponding to each cell nucleus. The union of all initial cell nucleus pixel regions is taken as the set of cell nucleus regions of the certain local correction region. For each cell nucleus pixel region in the set of cell nucleus regions, the contour boundary of the cell nucleus pixel region is used as the seed boundary. The region is expanded outward pixel by pixel along the outer normal direction of the contour boundary. After each layer of expansion, the average gray value of the expanded region is calculated. When the change of the average gray value in the continuous expansion of a preset number of layers is first lower than a preset change threshold, the expansion is stopped. The region formed when the expansion stops is taken as the cytoplasm candidate region corresponding to the cell nucleus pixel region. The outer normal direction is the direction from the geometric center of the cell nucleus pixel region to the outside of the boundary. The cytoplasmic candidate regions are removed from the cytoplasmic candidate regions that overlap with the cytoplasmic candidate regions of adjacent cell nuclei to obtain the cytoplasmic regions corresponding to each cell nucleus pixel region. The union of all cytoplasmic regions is taken as the cytoplasmic region set of a certain local correction region. Calculate the first red mean value in the red channel, the first green mean value in the green channel, and the first blue mean value in the blue channel for all pixels in the cell nucleus region set, and combine the first red mean value, the first green mean value, and the first blue mean value into a first color feature vector; Calculate the second red mean value of all pixels in the cytoplasmic region set in the red channel, the second green mean value in the green channel, and the second blue mean value in the blue channel, and combine the second red mean value, the second green mean value, and the second blue mean value into a second color feature vector; Calculate the Euclidean distance between the first color feature vector and the second color feature vector, and use the Euclidean distance as the color difference value between the nucleus region and the cytoplasm region within the local correction region.

[0054] In one specific embodiment, firstly, in the aligned spatial reference coordinate system, the anchor point set of each microscopic image is obtained, and the anchor points of all microscopic images are merged to obtain a global anchor point set. Each anchor point in the global anchor point set carries the source identifier of the corresponding microscopic image, that is, which original microscopic image the anchor point comes from.

[0055] Using the primary eigenvalue of internuclear distance as the base radius, and the ratio of the secondary eigenvalue of internuclear distance to the primary eigenvalue of internuclear distance as the radius adjustment coefficient, the adaptive neighborhood radius corresponding to each anchor point is obtained by multiplying the base radius by the radius adjustment coefficient. The primary eigenvalue of internuclear distance corresponds to the primary distance between cell nuclei, and the secondary eigenvalue of internuclear distance corresponds to the close distance between cell nuclei within the cell nucleus aggregation region. The ratio of the two reflects the degree of aggregation of the cell nucleus aggregation region. When the degree of aggregation is high, the ratio of the secondary peak to the primary peak is small, and the adaptive neighborhood radius is correspondingly reduced, making the local correction region more refined. When the degree of aggregation is low, the adaptive neighborhood radius is correspondingly increased, making the local correction region cover a wider range.

[0056] Select an undivided anchor point from the global anchor point set as the current anchor point. Delineate the initial local region of the current anchor point with the current anchor point as the center and the adaptive neighborhood radius corresponding to the current anchor point as the boundary. Detect whether the initial local region contains other global anchor points besides the current anchor point. If it does, identify the other global anchor point with the largest kernel density estimate in the initial local region as the competing anchor point, and calculate the spatial distance between the current anchor point and the competing anchor point.

[0057] The spatial distance is compared with the sum of the adaptive neighborhood radii of the current anchor point and the adaptive neighborhood radii of the competing anchor points. When the spatial distance is less than the sum of the adaptive neighborhood radii, it indicates that the neighborhood ranges of the two anchor points overlap, and the current anchor point and the competing anchor point are grouped into the same anchor point cluster. When the spatial distance is greater than or equal to the sum of the adaptive neighborhood radii, it indicates that the neighborhood ranges of the two anchor points are independent, and the competing anchor point is marked as an independent anchor point.

[0058] For each anchor point cluster, the arithmetic mean of the coordinates of all anchor points in the cluster is calculated to obtain the cluster center coordinates. The local correction region corresponding to the anchor point cluster is delineated with the cluster center coordinates as the center and the arithmetic mean of the adaptive neighborhood radii of all anchor points in the cluster as the boundary. The cluster center coordinates of the anchor point cluster reflect the common center position of multiple anchor points in the cluster, providing a stable center point after averaging multiple anchor points for the subsequent delineation of the correction region.

[0059] For each independent anchor point, the local correction region corresponding to the independent anchor point is defined with the coordinates of the independent anchor point as the center and the adaptive neighborhood radius corresponding to the independent anchor point as the boundary.

[0060] For pixels that do not fall into any local correction region, calculate the shortest distance from the pixel to the boundary of each local correction region, and assign the pixel to the local correction region corresponding to the shortest distance. The shortest distance is calculated by drawing a perpendicular line from the pixel to the boundary of each local correction region. When the foot of the perpendicular falls on the boundary line, the length of the perpendicular line is the shortest distance. When the foot of the perpendicular falls on the extension line of the boundary, the distance from the pixel to the boundary endpoint is the shortest distance.

[0061] When there is an overlapping area between two local correction regions, the area of ​​the overlapping area is calculated and compared with a preset percentage of the area of ​​the smaller local correction region. When the area of ​​the overlapping area is less than the preset percentage, the two local correction regions remain independent. When the area of ​​the overlapping area is greater than or equal to the preset percentage, the two local correction regions are merged into one local correction region. The center of the merged local correction region is the weighted average of the centers of the two local correction regions, and the weight is the number of anchor points contained in each local correction region.

[0062] Furthermore, after completing the local correction region division, the position coordinates and contour boundaries of all cell nucleus nodes contained in a certain local correction region are obtained. The pixel region enclosed by the contour boundaries of each cell nucleus node is taken as the initial cell nucleus pixel region corresponding to each cell nucleus. The union of all initial cell nucleus pixel regions is taken as the cell nucleus region set of a certain local correction region.

[0063] For each cell nucleus pixel region in the set of cell nucleus regions, the contour boundary of the cell nucleus pixel region is used as the seed boundary, and the region is expanded outward pixel by pixel along the outer normal direction of the contour boundary. The outer normal direction is the direction from the geometric center of the cell nucleus pixel region to the outside of the boundary. After each layer of expansion, the average gray value of the expanded region is calculated. When the change of the average gray value in the continuous preset number of layers of expansion is lower than the preset change threshold for the first time, the expansion stops. The continuous preset number of layers is 3 to 5 layers, and the preset change threshold is 10% of the gray standard deviation inside the cell nucleus pixel region. The region formed when the expansion stops is taken as the cytoplasmic candidate region corresponding to the cell nucleus pixel region. The part that overlaps with the cytoplasmic candidate regions of adjacent cell nuclei is removed from the cytoplasmic candidate regions to obtain the cytoplasmic regions corresponding to each cell nucleus pixel region. The union of all cytoplasmic regions is taken as the cytoplasmic region set of a certain local correction region.

[0064] Calculate the arithmetic mean of all pixels in the cell nucleus region set in the red channel, the arithmetic mean of the green channel, and the arithmetic mean of the blue channel, respectively, and use them as the first red mean, the first green mean, and the first blue mean. Combine the first red mean, the first green mean, and the first blue mean into a first color feature vector.

[0065] Calculate the arithmetic mean of all pixels in the cytoplasmic region set in the red channel, the arithmetic mean of the green channel, and the arithmetic mean of the blue channel, respectively, and use them as the second red mean, the second green mean, and the second blue mean. Combine the second red mean, the second green mean, and the second blue mean into a second color feature vector.

[0066] Calculate the Euclidean distance between the first and second color feature vectors. Use this Euclidean distance as the chromaticity difference between the nucleus and cytoplasm within a local correction region. The Euclidean distance is calculated as follows: calculate the squares of the differences between the first and second red mean values, the squares of the differences between the first and second green mean values, and the squares of the differences between the first and second blue mean values. Sum these three squared values ​​and take the square root. The larger the chromaticity difference value, the more distinct the color distinction between the nucleus and cytoplasm within the local correction region, and the better the staining quality. The smaller the chromaticity difference value, the more the staining difference leads to the convergence of nucleus and cytoplasm colors, requiring correction of this region.

[0067] This step achieves precise segmentation of local correction regions and measurement of staining quality through anchor point cluster division with adaptive neighborhood radius, cytoplasmic region delineation driven by grayscale changes in the outer normal direction, and calculation of nucleoplasmic color difference values. Its technical effects are reflected in the following aspects: The adaptive neighborhood radius is equal to the primary eigenvalue of the internuclear distance multiplied by the radius adjustment coefficient. The radius adjustment coefficient is the ratio of the secondary eigenvalue of the internuclear distance to the primary eigenvalue. The primary eigenvalue reflects the primary distance between cell nuclei, while the secondary eigenvalue reflects the close spacing within the cell nucleus aggregation region. The ratio quantifies the non-uniformity of the spatial distribution of cell nuclei. When the degree of cell nucleus aggregation is high, the radius of the local correction region decreases accordingly, making the anchor point cluster division more refined and avoiding multiple anchor points being assigned to the same region, which would lead to insufficient correction resolution. When the cell nucleus distribution is relatively uniform, the radius of the local correction region increases accordingly, ensuring that the anchor point cluster covers a sufficient spatial range. Anchor point clustering is achieved by detecting competing anchor points within the initial local region and comparing the sum of spatial distance and neighborhood radius. When the spatial distance between two anchor points is less than the sum of their adaptive neighborhood radii, it indicates that their influence ranges overlap and they should be assigned to the same anchor point cluster. The cluster center of the anchor point cluster is the average of the coordinates of all anchor points within the cluster, and the cluster boundary is the average of the adaptive neighborhood radii of all anchor points within the cluster. The competition mechanism ensures that anchor points within the same anchor point cluster are close to each other and have overlapping neighborhoods, avoiding the problem of isolated anchor points being incorrectly assigned to distant clusters. The expansion is performed pixel by pixel along the outer normal direction of the cell nucleus outline boundary, with the expansion direction pointing from the center of the cell nucleus outward, ensuring that the expansion direction always moves away from the cell nucleus region. After each layer of expansion, the average gray value of the expanded region is calculated. Expansion stops when the change in gray value in continuous multi-layer expansion first falls below a preset change threshold. This stopping condition detects the position where the gray value tends to be stable, that is, the position where the transition region between the cell nucleus and cytoplasm is completed and enters the uniform cytoplasm region, so that the cytoplasm candidate region is adaptively positioned in the cytoplasm region around the cell nucleus. The nucleus and cytoplasm exhibit different colors in HE staining: the nucleus is stained blue-purple by hematoxylin, showing lower values ​​in the red and green channels and higher values ​​in the blue channel in the RGB space; the cytoplasm is stained pink by eosin, showing higher values ​​in the red and green channels and lower values ​​in the blue channel in the RGB space. The nucleus-cytoplasm color difference value comprehensively reflects the average color difference between the nucleus and cytoplasm in all three channels. Before correction, each position within the same local correction area should have similar nucleus-cytoplasm color difference values, indicating high consistency in staining quality within the area. If there are significant changes in the nucleus-cytoplasm color difference values ​​at different positions, it indicates uneven staining within the area, requiring correction. The color difference value will serve as the basic data for calculating the difference ratio sequence in step S104, providing input for determining the correction coefficient.

[0068] Step S104: Based on the chromaticity difference value at the anchor point, compare the chromaticity difference value at each pixel position within the same local correction area with the chromaticity difference value at the anchor point to obtain the difference ratio sequence corresponding to each pixel position, and determine the color difference correction coefficient of each local correction area according to the difference ratio sequence.

[0069] In this step, a difference ratio sequence corresponding to a certain local correction region is obtained. Each difference ratio in the difference ratio sequence corresponds to a pixel position within the certain local correction region. The difference ratio is equal to the ratio of the chromaticity difference value at the pixel position to the chromaticity difference value at the anchor point. The chromaticity difference value at the pixel position is determined based on the chromaticity difference between the nucleus region and the cytoplasm region within the local window where the pixel position is located. The chromaticity difference value at the anchor point is determined based on the chromaticity difference between the nucleus region and the cytoplasm region at the location of the anchor point. Kernel density estimation is performed on the difference ratio sequence to obtain the probability density distribution curve of the difference ratio sequence on the ratio value axis. All local peak points on the probability density distribution curve are detected. The peak point with the highest probability density is selected from all local peak points as the main peak point. The difference ratio corresponding to the main peak point is used as the initial correction coefficient of a certain local correction region. Obtain the peak width corresponding to the main peak point, where the peak width is the length of the ratio interval on the probability density distribution curve when the probability density drops to a preset ratio of the probability density of the main peak point, with the main peak point as the center. Calculate the absolute value of the difference between the arithmetic mean of all difference ratios in the difference ratio sequence and the initial correction coefficient, and use the absolute value of the difference as the deviation of the correction coefficient; The peak width is compared with a preset width threshold, and the correction coefficient deviation is compared with a preset deviation threshold. When the peak width is less than the width threshold and the correction coefficient deviation is less than the deviation threshold, the initial correction coefficient is used as the staining difference correction coefficient for a certain local correction region. When the peak width is not less than the width threshold or the correction coefficient deviation is not less than the deviation threshold, determine whether there are two peak points on the probability density distribution curve whose probability density is greater than the probability density of the main peak point by a preset ratio. If the two peak points exist, the two ratio values ​​corresponding to the two peak points are respectively used as the first candidate correction coefficient and the second candidate correction coefficient, and the arithmetic mean of the first candidate correction coefficient and the second candidate correction coefficient is used as the staining difference correction coefficient of the local correction region. If the two peak points do not exist, the median value of the difference ratio sequence is used as the staining difference correction coefficient for a certain local correction region.

[0070] In one specific embodiment, for a certain local correction area, the chromaticity difference value at all pixel positions within that area is obtained. The chromaticity difference value at each pixel position is determined based on the chromaticity difference between the nucleus region and the cytoplasm region within the local window where the pixel position is located. The specific calculation method is the same as the method for calculating the chromaticity difference value at the anchor point in step S103: with the pixel position as the center, the nucleus region and the cytoplasm region within the local window where the center is located are extracted, and the Euclidean distance between the mean vectors of the two regions in the three RGB channels is calculated as the chromaticity difference value at the pixel position. The anchor point corresponding to the local correction area is obtained, and the chromaticity difference value at the anchor point is obtained. This value has been calculated in step S103.

[0071] The local window is a circular region centered on the pixel location and with the main peak feature value of the internuclear distance as the radius. If the local window does not contain any cell nucleus region or any cytoplasm region, the pixel location is marked as an invalid pixel, and its chromaticity difference value is not calculated. The difference ratio of the invalid pixel is replaced by the arithmetic mean of the difference ratios of the valid pixels in its local correction region. Alternatively, if the local window does not contain any cell nucleus region, the chromaticity difference value of the pixel location is set to the chromaticity difference value at the anchor point of the local correction region.

[0072] For each pixel position within the local correction region, calculate the ratio between the chromaticity difference value at that pixel position and the chromaticity difference value at the anchor point to obtain the difference ratio corresponding to that pixel position. Traverse all pixel positions within the local correction region and arrange all difference ratios according to pixel position to form a difference ratio sequence corresponding to the local correction region. The length of the difference ratio sequence is equal to the total number of pixels within the local correction region.

[0073] Kernel density estimation is performed on the difference ratio sequence to obtain the probability density distribution curve of the difference ratio sequence on the ratio value axis. Kernel density estimation uses each difference ratio in the difference ratio sequence as a sample point, and estimates the probability density value at each ratio value position using a preset kernel function and bandwidth parameter. The bandwidth parameter is determined based on the sample size and standard deviation of the difference ratio sequence. The smaller the bandwidth, the richer the details of the probability density distribution curve, and the larger the bandwidth, the smoother the curve.

[0074] All local peaks on the probability density distribution curve are detected. Local peaks are points where the probability density value is greater than the probability density values ​​on the two sides next to them, i.e., the apex of the "peak" in the probability density distribution curve. The peak with the largest probability density value is selected from all local peaks as the main peak. The difference ratio corresponding to the main peak is used as the initial correction coefficient of the local correction region. The initial correction coefficient corresponds to the position where the sample distribution is most concentrated in the difference ratio sequence, i.e. the most common nucleocytoplasmic color difference ratio.

[0075] Obtain the peak width corresponding to the main peak point. The peak width is the length of the ratio interval on the probability density distribution curve when the probability density drops to a preset proportion of the probability density of the main peak point, with the main peak point as the center. In a specific embodiment, the preset proportion is one-half, that is, the peak width is the length of the ratio interval when the probability density drops to half of the probability density of the main peak point. The peak width reflects the degree of concentration of the difference ratio sequence near the main peak point. The smaller the width, the more concentrated the difference ratio is, and the larger the width, the more dispersed the difference ratio is.

[0076] Calculate the arithmetic mean of all difference ratios in the difference ratio sequence, calculate the absolute value of the difference between the arithmetic mean and the initial correction coefficient, and use the absolute value of the difference as the correction coefficient deviation. The correction coefficient deviation reflects the degree to which the mean of the difference ratio sequence deviates from the position of the main peak. The larger the deviation, the more outliers there are in the sequence that deviate from the main peak or the sequence is skewed.

[0077] The peak width is compared with a preset width threshold, and the correction coefficient deviation is compared with a preset deviation threshold. The width threshold and deviation threshold are determined based on the total number of pixels in the local correction area. The more pixels there are, the smaller the threshold.

[0078] When the peak width is less than the width threshold and the correction coefficient deviation is less than the deviation threshold, it indicates that the difference ratio sequence is concentrated near the main peak and the mean is consistent with the main peak. The initial correction coefficient is used as the staining difference correction coefficient of the local correction region.

[0079] When the peak width is not less than the width threshold or the deviation of the correction coefficient is not less than the deviation threshold, it indicates that the distribution of the difference ratio sequence is scattered or there are outliers that deviate significantly from the main peak. At this time, a bimodal detection is performed on the probability density distribution curve. The bimodal detection determines whether there are two peak points on the probability density distribution curve. The probability density of both peak points is greater than the preset proportion of the probability density of the main peak point. In a specific embodiment, the preset proportion is one-third.

[0080] If there are two peak points, the two ratio values ​​corresponding to the two peak points are used as the first candidate correction coefficient and the second candidate correction coefficient, respectively. The arithmetic mean of the first candidate correction coefficient and the second candidate correction coefficient is calculated, and the arithmetic mean is used as the staining difference correction coefficient of the local correction area. The bimodal scene corresponds to the existence of two different types of cell populations in the local correction area. The nucleocytoplasmic color difference ratio of one cell type is biased towards the main peak, and the other is biased towards the secondary peak. Taking the average of the two as the correction coefficient can take into account both cell types.

[0081] If there are no two peaks, the median of the difference ratio sequence is used as the staining difference correction coefficient for the local correction region. The median is the value in the middle position after the difference ratio sequence is sorted by numerical value. When the sequence length is even, the arithmetic mean of the two middle values ​​is taken as the median.

[0082] Step S105: The pixel values ​​of each pixel in each local correction area are corrected using the staining difference correction coefficient, and the corrected cervical pathology slide image is output.

[0083] In this step, the staining difference correction coefficient corresponding to each local correction region is obtained, and the staining difference correction coefficient is a single value; For a boundary pixel of a certain local correction region, calculate the first distance from the boundary pixel to the anchor point corresponding to the certain local correction region, and the second distance from the boundary pixel to the anchor point corresponding to the adjacent local correction region. Use the ratio of the first distance and the second distance as the fusion weight, and linearly interpolate the color difference correction coefficient corresponding to the certain local correction region and the color difference correction coefficient corresponding to the adjacent local correction region according to the fusion weight to obtain the fusion correction coefficient corresponding to the boundary pixel. For a non-boundary pixel in a certain local correction region, the color difference correction coefficient corresponding to the certain local correction region is used as the fusion correction coefficient corresponding to the non-boundary pixel. Divide the original pixel value of each pixel in the red channel within a certain local correction area by the red channel component of the fusion correction coefficient to obtain the corrected pixel value of each pixel in the red channel. Divide the original pixel value of each pixel in the green channel within a certain local correction area by the green channel component of the fusion correction coefficient to obtain the corrected pixel value of each pixel in the green channel. Divide the original pixel value of each pixel in the blue channel within a certain local correction area by the blue channel component of the fusion correction coefficient to obtain the corrected pixel value of each pixel in the blue channel. The corrected pixel values ​​of each pixel in the red channel, the green channel, and the blue channel are combined to form the corrected pixel value for each pixel. Pixel values ​​less than zero in the corrected pixel values ​​are set to zero, and pixel values ​​greater than 255 in the corrected pixel values ​​are set to 255. The pixel values ​​after the limiting process are used as the final corrected pixel values. Arrange the final corrected pixel values ​​of all pixels within all local correction areas according to their original spatial positions to generate and output the corrected cervical pathology slide image.

[0084] In summary, the method of this application acquires multiple microscopic images of cervical pathological sections, extracts the position coordinates and contour boundaries of cell nuclei in each image, and constructs a spatial distribution map of cell nuclei. Based on the spatial distribution map of cell nuclei, it determines the distribution characteristics of the nuclear density field and internuclear distance. Using the local maxima of the nuclear density field as anchor points and the distribution characteristics of internuclear distance as scale constraints, it aligns the spatial distribution maps of cell nuclei in each image to a unified spatial reference coordinate system. In the aligned coordinate system, multiple local correction regions are divided with the anchor points as centers. In each region, the chromaticity features of the cell nucleus and cytoplasm are extracted and the nucleoplasmic chromaticity difference value is calculated. Using the chromaticity difference value at the anchor point as a benchmark, the difference ratio sequence of each pixel position is obtained, and the staining difference correction coefficient of each local correction region is determined. The pixel values ​​in each region are corrected using this coefficient, and the corrected image is output. With the spatial distribution of cell nuclei as an internal reference system, no external reference image is required, thus achieving adaptive correction of staining differences.

[0085] Please see Figure 2 The diagram shows a structural block diagram of a cervical pathology section staining difference correction system according to this application.

[0086] like Figure 2 As shown, the cervical pathology slide staining difference correction system 200 includes a construction module 210, an alignment module 220, a division module 230, a determination module 240, and a correction module 250.

[0087] The construction module 210 is configured to acquire microscopic images of multiple cervical pathology slides, extract the position coordinates and contour boundaries of cell nuclei in each microscopic image according to a preset image analysis strategy, and construct a spatial distribution map of cell nuclei corresponding to each microscopic image. In this spatial distribution map, the position coordinates of cell nuclei are used as nodes, and the spatial distance between cell nuclei is used as edges. The alignment module 220 is configured to determine the nuclear density field and internuclear distance distribution characteristics of each microscopic image based on the spatial distribution map, using the local maxima of the nuclear density field as anchor points and the internuclear distance distribution characteristics as scale constraints, and align the spatial distribution maps of the cell nuclei of each microscopic image to a unified spatial reference coordinate system. The segmentation module 230 is configured to, in the aligned spatial reference coordinate system, use each anchor point as the center and the corresponding boundary as the scale. Using the neighborhood radius determined by the internuclear distance distribution characteristics as the boundary, multiple local correction regions are divided. Within each local correction region, the chromaticity features of the nucleus region and the cytoplasm region are extracted. The chromaticity difference value between the nucleus region and the cytoplasm region within each local correction region is calculated. The determination module 240 is configured to compare the chromaticity difference value at each pixel location within the same local correction region with the chromaticity difference value at the anchor point, based on the chromaticity difference value at the anchor point, to obtain a difference ratio sequence corresponding to each pixel location. The staining difference correction coefficient for each local correction region is determined based on the difference ratio sequence. The correction module 250 is configured to correct the pixel values ​​of each pixel within each local correction region using the staining difference correction coefficient, and output the corrected cervical pathology slide image.

[0088] It should be understood that Figure 2 The modules and references described in the document Figure 1 The steps described in the text correspond to those in the method described above. Therefore, the operations, features, and corresponding technical effects described above also apply to the method described in the text. Figure 2 The various modules in the document will not be described in detail here.

[0089] In other embodiments, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the program instructions are executed by a processor, the processor performs the cervical pathological section staining difference correction method in any of the above method embodiments. In one embodiment, the computer-readable storage medium of the present invention stores computer-executable instructions, which are configured as follows: Multiple microscopic images of cervical pathology sections are acquired. The position coordinates and contour boundaries of cell nuclei in each microscopic image are extracted according to a preset image analysis strategy. A spatial distribution map of cell nuclei corresponding to each microscopic image is constructed. The spatial distribution map of cell nuclei uses the position coordinates of cell nuclei as nodes and the spatial distance relationship between cell nuclei as edges. Based on the nuclear spatial distribution map, the nuclear density field and internuclear distance distribution characteristics of each microscopic image are determined. The local maxima of the nuclear density field are used as anchor points, and the internuclear distance distribution characteristics are used as scale constraints to align the nuclear spatial distribution maps of each microscopic image to a unified spatial reference coordinate system. In the aligned spatial reference coordinate system, multiple local correction regions are divided with each anchor point as the center and the neighborhood radius determined by the internuclear distance distribution characteristics as the boundary. The chromaticity features of the nucleus region and the chromaticity features of the cytoplasm region are extracted in each local correction region, and the chromaticity difference value between the nucleus region and the cytoplasm region in each local correction region is calculated. Based on the chromaticity difference value at the anchor point, the chromaticity difference values ​​at each pixel position within the same local correction area are compared with the chromaticity difference value at the anchor point to obtain a difference ratio sequence corresponding to each pixel position. The color difference correction coefficient of each local correction area is determined based on the difference ratio sequence. The pixel values ​​of each pixel in each local correction area are corrected using the staining difference correction coefficient, and the corrected cervical pathology slide image is output.

[0090] Computer-readable storage media may include a stored program area and a stored data area, wherein the stored program area may store an operating system and an application program required for at least one function; the stored data area may store data created based on the use of the cervical pathology slide staining difference correction system, etc. Furthermore, the computer-readable storage medium may include high-speed random access memory, and may also include memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the computer-readable storage medium may optionally include memory remotely configured relative to a processor, which can be connected to the cervical pathology slide staining difference correction system via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0091] Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiment of the present invention, such as... Figure 3 As shown, the device includes a processor 310 and a memory 320. The electronic device may also include an input device 330 and an output device 340. The processor 310, memory 320, input device 330, and output device 340 can be connected via a bus or other means. Figure 3Taking a bus connection as an example, the memory 320 is the computer-readable storage medium described above. The processor 310 executes various server functions and data processing by running non-volatile software programs, instructions, and modules stored in the memory 320, thereby implementing the cervical pathology slide staining difference correction method described in the above embodiment. The input device 330 can receive input digital or character information and generate key signal inputs related to user settings and function control of the cervical pathology slide staining difference correction system. The output device 340 may include a display screen or other display device.

[0092] The aforementioned electronic device can execute the method provided in the embodiments of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in the method provided in the embodiments of the present invention.

[0093] In one implementation, the above-described electronic device is applied in a cervical pathology slide staining difference correction system for a client, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Multiple microscopic images of cervical pathology sections are acquired. The position coordinates and contour boundaries of cell nuclei in each microscopic image are extracted according to a preset image analysis strategy. A spatial distribution map of cell nuclei corresponding to each microscopic image is constructed. The spatial distribution map of cell nuclei uses the position coordinates of cell nuclei as nodes and the spatial distance relationship between cell nuclei as edges. Based on the nuclear spatial distribution map, the nuclear density field and internuclear distance distribution characteristics of each microscopic image are determined. The local maxima of the nuclear density field are used as anchor points, and the internuclear distance distribution characteristics are used as scale constraints to align the nuclear spatial distribution maps of each microscopic image to a unified spatial reference coordinate system. In the aligned spatial reference coordinate system, multiple local correction regions are divided with each anchor point as the center and the neighborhood radius determined by the internuclear distance distribution characteristics as the boundary. The chromaticity features of the nucleus region and the chromaticity features of the cytoplasm region are extracted in each local correction region, and the chromaticity difference value between the nucleus region and the cytoplasm region in each local correction region is calculated. Based on the chromaticity difference value at the anchor point, the chromaticity difference values ​​at each pixel position within the same local correction area are compared with the chromaticity difference value at the anchor point to obtain a difference ratio sequence corresponding to each pixel position. The color difference correction coefficient of each local correction area is determined based on the difference ratio sequence. The pixel values ​​of each pixel in each local correction area are corrected using the staining difference correction coefficient, and the corrected cervical pathology slide image is output.

[0094] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.

[0095] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for correcting staining differences in cervical pathology sections, characterized in that, include: Multiple microscopic images of cervical pathology sections are acquired. The position coordinates and contour boundaries of cell nuclei in each microscopic image are extracted according to a preset image analysis strategy. A spatial distribution map of cell nuclei corresponding to each microscopic image is constructed. The spatial distribution map of cell nuclei uses the position coordinates of cell nuclei as nodes and the spatial distance relationship between cell nuclei as edges. Based on the nuclear spatial distribution map, the nuclear density field and internuclear distance distribution characteristics of each microscopic image are determined. The local maxima of the nuclear density field are used as anchor points, and the internuclear distance distribution characteristics are used as scale constraints to align the nuclear spatial distribution maps of each microscopic image to a unified spatial reference coordinate system. In the aligned spatial reference coordinate system, multiple local correction regions are divided with each anchor point as the center and the neighborhood radius determined by the internuclear distance distribution characteristics as the boundary. The chromaticity features of the nucleus region and the chromaticity features of the cytoplasm region are extracted in each local correction region, and the chromaticity difference value between the nucleus region and the cytoplasm region in each local correction region is calculated. Based on the chromaticity difference value at the anchor point, the chromaticity difference values ​​at each pixel position within the same local correction area are compared with the chromaticity difference value at the anchor point to obtain a difference ratio sequence corresponding to each pixel position. The color difference correction coefficient of each local correction area is determined based on the difference ratio sequence. The pixel values ​​of each pixel in each local correction area are corrected using the staining difference correction coefficient, and the corrected cervical pathology slide image is output.

2. The method for correcting staining differences in cervical pathological sections according to claim 1, characterized in that, The step of extracting the position coordinates and contour boundaries of cell nuclei in each microscopic image according to a preset image analysis strategy, and constructing a spatial distribution map of cell nuclei corresponding to each microscopic image, includes: A preset number of gray levels is determined based on the dynamic range of gray values ​​of a certain microscopic image, wherein the preset number is the ratio of the dynamic range of gray values ​​to a preset gray level interval. According to a certain preset number of gray levels, the gray values ​​of each pixel in a certain microscopic image are divided into various gray levels. Each gray level corresponds to a gray value range. Pixels whose gray values ​​fall into the same gray value range are grouped into the same gray level set to obtain the set of equal gray pixels corresponding to each gray level. In a set of pixels with the same gray level, adjacent pixels are grouped into the same connected group to obtain multiple connected groups corresponding to a certain gray level. Each connected group consists of pixels whose gray values ​​fall into the same gray level and whose spatial positions are continuous. From all connected groups corresponding to all gray levels, the connected groups that form closed loops are selected, and the connected groups that form closed loops are marked as equal gray level closed contours. The equal gray level closed contours are the lines connecting pixels in the image with the same gray value and connected end to end to form a closed ring structure. The inclusion relationship between the equal grayscale closed contours is detected. The equal grayscale closed contours that are not included by any other equal grayscale closed contours are marked as the first layer contours, the equal grayscale closed contours included by the first layer contours are marked as the second layer contours, the equal grayscale closed contours included by the second layer contours are marked as the third layer contours, and so on, to obtain the nesting level of each equal grayscale closed contour. From all equal-grayscale closed contours, select equal-grayscale closed contours whose nesting levels meet preset level conditions as equal-grayscale contour lines of the cell nucleus. Use the geometric center of the equal-grayscale contour lines as the position coordinates of the cell nucleus. Use the line connecting the pixels of the equal-grayscale contour lines as the contour boundary of the cell nucleus. The preset level condition is that the nesting levels of the equal-grayscale closed contours simultaneously have at least one outer equal-grayscale closed contour and at least one inner equal-grayscale closed contour, that is, the number of levels of the equal-grayscale closed contours is not less than three. Using the position coordinates of all cell nuclei as nodes and the outline boundaries of all cell nuclei as node attributes, a spatial distribution map of cell nuclei corresponding to a certain microscopic image is constructed.

3. The method for correcting staining differences in cervical pathological sections according to claim 1, characterized in that, The step of determining the nuclear density field and internuclear distance distribution characteristics of each microscopic image based on the nuclear spatial distribution map, using the local maxima of the nuclear density field as anchor points and the internuclear distance distribution characteristics as scale constraints, and aligning the nuclear spatial distribution maps of each microscopic image to a unified spatial reference coordinate system includes: For each microscopic image corresponding to the cell nucleus spatial distribution map, the Euclidean distance between any two adjacent nodes in the cell nucleus spatial distribution map is calculated to obtain the internuclear distance set corresponding to the cell nucleus spatial distribution map. The frequency distribution of internuclear distances in the internuclear distance set is statistically analyzed to obtain the internuclear distance histogram corresponding to the internuclear distance set. The horizontal axis of the internuclear distance histogram is the range of internuclear distance values, and the vertical axis is the percentage of internuclear distances falling within each range of values ​​out of the total number of internuclear distances. The interval with the highest percentage in the internuclear distance histogram is extracted as the main peak interval. The median value of the main peak interval is used as the main peak feature value of the internuclear distance in the microscopic image. The interval with the second highest percentage in the internuclear distance histogram is used as the secondary peak interval. The median value of the secondary peak interval is used as the secondary peak feature value of the internuclear distance in the microscopic image. The main peak feature value and the secondary peak feature value of the internuclear distance are combined to form the internuclear distance distribution morphology feature vector of the microscopic image. For the spatial distribution map of cell nuclei corresponding to each microscopic image, the nuclear density estimation is performed with a preset multiple of the main peak feature value of the internuclear distance as the search radius and all node positions in the spatial distribution map of cell nuclei as sample points. The nuclear density estimation value at each node position is obtained. Nodes with nuclear density estimation values ​​greater than a preset density threshold are marked as high-density nodes. Nodes with nuclear density estimation values ​​of local maxima are selected from all high-density nodes as anchor points to obtain the anchor point set corresponding to each microscopic image. Using the main peak feature value of the internuclear distance as the scale constraint parameter, the spatial reference coordinate system of the target microscopic image with the most anchor points in the anchor point set is set as the unified spatial reference coordinate system, and the target microscopic image is used as the reference image. For each microscopic image to be aligned, excluding the reference image, each anchor point in the anchor point set of the reference image is used as a reference point. The anchor point in the anchor point set of the microscopic image to be aligned that is spatially closest to the reference point is searched as a matching point. A one-to-one correspondence between the anchor points of the reference image and the anchor points of the microscopic image to be aligned is established to obtain an anchor point matching set. The anchor point matching set contains multiple matching pairs. Each matching pair contains a reference image anchor point and a corresponding microscopic image anchor point to be aligned. For each matching pair in the anchor point matching set, a first neighbor set is formed by a predetermined number of nearest neighbor anchor points of the reference image anchor point in the anchor point set of the reference image, and a second neighbor set is formed by a predetermined number of nearest neighbor anchor points of the microscopic image anchor point to be aligned in the anchor point set of the microscopic image to be aligned. A first distance set between the reference image anchor point and each nearest neighbor anchor point in the first neighbor set, and a second distance set between the microscopic image anchor point to be aligned and each nearest neighbor anchor point in the second neighbor set are calculated respectively. The distance values ​​corresponding to the first distance set and the second distance set in the nearest neighbor order are divided one by one to obtain the neighbor spacing ratio sequence corresponding to each matching pair. From the sequence of neighbor spacing ratios corresponding to all matching pairs, the ratio with the highest frequency of occurrence is extracted as the optimal scaling factor of the microscopic image to be aligned relative to the reference image. The coordinates of all nodes in the cell nucleus spatial distribution map of the microscopic image to be aligned are scaled using the optimal scaling factor, so that the internuclear distance distribution of the microscopic image to be aligned with the internuclear distance distribution of the reference image at the main peak interval, thus obtaining the scale-normalized cell nucleus spatial distribution map of the microscopic image to be aligned. The difference between the geometric center coordinates of the cell nucleus spatial distribution map of the scale-normalized microscopic image to be aligned and the geometric center coordinates of the cell nucleus spatial distribution map of the reference image is calculated. Using the difference as a translation vector, all node coordinates in the scale-normalized cell nucleus spatial distribution map of the microscopic image to be aligned are translated along the direction of the translation vector, so that the geometric center of the cell nucleus spatial distribution map of the microscopic image to be aligned coincides with the geometric center of the cell nucleus spatial distribution map of the reference image, thus completing the rigid alignment of the cell nucleus spatial distribution map of the microscopic image to be aligned to the unified spatial reference coordinate system.

4. The method for correcting staining differences in cervical pathology sections according to claim 1, characterized in that, The process of dividing multiple local correction regions in the aligned spatial reference coordinate system, centered on each anchor point and bounded by the neighborhood radius determined by the kernel spacing distribution characteristics, includes: In the aligned spatial reference coordinate system, the anchor point set of each microscopic image is obtained, and the anchor points of all microscopic images are merged to obtain a global anchor point set. Each anchor point in the global anchor point set carries the source identifier of the corresponding microscopic image. Using the main peak feature value of the internuclear spacing as the base radius, and the ratio of the secondary peak feature value of the internuclear spacing to the main peak feature value of the internuclear spacing as the radius adjustment coefficient, the base radius is multiplied by the radius adjustment coefficient to obtain the adaptive neighborhood radius corresponding to each anchor point. Select an undivided anchor point from the global anchor point set as the current anchor point, and delineate the initial local region of the current anchor point with the current anchor point as the center and the adaptive neighborhood radius corresponding to the current anchor point as the boundary. Detect whether the initial local region contains other global anchor points besides the current anchor point; If included, identify the other global anchor point with the largest initial local region kernel density estimate as a competing anchor point, calculate the spatial distance between the current anchor point and the competing anchor point, and when the spatial distance is less than the sum of the adaptive neighborhood radius corresponding to the current anchor point and the adaptive neighborhood radius corresponding to the competing anchor point, classify the current anchor point and the competing anchor point into the same anchor point cluster; when the spatial distance is greater than or equal to the sum of the adaptive neighborhood radii, mark the competing anchor point as an independent anchor point. For each anchor point cluster, calculate the average coordinate of all anchor points in the anchor point cluster to obtain the cluster center coordinates corresponding to the anchor point cluster. Using the cluster center coordinates as the center and the average adaptive neighborhood radius of all anchor points in the anchor point cluster as the boundary, delineate the local correction region corresponding to the anchor point cluster. For each independent anchor point, a local correction region corresponding to the independent anchor point is defined with the coordinates of the independent anchor point as the center and the adaptive neighborhood radius corresponding to the independent anchor point as the boundary. For a pixel that does not fall into any local correction region, calculate the shortest distance from the pixel to the boundary of each local correction region, and assign the pixel to the local correction region corresponding to the shortest distance. When there is an overlapping area between two local correction regions, the area of ​​the overlapping area is calculated. If the area of ​​the overlapping area is less than a preset percentage of the area of ​​the smaller local correction region, the two local correction regions remain independent. If the area of ​​the overlapping area is greater than or equal to the preset percentage, the two local correction regions are merged into one local correction region. The center of the merged local correction region is the weighted average of the centers of the two local correction regions, and the weight is the number of anchor points contained in each local correction region.

5. The method for correcting staining differences in cervical pathological sections according to claim 1, characterized in that, The step of extracting the chromaticity features of the nucleus region and the chromaticity features of the cytoplasm region within each local correction region, and calculating the chromaticity difference value between the nucleus region and the cytoplasm region within each local correction region, includes: Obtain the position coordinates and contour boundaries of all cell nucleus nodes contained within a certain local correction region. Use the pixel region enclosed by the contour boundaries of each cell nucleus node as the initial cell nucleus pixel region corresponding to each cell nucleus. Use the union of all initial cell nucleus pixel regions as the set of cell nucleus regions of the certain local correction region. For each cell nucleus pixel region in the set of cell nucleus regions, the contour boundary of the cell nucleus pixel region is used as the seed boundary. The region is expanded outward pixel by pixel along the outer normal direction of the contour boundary. After each layer of expansion, the average gray value of the expanded region is calculated. When the change of the average gray value in the continuous expansion of a preset number of layers is first lower than a preset change threshold, the expansion is stopped. The region formed when the expansion stops is taken as the cytoplasm candidate region corresponding to the cell nucleus pixel region. The outer normal direction is the direction from the geometric center of the cell nucleus pixel region to the outside of the boundary. The cytoplasmic candidate regions are removed from the cytoplasmic candidate regions that overlap with the cytoplasmic candidate regions of adjacent cell nuclei to obtain the cytoplasmic regions corresponding to each cell nucleus pixel region. The union of all cytoplasmic regions is taken as the cytoplasmic region set of a certain local correction region. Calculate the first red mean value in the red channel, the first green mean value in the green channel, and the first blue mean value in the blue channel for all pixels in the cell nucleus region set, and combine the first red mean value, the first green mean value, and the first blue mean value into a first color feature vector; Calculate the second red mean value of all pixels in the cytoplasmic region set in the red channel, the second green mean value in the green channel, and the second blue mean value in the blue channel, and combine the second red mean value, the second green mean value, and the second blue mean value into a second color feature vector; Calculate the Euclidean distance between the first color feature vector and the second color feature vector, and use the Euclidean distance as the color difference value between the nucleus region and the cytoplasm region within the local correction region.

6. The method for correcting staining differences in cervical pathological sections according to claim 1, characterized in that, The step of determining the staining difference correction coefficient for each local correction region based on the difference ratio sequence includes: Obtain a sequence of difference ratios corresponding to a certain local correction region. Each difference ratio in the sequence corresponds to a pixel position within the local correction region. The difference ratio is equal to the ratio of the chromaticity difference value at the pixel position to the chromaticity difference value at the anchor point. The chromaticity difference value at the pixel position is determined based on the chromaticity difference between the nucleus region and the cytoplasm region within the local window where the pixel position is located. The chromaticity difference value at the anchor point is determined based on the chromaticity difference between the nucleus region and the cytoplasm region at the location of the anchor point. Kernel density estimation is performed on the difference ratio sequence to obtain the probability density distribution curve of the difference ratio sequence on the ratio value axis. All local peak points on the probability density distribution curve are detected. The peak point with the highest probability density is selected from all local peak points as the main peak point. The difference ratio corresponding to the main peak point is used as the initial correction coefficient of a certain local correction region. Obtain the peak width corresponding to the main peak point, where the peak width is the length of the ratio interval on the probability density distribution curve when the probability density drops to a preset ratio of the probability density of the main peak point, with the main peak point as the center. Calculate the absolute value of the difference between the arithmetic mean of all difference ratios in the difference ratio sequence and the initial correction coefficient, and use the absolute value of the difference as the deviation of the correction coefficient; The peak width is compared with a preset width threshold, and the correction coefficient deviation is compared with a preset deviation threshold. When the peak width is less than the width threshold and the correction coefficient deviation is less than the deviation threshold, the initial correction coefficient is used as the staining difference correction coefficient for a certain local correction region. When the peak width is not less than the width threshold or the correction coefficient deviation is not less than the deviation threshold, determine whether there are two peak points on the probability density distribution curve whose probability density is greater than the probability density of the main peak point by a preset ratio. If the two peak points exist, the two ratio values ​​corresponding to the two peak points are respectively used as the first candidate correction coefficient and the second candidate correction coefficient, and the arithmetic mean of the first candidate correction coefficient and the second candidate correction coefficient is used as the staining difference correction coefficient of the local correction region. If the two peak points do not exist, the median value of the difference ratio sequence is used as the staining difference correction coefficient for a certain local correction region.

7. The method for correcting staining differences in cervical pathological sections according to claim 1, characterized in that, The process of correcting the pixel values ​​of each pixel within each local correction region using the staining difference correction coefficient, and outputting the corrected cervical pathology slide image includes: Obtain the staining difference correction coefficients corresponding to each local correction region; For a boundary pixel of a certain local correction region, calculate the first distance from the boundary pixel to the anchor point corresponding to the certain local correction region, and the second distance from the boundary pixel to the anchor point corresponding to the adjacent local correction region. Use the ratio of the first distance and the second distance as the fusion weight, and linearly interpolate the color difference correction coefficient corresponding to the certain local correction region and the color difference correction coefficient corresponding to the adjacent local correction region according to the fusion weight to obtain the fusion correction coefficient corresponding to the boundary pixel. For a non-boundary pixel in a certain local correction region, the color difference correction coefficient corresponding to the certain local correction region is used as the fusion correction coefficient corresponding to the non-boundary pixel. Divide the original pixel value of each pixel in the red channel within a certain local correction area by the red channel component of the fusion correction coefficient to obtain the corrected pixel value of each pixel in the red channel. Divide the original pixel value of each pixel in the green channel within a certain local correction area by the green channel component of the fusion correction coefficient to obtain the corrected pixel value of each pixel in the green channel. Divide the original pixel value of each pixel in the blue channel within a certain local correction area by the blue channel component of the fusion correction coefficient to obtain the corrected pixel value of each pixel in the blue channel. The corrected pixel values ​​of each pixel in the red channel, the green channel, and the blue channel are combined to form the corrected pixel value for each pixel. Pixel values ​​less than zero in the corrected pixel values ​​are set to zero, and pixel values ​​greater than 255 in the corrected pixel values ​​are set to 255. The pixel values ​​after the limiting process are used as the final corrected pixel values. Arrange the final corrected pixel values ​​of all pixels within all local correction areas according to their original spatial positions to generate and output the corrected cervical pathology slide image.

8. A cervical pathology section staining difference correction system, characterized in that, include: The module is configured to acquire microscopic images of multiple cervical pathology slides, extract the position coordinates and contour boundaries of cell nuclei in each microscopic image according to a preset image analysis strategy, and construct a spatial distribution map of cell nuclei corresponding to each microscopic image. The spatial distribution map of cell nuclei uses the position coordinates of cell nuclei as nodes and the spatial distance relationship between cell nuclei as edges. The alignment module is configured to determine the nuclear density field and internuclear distance distribution characteristics of each microscopic image based on the nuclear spatial distribution map, use the local maxima of the nuclear density field as anchor points and the internuclear distance distribution characteristics as scale constraints, and align the nuclear spatial distribution maps of each microscopic image to a unified spatial reference coordinate system. The partitioning module is configured to divide multiple local correction regions in the aligned spatial reference coordinate system, with each anchor point as the center and the neighborhood radius determined by the internuclear distance distribution characteristics as the boundary. In each local correction region, the chromaticity features of the nucleus region and the chromaticity features of the cytoplasm region are extracted respectively, and the chromaticity difference value between the nucleus region and the cytoplasm region in each local correction region is calculated. The determination module is configured to compare the chromaticity difference values ​​at each pixel position within the same local correction area with the chromaticity difference value at the anchor point, based on the chromaticity difference value at the anchor point, to obtain a difference ratio sequence corresponding to each pixel position, and to determine the color difference correction coefficient of each local correction area based on the difference ratio sequence. The correction module is configured to use the staining difference correction coefficient to correct the pixel values ​​of each pixel in each local correction area and output the corrected cervical pathology slide image.

9. An electronic device, characterized in that, include: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method according to any one of claims 1 to 7.