Cell counting method and device, computer equipment, storage medium and product
By optimizing the single-cell reference area and combining morphological operations, the problem of insufficient time and accuracy of traditional cell counting methods is solved, and efficient and accurate cell counting is achieved, which is suitable for cell counting in static and flowing states.
Patent Information
- Application Number
- CN202411795808.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-12-09
AI Technical Summary
Traditional cell counting methods are time-consuming and susceptible to subjective judgments by observers. Automatic cell image analysis is inefficient and insufficiently accurate when processing complex images and cell clusters. Deep learning methods require a lot of manual annotation and high computing power.
By acquiring target cell images, optimize the single-cell reference area using the target loss function, calculate the number of cells, and improve counting accuracy and efficiency based on integer multiple differences in cell area and single-cell reference area.
It significantly improves the accuracy and efficiency of cell counting, especially when dealing with cell clusters and complex backgrounds, overcomes the efficiency and accuracy limitations of traditional methods, and provides a reliable and efficient solution for cell image analysis.
Smart Images

Figure CN119273685A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of computer vision and image processing, and in particular to a cell counting method, apparatus, computer equipment, storage medium and product. Background Art
[0002] Cell counting and image analysis are important links in biological cell research. Traditional cell counting methods mainly rely on manual counting under a microscope. This method is time-consuming and easily affected by the subjective judgment of the observer, resulting in uncertainty in the accuracy of the results. With the development of computer vision technology, automated cell image analysis methods have gradually become a research hotspot. Although the automated cell image analysis methods in related technologies have improved the counting efficiency, they still have problems of low efficiency and insufficient accuracy when processing complex images and cell clusters. Conventional deep learning target detection methods require a large number of manually annotated images for training, and the generated model files are large, which has a large demand on the computing power of the inference device and has high requirements for building high-performance embedded systems. Summary of the invention
[0003] Based on this, it is necessary to provide a cell counting method, device, computer equipment, storage medium and product that can improve processing efficiency and accuracy in response to the above technical problems.
[0004] In a first aspect, the present application provides a cell counting method. The method comprises: Acquire a target cell image of a cell sample to be counted; Determining the number of cells in the target cell image based on the cell area of the cell region in the target cell image and the single cell reference area; The single-cell reference area is obtained by training with cell image samples and a target loss function, and the target loss function is used to indicate the difference between the cell area of the cell region in the cell image sample and an integer multiple of the single-cell reference area.
[0005] In one embodiment, the single cell reference area is obtained by the following steps: Obtain cell image samples; Based on the target loss function, determining the difference between the cell area of each cell region and the integer multiple of the single cell reference area from the cell image sample; With the goal of reducing the differences, parameters of the single cell reference area were optimized.
[0006] In one embodiment, determining the difference between the cell area of each cell region and the integer multiple of the single cell reference area from the cell image sample based on the target loss function includes: For each of the cell regions, respectively determine the ratio of the cell area of each of the cell regions to the single cell reference area; Comparing the ratio with adjacent integers corresponding to the ratio to obtain comparison results of each of the cell regions; The difference is determined by combining the comparison results of each of the cell regions.
[0007] In one embodiment, determining the number of cells in the target cell image based on the cell area of the cell region in the target cell image and the single cell reference area comprises: For each cell region in the target cell image, based on the cell area of each cell region and the single cell reference area, determining the number of cells corresponding to each cell region; The number of cells in the target cell image is obtained by combining the number of cells corresponding to each of the cell regions.
[0008] In one embodiment, the step of acquiring a target cell image of a cell sample to be counted comprises: Acquiring an original cell image of the cell sample to be counted; Preprocessing the original cell image in a noise-reducing manner to obtain a preprocessed cell image; Performing color space conversion and threshold segmentation on the preprocessed cell image to obtain a binary cell image; A morphological operation is performed on the binary cell image by using a corrosion operation to obtain the target cell image.
[0009] In one embodiment, after acquiring the target cell image of the cell sample to be counted, the method further comprises: Detecting the cell contour of the cell region in the target cell image; The cell area of the cell region is determined using the contour area of the cell contour.
[0010] In a second aspect, the present application also provides a cell counting device. The device comprises: An acquisition module, used for acquiring a target cell image of a cell sample to be counted; A determination module, used to determine the number of cells in the target cell image based on the cell area of the cell region in the target cell image and the single cell reference area; The single-cell reference area is obtained by training with cell image samples and a target loss function, and the target loss function is used to indicate the difference between the cell area of the cell region in the cell image sample and an integer multiple of the single-cell reference area.
[0011] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented: Acquire a target cell image of a cell sample to be counted; Determining the number of cells in the target cell image based on the cell area of the cell region in the target cell image and the single cell reference area; The single-cell reference area is obtained by training with cell image samples and a target loss function, and the target loss function is used to indicate the difference between the cell area of the cell region in the cell image sample and an integer multiple of the single-cell reference area.
[0012] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented: Acquire a target cell image of a cell sample to be counted; Determining the number of cells in the target cell image based on the cell area of the cell region in the target cell image and the single cell reference area; The single-cell reference area is obtained by training with cell image samples and a target loss function, and the target loss function is used to indicate the difference between the cell area of the cell region in the cell image sample and an integer multiple of the single-cell reference area.
[0013] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented: Acquire a target cell image of a cell sample to be counted; Determining the number of cells in the target cell image based on the cell area of the cell region in the target cell image and the single cell reference area; The single-cell reference area is obtained by training with cell image samples and a target loss function, and the target loss function is used to indicate the difference between the cell area of the cell region in the cell image sample and an integer multiple of the single-cell reference area.
[0014] The above-mentioned cell counting method, device, computer equipment, storage medium and product realize cell counting by the following steps: first, obtain the target cell image of the cell sample to be counted; then, based on the total area of the cell area in the image and the single cell reference area, calculate the number of cells in the target image. Among them, the single cell reference area is obtained by training with cell image samples and target loss functions. The target loss function is used to measure the difference between the total area of the cell area in the cell image sample (characterizing the cell area) and the integer multiple of the single cell reference area. Under ideal conditions (i.e., the tiled two-dimensional planar structure formed by the cell cluster in the microfluidic chip flow channel), the area of a single cell or cell cluster is linearly proportional to the number of cells it contains, and the area of a single cell or cell cluster is usually close to an integer multiple of the single cell area. Based on this feature, the present application is trained by cell image samples, and the parameter of the single cell reference area is optimized by reducing the value of the loss function. The optimized single cell reference area can be directly used to calculate the cell count of each cell area in the target cell image. This method not only significantly improves the accuracy and efficiency of cell counting, but also shows superior performance when dealing with cell clusters and complex backgrounds. By optimizing the calculation process and model parameters, this application also effectively overcomes the limitations of traditional cell counting methods in terms of efficiency and accuracy, providing a more reliable and efficient solution for cell image analysis.
[0015] Furthermore, through the above-mentioned cell counting method, device, computer equipment, storage medium and product, not only can the cell samples to be counted be accurately and efficiently counted in a static, in-situ state (such as a fluorescence microscopy picture), but also in a flowing, real-time state (such as a fluorescence microscopy video). This greatly improves the scope of application of the method for multiple scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A diagram showing an application environment of a cell counting method in one embodiment; Figure 2 A schematic diagram of a cell counting method in one embodiment; Figure 3 A schematic diagram of a process for determining a single cell reference area in one embodiment; Figure 4 A schematic diagram of a flow chart of a step of determining a difference in one embodiment; Figure 5 is a schematic diagram of a cell counting method in another embodiment; Figure 6 is a structural block diagram of a cell counting device in one embodiment; Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0018] Computer Vision (CV) is a science that studies how to make machines "see". To put it more specifically, it refers to the use of cameras and computers to replace human eyes to identify, track and measure targets, and further process images so that the computer processes them into images that are more suitable for human observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multi-dimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR (Optical Character Recognition), video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and mapping, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.
[0019] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning.
[0020] The technical solution provided in the embodiment of the present application relates to the field of computer vision and image processing technology, and utilizes computer vision technology to perform image processing and analysis on the cell image of the cell sample to be detected, and ultimately determines the number of cells in the cell image.
[0021] The cell counting method provided in the embodiments of the present application can be applied to Figure 1In the application environment shown. The application environment includes a microscope 102 and a terminal 104, and optionally, may also include a server 106. The microscope 102 may be an ordinary optical microscope, and the operator of the microscope 102 may collect the microscopic image in the eyepiece of the microscope 102 through an image acquisition component (such as a camera or other device with an integrated camera).
[0022] For example, the microscope 102 may be integrated with a photographic cassette, and the operator of the microscope 102 may capture the microscopic image in the eyepiece of the microscope 102 using a camera installed on the photographic cassette, and then import the microscopic image captured by the camera into the terminal 104 or the server 106 through the image output interface integrated in the camera.
[0023] Alternatively, the microscope 102 may be an electron microscope integrated with an image acquisition component, which also provides an image output interface. The operator of the microscope 102 acquires the microscopic image in the eyepiece of the microscope 102 by operating the image acquisition function of the electron microscope, and imports the microscopic image into the terminal 104 through the image output interface.
[0024] Among them, the above-mentioned image output interface can be a wired interface, such as a USB (Universal Serial Bus) interface, an HDMI (High Definition Multimedia Interface) interface or an Ethernet interface, etc.; or, the above-mentioned image output interface can also be a wireless interface, such as a WLAN (Wireless Local Area Network) interface, a Bluetooth interface, etc.
[0025] Accordingly, depending on the type of the above-mentioned image output interface, the operator may have a variety of ways to export the microscopic image taken by the camera, such as importing the microscopic image to the terminal 104 via a wired or short-distance wireless method, or importing the microscopic image to the terminal 104 or the server 106 via a local area network or the Internet.
[0026] The terminal 104 may be installed with an application for obtaining and presenting processing results of microscopic images. After the terminal 104 obtains the microscopic image in the eyepiece of the microscope 102, the processing results obtained by processing the microscopic image can be obtained through the above application and the processing results can be presented.
[0027] The terminal 104 may be a terminal device with certain processing capabilities and interface display functions, for example, the terminal 104 may be a mobile phone, a tablet computer, an e-book reader, smart glasses, a laptop computer, a desktop computer, and the like.
[0028] exist Figure 1 In the application environment shown, the terminal 104 and the microscope 102 are physically separate entity devices. In a possible implementation, the terminal 104 and the microscope 102 may also be integrated into a single entity device; for example, the microscope 102 may be an intelligent microscope with the computing and interface display functions of the terminal 104, or the microscope 102 may be an intelligent microscope with the computing power of the terminal 104, and the intelligent microscope may output image processing results through a wired or wireless interface.
[0029] The server 106 is a server, or is composed of several servers, or is a virtualization platform, or is a cloud computing service center.
[0030] The server 106 may be a server that provides background services for applications installed in the terminal 104 or the microscope 102. The background server may manage the version of the application, perform background processing on the microscopic images acquired by the application and return the processing results, etc.
[0031] Optionally, the terminal 104 is connected to the server 106 via a communication network. Optionally, the microscope 102 is connected to the server 106 via a communication network. Optionally, the communication network is a wired network or a wireless network.
[0032] For ease of introduction, the following will take the implementation of the present application by a computer device as an example for description. The computer device is an electronic device with computing and processing capabilities. The computer device can be a single device, for example, Figure 1 The terminal 104 or the server 106 in the application environment shown; or, the computer device may also be a collection of multiple devices, for example, the computer device may include the above Figure 1 The terminal 104 and the server 106 in the system shown, that is, the embodiment of the present application can be executed by the interaction of the above-mentioned terminal 104 and the server 106.
[0033] In one embodiment, Figure 2 As shown, a cell counting method is provided, comprising the following steps: Step 202, obtaining a target cell image of a cell sample to be counted.
[0034] The target cell image may refer to a microscopic image used for cell counting, or may be an image of a target counting area circled in a microscopic image.
[0035] Exemplarily, the cell sample to be counted is stained with fluorescent dyes or specific markers to enhance the visibility of the cells, and the computer device can obtain a microscopic image of the fluorescently stained or labeled cell sample under the microscope field of view through a microscope to obtain an image of the target cell.
[0036] Step 204 , determining the number of cells in the target cell image based on the cell area of the cell region in the target cell image and the single cell reference area.
[0037] The cell region may refer to an image portion in the target cell image that can reflect the location of the cell and be significantly distinguished from the background region, and may be an area surrounded by the cell boundary.
[0038] In general, the target cell image includes multiple cell areas, each of which may correspond to a single cell or a cell cluster formed by multiple cells. It is understandable that the cell population in the cell sample to be counted is usually the same type of cell in the same growth cycle, wherein the volume size of each cell is usually similar, that is, the outline size of each cell under a microscope is similar. Then, the area size of the cell area corresponding to the cell cluster is in direct proportion to the number of cells contained in the cell cluster. Based on this, the embodiment of the present application predetermines the single cell reference area corresponding to the cell sample to be counted, and uses the single cell reference area as a standard for comparison and estimation of the typical area of a single cell in the cell sample to be counted.
[0039] The single cell reference area of the embodiment of the present application is obtained in advance through image samples of the same cell sample as the cell sample to be counted and training with the target loss function. Since the cell cluster includes multiple independent cells, the area contributed by each cell is basically the same. In theory, the area of the cell cluster is close to an integer multiple of the single cell area. The embodiment of the present application guides the optimization of the single cell reference area parameters through the target loss function so that the relationship between the cell area of each cell region and the single cell reference area best meets the integer multiple condition.
[0040] For example, the single-cell reference area is updated with the goal of minimizing the target loss function, that is, the sum of the differences corresponding to each cell region should be as small as possible, where the difference corresponding to a single cell region refers to the difference between the cell area of the cell region and the integer multiple of its closest single-cell reference area.
[0041] Exemplarily, the computer device can pre-acquire or store a single-cell reference area corresponding to a cell sample to be counted. During the cell counting process, the computer device can distinguish whether each cell area corresponds to a single cell or a cell cluster by comparing the single-cell reference area with the cell area of each cell area in the target cell image, and further determine the number of cells in the cell area corresponding to the cell cluster, thereby obtaining the total number of cells in the target cell image.
[0042] The above-mentioned cell counting method realizes cell counting by the following steps: first, obtaining the target cell image of the cell sample to be counted; then, based on the total area of the cell area in the image and the single cell reference area, the number of cells in the target image is calculated. Among them, the single cell reference area is obtained by training with cell image samples and target loss functions. The target loss function is used to measure the difference between the total area of the cell area in the cell image sample (characterizing the cell area) and the integer multiple of the single cell reference area. Under ideal conditions (i.e., the tiled two-dimensional planar structure formed by the cell cluster in the microfluidic chip flow channel), the area of a single cell or cell cluster is linearly proportional to the number of cells it contains, and the area of a single cell or cell cluster is usually close to an integer multiple of the single cell area. Based on this feature, the embodiment of the present application is trained by cell image samples, and the parameter of the single cell reference area is optimized by reducing the value of the loss function. The optimized single cell reference area can be directly used to calculate the cell count of each cell area in the target cell image. This method not only significantly improves the accuracy and efficiency of cell counting, but also shows superior performance when dealing with cell clusters and complex backgrounds. By optimizing the calculation process and model parameters, the embodiments of the present application also effectively overcome the limitations of traditional cell counting methods in terms of efficiency and accuracy, and provide a more reliable and efficient solution for cell image analysis.
[0043] Furthermore, through the above-mentioned cell counting method, device, computer equipment, storage medium and product, not only can the cell samples to be counted be accurately and efficiently counted in a static, in-situ state (such as a fluorescence microscopy picture), but also in a flowing, real-time state (such as a fluorescence microscopy video). This greatly improves the scope of application of the method for multiple scenarios.
[0044] The process of determining the single cell reference area according to the embodiment of the present application will be further described below.
[0045] In one embodiment, Figure 3 As shown, the single cell reference area is obtained by the following steps: Step 302: Acquire a cell image sample.
[0046] It can be understood that the cell image sample refers to an image sample of a cell sample that is the same as the cell sample to be counted. Alternatively, the cell image sample may include a target cell image.
[0047] Step 304 , based on the target loss function, determine the difference between the cell area of the cell region and the integer multiple of the single cell reference area from the cell image sample.
[0048] Exemplarily, the computer device can set an initial single-cell reference area as an initial parameter, and based on the target loss function and the initial single-cell reference area, calculate, for each cell region, the difference between its cell area and its nearest integer multiple of the single-cell reference area, and then combine the sum of the differences corresponding to each cell region in a large number of cell image samples to obtain the difference between the cell area of the cell region and the integer multiple of the single-cell reference area.
[0049] Step 306 , with the goal of reducing the difference, optimize the parameters of the single cell reference area.
[0050] Exemplarily, in each iterative training, the computer device calculates the difference based on the target loss function and the current single-cell reference area, and then adjusts the single-cell reference area through an optimization algorithm (such as gradient descent, enumeration method or other suitable method) until the difference is less than a preset loss threshold or the number of iterative training reaches a preset number of iterations.
[0051] In such Figure 3 In a possible implementation of the embodiment shown, as Figure 4 As shown, based on the target loss function, the difference between the cell area of each cell region and the integer multiple of the single cell reference area is determined from the cell image sample, including: Step 402, for each cell region, respectively determine the ratio of the cell area of each cell region to the single cell reference area.
[0052] Step 404 , compare the ratio and the adjacent integers corresponding to the ratio to obtain comparison results for each cell region.
[0053] The adjacent integer corresponding to a ratio refers to the integer closest to the ratio.
[0054] Step 406, determining the difference by combining the comparison results of each cell region.
[0055] For example, for each cell region, the computer device divides the cell area of each cell region by the single cell reference area to obtain a ratio corresponding to each cell region, and then combines the difference between each ratio and its nearest integer to determine the final difference value.
[0056] For example, the objective loss function can be expressed as: ; ; in, i is the cell outline index that characterizes the cell area, n is the number of contours found, i.e. the number of cell regions, S i For the i The cell area corresponding to the cell outline is s is the single cell reference area parameter, k i is an intermediate variable.
[0057] Optionally, the cell image sample is a microscopic image of the cell sample at a first microscope magnification, and the target cell image is a microscopic image of the cell sample at a second microscope magnification. The first microscope magnification and the second microscope magnification may be the same, or the first microscope magnification and the second microscope magnification may be different. In the case where the first microscope magnification and the second microscope magnification are different, the computer device converts the single cell reference area obtained by training the cell image sample and the target loss function based on the proportional relationship between the first microscope magnification and the second microscope magnification, thereby determining the single cell reference area used to determine the number of cells in the target cell image.
[0058] In some preferred embodiments, the first microscope magnification and the second microscope magnification are the same, that is, a cell image with the same microscope magnification as the target cell image is used as a sample for training optimization to determine the single cell reference area parameter, thereby further improving the accuracy of cell counting.
[0059] In other preferred embodiments, before acquiring the target cell image or cell image sample, the embodiments of the present application can control the cells under the microscope field of view to be flat as much as possible, and avoid the formation of a three-dimensional structure of cell clusters to a certain extent, that is, prevent the cells from overlapping in the direction of the microscope field of view, thereby further improving the accuracy of the cell counting method provided by the embodiments of the present application. For example, when preparing a microscope sample, the cell suspension can be diluted to an appropriate concentration so that the cells are evenly distributed on the slide to reduce aggregation; for example, when using a microchannel device, the flow channel depth of the microfluidic chip can be set to be slightly larger than the diameter of the cell through the planar microchannel in the microfluidic chip, and the cells can be controlled to move and distribute in a two-dimensional plane to avoid stacking.
[0060] In one embodiment, Figure 5 As shown, a cell counting method is provided, the method comprising: Step 502: Acquire the original cell image of the cell sample to be counted.
[0061] For example, after the cell sample to be counted is fluorescently labeled, the cells in the flow channel of the microfluidic chip are imaged by a fluorescent confocal microscope to obtain the original cell image. The fluorescent confocal microscope can obtain high-resolution images by labeling the sample with fluorescent substances, and can observe the process of biochemical reactions inside the cell without destruction. The fluorescent confocal microscope can be an intelligent microscope with terminal computing and interface display functions, and can also output the original cell image to a terminal or server through an interface.
[0062] Step 504 , preprocessing the original cell image in a noise reduction manner to obtain a preprocessed cell image.
[0063] For example, the computer device uses the cv.GaussianBlur function of the OpenCV library to apply Gaussian blur to the original cell image. The purpose of Gaussian blur is to reduce image noise, enhance image smoothness, and provide a clearer image for subsequent image processing steps. The degree of blur can be determined by the size and standard deviation of the Gaussian kernel.
[0064] Step 506: Perform color space conversion and threshold segmentation on the preprocessed cell image to obtain a binary cell image.
[0065] For example, the computer device uses the cv.cvtColor function of the OpenCV library to convert the preprocessed cell image from the BGR color space to the HSV color space. The HSV color space is more suitable for image segmentation based on color features because it separates color information from brightness information. Next, the computer device determines the range of the hue (H), saturation (S), and brightness (V) of the cells based on the distribution characteristics of the cells in the HSV color space, and determines the HSV value distribution of the cells through experiments or statistical analysis, thereby setting a suitable threshold. The cv.inRange function is then used to segment the cells from the background according to the set HSV threshold to obtain a binary cell image. The cv.inRange function sets the pixels in the image that fall within the threshold range to white and the rest to black, thereby achieving preliminary segmentation of the cells.
[0066] Step 508: Perform morphological operations on the binary cell image by means of corrosion operations to obtain a target cell image.
[0067] For example, the computer device uses the cv2.erode function to perform an erosion operation on the binary cell image. The erosion operation can remove small noise points and reduce the boundaries of the cell object. The cv2.dilate function is then used to perform an expansion operation on the eroded image. The expansion operation can connect adjacent cells and fill small holes inside the cell object.
[0068] Step 510, detecting the cell contour of the cell region in the target cell image, and determining the cell area of the cell region using the contour area of the cell contour.
[0069] For example, the computer device detects contours in a target cell image using the cv2.findContours function, which can return a list of all contours in the image. The computer device analyzes the detected contours and calculates the area of each contour as the cell area of the corresponding cell region.
[0070] Step 512, determining the number of cells in the target cell image based on the cell areas of all cell regions in the target cell image and the single cell reference area of the cell sample at the current microscope magnification.
[0071] Exemplarily, for each cell region in the target cell image, the number of cells corresponding to each cell region is determined based on the cell area of each cell region and the single cell reference area. Combined with the number of cells corresponding to each cell region, the number of cells in the target cell image is obtained.
[0072] For example, the area of each contour (which may be the contour of a single cell or a cell cluster) is divided by the single cell reference area, and the result of the division is rounded to the nearest integer, which is the number of cells in the cell contour (the division result of a single cell is close to 1). The number of cells corresponding to all cell contours is summed to obtain the number of cells in the target cell image.
[0073] In this embodiment, through the image preprocessing function, threshold segmentation function, morphological operation function and contour detection function, it is possible to accurately extract the target cell area from the complex microscope image, providing a reliable basis for subsequent cell counting. The optimized single-cell reference area is directly used to calculate the cell count of each cell area of the target cell image, which can complete the cell counting more accurately and efficiently, especially in the case of processing cell clusters and complex backgrounds, improving the counting efficiency and accuracy.
[0074] In a possible implementation of the embodiment shown in Figure 5, the computer device of the embodiment of the present application can also provide a user-friendly interface and parameter adjustment function, performance evaluation function, so that the cell image analysis process is more efficient and intuitive.
[0075] Exemplarily, the computer device displays a parameter adjustment page, which includes parameter adjustment controls, such as sliders and input boxes, and the computer device responds to the slider drag operation and / or the input box input operation, obtains the adjustment parameter value corresponding to the slider drag operation and / or the input box input operation, and adjusts the above-mentioned cell image processing process based on the adjustment parameter value. For example, the user is allowed to adjust the image processing parameters through the graphical user interface, and the parameters include HSV threshold, Gaussian blur kernel size, number of iterations of morphological operations, etc.
[0076] Exemplarily, during the image processing process, the computer device displays an image processing speed page, which can display the frame rate (FPS) of the software program used by the computer device for real-time calculations. The frame rate is an important indicator for measuring image processing speed.
[0077] In this embodiment, the graphical user interface (GUI) of the computer device can use the PySide6 library to create a graph, and the GUI includes an image display area, a parameter adjustment control, a result display area, etc. The image after preprocessing, segmentation, and morphological operation is displayed in the GUI, and the results of cell counting and analysis are displayed. The GUI provides controls such as sliders and input boxes to allow the user to adjust the image processing parameters, and the parameters entered by the user will be updated in real time to the image processing process.
[0078] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0079] Based on the same inventive concept, the embodiment of the present application also provides a cell counting device for implementing the cell counting method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more cell counting device embodiments provided below can refer to the limitations on the cell counting method above, and will not be repeated here.
[0080] In one embodiment, Figure 6 As shown, a cell counting device is provided, including: an acquisition module 602 and a determination module 604, wherein: The acquisition module 602 is used to acquire the target cell image of the cell sample to be counted.
[0081] The determination module 604 is used to determine the number of cells in the target cell image based on the cell area of the cell region in the target cell image and the single-cell reference area; wherein the single-cell reference area is obtained by training the cell image samples and the target loss function, and the target loss function is used to indicate the difference between the cell area of the cell region in the cell image sample and the integer multiples of the single-cell reference area.
[0082] In one embodiment, the cell counting device also includes a single cell reference area determination module, which is used to obtain cell image samples; based on the target loss function, determine the difference between the cell area of the cell region and the integer multiple of the single cell reference area from the cell image sample; with the goal of reducing the difference, perform parameter optimization on the single cell reference area.
[0083] In one embodiment, when the single-cell reference area determination module determines the difference between the cell area of the cell region and the integer multiples of the single-cell reference area from the cell image sample based on the target loss function, it is configured to: determine the ratio of the cell area of each cell region to the single-cell reference area for each cell region; compare the ratio with the adjacent integers corresponding to the ratio to obtain the comparison results of each cell region; and determine the difference in combination with the comparison results of each cell region.
[0084] In one embodiment, when determining the number of cells in the target cell image based on the cell area of the cell area in the target cell image and the single-cell reference area, the determination module 604 is configured to: for each cell area in the target cell image, based on the cell area of each cell area and the single-cell reference area, determine the number of cells corresponding to each cell area; and obtain the number of cells in the target cell image in combination with the number of cells corresponding to each cell area.
[0085] In one embodiment, the acquisition module 602 is configured to: acquire the original cell image of the cell sample to be counted; preprocess the original cell image by reducing noise to obtain a preprocessed cell image; perform color space conversion and threshold segmentation on the preprocessed cell image to obtain a binary cell image; perform morphological operations on the binary cell image by corrosion operations to obtain the target cell image.
[0086] In one embodiment, the determination module 604 is further configured to detect a cell contour of a cell region in the target cell image; and determine a cell area of the cell region using a contour area of the cell contour.
[0087] Each module in the above-mentioned cell counting device can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0088] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a cell counting method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0089] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0090] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0091] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0092] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0093] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0094] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0095] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0096] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A cell counting method, characterized in that: The method comprises: Acquire a target cell image of a cell sample to be counted; Determining the number of cells in the target cell image based on the cell area of the cell region in the target cell image and the single cell reference area; The single-cell reference area is obtained by training with cell image samples and a target loss function, and the target loss function is used to indicate the difference between the cell area of the cell region in the cell image sample and an integer multiple of the single-cell reference area.
2. The method according to claim 1, characterized in that The single cell reference area is obtained by the following steps: Obtain cell image samples; Based on the target loss function, determining the difference between the cell area of the cell region and the integer multiple of the single cell reference area from the cell image sample; With the goal of reducing the differences, parameters of the single cell reference area were optimized.
3. The method according to claim 2, characterized in that The step of determining the difference between the cell area of each cell region and the integer multiple of the single cell reference area from the cell image sample based on the target loss function comprises: For each of the cell regions, respectively determine the ratio of the cell area of each of the cell regions to the single cell reference area; Comparing the ratio with adjacent integers corresponding to the ratio to obtain comparison results of each of the cell regions; The difference is determined by combining the comparison results of each of the cell regions.
4. The method according to any one of claims 1 to 3, characterized in that: The step of determining the number of cells in the target cell image based on the cell area of the cell region in the target cell image and the single cell reference area comprises: For each cell region in the target cell image, based on the cell area of each cell region and the single cell reference area, determining the number of cells corresponding to each cell region; The number of cells in the target cell image is obtained by combining the number of cells corresponding to each of the cell regions.
5. The method according to claim 1, characterized in that The step of obtaining a target cell image of a cell sample to be counted comprises: Acquiring an original cell image of the cell sample to be counted; Preprocessing the original cell image in a noise-reducing manner to obtain a preprocessed cell image; Performing color space conversion and threshold segmentation on the preprocessed cell image to obtain a binary cell image; A morphological operation is performed on the binary cell image by using a corrosion operation to obtain the target cell image.
6. The method according to claim 5, characterized in that After obtaining the target cell image of the cell sample to be counted, the method further comprises: Detecting the cell contour of the cell region in the target cell image; The cell area of the cell region is determined using the contour area of the cell contour.
7. A cell counting device, characterized in that: The device comprises: An acquisition module, used for acquiring a target cell image of a cell sample to be counted; A determination module, used to determine the number of cells in the target cell image based on the cell area of the cell region in the target cell image and the single cell reference area; The single-cell reference area is obtained by training with cell image samples and a target loss function, and the target loss function is used to indicate the difference between the cell area of the cell region in the cell image sample and an integer multiple of the single-cell reference area.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Cell counting method based on template matching and lookup contour
CN110132823A
Cell identification counting method and device based on image identification and computer equipment
CN111524137A
Medical image processing method and device, computer equipment and storage medium
CN112419295A
Method and device for determining cell density of sample
CN117218139A
Enumeration Method of Analyte Detection
US20070298513A1