A method and system for ihc pathological grading based on her2 tissue chip
Patent Information
- Application Number
- CN202611090722.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-22
- Publication Date
- 2026-08-21
AI Technical Summary
[0011]本发明的目的在于克服现有技术中HER2 IHC病理分级主观性强、一致性低、全流程质控缺失、低表达区域识别困难、分级标准量化不足等技术问题,提供一种基于HER2组织芯片的IHC病理分级方法和系统
1、全流程质控,染色一致性强:采用含肿瘤微环境的HER2四等级组织芯片,与待检样本同步染色,纵向排列设计含待检样本区,可实时监控染色全流程,有效避免实验条件波动导致的染色偏差,解决传统组织芯片无肿瘤微环境、不同步染色的缺陷,染色一致性Kappa值提升至0.85以上。
Smart Images

Figure CN122617877A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of bioinformatics, specifically to an IHC pathological grading method and system based on HER2 tissue microarrays, which is particularly suitable for immunohistochemical (IHC) detection and grading of HER2 protein expression levels in breast cancer, and can provide a reliable biomarker assessment basis for targeted therapy. Background Technology
[0002] Human epidermal growth factor receptor 2 (HER2) is a transmembrane glycoprotein belonging to the epidermal growth factor receptor family. Its abnormal amplification or overexpression is closely related to the occurrence, development, prognosis, and treatment response of various malignant tumors, including breast cancer, gastric cancer, and ovarian cancer. In breast cancer patients, approximately 20%-30% exhibit HER2 overexpression; these patients tend to have tumor cells that proliferate rapidly, are highly invasive, and are prone to metastasis, resulting in a relatively poor prognosis.
[0003] Immunohistochemistry (IHC) is currently the standard method for clinically detecting HER2 protein expression levels. It offers advantages such as ease of operation, low cost, and the ability to be performed on routine pathology slides, making it widely used in pathology departments of hospitals at all levels. The core of HER2 IHC detection is the binding of specific antibodies to the HER2 protein in tissue samples, followed by a colorimetric reaction to reveal the location and intensity of protein expression. Finally, the expression intensity is graded to provide a basis for selecting clinical treatment plans.
[0004] Currently, the commonly used HER2 IHC grading standard in clinical practice is mainly based on the guidelines jointly developed by the American Society of Clinical Oncology (ASCO) and the College of American Pathologists (CAP), which classifies HER2 protein expression levels into four grades: 0, 1+, 2+, and 3+. Among them, grade 2+ is an indeterminate grade, which requires further verification of whether the HER2 gene has been amplified using techniques such as fluorescence in situ hybridization (FISH).
[0005] However, the existing HER2 IHC pathological grading process has many technical problems that seriously affect the accuracy, consistency, and standardization of the grading, as follows: 1. High subjectivity and low consistency in interpretation: HER2 IHC grading relies heavily on the pathologist's visual observation and experience, requiring a comprehensive assessment based on three core indicators: cell membrane staining intensity, staining integrity, and the proportion of stained cells. Different pathologists have varying levels of experience and adherence to standards; even the same pathologist may interpret the same slide at different times, leading to poor consistency in grading results. This is particularly pronounced for samples with low expression (grade 1+) and indeterminate grades (grade 2+). Statistics show that the Kappa value for grading consistency among different pathologists is only 0.6-0.7, which is insufficient to meet consistency requirements.
[0006] 2. Lack of end-to-end quality control, affecting grading accuracy due to staining quality: The entire HER2 IHC assay process includes sample processing, dewaxing and hydration, antigen retrieval, primary antibody incubation, DAB staining, counterstaining, dehydration and clearing, and mounting. The experimental conditions at each step (such as temperature, time, and reagent concentration) affect the staining results. Current technology lacks effective end-to-end quality control methods and a standardized control system, making it difficult to detect problems such as excessively light or dark staining, or background contamination. This leads to misclassification of some samples due to poor staining quality.
[0007] 3. Difficulty in identifying low-expression regions, leading to high rates of missed and false positives: For HER2 0 and 1+ samples, the cell membrane staining intensity is weak, the proportion of stained cells is low, and it is easily affected by factors such as tissue background and cell morphology. Pathologists find it difficult to accurately identify low-expression regions with the naked eye, which can easily lead to misjudgment (classifying 1+ as 0) or 0-level cases.
[0008] 4. Insufficient quantification of grading standards and lack of objective indicators: Existing grading standards are mostly qualitative descriptions, such as "Grade 0 is unstained or <10% of tumor cells have stained cell membranes" and "Grade 1+ is ≥10% of tumor cells have weak or incomplete stained cell membranes". The lack of specific quantitative indicators leads to a large degree of subjectivity in grading and makes it impossible to achieve objectivity and standardization of grading.
[0009] 5. Imperfect application of tissue microarrays and unreasonable design of control standards: In the existing technology, although some detection schemes use tissue microarrays as controls, the control standards are mostly lacking in tumor microenvironment or cannot be mass-produced. Moreover, the control standards and the test samples are often stained asynchronously, resulting in differences in the staining effects between the control standards and the test samples, which cannot be accurately used as a grading reference. At the same time, the arrangement of tissue microarrays is unreasonable, and no test sample area is set up, making it impossible to monitor the staining quality of the test samples synchronously, which is difficult to assist in slide interpretation.
[0010] To address the aforementioned technical challenges, existing technologies have proposed several HER2 IHC pathological grading schemes, such as image recognition-based grading methods and feature extraction-based quantitative grading methods. However, these schemes still have several shortcomings: some schemes do not incorporate tissue microarrays for end-to-end quality control, failing to ensure consistent staining quality; some schemes extract only a small number of feature parameters, failing to fully reflect the expression characteristics of the HER2 protein, resulting in low grading accuracy; some schemes lack specific implementation methods and detailed parameters, hindering clinical application; and some schemes lack control standard verification steps, failing to ensure the accuracy of grading standards and thus failing to meet clinical needs. Summary of the Invention
[0011] The purpose of this invention is to overcome the technical problems of existing HER2 IHC pathological grading, such as strong subjectivity, low consistency, lack of quality control throughout the process, difficulty in identifying low-expression regions, and insufficient quantification of grading standards. This invention provides an IHC pathological grading method and system based on HER2 tissue microarrays. This invention simultaneously stains the HER2 tissue microarray containing the tumor microenvironment with the sample to be tested, constructs a standardized four-level control system, extracts multi-dimensional feature parameters to achieve grading quantification, designs control standard verification steps to ensure grading accuracy, and optimizes parameter settings by combining two specific implementation methods to adapt to different clinical testing scenarios. This significantly improves the accuracy, consistency, and standardization of HER2 IHC pathological grading, reduces reliance on pathologist experience, and provides a reliable biomarker evaluation basis for HER2-targeted therapy in breast cancer.
[0012] The first aspect of this invention provides an IHC pathological grading method based on HER2 tissue microarrays, comprising: S1, tissue microarray construction and simultaneous staining; S2, image acquisition, including: acquiring images of tumor regions of control samples and test samples of the simultaneously stained tissue microarrays at various grades using an optical microscope to form a standardized image dataset; S3, image preprocessing, including: optimizing the images acquired in step S2 to remove noise, background interference, and redundant information from the images to obtain a noise-free, background-free foreground image with clear cell structure; S4, feature extraction, including: extracting multi-dimensional feature parameters that reflect the expression characteristics of HER2 protein from the foreground image. The data includes one-dimensional histogram features of the HSV channel, two-dimensional histogram features of the HS channel, and a 17-dimensional feature parameter vector; S5, reference standard verification, including: verifying the feature parameters of reference standards of each grade in the tissue microarray, verifying the accuracy of the reference standard grade labeling and the qualification of the staining quality, ensuring that the reference standards can serve as a reliable reference standard for judging the grade of the sample to be tested; if the reference standard verification fails, it prompts to re-stain the sample and acquire images; S6, sample grade judgment, including: after the reference standard verification is qualified, based on the extracted 17-dimensional feature parameter vector of the sample to be tested, combined with the constructed standard feature parameter vector library, the HER2 grade of the sample to be tested is quantitatively judged by calculating the Euclidean distance.
[0013] The second aspect of this invention provides an IHC pathological grading system based on HER2 tissue microarrays for implementing the method of the first aspect, comprising: a tissue microarray simultaneous staining module for constructing and simultaneously staining tissue microarrays; an image acquisition module for image acquisition, including: acquiring images of tumor regions of simultaneous stained tissue microarray control standards and test samples at various grades using an optical microscope to form a standardized image dataset; an image preprocessing module for image preprocessing, including: optimizing the images acquired by the image acquisition module to remove noise, background interference, and redundant information from the images to obtain a noise-free, background-free, and clearly structured foreground image; and a feature extraction module for feature extraction, including: extracting features reflecting HER2 from the foreground image obtained by the image preprocessing module. The R2 protein expression characteristics are analyzed using multi-dimensional feature parameters, including one-dimensional histogram features of the HSV channel, two-dimensional histogram features of the HS channel, and a 17-dimensional feature parameter vector. A reference standard verification module is used to verify reference standards, including: verifying the feature parameters of reference standards at each grade in the tissue microarray, verifying the accuracy of the reference standard grade labeling and the qualification of the staining quality, ensuring that the reference standards can serve as a reliable reference standard for judging the grade of the sample to be tested; if the reference standard verification fails, it prompts for re-staining the sample and re-acquiring the image. A grade discrimination module is used to judge the grade of the sample to be tested, including: after the reference standard verification is qualified, based on the 17-dimensional feature parameter vector of the sample to be tested extracted by the feature extraction module, combined with the standard feature parameter vector library constructed by the reference standard verification module, the HER2 grade of the sample to be tested is quantitatively judged by calculating the Euclidean distance.
[0014] A third aspect of the present invention also provides an electronic device, including a processor and a memory, the memory storing a plurality of instructions, the processor being configured to read the instructions and execute the method as described in the first aspect.
[0015] A fourth aspect of the present invention also provides a computer-readable storage medium storing a plurality of instructions which can be read by a processor and executed as described in the first aspect.
[0016] The present invention has the following beneficial technical effects: 1. Full-process quality control and strong staining consistency: The HER2 grade 4 tissue chip containing the tumor microenvironment is used for synchronous staining with the sample to be tested. The longitudinal arrangement design includes the area of the sample to be tested, which can monitor the entire staining process in real time. This effectively avoids staining deviations caused by fluctuations in experimental conditions and solves the defects of traditional tissue chips that do not have a tumor microenvironment and are not synchronously stained. The staining consistency Kappa value is improved to over 0.85.
[0017] 2. Multi-dimensional quantitative features, objective and accurate grading: Construct a 17-dimensional feature parameter vector to fully cover overall features, cell membrane refinement features and cell nucleus supplementary features. Combine HSV channel histogram and two-dimensional histogram analysis to achieve accurate quantification of staining features, overcome the subjectivity of traditional qualitative grading, and achieve an overall grading accuracy of over 94%, with the grading accuracy of low expression samples improved to 85%.
[0018] 3. Reference standard verification mechanism, reliable standard: Based on two core parameters, a two-level progressive verification logic is constructed to quickly and accurately verify the reference standard grade, ensuring the reliability of the standard feature vector library, providing a stable reference for the grading of samples to be tested, and the reference standard verification pass rate is over 91%.
[0019] 4. Multidimensional color feature optimization and efficient foreground extraction: By integrating HSV color space conversion and morphological opening and closing operations, combined with kurtosis / skewness secondary verification and Pearson correlation matching strategy, the system can accurately extract and quantify staining targets in complex backgrounds, solving the problem of discrimination difficulties caused by weak color in low expression regions (such as 1+).
[0020] 5. Strong compatibility and good clinical applicability: It can be seamlessly integrated with the existing IHC testing process in pathology departments without the need for additional complex equipment. The operating parameters are clear, and the grading accuracy rate is over 94%. It is suitable for clinical application in hospitals at all levels, which can reduce the dependence on the experience of pathologists, improve the standardization level of grading, and provide a reliable biomarker evaluation basis for HER2 targeted therapy of breast cancer. Attached Figure Description
[0021] Figure 1 The flowchart is shown below for the IHC pathological grading method based on HER2 tissue microarray according to the present invention.
[0022] Figure 2 This is a diagram of the IHC pathological grading system based on HER2 tissue microarray according to the present invention.
[0023] Figure 3 This is a schematic diagram of a method according to an application example of the present invention.
[0024] Figure 4 This is a stained image of a tumor region according to an application example of the present invention.
[0025] Figure 5 This is a set of one-dimensional histograms for comparison with level 0.
[0026] Figure 6 To compare multiple sets of one-dimensional histograms at level 1+.
[0027] Figure 7 To compare multiple sets of one-dimensional histograms at level 2+.
[0028] Figure 8 To compare multiple sets of one-dimensional histograms at level 3+.
[0029] Figure 9 This is a comparison chart of multiple sets of one-dimensional histograms for the samples to be tested.
[0030] Figure 10 Images of tumor regions of four grades are plotted in a two-dimensional histogram of the HS.
[0031] Figure 11 This is a cell nucleus image extracted as an application example of the present invention.
[0032] Figure 12 This is a cell membrane image extracted as an application example of the present invention. Detailed Implementation
[0033] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.
[0034] Example 1 like Figure 1 As shown, this embodiment provides an IHC pathological grading method based on HER2 tissue microarray, which includes: S1, Tissue microarray construction and simultaneous staining, including: S11, constructing a HER2 pathological immunohistochemical tissue microarray, wherein the HER2 pathological immunohistochemical tissue microarray is arranged vertically, with standard control areas for grades 0, 1+, 2+, and 3+ arranged from top to bottom, with one sample set for each grade, and a sample to be tested area set on the right, arranged parallel to the control area; S12, performing simultaneous staining on the HER2 pathological immunohistochemical tissue microarray and the sample to be tested to ensure that the staining environment of the two is consistent, providing a reliable control basis for subsequent grading.
[0035] In this embodiment, the HER2 pathological immunohistochemical tissue chip (hereinafter referred to as "tissue chip") is the core control carrier, and its design meets the needs of clinical testing. Specific features are as follows: (1) Coverage of control standards: The tissue microarray contains standard control standards for four levels of HER2 protein expression (0, 1+, 2+ and 3+), which can comprehensively cover different levels of HER2 expression and provide a comprehensive reference standard for the grading of samples to be tested.
[0036] (2) Source of control standards: The standard control standards of the four grades are all derived from the corresponding PDTX tissues. Each tissue has stable passage characteristics, and the four PDTX tissues correspond to the four grades. This ensures that the genetic background and tissue type of the control standards are consistent, avoids differences in expression characteristics due to different sources of control standards, and improves the accuracy of the control standards.
[0037] (3) Tumor microenvironment: All standard control samples contain a complete tumor microenvironment, including tumor cells, stromal cells, vascular endothelial cells, etc., which are consistent with the tissue morphology of clinical test samples. They can truly reflect the expression of HER2 protein in tumor tissue and avoid grading bias caused by lack of tumor microenvironment.
[0038] (4) Arrangement method: The tissue chip adopts a vertical arrangement, with grade 0, grade 1+, grade 2+ and grade 3+ standard control materials arranged from top to bottom, and repeated samples of each grade are arranged continuously; at the same time, the tissue chip has a sample area to be tested, which is located on the right side of the tissue chip and arranged parallel to the control area. The sample to be tested and the control materials can be stained and observed simultaneously, which facilitates the simultaneous monitoring of the staining quality of the sample to be tested, and also assists pathologists in reading the slides and improves the grading efficiency.
[0039] In this embodiment, the simultaneous staining process strictly follows standardized immunohistochemical operating procedures to ensure consistency of experimental conditions. The specific process includes: dewaxing and hydration, antigen retrieval, primary antibody incubation, secondary antibody incubation, DAB staining, hematoxylin counterstaining, dehydration and clearing, and mounting. The experimental conditions (temperature, time, reagent concentration) for each step are strictly controlled, and the tissue microarray and the sample to be tested complete all staining steps under exactly the same experimental conditions. The specific parameters are as follows (which can be adjusted according to the implementation scenario): ① Dewaxing and hydration: Xylene is used for dewaxing at a temperature of 25±2℃ for 3 times × 10 minutes. Then, a gradient of ethanol is used for hydration at concentrations of 100%, 95%, 85%, and 75% for 5 minutes each time. Finally, the mixture is rinsed with distilled water 3 times × 3 minutes to remove any ethanol residue.
[0040] ② Antigen retrieval: Citrate buffer (pH=6.0) was used for antigen retrieval. The retrieval method was thermal retrieval at 121℃ for 15 minutes. After retrieval, the antigen was allowed to cool naturally to room temperature and then rinsed three times with PBS buffer for three minutes each time to remove any buffer residue.
[0041] ③ Primary antibody incubation: Use anti-HER2 monoclonal antibody as the primary antibody (ready-to-use type), incubate at 4℃ for 12-24 hours; after incubation, rinse 3 times with PBS buffer for 5 minutes each time to remove unbound primary antibody.
[0042] ④ Secondary antibody incubation: Use HRP-labeled goat anti-mouse secondary antibody as the secondary antibody (ready-to-use type), incubate at 37℃ for 30-60 minutes; after incubation, rinse 3 times with PBS buffer for 5 minutes each time to remove unbound secondary antibody.
[0043] ⑤ DAB color development: Use a DAB color development kit for color development. The color development temperature is 25±2℃ and the color development time is 3-10 minutes. Observe under a microscope in real time during the color development process. Once the staining of the control sample reaches the standard, rinse with distilled water immediately to stop the color development.
[0044] ⑥ Hematoxylin counterstaining: Use hematoxylin dye solution for counterstaining at a temperature of 25±2℃ for 5-10 minutes. After counterstaining, rinse with distilled water, then differentiate with 1% hydrochloric acid ethanol for 3-5 seconds, and finally rinse with distilled water for 5 minutes to return to blue.
[0045] ⑦ Dehydration and clearing: Dehydration is performed using gradient ethanol with concentrations of 75%, 95%, and 100% in sequence, with each dehydration lasting 5 minutes; followed by clearing with xylene for 2 times × 10 minutes.
[0046] ⑧ Mounting: Use neutral resin for mounting. Avoid creating air bubbles during mounting. After mounting, place the slides in a ventilated place to dry and set aside.
[0047] In summary, this embodiment ensures that the sample quality meets the testing requirements through pre-processing (such as sectioning, dewaxing and hydration) and post-processing (such as counterstaining, dehydration and clearing, and mounting) of the samples and tissue microarrays.
[0048] S2, Image Acquisition, includes: acquiring images of tumor regions of tissue microarray controls and test samples after synchronous staining using an optical microscope, forming a standardized image dataset, which provides a basis for subsequent image preprocessing, feature extraction, and grade determination of test samples.
[0049] In this embodiment, the core device of the image acquisition module is a fully automated optical microscope, and its parameters are set as follows (which can be adjusted according to the implementation scenario): objective magnification is 20× or 40×, eyepiece magnification is 10×, image resolution is 1024×768 pixels or 2048×1536 pixels, acquisition method is fully automated scanning acquisition, acquisition area is the area with dense tumor cells (avoiding necrotic areas, hemorrhage areas and normal tissue areas), and one optimal field-of-view image is acquired for each sample to ensure that the acquired image can fully reflect the expression of HER2 protein.
[0050] In a preferred embodiment, S2 includes: S21, sample placement: placing the dried tissue chip and the sample section to be tested on the stage of the optical microscope, adjusting the stage position so that both the control area of the tissue chip and the sample section to be tested are within the field of view of the microscope; S22, parameter adjustment: turning on the optical microscope, adjusting the magnification of the objective lens and eyepiece, adjusting the focal length, brightness, and contrast to ensure a clear field of view and to ensure that tumor cells and cell membrane structures can be clearly identified; setting parameters such as image resolution and acquisition speed to ensure that the quality of the acquired images meets the requirements; S23, acquiring control images: first acquiring images of control samples of various grades on the tissue chip, acquiring them sequentially in the order of grade 0, grade 1+, grade 2+, and grade 3+, acquiring one image of each grade. Images of the tumor-stained area are used as control images. During acquisition, the control grade, sample number, and acquisition time of each control image are recorded to ensure a one-to-one correspondence between images and control grades. S24, Acquire images of the samples to be tested: After the control images are acquired, images of the samples to be tested are acquired. One optimal field-of-view image of the densely populated tumor cell area is acquired for each sample to be tested. During acquisition, the sample number, acquisition time, and field of view of each image are recorded to ensure image traceability. S25, Store images: All acquired images are named according to the naming rule of "control grade + sample number + acquisition time" and stored in PNG or JPG format to construct an image dataset. The storage path is the path specified by the system for easy subsequent retrieval and management.
[0051] S3, image preprocessing, includes: selecting the clearest image from each group of images acquired in S2, performing a series of optimization processes to remove noise, background interference and redundant information from the image, and obtaining a foreground image with no noise, no background interference and clear cell structure, providing high-quality image data for subsequent feature extraction and grade discrimination, and improving the accuracy of grading.
[0052] In a preferred embodiment, the specific process of image preprocessing includes: Gaussian denoising, RGB-HSV color space conversion, background removal, and morphological optimization. These steps are performed sequentially and synergistically, as detailed below: (1) Gaussian denoising: The acquired images inevitably contain electronic noise, environmental noise, etc., which will affect the accuracy of subsequent feature extraction. Therefore, Gaussian denoising is required to remove image noise while preserving the details of tumor cells and cell membrane structures in the image.
[0053] The Gaussian denoising method uses a 3×3 Gaussian convolution kernel for Gaussian blurring. The standard deviation σ of the Gaussian convolution kernel is set to 0.5-2.0 (which can be adjusted according to the image noise level, see the specific implementation method for details). Its core principle is to use a Gaussian function to perform a weighted average on each pixel in the image and its neighboring pixels, so that the gray value of the noisy pixels tends to be stable, thereby achieving the purpose of denoising.
[0054] Gaussian convolution kernel The specific expression is shown in equation (1) below: ; in, The pixel coordinates of the Gaussian convolution kernel. The standard deviation of the Gaussian convolution kernel. The larger the value, the stronger the noise reduction effect, but the worse the image detail retention; The smaller the value, the weaker the noise reduction effect, but the better the image detail is preserved. This invention optimizes... The value of is used to achieve a balance between noise reduction and image detail preservation.
[0055] (2) RGB-HSV color space conversion: The acquired image is an RGB color space image. The RGB color space is greatly affected by the light, and there is a correlation between the color components, which is not convenient for subsequent color feature extraction and analysis. The HSV color space is closer to the human eye's perception of color. It is divided into three independent components: hue (H), saturation (S), and lightness (V). Hue (H) reflects the type of color, saturation (S) reflects the vividness of the color, and lightness (V) reflects the brightness of the color. It can effectively reduce the influence of light changes and facilitate the separation of cell membrane staining area (yellow), cell nucleus area (blue) and background area (colorless or light red).
[0056] The specific process of RGB-HSV color space conversion is as follows: ① Normalization: Normalize the original values (range 0-255) of the three RGB channels to the range of 0-1. Let the normalized values be... , , The values are respectively , , The normalization formula is shown in equation (2): ; (2); ; in, , , The original pixel values in the RGB color space (0≤ , ≤255), , , Normalized pixel values (0≤ , , ≤1).
[0057] ② Calculate intermediate parameters: Calculate the normalized parameters. , , Maximum value Minimum value and difference The calculation formula is shown in equation (3): ; (3); - ; ③ Calculate the brightness Brightness Reflecting the brightness of the image, the value ranges from 0 to 255, and the calculation formula is shown in equation (4): (4); ④ Calculate saturation : Saturation Reflects the vibrancy of a color, with a value ranging from 0 to 255. When =0, =0 (no color); otherwise, The calculation formula is shown in equation (5): (5); ⑤ Calculate hue H: Hue H reflects the type of color, and its value ranges from 0 to 179 (adapting to the color range of the OpenCV image processing library). When H=0, H=0 (no color difference); otherwise, calculate the H value according to the channel type corresponding to the maximum value, and the specific calculation formula is shown in the following formulas (6-1)-(6-4): when Time (Red Dominant): (6-1); when Time (Green Dominant): (6-2); when Time (Blue Dominant): (6-3); Calculated After the value, if <0, then Then Values are compressed to the range of 0-179 using the following formula: (6-4)
[0058] (3) Background Removal: The background area mainly includes the blank area of the tissue section, the normal tissue area, and the stained background. Its color is mainly colorless, light red, or light blue, which is significantly different from the tumor cell area (including yellow staining of the cell membrane and blue staining of the cell nucleus). This invention generates background and foreground masks by setting the HSV threshold range, thereby separating the background area from the foreground area (tumor cell area) and removing background interference.
[0059] The HSV threshold range for the background region was determined through extensive experimental optimization, specifically as lower_bg=[100,0,106] and upper_bg=[179,55,255], where lower_bg is the lower limit of HSV values for the background region and upper_bg is the upper limit of HSV values for the background region; the foreground region (tumor cell region) is a non-background region, and its HSV values are not within the background threshold range.
[0060] The specific process for background removal is as follows: ① Generate a background mask: Traverse each pixel of the HSV color space image, if the HSV value of that pixel is within the range of... Within the specified range, pixels are identified as background pixels, and their mask value is set to 255; otherwise, they are identified as foreground pixels, and their mask value is set to 0, generating a background mask image. ② Generate the foreground mask: The foreground mask is the inverse mask of the background mask. That is, iterate through each pixel of the background mask; if the background mask value is 0, the foreground mask value is set to 255; if the background mask value is 255, the foreground mask value is set to 0, generating a foreground mask image. ③ Foreground image extraction: Perform a bitwise AND operation between the foreground mask and the HSV color space image, retaining the foreground region (tumor cell region) and removing the background region to obtain a preliminary foreground image.
[0061] (4) Morphological optimization: The initially extracted foreground image may contain a small number of noise points, small areas of background residue, and holes in the foreground region, which affect the accuracy of subsequent feature extraction. This invention optimizes the foreground mask by using morphological opening and closing operations and small region filtering, removes noise points and background residue, fills holes in the foreground region, and obtains a clean and complete foreground image.
[0062] ① Morphological opening operation: A rectangular structuring element (size 5×5) is used to perform morphological opening operation. First, the foreground mask is eroded to remove small noise points and burrs. Then, dilation is performed to restore the original shape of the foreground area and avoid excessive erosion of the foreground area.
[0063] The core principle of erosion processing is to use a structuring element to traverse each pixel of the foreground mask. If the mask value of all pixels covered by the structuring element is 255, then the mask value of that pixel remains 255; otherwise, it is set to 0, thereby removing small noise points.
[0064] The core principle of dilation processing is: use a structuring element to traverse each pixel of the eroded mask image. If at least one pixel covered by the structuring element has a mask value of 255, then the mask value of that pixel is set to 255; otherwise, it remains unchanged, thereby restoring the original shape of the foreground region.
[0065] ② Morphological closing operation: Morphological closing operation is performed using a rectangular structuring element of the same size as the opening operation. First, the mask image after the opening operation is dilated to fill the holes and gaps in the foreground area. Then, erosion is performed to remove the excess burrs generated during the dilation process, making the foreground area more complete and smooth.
[0066] ③ Small region filtering: Traverse the foreground mask image after the closing operation, calculate the area of each connected region, and remove connected regions with an area of less than 100 pixels (which can be adjusted according to the image resolution). These small connected regions are mostly noise points or background residues. Removing them can further improve the purity of the foreground image.
[0067] After morphological optimization, the optimized foreground mask is bitwise ANDed with the HSV color space image to obtain a noise-free, background-free foreground image with clear cell structure, which is then used for subsequent feature extraction.
[0068] S4, Feature Extraction, includes: extracting multi-dimensional feature parameters that reflect the expression characteristics of HER2 protein from the foreground image obtained from the image preprocessing module, including one-dimensional histogram features of HSV channel, two-dimensional histogram features of HS and 17-dimensional feature parameter vector, to provide quantitative basis for subsequent verification of control standards and grade discrimination of samples to be tested.
[0069] The core idea of feature extraction is that the expression level of HER2 protein is mainly reflected by the yellow staining intensity, staining integrity, and proportion of stained cells on the cell membrane. These features can be quantified by the distribution characteristics of the three components of hue (H), saturation (S), and lightness (V) in the HSV color space. Simultaneously, the blue staining characteristics of the cell nucleus can be used as a supplement to help determine the integrity and density of tumor cells, further improving the accuracy of grading. Therefore, the feature parameters extracted in this invention are mainly divided into three categories: one-dimensional histogram features of HSV channels, two-dimensional histogram features of HSV channels, and a 17-dimensional feature parameter vector.
[0070] In a preferred embodiment, S4 includes: S41, Extracting HSV Channel One-Dimensional Histogram Features: The HSV channel one-dimensional histogram includes the H channel histogram, S channel histogram, and V channel histogram, which respectively reflect the pixel distribution characteristics of the three components of hue (H), saturation (S), and brightness (V) in the foreground image. It can quantify the intensity distribution of yellow staining on the cell membrane and blue staining on the cell nucleus, as detailed below: ① H Channel Histogram: The H channel value ranges from 0 to 179. The number of pixels within each value is counted to obtain the H channel histogram. The peak position and peak height of the H channel histogram can reflect the main hue distribution of yellow (cell membrane) and blue (cell nucleus). For example, the H values in the yellow area are mainly concentrated in the range of 0-50, and the H values in the blue area are mainly concentrated in the range of 90-160. The intensity and distribution range of cell membrane staining can be preliminarily determined through the H channel histogram. ② S Channel Histogram: The S channel value ranges from 0 to 255. The number of pixels within each value is counted to obtain the S channel histogram. The peak position and peak height of the S-channel histogram reflect the vibrancy of the staining. The stronger the staining intensity (e.g., level 3+ samples), the higher the peak position and the greater the peak height of the S-channel; conversely, the weaker the staining intensity (e.g., level 0, 1+ samples), the lower the peak position and the smaller the peak height of the S-channel. ③ V-channel histogram: The V-channel value ranges from 0 to 255. The number of pixels within each value is counted to obtain the V-channel histogram. The distribution characteristics of the V-channel histogram reflect the brightness of the image, avoiding the influence of lighting changes on staining intensity judgment, and assisting in quantifying the intensity of cell membrane staining.
[0071] S42, Extracting HS 2D Histogram Features: The HS 2D histogram reflects the joint distribution characteristics of the hue (H) and saturation (S) components in the foreground image, simultaneously reflecting the color variety and vibrancy of the staining, further improving the comprehensiveness and accuracy of feature extraction. A 180×255 2D histogram matrix is constructed from the H and S channels of the HS 2D histogram. The number of pixels within each (H,S) bin is counted to obtain the HS 2D histogram. The peak position and peak height of the HS 2D histogram can accurately reflect the characteristics of yellow staining of the cell membrane. For example, the HS 2D histogram of level 3+ samples shows obvious peaks in the range of (0-50, 150-255), while the HS 2D histogram of level 0 samples shows no obvious peaks in this range.
[0072] S43, Extracting the 17-dimensional feature parameter vector: The 17-dimensional feature parameter vector is the core feature parameter of this invention, including 6 basic feature parameters, 10 refined feature parameters for the cell membrane region, and 1 supplementary feature parameter for the cell nucleus region. This vector comprehensively and accurately quantifies the expression characteristics of the HER2 protein, avoiding grading bias caused by a single feature parameter. All feature parameters are calculated using the foreground image and HSV channel histogram and HS 2D histogram. The specific definitions and calculation methods are as follows: ① Six basic feature parameters: These basic feature parameters are extracted from the entire foreground image and can reflect the overall characteristics of HER2 protein expression, including: a. Yellow area pixel ratio: The yellow area is the cell membrane staining area, and its HSV range is H∈[0,50], S∈[30,255], V∈[0,255]. The ratio of the number of pixels in the yellow area to the total number of pixels in the foreground image is the yellow area pixel ratio, which reflects the proportion of cells stained by the cell membrane. The value range is 0-1. The larger the ratio, the more stained cells there are, and the higher the HER2 expression level may be.
[0073] b. H-channel median: Calculates the median of all pixel values in the H-channel of the entire foreground image, reflecting the overall tonal distribution of the foreground image. The closer the median is to 0-50, the higher the proportion of yellow areas (cell membranes); the closer the median is to 90-160, the higher the proportion of blue areas (cell nuclei).
[0074] c. H-channel skewness: Calculates the skewness of all pixel values in the H-channel of the entire foreground image, reflecting the degree of asymmetry in the distribution of H-channel pixels. A positive skewness indicates that the H-channel pixel values are concentrated in the low range (high proportion of yellow area); a negative skewness indicates that the H-channel pixel values are concentrated in the high range (high proportion of blue area).
[0075] Skewness The calculation formula is shown in equation (7): (7); in, This represents the total number of pixels in the H channel. For the first H channel value of each pixel, The average value of the H channel pixels. This represents the standard deviation of the H channel pixel values.
[0076] d. S-channel skewness: Calculates the skewness of all pixel values in the S-channel of the entire foreground image, reflecting the degree of asymmetry in the distribution of S-channel pixels. A positive skewness indicates that the S-channel pixel values are concentrated in the low range (weak staining intensity); a negative skewness indicates that the S-channel pixel values are concentrated in the high range (strong staining intensity).
[0077] e. V channel kurtosis: Calculates the kurtosis of all pixel values in the V channel of the entire foreground image. It reflects the steepness of the pixel distribution in the V channel. The larger the kurtosis, the more concentrated the pixel values in the V channel are in a certain range, and the more uniform the brightness of the image. The smaller the kurtosis, the more dispersed the pixel values in the V channel are, and the greater the difference in brightness of the image.
[0078] Kudo The calculation formula is shown in equation (8): (8); in, This represents the total number of pixels in the H channel. For the first H channel value of each pixel, The average value of the H channel pixels. This represents the standard deviation of the H channel pixel values.
[0079] f. HS Two-Dimensional Entropy: The entropy value of the HS two-dimensional histogram is calculated, which reflects the uniformity of the distribution of the HS two-dimensional histogram. The larger the entropy value, the more uniform the distribution of the HS two-dimensional histogram, and the more dispersed the distribution of staining intensity and hue. The smaller the entropy value, the more concentrated the distribution of the HS two-dimensional histogram, the more concentrated the distribution of staining intensity and hue, and the more uniform the expression of HER2.
[0080] Entropy The calculation formula is shown in equation (9): (9); in, The number of bins for the H channel (36). for Number of bins in the channel (64). For the HS two-dimensional histogram, the first Line 1 The pixel probability of a bin (the ratio of the number of pixels in that bin to the total number of pixels in the foreground image).
[0081] ② Ten Refinement Feature Parameters for Cell Membrane Regions: These refinement feature parameters are extracted from the yellow region (cell membrane staining area) and accurately reflect the intensity, integrity, and distribution characteristics of cell membrane staining, further improving the accuracy of grading. These include: a. Yellow Region Pixel Ratio: Consistent with the yellow region pixel ratio in the basic feature parameters, this parameter is extracted separately as a refinement feature for the cell membrane region, used to highlight the proportion of cells stained in the cell membrane. b. Yellow Region H-Channel Median: Calculates the median of all pixel values in the yellow region's H-channel, reflecting the concentration of the cell membrane staining tone. The closer the median is to 0-50, the more uniform the cell membrane staining tone and the better the staining quality. c. Yellow Region H-Channel Entropy: Calculates the entropy value of the yellow region's H-channel histogram, reflecting the uniformity of the pixel distribution in the yellow region's H-channel. The smaller the entropy value, the more concentrated the tone of the yellow region and the more uniform the cell membrane staining; the larger the entropy value, the more dispersed the tone of the yellow region and the less uniform the cell membrane staining. d. First peak height of the H channel in the yellow region: Calculate the height of the first peak (the bin with the highest peak) in the H channel histogram of the yellow region. This reflects the concentration of the main hue in the yellow region. The higher the peak height, the more concentrated the hue in the yellow region, and the more concentrated and uniform the cell membrane staining. e. Skewness of the H channel in the yellow region: Calculate the skewness of all pixel values in the H channel of the yellow region. This reflects the asymmetry of the pixel distribution in the H channel of the yellow region. A positive skewness indicates that the hue in the yellow region is concentrated in the low range (strong staining intensity); a negative skewness indicates that the hue in the yellow region is concentrated in the high range (weak staining intensity). f. Mean value of the S channel in the yellow region: Calculate the mean value of all pixel values in the S channel of the yellow region. This reflects the average intensity of cell membrane staining. The higher the mean value, the stronger the average intensity of cell membrane staining, and the higher the HER2 expression level may be. g. First peak height of the S channel in the yellow region: Calculate the height of the first peak in the S channel histogram of the yellow region. This reflects the concentration of the main intensity of cell membrane staining. The higher the peak height, the more concentrated the intensity of cell membrane staining, and the more uniform the staining. h. First peak position of the S-channel in the yellow region: Calculate the S-channel value corresponding to the first peak of the S-channel histogram in the yellow region. This reflects the main intensity of cell membrane staining. The higher the peak position, the stronger the cell membrane staining intensity and the higher the HER2 expression level. This parameter is one of the core parameters for control validation. i. Kurtosis of the V-channel in the yellow region: Calculate the kurtosis of all pixel values in the V-channel of the yellow region. This reflects the steepness of the pixel distribution in the V-channel of the yellow region. The larger the kurtosis, the more uniform the brightness of the yellow region, the better the staining quality, and the less influence of light changes on staining intensity discrimination.j. Homogeneity of the Yellow Region in HS Two-Dimensional Histogram: The homogeneity of the yellow region in HS two-dimensional histogram is calculated to reflect the degree of concentration of the distribution of the HS two-dimensional histogram. The greater the homogeneity, the more concentrated the hue and saturation distribution of the yellow region, and the more uniform and complete the cell membrane staining. The smaller the homogeneity, the more dispersed the hue and saturation distribution of the yellow region, and the less uniform and complete the cell membrane staining.
[0082] homogeneity The calculation formula is shown in equation (10): (10); in, The number of bins for the H channel (36). for Number of bins in the channel (64). For the HS two-dimensional histogram, the first Line 1 The pixel probability of a column bin (the ratio of the number of pixels in that bin to the total number of pixels in the foreground image). ③ Supplementary feature parameters for one nucleus region: Supplementary feature parameters for the nucleus region are extracted from the blue nucleus region. The HSV range of the blue nucleus region is H∈[90,160], S∈[30,255], and V∈[0,255]. This parameter is used to assist in identifying the integrity and density of tumor cells and avoid grading bias caused by tumor cell necrosis and fragmentation. Specifically: Kurtosis of the H channel in the blue region: The kurtosis of all pixel values in the H channel of the blue nucleus region is calculated to reflect the steepness of the pixel distribution of the H channel in the blue region. The larger the kurtosis, the more concentrated the hue distribution of the nucleus, and the better the integrity and density of the tumor cells. The smaller the kurtosis, the more dispersed the hue distribution of the nucleus, and the tumor cells may be necrotic and fragmented. It is necessary to combine other feature parameters to comprehensively judge the HER2 expression level.
[0083] The specific process of feature extraction is as follows: (1) Read the preprocessed foreground image and extract the H, S and V channels of the HSV color space.
[0084] (2) Based on the HSV range of the yellow region and the blue nucleus region, extract the images of the yellow region and the blue nucleus region respectively.
[0085] (3) Calculate the one-dimensional histograms of the three channels H, S, and V, and the two-dimensional histogram of HS.
[0086] (4) Based on the above definitions and calculation formulas, calculate 6 basic feature parameters, 10 cell membrane region refinement feature parameters and 1 cell nucleus region supplementary feature parameter in sequence to construct a 17-dimensional feature parameter vector.
[0087] (5) Normalize the 17-dimensional feature parameter vector to normalize the value range of all feature parameters to the range of 0-1, so as to avoid the difference in the dimensions of different feature parameters from affecting the accuracy of subsequent Euclidean distance calculation and grade judgment. The normalization formula is shown in Equation (11): (11); in, These are the original feature parameter values. This is the minimum value of this feature parameter among all control images. This is the maximum value of this feature parameter across all control images. These are the normalized feature parameter values.
[0088] (6) The extracted one-dimensional histogram features of the HSV channel, the two-dimensional histogram features of the HS channel, and the normalized 17-dimensional feature parameter vector are associated with the corresponding image information (sample number, reference grade / sample number to be tested) and stored for subsequent reference verification and grade discrimination.
[0089] S5, Reference Standard Verification, includes: verifying the characteristic parameters of reference standards of each grade in tissue microarrays, verifying the accuracy of reference standard grade labeling and the qualification of staining quality, ensuring that reference standards can serve as reliable reference standards for judging the grade of samples to be tested; if the reference standard verification fails, it prompts to re-stain the sample and acquire images, avoiding misjudgment of grading due to unqualified reference standards, and realizing full-process quality control.
[0090] The core basis for the verification of reference standards is that there are significant differences in the first peak position of the S-channel in the yellow area and the pixel ratio of the yellow area in different grades of reference standards. Moreover, this difference is stable and distinguishable. After extensive experimental verification, a two-level progressive discrimination logic can be constructed through these two core parameters to achieve rapid and accurate verification of the grade of reference standards.
[0091] As a preferred embodiment, the specific process for verifying the reference standard in step S5 is as follows: S51: Read the feature parameters of each grade of control samples stored in the feature extraction module, and focus on extracting two core parameters for each control sample: the first peak position of the yellow S channel and the percentage of pixels in the yellow area.
[0092] S52. Each level of control sample is individually verified using a two-level progressive discrimination logic to determine whether the actual level of the control sample matches the labeled level. The specific discrimination logic is as follows: The first step is preliminary grade determination (3+ grade verification): If the first peak position of the S channel in the yellow area of the control sample is >80, it indicates that its cell membrane staining intensity is strong and is determined to be grade 3+; if the labeled grade of the control sample is grade 3+, the preliminary verification is qualified; if the labeled grade is not grade 3+, the preliminary verification is unqualified.
[0093] The second step is to determine the remaining grade (Grade 0, Grade 1+, and Grade 2+ verification): If the first peak position of the S channel in the yellow area of the control sample is ≤80, the grade is further determined based on the pixel ratio of the yellow area. The specific classification criteria are as follows: ① If the pixel ratio of the yellow area is <0.008, it indicates that the proportion of cells stained on the cell membrane is extremely low and the staining intensity is weak, and it is classified as Grade 0; if the grade is marked as Grade 0, the preliminary verification is qualified; otherwise, the preliminary verification is unqualified. ② If the pixel ratio of the yellow area is between 0.008 and 0.141 (inclusive of 0.008, exclusive of 0.141), it indicates that the proportion of cells stained on the cell membrane is low and the staining intensity is weak, and it is classified as Grade 1+; if the grade is marked as Grade 1+, the preliminary verification is qualified; otherwise, the preliminary verification is unqualified. ③ If the pixel ratio of the yellow area is ≥0.141, it indicates that the proportion of cells stained on the cell membrane is high and the staining intensity is strong, and it is classified as Grade 2+; if the grade is marked as Grade 2+, the preliminary verification is qualified; otherwise, the preliminary verification is unqualified.
[0094] S53, Repeat step S52 to complete the preliminary verification of all reference samples, and calculate the verification pass rate of each grade of reference (the ratio of the number of qualified samples to the total number of samples in that grade).
[0095] S54, Overall verification of reference materials: Set a verification pass threshold of 90% (which can be adjusted according to the implementation scenario, see the specific implementation method for details). That is, if the verification pass rate of each level of reference material is ≥90% and all levels of reference materials have qualified samples, then the overall verification of the reference materials is deemed to be qualified; otherwise, the overall verification of the reference materials is deemed to be unqualified.
[0096] S55, Process the verification results: ① If the overall verification of the reference standard is qualified, a reference standard verification report is generated, which clarifies the verification status of each grade of reference standard (number of qualified samples, number of unqualified samples, and pass rate). The mean of the 17-dimensional feature parameter vector of each grade of reference standard is used as the standard feature parameter vector of that grade, and a standard feature parameter vector library is constructed for subsequent grade determination of the samples to be tested.
[0097] The standard feature parameter vector library is constructed as follows: For each level (level 0, level 1+, level 2+, level 3+), the mean of the 17-dimensional feature parameter vectors of all qualified control samples at that level is calculated to obtain the standard feature parameter vector for that level. ( =0,1,2,3 correspond to level 0, level 1+, level 2+, and level 3+, respectively. Each component is the mean of the characteristic parameters corresponding to all qualified samples of that level, and the calculation formula is shown in equation (12): (12); in, The reference grades are (0, 1, 2, 3). Index of feature parameter dimensions (1≤ ≤17), This represents the number of control samples that passed the calibration for this level. For level No. The first of the qualified samples Each feature parameter value, For the first The first standard grade sample The values of each feature parameter.
[0098] ② If the overall verification of the reference standard fails, a verification failure prompt will be generated, specifying the reason for the failure (such as the verification pass rate of a certain grade of reference standard being too low, or the actual grade of a certain sample not matching the labeled grade, etc.), and prompting the user to re-perform sample synchronous staining, image acquisition, image preprocessing, and feature extraction until the reference standard verification passes.
[0099] S6, Determination of the grade of the sample to be tested, including: after the reference standard is verified to be qualified, based on the 17-dimensional feature parameter vector of the sample to be tested extracted by the feature extraction module, combined with the standard feature parameter vector library constructed by the reference standard verification module, the Euclidean distance is calculated to achieve objective and quantitative determination of the HER2 grade of the sample to be tested, ensuring the accuracy and consistency of the grading.
[0100] The core principle of grading is that the closer the HER2 expression level of the sample to be tested is to a certain grade of the standard control, the smaller the Euclidean distance between its 17-dimensional feature parameter vector and the feature parameter vector of that grade. Therefore, the Euclidean distance between the feature parameter vector of the sample to be tested and the feature parameter vectors of the four grades is calculated, and the grade corresponding to the standard control with the smallest distance is determined as the HER2 grade of the sample to be tested.
[0101] In a preferred embodiment, the specific process for determining the grade of the sample to be inspected in step S6 includes: S61, Read the standard feature parameter vector library constructed by the reference standard verification module, and obtain the standard feature parameter vectors of level 0, level 1+, level 2+, and level 3+. , , , .
[0102] S62, read the 17-dimensional feature parameter vector X (normalized) of the sample to be tested stored in the feature extraction module. If multiple images were collected for the sample to be tested, calculate the 17-dimensional feature parameter vector of each image, and then take the mean of all vectors as the final feature parameter vector X of the sample to be tested to ensure the representativeness of the feature parameters.
[0103] S63, Calculate the feature parameter vector X of the sample to be tested and the standard feature parameter vector of each level. ( Euclidean distance from (=0,1,2,3) The formula for calculating the Euclidean distance is shown in equation (13): (13); in, Dimension index of the feature parameter vector (1≤ ≤17), For the sample to be tested The values of each feature parameter, For the first The first standard grade sample The values of each feature parameter, For the sample to be tested and the first The Euclidean distance between standard grade samples indicates that the smaller the distance value, the more similar the color features of the two samples are, and the higher the consistency of the corresponding grades.
[0104] Example 2 like Figure 2As shown, this embodiment provides an IHC pathological grading system based on HER2 tissue microarrays for implementing the method described in Embodiment 1 above. The system includes multiple modules interconnected and working collaboratively to automate and standardize the entire HER2 IHC pathological grading process. These modules include: a tissue microarray synchronous staining module 101 for constructing and synchronously staining tissue microarrays; an image acquisition module 102 for image acquisition, including acquiring images of tumor regions of synchronously stained tissue microarray control samples and test samples using an optical microscope to form a standardized image dataset, providing a foundation for subsequent image preprocessing, feature extraction, and grade determination of test samples; an image preprocessing module 103 for image preprocessing, including performing a series of optimization processes on the acquired images to remove noise, background interference, and redundant information, obtaining noise-free, background-free, and clearly structured foreground images, providing high-quality image data for subsequent feature extraction and grade determination, and improving grading accuracy; and a feature extraction module 104 for feature extraction, including extracting multi-dimensional features reflecting HER2 protein expression characteristics from the foreground images obtained by the image preprocessing module. The parameters, including one-dimensional histogram features of the HSV channel, two-dimensional histogram features of the HS channel, and a 17-dimensional feature parameter vector, provide a quantitative basis for subsequent reference standard verification and grade determination of the sample to be tested. The reference standard verification module 105 is used to verify the reference standards, including: verifying the feature parameters of reference standards of each grade in the tissue microarray, verifying the accuracy of the reference standard grade labeling and the qualification of the staining quality, and ensuring that the reference standards can serve as a reliable reference standard for grade determination of the sample to be tested; if the reference standard verification fails, it prompts the sample staining and image acquisition to be repeated, avoiding misjudgment of the grade due to the failure of the reference standard, and realizing full-process quality control; the grade determination module 106 is used to determine the grade of the sample to be tested, including: after the reference standard verification is qualified, based on the 17-dimensional feature parameter vector of the sample to be tested extracted by the feature extraction module, combined with the standard feature parameter vector library constructed by the reference standard verification module, the Euclidean distance is calculated to achieve objective and quantitative determination of the HER2 grade of the sample to be tested, ensuring the accuracy and consistency of the grade.
[0105] Application examples: A standard control staining image library based on four levels of HER2 protein expression (0, 1+, 2+, 3+) was established for end-to-end experimental quality control. Image features were extracted using image recognition technology and combined with HER2 protein staining degree detection to determine the suitability of the control staining. After the control staining was deemed satisfactory, the features of the staining images of the samples to be tested were extracted and compared with the features of the standard control images at each level. By matching the most similar control image, the HER2 protein expression level of the sample to be tested was determined. (See diagram below.) Figure 3 As shown.
[0106] (a) HER2 grading criteria HER2 expression was classified using a grading system from 0 to 3+ based on the intensity and extent of cell membrane staining. Grading system: Grade 0: No staining or ≤10% of invasive cancer cells showing incomplete, weak cell membrane staining. Grade 1+: >10% of invasive cancer cells showing incomplete, weak cell membrane staining. Grade 2+: >10% of invasive cancer cells showing weak to moderate intensity, intact cell membrane staining, or ≤10% of invasive cancer cells showing strong, intact cell membrane staining; if uncertain, FISH testing is performed next. A positive FISH test is considered positive; a negative FISH test is considered negative. Grade 3+: >10% of invasive cancer cells showing strong, intact, and uniform cell membrane staining.
[0107] In this example, to more clearly demonstrate the core parameters and discrimination criteria for reference standard verification, Table 1 below is a table of criteria for classifying the core parameters for reference standard verification.
[0108] Table 1
[0109] The parameter classification criteria in Table 1 have been determined through extensive experimental optimization and can be fine-tuned according to the staining reagents, microscope parameters, etc. in the specific implementation scenario, with the fine-tuning range not exceeding ±10%.
[0110] (ii) Source of images for staining grades Simultaneous experiments were conducted using HER2 pathological immunohistochemical tissue microarrays produced by Puenrui Biotechnology Co., Ltd., and images of the tumor region were obtained using an optical microscope. HER2 expression was grade 0 in Group 1, 1+ in Group 2, 2+ in Group 3, and 3+ in Group 4.
[0111] This experiment employed simultaneous staining of tissue microarrays and test samples. The procedure followed standardized immunohistochemical protocols, including key steps such as dewaxing and hydration, antigen retrieval, primary antibody incubation, and DAB staining. All samples were observed under an optical microscope, and images of the tumor region were acquired. The experimental environment was consistent across all five stained slides in each group, ensuring comparability and accuracy of the results. Tumor region staining images are shown below. Figure 4 As shown.
[0112] The HER2 control samples used were all derived from HER2 amplification tissue samples of the corresponding grade. This source design maximizes the homology of the control samples in terms of cell genotype, tissue morphology, and antigen expression, effectively eliminating the interference of heterogeneity in different tissues on staining characteristics and providing a stable material basis for accurate differentiation of grade differences. Although the staining intensity of the control samples may vary between different groups due to experimental conditions such as batch of staining reagents, antigen retrieval time, and incubation temperature, four standardized staining gradients were strictly constructed for each group of experiments. The cell membrane staining characteristics of each gradient have clear distinguishability: Grade 0 control shows no brownish-yellow staining on the cell membrane; Grade 1+ (weakly positive) control shows light brownish-yellow, discontinuous staining on the cell membrane; Grade 2+ (moderately positive) control shows medium brownish-yellow, continuous but uneven staining on the cell membrane; and Grade 3+ (strongly positive) control shows dark brownish-yellow, continuous and uniform staining on the cell membrane. Since the staining intensity and hue characteristics of the cell membrane corresponding to the HER2 expression of the test sample are highly consistent with the staining performance of the corresponding grade control in the same group experiment, the cell membrane staining gradient formed by each grade control on the tissue chip can be used as an intuitive and quantitative reference standard. By comparing the matching degree of the staining gradient between the test sample and the control, the HER2 grade of the test sample can be accurately determined. This determination method can effectively offset the influence of staining differences between groups and improve the objectivity and reproducibility of grade determination.
[0113] (III) Gaussian Denoising Before feature extraction from HER2 control and test sample images, Gaussian filtering preprocessing is performed on the acquired images to ensure the accuracy of subsequent color feature parameter calculations. This preprocessing step uses a 3×3 Gaussian convolution kernel for Gaussian blurring. The core principle is to use a Gaussian function to perform a weighted average of the image pixel values, ensuring that each pixel value is smoothly transitioned by its neighboring pixel values, thereby effectively suppressing random noise introduced during image acquisition due to factors such as equipment noise and illumination fluctuations. Compared to other filtering methods, the 3×3 Gaussian kernel can retain the edge features and color gradient information of cell membrane staining to the greatest extent while removing noise, avoiding the loss of staining details caused by excessive blurring—this is crucial for distinguishing subtle staining differences between weakly positive and moderately positive samples such as HER2 grade 1+ and 2+. After this Gaussian filtering, the color boundary between the yellow positive area and the background area in the image is clearer, and the pixel value distribution of each HSV channel is more stable, which can significantly reduce the interference of noise on the calculation of image statistical parameters, providing a more reliable image data foundation for subsequent grade discrimination based on staining gradient.
[0114] (iv) Color space conversion In the field of image color feature analysis, the RGB color space, as a color model based on the additive mixing principle of three primary colors, is widely used in image acquisition and display devices. It represents color information through the numerical combination of three independent channels: red (R), green (G), and blue (B), with each channel typically ranging from 0 to 255 (for 8-bit images). However, the RGB color space has an inherent drawback of strong channel correlation; changes in brightness will simultaneously affect the numerical performance of the three channels. Furthermore, its numerical combination does not directly correspond to the human visual perception of color "type, vividness, and brightness," making it difficult to efficiently extract core features in scenarios such as color distribution difference analysis. Therefore, it is necessary to convert it to the HSV color space, which is more closely aligned with visual perception.
[0115] The HSV color space is a non-linear color model oriented towards visual perception. It describes color characteristics through three independent parameters: hue (H), saturation (S), and lightness (V). The physical meaning of each parameter is clear and they are decoupled from each other, providing convenient conditions for color distribution analysis. Hue (H) is used to distinguish the types of colors, corresponding to an angle range of 0-360° on the color wheel. In engineering implementations (such as the OpenCV framework), to adapt to 8-bit data storage, it is compressed into an integer range of 0-179. Different values correspond to specific colors; for example, near 0 is red, near 60 is yellow, and near 120 is green. Saturation (S) characterizes the vividness of a color, with a value range of 0-255. The higher the value, the purer the color; the lower the value, the closer the color is to gray. Lightness (V) reflects the brightness of a color, also with a value range of 0-255. The higher the value, the brighter the color; a value of 0 represents pure black.
[0116] The RGB to HSV conversion process is a nonlinear calculation process that maps the three-dimensional RGB numerical space to the three-dimensional HSV numerical space. The core steps include numerical normalization and parameter derivation. Specifically, firstly, the original values (0-255) of the three RGB channels are divided by 255 to normalize them to a floating-point range of 0-1. Then, the maximum value (denoted as V_raw), minimum value (denoted as min_val), and difference between the normalized R, G, and B values are calculated. The brightness (V) parameter is directly mapped from V_raw and converted to an integer range of 0-255 by multiplying by 255. The saturation (S) parameter is calculated differently depending on the case: when V_raw is 0 (i.e., the image is pure black), S is 0; otherwise, it is calculated by (delta / V_raw) × 255, ensuring it falls within the 0-255 range. The hue (H) parameter is derived based on the channel type corresponding to the maximum value. If delta is 0 (i.e., the image is gray or black and white), H is 0; if the maximum value is R, H = 60 × ((GB) / delta % 6); if the maximum value is G, H = 60 × ((BR) / delta + 6). 2) If the maximum value is B, then H = 60 × ((RG) / delta + 4). Finally, the calculated angle value is compressed into integers from 0 to 179 at a ratio of 1:0.5 to complete the entire conversion process.
[0117] (v) Background removal and noise reduction After Gaussian filtering, the foreground and background need to be separated through a standardized background removal process, and the mask quality is optimized by combining morphological operations and small region filtering. The specific steps are as follows: First, a background removal function is constructed to realize the process flow. The input is the Gaussian-filtered HSV image (hsv_img). The core operations revolve around mask generation, morphological optimization and foreground extraction.
[0118] The first step is to generate the background and foreground masks. Through statistical analysis of a large number of tissue microarray samples, the HSV threshold range for the background region is calibrated: the lower limit `lower_bg` is set to [100, 0, 106] (corresponding to the background tone range of H channel 100-179, S channel 0-55, and V channel 106-255), and the upper limit `upper_bg` is set to [179, 55, 255]. Based on this threshold range, an image thresholding algorithm (such as OpenCV's `inRange` function) is used to process the HSV image to generate a background mask (`bg_mask`). Regions in the mask that conform to the background HSV range are marked as 255 (white), and non-background regions are marked as 0 (black). Subsequently, a bitwise NOT operation is performed on the background mask to obtain the foreground mask (`fg_mask`). At this point, the foreground region (tumor tissue) is marked as 255, and the background region is marked as 0, achieving initial separation of the foreground and background.
[0119] The second step involves morphological operations to optimize the foreground mask. First, an opening operation is performed to remove small noise points: a 5x5 rectangular kernel is constructed. Then, an erosion operation is used to shrink the edges of the foreground mask, absorbing isolated noise points (such as pixel clusters corresponding to staining debris) with an area smaller than the kernel. Next, a dilation operation is performed to restore the original shape of the main foreground region, preventing foreground features from shrinking. To fill the tiny voids inside the foreground region caused by uneven staining (such as pores caused by cell membrane staining gaps), a closing operation is performed on the mask—first dilating and then eroding with the same kernel to fill the small voids inside the foreground region, improving mask integrity.
[0120] The third step involves small-region filtering and foreground extraction. Valid regions in the foreground mask are filtered by region area statistics. Connected regions with an area less than 100 pixels are identified as noise and removed (implemented using a custom `filter_small_regions` function), further optimizing mask accuracy. Finally, a bitwise AND operation is performed between the optimized foreground mask and the original HSV image, retaining only the foreground region pixels marked as 255 in the mask, resulting in the background-removed foreground HSV image (`hsv_no_bg`). This function ultimately returns the processed foreground HSV image and the optimized foreground mask, providing high-quality image data free from background interference and noise pollution for subsequent feature extraction of the yellow positive regions.
[0121] (vi) One-dimensional histogram analysis of HSV channels The HSV channel one-dimensional histogram is a core tool for statistically analyzing the pixel value distribution characteristics of individual channels (H, S, V) in the HSV color space. Essentially, it constructs a "pixel value - frequency" correspondence model by statistically analyzing the frequency of occurrence of each pixel value within a channel, providing a quantitative basis for analyzing color distribution differences between different images. The horizontal axis of the one-dimensional histogram represents the range of pixel values for the corresponding channel, and the vertical axis represents the frequency of that pixel value in the image (to eliminate image size differences, the frequency is usually normalized to the range of 0-1). Its statistical results can be presented in the form of data sequences or visual curves, intuitively reflecting the distribution patterns of pixel values within a channel.
[0122] Based on the different physical meanings of the three HSV channels, their corresponding one-dimensional histograms each possess unique characteristics and analytical value. The horizontal axis of the H channel one-dimensional histogram ranges from 0 to 179. Its peak position directly corresponds to the dominant color tone in the image, while the number and width of the peaks reflect the richness of color variety in the image—a single peak with a sharp peak indicates a single color tone, while a multi-peak distribution indicates that the image contains multiple dominant color tones. The horizontal axis of the S channel one-dimensional histogram ranges from 0 to 255. When the peak is located in the high value region (e.g., 200-255), it indicates that the overall image color is vibrant and highly saturated; when the peak is located in the low value region (e.g., 0-50), it indicates that the image color is grayish and has low saturation. The horizontal axis of the V channel one-dimensional histogram ranges from 0 to 255. The distribution of the peaks directly reflects the overall brightness characteristics of the image. Peaks concentrated in the high value region (e.g., 200-255) represent an overall bright image, while peaks concentrated in the low value region (e.g., 0-100) represent an overall dark image.
[0123] By comparing the one-dimensional histograms of different images across the H, S, and V channels, precise quantification of color distribution differences can be achieved. Specifically, if the peak positions of the H channel histograms of two images have a high degree of overlap and similar peak shapes, it indicates that the difference in their dominant color tones is small; if the peak positions and distribution ranges of the S channel histograms differ significantly, it indicates a significant difference in color vibrancy characteristics; and the degree of overlap in the V channel histograms directly reflects the consistency of brightness distribution between the two images. This difference analysis method based on HSV channel one-dimensional histograms, with its targeted feature extraction and intuitive difference representation, has significant application value in image retrieval, target recognition, and quality detection technologies. Figure 5 , Figure 6 Multiple one-dimensional histograms are provided for control level 0 and control level 1+, respectively. Figure 7 , Figure 8 These are multiple sets of one-dimensional histograms for control levels 2+ and 3+, respectively. Figure 9 The image shows a comparison of multiple sets of one-dimensional histograms of the samples to be tested.
[0124] This analytical method focuses on color feature recognition of HER2 (human epidermal growth factor receptor 2) tumor region images at four levels (0, 1+, 2+, and 3+). The core process is as follows: RGB-HSV color space conversion is performed on images of each level to construct a one-dimensional histogram with H, S, and V channels. After statistical analysis and cross-validation of multiple samples, it is confirmed that there are statistically significant feature differences among the four levels in the three-channel histogram. These differences can serve as a quantitative auxiliary basis for tumor grading.
[0125] The differences in the H-channel (hue) histogram are directly related to the staining characteristics of positive signals. In HER2 immunohistochemical staining, the HSV range of the core hue is clearly defined: positive staining of the cell membrane is brownish-yellow (H value 20-40), the stained area is reddish (H value 165-179), and the cell nucleus is blue (H value 100-130). The characteristics of each grade are significantly different: in grade 3+ tumor areas, due to the dense and uniform positive staining of the cell membrane, the H-channel histogram forms a sharp, high-amplitude single peak in the brownish-yellow hue range of 20-40, while the blue hue of the cell nucleus only shows a weak small peak; the H-channel histogram morphology of grade 2+ is similar to that of grade 3+, but the amplitude of the brownish-yellow peak is significantly reduced; the brownish-yellow peak of grade 1+ is further attenuated, and the blue peak of the cell nucleus at 100-130 becomes the main peak; grade 0 has no obvious brownish-yellow peak, and only forms a clear dominant peak in the blue hue range of the cell nucleus.
[0126] The histogram differences in the S channel (saturation) mainly reflect the distinction between the vividness of cell membrane and cell nucleus staining, with clear boundaries for each grade: Grade 3+ has a wide saturation coverage (0-255), forming a high-amplitude main peak in the 100-150 range, reflecting the high purity of positive staining; Grade 2+ has a narrow saturation coverage range of 0-150, with the main peak shifting to around 50, and the overall saturation is lower than Grade 3+; Grade 1+ exhibits a typical bimodal distribution due to the difference in saturation between weak positive cell membrane staining and cell nucleus staining, with relatively balanced amplitudes of the two peaks; Grade 0 also has a bimodal structure, but the amplitude of the first peak in the corresponding cell membrane region is significantly smaller, with only the second peak of cell nucleus staining being dominant.
[0127] The differences in the histograms of the V channel (brightness) were relatively insignificant, with the brightness range of each level concentrated between 50 and 255. The core differences were reflected in the peak shape characteristics: the brightness histogram of level 3+ showed a slightly wider single peak due to the deep staining of the cell membrane and the uniform cell density; the brightness histograms of levels 2+, 1+, and 0 showed a narrower single peak and did not form characteristic differences with graded direction.
[0128] In summary, HER2 grade and HSV channel characteristics show a clear correlation: as the grade increases from 0 to 3, the brownish-yellow peak of the H channel gradually becomes sharper and its proportion increases; the saturation distribution range and main peak position of the S channel change gradient; and the V channel shows no significant grade difference. Based on this, constructing a two-dimensional histogram of HER2 can further amplify the characteristic differences—by simultaneously capturing the joint distribution of hue and saturation, the brownish-yellow positive area of the cell membrane and the blue area of the cell nucleus will form characteristic clusters: grade 3+ will show a core cluster of brownish-yellow high saturation with a clear focus; grade 0 will mainly have blue-toned low-saturation clusters; and the two types of clusters in grades 1+ and 2+ will show a transitional distribution, providing a more intuitive visual basis for tumor grading.
[0129] (vii) Two-dimensional histogram analysis In the HSV color space, the combination of hue (H) and saturation (S) directly corresponds to the core attribute of "type-vividness" of colors in an image. The HS two-dimensional histogram constructs a two-dimensional mapping model of "color feature-pixel density" by statistically analyzing the joint distribution frequency of pixel values in the H channel (horizontal axis, 0-179) and the S channel (vertical axis, 0-255). This model can accurately capture the color difference between positive signals and background tissue in HER2 tumor immunohistochemical staining. Tumor region images of four grades (grade 0, 1+, 2+, 3+) exhibit focal distribution and clustering characteristics with clear hierarchical directionality on the HS two-dimensional histogram, such as... Figure 10 As shown, the location, density, boundary clarity, and quantity of clustered regions constitute the core basis for hierarchical differentiation.
[0130] When visualizing the staining characteristics of HER2 pathological sections using a two-dimensional histogram (HS), the four grades of HER2 within the same group—0, 1+, 2+, and 3+—exhibited significant separability: grade 3+ showed a core cluster with high saturation of brownish-yellow hues and clear feature focal points; grade 0 was characterized by low-saturation blue clusters; and the clustering distribution of grades 1+ and 2+ showed a transitional pattern. This visualization result can provide an intuitive basis for tumor HER2 grading. Specifically, HER2 grade 3+ formed clusters in the H-axis [0,30] and S-axis [10,180] ranges, exhibiting a tailing feature after the S-axis value of 180, and feature focal points near H-axis 15 and S-axis 100. HER2+ formed clusters in the H-axis [0,30] and S-axis [10,70] intervals, exhibiting a tailing feature in the S-axis [70,100] interval, with feature focal points near H-axis 15 and S-axis 40. HER21+ formed clusters in the H-axis [0,20] and S-axis [10,50] intervals, exhibiting a tailing feature in the S-axis [40,50] interval, with feature focal points near H-axis 10 and S-axis 30. HER20 formed clusters in the H-axis [110,135] and S-axis [50,100] intervals, exhibiting a tailing feature in the S-axis [100,135] interval, with feature focal points near H-axis 125 and S-axis 80. Furthermore, the HS two-dimensional histograms of the tested samples within the group were consistent with the HS two-dimensional histograms of the corresponding HER2 grades within the group, verifying the consistency of staining characteristics for the same HER2 grade under the same staining environment.
[0131] (viii) Separation of cell nucleus and cell membrane After obtaining a clean foreground image with background removed, the color range of the cell core structure needs to be precisely defined to achieve targeted extraction. The core targets are the yellow cell membrane region carrying the HER2 expression signal and the blue cell nucleus region used for cell localization. The HSV range of both types of regions is determined based on the HER2 immunohistochemical staining characteristics and statistical calibration of a large number of samples. The HSV range for the yellow cell membrane region is defined as follows: H channel 0-50 (covering the full spectrum of positive staining hues from dark brownish-yellow to light yellow), S channel 30-255 (filtering out low-saturation, blurry backgrounds and retaining only cell membrane regions with clear staining signals), and V channel 0-255 (accommodating differences in staining depth at different positive grades to avoid missing weakly positive areas). The HSV range for the blue cell nucleus region is defined as follows: H channel 90-160 (matching the blue-green to dark blue hues presented by cell nucleus-specific staining agents, providing a clear distinction from the yellow cell membrane), S channel 30-255 (eliminating low-saturation pseudonucleus regions to ensure accurate cell nucleus localization), and V channel 0-255 (adapting to lighting fluctuations during image acquisition to ensure effective identification of cell nuclei under different brightness levels). Through these clearly defined color ranges, precise segmentation and independent extraction of the two core structures can be achieved, providing targeted region data for subsequent analysis to quantify cell membrane HER2 expression characteristics and assist in cell nucleus localization.
[0132] 1. Extraction of the cell nucleus region from Figure 11 Analysis of the extracted cell nucleus images shows that the nuclear staining characteristics of the four HER2 grades differ among groups, but the differences between grades 2+ and 3+ are not significant in some groups. Cell nuclei are present in all sample images, and the difference in their quantity cannot directly reflect the HER2 grade level. However, the saturation and brightness of the nuclear staining show corresponding differences depending on the HER2 grade. In summary, cell nucleus images can provide some reference for HER2 grading, but the significance of this reference is low.
[0133] 2. Extraction of cell membrane region according to Figure 12Analysis of the extracted cell membrane images shows that the four grades of cell membrane staining regions are significantly distinguishable, and this staining grade is closely correlated with the HER2 expression grade, fully conforming to the HER2 clinical grading criteria. To ensure the accuracy of grade classification for the samples to be tested, the control grade images in the tissue microarray need to be rigorously verified to ensure the accurate labeling of the HER2 grade in the control samples. Statistical analysis was used to extract features from 261 sample images of different HER2 grades. The system screened and identified the specific image features corresponding to the four HER2 grades. Based on this feature system, automated HER2 grade detection of tissue microarray samples was achieved, thereby significantly improving the accuracy and reliability of grade classification for the samples to be tested.
[0134] (ix) Verification of reference material grade images The verification process requires extracting two core feature parameters from the yellow area in the control sample grade image: the position of the first peak of the S-channel in the yellow area and the pixel proportion of the yellow area. The first peak of the S-channel in the yellow area: the S value corresponding to the highest peak in the one-dimensional histogram of the S-channel in the yellow area (range 0-255). This parameter directly reflects the core saturation level of the positive signal. Grade 3+ strong positive signals, due to their vibrant staining, have a significantly higher peak position than other grades. Pixel proportion of the yellow area: the ratio of the number of pixels with H values in the 0-50 range within the yellow area to the number of pixels after removing the background (range 0-1). The control samples are from the same tissue source, and the expression at each grade is relatively stable, with cell membrane staining showing a gradient.
[0135] The steps for verifying the grade of the reference image include: The verification of the grade of the reference image is achieved through "two-level progressive discrimination". First, strong positive (3+ level) is quickly identified by saturation features. Then, other levels are distinguished by hue proportion. The specific discrimination logic and operation steps are as follows: Step 1: Rapid discrimination of 3+ level: Extract the parameter of "first peak position of S channel in yellow area" in the reference image. If the value of this parameter is >80, combined with the high saturation feature of the 3+ level positive signal, the standard grade of the reference image is 3+ level. If the value of this parameter is ≤80, proceed to the second step of refined discrimination to exclude the possibility of 3+ level. Step 2: Non-3+ Grade Classification: For the control images classified as non-3+ in Step 1, the "Yellow H0-50 Region Pixel Ratio" parameter is extracted. The classification level is determined based on the value range of this parameter: When the H0-50 region pixel ratio is <0.008, it indicates an extremely low proportion of positive characteristic hues in the yellow area, matching the characteristics of Grade 0 (negative) with no clear positive signal, and is classified as Grade 0; when the H0-50 region pixel ratio is between 0.008 and 0.141 (inclusive of boundary values), it indicates the presence of a small amount of weak positive characteristic hues in the yellow area, matching the staining characteristics of Grade 1+ (weak positive), and is classified as Grade 1+; when the H0-50 region pixel ratio is >0.141, it indicates a moderate proportion of positive characteristic hues in the yellow area, matching the staining characteristics of Grade 2+ (moderate positive), and is classified as Grade 2+. Step 3: After verifying and calibrating the results, subsequent images to be tested are classified.
[0136] Table 2 shows the statistical information of the two parameters in 261 images.
[0137] Table 2 sample1 0 34.37 0.002 sample132 2+ 36.36 0.235 sample2 0 33.37 0.003 sample133 2+ 50.30 0.360 sample3 0 38.35 0.000 sample134 2+ 36.36 0.188 sample4 0 31.38 0.001 sample135 2+ 35.36 0.233 sample5 0 31.38 0.006 sample136 2+ 33.37 0.218 sample6 0 32.37 0.001 sample137 2+ 35.36 0.195 sample7 0 33.37 0.002 sample138 2+ 50.30 0.390 sample8 0 31.38 0.002 sample139 2+ 42.33 0.329 sample9 0 31.38 0.002 sample140 2+ 42.33 0.305 sample10 0 33.37 0.002 sample141 2+ 38.35 0.316 sample11 0 33.37 0.003 sample142 2+ 32.37 0.214 sample12 0 33.37 0.003 sample143 2+ 36.36 0.142 sample13 0 32.37 0.001 sample144 2+ 36.36 0.266 sample14 0 34.37 0.001 sample145 2+ 50.30 0.339 sample15 0 32.37 0.000 sample146 2+ 50.30 0.355 sample16 0 36.36 0.002 sample147 2+ 36.36 0.257 sample17 0 33.37 0.001 sample148 2+ 36.36 0.293 sample18 0 32.37 0.004 sample149 2+ 32.37 0.086 sample19 0 32.37 0.002 sample150 2+ 32.37 0.152 sample20 0 30.38 0.002 sample151 2+ 50.30 0.324 sample21 0 32.37 0.001 sample152 2+ 42.33 0.294 sample22 0 32.37 0.001 sample153 2+ 50.30 0.400 sample23 0 34.37 0.000 sample154 2+ 42.33 0.282 sample24 0 33.37 0.002 sample155 2+ 50.30 0.340 sample25 0 31.38 0.002 sample156 2+ 38.35 0.348 sample26 0 30.38 0.002 sample157 2+ 38.35 0.334 sample27 0 34.37 0.001 sample158 2+ 50.30 0.408 sample28 0 32.37 0.002 sample159 2+ 50.30 0.301 sample29 0 32.37 0.001 sample160 2+ 32.37 0.211 sample30 0 32.37 0.001 sample161 2+ 35.36 0.297 sample31 0 31.38 0.001 sample162 2+ 35.36 0.294 sample32 0 32.37 0.002 sample163 2+ 33.37 0.243 sample33 0 30.38 0.002 sample164 2+ 38.35 0.243 sample34 0 30.38 0.002 sample165 2+ 50.30 0.382 sample35 0 30.38 0.004 sample166 2+ 38.35 0.299 sample36 0 30.38 0.000 sample167 2+ 50.30 0.272 sample37 0 31.38 0.001 sample168 2+ 36.36 0.252 sample38 0 32.37 0.001 sample169 2+ 42.33 0.273 sample39 0 33.37 0.002 sample170 2+ 50.30 0.263 sample40 0 33.37 0.002 sample171 2+ 38.35 0.325 sample41 0 34.37 0.000 sample172 2+ 50.30 0.353 sample42 0 30.38 0.001 sample173 2+ 50.30 0.312 sample43 0 33.37 0.002 sample174 2+ 33.37 0.217 sample44 0 33.37 0.001 sample175 2+ 50.30 0.359 sample45 0 32.37 0.003 sample176 2+ 38.35 0.310 sample46 0 30.38 0.001 sample177 2+ 50.30 0.374 sample47 0 39.35 0.002 sample178 2+ 36.36 0.227 sample48 0 36.36 0.003 sample179 2+ 35.36 0.275 sample49 0 31.38 0.004 sample180 2+ 38.35 0.280 sample50 0 33.37 0.006 sample181 2+ 36.36 0.218 sample51 0 34.37 0.005 sample182 2+ 50.30 0.331 sample52 0 30.38 0.001 sample183 2+ 50.30 0.338 sample53 0 34.37 0.001 sample184 2+ 50.30 0.247 sample54 0 32.37 0.003 sample185 2+ 63.25 0.408 sample55 0 30.38 0.001 sample186 2+ 38.35 0.318 sample56 0 34.37 0.001 sample187 2+ 42.33 0.359 sample57 0 33.37 0.001 sample188 2+ 63.25 0.405 sample58 0 31.38 0.003 sample189 2+ 36.36 0.329 sample59 0 32.37 0.001 sample190 3+ 128.00 0.463 sample60 0 31.38 0.002 sample191 3+ 90.15 0.427 sample61 0 33.37 0.003 sample192 3+ 128.99 0.489 sample62 0 32.37 0.001 sample193 3+ 95.13 0.557 sample63 0 30.38 0.004 sample194 3+ 126.01 0.533 sample64 0 34.37 0.001 sample195 3+ 128.00 0.562 sample65 0 32.37 0.003 sample196 3+ 86.16 0.403 sample66 0 30.38 0.002 sample197 3+ 110.07 0.507 sample67 0 32.37 0.000 sample198 3+ 101.10 0.466 sample68 0 31.38 0.004 sample199 3+ 110.07 0.525 sample69 0 32.37 0.002 sample200 3+ 110.07 0.555 sample70 0 31.38 0.000 sample201 3+ 98.12 0.592 sample71 0 34.37 0.005 sample202 3+ 128.99 0.548 sample72 0 30.38 0.001 sample203 3+ 114.05 0.478 sample73 1+ 33.37 0.116 sample204 3+ 114.05 0.485 sample74 1+ 32.37 0.141 sample205 3+ 110.07 0.509 sample75 1+ 33.37 0.132 sample206 3+ 95.13 0.468 sample76 1+ 33.37 0.124 sample207 3+ 110.07 0.512 sample77 1+ 33.37 0.066 sample208 3+ 86.16 0.509 sample78 1+ 30.38 0.029 sample209 3+ 128.00 0.646 sample79 1+ 30.38 0.040 sample210 3+ 128.99 0.479 sample80 1+ 32.37 0.104 sample211 3+ 86.16 0.460 sample81 1+ 30.38 0.044 sample212 3+ 110.07 0.506 sample82 1+ 30.38 0.068 sample213 3+ 110.07 0.521 sample83 1+ 30.38 0.081 sample214 3+ 110.07 0.508 sample84 1+ 32.37 0.047 sample215 3+ 128.00 0.584 sample85 1+ 30.38 0.015 sample216 3+ 114.05 0.591 sample86 1+ 32.37 0.054 sample217 3+ 128.00 0.631 sample87 1+ 30.38 0.082 sample218 3+ 110.07 0.563 sample88 1+ 33.37 0.043 sample219 3+ 98.12 0.550 sample89 1+ 32.37 0.066 sample220 3+ 126.01 0.536 sample90 1+ 33.37 0.091 sample221 3+ 110.07 0.534 sample91 1+ 30.38 0.037 sample222 3+ 128.00 0.547 sample92 1+ 32.37 0.055 sample223 3+ 95.13 0.599 sample93 1+ 30.38 0.015 sample224 3+ 128.99 0.506 sample94 1+ 31.38 0.026 sample225 3+ 86.16 0.460 sample95 1+ 32.37 0.031 sample226 3+ 98.12 0.489 sample96 1+ 33.37 0.050 sample227 3+ 101.10 0.494 sample97 1+ 32.37 0.036 sample228 3+ 128.00 0.633 sample98 1+ 30.38 0.031 sample229 3+ 110.07 0.504 sample99 1+ 30.38 0.021 sample230 3+ 110.07 0.556 sample100 1+ 30.38 0.046 sample231 3+ 128.00 0.607 sample101 1+ 30.38 0.029 sample232 3+ 128.00 0.501 sample102 1+ 30.38 0.027 sample233 3+ 140.95 0.571 sample103 1+ 33.37 0.025 sample234 3+ 128.99 0.580 sample104 1+ 33.37 0.038 sample235 3+ 128.00 0.600 sample105 1+ 33.37 0.033 sample236 3+ 128.99 0.635 sample106 1+ 32.37 0.021 sample237 3+ 110.07 0.513 sample107 1+ 35.36 0.035 sample238 3+ 114.05 0.581 sample108 1+ 31.38 0.013 sample239 3+ 110.07 0.495 sample109 1+ 32.37 0.099 sample240 3+ 95.13 0.547 sample110 1+ 33.37 0.059 sample241 3+ 110.07 0.527 sample111 1+ 33.37 0.009 sample242 3+ 110.07 0.560 sample112 1+ 32.37 0.034 sample243 3+ 114.05 0.517 sample113 1+ 30.38 0.027 sample244 3+ 114.05 0.559 sample114 1+ 30.38 0.028 sample245 3+ 86.16 0.459 sample115 1+ 33.37 0.100 sample246 3+ 95.13 0.459 sample116 1+ 33.37 0.054 sample247 3+ 98.12 0.576 sample117 1+ 32.37 0.078 sample248 3+ 95.13 0.473 sample118 1+ 33.37 0.114 sample249 3+ 110.07 0.517 sample119 1+ 33.37 0.042 sample250 3+ 98.12 0.570 sample120 1+ 30.38 0.051 sample251 3+ 110.07 0.558 sample121 1+ 33.37 0.076 sample252 3+ 128.00 0.653 sample122 1+ 30.38 0.022 sample253 3+ 110.07 0.540 sample123 1+ 33.37 0.098 sample254 3+ 114.05 0.533 sample124 1+ 33.37 0.118 sample255 3+ 128.00 0.663 sample125 1+ 33.37 0.044 sample256 3+ 128.00 0.587 sample126 2+ 50.30 0.309 sample257 3+ 90.15 0.539 sample127 2+ 50.30 0.249 sample258 3+ 110.07 0.566 sample128 2+ 38.35 0.368 sample259 3+ 114.05 0.517 sample129 2+ 50.30 0.406 sample260 3+ 128.00 0.537 sample130 2+ 50.30 0.323 sample261 3+ 128.99 0.515 sample131 2+ 38.35 0.293 This verification method, based on the essential differences in HER2 staining characteristics at each grade, selects two highly discriminative parameters: "saturation peak position" and "specific hue proportion," to achieve rapid and accurate classification of control grades. All 0, 1+, and 3+ control samples were correctly verified, with a 98.4% accuracy rate for the 2+ control sample. Its advantages are: first, the judgment logic is simple and clear, requiring no complex vector distance calculations, enabling efficient control verification; second, the parameters are consistent with the aforementioned feature system, ensuring the uniformity of the entire technical method; and third, objective grade classification is achieved through threshold control, avoiding subjective errors in control selection and providing a reliable standard for the subsequent grading of samples to be tested.
[0138] (x) Detection method for the image to be inspected Euclidean distance, a classic and reliable metric for measuring the similarity between two vectors in a high-dimensional vector space, is based on the principle of calculating the straight-line distance between the feature parameter vector of the test sample and the feature parameter vector of the standard control image. A smaller distance indicates a higher similarity in color features and a higher consistency in the corresponding HER2 level. Based on the aforementioned histogram screening process, 17 parameters were determined as image feature parameters. These 17 parameters were used to calculate the Euclidean distance between the feature parameter vector of the test image and the feature parameter vectors of the four standard control images. The level of the standard control image with the smallest Euclidean distance to the test image's feature parameter vector was then identified as the HER2 level of the test sample.
[0139] 1. Construction of HER2-level feature parameter vectors (1) Based on the characteristics of HER2 tumor immunohistochemical staining (yellow represents the cell membrane staining area, and blue represents the cell nucleus area), and combined with the application value of the above statistics, a feature parameter vector is constructed, consisting of "6 basic feature parameters + 10 refined feature parameters for the cell membrane area + 1 supplementary feature parameter for the cell nucleus area". This vector comprehensively covers the core features, detailed differences, and background references of positive signals, ensuring the accuracy of grading. The selection criteria and definitions of each parameter are as follows: The first group consists of six basic feature parameters. This group captures the core correlation between positive areas and color distribution at an overall level, covering area proportion, concentration trends of key channels, distribution offset, and the amount of information in two-dimensional space. Specifically, it includes: Yellow area pixel percentage: The ratio of the number of pixels in the yellow area to the total number of pixels in the effective tumor area of the image. It directly reflects the coverage of the positive signal and is a basic indicator of HER2 grading (3+ grade has the highest percentage, and 0 grade has the lowest). H channel median: The median of the H channel pixel values in the entire tumor area. It reflects the concentration trend of the overall tone of the area and anchors the mixed dominant tone of the positive and background. H channel skewness: The skewness of the H channel pixel values in the entire tumor area. It reflects the asymmetry of the overall tone distribution and distinguishes the tone characteristics dominated by the positive and the background. S channel skewness: The skewness of the S channel pixel values in the entire tumor area. It reflects the offset direction of the overall saturation distribution and is associated with the vividness of the positive signal. V channel kurtosis: The kurtosis of the V channel pixel values in the entire tumor area. It reflects the steepness of the overall brightness distribution and quantifies the concentration of regional brightness. HS 2D entropy: The entropy value of the HS 2D histogram of the entire tumor area. It reflects the information content of the hue-saturation joint distribution and reflects the richness and uniformity of the regional color distribution.
[0140] The second group consists of 10 refined feature parameters for cell membrane regions. The yellow region is the core carrier of the HER2 positive signal. This group of parameters focuses on the color feature details within the yellow region, precisely quantifying the hue, saturation, brightness characteristics, and distribution of the positive signal to amplify the differences between different levels. Specifically, this includes: Yellow region pixel percentage: overlapping with the first group of parameters, serving as a vector anchor point to ensure the correlation between basic and refined features; Yellow region H-channel median: the median of the H-channel pixel values in the yellow region, accurately reflecting the core hue of the positive signal (e.g., the H-value range corresponding to brownish-yellow), eliminating background interference; Yellow region H-channel entropy: the entropy value of the H-channel pixel values in the yellow region, quantifying the uniformity of the positive signal hue (3+ level entropy is low, 1+ level entropy is high); Yellow region H-channel first peak height: the amplitude of the highest peak in the one-dimensional histogram of the yellow region H-channel, reflecting the pixel concentration of the main hue of the positive signal; Yellow region H-channel skewness: the skewness of the yellow region H-channel pixels... The skewness of the value reflects the asymmetry of the hue distribution of the positive signal and relates to the uniformity of the staining; the mean of the S channel in the yellow region: the average value of the pixel values in the S channel of the yellow region, directly quantifying the overall saturation level of the positive signal; the height of the first peak in the S channel of the yellow region: the amplitude of the highest peak in the one-dimensional histogram of the S channel of the yellow region, reflecting the pixel concentration of the main saturation of the positive signal; the position of the first peak in the S channel of the yellow region: the S value corresponding to the highest peak in the one-dimensional histogram of the S channel of the yellow region, anchoring the core saturation range of the positive signal; the kurtosis of the V channel in the yellow region: the kurtosis of the pixel values in the V channel of the yellow region, quantifying the steepness of the brightness distribution of the positive signal and reflecting the uniformity of the staining depth; the homogeneity of the HS two-dimensional histogram in the yellow region: the homogeneity index of the HS two-dimensional histogram in the yellow region (calculating the distribution similarity of adjacent pixels). High homogeneity indicates that the hue-saturation combination of the positive signal is simple and concentrated, which is a typical feature of level 3+.
[0141] The third group: supplementary feature parameters for one cell nucleus region. The blue region represents a specific background or control area (such as normal tissue or stained reference area) in the HER2 tumor image. Its color characteristics are stable. The feature parameters of this region can be used to construct a reference benchmark to help correct the deviation of positive region features. The specific parameters are: H channel kurtosis of the blue region: the kurtosis of the pixel values of the H channel of the blue region, reflecting the concentration of the hue distribution of the background region. As a reference benchmark, it can eliminate feature shifts caused by differences in staining batches and improve the robustness of grading.
[0142] (2) Definition and application value of core statistics Median: As a positional statistic reflecting the central tendency of a dataset, its value is the middle value after arranging the pixel values of a channel in ascending order. Its core advantage is its strong resistance to outliers (such as extreme pixels caused by uneven staining). In HER2 tumor image analysis, the median of the color channels can accurately anchor the dominant color features within a region—for example, the H channel median of a yellow positive region. It can exclude the influence of individual background noise or abnormal pixels that are stained too darkly, directly reflecting the core hue concentration range of the positive signal, and providing a stable basis for distinguishing the hue of different levels of positive signals.
[0143] Entropy: As a statistic measuring the uncertainty and information content of data distribution, its calculation is based on the probability of pixel value distribution. The magnitude of entropy is positively correlated with the richness and uniformity of color distribution. The higher the entropy value, the more diverse and dispersed the colors are within that channel or two-dimensional space; the lower the entropy value, the more uniform the colors are and the more concentrated the distribution. In HER2 analysis, the H channel entropy of the yellow region can reflect the uniformity of the positive signal hue. Strong positive regions (3+) have low H channel entropy values due to uniform staining.
[0144] Skewness: Used to describe the asymmetry of data distribution. Its value (positive or negative) and magnitude reflect the direction and degree of the distribution's shift. For the pixel value distribution of the HSV channel, positive skewness (skewness > 0, right skewness) indicates that the proportion of low-value pixels is high, and the corresponding image channel is darker (e.g., positive skewness in the V channel indicates that the overall area is darker); negative skewness (skewness < 0, left skewness) indicates that the proportion of high-value pixels is high, and the corresponding image channel is brighter (e.g., negative skewness in the V channel indicates that the overall area is brighter).
[0145] Kurtosis: Used to describe the steepness of the data distribution. High kurtosis corresponds to a concentrated and uniform feature distribution (such as a positive area of high-quality staining), while low kurtosis corresponds to a dispersed feature distribution and many interfering factors (such as uneven staining or noise interference).
[0146] 2. HER2 Rank Determination Method Based on Euclidean Distance Euclidean distance is a classic metric for measuring the similarity between two vectors in a high-dimensional vector space. Its core logic is to calculate the linear distance between the feature parameter vectors of the sample to be tested and the standard control sample; the smaller the distance, the more similar their color features, and the higher the corresponding grade consistency. The specific steps for grade discrimination in this method are as follows: (1) Construction of the control image library: one standard sample of each of the four levels of HER2 in tissue microarray: level 0, level 1+, level 2+ and level 3+. For each control sample, feature values are extracted according to the above 6+10+1 parameter system to construct feature parameter vectors of the four standard levels, denoted as vectors C0 (level 0), C1 (level 1+), C2 (level 2+), and C3 (level 3+). The dimension of each vector is 17 (6+10+1).
[0147] (2) Feature extraction of the image to be tested: For the HER2 tumor region image to be tested, the same image preprocessing (such as region segmentation and color space conversion) and parameter calculation methods as the control sample are used to extract 17-dimensional feature parameters and construct the sample vector X to be tested.
[0148] (3) Euclidean distance calculation: Calculate the Euclidean distance between the sample vector X to be tested and the four standard control vectors C0, C1, C2, and C3 respectively. The distance calculation formula is as follows: ; in, Dimension index of the parameter vector (1≤ ≤17), For the sample to be tested The possible values of each parameter For the first The first standard grade sample The possible values of each parameter For the sample to be tested and the first Euclidean distance of standard-rank samples.
[0149] (4) Classification: Compare the four Euclidean distances , , , The numerical value determines the HER2 grade of the sample to be tested, which corresponds to the standard control sample with the smallest distance.
[0150] The core advantage of this method lies in the fact that the 17-dimensional feature parameter vector comprehensively covers the macroscopic range, microscopic color features, and background reference of the positive signal, ensuring the integrity of the feature representation; the Euclidean distance can effectively quantify the overall difference between vectors, avoiding misjudgment caused by fluctuations in a single parameter, thus transforming HER2 level discrimination from traditional subjective visual assessment to objective quantitative calculation, significantly improving the consistency and accuracy of the grading results. The results for 69 groups are shown in Table 3.
[0151] Table 3 test1 0 0 test36 2+ 2+ test2 0 0 test37 2+ 2+ test3 0 0 test38 2+ 2+ test4 0 0 test39 2+ 2+ test5 0 0 test40 2+ 2+ test6 0 0 test41 2+ 2+ test7 0 0 test42 2+ 2+ test8 0 0 test43 2+ 2+ test9 0 0 test44 2+ 2+ test10 0 0 test45 2+ 2+ test11 0 0 test46 2+ 2+ test12 0 0 test47 2+ 2+ test13 0 0 test48 2+ 2+ test14 0 0 test49 2+ 2+ test15 0 0 test50 2+ 2+ test16 0 0 test51 2+ 2+ test17 0 0 test52 3+ 3+ test18 1+ 2+ test53 3+ 3+ test19 1+ 2+ test54 3+ 3+ test20 1+ 1+ test55 3+ 3+ test21 1+ 1+ test56 3+ 3+ test22 1+ 1+ test57 3+ 3+ test23 1+ 1+ test58 3+ 3+ test24 1+ 2+ test59 3+ 3+ test25 1+ 1+ test60 3+ 3+ test26 1+ 1+ test61 3+ 3+ test27 1+ 1+ test62 3+ 3+ test28 1+ 1+ test63 3+ 3+ test29 1+ 1+ test64 3+ 3+ test30 1+ 1+ test65 3+ 3+ test31 1+ 1+ test66 3+ 3+ test32 1+ 2+ test67 3+ 3+ test33 1+ 1+ test68 3+ 3+ test34 2+ 2+ test69 3+ 3+ test35 2+ 2+ Of these, four 1+ samples were classified as 2+, and the accuracy statistics are shown in Table 4.
[0152] Table 4
[0153] In this application example, by directly comparing images of the test sample with objective control samples stained simultaneously, differences caused by varying subjective standards are reduced, especially when distinguishing between low expression ranges such as 0 and 1+. The method itself includes and emphasizes the calibration of low expression ranges, potentially aiding in the differentiation of borderline cases such as 0 and 1+ by extracting more refined image features. The human eye struggles to precisely quantify subtle staining differences, leading to poor reproducibility in IHC 0 and 1+ interpretation. Traditional quality control relies heavily on operational procedures and experience. By introducing four levels of standards stained simultaneously with the test sample, an intuitive and immediate "benchmark" is provided for each batch of experiments. This effectively monitors the stability of each stage, from tissue fixation and antigen retrieval to antibody staining, improving the reliability of the test from the source. Initial screening and comparison using image recognition technology reduces over-reliance on the pathologist's personal experience, contributing to the standardization and reproducibility of interpretation results. Simultaneously, automating quality control and interpretation processes is expected to improve the overall efficiency of the testing process.
[0154] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Clearly, those skilled in the art can make various alterations and variations to the invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the invention as claimed or its equivalents, the invention is also intended to include these modifications and variations.
Claims
1. A method for IHC pathological grading based on HER2 tissue microarray, characterized in that, include: S1, tissue microarray construction and simultaneous staining; S2, Image Acquisition, including: acquiring images of tumor regions of tissue microarray controls and test samples after synchronous staining using an optical microscope to form a standardized image dataset; S3, Image preprocessing, including: optimizing the image acquired in step S2, removing noise, background interference and redundant information from the image, and obtaining a foreground image with no noise, no background interference and clear cell structure. S4, Feature extraction, including: extracting multi-dimensional feature parameters that can reflect the expression characteristics of HER2 protein from the foreground image, including one-dimensional histogram features of HSV channel, two-dimensional histogram features of HS and a 17-dimensional feature parameter vector; S5, Reference Standard Verification, including: verifying the characteristic parameters of reference standards of each grade in tissue microarray, verifying the accuracy of reference standard grade labeling and the qualification of staining quality, and ensuring that the reference standards can serve as a reliable reference standard for judging the grade of the sample to be tested; if the reference standard verification fails, it will prompt to re-stain the sample and acquire images. S6, Determination of the grade of the sample to be tested, including: after the reference standard has passed the verification, based on the extracted 17-dimensional feature parameter vector of the sample to be tested, combined with the constructed standard feature parameter vector library, the Euclidean distance is used to quantitatively determine the HER2 grade of the sample to be tested.
2. The IHC pathological grading method based on HER2 tissue microarray according to claim 1, characterized in that, S1 includes: S11, Construct a HER2 pathological immunohistochemical tissue chip. The HER2 pathological immunohistochemical tissue chip is arranged vertically, with standard control areas for grades 0, 1+, 2+, and 3+ from top to bottom. One standard control is set for each grade. The sample area to be tested is set on the right side, arranged parallel to the control area. The standard control for the four grades are all from four tissues with a clear HER2 grade. The standard control is stably passaged and amplified using the PDTX model to ensure that the genetic background is consistent with the tissue type. S12 involves simultaneous staining of the HER2 pathological immunohistochemical tissue microarray and the sample to be tested to ensure consistent staining results and provide a reliable control basis for subsequent grading. The simultaneous staining process includes: dewaxing and hydration, antigen retrieval, primary antibody incubation, secondary antibody incubation, DAB staining, hematoxylin counterstaining, dehydration and clearing, and mounting. All staining steps are performed on the tissue microarray and the sample to be tested under identical experimental conditions.
3. The IHC pathological grading method based on HER2 tissue microarray according to claim 2, characterized in that, S2 includes: S21, Sample Placement: Place the dried tissue chip and the sample section to be tested on the stage of the optical microscope, and adjust the position of the stage so that the control area of the tissue chip and the sample area to be tested are both within the field of view of the microscope. S22, Adjustment parameters: Turn on the optical microscope, adjust the magnification of the objective lens and eyepiece, and adjust the focus, brightness and contrast to make the field of view clear and ensure that tumor cells and cell membrane structures can be clearly identified; set the parameters for image resolution and acquisition speed; S23, Acquire control images: First, acquire images of control samples of each grade on the tissue chip, in the order of grade 0, grade 1+, grade 2+, and grade 3+. Acquire one field of view image of the tumor stained area for each grade as a control image. Record the control grade, sample number, and acquisition time corresponding to each control image during acquisition. S24, Acquire images of the samples to be tested: After the control images are acquired, acquire images of the samples to be tested. For each sample to be tested, acquire one image of the field of view of the tumor stained area as the image of the sample to be tested. During acquisition, record the sample number, acquisition time and field of view corresponding to each image of the sample to be tested. S25, Storing Images: Name all collected images according to the naming rule of "control grade + sample number + collection time", store them in PNG or JPG format, construct an image dataset, and store them in the path specified by the system.
4. The IHC pathological grading method based on HER2 tissue microarray according to claim 3, characterized in that, S3 includes: Gaussian denoising, RGB-HSV color space conversion, background removal, and morphological optimization processing; wherein, Gaussian denoising is used to remove image noise while preserving the details of tumor cells and cell membrane structures in the image; the RGB-HSV color space conversion is used to facilitate the separation of yellow cell membrane staining areas, blue cell nucleus areas, and colorless or light red background areas; the background removal includes generating background and foreground masks by setting an HSV threshold range to separate the background and foreground areas and remove background interference, wherein the foreground area is the tumor cell area; the morphological optimization processing optimizes the foreground mask through morphological opening and closing operations and small region filtering, removes noise points and background residues, fills holes in the foreground area, and obtains a clean and complete foreground image.
5. The IHC pathological grading method based on HER2 tissue microarray according to claim 4, characterized in that, The features extracted in S4 include: HSV channel one-dimensional histogram features, which include H channel histogram, S channel histogram and V channel histogram, respectively reflect the pixel distribution features of the three components of hue (H), saturation (S) and brightness (V) in the foreground image, and are used to quantify the intensity distribution of yellow staining of cell membrane and blue staining of cell nucleus; The HS two-dimensional histogram feature is used to reflect the joint distribution characteristics of the two components of hue (H) and saturation (S) in the foreground image, and is used to simultaneously reflect the color type and vividness of the staining. The peak position and peak height of the HS two-dimensional histogram are used to accurately reflect the characteristics of yellow staining of cell membranes. A 17-dimensional feature parameter vector is generated, comprising 6 basic feature parameters, 10 cell membrane region refinement feature parameters, and 1 supplementary feature parameter for the cell nucleus region. All 17-dimensional feature parameter vectors are calculated using the foreground image, the one-dimensional HSV channel histogram, and the two-dimensional HS histogram. The 6 basic feature parameters include: pixel percentage, H channel median, H channel skewness, S channel skewness, V channel kurtosis, and HS two-dimensional entropy. The 10 cell membrane region refinement feature parameters include: pixel percentage in the yellow region, H channel median in the yellow region, H channel entropy in the yellow region, and the first peak height of the H channel in the yellow region. The parameters include: H-channel skewness in the yellow region, S-channel mean in the yellow region, first peak height of the S-channel in the yellow region, first peak position of the S-channel in the yellow region, V-channel kurtosis in the yellow region, and HS-two-dimensional homogeneity in the yellow region; the supplementary feature parameter for the one cell nucleus region is the H-channel kurtosis in the blue region, extracted from the blue cell nucleus region. The HSV range of the blue cell nucleus region is H∈[90,160], S∈[30,255], V∈[0,255]. The H-channel kurtosis in the blue region is used to assist in judging the integrity and density of tumor cells and avoid grading bias caused by tumor cell necrosis and fragmentation. S4 includes: S41, Read the preprocessed foreground image and extract the H, S, and V channels of the HSV color space; S42, based on the HSV range of the yellow cell membrane staining area and the blue cell nucleus area, extract the images of the yellow area and the blue cell nucleus area respectively; S43, calculate the one-dimensional histograms of the H, S, and V channels, and the two-dimensional histogram of HS; S44, calculate 6 basic feature parameters, 10 cell membrane region refinement feature parameters and 1 cell nucleus region supplementary feature parameter in sequence to construct a 17-dimensional feature parameter vector; S45, normalize the 17-dimensional feature parameter vector, normalizing the value range of all 17-dimensional feature parameters to the range of 0-1. S46. The extracted one-dimensional histogram features of the HSV channel, the two-dimensional histogram features of the HS channel, and the normalized 17-dimensional feature parameter vector are associated with and stored with the corresponding image information for subsequent verification of reference materials and grade discrimination of the sample to be tested.
6. The IHC pathological grading method based on HER2 tissue microarray according to claim 5, characterized in that, The basis for the verification of the reference material in S5 is that there are significant differences in the first peak position of the yellow S channel and the pixel ratio of the yellow area of different grades of reference materials, and this difference is stable and distinguishable. The reference standard verification in S5 includes: S51, read the characteristic parameters of each grade of control sample, and determine the two core parameters of the first peak position of the yellow area S channel and the percentage of yellow area pixels for each control sample; S52. Each level of control sample is individually verified using a two-level progressive discrimination logic to determine whether the actual level of the control sample matches the labeled level. The specific discrimination logic is as follows: The first step is preliminary grade determination, i.e., 3+ grade verification, which includes: if the first peak position of the S channel in the yellow area of the control sample is >80, it indicates that its cell membrane staining intensity is strong, and it is judged as 3+ grade; if the labeled grade of the control sample is 3+ grade, the preliminary verification is qualified; if the labeled grade is not 3+ grade, the preliminary verification is unqualified. The second step is to determine the remaining levels, namely, level 0, level 1+, and level 2+ verification. This includes: if the first peak position of the S channel in the yellow area of the control sample is ≤80, then the level is further determined based on the pixel ratio of the yellow area. The specific classification criteria are as follows: If the percentage of pixels in the yellow area is less than 0.008, it indicates that the proportion of cells stained by cell membrane staining is extremely low and the staining intensity is weak, so it is grade 0; if the grade is marked as 0, the preliminary verification is qualified; otherwise, the preliminary verification is unqualified. If the percentage of pixels in the yellow area is between 0.008 and 0.141 (including 0.008 but excluding 0.141), it indicates a low proportion of cells stained by cell membrane staining and weak staining intensity, and is classified as level 1+. If the level is marked as level 1+, the preliminary verification is qualified; otherwise, the preliminary verification is unqualified. If the percentage of pixels in the yellow area is ≥0.141, it indicates a high proportion of cells with cell membrane staining and strong staining intensity, and is classified as level 2+. If the level is marked as level 2+, the preliminary verification is qualified; otherwise, the preliminary verification is unqualified. S53, Repeat step S52 to complete the preliminary verification of all reference samples, and calculate the verification pass rate of each grade of reference, that is, the ratio of the number of qualified samples to the total number of samples of that grade. S54, Overall verification of reference standards: Set a verification pass threshold. If the verification pass rate of each grade of reference standard is greater than or equal to the verification pass threshold, and all grades of reference standards have samples that pass verification, then the overall verification of the reference standards is qualified; otherwise, the overall verification of the reference standards is unqualified. S55, Process the verification results: If the overall verification of the reference standard is qualified, a reference standard verification report is generated, which clarifies the verification status of each grade of reference standard. The mean of the 17-dimensional feature parameter vector of each grade of reference standard is used as the standard feature parameter vector of that grade, and a standard feature parameter vector library is constructed for the grade determination of subsequent samples to be tested. If the overall verification of the control standard fails, a verification failure message will be generated, specifying the reason for the failure, and prompting the user to repeat the sample synchronous staining, image acquisition, image preprocessing, and feature extraction until the control standard verification passes.
7. The IHC pathological grading method based on HER2 tissue microarray according to claim 6, characterized in that, S6 includes: S61, Read the standard feature parameter vector library constructed by the reference standard verification module, and obtain the standard feature parameter vectors of level 0, level 1+, level 2+ and level 3+. S62, read the normalized 17-dimensional feature parameter vector X of the sample to be tested stored in the feature extraction module. If multiple images were collected for the sample to be tested, calculate the 17-dimensional feature parameter vector of each image, and then take the mean of all vectors as the final feature parameter vector X of the sample to be tested. S63, calculate the Euclidean distance between the final feature parameter vector X of the sample to be tested and the feature parameter vector of each grade standard. The Euclidean distance is the straight-line distance between the feature parameter vectors of the sample to be tested and the standard control sample. The smaller the distance, the more similar the color features of the two are, and the higher the consistency of the corresponding grades.
8. An IHC pathological grading system based on HER2 tissue microarray, used to implement the method described in any one of claims 1-7, characterized in that, include: The tissue microarray simultaneous staining module (101) is used for tissue microarray construction and simultaneous staining. The image acquisition module (102) is used to acquire images, including: acquiring images of tumor regions of tissue microarray control standards and test samples after synchronous staining using an optical microscope, forming a standardized image dataset; The image preprocessing module (103) is used to perform image preprocessing, including: optimizing the image acquired by the image acquisition module, removing noise, background interference and redundant information in the image, and obtaining a foreground image with no noise, no background interference and clear cell structure; The feature extraction module (104) is used to perform feature extraction, including: extracting multi-dimensional feature parameters that can reflect the expression characteristics of HER2 protein from the foreground image obtained by the image preprocessing module, including one-dimensional histogram features of HSV channel, two-dimensional histogram features of HS and a 17-dimensional feature parameter vector; The reference standard verification module (105) is used to verify the reference standard, including: verifying the characteristic parameters of reference standards of each grade in tissue microarray, verifying the accuracy of the reference standard grade labeling and the qualification of staining quality, and ensuring that the reference standard can be used as a reliable reference standard for judging the grade of the sample to be tested; if the reference standard verification fails, it prompts to re-stain the sample and acquire the image. The grade discrimination module (106) is used to perform grade discrimination of the sample to be tested, including: after the reference standard is qualified, according to the 17-dimensional feature parameter vector of the sample to be tested extracted by the feature extraction module, combined with the standard feature parameter vector library constructed by the reference standard verification module, the HER2 grade of the sample to be tested is quantitatively discriminated by calculating the Euclidean distance.
9. An electronic device comprising a processor and a memory, characterized in that, The memory stores multiple instructions, and the processor is used to read the instructions and execute the method as described in any one of claims 1-7.
10. A computer-readable storage medium storing a plurality of instructions, characterized in that, The plurality of instructions may be read by the processor and executed as described in any one of claims 1-7.