Method for automatic detection and counting of sparse target cells in fluorescent immunohistochemistry images

CN122948875APending Publication Date: 2026-10-20KUORAN BIOMEDICAL TECH (SHANGHAI) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611428883.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-15
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0009]现有技术中,荧光免疫组化图像的稀疏目标细胞检测存在核分割窗口尺寸循环依赖、图像边界区域核密度统计缺乏不完整邻域面积补偿、标记通道弥散信号硬性归属导致信号错配,以及份额修正缺乏环向连续性约束和强度守恒回配的问题

Benefits of technology

在标记通道内,通过横向分辨尺度的高斯一阶导数平滑,获取梯度方向。然后,利用同通道背景噪声中位数,计算指向可信度。对于有效像素,按照距离衰减和方向因子,构造分摊权重,将荧光强度分配到候选细胞,代替硬性归属。这样,归属不再依赖核区边界,避免了阳性细胞膜信号错误抬升相邻阴性细胞强度造成的假阳性,也缓解了真阳性信号被远端细胞稀释导致的假阴性。同时,同通道背景统计消除了跨通道误用引起的梯度筛选偏差,从而使方向证据更可靠。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure SMS_47
    Figure SMS_47
  • Figure SMS_113
    Figure SMS_113
Patent Text Reader

Abstract

This invention relates to the field of image processing technology, specifically to an automated method for detecting and counting sparse target cells in fluorescence immunohistochemical images. The method includes: first, coarsely segmenting the nuclear localization reference image to determine the nuclear size, and then finely segmenting to extract the nuclear centroid; determining the lateral resolution scale based on imaging parameters, and then using the local density inversion of the nuclear centroid to derive the apportionment radius, truncating the image at this scale as a lower limit; smoothly extracting the gradient direction from the labeled channel image using the lateral resolution scale, calculating the direction confidence based on the background noise of the same channel, and weighting the effective pixels according to the apportionment radius, distance, and direction factor to allocate them to candidate cells, obtaining an initial attribution intensity and attribution share source ledger. This invention can reduce false positives and false negatives caused by signal mismatch in dense areas, and improve the accuracy, traceability, and stability of sparse target cell detection and counting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology. More specifically, this invention relates to an automated method for detecting and counting sparse target cells in fluorescence immunohistochemical images. Background Technology

[0002] The automatic detection of sparse target cells in fluorescence immunohistochemistry images starts with the segmentation of cell nuclei based on the nuclear localization reference channel. Then, the fluorescence signals of the labeled channels are assigned based on the nuclear region. The assignment method is mainly hard assignment, relying on the nearest neighbor distance or whether the pixel is within the nuclear outline to assign pixel intensity to specific cells.

[0003] However, in densely celled areas such as lymphoid follicles and tumor infiltration margins, the signals of membrane- or cytoplasmic markers diffuse around the nucleus. The distance between adjacent cell nuclei is often less than the lateral resolution limit of the optical system, resulting in signal propagation across cells.

[0004] Hard attribution does not take into account the direction and range of signal diffusion. Positive cell membrane signals are easily miscounted as negative cells, resulting in false positive counts. True positive cells may be missed due to signal dilution at distant sites, which directly affects the accuracy of sparse target cell detection.

[0005] Existing local adaptive binarization segmentation requires a preset window side length, which needs to match the kernel diameter, but the kernel diameter comes from the segmentation result, forming a circular dependency.

[0006] The kernel density statistics of the image boundary region lack area compensation for incomplete neighborhoods, which leads to distortion in the apportionment scale estimation.

[0007] The background noise parameters of the labeled channel are often borrowed from other channels, which does not reflect the true noise characteristics of the channel itself, thus reducing the reliability of the signal attribution.

[0008] The subsequent share adjustment strategy lacks prior constraints on cyclic continuity and global strength conservation. When dealing with densely superimposed signals, it is prone to iterative oscillations or non-conservation of the total signal amount, which ultimately reduces the credibility and traceability of the analysis results. Summary of the Invention

[0009] In existing technologies, sparse target cell detection in fluorescence immunohistochemistry images suffers from several problems: cyclic dependence of nuclear segmentation window size, lack of incomplete neighborhood area compensation in image boundary region nuclear density statistics, hard assignment of diffuse signals from labeled channels leading to signal mismatch, and lack of circumferential continuity constraints and intensity conservation in fraction correction. To address these issues, this invention provides the following solution.

[0010] In a first aspect, the present invention provides an automated method for detecting and counting sparse target cells in fluorescence immunohistochemical images, employing the following technical solution: The kernel size is obtained by coarse segmentation of the kernel localization reference image, and then the kernel centroid is extracted by fine segmentation. The lateral resolution scale is determined based on the imaging parameters, the apportionment radius is determined based on the local density of the core centroid, and the lateral resolution scale is used as the lower limit of the apportionment radius for truncation. The labeled channel image is smoothed and gradient direction is extracted using the lateral resolution scale. The pointing confidence is calculated based on the background noise of the same channel. The effective pixels are weighted and distributed to candidate cells according to the apportionment radius, distance and direction factor to obtain the initial attribution strength and attribution share source ledger. The nuclear outline of each cell is expanded outward at the lateral resolution scale to form a perinuclear ring. The borrowing share is determined by the circumferential energy concentration index of the attribution intensity of each sector of the perinuclear ring. The borrowing is traversed unidirectionally in ascending order of the initial attribution intensity, and the borrowing is withdrawn and directionally backfilled into the only adjacent cell, keeping the total attribution intensity unchanged. A connected region is constructed using the centroid distance, and residual verification is performed between the corrected sum of assigned strengths and the original total effective signal within the connected region, and then the signal is re-matched. Calculate the intensity areal density and circumferential coverage within the perinuclear ring of each cell, and use dynamic thresholds to identify and count positive cells.

[0011] Preferably, determining the lateral resolution scale based on imaging parameters includes: converting the lateral resolution scale according to the Rayleigh criterion using the objective lens numerical aperture, marker emission wavelength, and physical size per pixel of the image acquisition system; the lateral resolution scale is a resolution scale in pixels obtained by dividing 0.61 times the marker emission wavelength by the product of the objective lens numerical aperture and the physical size per pixel.

[0012] Preferably, the fine segmentation and extraction of the kernel centroid includes: performing initial local adaptive binarization on the kernel positioning reference image with a preset fixed window size to obtain a coarse kernel region; determining the equivalent circle diameter of each connected region based on the area of ​​each connected region in the coarse kernel region, and using the mean of the equivalent circle diameters as the mean of the initial kernel equivalent diameter; performing a second local adaptive binarization with twice the mean of the initial kernel equivalent diameter as the window side length, and performing distance transformation and watershed expansion on the obtained kernel region binary mask to extract the kernel centroid.

[0013] Preferably, determining the apportionment radius based on the local density of the kernel centroid includes: calculating the mean of the equivalent circular diameters of each kernel contour obtained by the fine segmentation, as the statistical mean of the kernel equivalent diameter; taking each kernel centroid as the center, taking three times the statistical mean of the kernel equivalent diameter as the radius, counting the number of kernel centroids in the neighborhood of the circle, and taking the actual intersection area of ​​the neighborhood and the image region as the effective neighborhood area, dividing the number of kernel centroids by the effective neighborhood area to obtain the local clustering density of the kernel centroids; dividing the scale factor by the square root of the local clustering density of the kernel centroids to obtain the initial value of the apportionment radius; comparing the initial value of the apportionment radius with the lateral resolution scale, and taking the larger one as the apportionment radius.

[0014] Preferably, the step of calculating the pointing confidence based on the background noise of the same channel includes: performing Gaussian first-order directional derivative processing on the marked channel image using the lateral resolution scale as the smoothing scale to obtain the gradient magnitude of each pixel; calculating the median of the gradient magnitude within the background mask of the marked channel image itself as a gradient noise reference; using the sum of the gradient magnitude at the effective pixel and the gradient noise reference as the denominator, and the gradient magnitude as the numerator, calculating the ratio to obtain the pointing confidence; and setting the pointing confidence to zero when the denominator is zero.

[0015] Preferably, the weighted distribution of effective pixels to candidate cells based on the distribution radius, distance, and orientation factor includes: filtering effective signals in the labeled channel image, identifying pixels with a gray level higher than the mean gray level of the background mask of the labeled channel image plus three times the gray level standard deviation as effective pixels, and recording the effective signal intensity after background subtraction; searching for the nuclear centroid within a range where the distance from each effective pixel to the nuclear centroid does not exceed three times the corresponding cell distribution radius, using each effective pixel as the center, to obtain a set of candidate cells; calculating the distance from each effective pixel to the nuclear centroid of each candidate cell and the source pointing deviation angle; constructing the distribution weights, which are obtained by multiplying a distance attenuation term and an orientation evidence term; the distance attenuation term is... An exponential decay function with the corresponding cell's allocated radius as the decay scale is used, and the greater the distance from the effective pixel to the centroid of the candidate cell nucleus, the smaller the distance decay term; the directional evidence term includes a directional cosine factor and an isotropic allocation factor weighted by the directional confidence, and the isotropic allocation factor is set as the reciprocal of the number of candidate cells; the allocated weights are normalized to obtain the allocated coefficient; when the sum of all allocated weights corresponding to a certain effective pixel is zero, the allocated coefficient of that effective pixel to each candidate cell is set as the reciprocal of the number of candidate cells; the effective signal intensity of each effective pixel is accumulated to the corresponding candidate cell according to the allocated coefficient to obtain the initial attribution intensity, and the attribution share source ledger of each effective pixel is recorded.

[0016] Preferably, the step of determining the borrowing share by the circumferential energy concentration index of the attribution intensity of each sector of the perinuclear ring, traversing unidirectionally in ascending order of initial attribution intensity, withdrawing and directionally filling into the only adjacent cell, and keeping the total attribution intensity unchanged, includes: expanding the nuclear outline of each cell outward by the lateral resolution scale to form a perinuclear ring; dividing the perinuclear ring into multiple sectors with the nuclear centroid as the pole and at a preset angle that ensures the circumferential arc length of each sector is not less than the lateral resolution scale, accumulating the attribution intensity within each sector, and taking the ratio of the maximum value of the attribution intensity of each sector to the sum as the circumferential energy concentration index, and taking the median of the attribution intensity of each sector as the circumferential baseline; triggering withdrawal when the circumferential energy concentration index is greater than a preset upper limit; taking the center azimuth angle of the sector with the highest attribution intensity as the source signal gradient direction; and in the case of the withdrawing nuclear centroid... Within a search range centered on the centroid and with a radius three times the allocated radius, the adjacent cell with the smallest deviation from the direction of the line connecting to the centroid of the withdrawing party and the gradient direction of the source signal, and whose initial attribution strength is higher than that of the withdrawing party, is selected as the sole receiver. A one-way traversal is performed in ascending order of initial attribution strength, with the currently traversed cell designated as the withdrawing party, and cells already designated as receivers are no longer considered withdrawing parties. The portion of the sector with the highest attribution strength that exceeds the circumferential baseline is multiplied by a direction gating factor to obtain the withdrawal share. When the minimum deviation angle corresponding to the sole receiver is not greater than a right angle, the direction gating factor is taken as the cosine of the minimum deviation angle; when the minimum deviation angle is greater than a right angle, the direction gating factor is zero. The withdrawal share is deducted from the attribution strength of the withdrawing party and added to the attribution strength of the sole receiver, keeping the total attribution strength unchanged.

[0017] Preferably, the step of constructing a connected region based on the distance between the core centroids, performing residual verification and reconfiguration on the corrected sum of the assigned intensity and the original effective signal total within the connected region, includes: connecting cells whose distance between their core centroids is less than or equal to twice the larger of the two cell distribution radii to form a connected region; for each connected region, calculating the sum of the assigned intensity of all cells within it after withdrawal and reconfiguration correction, and the difference between the sum of the effective signal intensities of all effective pixels within the connected region; if the sum of the effective signal intensities is zero, then setting the assigned intensity of all cells within the connected region to zero; if the sum of the effective signal intensities is not zero, and the ratio of the absolute value of the difference to the sum of the effective signal intensities is greater than a preset allowable upper limit, then reconfiguring the difference back to each cell according to the proportion of the corrected assigned intensity of each cell to the total assigned intensity within the connected region.

[0018] Preferably, the calculation of the attribution intensity areal density and circumferential coverage within the perinuclear ring of each cell, combined with dynamic thresholding to determine and count positive cells, includes: calculating the attribution intensity areal density within the perinuclear ring of each cell based on the attribution log after withdrawal and rematching correction, wherein the attribution intensity areal density is the attribution intensity within the perinuclear ring after withdrawal and rematching correction divided by the area of ​​the perinuclear ring; calculating the circumferential coverage, wherein the circumferential coverage is the proportion of the number of sectors with attribution intensity higher than the circumferential baseline to the total number of sectors; wherein, the areal density threshold in the dynamic threshold is preferentially adopted using the maximum inter-class variance method threshold of the attribution intensity areal density of all cells in this field of view; when the number of cells is less than a preset number threshold, or the maximum inter-class variance method cannot obtain two non-empty categories, the areal density threshold is determined by the mean of the background area areal density plus three times the standard deviation; cells with attribution intensity areal density greater than the areal density threshold and circumferential coverage greater than a preset coverage threshold are determined as positive cells and counted cumulatively.

[0019] The embodiments of the present invention have at least the following beneficial effects: Within the labeled channel, the gradient direction is obtained through Gaussian first-order derivative smoothing at the lateral resolution scale. Then, the directional confidence is calculated using the median of the background noise in the same channel. For valid pixels, a distributed weight is constructed based on distance attenuation and a direction factor to allocate fluorescence intensity to candidate cells, replacing hard assignment. This eliminates the dependence on nuclear boundaries, avoiding false positives caused by positive cell membrane signals mistakenly inflating the intensity of adjacent negative cells, and mitigating false negatives caused by the dilution of true positive signals by distant cells. Simultaneously, background statistics in the same channel eliminate gradient screening bias caused by cross-channel misuse, thus making the directional evidence more reliable.

[0020] First, a coarse segmentation using a preset fixed window is performed to obtain a rough equivalent diameter of the kernel. Then, a fine segmentation is performed using twice this diameter as the window side length, thereby breaking the cyclic dependence of the segmentation window size on the unmeasured kernel diameter. After compensating for the image boundary area, an initial value for the allocated radius is calculated based on the local aggregation density of the kernel centroid. This value is then compared with the lateral resolution scale calculated from the objective lens numerical aperture, marker emission wavelength, and actual pixel size, and the larger value is taken to obtain the density-adaptive allocated radius. This radius automatically expands in sparse regions and automatically contracts in dense regions, providing a spatial reference that matches the degree of tissue crowding for subsequent weighted allocation and withdrawal operations. At the same time, the system's resolution limit truncation contributes to the rationality of the lower scale limit.

[0021] The nuclear outline is expanded outward to form a perinuclear ring, which is then divided into sectors at equal angles. The circumferential energy concentration index of the assigned intensity for each sector is calculated. When this index exceeds the upper limit determined statistically by isolated nuclear samples, it is identified as a borrowed share, and a reverse withdrawal is initiated. A one-way traversal is performed according to the initial assigned intensity in ascending order, selecting the neighboring cell with the smallest source direction deviation angle and higher intensity as the sole receiver. Shares of concentrated sectors exceeding the circumferential baseline are repositioned and backfilled based on the cosine of the deviation angle. Based on the prior of circumferential continuity, borrowing signals are determined independently of the intensity threshold, correcting false positives caused by concentrated sectors of diffuse signals. The one-way traversal and sole receiver decision avoids withdrawal oscillations, and withdrawal and backfilling are strictly zero-sum, maintaining a constant total global intensity.

[0022] A connected region is constructed based on the distance between the nuclei and centroids. The assigned intensity within this region, after withdrawal correction, is summarized and compared with the original total effective signal. When the relative residual exceeds the allowable upper limit, the residual is reallocated back to each cell according to the proportion of assigned intensity, thereby eliminating the cumulative error introduced by segmented accumulation and fractional transfer, achieving a strict zero-sum closed loop for the total intensity. For positive determination, the assigned intensity areal density and circumferential coverage are calculated simultaneously. The areal density threshold is dynamically estimated from the areal density distribution of cells in this field of view, while the coverage threshold is preset to a constant. A positive result is only counted when both quantitative and quantitative conditions are met. This joint determination overcomes the sensitivity of a single intensity threshold to cell size, and the dynamic threshold ensures the method maintains discriminative stability across different devices and staining batches. Attached Figure Description

[0023] Figure 1 The flowchart illustrates the steps of the automatic detection and counting method for sparse target cells in fluorescence immunohistochemical images according to the present invention. Detailed Implementation

[0024] 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, not all, of the embodiments of the present invention. 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.

[0025] S1: Perform coarse segmentation on the kernel localization reference image to obtain the kernel size, and then perform fine segmentation to extract the kernel centroid.

[0026] In fluorescence immunohistochemistry images, the actual size of the cell nucleus is unknown before segmentation. The local adaptive binarization algorithm needs to set a neighborhood window side length, which should be greater than the diameter of the target to be segmented. However, the diameter itself needs to be obtained through statistical analysis of the segmentation results, which creates a circular dependency between the window size and the nucleus diameter.

[0027] To address this issue, a coarse segmentation based on a fixed window is first performed to obtain a preliminary estimate of the kernel size, and then this estimate is used to set the window for fine segmentation.

[0028] First, the input nuclear localization reference image is processed using... Median filtering of the window is used to suppress salt-and-pepper noise. Median filtering is a well-known technique and will not be described in detail here.

[0029] Then, a preset fixed window size was used. Perform initial local adaptive binarization on the filtered image. An empirical value of 15 pixels is taken as a hyperparameter, which can be adjusted by the implementer according to the magnification and resolution of the image being processed. Local adaptive binarization dynamically determines the threshold based on the mean and standard deviation of grayscale values ​​in the pixel neighborhood. This is a well-known technique and will not be elaborated further. Through this coarse segmentation, a binary map of the coarse kernel region is obtained, in which the foreground pixels correspond to the initially determined kernel region.

[0030] For each connected foreground region in the binary graph, calculate its area. The unit is pixel square, and the diameter of the equivalent circle for this region is calculated. Then, take the arithmetic mean of the diameters of all connected components as the preliminary kernel equivalent diameter mean. ,in, ; ; The total number of connected components in the coarse kernel region, dimensionless; For the first The area of ​​each connected component, expressed in pixels squared; Pi The unit is pixels.

[0031] Next As the new window side length, the filtered kernel localization reference image is locally adaptively binarized again to obtain a fine kernel region binary mask. The window side length is determined based on the preliminary estimate of the kernel size. Secondary segmentation can more accurately separate the cell nucleus region from the background. The value of 2 times the empirical value can be adjusted by the implementer according to the specific implementation scenario.

[0032] After obtaining the binary mask of the fine kernel region, a distance transformation is performed on the binary mask to obtain the distance value from each foreground pixel to the nearest background pixel. The distance transformation is a well-known technique and will not be described in detail here.

[0033] Local maxima are found on the distance transformation graph. These points are used as seed points for individual cell nuclei. Using these seed points as markers, the watershed segmentation algorithm is executed on the distance transformation graph to segment potentially contiguous nuclei into independent connected regions. The watershed algorithm is a well-known technique and will not be described in detail here.

[0034] Finally, for each independent region obtained by watershed segmentation, the average value of all pixel coordinates in that region is calculated, and the centroid position of the cell nucleus is obtained, thereby outputting the set of nucleus centroids. The acquisition of the centroid of connected components is a well-known technique and will not be elaborated further.

[0035] S2: After determining the lateral resolution scale based on the imaging parameters, the local density inversion of the core centroid is used to obtain the apportionment radius, and this scale is used as the lower limit for truncation.

[0036] After obtaining the centroid position and nuclear region contour of each cell nucleus in the nuclear localization reference image, the radius of action of each cell nucleus in distributing diffuse fluorescence signal in the labeling channel is further determined.

[0037] In fluorescence immunohistochemistry images, the fluorescence signal of the labeled channel is diffusely distributed. When the tissue is dense, the distance between adjacent cell nuclei is small. Using a fixed distribution radius may result in the same pixel being repeatedly assigned or omitted by multiple cells.

[0038] Therefore, the allocation radius needs to be adaptively determined based on the local crowding around each cell nucleus. In densely populated areas of cell nuclei, a smaller allocation radius can limit the assignment of the same signal to a short range, while in sparse areas, a larger allocation radius allows effective signals from a distance to be included in the allocation.

[0039] Meanwhile, the diffraction limit of the optical system determines the minimum distance that can be resolved in the image. If the apportionment radius is smaller than this limit, it will be impossible to effectively distinguish the signal attribution of cell nuclei with a spacing smaller than this limit. Therefore, the lateral resolution scale of the image acquisition system should be used as the lower limit of the apportionment radius for truncation.

[0040] The lateral resolution scale is calculated from the parameters of the imaging system, and the numerical aperture of the objective lens is read from the imaging scale record recorded by the image acquisition device. Marking the emission wavelength and the actual size of each pixel in the image. .

[0041] in, It is the numerical aperture of the objective lens, which is dimensionless and its value determines the objective lens's light-gathering and resolving power. It is the peak wavelength of the fluorescent label emission, measured in nanometers, which determines the diffraction limit of light; It is the actual length corresponding to each pixel, measured in nanometers per pixel, used to convert pixel distance into actual scale.

[0042] According to Rayleigh's criterion, the horizontal resolution scale ; This represents the minimum distance that an optical system can resolve on an image. Any structure smaller than this distance cannot be effectively distinguished, and therefore it is used as the lower limit of the amortized radius.

[0043] To measure the degree of local crowding around the cell nucleus, a baseline scale needs to be determined first. From the binary mask of the nuclear region obtained through fine segmentation, a total of [number missing] [items missing] are extracted. One cell nucleus, The total number of cell nuclei is dimensionless.

[0044] For each cell nucleus, extract its corresponding connected component and calculate the area of ​​that connected component. This area, expressed in pixels squared, reflects the size of the cell nucleus.

[0045] Calculate the diameter of its equivalent circle from its area. ;in, For the first The area of ​​each core region The diameter of a circle with the same area as the kernel is represented in pixels.

[0046] For all The arithmetic mean of the equivalent circular diameters of each cell nucleus is taken to obtain the statistical mean of the nuclear equivalent diameter. ,in, The size of the entire cell nucleus is represented in pixels and is used to determine the radius of the subsequent search neighborhood.

[0047] With the first Centered on the core mass, with Define a circular search neighborhood for the radius, where, The size is measured in pixels and is set based on kernel size statistics, with an empirical value of 3 times the kernel size. This allows the search scope to cover a local area, and the multiplier can be set by the implementer according to the specific implementation scenario.

[0048] Count the total number of all nuclei within the search neighborhood. , Including the The centroid of each nucleus reflects the number of local cell nuclei. The actual intersection area between this circular search neighborhood and the image region is calculated. .

[0049] When the centroid of the kernel is close to the image boundary, some regions of the search neighborhood may fall outside the image. Only the portion actually located within the image is counted, expressed in square pixels.

[0050] No. Local aggregation density at the core ,in, The density is expressed in negative square of pixels, representing the number of nuclei per unit area. Higher density indicates denser nuclei aggregation.

[0051] The first is obtained by inversion of local cluster density. Initial value of the radius of influence of each cell nucleus The inversion relationship is as follows:

[0052] in, The scale factor is dimensionless and has an empirical value of 1.0. It is an adjustable hyperparameter that implementers can adjust according to specific scenarios. Its function is to control the scale of the inversion results so that the final apportionment radius is within a reasonable range.

[0053] This inversion relationship makes it possible to find densely packed regions of the cell nucleus. When larger The value is small, thus limiting signal distribution to the short range, while in sparse regions... When smaller A larger value is used to include valid signals from a distance in the allocation.

[0054] Then, Lateral resolution scale Compare the two values ​​and take the larger one as the final apportioned radius of action. ;in, In pixels.

[0055] because The lateral resolution limit of the optical system, after truncation Not less than This ensures that the apportionment radius will not fall below the lateral resolution limit.

[0056] Thus, each cell nucleus acquires a distributed radius of action that is adaptively adjusted based on the degree of local crowding and truncated by the lateral resolution limit. .

[0057] S3: Extract gradient directions from the labeled channel images using a lateral resolution scale and distribute fluorescence signals based on the confidence level of the gradient directions.

[0058] In fluorescence immunohistochemistry images, the fluorescence signal of the labeled channel is diffusely distributed in the pixel domain, and the intensity at a single pixel location is often contributed by multiple surrounding cells.

[0059] When the intercellular distance is close to or smaller than the lateral resolution scale of the imaging system, it is impossible to uniquely attribute the signal of each pixel to a specific cell through geometric boundaries. The intensity gradient of the diffuse light field generally points to the direction of the signal source that contributes the most to that pixel. Therefore, the gradient direction can be used as a basis for source orientation.

[0060] However, in regions where signal changes are gradual or the signal-to-noise ratio is low, the gradient direction is nearly random and cannot be directly used as a reliable basis for allocation.

[0061] To address this limitation, this embodiment first extracts the gradient direction from the labeled channel image using the lateral resolution scale as the smoothing scale. Then, it obtains the gradient pointing confidence based on the background noise of the same channel. Finally, it uses this pointing confidence to dynamically modulate the distance attenuation and direction factor, and distributes the fluorescence intensity of the effective pixels to their candidate cells with normalized weights, thereby obtaining the initial assigned intensity of each cell and the assigned share source ledger for each pixel.

[0062] The kernel centroid position and kernel contours are obtained from step S1. On the marked channel image, the region inside each kernel contour is excluded, and the remaining pixels constitute the background mask of the marked channel.

[0063] Within this background mask, the average grayscale value of all pixels is calculated to obtain the background base of the labeled channels. The unit is pixel intensity value, where, Used to remove background signals from pixel grayscale values ​​in subsequent steps.

[0064] Simultaneously, the standard deviation of grayscale values ​​is used to obtain the standard deviation of background noise for the marked channels. Units and same. Used to set the threshold for filtering valid signals.

[0065] Next, the labeled channel image is processed using the first-order directional derivative of Gaussian smoothing, with the scale parameter of Gaussian smoothing applied. Set as lateral resolution scale ,Right now: ;in, Determined by the imaging system, this serves as a smoothing scale to adapt gradient extraction to the spatial resolution of intercellular spacing. The specific calculation of the Gaussian first-order directional derivative is a well-known technique and will not be elaborated here.

[0066] For each pixel position in the image The horizontal and vertical gradient components are obtained respectively, and the gradient magnitude is calculated from them. and gradient pointing angle ,in, It reflects the drastic change in fluorescence intensity at that pixel, and the unit is the change in intensity per pixel. In this processing, it is considered dimensionless. This represents the angle between the gradient direction and the horizontal axis, expressed in radians.

[0067] Within the background mask of the labeled channel, extract the gradient magnitudes corresponding to the pixels belonging to the background, and take the median to obtain the gradient noise reference value. ,in, and If they have the same dimensions, they are also considered dimensionless in calculations. Used to measure the typical level of noise component in gradient magnitude.

[0068] For each pixel in the labeled channel image, calculate its gradient pointing confidence. ,in, Dimensionless, with values ​​ranging from 0 to 1; the closer to 1, the higher the reliability.

[0069] When the gradient magnitude at pixel Much larger than the gradient noise reference value hour, A value close to 1 indicates that the gradient direction at that point is reliable and can be used as evidence of direction.

[0070] when Close to or less than hour, A value close to 0 indicates that the gradient direction is unreliable. It will be used in the subsequent weighting to modulate the directional evidence term and determine the degree of influence of the directional cosine factor.

[0071] Next, the labeled channel image is filtered pixel by pixel for effective signals. The filtering condition is that the original gray value of the pixel is greater than the effective signal threshold. ;in, It is a threshold coefficient, dimensionless, with an empirical value of 3. The implementer can adjust it according to the image signal-to-noise ratio to control the strictness of the screening. Pixels that meet the screening conditions are recorded as valid pixels.

[0072] Subtract the background base from the original grayscale value of the effective pixels. The difference obtained is taken as the effective signal strength of the effective pixel. The unit is pixel intensity value, where, This represents the total amount of fluorescence signal from surrounding cells carried by the pixel, which can be used to distribute it to candidate cells. Pixels that do not meet the screening criteria are not included in the distribution.

[0073] For each valid pixel, use the index This indicates that for a given pixel, the centroids of the nuclei surrounding its location that satisfy the distance condition are retrieved to form a candidate cell set for the effective pixel. Specifically, the distance condition is: Let the distance from the position of the effective pixel to the nth nucleus... The Euclidean distance between the centroids is The unit is pixels. If the following conditions are met... Then the first One cell is added to the candidate cell set.

[0074] in, It is the first The distributed radius of influence per cell, measured in pixels, has been calculated in previous steps and represents the spatial diffusion range of the cell's fluorescence signal. As a distance condition, it ensures coverage of the main contributing region of the cell signal. Signal contributions beyond this distance can be ignored. The multiple of 3 is an empirical value that can be adjusted by the implementer according to the specific implementation scenario.

[0075] For effective pixels Let its candidate cell set be denoted as The number of candidate cells is ,when At that time, the valid pixel is discarded and does not participate in the allocation of any cell.

[0076] For effective pixels and each cell in its candidate cell set Calculate the source pointing deviation angle The specific steps are as follows: Let the gradient pointing angle of the effective pixel be... Pointing from pixel position to cell The vector direction angle of the nucleus is , The unit is radians. Then the deviation angle... Calculate using the following formula:

[0077] in, The unit is radians, and its value ranges from 0 to 1. The smaller the value, the more directly the gradient points to the cell; conversely, the larger the value, the greater the deviation.

[0078] Construct effective pixels Allocated to cells apportionment weight , It is obtained by multiplying the distance decay term and the direction evidence term. The distance decay term uses a cell-based approach. Radius of shared effect An exponential decay function with a decay scale:

[0079] in, Dimensionless, when distance Exceed When this value decreases rapidly, it reflects the characteristic that signal strength attenuates with increasing distance.

[0080] Directional evidence item By pointing to credibility Adjusting the direction cosine factor and mixing the isotropic allocation factor, the calculation formula is as follows:

[0081] in, It is the direction cosine factor, when the deviation angle Less than A positive value is taken for radians, indicating that the gradient direction points towards the cell. On the side where it is located; when Greater than or equal to The radius is set to zero to exclude directions that deviate from the cell.

[0082] It is an isotropic allocation factor, which takes the number of candidate cells for that effective pixel. The reciprocal of , dimensionless.

[0083] when At higher levels, the directional evidence term is dominated by the directional cosine factor, and the allocation result is sensitive to the source orientation; when At lower levels, the directional evidence term tends to be... The distribution is approximated by equal distribution of candidate cells, thus reflecting the uncertainty of the gradient direction.

[0084] Therefore, effective pixels to cells The allocation weight is: ,in, It is dimensionless and combines evidence from both distance and direction.

[0085] For effective pixels For all candidate cells, normalize the above-mentioned allocation weights to obtain the allocation coefficients. ,in, Dimensionless, and for each valid pixel satisfy: This ensures that the total effective signal strength of the pixel is conserved during the allocation process.

[0086] For each cell The initial attribution strength of the cell is obtained by summing the share of all valid pixels received as candidate cells. ;in, It is all cells The set of indices for the effective pixels of candidate cells. It is the first The effective signal strength of each effective pixel, expressed in pixel intensity value. Units and Similarly, it is also a pixel intensity value. Represents cells The total amount of fluorescence signal obtained in the initial allocation phase is used to subsequently assess the expression level of the target protein.

[0087] During the pixel-by-pixel allocation process, a ledger of the source of the allocated share is established simultaneously, with each record in the ledger corresponding to a pair of valid pixels. With receiving cells It contains the following information: the coordinates of the effective pixels, and the effective signal strength. apportionment coefficient Actual apportionment intensity Deviance angle and the credibility of the pointer This ledger allows the destination of each fluorescence signal to be traced back to its specific pixel location and allocation basis, which is used for verification and adjustment.

[0088] S4: Identify borrowed shares through the circumferential energy concentration index and directionally backfill to the only adjacent cell, maintaining a zero-sum.

[0089] After the evidence-weighted competitive allocation is completed, each cell receives an initial attribution strength. The unit is pixel intensity value, and an attribution share source ledger has been established.

[0090] Because the fluorescent signal of the labeled channel is diffusely distributed, when the distance between adjacent cells is small, a certain cell will receive a borrowed share from the neighboring cell. The spatial distribution of this borrowed share on the perinuclear ring shows obvious directional concentration, that is, the sector facing the source cell has a significantly higher belonging intensity than other sectors.

[0091] Therefore, by analyzing the concentration of the attribution intensity distribution along the circumferential direction in each sector of the perinuclear ring, cells containing borrowed shares can be identified. This step uses the initial attribution state obtained through competitive allocation as a benchmark, performs circumferential continuity verification and reverse withdrawal directional backfilling, and maintains a global intensity zero-sum.

[0092] For each cell First, a perinuclear ring is constructed. Using the binary mask of the kernel contour obtained by fine segmentation as a reference, a morphological dilation operation is performed, with the dilation radius taken as the lateral resolution scale. The unit is pixels. The dilated region is obtained, and the original kernel region is subtracted from the dilated region to get the width. The ring-shaped region serves as the perinuclear ring of the cell.

[0093] The total number of pixels within the ring is denoted as The unit is pixel squared. Because the width of the annular band is consistent with the lateral resolution scale, the changes in fluorescence signal contained within the annular band are spatially resolvable.

[0094] With the nucleus's center of mass as the pole and the horizontal axis to the right as the polar axis, the circumferential zone of the nucleus is divided into equal parts. Each sector is divided into several segments, with the sector boundaries following a left-closed, right-open principle. To ensure that the circumferential arc length of each sector is not less than the lateral resolution scale, the number of segments is determined. In the formula, The average distance from the nucleus centroid to the outer edge of the perinuclear ring is expressed in pixels, derived from the first... The equivalent circular radius of each cell nucleus plus To obtain, that is: ,in, For the first The equivalent circular diameter of a cell nucleus, in pixels; The horizontal resolution scale is expressed in pixels. This is the floor function; It is dimensionless, and the lower limit is set to 8, which is an empirical value that can be adjusted by the implementer according to the specific implementation scenario.

[0095] The attribution intensity is accumulated cell by cell and sector by sector, based on the effective pixels corresponding to the current cell recorded in the attribution share source ledger. The initial allocation share will cause the pixel coordinates to fall into the kernel peripheral ring. The shares within a sector are accumulated to obtain the sector's attribution strength based on its initial attribution state. The unit is pixel intensity value.

[0096] Summing the attribution intensities of all sectors yields the total attribution intensity of the cell within the perinuclear ring. The median of the all-sector attribution strength is taken as the circumferential baseline. Thus, the circumferential energy concentration index Defined as the ratio of the maximum sector attribution strength to the total attribution strength:

[0097] In the formula, The unit is pixel intensity value; Dimensionless, with values ​​ranging from 0 to 1. The larger the value, the higher the concentration of initial attribution strength in the ring direction, and the greater the possibility of borrowing shares.

[0098] Judgment upper limit The density of localized clusters was obtained from statistical analysis of cells with low localized clustering density within the field of view. The result, calculated from the preceding steps, is used to measure the degree of aggregation around cells.

[0099] All cells Take the median, and select cells with an aggregation density lower than the median as an isolated nucleus sample set. If the number of cells in this sample set is not less than... ,in Then calculate the mean of the circumferential energy concentration index of these isolated nuclei. and standard deviation and take If the number of isolated nuclear samples is insufficient Then take the empirical value. This empirical value is a hyperparameter, dimensionless, and can be adjusted by the implementer according to the specific implementation scenario. and All of these are dimensionless statistics with preset empirical values. Therefore, the adaptive thresholds obtained in this way ensure that the judgment of borrowing share is not affected by the absolute strength level.

[0100] Before performing the withdrawal and backfill, all cells are assigned according to their initial attribution strength. Arrange the cells in ascending order to form a traversal sequence. At the same time, establish a set of received markers, which is initially empty. This set records cells that have been received as recipients of the backfill share. Cells in this set will not be considered for withdrawal in this round of traversal.

[0101] Additionally, initialize a working attribution strength vector that is identical to the initial attribution strength. The initial values ​​satisfy: Therefore, the undo and backfill operations will be modified on this working vector.

[0102] Starting with the cell with the lowest strength in the traversal sequence, extract the current cell in sequence. It checks whether the cell is in the received tag set. If it is, the cell is skipped, and the next cell in the sequence is processed. If it is not, and the cell's circumferential energy concentration index is... Greater than the upper limit of judgment If this happens, a reverse rollback process will be triggered.

[0103] For cells that trigger withdrawal Identify the sector with the highest assigned strength on its perinuclear ring band, and denote the index of this sector as . The central azimuth angle of the angle range corresponding to this sector is The unit is radians. As the source signal gradient direction of the cell, this direction reflects the main source direction of the borrowed share entering the cell.

[0104] Centered on the centroid of the withdrawing side, with a radius of... Construct a circular search neighborhood, where The radius of the allocated action determined for this cell in the allocation step is in pixels. All other cell nuclei centroids contained within this neighborhood are retrieved as candidate neighboring cells.

[0105] From these candidate neighboring cells, cells with an initial attribution strength greater than the initial attribution strength of the withdrawing cell are further selected to form a candidate receiver set. If the candidate receiver set is empty, the withdrawal is not performed, and the next cell is processed.

[0106] For each cell in the candidate receiver set Calculate the azimuth angle of the line connecting the centroid of the withdrawing party to the centroid of the candidate receiver. The unit is radians, and the azimuth angle relative to the gradient direction of the source signal is calculated. Angle of deviation between: ,in, Converted to 0 Within the range, the unit is radians. The smaller the deviation angle, the closer the adjacent cell is to the source direction of the borrowed share.

[0107] Select the deviation angle from the candidate receiver set. The smallest cell is the sole recipient. If multiple candidate receivers with the same deviation angle exist, the one with the highest initial attribution strength is selected. Add it to the set of received tokens to prevent it from being withdrawn again in subsequent traversals.

[0108] Withdrawal of shares Calculate using the following formula:

[0109] In the formula, The maximum sector intensity exceeds the circumferential baseline, and the unit is pixel intensity value; The direction matching gating factor is dimensionless and is defined as follows:

[0110] The unit is the same as the attribution strength. When the minimum deviation angle corresponding to the only receiver is not greater than a right angle, the direction matching gating factor is taken as the cosine of the minimum deviation angle; when the minimum deviation angle is greater than a right angle, the direction matching gating factor is taken as zero, preventing cells from backfilling in the direction away from the source.

[0111] Perform strict zero-sum withdrawal and backfill operations, and allocate the withdrawal party to the work attribution intensity. The value is updated to: , the recipient The value is updated to: .

[0112] At the same time, a withdrawal record is added to the attribution ledger, recording the withdrawing party's identifier, the receiving party's identifier, and the withdrawn share. Deviance angle and the corresponding maximum sector index Since the withdrawn share is deducted from one side and added to the other side in equal amounts, the total work attribution strength of all cells in the full field of view remains unchanged, satisfying the zero-sum condition.

[0113] After processing all cells in ascending order, the current round of withdrawal and backfilling ends, and the corrected job assignment strength for each cell is output. And the ability to withdraw records.

[0114] At this point, the cell attribution strengths, after circumferential continuity verification and backfill correction, are obtained, and the borrowed share has been identified and directed to the unique neighboring cell in the source direction.

[0115] S5: Construct connected regions based on the distance between the core and centroid and perform residual verification and strength matching.

[0116] After completing the reverse withdrawal and directional backfill correction, each cell obtains the corrected attribution strength. Although the total intensity of the entire field of view is kept constant during each withdrawal and backfill operation, the truncation error introduced by multiple rounds of accumulation, floating-point rounding, and the normalization process of the apportionment coefficient will cause a slight deviation in the theoretical conservation relationship between the sum of the corrected attributed intensities and the total amount of the original effective signal.

[0117] To eliminate this accumulated residual and ensure data traceability, strength conservation checks and residual matching are performed on a per-connected-region basis.

[0118] First, construct connected regions based on the spatial proximity between nuclei and centroids. and If the Euclidean distance between the two If the radius of a given cell is no greater than twice the larger of the radius of the two cells, then the two cells are connected in the undirected graph, with the following connection condition:

[0119] in, The distance between the two centroids is represented in pixels. and They represent the first The and the first The radius of influence of each cell is also in pixels. It is used to define the vicinity of the nucleus centroid. After traversing all pairs of nucleus centroids in the entire field of view, a set of initial connected components is obtained. 2 is an empirical value that can be adjusted by the implementer according to the specific implementation scenario.

[0120] Then, the retraction records generated in the reverse retraction step are retrieved, and for each pair of retraction parties... and the recipient If the two components are currently in different connected components, then the two components are merged into a single connected region to ensure that all the rollback and backfill operations that have occurred are closed within the same connected region. This indicates the withdrawal of the cell index. This represents the receiver cell index, where each independent connected component is ultimately treated as a connected region. , For connected region indexes.

[0121] For the first Connected regions Let its set of cell indexes be . Then the corrected sum of the membership strengths of this connected region Correspondingly, the sum of the initial belonging strengths of the connected region .

[0122] in, It is the first step obtained in the competitive allocation process. The initial assignment intensity of each cell, expressed in pixel intensity values. and The unit is also pixel intensity value. Since the initial assigned intensity is obtained by weighting and summing the effective pixels according to the allocation coefficient, It is equivalent to the sum of the signal intensities obtained by all cells within the connected region from each effective pixel, and therefore is considered as the connected region. The original effective signal quantity benchmark.

[0123] Theoretically, under the internal withdrawal closure condition, the following should be true: Therefore, the residuals are calculated. ,in, The unit is pixel intensity value.

[0124] like Then all cells in that connected region Set the value to zero, and simultaneously set the share strength of the corresponding ledger record within the connected area to zero.

[0125] like Calculate the relative residual ,in, Dimensionless, With preset allowable upper limit Compare, Get experience points It is dimensionless and is a hyperparameter that can be adjusted by the implementer according to the platform's floating-point precision.

[0126] like If the strength conservation of the connected region is within the error range, then no action is taken.

[0127] like Then perform residual matchback and match the residuals. According to the current corrected attribution strength of each cell in the connected region The ratio is reversed and re-allocated.

[0128] when At that time, the update formula is: ,when and season .

[0129] In the formula, For the first The current percentage of a cell's affiliation strength within a connected region, dimensionless, after update. The unit remains the same, still representing pixel intensity values.

[0130] If residual matching is performed, the share strength of all ledger records within the connected region will be multiplied by the same matching ratio:

[0131] Among them, if If the working attribution strength of all cells in the connected region is set to zero, the share strength of the corresponding ledger record is also set to zero. If the initial attribution strength is restored, the ledger record is restored to the initial attribution share, thereby ensuring that the ledger read by subsequent positive judgments is consistent with the final attribution strength of the cells.

[0132] This time, the connection region is made connected. The sum of the internally corrected attribution strengths is forcibly restored to the original value. This eliminates the accumulated residuals caused by floating-point rounding, etc. The magnitude is usually much smaller than the individual cell attribution strength, and the reassignment operation has a negligible impact on the relative strength arrangement of cells, only ensuring a zero-sum closed loop at the data level.

[0133] After completing the residual verification and refitting of all connected regions, the final attribution strength of each cell after conservation verification is obtained and output for positive determination.

[0134] S6: Calculate the intensity areal density and circumferential coverage within the perinuclear ring of each cell, and determine and count positive cases based on the dynamic threshold.

[0135] After completing the residual verification of the connected regions and obtaining the final attribution strength after the conservation verification of each cell, the attribution distribution of each sector of the perinuclear ring is re-statistically analyzed for each cell based on the corrected attribution ledger, and positive discrimination is made accordingly.

[0136] During the reverse withdrawal and residual matching process, the recipients of some shares change, and the original perinuclear ring sector attribution intensity based on the initial attribution ledger statistics no longer reflects the actual signal source distribution of the cell.

[0137] Therefore, based on the perinuclear ring region and sector division determined during the reverse withdrawal step for each cell, all cells in the destination register after scanning correction are included. The allocation record.

[0138] For each record, read the coordinates of the corresponding valid pixel. If the coordinates are located within the cell... Within the perinuclear ring, the sector number to which it belongs is determined by the azimuth angle of that coordinate relative to the nucleus's centroid. The allocated shares will be accumulated in the sector accumulator. .

[0139] The allocated share is stored directly in the ledger as an intensity value; if the record is an original allocation record, the intensity value that was finally assigned to the cell after withdrawal and reassignment is taken; if the record is a newly added record, the share value in the record is taken directly.

[0140] After traversing all records, cells are obtained. Corrected attribution strength of each sector of the perinuclear ring The unit is pixel intensity value.

[0141] The median of the corrected attribution strength for all sectors is extracted and used as the circumferential baseline for subsequent discrimination. In the formula, This is a sector index, dimensionless; For cells The total number of sectors, dimensionless; This represents the median function; Units and same.

[0142] In fluorescence immunohistochemical images, there are differences in cell membrane area and cytoplasmic volume among different cells. At the same marker expression level, larger cells also have higher corrected attribution intensity through competitive allocation.

[0143] Using attribution intensity directly as the criterion for positive results could lead to large volumes of low-expressing cells being misclassified as positive, due to the perinuclear ring area. That is, the total number of pixels in the annular region after expansion, expressed in pixels squared, which is positively correlated with the cell membrane area. Intensity reduction of the normalization factor can eliminate the bias caused by differences in cell size in the discrimination.

[0144] cell Perinuclear ring band attribution strength Subsidiary strength after correction of all sectors The summation is obtained, with the unit being pixel intensity value: Based on this, the attributed strength surface density is calculated. .

[0145] In the formula, For cells The assigned intensity within the perinuclear ring after withdrawal and reassignment correction, expressed in pixel intensity values; For cells The area of ​​the periphery band of the kernel, expressed in pixels squared; The unit is pixel intensity value per square pixel, which is considered dimensionless.

[0146] The fluorescent markers of actual positive cells are relatively evenly distributed along the perinuclear direction, and the intensity of their corrected ring sector assignments will exceed the circumferential baseline in multiple sectors; while spurious intensity concentrations caused by incomplete withdrawal of borrowed shares or background fluctuations usually only appear in a few sectors.

[0147] To quantify this distribution characteristic, the circumferential coverage is calculated. It is defined as the proportion of sector segments with a home strength higher than the circumferential baseline to the total number of sector segments:

[0148] In the formula, Represents the number of sectors that meet the conditions; it is dimensionless. The total number of sectors is dimensionless. Dimensionless, with values ​​ranging from 0 to 1. The closer it is to 1, the more continuous the distribution of the attribution intensity is in the perinuclear ring direction.

[0149] Surface density threshold for positive detection It needs to be dynamically determined based on the overall signal level of the current field of view. In this embodiment, it is based on all signals within the field of view. Cell-level attribution strength surface density As samples, the Otsu algorithm (maximum inter-class variance method) is used to calculate the binarization threshold, which serves as the surface density threshold. .

[0150] This algorithm automatically classifies samples into two categories, high and low areal density, by maximizing the inter-class variance. The processing procedure is a well-known technique and will not be described in detail here.

[0151] When the total number of cells in the field of vision Less than the preset quantity threshold When the Otsu's method fails to yield two non-empty classes, a background statistics scheme is used as a fallback approach; among which... Randomly generated within the background mask of the marked channel. There are three circular regions, each with an area equal to the average area of ​​the perinuclear rings of all cells within the current field of view. ,in, The empirical value of 200 is used as the hyperparameter, but it can also be adjusted by the implementer according to the specific implementation scenario.

[0152] Calculate the mean gray value of each circular region and divide it by the corresponding area to obtain the background surface density sample. Then calculate their mean. and standard deviation ,Pick: ,in, and Dimensions and Similarly, if the total number of cells in the field of view is... If the positive cell count is zero, then the output will be zero.

[0153] Circumferential coverage threshold Get experience points , dimensionless, is a hyperparameter that can be adjusted by the implementer according to the specific implementation scenario. This value corresponds to the requirement that in all sectors of the periphery ring, at least half of the sectors have a higher attribution intensity than the circumferential baseline.

[0154] Examine each cell in the field of view one by one. If all of the following conditions are met: and If the cell is identified as a positive cell, its nuclear centroid coordinates, belonging intensity surface density, and circumferential coverage information will be recorded in the list of positive cells.

[0155] After the traversal is complete, the number of cells in the positive cell list is accumulated to obtain the positive cell count for this field of view. As the output, the number of cells is counted.

[0156] The above are merely preferred embodiments of the present invention. It should be noted that those skilled in the art can make several improvements and substitutions without departing from the technical principles of the present invention, and these improvements and substitutions should also be considered within the scope of protection of the present invention.

Claims

1. An automated method for detecting and counting sparse target cells in fluorescence immunohistochemical images, characterized in that, include: The kernel size is obtained by coarse segmentation of the kernel localization reference image, and then the kernel centroid is extracted by fine segmentation. The lateral resolution scale is determined based on the imaging parameters, the apportionment radius is determined based on the local density of the core centroid, and the lateral resolution scale is used as the lower limit of the apportionment radius for truncation. The labeled channel image is smoothed and gradient direction is extracted using the lateral resolution scale. The pointing confidence is calculated based on the background noise of the same channel. The effective pixels are weighted and distributed to candidate cells according to the apportionment radius, distance and direction factor to obtain the initial attribution strength and attribution share source ledger. The nuclear outline of each cell is expanded outward at the lateral resolution scale to form a perinuclear ring. The borrowing share is determined by the circumferential energy concentration index of the attribution intensity of each sector of the perinuclear ring. The borrowing is traversed unidirectionally in ascending order of the initial attribution intensity, and the borrowing is withdrawn and directionally backfilled into the only adjacent cell, keeping the total attribution intensity unchanged. A connected region is constructed using the centroid distance, and residual verification is performed between the corrected sum of assigned strengths and the original total effective signal within the connected region, and then the signal is re-matched. Calculate the intensity areal density and circumferential coverage within the perinuclear ring of each cell, and use dynamic thresholds to identify and count positive cells.

2. The method for automatic detection and counting of sparse target cells in fluorescence immunohistochemical images according to claim 1, characterized in that, The step of determining the lateral resolution scale based on imaging parameters includes: The lateral resolution scale is calculated using the Rayleigh criterion based on the objective lens numerical aperture, marker emission wavelength, and physical size per pixel of the image acquisition system. The lateral resolution scale is the resolution scale in pixels obtained by dividing 0.61 times the marker emission wavelength by the product of the objective lens numerical aperture and the physical size per pixel.

3. The method for automatic detection and counting of sparse target cells in fluorescence immunohistochemical images according to claim 1, characterized in that, The fine segmentation and extraction of the nuclear centroid includes: The kernel positioning reference image is initially locally adaptively binarized with a preset fixed window size to obtain a coarse kernel region. The equivalent circle diameter of each connected region is determined based on the area of ​​each connected region in the rough kernel region, and the mean of the equivalent circle diameters is used as the mean of the initial kernel equivalent diameter. Using twice the average of the initial kernel equivalent diameter as the window side length, a second local adaptive binarization is performed, and the obtained kernel region binary mask is subjected to distance transformation and watershed expansion to extract the kernel centroid.

4. The method for automatic detection and counting of sparse target cells in fluorescence immunohistochemical images according to claim 1, characterized in that, The determination of the apportionment radius based on the local density of the core centroid includes: Calculate the mean of the equivalent circular diameters of each kernel contour obtained by the fine segmentation, and use it as the statistical mean of the kernel equivalent diameter; With each nucleus centroid as the center, take three times the statistical mean of the equivalent diameter of the nucleus as the radius, count the number of nucleus centroids in the circular neighborhood, and take the actual intersection area of ​​the neighborhood and the image region as the effective neighborhood area. Divide the number of nucleus centroids by the effective neighborhood area to obtain the local clustering density of the nucleus centroids. Divide the scale factor by the square root of the local aggregation density of the core centroid to obtain the initial value of the distributed action radius; The initial value of the apportioned radius of action is compared with the lateral resolution scale, and the larger value is taken as the apportioned radius.

5. The method for automatic detection and counting of sparse target cells in fluorescence immunohistochemical images according to claim 1, characterized in that, The calculation of directional confidence based on background noise in the same channel includes: Using the lateral resolution scale as the smoothing scale, the marked channel image is processed by Gaussian first-order directional derivative to obtain the gradient magnitude of each pixel. The median gradient magnitude within the background mask of the marked channel image itself is used as a reference for gradient noise. The ratio of the sum of the gradient magnitude at the effective pixel and the gradient noise reference is used as the denominator, and the gradient magnitude is used as the numerator to calculate the pointing confidence. When the denominator is zero, the pointer confidence level is set to zero.

6. The method for automatic detection and counting of sparse target cells in fluorescence immunohistochemical images according to claim 1, characterized in that, The weighted distribution of effective pixels to candidate cells based on the distribution radius, distance, and orientation factor includes: The marked channel image is subjected to effective signal filtering. Pixels with a gray level higher than the mean gray level of the background mask of the marked channel image plus three times the gray level standard deviation are taken as effective pixels, and the effective signal intensity after removing the background is recorded. Centered on each effective pixel, the nuclear centroid is searched within a range where the distance from the effective pixel to the nuclear centroid does not exceed three times the corresponding cell distribution radius, thus obtaining a set of candidate cells; Calculate the distance from the effective pixel to the centroid of each candidate cell nucleus and the source pointing deviation angle; A weighted distribution is constructed, which is obtained by multiplying a distance decay term and a direction evidence term. The distance decay term is an exponential decay function with the corresponding cell's distribution radius as the decay scale, and the larger the distance from the effective pixel to the centroid of the candidate cell nucleus, the smaller the distance decay term. The direction evidence term includes a direction cosine factor weighted by the direction confidence and an isotropic allocation factor, where the isotropic allocation factor is set to the reciprocal of the number of candidate cells. The apportionment weights are normalized to obtain the apportionment coefficients; when the sum of all apportionment weights corresponding to a certain effective pixel is zero, the apportionment coefficients of that effective pixel for each candidate cell are set to the reciprocal of the number of candidate cells. The effective signal intensity of each effective pixel is accumulated to the corresponding candidate cell according to the apportionment coefficient to obtain the initial attribution intensity, and the attribution share source ledger of each effective pixel is recorded.

7. The method for automatic detection and counting of sparse target cells in fluorescence immunohistochemical images according to claim 1, characterized in that, The process of determining the borrowing share based on the circumferential energy concentration index of the attribution strength of each sector of the perinuclear ring, unidirectionally traversing in ascending order of initial attribution strength, withdrawing and directionally refilling into the unique adjacent cell, and maintaining the total attribution strength unchanged includes: Expand the nuclear outline of each cell outward at the lateral resolution scale to form a perinuclear ring; With the core centroid as the pole, the circumferential zone of the core is divided into multiple sectors at a preset angle that makes the circumferential arc length of each sector not less than the lateral resolution scale. The attribution intensity in each sector is accumulated, and the ratio of the maximum value of the attribution intensity of each sector to the sum is taken as the circumferential energy concentration index. The median of the attribution intensity of each sector is taken as the circumferential baseline. When the circumferential energy concentration index exceeds the preset upper limit, a withdrawal is triggered. The center azimuth of the sector with the highest attribution strength is taken as the source signal gradient direction; within a search range centered on the centroid of the withdrawing party and with a radius of three times the apportionment radius, the adjacent cell with the smallest deviation between the line connecting to the centroid of the withdrawing party and the source signal gradient direction and the initial attribution strength higher than that of the withdrawing party is selected as the sole receiver. The traversal is performed in ascending order of initial attribution strength, with the currently traversed cell being the withdrawing party, and cells that have already been the receiving party are no longer considered as withdrawing parties. The portion of the sector with the highest attribution strength that exceeds the circumferential baseline is multiplied by a direction gating factor to obtain the withdrawal share; when the minimum deviation angle corresponding to the sole receiver is not greater than a right angle, the direction gating factor is taken as the cosine of the minimum deviation angle; when the minimum deviation angle is greater than a right angle, the direction gating factor is zero. The withdrawn share is deducted from the withdrawing party's attribution strength and added to the sole recipient's attribution strength, keeping the total attribution strength unchanged.

8. The method for automatic detection and counting of sparse target cells in fluorescence immunohistochemical images according to claim 1, characterized in that, The process of constructing a connected region based on the centroid distance, performing residual verification and re-matching between the corrected sum of assigned strengths and the original total effective signal within the connected region, includes: Connect cells whose distance between their nuclei is less than or equal to twice the larger of the two cell radii to form a connected region. For each connected region, calculate the sum of the attribution strengths of all cells within it after withdrawal and reassignment corrections, and the difference between the sum of the effective signal strengths of all effective pixels within that connected region. If the sum of the effective signal strengths is zero, then the attribution strength of all cells in the connected region is set to zero; If the sum of the effective signal strengths is not zero, and the ratio of the absolute value of the difference to the sum of the effective signal strengths is greater than a preset upper limit, then the difference is reversed and assigned back to each cell according to the proportion of the corrected assigned strength of each cell to the total assigned strength in the connected region.

9. The method for automatic detection and counting of sparse target cells in fluorescence immunohistochemical images according to claim 1, characterized in that, The calculation of the perinuclear zone of each cell's assigned intensity areal density and circumferential coverage, combined with dynamic thresholding to determine and count positive cells, includes: Based on the assigned register after withdrawal and reassignment correction, the assigned intensity surface density of each cell within the perinuclear ring is calculated. The assigned intensity surface density is the assigned intensity within the perinuclear ring after withdrawal and reassignment correction divided by the area of ​​the perinuclear ring. Calculate the circumferential coverage, which is the proportion of the number of sectors with a home strength higher than the circumferential baseline to the total number of sectors; Among them, the surface density threshold in the dynamic threshold is preferentially adopted as the threshold of the maximum inter-class variance method of the surface density of the intensity of all cells in this field of view; when the number of cells is less than the preset number threshold, or the maximum inter-class variance method cannot obtain two non-empty categories, the surface density threshold is determined by the mean of the background area surface density plus three times the standard deviation. Cells with an attribution intensity areal density greater than the areal density threshold and circumferential coverage greater than the preset coverage threshold are identified as positive cells and counted cumulatively.