A method and system for processing stained images
Patent Information
- Application Number
- CN202610932185.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-26
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2046-06-26
AI Technical Summary
[0004]本发明提供了一种染色图像的处理方法,用于解决现有技术中无法实现染色质量的自动化和定量化评估,并根据评估结果追溯染色方案中的缺陷成因的技术问题
[0020]第一,本发明基于同类型历史合格染色样品的历史灰度差异参数和历史染色均匀度参数,分别计算差异参数基准值和均匀度波动基准值,再结合当前染色图像的灰度差异参数和染色均匀度参数与基准值的偏差度,并采用染色剂结构富集度进行修正,得到综合染色质量参数。通过将该综合染色质量参数与基于历史质量均值和历史质量标准差计算的质量门限进行比较,实现染色质量的自动化和定量化评估。相比于现有技术依赖人工经验进行主观判断的方式,本发明的评估标准统一且具有统计依据,解决了现有技术中不同人员评分差异大、评估结果缺乏可比性的问题。
Smart Images

Figure CN122453834B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically to a method and system for processing stained images. Background Technology
[0002] In biomedical research, pathological diagnosis, and drug screening, staining biological samples is a crucial method for observing their microstructure. Staining allows cell nuclei, cytoplasm, specific proteins, or other subcellular structures to exhibit different shades of gray or colors, facilitating qualitative and quantitative analysis under an electron microscope. The staining process is influenced by various factors, including staining solution concentration, staining temperature, incubation time, and rinsing methods. The quality of the staining directly affects the reliability of subsequent image analysis and diagnostic conclusions.
[0003] Currently, the evaluation of staining results mainly relies on human experience. Technicians visually observe electron micrographs and subjectively judge whether the staining is too dark, too light, uneven, or has precipitation contamination. This manual evaluation method has the following shortcomings in practical applications: it is difficult to unify the evaluation criteria among different personnel, resulting in significant differences in scoring results; the evaluation efficiency is insufficient to meet the requirements of high-throughput experiments; and the evaluation results usually only provide a general quality level, making it difficult to trace back to the specific step or parameter in the staining protocol that caused the poor staining effect. Summary of the Invention
[0004] This invention provides a method for processing stained images, addressing the technical problem in existing technologies that cannot achieve automated and quantitative evaluation of staining quality and trace the causes of defects in the staining scheme based on the evaluation results. In view of the above problems, this invention also provides a system for processing stained images.
[0005] In a first aspect, the present invention provides a method for processing a stained image, the method comprising:
[0006] The biological samples were stained using an initial staining protocol, and the stained images of the biological samples were obtained.
[0007] The stained image is analyzed to extract stained quality assessment parameters, wherein the stained quality assessment parameters include at least grayscale difference parameters and stained uniformity parameters.
[0008] Based on the aforementioned staining quality assessment parameters, calculate the comprehensive staining quality parameters;
[0009] Based on the comparison results between the comprehensive staining quality parameters and the quality threshold, the staining quality level of the stained image is determined;
[0010] Based on the dyeing quality grade and the initial dyeing scheme, obtain the dyeing scheme defect identification results;
[0011] The staining quality level and the staining scheme defect identification results are integrated to generate staining image evaluation results.
[0012] Secondly, the present invention also provides a system for processing stained images, the system comprising:
[0013] The image acquisition module is used to stain biological samples using an initial staining scheme and acquire stained images of the biological samples after staining.
[0014] The quality assessment parameter extraction module is used to analyze the stained image and extract stained quality assessment parameters, wherein the stained quality assessment parameters include at least grayscale difference parameters and stained uniformity parameters.
[0015] The comprehensive staining quality calculation module is used to calculate the comprehensive staining quality parameters based on the staining quality assessment parameters.
[0016] The staining quality level determination module is used to determine the staining quality level of the stained image based on the comparison result between the comprehensive staining quality parameters and the quality threshold.
[0017] The defect identification module is used to obtain the defect identification result of the dyeing scheme based on the dyeing quality level and the initial dyeing scheme;
[0018] The evaluation result generation module is used to integrate the staining quality level and the staining scheme defect identification results to generate staining image evaluation results.
[0019] One or more technical solutions provided in this invention have at least the following technical effects or advantages:
[0020] First, this invention calculates baseline values for the difference parameters and uniformity parameters based on historical grayscale difference parameters and historical dyeing uniformity parameters of similar historical qualified dyed samples. Then, it combines the deviations of the current dyed image's grayscale difference parameters and dyeing uniformity parameters from the baseline values, and uses dye structure enrichment for correction, to obtain a comprehensive dyeing quality parameter. By comparing this comprehensive dyeing quality parameter with a quality threshold calculated based on historical quality mean and historical quality standard deviation, automated and quantitative evaluation of dyeing quality is achieved. Compared to existing technologies that rely on subjective judgment based on human experience, this invention provides a unified and statistically based evaluation standard, solving the problems of large differences in scores from different personnel and a lack of comparability in evaluation results in existing technologies.
[0021] Secondly, when the dyeing quality grade is unqualified, this invention inputs the initial dyeing scheme, grayscale difference parameters, and dyeing uniformity parameters into a pre-constructed dyeing defect identification model. It automatically obtains the defect identification results of the dyeing scheme and integrates them into a dyeing image evaluation report containing the cause of the defect and improvement suggestions. Compared to existing technologies that can only provide a general quality grade without tracing the cause of the defect, this invention can automatically identify the defect type of the dyeing scheme based on quantitative parameters and output targeted improvement suggestions, providing clear data support for the optimization and adjustment of the dyeing scheme.
[0022] In summary, this invention solves the technical problems of existing technologies, such as reliance on human experience, difficulty in standardization, and inability to automatically trace the causes of defects, by quantitatively calculating multi-dimensional dyeing quality assessment parameters and automatically identifying dyeing defects. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart illustrating a method for processing a stained image according to an embodiment of the present invention;
[0025] Figure 2 This is a schematic diagram of the structure of a colorimetric image processing system provided in an embodiment of the present invention;
[0026] The diagram is labeled as follows: Image acquisition module 11, quality assessment parameter extraction module 12, comprehensive staining quality calculation module 13, staining quality grade determination module 14, defect identification module 15, and assessment result generation module 16. Detailed Implementation
[0027] This invention provides a method and system for processing stained images, addressing the technical problems in existing technologies where stained quality assessment relies on human experience, is difficult to standardize, and cannot automatically trace the causes of defects.
[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0029] It should be noted that the terms "comprising" and "having" are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or modules that are not explicitly listed or that are inherent to these processes, methods, products, or devices.
[0030] Example 1, as Figure 1 As shown, the present invention provides a method for processing stained images, the method comprising:
[0031] S100: The biological sample is stained using an initial staining protocol, and the stained image of the biological sample is obtained.
[0032] In electron microscopy observation of biological samples, staining is a crucial step in enhancing the contrast of the sample's microstructure. The quality of staining directly depends on the settings of various parameters in the staining protocol, including the selection and concentration of the staining agent, the staining time, and the control of environmental conditions. Different types of biological samples require different suitable staining protocols. If an inappropriate staining protocol is selected, it may lead to problems such as insufficient grayscale contrast of the target structure, uneven staining, or the introduction of precipitation contamination, directly affecting the accuracy of subsequent image analysis results.
[0033] Step S100 in the method provided in this embodiment of the invention includes: obtaining the sample type of the biological sample and querying the corresponding initial staining scheme, wherein the initial staining scheme includes at least the type of staining agent, the concentration of staining agent, the staining time and the staining environment conditions;
[0034] The biological sample was stained using the initial staining protocol to obtain the stained biological sample.
[0035] The stained biological sample is imaged to obtain stained images.
[0036] The specific implementation method is as follows:
[0037] First, the sample type of the biological sample is determined. Biological samples can be tissue sections, cell smears, or ultrathin sections, etc. The sample type information is recorded and entered by the experimenter during sample preparation. Based on the sample type, the corresponding initial staining protocol is retrieved from a pre-established staining protocol database. The staining protocol database stores the mapping relationship between different sample types and validated standard staining protocols. For example, for ultrathin cell sections observed under a transmission electron microscope, the initial staining protocol might include: uranium acetate as the staining agent at a concentration of 2%, a staining time of 25 minutes, a staining temperature of 25 degrees Celsius, and a humidity of 45%. The initial staining protocol includes at least four parameters: staining agent type, staining agent concentration, staining time, and staining environmental conditions. The staining environmental conditions include environmental factors such as temperature and humidity that affect the staining reaction rate.
[0038] Furthermore, the biological samples were stained using the initial staining protocol obtained from the query. The staining solution was prepared according to the type and concentration of the staining agent specified in the protocol. The biological samples were then incubated in the staining solution for the designated duration under specified temperature and humidity conditions. After incubation, the samples were rinsed according to standard procedures to remove excess staining solution, yielding the stained biological samples.
[0039] Finally, the stained biological samples are imaged to obtain stained images. The stained biological samples are placed in the sample chamber of an electron microscope, and imaging parameters are set according to the sample type and observation target. Imaging parameters may include accelerating voltage, magnification, exposure time, and image resolution. The electron microscope can be a transmission electron microscope, with imaging magnification typically between several thousand and tens of thousands of times to obtain clear images of organelle-level ultrastructures. After imaging, a digitized stained image is acquired. The image should be a grayscale image with sufficient gray depth for subsequent extraction of quality assessment parameters. For example, the acquired stained image is a 16-bit grayscale image with a resolution of 2048 × 2048 pixels. This image contains information about target structures such as the cell nucleus, mitochondria, and endoplasmic reticulum, as well as background areas.
[0040] The following technical effects were achieved through this step:
[0041] By establishing a mapping relationship between sample types and standard staining protocols in advance, and performing staining operations according to specific parameters such as the type and concentration of staining agents, staining time, and environmental conditions in the protocol, the consistency and reproducibility of the staining process for different batches of biological samples are ensured, providing a standardized image input basis for the subsequent objective evaluation of staining quality.
[0042] S200: Analyze the stained image and extract stained quality assessment parameters, wherein the stained quality assessment parameters include at least grayscale difference parameters and stained uniformity parameters;
[0043] The quality assessment of stained images requires quantification from multiple dimensions. Relying solely on the overall grayscale mean only reflects the depth of staining and fails to reflect the contrast difference between the target structure and the background, as well as the spatial uniformity of the staining. If only grayscale differences are considered, an image with high overall grayscale but insufficient contrast between the target structure and the background may still be misjudged as well-stained. Similarly, if only uniformity is considered, a highly uniform staining but overall low grayscale making the target structure indistinguishable will also fail to accurately reflect the staining quality. Furthermore, different images have different grayscale distribution ranges, making direct comparison using absolute grayscale values lack universality.
[0044] Step S200 in the method provided in this embodiment of the invention includes:
[0045] From the stained image, the average pixel grayscale value of the target structural region is extracted as the structural grayscale value, and the average pixel grayscale value of the background region is extracted and recorded as the background grayscale value.
[0046] Obtain the grayscale dynamic range of the stained image, and divide the absolute difference between the mean grayscale value of the structure and the mean grayscale value of the background by the grayscale dynamic range to obtain the grayscale difference parameter;
[0047] The stained image is uniformly divided into multiple grid regions, the grid gray standard deviation of the average gray value of all grid regions is calculated, and the average gray value of the entire stained image is calculated.
[0048] Divide the standard deviation of the grid gray level by the average gray level of the entire image to obtain the color uniformity parameter.
[0049] The specific implementation method is as follows:
[0050] First, the mean grayscale values of the target structural regions and the background regions are extracted. The target structural regions refer to the image areas containing subcellular structures that need to be observed after staining, such as the cell nucleus, mitochondria, and endoplasmic reticulum membrane. Target structural regions can be automatically identified and masked using a deep learning-based semantic segmentation model, or technicians can manually select and label regions of interest. The mean grayscale value of the structure is obtained by summing the grayscale values of all pixels within the target structural region and dividing by the total number of pixels in that region. The background region refers to areas in the image that contain no biological sample tissue and only include the substrate or voids; its mean grayscale value is also calculated and recorded as the background mean grayscale value.
[0051] Furthermore, the grayscale dynamic range of the stained image is obtained, which is the difference between the maximum and minimum grayscale values of all pixels in the image. The maximum grayscale value of a grayscale image depends on the grayscale bit depth of the imaging device; for example, the theoretical maximum grayscale value of a 16-bit grayscale image is 65535. The grayscale dynamic range reflects the actual grayscale span utilized in the current image. The absolute difference between the mean grayscale value of the structure and the mean grayscale value of the background is calculated, and then divided by the grayscale dynamic range to obtain the grayscale difference parameter. This parameter is a dimensionless value, typically ranging from 0 to 1. The larger the value, the more significant the grayscale contrast between the target structure and the background, and the clearer and more distinguishable the target structure; the smaller the value, the closer the grayscale values are, and the more difficult it is to distinguish the target structure from the background. For example, in a stained image of an ultrathin cell section, the average structural gray level of the cell nucleus region is 32000, the average background gray level of the background region is 8000, and the image gray level dynamic range is 58000. Then the gray level difference parameter is |32000-8000|÷58000≈0.414.
[0052] Finally, the coloring uniformity parameter is calculated. The colored image is divided equally along its length and width into multiple grid regions. For example, a 2048×2048 pixel image is divided into 8 equal parts both vertically and horizontally, resulting in 64 256×256 pixel grid regions. The average gray value of all pixels within each grid region is calculated, yielding 64 grid gray values. The standard deviation of these 64 grid gray values is then calculated and denoted as the grid gray standard deviation. The grid gray standard deviation reflects the dispersion of gray values between sub-regions; the more uneven the coloring between regions, the larger this standard deviation. Simultaneously, the average gray value of the entire colored image is calculated, which is the sum of the gray values of all pixels in the entire image divided by the total number of pixels. The grid gray standard deviation is divided by the average gray value of the entire image to obtain the coloring uniformity parameter. This parameter is also dimensionless; dividing by the average gray value of the entire image aims to eliminate the influence of overall gray level differences between different images, making the uniformity parameter comparable between images with different brightness levels. The smaller the value, the more uniform the gray level is across different areas; the larger the value, the more likely there is local over-coloring, under-coloring, or patchy unevenness. For example, if the standard deviation of the grid gray level of a stained image is 450 and the average gray level of the entire image is 18000, then the stained uniformity parameter is 450 ÷ 18000 = 0.025.
[0053] The following technical effects were achieved through this step:
[0054] By calculating the absolute difference between the mean gray level of the structure and the mean gray level of the background and dividing by the gray level dynamic range, the color contrast is standardized into a gray level difference parameter independent of the image's gray level distribution range. Simultaneously, through grid division and standard deviation calculation, color uniformity is quantified into a color uniformity parameter unaffected by the overall gray level. These two types of parameters quantify color quality from two dimensions—contrast and spatial distribution—providing standardized input for subsequent calculations of comprehensive color quality parameters.
[0055] S300: Calculate the comprehensive staining quality parameters based on the staining quality assessment parameters;
[0056] The grayscale difference parameter and staining uniformity parameter extracted in step S200 reflect the staining quality from two dimensions: contrast and spatial distribution, respectively. However, a single parameter is insufficient to comprehensively evaluate the staining effect. A high grayscale difference parameter but poor uniformity may indicate local overstaining or precipitation, while good uniformity but insufficient grayscale difference may result in a blurred target structure. Furthermore, the relative enrichment of the staining agent on the target structure is also an important factor affecting staining quality.
[0057] Step S300 in the method provided in this embodiment of the invention includes:
[0058] Obtain a set of historical qualified staining sample information for multiple historical qualified staining samples of the same type as the biological sample, wherein the set of historical qualified staining sample information includes historical grayscale difference parameters, historical staining uniformity parameters, and historical comprehensive staining quality parameters.
[0059] Calculate the arithmetic mean of multiple historical grayscale difference parameters as the benchmark value of the difference parameters, and calculate the arithmetic mean of multiple historical staining uniformity parameters as the benchmark value of uniformity fluctuation.
[0060] Calculate the grayscale difference deviation between the grayscale difference parameter and the grayscale difference parameter reference value, and calculate the uniformity deviation between the dyeing uniformity parameter and the uniformity fluctuation reference value;
[0061] Obtain the structural enrichment of the staining agent;
[0062] Based on the grayscale difference deviation and the uniformity deviation, the initial staining quality parameters are obtained, and the initial staining quality parameters are corrected by the dye structure enrichment to obtain the comprehensive staining quality parameters.
[0063] The specific implementation method is as follows:
[0064] First, a set of historically qualified stained samples of the same type as the current biological sample is obtained. "Same type" refers to biological samples from the same tissue source and prepared using the same method, such as all being ultrathin sections of liver tissue or all being smears of cultured cells. Historically qualified stained samples are those that have undergone staining treatment and whose staining quality has been deemed acceptable. Each record in the historically qualified stained sample set contains at least the sample's historical grayscale difference parameters, historical staining uniformity parameters, and historical overall staining quality parameters. This historical data is stored in the system's historical database and is automatically updated after each qualified sample evaluation.
[0065] Further, baseline values for the difference parameter and uniformity fluctuation are calculated. The baseline value for the difference parameter is obtained by summing all historical grayscale difference parameters in the historical qualified staining sample information set and dividing by the number of samples. This baseline value represents the typical level of grayscale difference parameters for this type of biological sample under qualified staining conditions. The baseline value for uniformity fluctuation is obtained by summing all historical staining uniformity parameters in the historical qualified staining sample information set and dividing by the number of samples. This baseline value represents the normal fluctuation level of staining uniformity for this type of biological sample under qualified staining conditions.
[0066] Further, the grayscale difference deviation and uniformity deviation are calculated. The grayscale difference deviation is the absolute value of the difference between the grayscale difference parameter of the current dyed image obtained in step S200 and the baseline value of the difference parameter, divided by the baseline value of the difference parameter. The grayscale difference deviation reflects the gap between the dyeing contrast of the current sample and the typical level of qualified samples of the same type; the smaller the deviation, the closer it is to the qualified level. The uniformity deviation is the difference between the dyeing uniformity parameter of the current dyed image and the baseline value of uniformity fluctuation, divided by the baseline value of uniformity fluctuation. Both the grayscale difference deviation and the uniformity deviation are normalized relative deviations; the smaller the value, the closer the dyeing quality of the current sample is to the typical level of qualified samples of the same type. For example, let the grayscale difference parameter of the current dyed image be 0.36, the dyeing uniformity parameter be 0.032, the baseline value of the difference parameter be 0.40, and the baseline value of the uniformity fluctuation be 0.025. Gray-scale difference deviation = |0.36-0.40|÷0.40=0.04÷0.40=0.10, uniformity deviation = |0.032-0.025|÷0.025=0.007÷0.025=0.28.
[0067] Furthermore, the dye structure enrichment is obtained. Dye structure enrichment reflects the degree of dye enrichment in the target structural region relative to the background region, and is obtained by comparing the current sample's structural background grayscale ratio with the historical average grayscale ratio of similar qualified samples.
[0068] Finally, the overall staining quality parameters are calculated. First, an initial staining quality assessment index is obtained based on the grayscale difference deviation and uniformity deviation. The initial staining quality assessment index equals 1 divided by the sum of the grayscale difference deviation and uniformity deviation, plus a very small positive real number to prevent the denominator from being zero. Then, the initial staining quality assessment index is corrected using the dye structure enrichment. The correction method is to multiply the initial staining quality assessment index by the dye structure enrichment to obtain the overall staining quality parameter. For example, let the dye structure enrichment be 1.02, and the very small positive real number be 0.001. The initial staining quality assessment index = 1 ÷ (0.10 + 0.28 + 0.001) = 1 ÷ 0.381 ≈ 2.62, and the overall staining quality parameter = 2.62 × 1.02 ≈ 2.67. The overall staining quality parameter is a dimensionless value; a larger value indicates better overall staining quality. When the structural enrichment is greater than 1, the comprehensive parameter is adjusted upwards; when it is less than 1, the comprehensive parameter is adjusted downwards.
[0069] Step S300 in the method provided in this embodiment of the invention further includes: obtaining the enrichment of the dye structure, including:
[0070] Calculate the ratio of the average gray level of the structure to the average gray level of the background in the stained image to obtain the structure-background gray level ratio;
[0071] Obtain the structural background grayscale ratio of multiple historical qualified staining samples belonging to the same type as the biological sample, calculate the arithmetic mean of the structural background grayscale ratio, and obtain the historical average grayscale ratio;
[0072] The structure enrichment of the dye is obtained by dividing the structure background grayscale ratio by the historical average grayscale ratio.
[0073] The specific implementation method is as follows:
[0074] First, the ratio of the average gray level of the structure to the average gray level of the background in the current stained image is calculated. The average gray levels of the structure and background have already been extracted in step S200. The average gray level of the structure is divided by the average gray level of the background to obtain the structure-background gray level ratio. This ratio reflects the gray level multiple of the target structure region relative to the background region; a larger ratio indicates a stronger gray level contrast between the target structure and the background, meaning a higher relative enrichment of the dye on the target structure.
[0075] Furthermore, the structural background grayscale ratios of multiple historical qualified staining samples belonging to the same type as the current biological sample are obtained. This data is stored in a historical qualified staining sample information set, and the structural background grayscale ratio of each historical record is saved synchronously during storage. The average historical grayscale ratio is obtained by summing all the obtained historical structural background grayscale ratios and dividing by the number of samples. The average historical grayscale ratio represents the typical level of structural background grayscale ratio for this type of biological sample under qualified staining conditions.
[0076] Finally, the structure-background grayscale ratio of the current sample is divided by the historical average grayscale ratio to obtain the staining agent structure enrichment. When the staining agent structure enrichment is greater than 1, it indicates that the current sample's staining agent enrichment of the target structure is better than the average level of similar qualified samples in the past, indicating good staining specificity. When it is less than 1, it indicates insufficient enrichment, and the staining agent may be more distributed in the background area or the overall staining may be too light. For example, the average structure grayscale value of an ultrathin section of liver tissue is 32000, and the average background grayscale value is 8000, so the structure-background grayscale ratio is 4.0. The structure-background grayscale ratios of similar qualified samples are 3.6, 3.8, 4.1, 3.9, and 4.2, respectively, and the historical average grayscale ratio is 3.92. The staining agent structure enrichment is 4.0 divided by 3.92, which is approximately 1.02, slightly greater than 1, indicating that the current sample's staining agent structure enrichment is slightly better than the average level of similar qualified samples in the past.
[0077] The following technical effects were achieved through this step:
[0078] First, by comparing the grayscale difference parameter and dyeing uniformity parameter with the benchmark values of historical qualified samples of the same type and calculating the deviation, the dyeing quality assessment of the current sample is based on the statistical distribution comparison with qualified samples of the same type, eliminating the influence of the inherent differences in dyeing characteristics between different sample types, and making the assessment results more comparable.
[0079] Second, the dye structure enrichment degree is introduced as a correction factor. By calculating the ratio of the average structural gray value to the average background gray value and comparing it with the historical average gray value ratio, the relative enrichment degree of the dye on the target structure is incorporated into the comprehensive evaluation. When the gray value difference parameters are similar, the staining result with higher structure enrichment degree can obtain a higher comprehensive staining quality parameter, reflecting the influence of staining specificity on the overall quality.
[0080] S400: Determine the staining quality level of the stained image based on the comparison result between the comprehensive staining quality parameters and the quality threshold;
[0081] The comprehensive staining quality parameter calculated in step S300 is a dimensionless value, and this value alone cannot directly determine whether the staining is qualified. Different types of biological samples have natural differences in their staining characteristics, and the distribution range of the comprehensive staining quality parameter for qualified samples varies. If a fixed absolute threshold is used for judgment, it may be too strict or too lenient for new types of samples. Therefore, this step dynamically calculates the quality threshold based on the statistical distribution of the historical comprehensive staining quality parameter set of qualified samples of the same type, compares the comprehensive staining quality parameter of the current sample with the quality threshold, and determines whether the staining quality level is qualified or unqualified.
[0082] Step S400 in the method provided in this embodiment of the invention includes: obtaining the historical comprehensive staining quality parameter set of multiple historical qualified staining samples of the same type as the biological sample, calculating the mean of the historical comprehensive staining quality parameter set as the historical quality mean, and calculating the standard deviation of the historical comprehensive staining quality parameter set as the historical quality standard deviation;
[0083] The quality threshold is obtained by subtracting the historical quality standard deviation from the historical quality mean.
[0084] When the comprehensive staining quality parameter is greater than or equal to the quality threshold, the staining quality level is determined to be qualified;
[0085] When the comprehensive staining quality parameter is less than the quality threshold, the staining quality grade is determined to be unqualified.
[0086] The specific implementation method is as follows:
[0087] First, a set of historical comprehensive staining quality parameters for multiple historically qualified staining samples of the same type as the current biological sample is obtained. This data originates from the historical qualified staining sample information set used in step S300, where each record contains the historical comprehensive staining quality parameters for that sample. The historical comprehensive staining quality parameters are calculated and stored according to the method in step S300 during the evaluation of each historical sample.
[0088] Furthermore, the mean and standard deviation of the historical comprehensive staining quality parameter set are calculated. The sum of all values in the historical comprehensive staining quality parameter set is divided by the number of samples to obtain the historical mean. The historical mean represents the average level of comprehensive staining quality parameters for this type of biological sample under qualified staining conditions. The standard deviation of the historical comprehensive staining quality parameter set is then calculated to obtain the historical standard deviation. The standard deviation reflects the dispersion of the comprehensive staining quality parameters of historical qualified samples; a smaller standard deviation indicates more stable staining quality among qualified samples, while a larger standard deviation indicates greater fluctuations in staining quality among qualified samples.
[0089] Furthermore, the historical quality mean is subtracted from the historical quality standard deviation to obtain the quality threshold. This quality threshold is based on the principle of one standard deviation in statistics, leaving a margin of one standard deviation below the average level of qualified samples as the boundary for distinguishing between qualified and unqualified samples. When the quality distribution of historical qualified samples is relatively concentrated, the standard deviation is smaller, the quality threshold is higher, and the judgment is more stringent; when the quality distribution of historical qualified samples is relatively dispersed, the standard deviation is larger, the quality threshold is lower, and the judgment is relatively lenient, to accommodate the normal fluctuation range of staining quality of similar samples.
[0090] Finally, the comprehensive staining quality parameter calculated in step S300 is compared with the quality threshold. When the comprehensive staining quality parameter is greater than or equal to the quality threshold, it indicates that the staining quality of the current stained image is within the normal fluctuation range of historically qualified samples of the same type, and the staining quality level is determined to be qualified. When the comprehensive staining quality parameter is less than the quality threshold, it indicates that the staining quality of the current stained image is significantly lower than the typical level of historically qualified samples of the same type, and the staining quality level is determined to be unqualified.
[0091] For example, the historical composite staining quality parameters of 15 historically qualified samples of a certain type of biological sample are 2.82, 2.85, 2.79, 2.88, 2.83, 2.80, 2.86, 2.81, 2.84, 2.87, 2.82, 2.85, 2.80, 2.83, and 2.84, respectively. Summing these parameters and dividing by 15 yields a historical mean of 2.833, with a standard deviation of 0.0261. Subtracting the historical standard deviation of 0.0261 from the historical mean of 2.833 gives a quality threshold of 2.807. If the composite staining quality parameter of the current sample is 2.67, which is less than 2.807, the staining quality grade is unqualified; if the composite staining quality parameter of the current sample is 2.85, which is greater than or equal to 2.807, the staining quality grade is qualified.
[0092] The following technical effects were achieved through this step:
[0093] The quality threshold is dynamically calculated based on the mean and standard deviation of the comprehensive staining quality parameters of historically qualified samples of the same type, rather than using a fixed absolute threshold. When the staining quality of historically qualified samples is stable and the standard deviation is small, the threshold is automatically raised to ensure strict judgment criteria; when the staining quality of historically qualified samples fluctuates greatly, the threshold is automatically lowered to accommodate the normal variation range of that type of sample. This adaptive threshold mechanism ensures that the determination of staining quality level is both statistically based and adaptable to the differences in staining characteristics of different sample types.
[0094] S500: Based on the dyeing quality level and the initial dyeing scheme, obtain the dyeing scheme defect identification result;
[0095] The staining quality grade determined in step S400 categorizes the current stained image into acceptable and unacceptable categories. For acceptable samples, their quality parameters can be included in the statistical database as new historical acceptable samples to update the quality threshold, allowing the subsequent evaluation criteria to be dynamically optimized as acceptable samples accumulate. For unacceptable samples, simply concluding "unacceptable" is insufficient to guide the improvement of the staining protocol; further identification of the specific causes of poor staining is required, such as insufficient staining solution concentration, short staining time, inadequate rinsing, or other factors.
[0096] Step S500 in the method provided in this embodiment of the invention includes:
[0097] When the dyeing quality level is qualified, the grayscale difference parameter, the dyeing uniformity parameter and the comprehensive dyeing quality parameter are added to the historical qualified dyeing sample information set, and the quality threshold is recalculated.
[0098] When the dyeing quality grade is unqualified, the initial dyeing scheme, the grayscale difference parameter, and the dyeing uniformity parameter are input into the dyeing defect identification model to obtain the dyeing scheme defect identification result.
[0099] The specific implementation method is as follows:
[0100] When step S400 determines the staining quality level to be acceptable, it indicates that the staining quality of the current stained image is within the normal fluctuation range of historical acceptable samples of the same type. At this time, the grayscale difference parameter, staining uniformity parameter, and comprehensive staining quality parameter obtained in this evaluation are added as a new record to the historical acceptable staining sample information set used in step S300. After the number of samples in the historical acceptable staining sample information set increases, the historical quality mean and historical quality standard deviation are recalculated according to the method described in step S400, thereby updating the quality threshold. Through the above continuous update mechanism, the quality threshold is dynamically adjusted as acceptable samples accumulate. The more samples there are, the higher the statistical stability of the threshold and the stronger the reliability of the evaluation standard.
[0101] When step S400 determines that the staining quality level is unqualified, it indicates that the staining quality of the current stained image is significantly lower than the typical level of historical qualified samples of the same type. At this point, it is necessary to identify the cause of the staining scheme defect leading to the unqualified result. The initial staining scheme used in step S100, the grayscale difference parameters extracted in step S200, and the staining uniformity parameters are used as inputs and fed into a pre-constructed staining defect identification model. The initial staining scheme includes parameters such as the type of dye, dye concentration, staining duration, and staining environmental conditions. The staining defect identification model is built based on machine learning methods and can infer and output the corresponding staining scheme defect identification result based on the input staining scheme parameters and quality assessment parameters.
[0102] Step S500 in the method provided in this embodiment of the invention further includes: constructing a staining defect identification model, including:
[0103] Obtain a sample staining defect set, wherein the sample staining defect set includes sample grayscale difference parameters, sample staining uniformity parameters, sample initial staining scheme parameters, and staining scheme defect identification result labels;
[0104] A staining defect identification model is constructed based on machine learning. The staining defect identification model takes gray level difference parameter, staining uniformity parameter and initial staining scheme as input and staining scheme defect identification result as output.
[0105] The staining defect recognition model is trained using the sample staining defect set until convergence, and the trained staining defect recognition model is obtained.
[0106] The specific implementation method is as follows:
[0107] First, a sample staining defect set is obtained. This set is derived from records of substandard stained samples accumulated in historical staining experiments. Each sample record contains the following: sample grayscale difference parameters and sample staining uniformity parameters, extracted from the corresponding stained image according to the method in step S200; initial staining scheme parameters, including the type of staining agent, staining concentration, staining time, and staining environmental conditions used for the sample; and staining scheme defect identification result labels, which are marked by technicians based on the staining effect and experimental experience of the sample. These labels can be classification labels, for example, labeled as insufficient staining solution concentration, short staining time, long staining time, insufficient rinsing, uneven staining solution distribution, etc. Multiple sets of collected sample records are then combined to form the sample staining defect set.
[0108] Finally, a staining defect identification model is constructed based on machine learning. The staining defect identification model can employ classification models, such as support vector machines, random forests, or shallow fully connected neural networks.
[0109] For example, this embodiment of the invention uses a shallow fully connected neural network as the classification model. The shallow fully connected neural network consists of an input layer, a hidden layer, and an output layer connected in sequence.
[0110] The input layer has 8 nodes, corresponding to 8-dimensional input features. The input features include: grayscale difference parameter (1-dimensional), staining uniformity parameter (1-dimensional), a 3-dimensional vector of the staining agent type after uniquely heat-encoded encoding (e.g., uranium acetate encoded as [1,0,0], lead citrate encoded as [0,1,0], phosphotungstic acid encoded as [0,0,1]), staining agent concentration (1-dimensional), staining duration (1-dimensional), staining temperature (1-dimensional), and staining humidity (1-dimensional). Taking a substandard stained sample as an example, its input feature vector is [0.36,0.032,1,0,0,2.0,25,25,45], where the first dimension is the grayscale difference parameter 0.36, the second dimension is the staining uniformity parameter 0.032, the third to fifth dimensions are the staining agent type (currently uranium acetate), the sixth dimension is the concentration 2.0%, the seventh dimension is the duration 25 minutes, the eighth dimension is the temperature 25 degrees Celsius, and the ninth dimension is the humidity 45%.
[0111] The hidden layer contains 16 neurons. Each hidden layer node is connected to the 8 nodes in the input layer via fully connected connections. Each connection has a learnable weight parameter, resulting in 128 weight parameters (8 × 16). Each hidden layer node also has a bias parameter, resulting in 16 bias parameters. The hidden layer node's input value is calculated as follows: the values of the 8 input layer nodes are multiplied by their corresponding connection weights, summed, and then added to the bias parameter. This sum gives the net input value for that node. The output value is then obtained by applying a non-linear transformation using an activation function. The activation function is a linear rectified function, which sets values less than zero to zero and leaves values greater than zero unchanged, introducing non-linear expressive power into the network.
[0112] The output layer has 5 nodes, corresponding to 5 types of staining scheme defects, such as insufficient staining solution concentration, short staining time, long staining time, insufficient rinsing, and uneven staining solution distribution. Each output layer node is fully connected to the 16 nodes in the hidden layer, with a total of 16 × 5 = 80 weight parameters. Each output layer node also has 5 bias parameters. The net input values of the output layer nodes are converted into predicted probabilities for each defect category using the Softmax function. The Softmax function works by performing exponential operations on the net input values of the 5 output layer nodes, summing the 5 exponential values, and dividing the exponential value of each node by this sum to obtain the predicted probability for each defect category. The sum of the probabilities for the 5 categories is 1.
[0113] During training, forward propagation is performed first, with input samples passing through the input layer, hidden layer, and output layer, calculating the predicted probability distributions for the five defect categories. Then, the classification cross-entropy loss function is used to calculate the error between the model's predicted probabilities and the defect identification labels obtained using the coloring scheme. The classification cross-entropy loss function is calculated as follows: the predicted probability of the category corresponding to the true label is taken, and the negative logarithm of that probability is calculated as the loss value. The closer the predicted probability is to 1, the smaller the loss value; the closer it is to 0, the larger the loss value.
[0114] The gradient of the loss function with respect to the weight and bias parameters of each layer is calculated using the backpropagation algorithm. The backpropagation algorithm utilizes the chain rule to calculate the gradient of each parameter layer by layer, starting from the output layer. A gradient descent optimizer is used to update the parameters of each layer based on the gradient and a preset learning rate, with the update direction opposite to the gradient direction. One training epoch consists of iterating through all training samples. During training, the classification accuracy is monitored on the validation set. When the validation set accuracy no longer improves after several consecutive training epochs, training stops, and the model parameters corresponding to the highest validation set accuracy are saved, resulting in the completed staining defect recognition model.
[0115] The following technical effects were achieved through this step:
[0116] First, based on the branching processing mechanism of dyeing quality grades, qualified samples are automatically included in the historical statistical database and the quality threshold is updated, while unqualified samples trigger the defect identification process. This design allows for the continuous accumulation of data on qualified samples, and the quality threshold becomes increasingly stable as the sample size increases, giving the evaluation criteria the ability to continuously self-optimize.
[0117] Second, the staining defect identification model built through machine learning can automatically infer the cause of defects based on staining scheme parameters and quality assessment parameters, transforming traditional manual experience judgment into data-driven automated diagnosis.
[0118] S600: Integrate the dyeing quality level and the defect identification results of the dyeing scheme to generate dyeing image evaluation results.
[0119] The staining quality level determined in step S400 reflects whether the staining quality of the current stained image is acceptable, and the staining scheme defect identification results output in step S500 indicate the possible causes of unacceptable staining. However, this information is scattered across different processing stages, and if it is output separately, a complete evaluation conclusion cannot be formed. Evaluators need to see the quality level, the specific values of each dimension parameter, as well as the defect identification results and improvement directions simultaneously to fully understand the current state of the stained sample and optimize subsequent experimental schemes accordingly. Therefore, this step integrates the staining quality level, comprehensive staining quality parameters, grayscale difference parameters, staining uniformity parameters, initial staining scheme, and defect identification results output from the aforementioned steps to generate a structured staining image evaluation report.
[0120] Step S600 in the method provided in this embodiment of the invention includes:
[0121] The staining quality grade, the comprehensive staining quality parameter, the grayscale difference parameter, the staining uniformity parameter, and the staining image are combined into structured evaluation data.
[0122] After associating the structured evaluation data with the initial staining scheme and the staining scheme defect identification results, a staining image evaluation report containing defect causes and improvement suggestions is generated, wherein the improvement suggestions are obtained based on the grayscale difference parameter and the staining uniformity parameter.
[0123] The specific implementation method is as follows:
[0124] First, the evaluation information from each dimension is combined into structured evaluation data. The staining quality level is obtained from step S400, the comprehensive staining quality parameters from step S300, the grayscale difference parameters and staining uniformity parameters from step S200, and the staining image is obtained from step S100. This information is organized according to a preset data structure, such as storing it in key-value pairs or tables, to form structured evaluation data. Each piece of information in the structured evaluation data has a clear field identifier and data type, facilitating subsequent retrieval, statistics, and display.
[0125] Furthermore, the structured evaluation data is correlated with the initial staining protocol used in step S100 and the staining protocol defect identification results obtained in step S500. The initial staining protocol includes the type of staining agent, staining agent concentration, staining duration, and staining environmental conditions. The staining protocol defect identification results include defect type labels and corresponding defect descriptions.
[0126] Finally, a staining image evaluation report is generated, including the causes of defects and improvement suggestions. The evaluation report includes the following: staining quality grade and comprehensive staining quality parameter values, allowing evaluators to quickly understand the overall quality; individual values of grayscale difference parameters and staining uniformity parameters, allowing evaluators to view the specific performance of each dimension; initial staining scheme parameters and defect identification results, allowing evaluators to trace the possible causes of staining defects; and a staining image thumbnail or storage path, allowing evaluators to review the image against the reference image.
[0127] The improvement suggestions are based on the grayscale difference parameter and the staining uniformity parameter. The logic for generating the improvement suggestions is as follows: When the grayscale difference parameter is low, it indicates insufficient contrast between the target structure and the background. It is recommended to check whether the staining solution concentration is insufficient or the staining time is too short, and the staining solution concentration can be appropriately increased or the staining time extended. When the staining uniformity parameter is high, it indicates that the staining is not evenly distributed in space. It is recommended to check whether the rinsing step is sufficient or whether the staining solution is evenly distributed on the sample surface. The number of rinsing steps can be increased or the staining solution application method can be improved. When both the grayscale difference parameter and the staining uniformity parameter deviate from the normal range, it is recommended to comprehensively adjust the above-mentioned staining steps.
[0128] For example, a staining image evaluation report may include: staining quality grade is unqualified, overall staining quality parameter is 2.67, grayscale difference parameter is 0.36, staining uniformity parameter is 0.032, initial staining scheme is uranium acetate concentration of 2%, staining time of 25 minutes, temperature of 25 degrees Celsius, humidity of 45%, defect identification result is insufficient staining solution concentration, improvement suggestion is to increase uranium acetate concentration from 2% to 3%, and appropriately extend staining time to 30 minutes, while checking whether the number of rinsing times is sufficient.
[0129] The following technical effects were achieved through this step:
[0130] This system integrates quality assessment parameters, staining quality grades, initial staining schemes, and defect identification results scattered across various processing stages into a structured staining image assessment report. This allows assessors to obtain a comprehensive overview of staining quality, defect causes, and improvement directions in one place, avoiding the tedious process of consulting multiple sources and manual correlation, thus improving the readability and usability of the assessment results. Improvement suggestions are automatically generated based on the specific values of grayscale difference and staining uniformity parameters, providing clear and actionable adjustment directions for optimizing the staining scheme.
[0131] Example 2, as Figure 2 As shown, based on the same inventive concept as the staining image processing method provided in Embodiment 1, this embodiment of the invention also provides a staining image processing system. The system includes a staining and image acquisition module, a quality assessment parameter extraction module, a comprehensive staining quality calculation module, a staining quality grade determination module, a defect identification module, and an assessment result generation module. The system includes:
[0132] The staining and image acquisition module 11 is used to stain the biological sample using an initial staining scheme and acquire the stained image of the biological sample after staining.
[0133] The quality assessment parameter extraction module 12 is used to analyze the stained image and extract stained quality assessment parameters, wherein the stained quality assessment parameters include at least grayscale difference parameters and stained uniformity parameters.
[0134] The comprehensive staining quality calculation module 13 is used to calculate the comprehensive staining quality parameters based on the staining quality assessment parameters;
[0135] The staining quality level determination module 14 is used to determine the staining quality level of the stained image based on the comparison result between the comprehensive staining quality parameters and the quality threshold.
[0136] The defect identification module 15 is used to obtain the defect identification result of the dyeing scheme based on the dyeing quality level and the initial dyeing scheme;
[0137] The evaluation result generation module 16 is used to integrate the staining quality level and the staining scheme defect identification results to generate staining image evaluation results.
[0138] In one embodiment, the staining and image acquisition module 11 is further configured to stain the biological sample using an initial staining scheme and acquire a stained image of the biological sample after staining, including:
[0139] Obtain the sample type of the biological sample and query the corresponding initial staining protocol, wherein the initial staining protocol includes at least the type of staining agent, the concentration of staining agent, the staining time and the staining environmental conditions;
[0140] The biological sample was stained using the initial staining protocol to obtain the stained biological sample.
[0141] The stained biological sample is imaged to obtain stained images.
[0142] In one embodiment, the quality assessment parameter extraction module 12 is further configured to analyze the stained image and extract stained quality assessment parameters, wherein the stained quality assessment parameters include at least grayscale difference parameters and stained uniformity parameters, including:
[0143] From the stained image, the average pixel grayscale value of the target structural region is extracted as the structural grayscale value, and the average pixel grayscale value of the background region is extracted and recorded as the background grayscale value.
[0144] Obtain the grayscale dynamic range of the stained image, and divide the absolute difference between the mean grayscale value of the structure and the mean grayscale value of the background by the grayscale dynamic range to obtain the grayscale difference parameter;
[0145] The stained image is uniformly divided into multiple grid regions, the grid gray standard deviation of the average gray value of all grid regions is calculated, and the average gray value of the entire stained image is calculated.
[0146] Divide the standard deviation of the grid gray level by the average gray level of the entire image to obtain the color uniformity parameter.
[0147] In one embodiment, the comprehensive staining quality calculation module 13 is further configured to calculate comprehensive staining quality parameters based on the staining quality assessment parameters, including:
[0148] Obtain a set of historical qualified staining sample information for multiple historical qualified staining samples of the same type as the biological sample, wherein the set of historical qualified staining sample information includes historical grayscale difference parameters, historical staining uniformity parameters, and historical comprehensive staining quality parameters.
[0149] Calculate the arithmetic mean of multiple historical grayscale difference parameters as the benchmark value of the difference parameters, and calculate the arithmetic mean of multiple historical staining uniformity parameters as the benchmark value of uniformity fluctuation.
[0150] Calculate the grayscale difference deviation between the grayscale difference parameter and the grayscale difference parameter reference value, and calculate the uniformity deviation between the dyeing uniformity parameter and the uniformity fluctuation reference value;
[0151] Obtain the structural enrichment of the staining agent;
[0152] Based on the grayscale difference deviation and the uniformity deviation, the initial staining quality parameters are obtained, and the initial staining quality parameters are corrected by the dye structure enrichment to obtain the comprehensive staining quality parameters.
[0153] The acquisition of dye structure enrichment includes:
[0154] Calculate the ratio of the average gray level of the structure to the average gray level of the background in the stained image to obtain the structure-background gray level ratio;
[0155] Obtain the structural background grayscale ratio of multiple historical qualified staining samples belonging to the same type as the biological sample, calculate the arithmetic mean of the structural background grayscale ratio, and obtain the historical average grayscale ratio;
[0156] The structure enrichment of the dye is obtained by dividing the structure background grayscale ratio by the historical average grayscale ratio.
[0157] In one embodiment, the staining quality level determination module 14 is further configured to determine the staining quality level of the stained image based on the comparison result of the comprehensive staining quality parameters and the quality threshold, including:
[0158] Obtain the historical comprehensive staining quality parameter set of multiple historical qualified staining samples belonging to the same type as the biological sample, calculate the mean of the historical comprehensive staining quality parameter set as the historical quality mean, and calculate the standard deviation of the historical comprehensive staining quality parameter set as the historical quality standard deviation.
[0159] The quality threshold is obtained by subtracting the historical quality standard deviation from the historical quality mean.
[0160] When the comprehensive staining quality parameter is greater than or equal to the quality threshold, the staining quality level is determined to be qualified;
[0161] When the comprehensive staining quality parameter is less than the quality threshold, the staining quality grade is determined to be unqualified.
[0162] In one embodiment, the defect identification module 15 is further configured to obtain a defect identification result for the dyeing scheme based on the dyeing quality grade and the initial dyeing scheme, including:
[0163] When the dyeing quality level is qualified, the grayscale difference parameter, the dyeing uniformity parameter and the comprehensive dyeing quality parameter are added to the historical qualified dyeing sample information set, and the quality threshold is recalculated.
[0164] When the dyeing quality grade is unqualified, the initial dyeing scheme, the grayscale difference parameter, and the dyeing uniformity parameter are input into the dyeing defect identification model to obtain the dyeing scheme defect identification result.
[0165] The construction of the staining defect identification model includes:
[0166] Obtain a sample staining defect set, wherein the sample staining defect set includes sample grayscale difference parameters, sample staining uniformity parameters, sample initial staining scheme parameters, and staining scheme defect identification result labels;
[0167] A staining defect identification model is constructed based on machine learning. The staining defect identification model takes gray level difference parameter, staining uniformity parameter and initial staining scheme as input and staining scheme defect identification result as output.
[0168] The staining defect recognition model is trained using the sample staining defect set until convergence, and the trained staining defect recognition model is obtained.
[0169] In one embodiment, the evaluation result generation module 16 is further configured to integrate the staining quality grade and the staining scheme defect identification results to generate a staining image evaluation result, including:
[0170] The staining quality grade, the comprehensive staining quality parameter, the grayscale difference parameter, the staining uniformity parameter, and the staining image are combined into structured evaluation data.
[0171] After associating the structured evaluation data with the initial staining scheme and the staining scheme defect identification results, a staining image evaluation report containing defect causes and improvement suggestions is generated, wherein the improvement suggestions are obtained based on the grayscale difference parameter and the staining uniformity parameter.
[0172] It should be noted that the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some implementations, multitasking and parallel processing are possible or may be advantageous.
[0173] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0174] This specification and accompanying drawings are merely illustrative examples of the invention and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of the invention. Clearly, those skilled in the art can make various alterations and modifications to the invention without departing from its scope. Therefore, if such modifications and modifications fall within the scope of the invention and its equivalents, the invention is intended to include these modifications and modifications.
Claims
1. A method for processing a stained image, characterized in that, include: The biological samples were stained using an initial staining protocol, and the stained images of the biological samples were obtained. The stained image is analyzed to extract staining quality assessment parameters, which include at least grayscale difference parameters and staining uniformity parameters, including: From the stained image, the average pixel grayscale value of the target structural region is extracted as the structural grayscale value, and the average pixel grayscale value of the background region is extracted and recorded as the background grayscale value. Obtain the grayscale dynamic range of the stained image, and divide the absolute difference between the mean grayscale value of the structure and the mean grayscale value of the background by the grayscale dynamic range to obtain the grayscale difference parameter; The stained image is uniformly divided into multiple grid regions, the grid gray standard deviation of the average gray value of all grid regions is calculated, and the average gray value of the entire stained image is calculated. Divide the standard deviation of the grid gray level by the average gray level of the entire image to obtain the color uniformity parameter; Based on the aforementioned staining quality assessment parameters, a comprehensive staining quality parameter is calculated, including: Obtain a set of historical qualified staining sample information for multiple historical qualified staining samples of the same type as the biological sample, wherein the set of historical qualified staining sample information includes historical grayscale difference parameters, historical staining uniformity parameters, and historical comprehensive staining quality parameters. Calculate the arithmetic mean of multiple historical grayscale difference parameters as the benchmark value of the difference parameters, and calculate the arithmetic mean of multiple historical staining uniformity parameters as the benchmark value of uniformity fluctuation. Calculate the grayscale difference deviation between the grayscale difference parameter and the grayscale difference parameter reference value, and calculate the uniformity deviation between the dyeing uniformity parameter and the uniformity fluctuation reference value; Obtain the structural enrichment of the staining agent; Based on the grayscale difference deviation and the uniformity deviation, the initial staining quality parameters are obtained, and the initial staining quality parameters are corrected by the dye structure enrichment to obtain the comprehensive staining quality parameters. Based on the comparison results between the comprehensive staining quality parameters and the quality threshold, the staining quality level of the stained image is determined; Based on the dyeing quality grade and the initial dyeing scheme, obtain the dyeing scheme defect identification results; The staining quality level and the staining scheme defect identification results are integrated to generate staining image evaluation results.
2. The method for processing a stained image according to claim 1, characterized in that, The step of staining the biological sample using an initial staining protocol and obtaining a stained image of the biological sample after staining includes: Obtain the sample type of the biological sample and query the corresponding initial staining protocol, wherein the initial staining protocol includes at least the type of staining agent, the concentration of staining agent, the staining time and the staining environmental conditions; The biological sample was stained using the initial staining protocol to obtain the stained biological sample. The stained biological sample is imaged to obtain stained images.
3. The method for processing a stained image according to claim 1, characterized in that, The acquisition of dye structure enrichment includes: Calculate the ratio of the average gray level of the structure to the average gray level of the background in the stained image to obtain the structure-background gray level ratio; Obtain the structural background grayscale ratio of multiple historical qualified staining samples belonging to the same type as the biological sample, calculate the arithmetic mean of the structural background grayscale ratio, and obtain the historical average grayscale ratio; The structure enrichment of the dye is obtained by dividing the structure background grayscale ratio by the historical average grayscale ratio.
4. The method for processing a stained image according to claim 1, characterized in that, The step of determining the staining quality level of the stained image based on the comparison result of the comprehensive staining quality parameters and the quality threshold includes: Obtain the historical comprehensive staining quality parameter set of multiple historical qualified staining samples belonging to the same type as the biological sample, calculate the mean of the historical comprehensive staining quality parameter set as the historical quality mean, and calculate the standard deviation of the historical comprehensive staining quality parameter set as the historical quality standard deviation. The quality threshold is obtained by subtracting the historical quality standard deviation from the historical quality mean. When the comprehensive staining quality parameter is greater than or equal to the quality threshold, the staining quality level is determined to be qualified; When the comprehensive staining quality parameter is less than the quality threshold, the staining quality grade is determined to be unqualified.
5. The method for processing a stained image according to claim 1, characterized in that, The step of obtaining the staining scheme defect identification result based on the staining quality grade and the initial staining scheme includes: When the dyeing quality level is qualified, the grayscale difference parameter, the dyeing uniformity parameter and the comprehensive dyeing quality parameter are added to the historical qualified dyeing sample information set, and the quality threshold is recalculated. When the dyeing quality grade is unqualified, the initial dyeing scheme, the grayscale difference parameter, and the dyeing uniformity parameter are input into the dyeing defect identification model to obtain the dyeing scheme defect identification result.
6. The method for processing a stained image according to claim 5, characterized in that, The construction of the staining defect identification model includes: Obtain a sample staining defect set, wherein the sample staining defect set includes sample grayscale difference parameters, sample staining uniformity parameters, sample initial staining scheme parameters, and staining scheme defect identification result labels; A staining defect identification model is constructed based on machine learning. The staining defect identification model takes gray level difference parameter, staining uniformity parameter and initial staining scheme as input and staining scheme defect identification result as output. The staining defect recognition model is trained using the sample staining defect set until convergence, and the trained staining defect recognition model is obtained.
7. The method for processing a stained image according to claim 1, characterized in that, The process of integrating the staining quality level and the staining scheme defect identification results to generate a staining image evaluation result includes: The staining quality grade, the comprehensive staining quality parameter, the grayscale difference parameter, the staining uniformity parameter, and the staining image are combined into structured evaluation data. After associating the structured evaluation data with the initial staining scheme and the staining scheme defect identification results, a staining image evaluation report containing defect causes and improvement suggestions is generated, wherein the improvement suggestions are obtained based on the grayscale difference parameter and the staining uniformity parameter.
8. A system for processing stained images, characterized in that, The system is used to implement a method for processing a stained image according to any one of claims 1-7, the system comprising: The staining and image acquisition module is used to stain biological samples using an initial staining scheme and acquire stained images of the biological samples after staining. A quality assessment parameter extraction module is used to analyze the stained image and extract stained quality assessment parameters, wherein the stained quality assessment parameters include at least grayscale difference parameters and stained uniformity parameters, including: From the stained image, the average pixel grayscale value of the target structural region is extracted as the structural grayscale value, and the average pixel grayscale value of the background region is extracted and recorded as the background grayscale value. Obtain the grayscale dynamic range of the stained image, and divide the absolute difference between the mean grayscale value of the structure and the mean grayscale value of the background by the grayscale dynamic range to obtain the grayscale difference parameter; The stained image is uniformly divided into multiple grid regions, the grid gray standard deviation of the average gray value of all grid regions is calculated, and the average gray value of the entire stained image is calculated. Divide the standard deviation of the grid gray level by the average gray level of the entire image to obtain the color uniformity parameter; The comprehensive staining quality calculation module is used to calculate comprehensive staining quality parameters based on the staining quality assessment parameters, including: Obtain a set of historical qualified staining sample information for multiple historical qualified staining samples of the same type as the biological sample, wherein the set of historical qualified staining sample information includes historical grayscale difference parameters, historical staining uniformity parameters, and historical comprehensive staining quality parameters. Calculate the arithmetic mean of multiple historical grayscale difference parameters as the benchmark value of the difference parameters, and calculate the arithmetic mean of multiple historical staining uniformity parameters as the benchmark value of uniformity fluctuation. Calculate the grayscale difference deviation between the grayscale difference parameter and the grayscale difference parameter reference value, and calculate the uniformity deviation between the dyeing uniformity parameter and the uniformity fluctuation reference value; Obtain the structural enrichment of the staining agent; Based on the grayscale difference deviation and the uniformity deviation, the initial staining quality parameters are obtained, and the initial staining quality parameters are corrected by the dye structure enrichment to obtain the comprehensive staining quality parameters. The staining quality level determination module is used to determine the staining quality level of the stained image based on the comparison result between the comprehensive staining quality parameters and the quality threshold. The defect identification module is used to obtain the defect identification result of the dyeing scheme based on the dyeing quality level and the initial dyeing scheme; The evaluation result generation module is used to integrate the staining quality level and the staining scheme defect identification results to generate staining image evaluation results.
Citation Information
Patent Citations
Chromosome karyotype image quality evaluation method, chromosome analyzer and storage medium
CN113470028A
IgA nephropathy prognosis prediction method fusing multi-modal images and clinical features
CN121528566A