Real-time hyperspectral microscopic image cell classification method based on FPGA

A hyperspectral microscopic image cell classification method implemented using FPGA, combining spectral and texture features, solves the problems of low efficiency and insufficient accuracy in traditional cell detection, achieving high-precision and rapid cell classification.

CN122244864APending Publication Date: 2026-06-19HARBIN NORMAL UNIVERSITY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HARBIN NORMAL UNIVERSITY
Filing Date
2026-03-26
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Traditional cell detection methods are inefficient, subjective due to human observation, and difficult to rapidly detect large-scale cell samples. Furthermore, there are inconsistencies in diagnostic results among different observers. Existing cell classification methods rely on single-feature judgments, resulting in insufficient accuracy.

Method used

A real-time hyperspectral microscopic image cell classification method based on FPGA is adopted. Combining spectral and texture features, the image data is processed rapidly through the FPGA's internal storage module and computing unit to calculate spectral reflectance and its derivative, determine the position of absorption peaks, and combine features such as light intensity, standard deviation, contrast, energy and entropy to achieve multi-dimensional cell classification.

🎯Benefits of technology

It achieves high-precision quantitative description of cell characteristics, captures the differences between cancer cells and normal cells, avoids the limitations of single feature judgment, improves processing speed, and meets the needs of real-time detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122244864A_ABST
    Figure CN122244864A_ABST
Patent Text Reader

Abstract

This invention provides a real-time hyperspectral microscopic image cell classification method based on FPGA, belonging to the field of medical image processing and analysis technology. By analyzing hyperspectral microscopic images of cells and storing the data on an FPGA, the method first calculates the spectral characteristics of the cell's absorption peak position light intensity value and its standard deviation, as well as the texture characteristics of contrast, energy, and entropy. Based on the threshold ranges of each feature obtained from statistical analysis of similar normal cells, the corresponding features of the cell to be detected are compared to determine whether it is abnormal. The above calculation and judgment logic is implemented using an FPGA. With the help of a logic judgment circuit, the cell category is determined based on the signals of spectral and texture features. When either the spectral or texture feature is determined to be abnormal, the cell is classified as a cancer cell; when both are within the threshold range of similar normal cells, it is classified as a normal cell. Finally, the classification result is output through the output port.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical image processing and analysis technology, specifically to a real-time hyperspectral microscopic image cell classification method based on FPGA. Background Technology

[0002] In the field of modern biomedical research and clinical diagnosis, cell analysis technology occupies a crucial position. Traditional cell detection methods, such as manual observation and identification under a microscope, while having a certain foundation in cell morphology research, face many limitations. Manual observation is highly subjective, and different observers may have different judgments on cell characteristics, leading to inconsistent diagnostic results. Moreover, this method is inefficient and cannot meet the needs of rapid detection of large-scale cell samples. In the early screening of diseases such as cancer, the slow detection speed can easily delay the best treatment time. Against this technological background, there is an urgent need for a comprehensive, efficient, and accurate cell classification method.

[0003] Many diseases, especially cancer, exhibit specific changes at the cellular level. Precise cell classification methods can accurately identify the differences between diseased and normal cells, providing crucial evidence for early disease diagnosis. Hyperspectral imaging technology has emerged and is gradually being applied in cell research, with image texture analysis technology receiving significant attention in cell image research. Hyperspectral microscopy images can provide rich spectral information about cells, reflecting the content and distribution of different biomolecules within the cell. However, simple texture feature analysis also has limitations; for example, some texture features may not be sensitive to minor cellular lesions, or the distinction between different cell types may not be clear enough. This invention combines the spectral and texture features of cells, fully leveraging their advantages and overcoming their respective limitations, making it an important research direction in the field of cell analysis technology.

[0004] Existing technologies for cell classification have the following shortcomings: Traditional cell classification methods often rely on only one type of cell characteristic, such as simple cell morphology or a single biochemical indicator; manual microscopic observation combined with manual analysis, although relatively accurate, is very time-consuming; in the data analysis stage, differences in the experience and judgment standards of different technicians may also lead to inconsistencies in classification results.

[0005] The information disclosed in the background section is only intended to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0006] The purpose of this invention is to provide a real-time hyperspectral microscopic image cell classification method based on FPGA, so as to solve the problems mentioned in the background art above;

[0007] To achieve the above objectives, the present invention provides the following technical solution:

[0008] A real-time hyperspectral microscopic image cell classification method based on FPGA, comprising the following steps:

[0009] Step 1: Using hyperspectral imaging technology in to wavelength range, in Normal cell hyperspectral microscopic images are acquired at intervals. The number of wavelength points is determined according to the wavelength range and interval. The image data is stored in the internal storage module of the FPGA. The image data includes wavelength range, wavelength interval, coordinates of the pixel, light intensity value, and number of wavelength points.

[0010] Step 2: Pre-set the reference light intensity value, calculate the spectral reflectance by reading the number of wavelength points and the reference light intensity value from the FPGA's internal storage module, and then determine the absorption peak position based on the first and second derivatives of the spectral reflectance, and calculate the spectral characteristics, which include the light intensity value and standard deviation of the absorption peak position.

[0011] Step 3: Extract the light intensity value of the absorption peak position of each pixel from the FPGA internal storage module, calculate the texture features, which include contrast, energy and entropy, and set difference thresholds for the light intensity value, standard deviation, contrast, energy and entropy at the absorption peak position respectively.

[0012] Step 4: Acquire hyperspectral microscopic images of the cells to be tested, calculate spectral features and texture features. When the average value and standard deviation of the spectral features of the cells to be tested both exceed the threshold range of normal cells of the same type, the spectral features are determined to be abnormal. When the contrast, energy and entropy of the cells to be tested both exceed the threshold range of normal cells of the same type, the texture features are determined to be abnormal.

[0013] Step 5: If either the spectral feature or the texture feature is determined to be abnormal, the cell is classified as a cancer cell. If both the spectral feature and the texture feature are within the threshold range of normal cells of the same type, the cell is classified as a normal cell.

[0014] Furthermore, the method for storing image data in the FPGA's internal storage module is as follows:

[0015] exist Within the wavelength range, with Spatial resolution, Images are acquired at wavelength intervals, and the image plane position is represented by coordinates in a Cartesian coordinate system. Pixels are mapped one-to-one with coordinates. BRAM is selected as the storage module and named Raw Image Data Storage BRAM. When acquiring data for a single pixel, its... The coordinate values ​​are converted into their corresponding binary numbers, written into the BRAM, and then the pixel is extracted. Coordinate values, after being converted to binary numbers, in The coordinates are subsequently written to the BRAM in consecutive storage locations. A unique index is assigned to each wavelength. The index value of the wavelength is first stored in the BRAM in binary form, and then the light intensity value is stored in the BRAM immediately after the wavelength index.

[0016] Furthermore, the method for calculating spectral reflectance is as follows:

[0017] A data buffer is constructed using the raw image data storage BRAM inside the FPGA. Pixel data in the raw image data storage BRAM is read sequentially in a line-by-line scanning order, and each line of data is stored sequentially in the buffer. Then, the original light intensity values ​​of each pixel in a 3×3 neighborhood centered on the target pixel are extracted from the buffer. A computation unit is constructed using multiple multipliers and adders. For each pixel, the extracted original light intensity values ​​of the nine neighboring pixels are simultaneously fed into the multiplier using control logic. Each multiplier performs an operation with 1 / 9. These operation results are then accumulated through an adder tree structure to obtain the new light intensity value of the pixel after mean filtering. That is, the original light intensity value of each pixel is replaced by the mean of the light intensity values ​​of its surrounding pixels. Subsequently, the spectral reflectance is calculated. The spectral reflectance is the ratio of the mean-filtered light intensity value to the reference light intensity value. The BRAM is selected as the storage module and named the spectral reflectance storage BRAM to store the spectral reflectance value of each pixel at different wavelengths.

[0018] Furthermore, the method for determining the absorption peak position based on the first and second derivatives of spectral reflectance is as follows:

[0019] Using wavelength as the independent variable, the first derivative of the spectral reflectance curve of each pixel is calculated. Multiple subtractors and multipliers are constructed in the FPGA. The difference in spectral reflectance between two adjacent wavelength points is calculated by the subtractor, and then multiplied by the inverse of twice the wavelength interval by the multiplier to obtain the first derivative result of each wavelength point. The result is stored in a new BRAM and named the first derivative storage BRAM.

[0020] First-order derivative data are read sequentially from the first-order derivative storage BRAM in wavelength order, and then the second-order derivative is calculated. Similarly, the difference between the first-order derivatives of two adjacent wavelength points is calculated by a subtractor, and then multiplied by a multiplier with twice the reciprocal of the wavelength interval to obtain the second-order derivative of each wavelength point.

[0021] The wavelength points where the first derivative is 0 and the second derivative is less than 0 are defined as absorption peak positions. A comparator and logic judgment unit are designed in the FPGA to compare the first and second derivatives of each wavelength point with 0, and filter out the wavelength points that satisfy the condition that the first derivative is 0 and the second derivative is less than 0, and store them in a new second-order absorption peak storage BRAM.

[0022] Furthermore, the method for calculating spectral characteristics is as follows:

[0023] The number of absorption peaks of each pixel is counted from the second-order absorption peak storage BRAM, and the light intensity value of the pixel at these absorption peak positions is extracted. An accumulator is built in the FPGA, and the light intensity value of a certain pixel at each absorption peak position is fed into the accumulator in sequence for summation. Then, the sum is divided by the number of absorption peaks of the pixel through the division operation module to obtain the light intensity value of the absorption peak at the pixel.

[0024] The design incorporates a two-layer nested loop structure, which iterates through the coordinates of all pixels in the second-order absorption peak storage BRAM, accumulates the light intensity value of the absorption peak of each pixel, and then divides the accumulated sum by the total number of pixels through a division operation module to obtain the light intensity value of the absorption peak position of the normal cell.

[0025] When calculating the standard deviation of light intensity, first subtract the light intensity value of the corresponding pixel from the light intensity value of each absorption peak position, then use a multiplier to square the difference, then use an accumulator to sum the squared differences of all pixels, then use a division module to divide the sum of the squared differences by the number of wavelengths, and finally take the square root of the result to obtain the standard deviation of light intensity of normal cells.

[0026] Furthermore, the method for setting difference thresholds for the light intensity value, standard deviation, contrast, energy, and entropy at the absorption peak position is as follows:

[0027] The total number of normal cells detected was counted, and each normal cell had corresponding contrast, energy, and entropy values. The average contrast, average energy, and average entropy of these normal cells were calculated using multipliers and adders. At the same time, the standard deviation of contrast and the standard deviation of entropy were calculated. The threshold range of light intensity value was set as the light intensity value of the absorption peak of normal cells plus or minus 2.5 times the standard deviation of light intensity of normal cells. The threshold of light intensity standard deviation was set as twice the standard deviation of light intensity of normal cells. The threshold of contrast was set as the average contrast of normal cells plus 3 times the standard deviation of contrast. The threshold of energy was set as 0.8 times the lowest energy value of normal cells. The threshold of entropy was set as the average entropy of normal cells plus 2 times the standard deviation of entropy.

[0028] Furthermore, the method for calculating texture features is as follows:

[0029] A light intensity co-occurrence matrix (GLCM) is constructed. The light intensity level of the image is set to 256, the distance is 2, and the direction includes 0°, 45°, and 135°. The storage structure of GLCM adopts a 256×256 two-dimensional array to record the occurrence of pixel pairs with different light intensity value combinations. Each storage unit corresponds to the light intensity value combination of two pixels. In the initial state, the value of all storage units is 0.

[0030] Pixel data is read from the spectral reflectance storage BRAM. For each pixel, its coordinates and light intensity value are obtained first. Another pixel is found according to the set distance and direction, and a pixel pair is formed until all pixels are traversed.

[0031] exist In the direction, for the current pixel at any coordinate, find the distance of... For each pixel, obtain the light intensity value of the two pixels, use these two values ​​as indices to find the corresponding position in the GLCM, increment the value at that position by 1, that is, perform read, modify and write operations on the data at the corresponding position in the GLCM, repeat this operation until all pixels have been traversed, and repeat the above operation until all pixels have been traversed.

[0032] for Direction: For the current pixel at any coordinate, find its direction in... directional distance is For each pixel, obtain the light intensity value of both, perform the same read, modify and write operation on the data at the corresponding position in GLCM, and repeat this operation until all pixels have been traversed;

[0033] for Starting from the first row and first column of the image, for any coordinate of the current pixel, find the pixel that is 2 units away in the 135° direction, obtain the light intensity values ​​of the two, perform the same read, modify and write operation on the data at the corresponding position in GLCM, and repeat this operation until all pixels have been traversed.

[0034] In the FPGA, multipliers, subtractors, and accumulators are constructed to calculate contrast: the contrast of a normal cell is obtained by multiplying the squared difference of all light intensity pairs by the number of occurrences of the corresponding pixel pairs, and then accumulating these products. Similarly, the same arithmetic units are constructed to calculate energy: the number of occurrences of all pixel pairs is squared, and then the squared results are accumulated to obtain the energy of a normal cell. When calculating entropy, a lookup table is first created using a new BRAM to store the base-2 logarithmic result of the number of occurrences of each pixel pair. The corresponding logarithmic result can be obtained from the lookup table based on the input value. Then, the constructed multipliers, subtractors, and accumulators are used to calculate the product of the number of occurrences of all pixel pairs and their corresponding logarithmic results. The negative values ​​of these products are then accumulated to obtain the entropy of a normal cell.

[0035] Furthermore, the methods for determining spectral feature anomalies and texture feature anomalies are as follows:

[0036] Based on spectral characteristics, the light intensity value and its standard deviation at the absorption peak position of the cell to be tested are used as the judgment index: when the light intensity value of the absorption peak of the cell to be tested is greater than the light intensity value of the absorption peak of normal cells plus 2.5 times the standard deviation, or the light intensity value of the absorption peak is less than the light intensity value of the absorption peak of normal cells minus 2.5 times the standard deviation, or the light intensity standard deviation is greater than twice the light intensity standard deviation of normal cells, if any of these conditions are met, the spectral characteristics of the cell to be tested are judged to be abnormal.

[0037] Three signals are set for judging spectral feature anomalies: when the light intensity at the absorption peak position of the cell to be detected is greater than the upper threshold, the first signal outputs a high level, otherwise it outputs a low level; when the light intensity at the absorption peak position of the cell to be detected is less than the lower threshold, the second signal outputs a high level, otherwise it outputs a low level; when the standard deviation of the light intensity of the cell to be detected is greater than the threshold, the third signal outputs a high level, otherwise it outputs a low level. The first two signals are connected by an OR gate to generate a light intensity over-limit signal. When either of these signals is high, the light intensity judgment signal outputs a high level. The light intensity judgment signal and the third signal are then connected by an OR gate to generate a spectral feature anomaly signal. When this signal is high, it indicates that the spectral feature is abnormal; when it is low, it indicates that the spectral feature is normal.

[0038] For texture features, the contrast, energy, and entropy of the cell to be detected are used as judgment indicators; when the contrast of the cell to be detected is greater than the contrast threshold, or the energy is less than the energy threshold, or the entropy is greater than the entropy threshold, the texture features of the cell to be detected are judged to be abnormal.

[0039] Three signals are set for texture feature anomaly detection: the first signal outputs a high level when the contrast of the cell to be detected is higher than the upper threshold, and a low level otherwise; the second signal outputs a high level when the energy of the cell to be detected is lower than the lower threshold, and a low level otherwise; the third signal outputs a high level when the entropy of the cell to be detected is higher than the upper threshold, and a low level otherwise. These three signals are connected by an OR gate to generate a texture feature anomaly signal. When any one of the signals is high, the texture feature anomaly signal outputs a high level; when the signal is high, it indicates a texture feature anomaly, and when it is low, it indicates a normal texture feature.

[0040] Compared with the prior art, the beneficial effects of the present invention are:

[0041] By accurately calculating spectral reflectance and its first and second derivatives to determine the position of the absorption peak, the light intensity value and standard deviation of the absorption peak position are obtained. Contrast, energy, and entropy texture features are then calculated, enabling a multi-dimensional, high-precision quantitative description of cell features. This captures the differences between cancer cells and normal cells, compares the features of the cells to be detected with the threshold range of normal cells, and classifies cells by comprehensively considering spectral and texture features, avoiding the limitations of single-feature judgment. The entire cell classification process is implemented using an FPGA. The FPGA's internal storage module and computing unit can quickly process and store large amounts of image data and calculation results, greatly improving processing speed compared to traditional software-based processing methods. This allows for real-time analysis and classification of cell images, meeting the needs of real-time detection. Attached Figure Description

[0042] Figure 1 This is a schematic diagram of the overall method flow of the present invention;

[0043] Figure 2 This is a schematic diagram of the spectral characteristics of the present invention;

[0044] Figure 3 This is a schematic diagram of the texture features of the present invention;

[0045] Figure 4 This is a spectral feature verification diagram of the present invention;

[0046] Figure 5 This is a texture feature verification image for the present invention;

[0047] Figure 6 This is an output diagram of the abnormal features of the present invention. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments;

[0049] It should be noted that, unless otherwise defined, the technical or scientific terms used in this invention should have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains; the terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components; the terms "comprising" or "including," etc., mean that the element or object preceding the word covers the element or object listed after the word and its equivalents, without excluding other elements or objects; the terms "connected" or "linked," etc., are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect; "upper," "lower," "left," "right," etc., are only used to indicate relative positional relationships, and when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0050] Example:

[0051] Please see Figures 1 to 6 The present invention provides a technical solution:

[0052] A real-time hyperspectral microscopic image cell classification method based on FPGA, comprising the following steps:

[0053] Step 1: Using hyperspectral imaging technology, acquire hyperspectral microscopic images of normal cells in the wavelength range of 400nm to 2500nm at 3nm intervals. Determine the number of wavelength points according to the wavelength range and interval, and store the image data in the internal storage module of the FPGA. The image data includes the wavelength range, wavelength interval, coordinates of the pixel, light intensity value, and number of wavelength points.

[0054] Different biomolecules, such as proteins, nucleic acids, and lipids, have different absorption and scattering characteristics within a specific wavelength range. By obtaining the light intensity values ​​corresponding to different wavelengths, we can capture the response of various biomolecules in cells to light, thereby indirectly reflecting the material composition of cells. For example, some proteins have obvious absorption peaks at specific wavelengths. By detecting the changes in light intensity at that wavelength, we can infer that there are differences in composition compared to normal cells.

[0055] exist Within the wavelength range, with Images are acquired at wavelength intervals, and a formula for calculating the number of wavelength points is constructed:

[0056]

[0057] coordinates in the Cartesian coordinate system To represent the planar position of an image, pixels are mapped one-to-one with coordinates. BRAM (Browser-Based RAM) is chosen as the storage module and named the Raw Image Data Storage BRAM. When acquiring data for a single pixel, its coordinates are first extracted... The coordinate values ​​are converted into their corresponding binary numbers, written into the BRAM, and then the pixel is extracted. Coordinate values, after being converted to binary numbers, in The coordinates are subsequently written to the BRAM in consecutive storage locations, and a unique index value is assigned to each wavelength. Increasing sequentially to To finish, first store the wavelength index value in binary form in the BRAM, and then store the light intensity value immediately after the wavelength index in the BRAM;

[0058] In cell classification applications, it is often necessary to process a large number of hyperspectral microscopic images quickly to meet the requirements of real-time detection. FPGA has parallel processing capabilities and high-speed computing performance, which can perform complex calculations and analyses on image data in a short time. Although FPGA itself does not have the ability to directly store images, it can realize the image storage function by configuring its internal storage resources to store image data in the internal storage module, thereby performing efficient data processing directly at the hardware level.

[0059] Step 2: Pre-set the reference light intensity value, calculate the spectral reflectance by reading the number of wavelength points and the reference light intensity value from the FPGA's internal storage module, and then determine the absorption peak position based on the first and second derivatives of the spectral reflectance, and calculate the spectral characteristics, which include the light intensity value and standard deviation of the absorption peak position.

[0060] A data buffer is constructed using the raw image data storage BRAM inside the FPGA. The raw image data storage BRAM is read sequentially in a line-by-line scanning order, and the pixel data is stored in the buffer. Then, the data centered on each pixel is extracted from the buffer. Original light intensity value of neighboring pixels The computational unit is constructed using multiple multipliers and adders. For each pixel, the original light intensity values ​​of the extracted nine neighboring pixels are processed by control logic. Simultaneously fed into the multiplier, each multiplier and... The values ​​are multiplied, and then these products are accumulated through an adder tree structure to obtain the new light intensity value of the pixel after mean filtering. This completes the light intensity value smoothing process, where the original light intensity value of each pixel is replaced with the mean of the light intensity values ​​of its surrounding pixels. The calculation formula is as follows:

[0061]

[0062] In the formula, Representing coordinates The original light intensity value of the pixel, where, , , Representing coordinates After mean filtering, the new light intensity value is affected by noise inevitably introduced during hyperspectral microscopy image acquisition due to electronic components of the imaging equipment, optical systems, and environmental factors. Mean filtering effectively smooths the data and reduces the impact of noise by averaging the light intensity values ​​of a pixel and its neighboring pixels. Specifically, the selection of... Neighborhood mean filtering can achieve a good balance between reducing noise and preserving image details, avoiding excessive smoothing of the image due to excessively large neighborhood size, which can lead to the loss of cell edge and fine structure information.

[0063] Next, calculate the spectral reflectance:

[0064]

[0065] In the formula, It is a wavelength of spectral reflectance, This is a reference light intensity value. A BRAM (Bright Spot RAM) is selected as the storage module and named the Spectral Reflectance Storage BRAM. It stores the spectral reflectance value of each pixel at different wavelengths. Accurately calculating spectral reflectance is a key step in obtaining cellular spectral information. It reflects the cell's ability to reflect light of different wavelengths. Due to differences in their internal structure, composition, and physiological state, cells have different light reflection characteristics. These changes can be detected through spectral reflectance, which helps to distinguish between normal cells and cancer cells.

[0066] The absorption and reflection characteristics of cells to light of different wavelengths determine the shape of their spectral reflectance curve. The absorption peak is the location where the reflectance in the spectral reflectance curve reaches a local minimum. When the first derivative of the spectral reflectance is zero, it means that the slope of the reflectance curve at that point is zero, which may be an extreme point, i.e., the location of the absorption peak or reflection peak. When the first derivative is zero and the second derivative is less than zero, it indicates that the reflectance curve changes from a convex function to a concave function at that point, i.e., from an upward trend to a downward trend. This is consistent with the characteristics of an absorption peak, thus determining that point as the location of the absorption peak.

[0067] Read the spectral reflectance values ​​of each pixel at different wavelengths sequentially from the spectral reflectance storage BRAM. Using wavelength as the independent variable, the first derivative of the spectral reflectance curve of each pixel is calculated. Multiple subtractors and multipliers are constructed in the FPGA to perform calculations. Then through the multiplier and The multiplication is performed, and the calculated first derivative result is stored in a new BRAM, named the First Derivative Storage BRAM. The storage address is associated with the corresponding pixel coordinates and wavelength information, as shown in the formula:

[0068]

[0069] In the formula, Indicates wavelength interval, Represents wavelength point The first derivative of , where, Representing points of different wavelengths, ;

[0070] First-order derivative data are read sequentially from the first-order derivative storage BRAM in wavelength order. Then calculate the second derivative, the formula is:

[0071]

[0072] In the formula, Represents wavelength point The second derivative will satisfy The point is defined as the position of the absorption peak, which is calculated by the subtractor. Then through the multiplier and Multiply to obtain the wavelength point The second derivative is used to design comparators and logic decision units in an FPGA, and the first derivative is used for each wavelength point. and second derivative and Compare and satisfy The wavelength point is stored in the new second-order absorption peak storage BRAM;

[0073] According to the Lambert-Beer law, under certain conditions, absorbance is directly proportional to the concentration of a substance. When the content of a certain biomolecule in a cell increases, its light absorption at the characteristic absorption wavelength will be enhanced, resulting in a decrease in the light intensity value of the absorption peak. Conversely, when the content of the biomolecule decreases, the light intensity value of the absorption peak will increase. By detecting the change in the light intensity value of the corresponding absorption peak, it can be indirectly reflected that tumor-related proteins or metabolites may be overexpressed or abnormally accumulated.

[0074] The number of absorption peaks for each pixel is counted from the second-order absorption peak storage BRAM, and the light intensity value of that pixel at these individual absorption peak positions is extracted. An accumulator is built in the FPGA to process the extracted values ​​for a given pixel. The light intensity value at each individual absorption peak position The data are sequentially fed into the accumulator for summation to obtain the total. Then, a division operation module is built to divide the sum obtained above by the number of absorption peaks of that pixel. , obtain pixels light intensity value at the absorption peak The calculation formula is:

[0075]

[0076] In the formula, Representing coordinates The light intensity value at the absorption peak, Representing coordinates The number of absorption peaks. Representing coordinates First The light intensity values ​​at the positions of the absorption peaks, among which... The range of values ​​is arrive Positive integers;

[0077] The concentration of organelle-related biomolecules varies at different locations within a cell. This non-uniformity causes the absorption peak light intensity value of a single pixel to be strongly affected by the local material distribution, resulting in significant individual differences. By calculating the average absorption peak light intensity value of all pixels in a cell, the situation of various regions within the cell can be comprehensively considered, avoiding the erroneous identification of cancer cells as normal cells due to these local abnormalities.

[0078] Design a two-level nested loop structure to iterate through the second-order absorption peaks and store the pixel coordinates in the BRAM. By accumulating the light intensity values ​​of each pixel, we obtain Then, the division module divides the accumulated sum by the total number of pixels. The light intensity at the absorption peak position is obtained. The formula for calculating the light intensity value at the absorption peak position is:

[0079]

[0080] In the formula, The light intensity value that indicates the location of the absorption peak in normal cells. This represents the total number of pixels. Then, the division module divides the accumulated sum by the total number of pixels. ,get ;

[0081] The standard deviation of light intensity quantifies the dispersion of light intensity values ​​within a cell. A larger standard deviation indicates greater differences in light intensity values ​​among different pixels within the cell, meaning a more uneven distribution of biomolecules. Conversely, a smaller standard deviation indicates a more uniform distribution of biomolecules within the cell. Cancer cells, due to metabolic disorders and abnormal cell structure, often exhibit abnormal changes in biomolecule distribution, which are reflected in an increase in the standard deviation of light intensity. Therefore, the standard deviation of light intensity is calculated as follows:

[0082] Light intensity value at each absorption peak position Subtract coordinates absorption peak light intensity value The difference is squared using a multiplier to obtain the result. Construct an accumulator that sums the squared differences calculated for each pixel to obtain the result. Build a division operation module to first calculate the sum of squares of the accumulated differences. Divide by ,get The calculation formula is:

[0083]

[0084] In the formula, This represents the standard deviation of light intensity in normal cells.

[0085] Step 3: Extract the light intensity value of the absorption peak position of each pixel from the FPGA internal storage module, calculate the texture features, which include contrast, energy and entropy, and set difference thresholds for the light intensity value, standard deviation, contrast, energy and entropy at the absorption peak position respectively.

[0086] The texture features of cell images reflect the arrangement and distribution of internal cell structures. The Light Intensity Co-occurrence Matrix (GLCM) is a classic method for describing image texture information. It characterizes the texture properties of an image by statistically analyzing the frequency of pixel pairs with different light intensity values ​​appearing in a specific direction and distance. In cell images, the cell membrane, nucleus, cytoplasm, and other structures of the cell, as well as the relationships between them, form different texture patterns, which can be represented in GLCM.

[0087] Constructing a light intensity co-occurrence matrix Set the light intensity level of the image to The distance is , direction is Because the light intensity level of the image is set to The range of light intensity values ​​can usually be within Therefore, a light intensity co-occurrence matrix is ​​constructed. The storage structure is A two-dimensional array storage area is used to store the data of the light intensity co-occurrence matrix, covering various light intensity value changes that may occur in the cell image, avoiding information loss. Textures in different directions may reflect the arrangement of different cell structures; select These three directions can cover common texture direction variations in cell images, and each storage unit is used to record the number of times the corresponding combination of light intensity values ​​of pixel pairs occur. , and These represent the light intensity values ​​of two pixels, and all elements are initialized to 0. That is, initially, the number of times each pair of pixels with the same light intensity value appears is 0;

[0088] Pixel data is read from the spectral reflectance storage BRAM. For each pixel, its coordinates are first obtained. And the light intensity value, based on the set distance and direction Find another pixel and form a pixel pair, until all pixels have been traversed;

[0089] For each pixel, in In the direction, find the distance as The pixel point, i.e., the coordinates are For each pixel, obtain the light intensity value of these two pixels. and ,by and Using the index, in the light intensity co-occurrence matrix Find the corresponding position Add the element value at that position Repeat the above operation until all pixels have been traversed;

[0090] for Direction, for coordinates Find the current pixel and its position in the image. directional distance is The pixel point, i.e., the coordinates are For each pixel, obtain the light intensity value of these two pixels. and For the corresponding GLCM storage area The location data is read, modified, and written (read the original data, add 1, and write it back). The above operation is repeated until all pixels have been traversed.

[0091] for The direction starts from the first row and first column of the image, for coordinates... Find the current pixel and its position in the image. directional distance is The pixel point, i.e., the coordinates are For each pixel, obtain the light intensity value of these two pixels. and For the corresponding GLCM storage area The location data is read, modified, and written (read the original data, add 1, and write it back). The above operation is repeated until all pixels have been traversed.

[0092] Construct multiplier, subtractor, and accumulator operation units in the FPGA to implement the contrast calculation formula:

[0093]

[0094] In the formula, Contrast in normal cells reflects the magnitude of brightness differences between regions of different light intensity in a hyperspectral micrograph of a cell. The contrast in a cell image reflects the variation in light intensity values ​​across different regions. Cancer cells, due to changes in their morphology, structure, and metabolism, often exhibit enlarged nuclei, abnormal chromatin distribution, and altered intercellular connections. These changes increase the difference in light intensity between different regions in the cell image, thus raising or lowering the contrast, providing a key texture feature for distinguishing normal cells from cancer cells. The higher the value, the stronger the contrast between light and dark in the image texture, corresponding to irregularities in the internal structure of cells, such as the mottled texture formed by the aggregation of chromatin in cancer cells. The smaller the value, the smaller the light intensity difference between most pixel pairs in the cell image, resulting in a smoother and more uniform overall image texture. For example, the light intensity distribution in the cytoplasm of normal cells is consistent, the contrast at the boundary between the cell nucleus and cytoplasm is moderate, and there are no significant areas of abrupt changes in brightness. The larger the absolute value of the difference, the The larger the value, the better. This reflects the frequency of differences; the higher the value, the more frequent the difference. The larger the value, the stronger the positive correlation.

[0095] Multipliers, subtractors, and accumulators are constructed in an FPGA to implement the energy calculation formula:

[0096]

[0097] In the formula, The energy value represents the energy of a normal cell. The energy value is calculated as the sum of the squares of the values ​​of each element in the GLCM. It reflects the uniformity of the light intensity distribution in the image. In normal cell images, due to the relative stability of cell structure and composition, the distribution of light intensity values ​​at different locations is relatively uniform, and the energy value is relatively high. However, the abnormal growth and metabolic changes of cancer cells lead to uneven distribution of intracellular substances, and the distribution of light intensity values ​​becomes more dispersed, thus reducing the energy value.

[0098] First, create a lookup table by naming the new BRAM and then using that lookup table. The results are stored in a lookup table. The corresponding result is retrieved from the lookup table based on the input value. Then, by constructing multiplier, subtractor, and accumulator operation units, the entropy calculation formula is implemented.

[0099]

[0100] In the formula, The entropy of a normal cell is... Implementing logarithmic operations directly in hardware is quite complex. Compared with common arithmetic operations such as addition and multiplication, logarithmic operations require more computational steps and resources. If a series expansion-based method is used for calculation, the number of series terms required will increase as the computational accuracy requirements increase, and the computational complexity will also increase significantly, which cannot meet the needs of real-time image processing.

[0101] Entropy is an indicator that measures the complexity or randomness of image texture. The texture structure of normal cells usually has a certain regularity and repetition, and its entropy value is relatively low. Cancer cells, due to the abnormalities in their cell morphology, structure and function, often have more complex and irregular image textures, and their entropy values ​​will increase or decrease accordingly.

[0102] The number of normal cells to be detected was set to , No. The contrast ratio of each normal cell is Energy is Entropy is , , for Positive integers are used to calculate contrast, energy, and entropy using multipliers and adders;

[0103] The average contrast of normal cells is:

[0104]

[0105] In the formula, The average contrast of a normal cell;

[0106] The average energy of normal cells is:

[0107]

[0108] In the formula, The average energy of a normal cell;

[0109] The average entropy of normal cells is:

[0110]

[0111] In the formula, The average entropy of a normal cell;

[0112] The formula for calculating the standard deviation of normal cell contrast is:

[0113]

[0114] In the formula, The standard deviation representing the contrast of normal cells. ;

[0115] The formula for calculating the standard deviation of normal cell entropy is:

[0116]

[0117] In the formula, The standard deviation representing the contrast of normal cells. ;

[0118] Calculate the spectral and texture features of the cells to be detected, and calibrate the light intensity values ​​at the absorption peak positions as follows: The standard deviation is calibrated as Contrast calibration is Energy calibrated as Entropy is calibrated as Then, difference thresholds were set for light intensity, standard deviation, contrast, energy, and entropy, respectively.

[0119] Under physiological conditions, the spectral characteristics of normal cells exhibit certain stability and regularity, showing a relatively concentrated distribution trend. Through statistical analysis of a large number of normal cell samples, the mean and standard deviation of these characteristics can be obtained, thereby determining a reasonable threshold range that reflects the degree of variation of the normal cell population in this characteristic.

[0120] Based on measurements and statistical analysis of a large number of similar normal cell samples, the threshold range for light intensity was set as follows:

[0121]

[0122] In the formula, It indicates the threshold range of light intensity values, which can ensure a high coverage of normal cells and avoid misidentifying normal cells as cancer cells;

[0123] The content of biomolecules inside normal cells is stable, and the intensity of the absorption peak light around the mean. Cancer cells or other abnormal cells, due to their internal physiological and pathological changes, will cause significant changes in spectral characteristics. The threshold range of light intensity standard deviation is set as follows:

[0124]

[0125] In the formula, This represents the standard deviation threshold of light intensity, which can detect this abnormal situation of increased intercellular differences and screen out abnormal cells that have significant differences in spectral characteristics from normal cells.

[0126] The light intensity value at the position of the absorption peak of the cell to be detected Or the light intensity value at the location of the absorption peak of the cell to be detected. Determine spectral anomalies; when the standard deviation of light intensity... If the spectral characteristics of the cell to be tested are abnormal, the cell to be tested is judged to have abnormal spectral characteristics as a whole if either of the two spectral characteristic determinations above is abnormal. For example, when cancer cells divide rapidly, nucleic acids are replicated in large quantities, which enhances light absorption capacity and increases the intensity value.

[0127] Normal cells have a relatively stable and ordered internal structure, and their texture features are within a certain normal range. When cells become cancerous, the structural changes cause changes in contrast, and the difference in light intensity between adjacent pixels increases sharply, resulting in a contrast higher than the normal range. The upper limit threshold for contrast is set as follows:

[0128]

[0129] In the formula, This represents the upper limit threshold of contrast. In statistics, by statistically analyzing the contrast data of a large number of normal cell samples, a large number of data will fall within this range, reducing the probability of misclassifying normal cells as cancer cells.

[0130] Cancer cells often exhibit significantly different energy levels compared to normal cells due to metabolic disorders and abnormal cell structure. For example, metabolic disorders can lead to a decrease in energy levels. Therefore, the lower limit threshold for energy is set as follows:

[0131]

[0132] In the formula, This indicates the lower energy threshold. This represents the lowest energy value in normal cells. The energy value of normal cells may vary under different physiological states or experimental conditions; however, this variation is usually relatively small and gradual, without significant fluctuations. Statistical analysis of contrast data from a large number of normal cell samples... The selection of this coefficient can adapt to the changing characteristics of normal cell energy values. Even if normal cells are briefly hypoxic, their energy will not fall below 80% of their minimum value.

[0133] Changes in the internal structure of cancer cells disrupt the number, size, and location of organelles, as well as the distribution of biomolecules. Entropy can quantify this disorder. The entropy value of normal cells is relatively stable. When cells become diseased, the degree of disorder in their internal structure increases, and the entropy value changes accordingly. The upper limit threshold of entropy is set as follows:

[0134]

[0135] In the formula, This represents the upper limit threshold of entropy. Through statistical analysis of contrast data from a large number of normal cell samples, the entropy values ​​of normal cells typically approximate a normal distribution, covering approximately... The entropy value of a normal cell is calculated, and then the threshold is stored in the ROM inside the FPGA.

[0136] Table 1 shows the light intensity, contrast, energy, and entropy of 40 groups of the same type of cells. Groups 1-20 are normal cells, and groups 21-40 are cancer cells. The data were then compiled into a spectral characteristic statistical table.

[0137] Table 1 Statistical Table of Spectral Characteristics

[0138] Sample number Light intensity Standard deviation of light intensity Contrast energy entropy 1 82.3 6.8 3850 192000 7100 2 86.5 7.2 4120 205000 7850 3 79.8 8.1 3680 188000 7320 4 91.2 6.5 4350 212000 7640 5 84.7 7.9 3980 195000 7010 6 88.1 6.3 4050 221000 7930 7 77.4 8.5 3720 181000 7250 8 93.6 7 4280 208000 7760 9 85.2 6.7 3890 198000 7150 10 89.5 7.5 4180 215000 7890 11 75.9 8.3 3650 185000 7380 12 95.1 6.1 4320 225000 7680 13 83.6 7.7 3920 190000 7050 14 87.8 6.9 4090 202000 7980 15 78.7 8.2 3780 183000 7210 16 92.4 6.4 4250 218000 7720 17 84.1 7.3 3810 196000 7120 18 88.9 7.1 4150 209000 7830 19 76.8 8.4 3690 187000 7350 20 94.3 6.6 4300 223000 7700 21 68.5 11.2 5200 128000 8800 22 102.3 13.7 6100 115000 8500 23 70.1 9.8 4850 132000 8050 24 99.7 12.5 5600 108000 8300 25 65.8 14.3 5900 121000 6650 26 105.6 10.5 4980 130000 8100 27 71.9 11.8 5400 112000 8450 28 98.2 13.1 6300 105000 8200 29 67.3 12 5100 125000 8750 30 101.5 11.4 5700 118000 7550 31 88.6 10.3 5300 123000 8200 32 90.2 12.8 6000 102000 8500 33 73.6 11.1 5050 129000 9100 34 96.8 13.4 5800 110000 8350 35 75.2 10.8 5500 116000 8400 36 94.7 12.2 4800 135000 9050 37 82.9 11.5 5250 120000 8250 38 86.3 13 6200 107000 8600 39 74.5 10.6 5150 126000 8150 40 92.8 12.6 5950 113000 8450

[0139] like Figures 2-3 As shown, the light intensity of groups 1-20 is concentrated between 72.5 and 97.5, with the standard deviation of light intensity mostly below 10, the contrast ratio concentrated between 3500 and 4700, the energy concentrated between 180000 and 230000, and the entropy stable between 7000 and 8000. The light intensity of groups 21-40 is partially below 72.5 and partially above 97.5, with the standard deviation of light intensity generally above 10, the contrast ratio generally exceeding 4700, the energy mostly below 136000, and the entropy generally above 8000. The characteristics of normal cells and cancer cells are significantly different, providing a scientific and effective analysis for cell classification methods.

[0140] Step 4: Acquire hyperspectral microscopic images of the cells to be tested, calculate spectral features and texture features. When the average value and standard deviation of the spectral features of the cells to be tested both exceed the threshold range of normal cells of the same type, the spectral features are determined to be abnormal. When the contrast, energy and entropy of the cells to be tested both exceed the threshold range of normal cells of the same type, the texture features are determined to be abnormal.

[0141] Hyperspectral microscopic images of the cells to be analyzed were acquired using the same hyperspectral imaging technique and parameter settings. The same techniques and parameters were used for image acquisition, and the same calculation methods were employed to obtain features, ensuring consistency between the data and the analysis. Within the wavelength range, with Spatial resolution, Images are acquired at wavelength intervals and stored in a second raw image data storage BRAM. When acquiring data for a single pixel, its data is first extracted. The coordinate values ​​are converted into their corresponding binary numbers, written into the BRAM, and then the pixel is extracted. Coordinate values, after being converted to binary numbers, in The coordinates are subsequently written to the BRAM in consecutive storage locations, and a unique index value is assigned to each wavelength. Increasing sequentially to To finish, first store the wavelength index value in binary form in the BRAM, then store the light intensity value immediately after the wavelength index in the BRAM, extract data from the second original image data storage BRAM, calculate the spectral and texture features of the cell to be detected, extract the spectral and texture features, and calculate the mean and standard deviation of the spectral features of the cell to be detected.

[0142] The comparison operation uses a comparator to call the threshold stored in ROM, and the contrast of the cell to be detected is then compared. The system determines that the texture features of the cell to be detected are abnormal; when the energy of the cell to be detected is abnormal... Determine abnormal texture features; when the entropy of the cell to be detected... If any one of the three texture feature determinations of the cell to be detected is abnormal, the texture feature of the cell to be detected is determined to be abnormal as a whole.

[0143] Setting the signal for detecting spectral anomalies:

[0144] Set the signal whose light intensity is greater than the upper threshold at the position of the absorption peak of the cell to be detected. ,when When the light intensity exceeds the upper limit threshold, Output a high level; otherwise, output a low level.

[0145] Set the signal where the light intensity at the absorption peak position of the cell to be detected is less than the lower threshold. ,when When the light intensity is below the lower limit threshold, Output a high level; otherwise, output a low level.

[0146] Set a signal whose standard deviation of light intensity of the cells to be detected is greater than the upper threshold. ,when When the light intensity is greater than the standard deviation threshold, Output a high level; otherwise, output a low level.

[0147] Then, construct a light intensity exceeding the limit signal. Connected via OR gate ,when When either is high, Output high level; only when When both are low level, Output low level; construct spectral characteristic anomaly signal Connected via OR gate and ,when or When either is high, Output high level only when and When both are low level, Output low level;

[0148] Setting the texture feature anomaly detection signal:

[0149] Set the signal where the contrast of the cells to be detected is higher than the upper limit threshold. ,when When the contrast is above the upper limit threshold, Output a high level; otherwise, output a low level.

[0150] Set the signal when the energy of the cell to be detected is below the lower limit threshold. ,when When below the lower energy threshold, Output a high level; otherwise, output a low level.

[0151] Set a signal when the entropy of the cell to be detected exceeds an upper threshold. ,when When it exceeds the upper limit threshold of entropy, Output a high level; otherwise, output a low level.

[0152] Constructing texture feature anomaly signals Connected via OR gate and ,when and When either is high, the signal A high level indicates abnormal texture features, only when and When both are low level, the signal The level is low, and the texture features are normal.

[0153] Step 5: If either the spectral feature or the texture feature is determined to be abnormal, the cell is classified as a cancer cell; if both the spectral feature and the texture feature are within the threshold range of normal cells of the same type, the cell is classified as a normal cell.

[0154] Medical research shows that cancer cells, due to internal physiological and pathological changes such as chromatin aggregation, metabolic disorders, and structural disintegration, will inevitably lead to abnormal spectral features or abnormal texture features, and at least one of the two will occur. Therefore, when either the spectral feature or the texture feature is judged to be abnormal, the cell is classified as a cancer cell. Only when both the spectral feature and the texture feature are within the threshold range of the same type of normal cell is the cell classified as a normal cell.

[0155] The two inputs of the OR gate within the FPGA are connected to the spectral feature anomaly signal V and the texture feature anomaly signal U, respectively. According to the judgment rule:

[0156] When signal V is high or signal U is high, the OR gate output is high—this indicates that the cell to be detected has been classified as a cancer cell.

[0157] When both signal V and signal U are low, the OR gate output is low—this indicates that the cell being tested is classified as a normal cell. Table 2 shows 40 sets of data on three types of cells: light intensity, light intensity standard deviation, contrast, energy, and entropy. These data were then summarized to generate a new data classification summary table.

[0158] Table 2 Summary Table of New Data Categories

[0159] Sample number Light intensity Standard deviation of light intensity Contrast energy entropy Cell types 1 82.7 7.3 4200 185000 8300 Cell A 2 69.3 8.9 4150 192000 8700 Cell A 3 88.5 9.1 5100 140000 8500 Cell A 4 95.3 10.8 4800 132000 9200 Cell A 5 78.9 6.5 3900 205000 8100 Cell A 6 99.6 7.8 4300 180000 8800 Cell A 7 84.1 8.2 4650 130000 8600 Cell A 8 75.6 11.2 5300 128000 8900 Cell A 9 91.8 5.7 4000 198000 7900 Cell A 10 80.3 10.5 4400 175000 8400 Cell A 11 86.9 7.1 4850 160000 9100 Cell A 12 68.5 12.3 4900 135000 8200 Cell A 13 89.2 6.8 4250 210000 8500 Cell A 14 96.7 9.5 4500 188000 8700 Cell A 15 72.3 9.2 4000 150000 8600 Cell B 16 68.5 8.8 4300 140000 8700 Cell B 17 88.9 9.8 4800 135000 8800 Cell B 18 95.2 9 4200 130000 8900 Cell B 19 75.6 8.5 4600 160000 8500 Cell B 20 82.1 10.1 4400 155000 8750 Cell B 21 78.9 9.3 4900 138000 8820 Cell B 22 90.5 8.7 4500 131000 8800 Cell B 23 69.2 9.5 4300 142000 8860 Cell B 24 85.7 9.4 4100 170000 8600 Cell B 25 93.8 10.2 4650 158000 8700 Cell B 26 76.4 9.1 4850 133000 8830 Cell B 27 89.3 8.9 4200 130000 8850 Cell B 28 80.5 9.8 4300 150000 8900 Cell C 29 73.2 10 4400 145000 8800 Cell C 30 92.8 10.6 4600 138000 9000 Cell C 31 102.5 10.2 4200 160000 9100 Cell C 32 85.6 9.5 4800 155000 9200 Cell C 33 78.9 10.8 4500 135000 8700 Cell C 34 98.7 10 4100 142000 8800 Cell C 35 76.3 11.2 4300 148000 9050 Cell C 36 89.2 9.7 4900 152000 9180 Cell C 37 100.8 10.3 4400 139000 8900 Cell C 38 82.7 9.9 4000 165000 8750 Cell C 39 74.1 10.5 4650 141000 9000 Cell C 40 95.3 10.1 4250 138000 9150 Cell C

[0160] like Figures 4-5 As shown, curves were generated after statistically analyzing the light intensity, standard deviation of light intensity, contrast, energy, and entropy of 40 groups of samples. Sample numbers 1-14 represent cell A, 15-27 represent cell B, and 28-40 represent cell C. The differences were compared against their respective set thresholds. Figure 6 The output classifies cells as normal, spectral features as abnormal, texture features as abnormal, and both spectral and texture features as abnormal, and labels them with red, blue, and cyan respectively. Cells A, B, and C all exhibit the following conditions: normal cells, abnormal spectral features, abnormal texture features, and both spectral and texture features as abnormal.

[0161] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.

[0162] The above embodiments can be implemented in whole or in part by software, hardware, firmware or other arbitrary combinations; when implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product; those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware; whether these functions are implemented by hardware or software methods depends on the specific application and design constraints of the technical solution.

[0163] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0164] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes 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.

Claims

1. A real-time hyperspectral microscopic image cell classification method based on FPGA, characterized in that, The specific steps include: Step 1: Using hyperspectral imaging technology in to wavelength range, in Normal cell hyperspectral microscopic images are acquired at intervals. The number of wavelength points is determined according to the wavelength range and interval. The image data is stored in the internal storage module of the FPGA. The image data includes wavelength range, wavelength interval, coordinates of the pixel, light intensity value, and number of wavelength points. Step 2: Pre-set the reference light intensity value, calculate the spectral reflectance by reading the number of wavelength points and the reference light intensity value from the FPGA's internal storage module, and then determine the absorption peak position based on the first and second derivatives of the spectral reflectance, and calculate the spectral characteristics, which include the light intensity value and standard deviation of the absorption peak position. Step 3: Extract the light intensity value of the absorption peak position of each pixel from the FPGA internal storage module, calculate the texture features, which include contrast, energy and entropy, and set difference thresholds for the light intensity value, standard deviation, contrast, energy and entropy at the absorption peak position respectively. Step 4: Acquire hyperspectral microscopic images of the cells to be tested, calculate spectral features and texture features. When the average value and standard deviation of the spectral features of the cells to be tested both exceed the threshold range of normal cells of the same type, the spectral features are determined to be abnormal. When the contrast, energy and entropy of the cells to be tested both exceed the threshold range of normal cells of the same type, the texture features are determined to be abnormal. Step 5: If either the spectral feature or the texture feature is determined to be abnormal, the cell is classified as a cancer cell. If both the spectral feature and the texture feature are within the threshold range of normal cells of the same type, the cell is classified as a normal cell.

2. The method for real-time hyperspectral microscopic image cell classification based on FPGA according to claim 1, characterized in that: The method for storing image data in the FPGA's internal storage module is as follows: exist Within the wavelength range, with Spatial resolution, Images are acquired at wavelength intervals, and the image plane position is represented by coordinates in a Cartesian coordinate system. Pixels are mapped one-to-one with coordinates. BRAM is selected as the storage module and named Raw Image Data Storage BRAM. When acquiring data for a single pixel, its... The coordinate values ​​are converted into their corresponding binary numbers, written into the BRAM, and then the pixel is extracted. Coordinate values, after being converted to binary numbers, in The coordinates are subsequently written to the BRAM in consecutive storage locations. A unique index is assigned to each wavelength. The index value of the wavelength is first stored in the BRAM in binary form, and then the light intensity value is stored in the BRAM immediately after the wavelength index.

3. The method for real-time hyperspectral microscopic image cell classification based on FPGA according to claim 2, characterized in that: The method for calculating spectral reflectance is as follows: A data buffer is constructed using the raw image data storage BRAM inside the FPGA. Pixel data in the raw image data storage BRAM is read sequentially in a line-by-line scanning order, and each line of data is stored sequentially in the buffer. Then, the original light intensity values ​​of each pixel in a 3×3 neighborhood centered on the target pixel are extracted from the buffer. A computation unit is constructed using multiple multipliers and adders. For each pixel, the extracted original light intensity values ​​of the nine neighboring pixels are simultaneously fed into the multiplier using control logic. Each multiplier performs an operation with 1 / 9. These operation results are then accumulated through an adder tree structure to obtain the new light intensity value of the pixel after mean filtering. That is, the original light intensity value of each pixel is replaced by the mean of the light intensity values ​​of its surrounding pixels. Subsequently, the spectral reflectance is calculated. The spectral reflectance is the ratio of the mean-filtered light intensity value to the reference light intensity value. The BRAM is selected as the storage module and named the spectral reflectance storage BRAM to store the spectral reflectance value of each pixel at different wavelengths.

4. The method for real-time hyperspectral microscopic image cell classification based on FPGA according to claim 1, characterized in that: The method for determining the position of the absorption peak based on the first and second derivatives of spectral reflectance is as follows: Using wavelength as the independent variable, the first derivative of the spectral reflectance curve of each pixel is calculated. Multiple subtractors and multipliers are constructed in the FPGA. The difference in spectral reflectance between two adjacent wavelength points is calculated by the subtractor, and then multiplied by the inverse of twice the wavelength interval by the multiplier to obtain the first derivative result of each wavelength point. The result is stored in a new BRAM and named the first derivative storage BRAM. First-order derivative data are read sequentially from the first-order derivative storage BRAM in wavelength order, and then the second-order derivative is calculated. Similarly, the difference between the first-order derivatives of two adjacent wavelength points is calculated by a subtractor, and then multiplied by a multiplier with twice the reciprocal of the wavelength interval to obtain the second-order derivative of each wavelength point. The wavelength points where the first derivative is 0 and the second derivative is less than 0 are defined as absorption peak positions. A comparator and logic judgment unit are designed in the FPGA to compare the first and second derivatives of each wavelength point with 0, and filter out the wavelength points that satisfy the condition that the first derivative is 0 and the second derivative is less than 0, and store them in a new second-order absorption peak storage BRAM.

5. The FPGA-based real-time hyperspectral microscopic image cell classification method according to claim 4, characterized in that: The method for calculating spectral characteristics is as follows: The number of absorption peaks of each pixel is counted from the second-order absorption peak storage BRAM, and the light intensity value of the pixel at these absorption peak positions is extracted. An accumulator is built in the FPGA, and the light intensity value of a certain pixel at each absorption peak position is fed into the accumulator in sequence for summation. Then, the sum is divided by the number of absorption peaks of the pixel through the division operation module to obtain the light intensity value of the absorption peak at the pixel. The design incorporates a two-layer nested loop structure, which iterates through the coordinates of all pixels in the second-order absorption peak storage BRAM, accumulates the light intensity value of the absorption peak of each pixel, and then divides the accumulated sum by the total number of pixels through a division operation module to obtain the light intensity value of the absorption peak position of the normal cell. When calculating the standard deviation of light intensity, first subtract the light intensity value of the corresponding pixel from the light intensity value of each absorption peak position, then use a multiplier to square the difference, then use an accumulator to sum the squared differences of all pixels, then use a division module to divide the sum of the squared differences by the number of wavelengths, and finally take the square root of the result to obtain the standard deviation of light intensity of normal cells.

6. The method for real-time hyperspectral microscopic image cell classification based on FPGA according to claim 1, characterized in that: The method for setting difference thresholds for the light intensity value, standard deviation, contrast, energy, and entropy at the absorption peak position is as follows: The total number of normal cells detected was counted, and each normal cell had corresponding contrast, energy, and entropy values. The average contrast, average energy, and average entropy of these normal cells were calculated using multipliers and adders. At the same time, the standard deviation of contrast and the standard deviation of entropy were calculated. The threshold range of light intensity value was set as the light intensity value of the absorption peak of normal cells plus or minus 2.5 times the standard deviation of light intensity of normal cells. The threshold of light intensity standard deviation was set as twice the standard deviation of light intensity of normal cells. The threshold of contrast was set as the average contrast of normal cells plus 3 times the standard deviation of contrast. The threshold of energy was set as 0.8 times the lowest energy value of normal cells. The threshold of entropy was set as the average entropy of normal cells plus 2 times the standard deviation of entropy.

7. The method for real-time hyperspectral microscopic image cell classification based on FPGA according to claim 3, characterized in that: The method for calculating texture features is as follows: A light intensity co-occurrence matrix (GLCM) is constructed. The light intensity level of the image is set to 256, the distance is 2, and the direction includes 0°, 45°, and 135°. The storage structure of GLCM adopts a 256×256 two-dimensional array to record the occurrence of pixel pairs with different light intensity value combinations. Each storage unit corresponds to the light intensity value combination of two pixels. In the initial state, the value of all storage units is 0. Pixel data is read from the spectral reflectance storage BRAM. For each pixel, its coordinates and light intensity value are obtained first. Another pixel is found according to the set distance and direction, and a pixel pair is formed until all pixels are traversed. exist In the direction, for the current pixel at any coordinate, find the distance of... For each pixel, obtain the light intensity value of the two pixels, use these two values ​​as indices to find the corresponding position in the GLCM, increment the value at that position by 1, that is, perform read, modify and write operations on the data at the corresponding position in the GLCM, repeat this operation until all pixels have been traversed, and repeat the above operation until all pixels have been traversed. for Direction: For the current pixel at any coordinate, find its direction in... directional distance is For each pixel, obtain the light intensity value of both, perform the same read, modify and write operation on the data at the corresponding position in GLCM, and repeat this operation until all pixels have been traversed; for Starting from the first row and first column of the image, for any coordinate of the current pixel, find the pixel that is 2 units away in the 135° direction, obtain the light intensity values ​​of the two, perform the same read, modify and write operation on the data at the corresponding position in GLCM, and repeat this operation until all pixels have been traversed. In the FPGA, multipliers, subtractors, and accumulators are constructed to calculate contrast: the contrast of normal cells is obtained by multiplying the squared difference of all light intensity value pairs by the number of occurrences of the corresponding pixel pairs, and then accumulating these products. Similarly, the above-mentioned arithmetic units are constructed to calculate energy: the number of occurrences of all pixel pairs is squared, and then the squared results are accumulated to obtain the energy of normal cells. When calculating entropy, a lookup table is first created through a new BRAM to store the base-2 logarithmic result of the number of occurrences of each pixel pair. The corresponding logarithmic result can be obtained from the lookup table according to the input value. Then, by constructing multipliers, subtractors, and accumulators, the product of the occurrence count of each pixel pair and its corresponding pairwise result is calculated. These products are then negative and accumulated to obtain the entropy of a normal cell.

8. The FPGA-based real-time hyperspectral microscopic image cell classification method according to claim 5, characterized in that: The methods for determining spectral feature anomalies and texture feature anomalies are as follows: Based on spectral characteristics, the light intensity value and its standard deviation at the absorption peak position of the cell to be tested are used as the judgment index: when the light intensity value of the absorption peak of the cell to be tested is greater than the light intensity value of the absorption peak of normal cells plus 2.5 times the standard deviation, or the light intensity value of the absorption peak is less than the light intensity value of the absorption peak of normal cells minus 2.5 times the standard deviation, or the light intensity standard deviation is greater than twice the light intensity standard deviation of normal cells, if any of these conditions are met, the spectral characteristics of the cell to be tested are judged to be abnormal. Three signals are set for judging spectral feature anomalies: when the light intensity at the absorption peak position of the cell to be detected is greater than the upper threshold, the first signal outputs a high level, otherwise it outputs a low level; when the light intensity at the absorption peak position of the cell to be detected is less than the lower threshold, the second signal outputs a high level, otherwise it outputs a low level; when the standard deviation of the light intensity of the cell to be detected is greater than the threshold, the third signal outputs a high level, otherwise it outputs a low level. The first two signals are connected by an OR gate to generate a light intensity over-limit signal. When either of these signals is high, the light intensity judgment signal outputs a high level. The light intensity judgment signal and the third signal are then connected by an OR gate to generate a spectral feature anomaly signal. When this signal is high, it indicates that the spectral feature is abnormal; when it is low, it indicates that the spectral feature is normal. For texture features, the contrast, energy, and entropy of the cell to be detected are used as judgment indicators; when the contrast of the cell to be detected is greater than the contrast threshold, or the energy is less than the energy threshold, or the entropy is greater than the entropy threshold, the texture features of the cell to be detected are judged to be abnormal. Three signals are set for texture feature anomaly detection: the first signal outputs a high level when the contrast of the cell to be detected is higher than the upper threshold, and a low level otherwise; the second signal outputs a high level when the energy of the cell to be detected is lower than the lower threshold, and a low level otherwise; the third signal outputs a high level when the entropy of the cell to be detected is higher than the upper threshold, and a low level otherwise. These three signals are connected by an OR gate to generate a texture feature anomaly signal. When any one of the signals is high, the texture feature anomaly signal outputs a high level; when the signal is high, it indicates a texture feature anomaly, and when it is low, it indicates a normal texture feature.