Control methods for a slide staining machine, slide staining machine and storage medium

By integrating a high-speed camera and LED cold light source into the slide staining machine, real-time images of slides are acquired and the staining time is adjusted using a preset compensation model. This solves the problem of inconsistent colors caused by changes in the state of the staining solution in the slide staining machine, and improves the accuracy and adaptability of pathological diagnosis.

CN122084359APending Publication Date: 2026-05-26SHENZHEN SHENGQIANG TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610552099.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-24
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing slide staining machines cannot detect changes in the state of the staining solution in real time during continuous staining, resulting in inconsistent colors of slides in the same batch, which affects the accuracy and consistency of pathological diagnosis.

Method used

By integrating a high-speed camera, LED cold light source, and slide positioning sensor into the slide staining machine, real-time images of slide tissue are acquired, quantitative color feature values ​​are extracted, and the staining time adjustment is calculated using a preset compensation model to form a closed-loop control and dynamically adjust the staining parameters.

Benefits of technology

It achieves consistency in staining effects for slides from the same batch, improves the accuracy of pathological diagnosis and the adaptability of the process, and solves the problem of difficulty in matching staining parameters with real-time staining effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122084359A_ABST
    Figure CN122084359A_ABST
Patent Text Reader

Abstract

This application discloses a control method, a slide staining machine, and a storage medium for a slide staining machine. The method includes: acquiring a slide tissue image of at least one target slide in the current staining batch; extracting quantified color feature values ​​from the slide tissue image; acquiring a color feature target range associated with the current staining batch and determining the color feature deviation between the quantified color feature values ​​and the color feature target range; obtaining a staining time adjustment amount corresponding to the color feature deviation through a preset compensation model; and setting the staining soaking time for the next slide to be stained in the current staining batch based on the staining time adjustment amount. This application compensates for the dye consumption effect through online real-time visual feedback and dynamic time adjustment, ensuring that the staining color of slides in the same batch is highly consistent from the first to the last slide.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of medical devices, and more particularly to a control method for a slide staining machine, the slide staining machine, and a storage medium. Background Technology

[0002] In pathology, tissue sections are stained using an HE staining machine for easier observation. During continuous staining, the effective components of the staining solution are constantly absorbed and consumed by the slides. Simultaneously, the staining solution may be affected by other factors, resulting in a continuous decrease in its concentration and activity.

[0003] In related technologies, staining machines typically run fixed staining programs based on experience. These programs determine all parameters at the start of each batch, failing to detect dynamic changes in the staining solution's state and thus unable to compensate for the decline in staining quality caused by solution consumption. This results in significant intra-batch color variations within the same staining batch, where earlier stained slides show normal color while later stained slides gradually become lighter. This variation not only affects pathologists' subjective judgment of the staining intensity of cell nuclei and cytoplasm but can also lead to misdiagnosis or missed diagnosis, directly threatening the consistency and accuracy of pathological diagnoses.

[0004] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention

[0005] The main objective of this application is to provide a control method for a slide staining machine, a slide staining machine, and a storage medium, aiming to solve the technical problem of inconsistent staining colors in slides from the same batch.

[0006] To achieve the above objectives, this application proposes a control method for a slide staining machine, which is applied to a slide staining machine equipped with a high-speed camera, an LED cold light source, a slide positioning sensor, and a light shield. The method includes: Acquire tissue images of at least one target slide in the current staining batch, wherein the target slide is a slide located between the staining area and the scanning area; Quantitative color feature values ​​are extracted from the tissue image on the slide. The quantitative color feature values ​​include the average blue component of the cell nucleus, the average red component of the cytoplasm, and the nucleoplasm contrast. Obtain the target range of color features associated with the current dyeing batch, and determine the color feature deviation between the quantized color feature value and the target range of color features; The color feature deviation is obtained by using a preset compensation model to determine the dyeing time adjustment amount, and the dyeing soaking time of the next slide to be dyed in the current dyeing batch is set based on the dyeing time adjustment amount.

[0007] In one embodiment, the step of obtaining the dyeing time adjustment amount corresponding to the color feature deviation through a preset compensation model includes: Obtain the number of glass slides that have been stained in the current staining batch and the information on the use of the staining solution, including the initial concentration, the duration of use, and the type of staining solution; Based on the dye usage information and the dye attenuation empirical model, the trend of dye concentration decrease caused by dyeing multiple consecutive slides to be stained in the future staining process is predicted. The decreasing trend of the dye concentration is converted into a feedforward compensation amount, and the feedback compensation amount is calculated based on the color feature deviation. The feedforward compensation amount and the feedback compensation amount are weighted and superimposed to obtain the staining time adjustment amount. The feedback compensation amount is used to adjust the staining time of the next adjacent slide, and the feedforward compensation amount is used to adjust the staining time of multiple subsequent slides. The window length of the feedforward compensation is dynamically set according to the staining solution decay rate.

[0008] In one embodiment, before the step of predicting the trend of decreasing dye concentration after staining of multiple consecutive slides in future staining processes based on the dye usage information and the dye attenuation empirical model, the method further includes: Multiple batches of glass slides were collected at different time points during the staining process, and the concentration of the effective components in each staining sample was measured. The number of stained slides and the usage time corresponding to each staining solution sample are used as time variables, and the concentration of the effective component of the staining solution is used as the decay target. The decay function of the staining solution concentration as a function of the time variable is fitted and used as the empirical model of staining solution decay.

[0009] In one embodiment, the step of extracting quantized color feature values ​​from the slide tissue image includes: Obtain the reference color feature values ​​of the fixed color card reference image for the current dyeing batch; The combined drift of the current lighting environment and camera response is calculated based on the reference color feature value and the pre-stored calibration value. The quantized color feature value is corrected by the overall drift amount.

[0010] In one embodiment, the preset compensation model is a linear mapping model. The step of obtaining the staining time adjustment amount corresponding to the color feature deviation through the preset compensation model, and setting the staining soaking time of the next slide to be stained in the current staining batch based on the staining time adjustment amount, includes: The color feature deviation is decomposed into a multidimensional deviation vector, which includes the nuclear blue component deviation, the cytoplasmic red component deviation, and the nuclear-cytoplasmic contrast deviation. The independent compensation coefficients for each slide staining step are obtained, and the independent compensation coefficients are organized into a compensation coefficient matrix. The slide staining steps include hematoxylin staining, eosin staining, differentiation, and bluing. A linear mapping operation is performed on the multidimensional deviation vector and the compensation coefficient matrix to obtain the preliminary time adjustment vector corresponding to each staining step; The initial time adjustment vector is algebraically superimposed with the baseline staining time of the slide to be stained in the corresponding staining step to obtain the staining soaking time for each staining step.

[0011] In one embodiment, after setting the staining soaking time of the next slide to be stained corresponding to the target slide in the current staining batch based on the staining time adjustment amount, the method further includes: Obtain dye liquor configuration information, and calculate dye liquor configuration parameters based on the dye liquor configuration information and the color feature deviation. The dye liquor configuration parameters include the dye liquor temperature adjustment amount and the liquid pump flow rate adjustment amount. The staining time adjustment and staining solution configuration parameters are simultaneously sent to the staining execution mechanism so that the staining execution mechanism can adjust the staining time adjustment and staining solution configuration parameters at the same time during the staining process of the next slide to be stained.

[0012] In one embodiment, the preset compensation model is a machine learning model, and the control method of the slide staining machine further includes: Historical staining data is collected to construct a training sample set. Each training sample in the training sample set includes an input feature vector and an output time adjustment label. The input feature vector includes the current color feature deviation, the number of stained slides, the stain concentration decay trend, the ambient temperature and humidity, and the stain type. The training sample set is trained offline to obtain an initial machine learning model; Obtain the actual staining effect and the expected staining effect of the stained slide, and calculate the comparison result between the actual staining effect and the expected staining effect; The comparison results are used as new training samples to perform incremental learning training and parameter updates on the initial machine learning model, thereby obtaining the preset compensation model.

[0013] In one embodiment, the control method of the slide staining machine further includes: After the current dyeing batch is completed, a batch quality report based on the dyeing batch is generated. The batch quality report includes parameter adjustment records, color feature change curves, and model output deviation analysis from reality. When multiple consecutive batches of staining effect scores are detected to be lower than a preset threshold, the retraining process of the preset compensation model is triggered.

[0014] In addition, to achieve the above objectives, this application also proposes a slide staining machine, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the control method for the slide staining machine as described above.

[0015] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the control method for the slide staining machine as described above.

[0016] One or more technical solutions proposed in this application have at least the following technical effects: The technical solution of this application is applied to a slide staining machine. The slide staining machine is equipped with a high-speed camera, an LED cold light source, a slide positioning sensor, and a light shield. It acquires slide tissue images of at least one target slide in the current staining batch, wherein the target slide is a slide located between the staining area and the scanning area. Quantitative color feature values ​​are extracted from the slide tissue images. These quantitative color feature values ​​include the average blue component of the cell nucleus, the average red component of the cytoplasm, and the nucleoplasm-cytoplasm contrast. The target range of color features associated with the current staining batch is obtained, and the color feature deviation between the quantitative color feature values ​​and the target range is determined. A staining time adjustment amount corresponding to the color feature deviation is obtained through a preset compensation model, and the staining soaking time of the next slide to be stained in the current staining batch is set based on the staining time adjustment amount.

[0017] Specifically, this invention uses the blue component of the cell nucleus, the red component of the cytoplasm, and the nucleoplasmic contrast as core features to characterize the staining effect, ensuring the accuracy and representativeness of feature extraction. In the deviation calculation stage, the real-time extracted feature values ​​are compared with the ideal target range, overcoming the static judgment defects of traditional methods that rely on human experience. In the time adjustment stage, a preset compensation model maps color deviation to staining time adjustment, which is then applied to subsequent slides, forming a closed-loop control of "detection-decision-execution." Regarding the compensation strategy, it supports feedforward / feedback hybrid control and machine learning model optimization, further enhancing the adaptive capability under complex working conditions. Through the above technical means, this application significantly improves the process adaptability while ensuring the consistency of staining effects, providing an effective technical solution to the technical problems in the prior art where staining parameters are difficult to accurately match with real-time staining effects, and where it is difficult to balance dye utilization and staining quality. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating the first embodiment of the control method for the slide staining machine of this application; Figure 2 This is a detailed schematic diagram of step S40 based on the first embodiment; Figure 3 This is a schematic diagram of another detailed process based on step S40 in the first embodiment; Figure 4 This is a flowchart illustrating the second embodiment of the control method for the slide staining machine of the present invention; Figure 5 This is a flowchart illustrating the third embodiment of the control method for the slide staining machine of the present invention; Figure 6 This is a flowchart illustrating the fourth embodiment of the control method for the slide staining machine of the present invention; Figure 7 This is a schematic diagram of the hardware operating environment involved in the control method of the slide staining machine in the embodiments of this application.

[0021] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0022] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0023] In related technologies, the staining time control of slide staining machines mainly follows two different technical paths, but each has its own inherent defects, making it difficult to meet the dual requirements of color consistency and adaptive adjustment in continuous staining processes.

[0024] The first type of method is represented by preset programs with fixed parameters, where operators set the soaking time for each staining step based on experience. Once set, this method remains static and cannot detect dynamic changes in the staining solution due to continuous use, such as concentration decay, oxidation, or temperature fluctuations. In actual production, as staining batches progress, the effective components of the staining solution are continuously consumed, causing subsequent slides to gradually fade in color. Significant differences in color between the first and last slides within the same batch can occur, directly affecting the accuracy of pathological diagnosis. Furthermore, this type of method lacks a real-time evaluation mechanism for staining effects, making it difficult to support quality control requirements.

[0025] The second type of method attempts to improve the process by introducing post-treatment quality control, including manual microscopic examination or digital scanning assessment after staining. These methods can detect staining quality problems, but their detection point is at the end of the staining process, making it impossible to intervene or adjust the ongoing staining process. Once a defect is detected, the entire batch of slides is often scrapped, resulting in a significant waste of tissue samples, staining solution, and time. Although some slide staining machines integrate optical sensors to monitor staining solution levels or colors, these only serve as alarm prompts for staining solution replacement and do not form a closed-loop control system, thus failing to adjust staining parameters in real time.

[0026] Comprehensive analysis reveals that the core dilemma faced by both methods is that while fixed-parameter methods are stable, they lack adaptability; and while post-inspection methods can detect problems, they suffer from significant lag. Neither can detect the dyeing effect in real time during dye liquor consumption and dynamically compensate for parameters. More importantly, existing technical solutions generally employ open-loop or offline control logic. When faced with complex conditions where the dye liquor state continuously declines, the dyeing parameters become severely disconnected from the actual coloring effect, leading to a technical problem where dyeing consistency and process economy are difficult to balance.

[0027] Based on the aforementioned deficiencies in related technologies, this application proposes a control method for a slide staining machine. This method addresses the core pain points of existing methods, such as weak adaptability, control lag, and lack of closed-loop optimization. It integrates an online visual inspection station within the slide staining machine to acquire slide tissue images in real time and extract quantified color feature values. The color feature deviation is calculated by combining this with a preset ideal color target range, and then a compensation model is used to obtain the staining time adjustment amount, dynamically setting the staining soaking time for the next slide. Specifically, this method uses the blue component of the cell nucleus, the red component of the cytoplasm, and the nucleoplasm-cytoplasm contrast as core feature quantities characterizing the staining effect, ensuring the accuracy and representativeness of feature extraction. In the deviation calculation stage, the real-time extracted feature values ​​are compared with the ideal target range, overcoming the static judgment defects of traditional methods that rely on human experience. In the time adjustment stage, a preset compensation model maps the color deviation to a staining time adjustment amount and applies it to subsequent slides, forming a closed-loop control of "detection-decision-execution." Regarding the compensation strategy, it supports feedforward / feedback hybrid control and machine learning model optimization, further improving the adaptive capability under complex working conditions. Through the above-mentioned technical means, this application significantly improves the process adaptability while ensuring the consistency of dyeing effect, and provides an effective technical solution to the technical problems in the prior art that it is difficult to accurately match dyeing parameters with real-time coloring effect and difficult to balance dye liquor utilization and dyeing quality.

[0028] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0029] Based on this, embodiments of this application provide a control method for a slide staining machine, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the control method for a slide staining machine according to this application. In this embodiment, the control method for the slide staining machine is applied to a slide staining machine, which is equipped with a high-speed camera, an LED cold light source, a slide positioning sensor, and a light shield, and includes steps S10 to S40: Step S10: Obtain a slide tissue image of at least one target slide in the current staining batch, wherein the target slide is a slide located between the staining area and the scanning area; In this embodiment, a whole-slide staining machine equipped with an online machine vision feedback system has an internal staining process line for continuously transferring multiple slides of the same staining batch. In this online machine vision feedback system, the image acquisition position is located between the staining tank and the scanner. One or more online visual inspection stations are integrated into this process line. The online visual inspection stations shown are not located at the end of the staining process, but are strategically embedded after the main staining steps and before the dehydration and clearing steps. For example, the first online visual inspection station is located after the hematoxylin staining step and before the differentiation step, and the second online visual inspection station is located after the eosin staining step and before the dehydration and clearing step. Specifically, an embedded online visual acquisition device is deployed within this station. Its core components include a high-speed camera, a set of wavelength-optimized LED cold light sources, a high-precision slide positioning sensor, and a light shield.

[0030] When the staining line starts operating, slides from the same batch pass through each staining tank sequentially according to a preset mechanical rhythm, completing the hematoxylin, differentiation, bluing, and eosin staining steps, and are then transferred to the aforementioned online visual inspection station. When the slide reaches its precise position at this station, the slide positioning sensor is triggered. This sensor sends a high-precision trigger signal to the control system, which then initiates the image acquisition process. The LED cold light source illuminates instantaneously under the synchronous control of the trigger signal, providing stable and uniform illumination for imaging. Its specific wavelength is selected to effectively distinguish between the blue / purple of hematoxylin staining and the red / pink of eosin staining, thereby enhancing the color contrast between the cell nucleus and cytoplasm in the image.

[0031] Within milliseconds of receiving the trigger signal, the high-speed camera immediately takes one or more rapid photos of the target slide currently at the workstation, focusing on capturing images of the tissue region and optional standard contrast areas on the slide. The entire acquisition process is extremely short, completed within 50 milliseconds, without interfering with the normal slide transport cycle, thus ensuring the high-throughput processing capacity of the staining machine. At this point, the system successfully obtains the target slide tissue image for subsequent analysis. The core logic of this process lies in moving the image acquisition action from the traditional offline, terminal quality inspection stage to the continuous production process, making it a deterministic online step triggered by physical location and sensors. This lays the foundation for data acquisition in establishing a real-time feedback control loop.

[0032] Step S20: Extract quantized color feature values ​​from the slide tissue image. The quantized color feature values ​​include the average blue component of the cell nucleus, the average red component of the cytoplasm, and the nucleoplasm contrast. After successfully acquiring the slide tissue image of the target slide through the aforementioned online visual inspection station, the image data is transmitted in real time to the image processing and feature analysis module. The core task of this module is to convert the raw image data into quantitative values ​​that can objectively reflect the staining effect, that is, to extract a set of standardized quantitative color feature values. To achieve this conversion, the module internally executes a preset image processing and feature calculation process.

[0033] First, the original image undergoes preprocessing. Preprocessing includes applying denoising algorithms to eliminate minor noise introduced by lighting or sensors, and then automatically cropping the image according to a pre-defined tissue recognition logic, removing information-free background areas and retaining only the effective areas carrying the tissue samples. Next, the image is converted to a different color space as needed, for example, converting the original RGB space to HSV or LAB spaces that better match human visual perception or better separate color information.

[0034] After preprocessing, the module enters the core feature extraction stage. Based on the pathological characteristics of HE staining, the system focuses on calculating the following quantitative color feature values. The first is the average blue component of the cell nucleus, reflecting the staining depth of hematoxylin on the cell nucleus. The algorithm first identifies the cell nucleus region in the image using image segmentation techniques, and then calculates the average intensity value of all pixels within that region in the blue channel. A higher blue component value indicates a darker staining of the cell nucleus, and vice versa. The second is the average red component of the cytoplasm, reflecting the staining intensity of eosin on the cytoplasm. Similarly, the algorithm identifies the cytoplasmic region and calculates the average intensity value of all pixels within that region in the red channel to quantify the pinkness of the cytoplasm. The third is the nucleoplasmic contrast, a comprehensive indicator used to assess the color distinguishability of the cell nucleus from the surrounding cytoplasm. This value can be obtained by calculating the ratio of the average blue component of the cell nucleus to the average red component of the cytoplasm, or by calculating the Euclidean distance between the two in a specific color space. An ideal nucleocytoplasmic contrast ensures a clear boundary between the purple / blue of the cell nucleus and the pink / red of the cytoplasm, which is fundamental to accurate pathological diagnosis. In addition to the three core features mentioned above, the system can also extract auxiliary features such as the optical density of the entire image or the histogram distribution of specific color channels, as needed. All the calculated values ​​together constitute a quantitative color feature vector describing the staining effect of the current target slide, and serve as input data for the next stage of deviation calculation. The core logic of this step lies in transforming the pathologist's subjective, qualitative color judgment into an objective, repeatable, and directly computer-processable quantitative mathematical description.

[0035] In addition, considering the numerical shift caused by ambient light in the slide tissue image, the step of extracting quantized color feature values ​​from the slide tissue image includes: Obtain the reference color feature values ​​of the fixed color card reference image for the current dyeing batch; The combined drift of the current lighting environment and camera response is calculated based on the reference color feature value and the pre-stored calibration value. The quantized color feature value is corrected by the overall drift amount.

[0036] In practical engineering applications of extracting quantified color feature values ​​from slide tissue images, factors such as the slow decay of the illumination source inside the staining machine, the response drift of the camera sensor due to temperature changes, and minor contamination along the optical path between the slide and the lens can lead to the directly extracted raw quantified color feature values ​​containing systematic errors introduced by factors other than the staining effect itself. To eliminate these interferences and ensure that the extracted average blue component of the cell nucleus, average red component of the cytoplasm, and nucleoplasm contrast accurately reflect the actual effect of the staining solution on coloring, an online correction logic based on a fixed color chart is further integrated into the extraction steps.

[0037] In this correction logic, the reference color feature values ​​of the fixed color card reference image for the current staining batch are first obtained. Specifically, an industrial-grade standard color card, calibrated to standard color, is permanently installed beside the online visual inspection station inside the staining machine or within the same optical path. This color card contains multiple known standard color blocks, such as standard white, standard gray, standard black, and several red, blue, and purple blocks related to the HE staining color channels. At the start of each staining batch, or after every preset number of slides (e.g., every 20 slides), the control system automatically triggers the camera to acquire an image of the fixed color card, obtaining a reference image. Subsequently, the image processing module analyzes this reference image, extracting the actual measured values ​​of each standard color block under the current illumination and camera conditions—that is, the reference color feature values. This set of reference color feature values ​​records the overall response status of the entire imaging chain at the current moment.

[0038] Next, the step involves calculating the combined drift of the current lighting environment and camera response based on the aforementioned reference color feature values ​​and pre-stored calibration values. After system initialization or a thorough optical calibration, a set of pre-stored calibration values ​​is stored in the memory of the control decision module. These calibration values ​​are standard reference feature values ​​extracted after imaging the same fixed color chart under ideal lighting conditions and camera reference response, representing the zero-drift state of the system. When calculating the combined drift, the currently obtained reference color feature values ​​are compared channel by channel with the corresponding pre-stored calibration values. For example, the ratio between the current average value of the red channel of the standard white block and the pre-stored average value of the red channel is calculated as the gain drift coefficient of the red channel; similarly, the drift coefficient of the blue channel is calculated. These drift coefficients are integrated to form a multi-dimensional combined drift vector, which quantifies the overall offset of the entire optoelectronic link from the light source to the camera sensor relative to the calibration time at the current moment.

[0039] Finally, the quantified color feature values ​​are corrected using the aforementioned comprehensive drift amount. After extracting the original quantified color feature values, such as the average blue component of the cell nucleus and the average red component of the cytoplasm, from the tissue image of the target slide, these values ​​are substituted into a correction formula. The correction formula typically uses division or subtraction; for example, the corrected blue component equals the original extracted blue component divided by the drift coefficient of the blue channel. For composite indicators such as nucleocytoplasmic contrast, the basic color components are corrected separately before the contrast value is recalculated. This correction effectively eliminates spurious biases introduced by changes in ambient lighting or camera performance fluctuations, ensuring that the final output quantified color feature values ​​are entirely attributable to the true contribution of the staining solution. This correction logic significantly improves the robustness and cross-batch comparability of color feature extraction, ensuring that subsequent color feature deviation calculations are not misjudged due to interference from non-staining factors, thereby avoiding erroneous staining time adjustment instructions.

[0040] Step S30: Obtain the target range of color features associated with the current dyeing batch, and determine the color feature deviation between the quantized color feature value and the target range of color features; After obtaining the quantified color feature values ​​of the current target slide through the image processing and feature analysis modules described above, the control decision module initiates its core logic, namely, deviation calculation. This quantifies the degree of difference between the actual staining effect of the current slide and a preset staining standard representing "qualified" or "ideal".

[0041] First, the ideal color feature target range is obtained for the current staining batch. This target range is not generated temporarily, but is set by the operator through the human-computer interface and stored in the memory of the control decision module before the staining task begins. The setting of this target range can be based on various criteria, such as using a standard staining slide evaluated by experts as a benchmark, scanning the slide and automatically extracting its color feature values ​​as the target; or the operator can directly input the expected numerical ranges of the blue component of the cell nucleus, the red component of the cytoplasm, and the nucleocytoplasmic contrast according to the quality standards of a specific laboratory. This target range represents the expected quality of the final staining effect for this batch.

[0042] Subsequently, the core deviation calculation task is performed. This task compares the obtained actual quantified color feature value vector with the obtained ideal color feature target range. The comparison is performed item by item. For the average blue component of the cell nucleus, the algebraic difference between its actual value and the center value or target value of the target range is calculated to obtain the nuclear blue deviation value. If the actual value is higher than the upper limit of the target range, it indicates that the cell nucleus is stained too dark; if it is lower than the lower limit of the target range, it indicates that the staining is too light. Similarly, the difference between the actual value and the target value of the average red component of the cytoplasm is calculated to obtain the plasma red deviation value. For the nucleoplasm contrast, the difference between its actual value and the ideal contrast value is also calculated to obtain the contrast deviation value. Combining the above differences, a multi-dimensional color feature deviation vector ΔF is formed. The mathematical expression of this vector can be written as ΔF = [ΔF_nucleus_blue, ΔF_cytoplasm_red, ΔF_contrast, ...]. This ΔF vector accurately quantifies the degree of deviation of the current slide staining effect from the ideal standard in multiple key dimensions. The core logic lies in decomposing the complex, multi-factor coupled staining quality problem into several independent and controllable deviation signals, providing clear and quantitative input for subsequent compensation decisions. A positive deviation may indicate that a certain staining time needs to be reduced, while a negative deviation indicates that the staining time needs to be increased.

[0043] Step S40: Obtain the dyeing time adjustment amount corresponding to the color feature deviation through a preset compensation model, and set the dyeing soaking time of the next glass slide to be dyed in the current dyeing batch based on the dyeing time adjustment amount.

[0044] After calculating the color feature deviation vector ΔF between the current target slide and the ideal standard, the core task of the control decision module is to transform this deviation information into specific correction instructions for the subsequent staining process. The core of this transformation process is a pre-defined compensation model that establishes a mapping relationship between the color feature deviation ΔF and the staining time adjustment amount ΔT.

[0045] The calculated ΔF vector is used as input to the compensation model. This model internally encapsulates pre-defined mapping logic. In the initial stages of system operation or when conditions are stable, the model can be a simple linear relationship model, i.e., ΔT = K × ΔF. Here, ΔT is an output vector containing time adjustments for different staining steps, such as hematoxylin staining time, eosin staining time, and differentiation time. K is a pre-defined compensation coefficient matrix, where each element corresponds to the proportional relationship between a specific staining step and a specific color feature deviation. For example, if the nuclear blue deviation indicates that the cell nucleus staining is too light, the model will calculate the required increase in hematoxylin staining time based on the corresponding coefficients, such as adding 5 seconds.

[0046] After accumulating sufficient historical operational data, the compensation model can be switched to a more complex machine learning model, such as a lightweight neural network. In this case, the model's input includes not only the current ΔF, but also contextual information such as the number of stained slides, the cumulative consumption time of the stain solution, and environmental temperature and humidity. By learning the nonlinear relationship between these inputs and the optimal adjustment amount in historical data, the model can output a more accurate and adaptive ΔT. A hybrid feedforward and feedback control strategy can also be employed. Feedback control directly calculates the ΔT used to adjust the parameters of the (N+1)th slide based on the ΔF of the current Nth slide. Feedforward control, on the other hand, makes a small pre-adjustment based on trend information such as the number of stained slides before a deviation occurs.

[0047] Once the model calculates ΔT, the control decision module immediately sends this time adjustment to the actuators of the staining machine. The actuators include a robotic arm, fluid valve controllers, and a timing unit. These mechanisms dynamically modify their control logic based on the received instructions. Specifically, when the next slide to be stained enters the staining process, the actuators will no longer use the original baseline staining time, but instead use the adjusted new staining immersion time. For example, if ΔT indicates that the hematoxylin staining time needs to be increased by 5 seconds, the total immersion time of the next slide in the hematoxylin staining solution will be 5 seconds longer than the baseline time. In this way, a closed-loop control of "detection-decision-execution" is completed, achieving real-time, dynamic compensation for staining quality degradation and ensuring that subsequent slides in the same batch achieve the same and ideal staining effect as the previous slides.

[0048] Furthermore, you can also view Figure 2 , Figure 2 This is a detailed process diagram based on step S40 in the first embodiment. Figure 2 The step of obtaining the dyeing time adjustment amount corresponding to the color feature deviation through a preset compensation model includes S41~43: Step S41: Obtain the number of glass slides that have been stained in the current staining batch and the information on the use of the staining solution. The information on the use of the staining solution includes the initial concentration, the duration of use, and the type of the solution. Step S42: Based on the dye usage information and the dye attenuation empirical model, predict the trend of dye concentration decrease caused by dyeing multiple consecutive slides in the future dyeing process. Step S43: Convert the decreasing trend of the dye concentration into a feedforward compensation amount, and calculate the feedback compensation amount based on the color feature deviation; Step S44: The feedforward compensation amount and the feedback compensation amount are weighted and superimposed to obtain the staining time adjustment amount. The feedback compensation amount is used to adjust the staining time of the next adjacent slide, and the feedforward compensation amount is used to adjust the staining time of multiple subsequent slides. The window length of the feedforward compensation is dynamically set according to the staining solution decay rate.

[0049] In the specific implementation of converting color feature deviation into dyeing time adjustment amount through the above-mentioned preset compensation model, in order to simultaneously deal with the dyeing quality deviation that has already occurred and the impending dye liquor decay trend, a control strategy that combines feedforward and feedback is integrated internally.

[0050] First, the number of slides that have been stained and the information on the staining solution used in the current staining batch are obtained. The control decision module maintains a running counter that records in real time the total number of slides stained from the first slide in the batch to the current target slide. Simultaneously, the staining solution usage information for this batch is read from the human-machine interface or data storage module. This information includes the initial concentration of the staining solution, the total time the staining solution has been used in the batch (in hours), and the brand and model of the staining solution. This data provides the basic input for predicting the staining solution status.

[0051] Based on the aforementioned information on staining solution usage and the empirical model of staining solution decay, the decreasing trend of staining solution concentration during the staining process of multiple consecutive slides to be stained is predicted. The control decision module's memory contains a pre-installed empirical model of staining solution decay. This model is obtained by fitting historical test data of the same type of staining solution under standardized usage conditions and can describe the nonlinear decay curve of staining solution concentration with the number of stained slides and usage time. By substituting the acquired number of stained slides and the duration of staining solution usage into this model, the successive decrease in staining solution concentration when multiple consecutive slides, such as the next 5 or 10 slides, are stained sequentially is extrapolated, thus forming a concentration decrease trend sequence.

[0052] The aforementioned trend of decreasing stain concentration is converted into a feedforward compensation amount, and a feedback compensation amount is calculated based on the aforementioned color feature deviation. The calculation logic of the feedforward compensation amount is that, for each step of the decrease in the concentration decreasing trend sequence, the corresponding staining time is increased in advance to offset the expected loss of tinting strength. For example, if the model predicts that the concentration will decrease by 2% when staining the (N+1)th slide, the feedforward compensation amount is preset to increase the hematoxylin time of that slide by a corresponding fixed increment. The calculation of the feedback compensation amount follows the aforementioned linear or machine learning model, directly generating an instantaneous compensation amount to correct the immediately following slide, i.e., the (N+1)th slide, based on the color feature deviation ΔF calculated for the current Nth slide.

[0053] The aforementioned feedforward compensation and feedback compensation are weighted and summed to obtain the staining time adjustment. The feedback compensation adjusts the staining time of the immediately following slide, while the feedforward compensation adjusts the staining time of subsequent slides. The weighted summation uses the formula ΔT_total = w_fb × ΔT_feedback + w_ff × ΔT_feedforward, where the weights w_fb and w_ff are dynamically adjusted based on whether the staining solution is in its initial, middle, or final stage. The feedforward compensation window length—the number of slides whose time is adjusted simultaneously—is dynamically set based on the staining solution decay rate: when the staining solution is detected to be in a rapid decay phase (e.g., late stage), the window length automatically increases to, for example, 10 slides; when the staining solution is in a stable phase, the window length shortens to, for example, 2 slides. Through this hybrid control strategy, the system can both immediately correct existing staining deviations and proactively suppress foreseeable future staining solution decay trends, thereby significantly improving the color stability of the entire batch.

[0054] Furthermore, you can also view Figure 3 , Figure 3 This is a schematic diagram of another detailed process based on step S40 in the first embodiment. Figure 3 The preset compensation model is a linear mapping model. The step of obtaining the staining time adjustment amount corresponding to the color feature deviation through the preset compensation model, and setting the staining soaking time of the next slide to be stained in the current staining batch based on the staining time adjustment amount, includes S45~48: Step S45: Decompose the color feature deviation into a multidimensional deviation vector, which includes the nucleus blue component deviation, the cytoplasm red component deviation, and the nucleo-cytoplasmic contrast deviation. Step S46: Obtain the independent compensation coefficients for each slide staining step, and organize the independent compensation coefficients into a compensation coefficient matrix. The slide staining steps include hematoxylin staining, eosin staining, differentiation, and bluing. Step S47: Perform a linear mapping operation on the multidimensional deviation vector and the compensation coefficient matrix to obtain the preliminary time adjustment vector corresponding to each staining step; Step S48: The preliminary time adjustment vector is algebraically superimposed with the baseline staining time of the slide to be stained in the corresponding staining step to obtain the staining soaking time for each staining step.

[0055] Under the condition that the above-mentioned preset compensation model is a linear mapping model, such as when the system is in the initial stage of operation or when the dye solution is relatively stable, the dyeing time adjustment corresponding to the color feature deviation is obtained through this model, and the specific implementation of setting the dyeing soaking time of the next slide to be dyed is achieved.

[0056] The calculated color feature deviations are decomposed into a multidimensional deviation vector. This deviation vector is not a single numerical value, but an array containing multiple independent deviation components. Specifically, from the output ΔF, the nuclear blue component deviation, the cytoplasmic red component deviation, and the nucleocytoplasmic contrast deviation are extracted. This multidimensional deviation vector can be represented as ΔF_vec = [ΔF_nuc_blue, ΔF_cyto_red, ΔF_contrast]. Each component has its own independent physical meaning and unit; for example, the unit of the blue component deviation is gray level, and the contrast deviation is a unit ratio.

[0057] Independent compensation coefficients for each slide staining step were obtained and organized into a compensation coefficient matrix. The slide staining steps include hematoxylin staining, eosin staining, differentiation, and bluing. Each step has a different sensitivity to the three types of biases. For example, the nuclear blue component bias is mainly determined by the hematoxylin staining step; therefore, the hematoxylin step has a larger compensation coefficient for nuclear blue bias, while its compensation coefficient for plasma red bias is close to zero. These independent compensation coefficients were obtained through experimental calibration and pre-stored in the control decision module. The system organizes these coefficients into a matrix K with dimensions of 4 rows and 3 columns, with rows corresponding to staining steps and columns corresponding to bias components.

[0058] A linear mapping operation is performed on the aforementioned multidimensional deviation vector and the aforementioned compensation coefficient matrix to obtain the preliminary time adjustment vector corresponding to each staining step. This linear mapping operation is a standard matrix-vector multiplication, i.e., ΔT_preliminary = K × ΔF_vec. The calculation result is a four-dimensional vector, where the first component represents the preliminary time adjustment for the hematoxylin staining step, the second component represents the preliminary time adjustment for the eosin staining step, the third component represents the time adjustment for the differentiation step, and the fourth component represents the time adjustment for the bluing step. This operation can be completed within microseconds, ensuring the requirements of real-time control.

[0059] The initial time adjustment vector is algebraically superimposed with the baseline staining time of the slide to be stained for the corresponding staining step to obtain the final staining soaking time for each staining step. The baseline staining time is the standard soaking time set by the operator at the start of the batch, for example, a hematoxylin baseline time of 10 minutes and an eosin baseline time of 2 minutes. The superposition operation uses a component-by-component addition method, that is, the final hematoxylin time equals the baseline hematoxylin time plus the hematoxylin adjustment amount in the initial adjustment vector. If the adjustment amount is positive, the soaking time is extended; if it is negative, it is shortened. The system sends these four final time values ​​to the staining machine's actuator. When the next slide to be stained passes through each staining tank in sequence, the actuator strictly controls the dwell time of the robotic arm according to its corresponding final staining soaking time. Through this linear mapping model, the system realizes a computationally efficient and physically clear dynamic adjustment mechanism for staining time.

[0060] Furthermore, you can also view Figure 4 , Figure 4 This is a flowchart illustrating the second embodiment of the control method for the slide staining machine of the present invention. Before the step of predicting the trend of decreasing stain concentration after staining of multiple consecutive slides in the future staining process based on the staining solution usage information and the empirical model of staining solution attenuation, the method further includes steps S50-60: Step S50: Collect staining solution samples from multiple batches of glass slides at different time points during the staining process, and measure the concentration of effective components in each staining solution sample; Step S60: The number of stained slides and the usage time corresponding to each staining solution sample are used as time variables, and the concentration of the effective component of the staining solution is used as the decay target. The decay function of the staining solution concentration as a function of the time variable is fitted and used as the empirical model of staining solution decay.

[0061] Before performing the steps described above, which predict the future trend of dye concentration decline based on dye usage information and an empirical model of dye attenuation, it is necessary to establish the empirical model of dye attenuation in advance. This process is usually performed offline during the calibration stage before the dyeing machine leaves the factory or during the learning stage before a new type of dye is first used, and the generated model parameters are then stored in the memory of the control decision module.

[0062] Multiple batches of slides were sampled at different time points during the staining process, and the concentration of the effective component in each sample was measured. In practice, operators or automated sampling devices continuously ran multiple complete staining batches using the same type and initial concentration of dye solution on a single laboratory staining machine or production equipment. During each batch, a small sample of dye solution was extracted from the staining tank at preset sampling intervals, such as after every 50 slides or every 30 minutes. For hematoxylin staining solutions, the effective concentration of hematoxylin oxidation products, such as haematein, was measured using spectrophotometry or high-performance liquid chromatography. For eosin staining solutions, the absorbance of the dye molecules was measured and converted into a concentration value. Two time variables were recorded for each sample: the total number of slides stained from the first slide in the batch to the sampling time, and the total accumulated usage time of the staining solution from its initial use to the sampling time. These data formed an observation record consisting of three values: the number of stained slides, the usage time, and the concentration of the effective component.

[0063] The number of stained slides and usage time corresponding to each staining solution sample are used as time variables, and the concentration of the effective component of the staining solution is used as the decay target. A decay function of the staining solution concentration as a function of the time variables is fitted, serving as the empirical model for staining solution decay. The fitting process is performed in the accompanying data analysis software. Since staining solution concentration decay typically exhibits nonlinear characteristics, such as rapid initial decay followed by a gradual decrease, an exponential decay model or a double exponential model can be chosen as the function form. Taking the exponential decay model as an example, the function expression is C = C0 × exp(-α × N - β × t), where C is the predicted concentration, C0 is the initial concentration, N is the number of stained slides, t is the usage time, and α and β are the decay coefficients to be fitted. The system substitutes all observation records into this function form and uses a nonlinear least squares algorithm to solve for the optimal values ​​of α and β coefficients. The fitted coefficients differ for different types of staining solutions. Finally, the above function form and the fitted coefficients are encapsulated into an executable calculation module, i.e., the empirical model for staining solution decay. During subsequent online execution, the model takes the current number of stained slides and the duration of use as input and outputs the predicted current stain concentration, as well as the predicted concentration decrease trend after staining multiple consecutive slides using forward recursion. Through this offline modeling step, the system obtains an accurate description of the decay of specific stain physicochemical properties, providing a reliable mathematical basis for subsequent feedforward compensation.

[0064] Furthermore, you can also view Figure 5 , Figure 5This is a flowchart illustrating the third embodiment of the control method for the slide staining machine of the present invention. After the step of setting the staining soaking time of the next slide to be stained corresponding to the target slide in the current staining batch based on the staining time adjustment amount, the method further includes steps S70-80: Step S70: Obtain dye liquor configuration information, and calculate dye liquor configuration parameters based on the dye liquor configuration information and the color feature deviation. The dye liquor configuration parameters include dye liquor temperature adjustment amount and liquid pump flow rate adjustment amount. Step S80: The staining time adjustment amount and staining solution configuration parameters are simultaneously sent to the staining execution mechanism so that the staining execution mechanism can adjust the staining time adjustment amount and staining solution configuration parameters at the same time during the staining process of the next slide to be stained.

[0065] Following the steps described above for setting the staining soaking time for the next slide based on the staining time adjustment, to further improve the control accuracy of staining consistency and expand the dimensions of compensation methods, the system can also simultaneously execute multi-parameter collaborative adjustment logic. This expands the single staining time compensation into the joint control of multiple physical quantities such as time, temperature, and flow rate.

[0066] The dye solution configuration information is obtained, and the dye solution configuration parameters are calculated based on this information and the aforementioned color feature deviation. The dye solution configuration information includes the current set temperature values ​​for each dyeing tank and the base flow rate value of the liquid pump. This information is pre-set by the operator through the human-machine interface and stored in the control decision module. When calculating the dye solution configuration parameters, it is first determined whether the currently calculated color feature deviation exceeds the range that can be effectively compensated for by simply adjusting the staining time. For example, when the blue component deviation of the cell nucleus is too large and multiple consecutive slides show severe deviations in the same direction, it may indicate that the overall activity of the dye solution is severely insufficient. In this case, simply extending the soaking time has limited effect and will significantly reduce the throughput. To address this situation, a preset multi-parameter compensation model is invoked. The input to this model is also the aforementioned color feature deviation vector ΔF, but its output is no longer limited to the time adjustment amount, but is expanded to a multi-dimensional parameter vector that includes the dye solution temperature adjustment amount and the liquid pump flow rate adjustment amount. The calculation of the dye solution temperature adjustment is based on an empirical formula that increases the diffusion rate and coloring efficiency of dye molecules by a certain temperature increase, such as 1 degree Celsius. For deviations where the staining is too light, the system calculates the adjustment amount required to raise the hematoxylin dye solution temperature from room temperature by a certain number of degrees Celsius. The liquid pump flow rate adjustment is used to control the circulation or convection speed of the dye solution within the tank. Increasing the flow rate can enhance the contact renewal between the dye solution and the tissue section surface, and can also compensate for the decrease in concentration to some extent. The system calculates the values ​​of the above two adjustment amounts according to the severity and direction of the deviation.

[0067] The aforementioned staining time adjustment and staining solution configuration parameters are simultaneously sent to the staining execution mechanism, enabling the mechanism to adjust both parameters concurrently during the staining process of the next slide. The staining execution mechanism includes a temperature control unit controlling the heating rod in the staining bath, a frequency converter unit controlling the rotation speed of the circulating pump, and a timing unit controlling the immersion time of the robotic arm. When the control decision module simultaneously sends three sets of instructions—increasing the hematoxylin staining time by a certain number of seconds, raising the hematoxylin staining solution temperature by a certain number of degrees Celsius, and increasing the circulating pump flow rate by a certain percentage—to the corresponding execution units, these units synchronously adjust the parameters before or immediately before the next slide enters the corresponding staining bath. For example, when the next slide is moved to the hematoxylin staining bath by the robotic arm, the staining solution temperature has already been raised according to the instructions, the pump flow rate has been adjusted to the target value, and the timing unit begins timing according to the extended immersion time. Through this multi-parameter coordinated adjustment, the system achieves multi-dimensional joint compensation for the dyeing effect, which can maintain the stability of dyeing quality even under severe dye liquor decay or extreme working conditions, while also avoiding the problem of excessive increase in total batch time caused by relying solely on time compensation.

[0068] Furthermore, you can also view Figure 6 , Figure 6 This is a flowchart illustrating the fourth embodiment of the control method for the slide staining machine of the present invention. The preset compensation model is a machine learning model, and the control method for the slide staining machine further includes steps S90-120: Step S90: Collect historical staining data to construct a training sample set. Each training sample in the training sample set includes an input feature vector and an output time adjustment label. The input feature vector includes the current color feature deviation, the number of stained slides, the stain concentration decay trend, the ambient temperature and humidity, and the stain type. Step S100: Perform offline training on the training sample set to obtain an initial machine learning model; Step S110: Obtain the actual staining effect and the expected staining effect of the stained slide, and calculate the comparison result between the actual staining effect and the expected staining effect; Step S120: Using the comparison results as new training samples, incremental learning training and parameter updates are performed on the initial machine learning model to obtain the preset compensation model.

[0069] In the scenario where the aforementioned preset compensation model employs a machine learning model, this model is not static but can continuously optimize itself through the accumulation of historical data and online learning. To achieve this capability, the control method of the aforementioned slide staining machine further integrates the logic of model building and incremental updates.

[0070] A training sample set is constructed by collecting historical staining data. Each training sample in this set includes an input feature vector and an output time adjustment label. In practice, the staining machine continuously records all relevant parameters of each slide's staining process. For a completed slide, the system uses its state before staining as the input feature vector. This vector includes, but is not limited to, the current color feature deviation (ΔF calculated from the previous slide), the number of stained slides before this slide, the current dye concentration decay trend predicted by the dye decay empirical model, the temperature and humidity sensor readings of the staining machine's environment, and the dye type code currently used. The output time adjustment label of this training sample is the time adjustment vector that was actually executed during the staining process and ultimately proved to produce good staining results, such as the hematoxylin time adjustment and eosin time adjustment. The system collects the above input-output pairs corresponding to each slide, forming a continuously growing historical database. When a preset size of 2000 samples is accumulated, it constitutes a training sample set that can be used for model training.

[0071] The initial machine learning model is obtained by offline training on the aforementioned training sample set. Offline training can be performed automatically during the idle period of the colorimeter or by exporting the data to an external high-performance computing server. The model can be support vector regression, random forest regression, or a lightweight multilayer perceptron neural network. The goal of training is to enable the model to learn the nonlinear mapping relationship between the input feature vector and the output time adjustment. During training, the input feature vectors from the training sample set are sequentially fed into the model to be trained. The model outputs a predicted time adjustment, and then the loss function, such as root mean square error, is calculated by comparing this predicted value with the true time adjustment labels recorded in the samples. The weight parameters inside the model are continuously adjusted through the backpropagation algorithm or a corresponding optimizer until the loss function value is reduced to a preset convergence threshold. After training, an initial machine learning model is obtained and deployed back to the control decision module for online inference.

[0072] The actual and expected staining effects of the stained slides are obtained, and a comparison between the actual and expected staining effects is calculated. During the online operation of the staining machine, when a slide completes staining and passes the online visual inspection station, its quantified color feature values ​​are extracted for adjusting the next slide. These feature values ​​are also compared with a preset ideal color feature target range to calculate an actual staining effect score. Simultaneously, the expected staining effect predicted by the machine learning model before staining is reviewed—that is, the color feature values ​​the model expects to achieve with the adjusted amount. Subtracting the expected effect from the actual effect yields a deviation vector, which reflects the prediction error of the current model under the current operating conditions.

[0073] Using the comparison results as new training samples, the initial machine learning model is incrementally trained and its parameters updated to obtain the aforementioned pre-set compensation model. Specifically, the calculated deviation vector is combined with the input feature vector corresponding to the occurrence of the deviation to form a new training sample with actual correction information. The label of this sample is not the original time adjustment amount, but the corrected, optimized time adjustment amount. Using an incremental learning algorithm, such as online gradient descent or mini-batch stochastic gradient descent, this new sample is used to update the parameters of the currently deployed machine learning model one or more times. The updated model parameters are saved and immediately used for subsequent slide time adjustment prediction. Through this learn-as-you-go mechanism, the aforementioned pre-set compensation model can gradually adapt to the staining characteristics, environmental fluctuations, and operating habits of a specific laboratory, achieving an evolution from a general model to a personalized, self-optimizing model.

[0074] In addition, the control method of the slide staining machine also includes: After the current dyeing batch is completed, a batch quality report based on the dyeing batch is generated. The batch quality report includes parameter adjustment records, color feature change curves, and model output deviation analysis from reality. When multiple consecutive batches of staining effect scores are detected to be lower than a preset threshold, the retraining process of the preset compensation model is triggered.

[0075] Building upon the aforementioned control method for the slide staining machine based on a machine learning model, to ensure the model maintains good predictive accuracy throughout long-term operation and promptly detects systematic performance degradation, this method further integrates a model health management and retraining trigger mechanism. This mechanism executes the following logic after each staining batch and during cross-batch monitoring.

[0076] After the current staining batch is completed, a batch quality report based on that batch is automatically generated. This report is not a simple operation log, but contains multi-dimensional information for evaluating model performance and staining quality. The first part of the report is a parameter adjustment record, which details the staining time adjustments for each slide in the batch in the form of a time series table, including hematoxylin adjustment time, eosin adjustment time, differentiation adjustment time, and bluing adjustment time, as well as whether each adjustment was made by feedback control, feedforward control, or the model's own output. The second part of the report is a color feature change curve. This curve plots the actual measured feature value changes of all slides in the entire batch, with the slide number as the horizontal axis and the three key quantitative color feature values ​​of average blue component of the cell nucleus, average red component of the cytoplasm, and nucleocytoplasmic contrast as the vertical axis. The report overlays this trajectory with the preset ideal color feature target range on the same chart, allowing operators to intuitively see whether the staining effect of the entire batch is stably within the target range. The third part of the report is the model output and actual deviation analysis. This analysis statistically correlates the time adjustment predicted by the machine learning model for each slide with the actual measured color feature deviation after staining the slide, calculating the mean, standard deviation, and maximum deviation of the model prediction error. This report is presented to the operator through a human-computer interaction interface and stored in a data storage module in a structured data format such as JSON or CSV.

[0077] Based on the batch quality report generated above, a cross-batch model performance monitoring and retraining trigger logic is further executed. When multiple consecutive batches are detected to have staining effect scores below a preset threshold, the retraining process of the preset compensation model is automatically triggered. The staining effect score is calculated as follows: for each batch, the number of slides falling outside the ideal target range in the color feature curve is counted, divided by the total number of slides in the batch to obtain the failure rate, and then the failure rate is converted into a percentage score. For example, a failure rate of 0% is a score of 100 points, and the score decreases by 5 points for every 1% increase in the failure rate. The preset threshold can be set to 80 points. In addition, a sliding window is maintained to record the scores of the five most recent consecutive batches. When the scores of these five batches are all below 80 points, it indicates that the currently deployed machine learning model can no longer adapt to the latest changes in the staining solution or environment, and a systematic bias has occurred. After triggering the retraining process, all new historical staining data accumulated since the last model training is retrieved from the data storage module, along with the original training data, and the complete offline training process described above is re-executed. After training, a new machine learning model is generated. Once cross-validation confirms that its prediction error is significantly lower than the old model, it automatically replaces the model currently running in the control decision module. Through this quality report and retraining trigger mechanism, the above method achieves closed-loop monitoring and maintenance of its core algorithm components, ensuring the continuous effectiveness and reliability of the machine learning compensation model throughout its entire lifecycle.

[0078] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the control method of the slide staining machine of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0079] This application provides a slide staining machine equipped with an online machine vision feedback system. The slide staining machine includes a staining tank, a staining process line, a scanner, and the online machine vision feedback system. The staining process line is located inside the slide staining machine. The online machine vision feedback system has an image acquisition position located between the staining tank and the scanner. One or more online visual inspection stations are provided in the staining process line. Each online visual inspection station includes a high-speed camera, an LED cold light source, a slide positioning sensor, and a light shield. The scanner includes at least one processor and a memory communicatively connected to the at least one processor. The memory stores instructions executable by the at least one processor, which, when executed, enables the at least one processor to perform the control method for the slide staining machine described in Embodiment 1.

[0080] The following is for reference. Figure 7The diagram illustrates a structural schematic of a scanner suitable for implementing embodiments of this application. The scanner in these embodiments may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The scanner shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of this application.

[0081] like Figure 7 As shown, the scanner may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.) that can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the slide staining machine. The processing device 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. The communication device 1009 allows the scanner to communicate wirelessly or wiredly with other devices to exchange data. While scanners with various systems are shown in the figures, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.

[0082] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0083] The slide staining machine provided in this application, employing the control method of the slide staining machine in the above embodiments, can solve the technical problem of inconsistent staining colors within batches caused by dye consumption in existing slide staining machines. Compared with the prior art, the beneficial effects of the slide staining machine provided in this application are the same as those of the control method of the slide staining machine provided in the above embodiments, and other technical features of this slide staining machine are the same as those disclosed in the method of the previous embodiment, and will not be repeated here.

[0084] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0085] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0086] This application provides a storage medium, which is a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the control method of the slide staining machine in the above embodiments.

[0087] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0088] The aforementioned computer-readable storage medium may be included in the slide staining machine; or it may exist independently and not assembled into the slide staining machine.

[0089] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the slide staining machine, enable the slide staining machine to implement the technical content of the control method embodiment of the slide staining machine as shown above.

[0090] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0091] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0092] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0093] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the control method of the above-described slide staining machine, which can solve the technical problem of inconsistent staining colors within batches due to dye consumption in existing slide staining machines. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the control method of the slide staining machine provided in the above embodiments, and will not be repeated here.

Claims

1. A control method for a slide staining machine, characterized in that, The method for controlling a slide staining machine includes the following steps: (The slide staining machine is equipped with a high-speed camera, an LED cold light source, a slide positioning sensor, and a light shield.) Acquire tissue images of at least one target slide in the current staining batch, wherein the target slide is a slide located between the staining area and the scanning area; Quantitative color feature values ​​are extracted from the tissue image on the slide. The quantitative color feature values ​​include the average blue component of the cell nucleus, the average red component of the cytoplasm, and the nucleoplasm contrast. Obtain the target range of color features associated with the current dyeing batch, and determine the color feature deviation between the quantized color feature value and the target range of color features; The color feature deviation is obtained by using a preset compensation model to determine the dyeing time adjustment amount, and the dyeing soaking time of the next slide to be dyed in the current dyeing batch is set based on the dyeing time adjustment amount.

2. The control method for the section staining machine as described in claim 1, characterized in that, The step of obtaining the dyeing time adjustment amount corresponding to the color feature deviation through a preset compensation model includes: Obtain the number of glass slides that have been stained in the current staining batch and the information on the use of the staining solution, including the initial concentration, the duration of use, and the type of staining solution; Based on the dye usage information and the dye attenuation empirical model, the trend of dye concentration decrease caused by dyeing multiple consecutive slides to be stained in the future staining process is predicted. The decreasing trend of the dye concentration is converted into a feedforward compensation amount, and the feedback compensation amount is calculated based on the color feature deviation. The feedforward compensation amount and the feedback compensation amount are weighted and superimposed to obtain the staining time adjustment amount. The feedback compensation amount is used to adjust the staining time of the next adjacent slide, and the feedforward compensation amount is used to adjust the staining time of multiple subsequent slides. The window length of the feedforward compensation is dynamically set according to the staining solution decay rate.

3. The control method for the section staining machine as described in claim 2, characterized in that, Before the step of predicting the trend of decreasing dye concentration after staining of multiple consecutive slides in future staining processes based on the dye usage information and the dye attenuation empirical model, the method further includes: Multiple batches of glass slides were collected at different time points during the staining process, and the concentration of the effective components in each staining sample was measured. The number of stained slides and the usage time corresponding to each staining solution sample are used as time variables, and the concentration of the effective component of the staining solution is used as the decay target. The decay function of the staining solution concentration as a function of the time variable is fitted and used as the empirical model of staining solution decay.

4. The control method for the section staining machine as described in claim 1, characterized in that, The step of extracting quantized color feature values ​​from the slide tissue image includes: Obtain the reference color feature values ​​of the fixed color card reference image for the current dyeing batch; The combined drift of the current lighting environment and camera response is calculated based on the reference color feature value and the pre-stored calibration value. The quantized color feature value is corrected by the overall drift amount.

5. The control method for the section staining machine as described in claim 1, characterized in that, The preset compensation model is a linear mapping model. The step of obtaining the staining time adjustment amount corresponding to the color feature deviation through the preset compensation model, and setting the staining soaking time of the next slide to be stained in the current staining batch based on the staining time adjustment amount, includes: The color feature deviation is decomposed into a multidimensional deviation vector, which includes the nuclear blue component deviation, the cytoplasmic red component deviation, and the nuclear-cytoplasmic contrast deviation. The independent compensation coefficients for each slide staining step are obtained, and the independent compensation coefficients are organized into a compensation coefficient matrix. The slide staining steps include hematoxylin staining, eosin staining, differentiation, and bluing. A linear mapping operation is performed on the multidimensional deviation vector and the compensation coefficient matrix to obtain the preliminary time adjustment vector corresponding to each staining step; The initial time adjustment vector is algebraically superimposed with the baseline staining time of the slide to be stained in the corresponding staining step to obtain the staining soaking time for each staining step.

6. The control method for the section staining machine as described in claim 1, characterized in that, After setting the staining soaking time for the next slide to be stained corresponding to the target slide in the current staining batch based on the staining time adjustment amount, the method further includes: Obtain dye liquor configuration information, and calculate dye liquor configuration parameters based on the dye liquor configuration information and the color feature deviation. The dye liquor configuration parameters include the dye liquor temperature adjustment amount and the liquid pump flow rate adjustment amount. The staining time adjustment and staining solution configuration parameters are simultaneously sent to the staining execution mechanism so that the staining execution mechanism can adjust the staining time adjustment and staining solution configuration parameters at the same time during the staining process of the next slide to be stained.

7. The control method for the section staining machine as described in claim 1, characterized in that, The preset compensation model is a machine learning model, and the control method of the slide staining machine further includes: Historical staining data is collected to construct a training sample set. Each training sample in the training sample set includes an input feature vector and an output time adjustment label. The input feature vector includes the current color feature deviation, the number of stained slides, the stain concentration decay trend, the ambient temperature and humidity, and the stain type. The training sample set is trained offline to obtain an initial machine learning model; Obtain the actual staining effect and the expected staining effect of the stained slide, and calculate the comparison result between the actual staining effect and the expected staining effect; The comparison results are used as new training samples to perform incremental learning training and parameter updates on the initial machine learning model, thereby obtaining the preset compensation model.

8. The control method for the section staining machine as described in claim 7, characterized in that, The control method for the slide staining machine also includes: After the current dyeing batch is completed, a batch quality report based on the dyeing batch is generated. The batch quality report includes parameter adjustment records, color feature change curves, and model output deviation analysis from reality. When multiple consecutive batches of staining effect scores are detected to be lower than a preset threshold, the retraining process of the preset compensation model is triggered.

9. A slide staining machine, characterized in that, The slide staining machine stores a computer program, which, when executed by a processor, implements the control method of the slide staining machine according to any one of claims 1-8.

10. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the control method of the slide staining machine according to any one of claims 1-8.