A method and system for optimizing matrix spray parameters for mass spectrometry imaging
By optimizing the spraying parameters in mass spectrometry imaging and automatically adjusting the nozzle movement speed according to the differences in hydrophilicity and hydrophobicity of the tissue slice surface, the problem of uneven matrix spraying was solved, and the signal uniformity and spatial resolution of mass spectrometry imaging were improved.
Patent Information
- Application Number
- CN202610823546.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-09
- Publication Date
- 2026-08-25
AI Technical Summary
In existing mass spectrometry imaging techniques, the difference in hydrophilicity and hydrophobicity in different regions of the tissue section surface leads to uneven matrix spraying, which affects the signal uniformity and spatial resolution of mass spectrometry imaging.
By acquiring optical images of the surface of tissue sections, dividing them into multiple grid cells, calculating the hydrophilicity/hydrophobicity index of each grid cell, and using a pre-trained spraying parameter prediction model to optimize the nozzle movement speed, merging adjacent grid cells into spraying areas, calculating and correcting the nozzle movement speed, and finally achieving differentiated spraying.
This improved the signal uniformity and spatial resolution of mass spectrometry imaging, and achieved adaptive matching between matrix coverage and the hydrophilicity/hydrophobicity of tissue section surfaces.
Smart Images

Figure CN122632618A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of deep learning technology, and specifically to a method and system for optimizing matrix spraying parameters for mass spectrometry imaging. Background Technology
[0002] During the matrix spraying process in mass spectrometry imaging, different regions on the surface of tissue sections exhibit varying hydrophilicity and hydrophobicity. Hydrophobic regions show a weaker ability to accept the spread of matrix solution, while hydrophilic regions show a stronger ability to accept the spread of matrix solution.
[0003] Existing matrix spraying methods use a fixed speed for uniform spraying, which cannot adjust the nozzle movement speed according to the differences in hydrophilicity and hydrophobicity of different areas on the tissue section surface. This results in a mismatch between the matrix coverage and surface characteristics, affecting the signal uniformity and spatial resolution of mass spectrometry imaging.
[0004] Therefore, a method for optimizing matrix spraying parameters in mass spectrometry imaging is needed to achieve adaptive matching between matrix coverage and the hydrophilicity / hydrophobicity of different regions on the tissue slice surface. Summary of the Invention
[0005] This invention provides a method and system for optimizing matrix spraying parameters for mass spectrometry imaging, which solves the technical problems in the prior art that lead to uneven spraying and low spatial resolution consistency in mass spectrometry imaging due to differences in the hydrophilicity and hydrophobicity of tissue surfaces.
[0006] In a first aspect, the present invention provides a method for optimizing matrix spraying parameters for mass spectrometry imaging, the method comprising: An optical image of the surface of a tissue section is acquired, and the optical image is uniformly divided into multiple grid units arranged in rows and columns. The optical reflectance value of each grid unit is extracted from the optical image to form an optical reflectance distribution map. The optical reflectance distribution map is preprocessed, and the hydrophilicity / hydrophobicity index of each grid cell is calculated. The hydrophilicity / hydrophobicity index of each grid cell is input into the pre-trained spraying parameter prediction model, and the predicted value of the nozzle movement speed of each grid cell is output. Mesh cells that are adjacent in the same row and whose differences in the predicted nozzle movement speed are within a preset tolerance range are merged into the same spraying area. The arithmetic mean of the predicted nozzle movement speed of all mesh cells in each spraying area is calculated to obtain the initial optimized nozzle movement speed of each spraying area. The initial optimized nozzle movement speed is corrected to obtain the optimized nozzle movement speed for each spraying area. Based on the optimized nozzle movement speed for each spraying area, the spraying device is controlled to perform differentiated spraying of matrix solution on the surface of the tissue section.
[0007] In a second aspect, the present invention provides a matrix spraying parameter optimization system for mass spectrometry imaging, the system comprising: The optical reflectance value extraction module is used to acquire optical images of the surface of tissue sections, divide the optical images into multiple grid units arranged in rows and columns, extract the optical reflectance value of each grid unit from the optical images, and form an optical reflectance distribution map. The hydrophilicity / hydrophobicity index acquisition module is used to preprocess the optical reflectance distribution map and calculate the hydrophilicity / hydrophobicity index of each grid cell. The nozzle movement speed prediction module is used to input the hydrophilicity / hydrophobicity index of each grid cell into the pre-trained spraying parameter prediction model and output the predicted value of the nozzle movement speed of each grid cell. The spraying area merging module is used to merge adjacent grid cells in the same row that have a difference in the predicted nozzle movement speed within a preset tolerance range into the same spraying area. It calculates the arithmetic mean of the predicted nozzle movement speed of all grid cells in each spraying area to obtain the initial optimized nozzle movement speed of each spraying area. The initial optimized nozzle movement speed correction module is used to correct the initial optimized nozzle movement speed to obtain the optimized nozzle movement speed for each spraying area, and control the spraying device to perform differentiated spraying of matrix solution on the surface of the tissue section according to the optimized nozzle movement speed of each spraying area.
[0008] One or more technical solutions provided in this invention have at least the following technical effects or advantages: This invention provides a method and system for optimizing matrix spraying parameters for mass spectrometry imaging. First, an optical image of the tissue section surface is acquired and uniformly divided into multiple grid cells. The optical reflectance value of each grid cell is extracted to construct an optical reflectance distribution map. Second, the optical reflectance distribution map is preprocessed, and the hydrophilicity / hydrophobicity index of each grid cell is calculated. Third, the hydrophilicity / hydrophobicity index is input into a pre-trained spraying parameter prediction model to obtain a predicted nozzle movement speed. Further, the grid cells are merged into spraying regions, and the initial optimized nozzle movement speed for each spraying region is calculated, reducing the number of nozzle movement speed changes during spraying and improving control stability. Finally, the optimized nozzle movement speed for each spraying region is obtained through correction, and the spraying device is controlled to perform differentiated spraying of the matrix solution onto the tissue section surface according to the optimized nozzle movement speed of each spraying region. This method automatically optimizes the nozzle movement speed based on the local hydrophilicity / hydrophobicity characteristics of the tissue section, achieving differentiated spraying for different hydrophilicity / hydrophobic regions. Ultimately, it achieves adaptive matching between matrix coverage and the hydrophilicity / hydrophobicity of the tissue section surface, improving the signal uniformity and spatial resolution of mass spectrometry imaging. Attached Figure Description
[0009] Figure 1 This is a schematic flowchart of a matrix spraying parameter optimization method for mass spectrometry imaging provided by the present invention; Figure 2 This is a logical schematic diagram of a matrix spraying parameter optimization method for mass spectrometry imaging provided by the present invention; Figure 3 This is a schematic diagram of a matrix spraying parameter optimization system for mass spectrometry imaging provided by the present invention.
[0010] In the attached diagram, the components represented by each number are as follows: Module 11 for extracting optical reflectance values; Module 12 for obtaining hydrophilicity / hydrophobicity index; Module 13 for predicting nozzle movement speed; Module 14 for merging spraying areas; Module 15 for correcting nozzle movement speed after initial optimization. Detailed Implementation
[0011] This invention provides a method and system for optimizing matrix spraying parameters for mass spectrometry imaging, which solves the technical problems in the prior art that lead to uneven spraying and low spatial resolution consistency in mass spectrometry imaging due to differences in the hydrophilicity and hydrophobicity of tissue surfaces.
[0012] The present invention will now be described in detail with reference to the accompanying drawings.
[0013] like Figure 1 , Figure 2 As shown, in one embodiment, the present invention provides a method for optimizing matrix spraying parameters for mass spectrometry imaging, the method comprising: S10: Acquire an optical image of the surface of a tissue section, divide the optical image into multiple grid units arranged in rows and columns, extract the optical reflectance value of each grid unit from the optical image, and form an optical reflectance distribution map; In this embodiment of the invention, the optical image is a two-dimensional grayscale or color digital image acquired by an imaging sensor after illuminating the surface of the object under test with a visible light source; the tissue section refers to a thin slice cut from biological tissue using a slicer after processing such as sampling and fixation; the grid cell is a basic spatial sub-region obtained by dividing the optical image according to a fixed number of rows and columns; the optical reflectance value is the arithmetic mean of the grayscale values of all pixels in the grid cell; and the optical reflectance distribution map is a two-dimensional numerical matrix formed by arranging the optical reflectance values of all grid cells in the original row and column order.
[0014] Specifically, the prepared tissue sections are placed on the platform of a spraying device, and their surface optical images are acquired using an industrial camera under standard light source conditions. Then, based on the spatial resolution of the optical image, the entire optical image is uniformly divided into multiple grid cells arranged in rows and columns. Next, the optical reflectance value of each grid cell is calculated. The optical reflectance value of each grid cell is then filled into the matrix elements corresponding to its row and column positions, forming an optical reflectance distribution map.
[0015] Step S10 in the method of this embodiment of the invention includes: The prepared tissue section is placed on the working platform of the spraying device, and the height of the working platform is adjusted so that the vertical distance between the surface of the tissue section and the nozzle of the spraying device is equal to the preset standard working height. Optical images of the tissue slice surface are acquired under standard light source illumination conditions using an industrial camera deployed above the work platform. The nozzle coverage diameter of the spraying device is obtained, and the nozzle coverage diameter is converted into the corresponding number of pixels according to the spatial resolution of the optical image. The number of pixels is used as the grid side length, and the optical image is uniformly divided into multiple grid units arranged in rows and columns.
[0016] In this embodiment of the invention, firstly, the prepared glass slide containing tissue sections is placed on the working platform of the spraying device. The height of the working platform is adjusted so that the vertical distance between the surface of the tissue section and the nozzle of the spraying device is equal to the preset standard working height. The preset standard working height is the vertical distance between the nozzle outlet and the surface of the tissue section, optimized through previous experiments, and is typically 10–40 mm. At the preset standard working height, the atomized droplets will not dry excessively before reaching the surface, and will not splash due to excessive impact velocity, thus forming a uniform matrix crystalline layer.
[0017] Secondly, an industrial camera deployed above the work platform acquires optical images of the tissue slide surface under standard light source illumination conditions. These standard light source illumination conditions ensure that parameters such as illumination intensity, incident angle, and color temperature remain constant during the acquisition of optical images of the tissue slide surface. For example, an illumination intensity of 10000 Lux, a ring-shaped LED light source, an incident angle of 90 degrees, and a color temperature of 5500K.
[0018] Finally, after obtaining the nozzle coverage diameter, it is converted into the corresponding number of pixels based on the spatial resolution of the optical image. The number of pixels at the spatial resolution is then used as the side length of the square grid unit, and the optical image is uniformly divided into multiple grid units arranged in rows and columns. Here, the nozzle coverage diameter refers to the diameter of the circular area formed by the intersection of the atomizing cone and the surface at the standard working height; the spatial resolution refers to the actual physical size corresponding to each pixel.
[0019] For example, the optical image size of a tissue section is 10mm × 10mm, the spatial resolution is 10μm / pixel, and the pixel size of the optical image is 1000 × 1000. The nozzle coverage diameter is 2mm, which is equivalent to 200 pixels. Then the optical image is divided into 5 rows × 5 columns, a total of 25 grid units, and each grid unit corresponds to a 2mm × 2mm area on the tissue section surface.
[0020] It should be noted that when converting the nozzle coverage diameter to the corresponding number of pixels, and using the number of pixels as the grid side length, although from a static geometric perspective, the coverage area of a circular nozzle cannot completely fill a square grid cell of equal side length (the four corners of the square fall outside the circular coverage area), in the actual operation of matrix spraying, the nozzle does not stop at the center of each grid cell for a single spray, but moves continuously row by row along the scanning direction, continuously spraying the matrix solution downwards at a constant atomization pressure and atomization flow rate during the movement. A series of circular coverage areas formed by the nozzle during the movement continuously overlap along the scanning direction. The overlapping circular coverage spots merge on the tissue section surface into a continuous coverage band with a width equal to the nozzle coverage diameter. This continuous coverage band can precisely cover the strip-shaped area where the row of grid cells is located. Therefore, using the nozzle coverage diameter as the grid side length allows the size of each grid cell to precisely match the minimum effective coverage width formed by the spraying device during continuous moving spraying, with the grid side length equal to the width of the continuous coverage band, thereby achieving seamless full-coverage spraying of the entire tissue section surface.
[0021] Step S10 in the method of this embodiment of the invention further includes: For each grid cell, obtain the gray values of all pixels within that grid cell, calculate the arithmetic mean of the gray values of all pixels, and use the arithmetic mean as the optical reflectance value of that grid cell. The optical reflectance values of all grid cells are arranged according to the row and column positions of the grid cells to form an optical reflectance distribution map.
[0022] In this embodiment of the invention, firstly, for each grid cell, the grayscale values of all pixels within that grid cell are obtained. The sum of all grayscale values within the grid cell is then divided by the total number of pixels in that grid cell to obtain the arithmetic mean of the grayscale values. This arithmetic mean of the grayscale values is then used as the optical reflectivity value of that grid cell. Here, the grayscale value is the brightness value of each pixel in the digital image, ranging from 0 to 255, and is positively correlated with surface reflectivity.
[0023] Secondly, the optical reflectance values of all grid cells are calculated and written into the position of the x-th row and y-th column of a two-dimensional array according to their row number x and column number y in the optical image, forming a two-dimensional numerical matrix, which is the optical reflectance distribution map.
[0024] For example, the grayscale mean of 200×200 pixels in each grid cell is extracted to obtain 25 reflectance values, which are arranged in order to form a 5×5 optical reflectance distribution map.
[0025] In this embodiment of the invention, optical images are acquired and uniformly divided into multiple grid cells arranged in rows and columns, providing a spatial coordinate reference for subsequent local differential control and effectively suppressing random noise and local fluctuations caused by small structures in optical image acquisition. Simultaneously, the spatial adjacency relationship is preserved through the optical reflectance distribution map, providing standardized input data for calculating the hydrophilicity / hydrophobicity index.
[0026] S20: Preprocess the optical reflectance distribution map and calculate the hydrophilicity / hydrophobicity index of each grid cell; In this embodiment of the invention, the preprocessing is a transformation operation performed on the optical reflectance distribution map; the hydrophilicity-hydrophobicity index is a physical parameter that quantitatively characterizes the degree to which a solid surface is wetted by a liquid.
[0027] Specifically, the optical reflectance value of each grid cell in the optical reflectance distribution map is preprocessed to obtain the relative reflectance of each grid cell. This eliminates systematic errors caused by uneven light source illumination and differences in camera response. Subsequently, a pre-calibrated reflectance-contact angle mapping table is obtained, and the hydrophilicity / hydrophobicity index of each grid cell is retrieved based on the relative reflectance value.
[0028] Step S20 in the method of this embodiment of the invention includes: Calculate the ratio of the optical reflectance value of each grid cell in the optical reflectance distribution map to the preset standard reflectance reference value, and use the ratio as the relative reflectance of the grid cell. The standard reflectance reference value is the optical reflectance value of the blank slide area without tissue coverage on the surface of the tissue section. Obtain a pre-calibrated reflectivity-contact angle mapping table, wherein the reflectivity-contact angle mapping table is a mapping table from relative reflectivity to contact angle value; Based on the relative reflectance of each grid cell, the corresponding contact angle value is looked up in the reflectance-contact angle mapping table, and the looked-up contact angle value is used as the hydrophilicity / hydrophobicity index of that grid cell.
[0029] In this embodiment of the invention, firstly, the ratio of the optical reflectance value of each grid cell in the optical reflectance distribution map to a preset standard reflectance reference value is calculated. This ratio is used as the relative reflectance of that grid cell. The standard reflectance reference value is the optical reflectance value of the uncovered area of the slide on the surface of the tissue section, comprehensively reflecting the light source intensity, camera response, and the reflective characteristics of the slide itself. The relative reflectance is used to eliminate systematic errors. Since tissue typically absorbs more light than the slide, the relative reflectance is usually less than 1; however, if the tissue has a highly reflective structure such as fat, it can be greater than 1.
[0030] Secondly, a reflectance-contact angle mapping table, pre-established through experimental calibration, was obtained. This table records the quantitative correspondence between different relative reflectances and their corresponding contact angle values. The contact angle value is the angle between the gas-liquid interface and the solid-liquid interface when a droplet reaches thermodynamic equilibrium on a solid surface.
[0031] Finally, based on the relative reflectivity of each grid cell, the corresponding contact angle value is looked up in the reflectivity-contact angle mapping table, and the contact angle value is used as the hydrophilicity / hydrophobicity index of that grid cell.
[0032] In the method of this embodiment of the invention, obtaining a pre-calibrated reflectivity-contact angle mapping table includes: Multiple standard sample surfaces with different hydrophilicity and hydrophobicity were prepared. The contact angle value of each standard sample surface was measured at room temperature using a contact angle meter to obtain the contact angle label value of each standard sample surface. Under standard light source illumination conditions, optical images of the surface of each standard sample were acquired, and the relative reflectance of the surface of each standard sample was calculated. Multiple discrete data points are formed by combining the relative reflectance and contact angle label values of the surfaces of multiple standard samples. Interpolation is then performed on these discrete data points to obtain a reflectance-contact angle mapping table covering a continuous range of relative reflectance.
[0033] In this embodiment of the invention, firstly, because the surface tension of a liquid changes with temperature, the room temperature conditions must be kept consistent: the ambient temperature is controlled at 20~25℃, and the relative humidity at 40%~60%. Clean glass slides or silicon wafers are selected as substrates, and multiple standard sample surfaces with different hydrophilicity and hydrophobicity are prepared through different surface treatment processes. The standard samples are placed sequentially on the stage of a contact angle measuring instrument. Under room temperature conditions, after the droplets stabilize, images are captured using the camera of the contact angle measuring instrument, and the contact angle of each standard sample surface is calculated to obtain the contact angle label value for each standard sample surface.
[0034] Specifically, a standard sample surface is a series of solid planes with known, stable and uniform surface wettability, usually prepared from glass or silicon wafers with different chemical modifications; a contact angle meter is a precision optical instrument that drops a fixed volume of liquid onto a solid surface, uses a high-magnification camera to photograph the outline of the droplet, and calculates the contact angle using image analysis software. The accuracy of the contact angle calculation is usually ±0.1°.
[0035] Next, the standard samples with the contact angle measured are transferred to the working platform of the spraying device. Using the same standard light source illumination conditions as when collecting tissue sections, optical images of the surface of each standard sample are acquired to obtain optical reflectance values. Under the same acquisition conditions, optical images of blank slides are acquired, and the grayscale mean of the optical images is calculated to obtain a preset standard reflectance reference value. For each standard sample, one or more uniform regions are selected from the acquired images, and the ratio of the optical reflectance value within that region to the preset standard reflectance reference value is calculated to obtain the relative reflectance of each standard sample surface.
[0036] Finally, the relative reflectance and contact angle label values of the surfaces of multiple standard samples were combined to form multiple discrete data points. A linear interpolation formula was used to interpolate these discrete data points, constructing a reflectance-contact angle mapping table covering a continuous range of relative reflectance.
[0037] In the method of this embodiment of the invention, the relative reflectance and contact angle label values corresponding to the surfaces of the plurality of standard samples are used to form a plurality of discrete data points. Interpolation processing is performed on the plurality of discrete data points to obtain a reflectance-contact angle mapping table covering a continuous range of relative reflectance, including: Multiple discrete data points are arranged in ascending order of relative reflectivity to form an ordered discrete data point sequence. For any relative reflectance value between any two adjacent discrete data points in the ordered discrete data point sequence, the contact angle value corresponding to the relative reflectance value is calculated by linear interpolation based on the proportional relationship between the relative reflectance value and the relative reflectance values of the two adjacent discrete data points before and after, so as to obtain a reflectance-contact angle mapping table covering the entire continuous interval from the minimum relative reflectance value to the maximum relative reflectance value.
[0038] In this embodiment of the invention, firstly, multiple discrete data points are arranged in ascending order of relative reflectivity to form an ordered discrete data point sequence.
[0039] Secondly, it is assumed that within an ordered discrete data point sequence, the relative reflectance and the contact angle are linearly related, that is, the contact angle value changes at a constant rate with respect to the relative reflectance.
[0040] For any relative reflectance value between any two adjacent discrete data points in an ordered discrete data point sequence, the contact angle value corresponding to the relative reflectance value is calculated using a linear interpolation method based on the proportional relationship between this relative reflectance value and the relative reflectance values of the two adjacent discrete data points before and after it. For any relative reflectance r∈[r] within a continuous interval... i ,r i+1 The interpolation formula is: , where r is the relative reflectivity and θ is the contact angle. The continuous interval is the interval consisting of all real numbers between the minimum and maximum relative reflectivity.
[0041] Then, based on the contact angle value, a reflectance-contact angle mapping table covering the entire continuous range from the minimum relative reflectance value to the maximum relative reflectance value is constructed.
[0042] In this embodiment of the invention, a reflectance-contact angle mapping table covering a continuous range of relative reflectance is constructed using a linear interpolation method to ensure the reliability of the mapping relationship and avoid errors caused by discretization. The hydrophilicity-hydrophobicity index is then looked up from the reflectance-contact angle mapping table based on the relative reflectance, transforming the dimensionless relative reflectance into a parameter describing the hydrophilicity-hydrophobicity of the surface, thus providing input data for subsequent processing.
[0043] S30: Input the hydrophilicity / hydrophobicity index of each grid cell into the pre-trained spraying parameter prediction model, and output the predicted value of the nozzle movement speed of each grid cell. In this embodiment of the invention, the hydrophilicity / hydrophobicity index of each grid cell is used as an input feature and input into the trained spraying parameter prediction model; the spraying parameter prediction model outputs the predicted value of the nozzle movement speed corresponding to the hydrophilicity / hydrophobicity index through nonlinear transformation.
[0044] In the method of this embodiment of the invention, the pre-training process of the spraying parameter prediction model includes: Obtain a historical spraying sample set, wherein each historical spraying sample in the historical spraying sample set contains the historical hydrophilicity and hydrophobicity index of multiple grid cells on a historical tissue slice, and the corresponding optimal nozzle movement speed label. An initial spraying parameter prediction model is constructed based on a fully connected neural network. The initial spraying parameter prediction model includes an input layer, at least two hidden layers, and an output layer. The input layer receives the hydrophilicity / hydrophobicity index, the output layer outputs the predicted value of the nozzle movement speed, and the hidden layer uses a rectified linear unit as the activation function. The historical hydrophobicity index in the historical spraying sample set is used as the input feature, the corresponding optimal nozzle movement speed label is used as the output label, and the mean square error between the output nozzle movement speed prediction value and the optimal nozzle movement speed label is used as the training objective. The initial spraying parameter prediction model is trained in a supervised manner. When the mean square error meets the preset convergence condition, the trained spraying parameter prediction model is obtained. The optimal nozzle movement speed label is determined as follows: For each grid cell in each historical spraying sample, under the condition of fixed atomization pressure, atomization flow rate and standard working height, the grid cell is sprayed with multiple different nozzle movement speeds. The actual matrix coverage of the grid cell is measured after each spraying. The deviation between the actual matrix coverage and the target matrix coverage of the grid cell is calculated. The nozzle movement speed that minimizes this deviation is taken as the optimal nozzle movement speed label for the grid cell.
[0045] In this embodiment of the invention, firstly, a historical spraying sample set is obtained. Each historical spraying sample in the historical spraying sample set contains the historical hydrophilicity / hydrophobicity index of multiple grid cells on a historical tissue slice, as well as the corresponding optimal nozzle movement speed label. The historical spraying sample set is a collection of historical data from several independent spraying experiments.
[0046] Specifically, 20,000 historical spraying experiment data points can be collected. The hydrophilicity / hydrophobicity index of each grid cell is calculated for the organized slices of the historical spraying experiment data. Each grid cell's (hydrophilicity / hydrophobicity index, optimal speed) is used as a sample. Subsequently, samples from all grid cells and all historical slices are aggregated to construct a historical spraying sample set, with the input feature dimension and label dimension both being 1.
[0047] Secondly, an initial spraying parameter prediction model is constructed based on a fully connected neural network. The fully connected neural network is a type of feedforward artificial neural network in which each neuron in each layer is connected to all neurons in the next layer.
[0048] Specifically, the initial spraying parameter prediction model includes an input layer, at least two hidden layers, and an output layer. The input layer receives the hydrophilicity / hydrophobicity index, the output layer outputs the predicted nozzle movement speed, and the hidden layers use rectified linear units as activation functions.
[0049] For example, the initial spraying parameter prediction model constructed based on a fully connected neural network has an input layer with an input dimension of 1, receiving the hydrophilicity / hydrophobicity index of the grid cells; the hidden layers consist of two fully connected hidden layers, the first containing 32 neurons and the second containing 16 neurons. Each hidden layer is followed by an activation function, which is a rectified linear unit, to allow the network to fit the possible nonlinear relationship between the hydrophilicity / hydrophobicity index and the optimal nozzle movement speed label; the output layer is a fully connected layer containing 1 neuron with no activation function, directly outputting the predicted nozzle movement speed value.
[0050] Furthermore, the historical hydrophobicity index in the historical spraying sample set is used as the input feature, and the corresponding optimal nozzle movement speed label is used as the output label. The training objective is to minimize the mean square error between the output nozzle movement speed prediction value and the optimal nozzle movement speed label. The initial spraying parameter prediction model is trained in a supervised manner. When the mean square error meets the preset convergence condition, the trained spraying parameter prediction model is obtained.
[0051] For example, the historical spraying sample set is divided into a training set and a validation set in an 8:2 ratio. During training, the hydrophilicity / hydrophobicity index of the training samples is input into the network through forward propagation, and the predicted nozzle movement speed is calculated layer by layer. Subsequently, the loss between the optimal nozzle movement speed label and the predicted nozzle movement speed is calculated using the mean squared error loss function. For example, if the optimal nozzle movement speed label of a sample is 8.0 mm / s, the mean squared error is calculated as (8.5-8.0)² = 0.25. Then, through backpropagation, the gradient descent algorithm is used with an Adam optimizer with a learning rate of 0.001 to calculate the gradient of the loss function with respect to each weight and bias. The weights and biases are updated along the negative gradient direction to reduce the loss. The above process is repeated for all training samples, and each complete traversal is called an epoch. After each epoch, the mean squared error is calculated on the validation set to evaluate the generalization performance of the spraying parameter prediction model. The model is considered successful when the mean squared error of the validation set no longer decreases for 10 consecutive epochs, or reaches a preset mean squared error threshold, or reaches a preset maximum number of epochs. For example, training stops when the maximum number of rounds is 200, and the current parameters are saved as the completed spraying parameter prediction model.
[0052] The optimal nozzle movement speed label is determined as follows: For each grid cell in each historical spraying sample, a tissue slice is placed in the spraying device. Under the conditions of fixed atomization pressure, atomization flow rate, and standard working height, the grid cell is sprayed with multiple different nozzle movement speeds, covering the possible range of optimal nozzle movement speeds. For each candidate optimal nozzle movement speed, spraying is performed on the same grid cell. Note that the nozzle must be cleaned after each spraying or sprayed from a different location to avoid cross-influence. The spraying time is calculated based on the grid size and speed to ensure that the nozzle movement exactly covers the entire grid cell.
[0053] The actual matrix coverage of the grid cell was quantitatively measured using a microscopic optical densitometer or matrix-specific staining method. The deviation between the actual matrix coverage and the target matrix coverage of the grid cell was calculated and compared with a pre-set target matrix coverage. The speed with the smallest deviation was taken as the optimal nozzle movement speed label for the grid cell. The target matrix coverage is a pre-set ideal matrix solution deposition density, which can be determined based on preliminary experiments using mass spectrometry imaging to obtain the best signal intensity and crystal quality. The actual matrix coverage is the true deposition amount measured after spraying using optical densitometer, fluorescence labeling, or gravimetric method.
[0054] In this embodiment of the invention, a spraying parameter prediction model is obtained by acquiring a historical spraying sample set, supervising the training of the spraying parameter prediction model, and determining the optimal nozzle moving speed label. This ensures that the spraying parameter prediction model can accurately learn the complex mapping relationship between the hydrophilicity / hydrophobicity index and the optimal moving speed, thereby achieving automated nozzle moving speed prediction.
[0055] S40: Merge adjacent grid cells in the same row whose differences in the predicted nozzle movement speed are within a preset tolerance range into the same spraying area, calculate the arithmetic mean of the predicted nozzle movement speed of all grid cells in each spraying area, and obtain the initial optimized nozzle movement speed of each spraying area. In this embodiment of the invention, the spraying area is a continuous area formed by merging several spatially adjacent grid cells with similar velocity prediction values; the preset tolerance range is a pre-set velocity difference threshold, used to determine whether the velocity prediction values of adjacent grid cells can be merged.
[0056] Specifically, the velocity prediction values of the grid cells are processed row by row by the spraying device. For any row, each grid cell in that row is traversed sequentially along the spraying direction. The velocity prediction value of the current grid cell is compared with that of the next adjacent grid cell. After traversing all rows, the spraying area of the entire tissue slice surface is divided. The arithmetic mean of the nozzle movement velocity prediction values of all grid cells within each spraying area is used as the initial optimized nozzle movement velocity.
[0057] Step S40 in the method of this embodiment of the invention includes: For the first row of grid cells, along the scanning movement direction of the spraying device in the first row, starting from the first grid cell of the first row, the predicted nozzle movement speed values of two adjacent grid cells are compared sequentially. When the absolute value of the difference between the predicted nozzle movement speed values of two adjacent grid cells is less than or equal to the preset tolerance range, the latter grid cell is merged into the spraying area where the former grid cell is located. When the absolute value of the difference between the predicted nozzle movement speed values of two adjacent grid cells is greater than the preset tolerance range, a new spraying area is created starting from the next grid cell. After traversing all the grid cells in the first row, at least one spraying area corresponding to the first row is obtained; The comparison and merge operations are repeated for each row of grid cells until all rows are traversed to obtain the entire sprayed area on the surface of the tissue slice. For each spraying area, the predicted nozzle movement speed values of all grid cells in the spraying area are accumulated to obtain the accumulated speed value. The total number of grid cells in the spraying area is counted. The accumulated speed value is divided by the total number of grid cells to obtain the initial optimized nozzle movement speed of the spraying area. Based on the prediction error statistics of the spraying parameter prediction model and the speed fluctuation characteristics of each spraying area, the initial optimized nozzle moving speed is corrected to obtain the optimized nozzle moving speed for each spraying area.
[0058] In this embodiment of the invention, firstly, during the matrix spraying process, the spraying device performs a line-by-line serpentine scan, with the first line from left to right, the second line from right to left, the third line from left to right again, and so on, to fully cover the surface of the tissue section. Therefore, along the scanning direction of the spraying device in the first line, starting from the first grid cell of the first line, the predicted nozzle movement speed values of adjacent grid cells are compared sequentially.
[0059] Furthermore, when the absolute value of the difference between the predicted nozzle movement speed values of two adjacent grid cells is less than or equal to the preset tolerance range, it is determined that the predicted nozzle movement speed values of the two grid cells are similar, and they can be sprayed at the same spraying speed. The latter grid cell is then merged into the spraying area where the former grid cell is located.
[0060] For example, the preset tolerance range can be set using a dynamic quantification method, determined jointly based on the speed adjustment resolution of the spraying device's motion control system, the predicted speed value of the current grid cell, and the spreading and self-healing characteristics of the matrix solution on the tissue surface. Specifically: let the predicted nozzle movement speed values of two adjacent grid cells be v... i and v i+1 Take v min =min(v i ,v i+ 1) The maximum allowable relative deviation of deposition amount γ is pre-calibrated experimentally (e.g., γ=0.08, meaning that a step change in coverage amount at the boundary of no more than 8% will not affect the uniformity of the mass spectrometry imaging signal). Then, the maximum allowable velocity difference based on the requirement of coverage uniformity is Δv. uniform =γ·v min At the same time, the minimum speed regulation resolution Δv of the motion control system is also considered. res (For example, Δv) res =0.1 mm / s), and the final dynamic preset tolerance range is the larger of the two values: preset tolerance range = max(Δv res ,Δv uniform Thus, the preset tolerance range ensures that velocity differences within the tolerance range can be reliably tracked by the actuator, while also preventing relative deviations in matrix coverage between adjacent areas from exceeding γ, thereby avoiding detectable coverage steps at area boundaries. Furthermore, the preset tolerance range adaptively adjusts with the predicted velocity value: when v... min When the value is small, the preset tolerance range is limited by the hardware resolution to avoid setting it too small and causing execution failure; when v min When the value is large, the preset tolerance range is γ·v min The system is designed to allow for a more relaxed merging process to reduce unnecessary speed switching while maintaining accurate hydrophilicity / hydrophobicity matching.
[0061] For example, if the predicted velocity values of two adjacent grid cells are 8.0 mm / s and 8.6 mm / s respectively, and v is taken as... min =8.0 mm / s, if γ=0.08, then Δv uniform =0.64 mm / s; if Δv res =0.1 mm / s, then the dynamic tolerance range is max(0.1,0.64)=0.64 mm / s.
[0062] When the absolute value of the difference between the predicted nozzle movement speeds of two adjacent grid cells is greater than the preset tolerance range, it indicates that the spraying area of the previous grid cell has ended and will not expand further. In this case, a new spraying area is created starting from the next grid cell. The new spraying area initially contains only that grid cell, and then continues to be compared with the next grid cell in the same way. If the merging conditions are met, the grid cells are merged.
[0063] Furthermore, after traversing all the grid cells in the first row, at least one spraying area corresponding to the first row is obtained. Each spraying area contains a continuous set of grid cells, and the absolute value of the difference between the predicted nozzle movement speeds of any adjacent cells within the spraying area is ≤ a preset tolerance range, while the absolute value of the difference between the predicted nozzle movement speeds at the boundary of the spraying area is > a preset tolerance range.
[0064] Furthermore, the comparison and merging operations are repeated for each row of grid cells until all rows are traversed to obtain the entire sprayed area on the surface of the tissue slice.
[0065] Furthermore, for each spraying area, the predicted nozzle movement speed values of all grid cells within that area are summed to obtain a cumulative speed value. The total number of grid cells in that spraying area is then counted, and the cumulative speed value is divided by the total number of grid cells to obtain the initial optimized nozzle movement speed for that spraying area, i.e., the initial optimized nozzle movement speed. Where n is the total number of grid cells, v i It is the predicted value of nozzle movement speed.
[0066] Finally, based on the prediction error statistics of the spraying parameter prediction model and the velocity fluctuation characteristics of each spraying area, the initially optimized nozzle movement speed is corrected to obtain the optimized nozzle movement speed for each spraying area. The prediction error statistics are uncertainty measures, such as prediction accuracy, obtained during the training phase of the spraying parameter prediction model. The velocity fluctuation characteristics are the standard deviation of the predicted nozzle movement speed values for all grid cells within the spraying area; a larger standard deviation indicates a greater velocity difference within the spraying area and a higher risk of local mismatch.
[0067] In this embodiment of the invention, the difference between the predicted nozzle moving speed values of two adjacent grid cells is compared with the preset tolerance range. Based on the comparison results, the spraying areas are merged according to different situations to adapt to the changes in the hydrophilicity and hydrophobicity distribution on the tissue slice surface. Subsequently, based on the prediction error statistics of the spraying parameter prediction model and the speed fluctuation characteristics of each spraying area, the initial optimized nozzle moving speed is corrected, and the optimized nozzle moving speed is calculated to compensate for systematic deviations, making the final optimized nozzle moving speed more stable.
[0068] S50: Correct the initial optimized nozzle moving speed to obtain the optimized nozzle moving speed for each spraying area, and control the spraying device to perform differentiated spraying of matrix solution on the surface of the tissue section according to the optimized nozzle moving speed for each spraying area.
[0069] In this embodiment of the invention, differentiated spraying is achieved by the spraying device automatically adjusting the nozzle movement speed according to the optimized speed corresponding to the current spraying area during the scanning process, so that areas with different hydrophilicity and hydrophobicity can obtain different matrix solution deposition densities.
[0070] Specifically, the initial optimized nozzle movement speed is corrected to obtain the final optimized nozzle movement speed. Subsequently, the nozzle movement speed is automatically adjusted according to the line-by-line serpentine scanning path to control the spraying device to perform differentiated spraying on each spraying area.
[0071] Step S50 in the method of this embodiment of the invention includes: Obtain the prediction accuracy of the spraying parameter prediction model during the training phase; Calculate the standard deviation of the predicted nozzle movement speed of all grid cells in the spraying area, and use the standard deviation as the speed fluctuation characteristic of the spraying area; Subtracting the prediction accuracy from the numerical value yields the model unreliability. Multiplying the unreliability of the model by the velocity fluctuation characteristic yields the correction amount for the sprayed area. The optimized nozzle movement speed of the spraying area is obtained by adding the initial optimized nozzle movement speed to the correction amount. Based on the optimized nozzle movement speed of each spraying area, the spraying device is controlled to perform differentiated spraying of matrix solution on each spraying area of the tissue section surface.
[0072] In this embodiment of the invention, firstly, the prediction accuracy of the spraying parameter prediction model during the training phase is obtained. The prediction accuracy can be obtained by normalizing the reciprocal of the root mean square error: reciprocal = 1 / root mean square error. Mapping the reciprocal within the range of 0-1 yields the prediction accuracy.
[0073] Secondly, the standard deviation of the predicted nozzle movement speed for all grid cells within the spraying area is calculated, and this standard deviation is used as the speed fluctuation characteristic of the spraying area. Where m represents the number of predicted nozzle movement speed values, v i This represents the predicted nozzle movement speed. This represents the mean of the predicted nozzle movement speed.
[0074] Next, subtract the prediction accuracy from the numerical value to obtain the model unreliability. Model unreliability = 1 - prediction accuracy.
[0075] Furthermore, the model unreliability is multiplied by the velocity fluctuation characteristic to obtain the correction amount for the sprayed area. The correction amount for the nozzle movement speed after initial optimization = model unreliability × velocity fluctuation characteristic.
[0076] Furthermore, the optimized nozzle movement speed is added to the correction amount to obtain the optimized nozzle movement speed for the spraying area. Optimized nozzle movement speed = Initial optimized nozzle movement speed + Correction amount for the initial optimized nozzle movement speed. A larger correction amount is applied to the initial optimized nozzle movement speed when there are large fluctuations within the spraying area; conversely, a smaller correction amount is applied when there are smaller fluctuations.
[0077] Finally, based on the optimized nozzle movement speed of each spraying area, the spraying device sends speed commands to the drive motor through the motion control system, so that the nozzles move according to the planned path and area speed, and perform differentiated spraying of matrix solution on each spraying area of the tissue section surface.
[0078] At the start of spraying, the nozzle begins at the starting position of the first spraying area in the first row of the tissue section surface. Following the optimized nozzle movement speed for that area, it moves uniformly along the scanning direction of that row. During this movement, the matrix solution is sprayed downwards in the form of microdroplets at a constant atomization pressure and flow rate until the sprayed area is fully covered. Through differentiated spraying, hydrophobic areas receive a slower nozzle movement speed to increase matrix solution deposition, while hydrophilic areas receive a faster nozzle movement speed to reduce matrix solution deposition, achieving an adaptive match between matrix coverage and the hydrophilicity / hydrophobicity of different areas on the tissue section surface.
[0079] In this embodiment, based on the predicted nozzle movement speed and the prediction accuracy obtained during the training phase, the correction amount for the initially optimized nozzle movement speed is calculated and corrected to obtain the final optimized nozzle movement speed. Subsequently, the nozzle movement speed is automatically adjusted according to the progressive serpentine scanning path, controlling the spraying device to perform differentiated spraying on each spraying area. This effectively solves the problem of mismatch between matrix coverage and surface characteristics, improves the uniformity and spatial resolution of mass spectrometry imaging signals, and makes the molecular signal contrast of different tissue regions more realistic.
[0080] Through the specific implementation methods described above, the embodiments of the present invention achieve the following technical effects: In this embodiment of the invention, an optical image is first acquired and uniformly divided into multiple grid cells arranged in rows and columns. This provides a spatial coordinate reference for subsequent local differential control, effectively suppressing random noise and local fluctuations caused by minute structures during optical image acquisition. Simultaneously, the spatial adjacency relationship is preserved through an optical reflectance distribution map, providing standardized input data for calculating the hydrophilicity / hydrophobicity index.
[0081] Secondly, a reflectance-contact angle mapping table covering a continuous range of relative reflectance is constructed using linear interpolation to ensure the reliability of the mapping relationship and avoid errors caused by discretization. Based on the relative reflectance, the hydrophilicity-hydrophobicity index is found from the reflectance-contact angle mapping table, transforming the dimensionless relative reflectance into a parameter describing the hydrophilicity-hydrophobicity of the surface, thus providing input data for subsequent processing.
[0082] Furthermore, by acquiring historical samples, determining the neural network architecture, and identifying the optimal speed label, the pre-training of the spraying parameter prediction model is completed. This ensures that the model can accurately learn the complex mapping relationship between the hydrophilicity / hydrophobicity index and the optimal moving speed, thereby achieving automated nozzle moving speed prediction.
[0083] Furthermore, by comparing the difference between the predicted nozzle movement speeds of two adjacent grid cells with the preset tolerance range, the spraying areas are merged according to the comparison results, which can adapt to the changes in the hydrophilicity and hydrophobicity distribution on the tissue slice surface. Subsequently, the initial optimized nozzle movement speed is corrected based on the prediction error statistics of the spraying parameter prediction model and the speed fluctuation characteristics of each spraying area. The optimized nozzle movement speed is calculated to compensate for systematic deviations, making the final optimized nozzle movement speed more stable.
[0084] Finally, based on the predicted nozzle movement speed and the prediction accuracy obtained during the training phase, the correction amount for the initially optimized nozzle movement speed is calculated and adjusted to obtain the final optimized nozzle movement speed. Subsequently, the nozzle movement speed is automatically adjusted according to the line-by-line serpentine scanning path, controlling the spraying device to perform differentiated spraying on each spraying area. This effectively solves the problem of mismatch between matrix coverage and surface characteristics, improves the uniformity and spatial resolution of mass spectrometry imaging signals, and makes the molecular signal contrast of different tissue regions more realistic.
[0085] like Figure 3 As shown, in another embodiment, based on the same inventive concept as the matrix spraying parameter optimization method for mass spectrometry imaging provided in the first embodiment, this embodiment of the invention also provides a matrix spraying parameter optimization system for mass spectrometry imaging, the system comprising: The optical reflectance value extraction module 11 is used to acquire optical images of the surface of tissue sections, uniformly divide the optical images into multiple grid units arranged in rows and columns, extract the optical reflectance value of each grid unit from the optical images, and form an optical reflectance distribution map. The hydrophilicity / hydrophobicity index acquisition module 12 is used to preprocess the optical reflectance distribution map and calculate the hydrophilicity / hydrophobicity index of each grid cell. The nozzle moving speed prediction module 13 is used to input the hydrophilicity / hydrophobicity index of each grid cell into the pre-trained spraying parameter prediction model and output the nozzle moving speed prediction value of each grid cell. The spraying area merging module 14 is used to merge adjacent grid cells in the same row with the difference between the predicted nozzle movement speed values within a preset tolerance range into the same spraying area, calculate the arithmetic mean of the predicted nozzle movement speed values of all grid cells in each spraying area, and obtain the initial optimized nozzle movement speed of each spraying area. The initial optimized nozzle movement speed correction module 15 is used to correct the initial optimized nozzle movement speed to obtain the optimized nozzle movement speed for each spraying area, and control the spraying device to perform differentiated spraying of matrix solution on the surface of the tissue section according to the optimized nozzle movement speed of each spraying area.
[0086] In one embodiment, the optical reflectance value extraction module 11 is used for: The prepared tissue section is placed on the working platform of the spraying device, and the height of the working platform is adjusted so that the vertical distance between the surface of the tissue section and the nozzle of the spraying device is equal to the preset standard working height. Optical images of the tissue slice surface are acquired under standard light source illumination conditions using an industrial camera deployed above the work platform. The nozzle coverage diameter of the spraying device is obtained, and the nozzle coverage diameter is converted into the corresponding number of pixels according to the spatial resolution of the optical image. The number of pixels is used as the grid side length, and the optical image is uniformly divided into multiple grid units arranged in rows and columns.
[0087] In one embodiment, the optical reflectivity value extraction module 11 is further configured to: For each grid cell, obtain the gray values of all pixels within that grid cell, calculate the arithmetic mean of the gray values of all pixels, and use the arithmetic mean as the optical reflectance value of that grid cell. The optical reflectance values of all grid cells are arranged according to the row and column positions of the grid cells to form an optical reflectance distribution map.
[0088] In one embodiment, the hydrophilicity / hydrophobicity index acquisition module 12 is used for: Calculate the ratio of the optical reflectance value of each grid cell in the optical reflectance distribution map to the preset standard reflectance reference value, and use the ratio as the relative reflectance of the grid cell. The standard reflectance reference value is the optical reflectance value of the blank slide area without tissue coverage on the surface of the tissue section. Obtain a pre-calibrated reflectivity-contact angle mapping table, wherein the reflectivity-contact angle mapping table is a mapping table from relative reflectivity to contact angle value; Based on the relative reflectance of each grid cell, the corresponding contact angle value is looked up in the reflectance-contact angle mapping table, and the looked-up contact angle value is used as the hydrophilicity / hydrophobicity index of that grid cell.
[0089] This includes obtaining the pre-calibrated reflectivity-contact angle mapping table, including: Multiple standard sample surfaces with different hydrophilicity and hydrophobicity were prepared. The contact angle value of each standard sample surface was measured at room temperature using a contact angle meter to obtain the contact angle label value of each standard sample surface. Under standard light source illumination conditions, optical images of the surface of each standard sample were acquired, and the relative reflectance of the surface of each standard sample was calculated. Multiple discrete data points are formed by combining the relative reflectance and contact angle label values of the surfaces of multiple standard samples. Interpolation is then performed on these discrete data points to obtain a reflectance-contact angle mapping table covering a continuous range of relative reflectance.
[0090] Specifically, the relative reflectance and contact angle label values corresponding to the surfaces of the multiple standard samples are used to form multiple discrete data points. Interpolation processing is performed on these discrete data points to obtain a reflectance-contact angle mapping table covering a continuous range of relative reflectance, including: Multiple discrete data points are arranged in ascending order of relative reflectivity to form an ordered discrete data point sequence. For any relative reflectance value between any two adjacent discrete data points in the ordered discrete data point sequence, the contact angle value corresponding to the relative reflectance value is calculated by linear interpolation based on the proportional relationship between the relative reflectance value and the relative reflectance values of the two adjacent discrete data points before and after, so as to obtain a reflectance-contact angle mapping table covering the entire continuous interval from the minimum relative reflectance value to the maximum relative reflectance value.
[0091] In one embodiment, the nozzle movement speed prediction module 13 is used for: Obtain a historical spraying sample set, wherein each historical spraying sample in the historical spraying sample set contains the historical hydrophilicity and hydrophobicity index of multiple grid cells on a historical tissue slice, and the corresponding optimal nozzle movement speed label. An initial spraying parameter prediction model is constructed based on a fully connected neural network. The initial spraying parameter prediction model includes an input layer, at least two hidden layers, and an output layer. The input layer receives the hydrophilicity / hydrophobicity index, the output layer outputs the predicted value of the nozzle movement speed, and the hidden layer uses a rectified linear unit as the activation function. The historical hydrophobicity index in the historical spraying sample set is used as the input feature, the corresponding optimal nozzle movement speed label is used as the output label, and the mean square error between the output nozzle movement speed prediction value and the optimal nozzle movement speed label is used as the training objective. The initial spraying parameter prediction model is trained in a supervised manner. When the mean square error meets the preset convergence condition, the trained spraying parameter prediction model is obtained. The optimal nozzle movement speed label is determined as follows: For each grid cell in each historical spraying sample, under the condition of fixed atomization pressure, atomization flow rate and standard working height, the grid cell is sprayed with multiple different nozzle movement speeds. The actual matrix coverage of the grid cell is measured after each spraying. The deviation between the actual matrix coverage and the target matrix coverage of the grid cell is calculated. The nozzle movement speed that minimizes this deviation is taken as the optimal nozzle movement speed label for the grid cell.
[0092] In one embodiment, the spraying area merging module 14 is used for: For the first row of grid cells, along the scanning movement direction of the spraying device in the first row, starting from the first grid cell of the first row, the predicted nozzle movement speed values of two adjacent grid cells are compared sequentially. When the absolute value of the difference between the predicted nozzle movement speed values of two adjacent grid cells is less than or equal to the preset tolerance range, the latter grid cell is merged into the spraying area where the former grid cell is located. When the absolute value of the difference between the predicted nozzle movement speed values of two adjacent grid cells is greater than the preset tolerance range, a new spraying area is created starting from the next grid cell. After traversing all the grid cells in the first row, at least one spraying area corresponding to the first row is obtained; The comparison and merge operations are repeated for each row of grid cells until all rows are traversed to obtain the entire sprayed area on the surface of the tissue slice. For each spraying area, the predicted nozzle movement speed values of all grid cells in the spraying area are accumulated to obtain the accumulated speed value. The total number of grid cells in the spraying area is counted. The accumulated speed value is divided by the total number of grid cells to obtain the initial optimized nozzle movement speed of the spraying area. Based on the prediction error statistics of the spraying parameter prediction model and the speed fluctuation characteristics of each spraying area, the initial optimized nozzle moving speed is corrected to obtain the optimized nozzle moving speed for each spraying area.
[0093] In one embodiment, the nozzle movement speed correction module 15 after initial optimization is used for: Obtain the prediction accuracy of the spraying parameter prediction model during the training phase; Calculate the standard deviation of the predicted nozzle movement speed of all grid cells in the spraying area, and use the standard deviation as the speed fluctuation characteristic of the spraying area; Subtracting the prediction accuracy from the numerical value yields the model unreliability. Multiplying the unreliability of the model by the velocity fluctuation characteristic yields the correction amount for the sprayed area. The optimized nozzle movement speed of the spraying area is obtained by adding the initial optimized nozzle movement speed to the correction amount. Based on the optimized nozzle movement speed of each spraying area, the spraying device is controlled to perform differentiated spraying of matrix solution on each spraying area of the tissue section surface.
[0094] Compared to existing technologies, this invention provides a method and system for optimizing matrix spraying parameters for mass spectrometry imaging. The method involves: an optical reflectance extraction module to acquire optical images, divide them into grid cells, and construct an optical reflectance distribution map; a hydrophilicity / hydrophobicity index acquisition module to preprocess the optical reflectance distribution map and calculate the hydrophilicity / hydrophobicity index of the grid cells; a nozzle movement speed prediction module to construct a spraying parameter prediction model and output predicted nozzle movement speed values for the grid cells; a spraying region merging module to merge the grid cells into a spraying region and calculate the initial optimized nozzle movement speed within the spraying region; and an initial optimized nozzle movement speed correction module to correct the initial optimized nozzle movement speed, obtaining the optimized nozzle movement speed for the spraying region, thereby controlling the spraying device to perform differentiated spraying of the matrix solution onto the surface of the tissue section. By allowing a slower nozzle movement speed in hydrophobic regions to increase the amount of matrix solution deposited and a faster nozzle movement speed in hydrophilic regions to reduce the amount of matrix solution deposited, an adaptive match between matrix coverage and the hydrophilicity / hydrophobicity of the tissue section surface is achieved. Compared with existing uniform spraying methods, this invention significantly improves the signal uniformity and spatial resolution of mass spectrometry imaging, and ensures the reliability of cross-batch spraying results through relative reflectance normalization and velocity correction mechanisms.
Claims
1. A method for optimizing matrix spraying parameters for mass spectrometry imaging, characterized in that, The method includes: An optical image of the surface of a tissue section is acquired, and the optical image is uniformly divided into multiple grid units arranged in rows and columns. The optical reflectance value of each grid unit is extracted from the optical image to form an optical reflectance distribution map. The optical reflectance distribution map is preprocessed, and the hydrophilicity / hydrophobicity index of each grid cell is calculated. The hydrophilicity / hydrophobicity index of each grid cell is input into the pre-trained spraying parameter prediction model, and the predicted value of the nozzle movement speed of each grid cell is output. Mesh cells that are adjacent in the same row and whose differences in the predicted nozzle movement speed are within a preset tolerance range are merged into the same spraying area. The arithmetic mean of the predicted nozzle movement speed of all mesh cells in each spraying area is calculated to obtain the initial optimized nozzle movement speed of each spraying area. The initial optimized nozzle movement speed is corrected to obtain the optimized nozzle movement speed for each spraying area. Based on the optimized nozzle movement speed for each spraying area, the spraying device is controlled to perform differentiated spraying of matrix solution on the surface of the tissue section.
2. The method for optimizing matrix spraying parameters for mass spectrometry imaging according to claim 1, characterized in that, Acquire optical images of the surface of tissue sections, and uniformly divide the optical images into multiple grid units arranged in rows and columns, including: The prepared tissue section is placed on the working platform of the spraying device, and the height of the working platform is adjusted so that the vertical distance between the surface of the tissue section and the nozzle of the spraying device is equal to the preset standard working height. Optical images of the tissue slice surface are acquired under standard light source illumination conditions using an industrial camera deployed above the work platform. The nozzle coverage diameter of the spraying device is obtained, and the nozzle coverage diameter is converted into the corresponding number of pixels according to the spatial resolution of the optical image. The number of pixels is used as the grid side length, and the optical image is uniformly divided into multiple grid units arranged in rows and columns.
3. The method for optimizing matrix spraying parameters for mass spectrometry imaging according to claim 2, characterized in that, The optical reflectance value of each grid cell is extracted from the optical image to form an optical reflectance distribution map, including: For each grid cell, obtain the gray values of all pixels within that grid cell, calculate the arithmetic mean of the gray values of all pixels, and use the arithmetic mean as the optical reflectance value of that grid cell. The optical reflectance values of all grid cells are arranged according to the row and column positions of the grid cells to form an optical reflectance distribution map.
4. The method for optimizing matrix spraying parameters for mass spectrometry imaging according to claim 1, characterized in that, The optical reflectance distribution map is preprocessed, and the hydrophilicity / hydrophobicity index of each grid cell is calculated, including: Calculate the ratio of the optical reflectance value of each grid cell in the optical reflectance distribution map to the preset standard reflectance reference value, and use the ratio as the relative reflectance of the grid cell. The standard reflectance reference value is the optical reflectance value of the blank slide area without tissue coverage on the surface of the tissue section. Obtain a pre-calibrated reflectivity-contact angle mapping table, wherein the reflectivity-contact angle mapping table is a mapping table from relative reflectivity to contact angle value; Based on the relative reflectance of each grid cell, the corresponding contact angle value is looked up in the reflectance-contact angle mapping table, and the looked-up contact angle value is used as the hydrophilicity / hydrophobicity index of that grid cell.
5. The method for optimizing matrix spraying parameters for mass spectrometry imaging according to claim 4, characterized in that, Obtain the pre-calibrated reflectivity-contact angle mapping table, including: Multiple standard sample surfaces with different hydrophilicity and hydrophobicity were prepared. The contact angle value of each standard sample surface was measured at room temperature using a contact angle meter to obtain the contact angle label value of each standard sample surface. Under standard light source illumination conditions, optical images of the surface of each standard sample were acquired, and the relative reflectance of the surface of each standard sample was calculated. Multiple discrete data points are formed by combining the relative reflectance and contact angle label values of the surfaces of multiple standard samples. Interpolation is then performed on these discrete data points to obtain a reflectance-contact angle mapping table covering a continuous range of relative reflectance.
6. The method for optimizing matrix spraying parameters for mass spectrometry imaging according to claim 5, characterized in that, The relative reflectance and contact angle label values corresponding to the surfaces of the multiple standard samples are used to form multiple discrete data points. Interpolation is then performed on these discrete data points to obtain a reflectance-contact angle mapping table covering a continuous range of relative reflectance, including: Multiple discrete data points are arranged in ascending order of relative reflectivity to form an ordered discrete data point sequence. For any relative reflectance value between any two adjacent discrete data points in the ordered discrete data point sequence, the contact angle value corresponding to the relative reflectance value is calculated by linear interpolation based on the proportional relationship between the relative reflectance value and the relative reflectance values of the two adjacent discrete data points before and after, so as to obtain a reflectance-contact angle mapping table covering the entire continuous interval from the minimum relative reflectance value to the maximum relative reflectance value.
7. The method for optimizing matrix spraying parameters for mass spectrometry imaging according to claim 1, characterized in that, The pre-training process of the spraying parameter prediction model includes: Obtain a historical spraying sample set, wherein each historical spraying sample in the historical spraying sample set contains the historical hydrophilicity and hydrophobicity index of multiple grid cells on a historical tissue slice, and the corresponding optimal nozzle movement speed label. An initial spraying parameter prediction model is constructed based on a fully connected neural network. The initial spraying parameter prediction model includes an input layer, at least two hidden layers, and an output layer. The input layer receives the hydrophilicity / hydrophobicity index, the output layer outputs the predicted value of the nozzle movement speed, and the hidden layer uses a rectified linear unit as the activation function. The historical hydrophobicity index in the historical spraying sample set is used as the input feature, the corresponding optimal nozzle movement speed label is used as the output label, and the mean square error between the output nozzle movement speed prediction value and the optimal nozzle movement speed label is used as the training objective. The initial spraying parameter prediction model is trained in a supervised manner. When the mean square error meets the preset convergence condition, the trained spraying parameter prediction model is obtained. The optimal nozzle movement speed label is determined as follows: For each grid cell in each historical spraying sample, under the condition of fixed atomization pressure, atomization flow rate and standard working height, the grid cell is sprayed with multiple different nozzle movement speeds. The actual matrix coverage of the grid cell is measured after each spraying. The deviation between the actual matrix coverage and the target matrix coverage of the grid cell is calculated. The nozzle movement speed that minimizes this deviation is taken as the optimal nozzle movement speed label for the grid cell.
8. The method for optimizing matrix spraying parameters for mass spectrometry imaging according to claim 1, characterized in that, Mesh cells in the same row whose predicted nozzle movement speeds differ within a preset tolerance range are merged into the same spraying region. The arithmetic mean of the predicted nozzle movement speeds of all mesh cells within each spraying region is calculated to obtain the optimized nozzle movement speed for each spraying region, including: For the first row of grid cells, along the scanning movement direction of the spraying device in the first row, starting from the first grid cell of the first row, the predicted nozzle movement speed values of two adjacent grid cells are compared sequentially. When the absolute value of the difference between the predicted nozzle movement speed values of two adjacent grid cells is less than or equal to the preset tolerance range, the latter grid cell is merged into the spraying area where the former grid cell is located. When the absolute value of the difference between the predicted nozzle movement speed values of two adjacent grid cells is greater than the preset tolerance range, a new spraying area is created starting from the next grid cell. After traversing all the grid cells in the first row, at least one spraying area corresponding to the first row is obtained; The comparison and merge operations are repeated for each row of grid cells until all rows are traversed to obtain the entire sprayed area on the surface of the tissue slice. For each spraying area, the predicted nozzle movement speed values of all grid cells in the spraying area are accumulated to obtain the accumulated speed value. The total number of grid cells in the spraying area is counted. The accumulated speed value is divided by the total number of grid cells to obtain the initial optimized nozzle movement speed of the spraying area. Based on the prediction error statistics of the spraying parameter prediction model and the speed fluctuation characteristics of each spraying area, the initial optimized nozzle moving speed is corrected to obtain the optimized nozzle moving speed for each spraying area.
9. The method for optimizing matrix spraying parameters for mass spectrometry imaging according to claim 1, characterized in that, The initial optimized nozzle movement speed is corrected to obtain the optimized nozzle movement speed for each spraying area. Based on the optimized nozzle movement speed for each spraying area, the spraying device is controlled to perform differentiated spraying of the matrix solution onto the surface of the tissue section, including: Obtain the prediction accuracy of the spraying parameter prediction model during the training phase; Calculate the standard deviation of the predicted nozzle movement speed of all grid cells in the spraying area, and use the standard deviation as the speed fluctuation characteristic of the spraying area; Subtracting the prediction accuracy from the numerical value yields the model unreliability. Multiplying the unreliability of the model by the velocity fluctuation characteristic yields the correction amount for the sprayed area. The optimized nozzle movement speed of the spraying area is obtained by adding the initial optimized nozzle movement speed to the correction amount. Based on the optimized nozzle movement speed of each spraying area, the spraying device is controlled to perform differentiated spraying of matrix solution on each spraying area of the tissue section surface.
10. A matrix spraying parameter optimization system for mass spectrometry imaging, characterized in that, For implementing the matrix spraying parameter optimization method for mass spectrometry imaging according to any one of claims 1-9, the system comprises: The optical reflectance value extraction module is used to acquire optical images of the surface of tissue sections, divide the optical images into multiple grid units arranged in rows and columns, extract the optical reflectance value of each grid unit from the optical images, and form an optical reflectance distribution map. The hydrophilicity / hydrophobicity index acquisition module is used to preprocess the optical reflectance distribution map and calculate the hydrophilicity / hydrophobicity index of each grid cell. The nozzle movement speed prediction module is used to input the hydrophilicity / hydrophobicity index of each grid cell into the pre-trained spraying parameter prediction model and output the predicted value of the nozzle movement speed of each grid cell. The spraying area merging module is used to merge adjacent grid cells in the same row that have a difference in the predicted nozzle movement speed within a preset tolerance range into the same spraying area. It calculates the arithmetic mean of the predicted nozzle movement speed of all grid cells in each spraying area to obtain the initial optimized nozzle movement speed of each spraying area. The initial optimized nozzle movement speed correction module is used to correct the initial optimized nozzle movement speed to obtain the optimized nozzle movement speed for each spraying area, and control the spraying device to perform differentiated spraying of matrix solution on the surface of the tissue section according to the optimized nozzle movement speed of each spraying area.