Cell density clustering method, device, electronic device and storage medium
By using density grouping model and twin network model to calculate image error values in image processing, the cell density range is quickly determined, and the time consumption problem caused by the complexity of cell image density grouping calculation is solved, and efficient density grouping is achieved.
Patent Information
- Application Number
- CN202110241585.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-04
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2041-03-04
AI Technical Summary
In image processing, the calculation process of cell image density clustering is complicated, resulting in large time consumption and it is difficult to achieve rapid classification.
By inputting the image to be detected to the autoencoder of the preset number of density grouping models, combining the twin network model, the error value between the image and the reconstructed image is calculated, and the density range corresponding to the minimum error value is determined as the density range of the image.
The rapid classification of the cell density range is achieved, the efficiency of cell image density clustering is improved, and the cell images with the same density range can be accurately divided.
Smart Images

Figure CN115035017B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular to a cell density clustering method, device, electronic device and storage medium. Background Art
[0002] When performing image processing, cell image density clustering requires calculating the number and volume of cells in the image, and then calculating the proportion of cells in the image. Since the calculation process of cell image density clustering is relatively complicated, it usually takes a lot of time. Summary of the invention
[0003] In view of the above, it is necessary to propose a cell density clustering method, device, electronic device and storage medium to achieve rapid classification of cell density ranges.
[0004] The first aspect of the present application provides a cell density clustering method, the method comprising:
[0005] Input the image to be detected into the autoencoders of a preset number of density clustering models to obtain a preset number of reconstructed images to be detected, each of the density clustering models is composed of the autoencoder and the twin network model, each of the density clustering models corresponds to a density range, and each reconstructed image to be detected corresponds to a density clustering model;
[0006] Input the image to be detected and each of the reconstructed images to be detected into a twin network model of a density clustering model corresponding to each of the reconstructed images to be detected, and calculate a first error value between the image to be detected and each of the reconstructed images to be detected, wherein all the first error values form a first error value set, and each first error value corresponds to a density clustering model;
[0007] The minimum first error value in the first error value set is determined, and the density range corresponding to the density clustering model corresponding to the minimum first error value is used as the density range of the image to be detected.
[0008] Optionally, the method further includes: training the density clustering model, including:
[0009] Dividing the cell image set according to the density range to obtain a preset number of cell training image sets, each cell training image set corresponding to a density range;
[0010] Performing a training operation on each cell training image set to obtain a preset number of density clustering models, each of which corresponds to a density range, the training operation includes:
[0011] Convert the cell training images in the cell training image set into cell training image vectors, and form a cell training image vector set from all the cell training image vectors;
[0012] Using the cell training image vector set to train the autoencoder to obtain a trained autoencoder;
[0013] Inputting the cell training image vector set into the trained autoencoder of the density clustering model to obtain a cell reconstruction image vector set, wherein the cell reconstruction image vector set includes a cell reconstruction image vector;
[0014] The twin network model is trained using the cell training image vector set and the cell reconstruction image vector set to obtain a trained twin network model. The trained autoencoder and the trained twin network model constitute the density clustering model.
[0015] Optionally, the step of training an autoencoder using the cell training image vector set to obtain a trained autoencoder comprises:
[0016] Inputting the cell training image vector in the cell training image vector set into the encoding layer of the autoencoder to obtain a latent vector of the cell training image vector;
[0017] Inputting the latent vector into the decoding layer of the autoencoder to obtain a reconstructed image vector of the cell training image vector;
[0018] A preset error function is used to calculate a second error value between the cell training image vector and the reconstructed image vector, and the parameters of the encoding layer and the decoding layer are adjusted to minimize the error value to obtain an autoencoder of the density clustering model.
[0019] Optionally, the twin network model includes a first neural network and a second neural network, and the twin network model is trained using the cell training image vector set and the cell reconstruction image vector set to obtain a trained twin network model including:
[0020] Inputting the cell training image vector in the cell training image vector set into the first neural network to obtain a first feature map;
[0021] Inputting the cell reconstruction image vector in the cell reconstruction image vector set into the second neural network to obtain a second feature map;
[0022] Calculate a third error value between the first feature map and the second feature map, and optimize the first neural network and the second neural network according to the third error value to obtain the trained twin network model.
[0023] Optionally, the weight of the first neural network is the same as the weight of the second neural network, and the structure of the first neural network is the same as the structure of the second neural network.
[0024] Optionally, inputting the cell training image vector in the cell training image vector set into the first neural network to obtain a first feature map comprises:
[0025] Inputting the cell training image vector into the first neural network;
[0026] The cell training image vector and the matrix in the first neural network are calculated to obtain features of the cell training image vector to form the first feature map.
[0027] Optionally, calculating a third error value between the first feature map and the second feature map includes:
[0028] A mean absolute error function is used to calculate a mean absolute error between the first feature map and the second feature map, and the mean absolute error is used as a third error value between the first feature map and the second feature map.
[0029] The second application of the present application provides a cell density clustering device, the device comprising:
[0030] An image reconstruction module, used for inputting the image to be detected into the autoencoder of a preset number of density clustering models to obtain a preset number of reconstructed images to be detected, each of the density clustering models is composed of the autoencoder and the twin network model, each of the density clustering models corresponds to a density range, and each reconstructed image to be detected corresponds to a density clustering model;
[0031] an error value calculation module, used for inputting the image to be detected and each of the reconstructed images to be detected into a twin network model of a density clustering model corresponding to each of the reconstructed images to be detected, and calculating a first error value between the image to be detected and each of the reconstructed images to be detected, wherein all the first error values constitute a first error value set, and each first error value corresponds to a density clustering model;
[0032] The density range determination module is used to determine the minimum first error value in the first error value set, and use the density range corresponding to the density clustering model corresponding to the minimum first error value as the density range of the image to be detected.
[0033] The third application of the present application provides an electronic device, the electronic device comprising:
[0034] a memory storing at least one instruction; and
[0035] A processor executes the instructions stored in the memory to implement the cell density clustering method.
[0036] The fourth application of the present application provides a computer storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the cell density clustering method is implemented.
[0037] The present application can train an autoencoder to reconstruct images using cell images of different density ranges and train a twin network model to distinguish the range of cell density, thereby achieving accurate division of cell images with the same density range and improving the efficiency of cell image density clustering. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 The present invention is a flowchart of a cell density clustering method according to one embodiment of the present application.
[0039] Figure 2 This is a structural diagram of a cell density clustering device in one embodiment of the present application.
[0040] Figure 3 Schematic diagram of an electronic device for implementing a cell density clustering method in one embodiment of the present application.
[0041] Main component symbols
[0042] Cell density clustering device 30 Image reconstruction module 301 Error value calculation module 302 Density range determination module 303 Electronic devices 6 Memory 61 processor 62 Computer Programs 63 DETAILED DESCRIPTION
[0043] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the present application is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0044] In the following description, many specific details are set forth to facilitate a full understanding of the present application. The embodiments described are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0046] Preferably, the cell density clustering method of the present application is applied in one or more electronic devices. The electronic device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), digital signal processors (DSP), embedded devices, etc.
[0047] The electronic device may be a computing device such as a desktop computer, a laptop computer, a tablet computer, a cloud server, etc. The electronic device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0048] Example 1
[0049] Figure 1 1 is a flow chart of a cell density clustering method in one embodiment of the present application. The cell density clustering method is applied to electronic devices. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted.
[0050] See also Figure 1 As shown, the cell density clustering method specifically comprises the following steps:
[0051] Step S11, input the image to be detected into the autoencoder of a preset number of density clustering models to obtain a preset number of reconstructed images to be detected, each of the density clustering models is composed of the autoencoder and the twin network model, each of the density clustering models corresponds to a density range, and each reconstructed image to be detected corresponds to a density clustering model.
[0052] For example, the preset number can be 4, and the 4 density clustering models correspond to 4 density ranges (0, 40%), (40%, 60%), (60%, 80%), and (80%, 100%) respectively. The image to be detected is input into the autoencoder of the 4 density clustering models to obtain 4 reconstructed images to be detected, namely, reconstructed image A to be detected, reconstructed image B to be detected, reconstructed image C to be detected, and reconstructed image D to be detected.
[0053] Step S12, input the image to be detected and each of the reconstructed images to be detected into the twin network model of the density clustering model corresponding to each of the reconstructed images to be detected, and calculate the first error value between the image to be detected and each of the reconstructed images to be detected, and the first error value set is composed of all the first error values, and each first error value corresponds to a density clustering model.
[0054] For example, the twin network model of the density clustering model corresponding to the density range (0, 40%) of the image to be detected and the reconstructed image A to be detected, the twin network model of the density clustering model corresponding to the density range (40%, 60%) of the image to be detected and the reconstructed image B to be detected, the twin network model of the density clustering model corresponding to the density range (60%, 80%) of the image to be detected and the reconstructed image C to be detected, the twin network model of the density clustering model corresponding to the density range (80%, 100%) of the image to be detected and the reconstructed image D to be detected are input, and the first error value between the image to be detected and each of the reconstructed images to be detected is calculated, and a first error value set is composed of all first error values, and each first error value corresponds to a density clustering model.
[0055] Step S13, determining the minimum first error value in the first error value set, and taking the density range corresponding to the density clustering model corresponding to the minimum first error value as the density range of the image to be detected.
[0056] For example, when the minimum first error value in the first error value set is 10%, the density range (60%, 80%) corresponding to the density clustering model corresponding to the minimum first error value is used as the density range of the image to be detected.
[0057] In at least one embodiment of the present application, the method further includes: training the density clustering model, including:
[0058] Dividing the cell image set according to the density range to obtain a preset number of cell training image sets, each cell training image set corresponding to a density range;
[0059] Performing a training operation on each cell training image set to obtain a preset number of density clustering models, each of which corresponds to a density range, the training operation includes:
[0060] Convert the cell training images in the cell training image set into cell training image vectors, and form a cell training image vector set from all the cell training image vectors;
[0061] Using the cell training image vector set to train the autoencoder to obtain a trained autoencoder;
[0062] Inputting the cell training image vector set into the trained autoencoder of the density clustering model to obtain a cell reconstruction image vector set, wherein the cell reconstruction image vector set includes a cell reconstruction image vector;
[0063] The twin network model is trained using the cell training image vector set and the cell reconstruction image vector set to obtain a trained twin network model. The trained autoencoder and the trained twin network model constitute the density clustering model.
[0064] For example, the cell image set is divided into four density ranges (0, 40%), (40%, 60%), (60%, 80%), and (80%, 100%) to obtain four cell training image sets. A training operation is performed on each cell training image set to obtain four density clustering models, and each density clustering model corresponds to a density range.
[0065] In at least one embodiment of the present application, the step of training the autoencoder using the cell training image vector set to obtain the trained autoencoder comprises:
[0066] Inputting the cell training image vector in the cell training image vector set into the encoding layer of the autoencoder to obtain a latent vector of the cell training image vector;
[0067] Inputting the latent vector into the decoding layer of the autoencoder to obtain a reconstructed image vector of the cell training image vector;
[0068] A preset error function is used to calculate a second error value between the cell training image vector and the reconstructed image vector, and the parameters of the encoding layer and the decoding layer are adjusted to minimize the error value to obtain an autoencoder of the density clustering model.
[0069] In at least one embodiment of the present application, when the preset error function is a minimum absolute value error function, the minimum absolute value function error is used to calculate the second error value between the cell training image vector and the reconstructed image vector, and the calculation formula is: Wherein, MAE is the minimum absolute value function, y i is the i-th vector of the cell training image vector, is the i-th vector of the reconstructed image vector, and n is the vector dimension of the cell training image vector and the reconstructed image vector.
[0070] In at least one embodiment of the present application, when the preset error function is a mean square error function, the mean square error function error is used to calculate the second error value between the cell training image vector and the reconstructed image vector, and the calculation formula is: Where RSE is the mean square error function, y i is the i-th vector of the cell training image vector, is the i-th vector of the reconstructed image vector, and n is the vector dimension of the cell training image vector and the reconstructed image vector.
[0071] In at least one embodiment of the present application, the twin network model includes a first neural network and a second neural network, and the twin network model is trained using the cell training image vector set and the cell reconstruction image vector set to obtain a trained twin network model including:
[0072] Inputting the cell training image vector in the cell training image vector set into the first neural network to obtain a first feature map;
[0073] Inputting the cell reconstruction image vector in the cell reconstruction image vector set into the second neural network to obtain a second feature map;
[0074] Calculate a third error value between the first feature map and the second feature map, and optimize the first neural network and the second neural network according to the third error value to obtain the trained twin network model.
[0075] In at least one embodiment of the present application, the weight of the first neural network is the same as the weight of the second neural network, and the structure of the first neural network is the same as the structure of the second neural network.
[0076] In at least one embodiment of the present application, inputting the cell training image vector in the cell training image vector set into the first neural network to obtain the first feature map comprises:
[0077] Inputting the cell training image vector into the first neural network;
[0078] The cell training image vector and the matrix in the first neural network are calculated to obtain features of the cell training image vector to form the first feature map.
[0079] In at least one embodiment of the present application, calculating a third error value between the first feature map and the second feature map includes:
[0080] A mean absolute error function is used to calculate a mean absolute error between the first feature map and the second feature map, and the mean absolute error is used as a third error value between the first feature map and the second feature map.
[0081] In other embodiments of the present application, calculating a third error value between the first feature map and the second feature map includes:
[0082] A mean square error function is used to calculate a mean square error between the first feature map and the second feature map, and the mean square error value is used as a third error value between the first feature map and the second feature map.
[0083] The present application can train an autoencoder to reconstruct images using cell images of different density ranges and train a twin network model to distinguish the range of cell density, thereby achieving accurate division of cell images with the same density range and improving the efficiency of cell image density clustering.
[0084] Example 2
[0085] Figure 2 1 is a structural diagram of a cell density clustering device 30 in one embodiment of the present application.
[0086] In some embodiments, the cell density clustering device 30 is operated in an electronic device. The cell density clustering device 30 may include a plurality of functional modules composed of program code segments. The program code of each program segment in the cell density clustering device 30 may be stored in a memory and executed by at least one processor.
[0087] In this embodiment, the cell density clustering device 30 can be divided into a plurality of functional modules according to the functions it performs. Figure 3 As shown, the cell density clustering device 30 may include an image reconstruction module 301, an error value calculation module 302, and a density range determination module 303. The module referred to in this application refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory. In some embodiments, the functions of each module will be described in detail in subsequent embodiments.
[0088] The image reconstruction module 301 inputs the image to be detected into the autoencoder of a preset number of density clustering models to obtain a preset number of reconstructed images to be detected, each of the density clustering models is composed of the autoencoder and the twin network model, each of the density clustering models corresponds to a density range, and each reconstructed image to be detected corresponds to a density clustering model.
[0089] The error value calculation module 302 inputs the image to be detected and each of the reconstructed images to be detected into the twin network model of the density clustering model corresponding to each of the reconstructed images to be detected, and calculates the first error value between the image to be detected and each of the reconstructed images to be detected. A first error value set is composed of all the first error values, and each first error value corresponds to a density clustering model.
[0090] The density range determination module 303 determines the minimum first error value in the first error value set, and uses the density range corresponding to the density clustering model corresponding to the minimum first error value as the density range of the image to be detected.
[0091] In at least one embodiment of the present application, the device also includes a density clustering model training module.
[0092] The density clustering model training module is used to train the density clustering model, including:
[0093] Dividing the cell image set according to the density range to obtain a preset number of cell training image sets, each cell training image set corresponding to a density range;
[0094] Performing a training operation on each cell training image set to obtain a preset number of density clustering models, each of which corresponds to a density range, the training operation includes:
[0095] Convert the cell training images in the cell training image set into cell training image vectors, and form a cell training image vector set from all the cell training image vectors;
[0096] Using the cell training image vector set to train the autoencoder to obtain a trained autoencoder;
[0097] Inputting the cell training image vector set into the trained autoencoder of the density clustering model to obtain a cell reconstruction image vector set, wherein the cell reconstruction image vector set includes a cell reconstruction image vector;
[0098] The twin network model is trained using the cell training image vector set and the cell reconstruction image vector set to obtain a trained twin network model. The trained autoencoder and the trained twin network model constitute the density clustering model.
[0099] In at least one embodiment of the present application, the density clustering model training module uses the cell training image vector set to train the autoencoder, and the trained autoencoder includes:
[0100] Inputting the cell training image vector in the cell training image vector set into the encoding layer of the autoencoder to obtain a latent vector of the cell training image vector;
[0101] Inputting the latent vector into the decoding layer of the autoencoder to obtain a reconstructed image vector of the cell training image vector;
[0102] A preset error function is used to calculate a second error value between the cell training image vector and the reconstructed image vector, and the parameters of the encoding layer and the decoding layer are adjusted to minimize the error value to obtain an autoencoder of the density clustering model.
[0103] In at least one embodiment of the present application, when the preset error function is a minimum absolute value error function, the minimum absolute value function error is used to calculate the second error value between the cell training image vector and the reconstructed image vector, and the calculation formula is: Wherein, MAE is the minimum absolute value function, y i is the i-th vector of the cell training image vector, is the i-th vector of the reconstructed image vector, and n is the vector dimension of the cell training image vector and the reconstructed image vector.
[0104] In at least one embodiment of the present application, when the preset error function is a mean square error function, the mean square error function error is used to calculate the second error value between the cell training image vector and the reconstructed image vector, and the calculation formula is: Where RSE is the mean square error function, y i is the i-th vector of the cell training image vector, is the i-th vector of the reconstructed image vector, and n is the vector dimension of the cell training image vector and the reconstructed image vector.
[0105] In at least one embodiment of the present application, the twin network model includes a first neural network and a second neural network.
[0106] In at least one embodiment of the present application, the density clustering model training module uses the cell training image vector set and the cell reconstruction image vector set to train the twin network model, and the trained twin network model includes:
[0107] Inputting the cell training image vector in the cell training image vector set into the first neural network to obtain a first feature map;
[0108] Inputting the cell reconstruction image vector in the cell reconstruction image vector set into the second neural network to obtain a second feature map;
[0109] Calculate a third error value between the first feature map and the second feature map, and optimize the first neural network and the second neural network according to the third error value to obtain the trained twin network model.
[0110] In at least one embodiment of the present application, the weight of the first neural network is the same as the weight of the second neural network, and the structure of the first neural network is the same as the structure of the second neural network.
[0111] In at least one embodiment of the present application, the density clustering model training module inputs the cell training image vector in the cell training image vector set into the first neural network to obtain the first feature map, including:
[0112] Inputting the cell training image vector into the first neural network;
[0113] The cell training image vector and the matrix in the first neural network are calculated to obtain features of the cell training image vector to form the first feature map.
[0114] In at least one embodiment of the present application, the density clustering model training module calculates the third error value between the first feature map and the second feature map, including:
[0115] A mean absolute error function is used to calculate a mean absolute error between the first feature map and the second feature map, and the mean absolute error is used as a third error value between the first feature map and the second feature map.
[0116] In other embodiments of the present application, calculating a third error value between the first feature map and the second feature map includes:
[0117] A mean square error function is used to calculate a mean square error between the first feature map and the second feature map, and the mean square error value is used as a third error value between the first feature map and the second feature map.
[0118] The present application can train an autoencoder to reconstruct images using cell images of different density ranges and train a twin network model to distinguish the range of cell density, thereby achieving accurate division of cell images with the same density range and improving the efficiency of cell image density clustering.
[0119] Example 3
[0120] Figure 3 Schematic diagram of an electronic device 6 in one embodiment of the present application.
[0121] The electronic device 6 includes a memory 61, a processor 62, and a computer program 63 stored in the memory 61 and executable on the processor 62. When the processor 62 executes the computer program 63, the steps in the above-mentioned cell density clustering method embodiment are implemented, for example Figure 1 Alternatively, when the processor 62 executes the computer program 63, the functions of each module / unit in the above-mentioned cell density clustering device embodiment are realized, for example Figure 2 Modules 301 to 303 in.
[0122] Exemplarily, the computer program 63 may be divided into one or more modules / units, which are stored in the memory 61 and executed by the processor 62 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 63 in the electronic device 6. For example, the computer program 63 may be divided into Figure 3 The image reconstruction module 301, the error value calculation module 302 and the density range determination module 303 in the embodiment, the specific functions of each module refer to Example 2.
[0123] In this embodiment, the electronic device 6 may be a computing device such as a desktop computer, a notebook, a PDA, a cloud terminal device, etc. Those skilled in the art will appreciate that the schematic diagram is merely an example of the electronic device 6 and does not constitute a limitation on the electronic device 6. The electronic device 6 may include more or fewer components than shown in the diagram, or may combine certain components, or different components. For example, the electronic device 6 may also include input and output devices, network access devices, buses, etc.
[0124] The processor 62 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor 62 may be any conventional processor, etc. The processor 62 is the control center of the electronic device 6, and uses various interfaces and lines to connect various parts of the entire electronic device 6.
[0125] The memory 61 can be used to store the computer program 63 and / or modules / units. The processor 62 implements various functions of the electronic device 6 by running or executing the computer program and / or modules / units stored in the memory 61 and calling the data stored in the memory 61. The memory 61 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device 6 (such as audio data, a phone book, etc.), etc. In addition, the memory 61 can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0126] If the module / unit integrated in the electronic device 6 is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc.
[0127] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0128] In addition, each functional module in each embodiment of the present application can be integrated into the same processing module, or each module can exist physically separately, or two or more modules can be integrated into the same module. The above integrated modules can be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0129] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the spirit or basic features of the present application. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present application is defined by the attached claims rather than the above description, so it is intended to include all changes that fall within the meaning and scope of the equivalent elements of the claims in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other modules or steps, and the singular does not exclude the plural. Multiple modules or electronic devices stated in the electronic device claim can also be implemented by the same module or electronic device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.
Claims
1. A cell density clustering method, characterized in that: The method comprises: Input the image to be detected into the autoencoders of a preset number of density clustering models to obtain a preset number of reconstructed images to be detected, each of the density clustering models is composed of the autoencoder and the twin network model, each of the density clustering models corresponds to a density range, and each reconstructed image to be detected corresponds to a density clustering model; Input the image to be detected and each of the reconstructed images to be detected into a twin network model of a density clustering model corresponding to each of the reconstructed images to be detected, and calculate a first error value between the image to be detected and each of the reconstructed images to be detected, wherein all the first error values form a first error value set, and each first error value corresponds to a density clustering model; The minimum first error value in the first error value set is determined, and the density range corresponding to the density clustering model corresponding to the minimum first error value is used as the density range of the image to be detected.
2. The cell density clustering method according to claim 1, characterized in that: The method further includes: training the density clustering model, including: Dividing the cell image set according to the density range to obtain a preset number of cell training image sets, each cell training image set corresponding to a density range; Performing a training operation on each cell training image set to obtain a preset number of density clustering models, each of which corresponds to a density range, the training operation includes: Convert the cell training images in the cell training image set into cell training image vectors, and form a cell training image vector set from all the cell training image vectors; Using the cell training image vector set to train the autoencoder to obtain a trained autoencoder; Inputting the cell training image vector set into the trained autoencoder of the density clustering model to obtain a cell reconstruction image vector set, wherein the cell reconstruction image vector set includes a cell reconstruction image vector; The twin network model is trained using the cell training image vector set and the cell reconstruction image vector set to obtain a trained twin network model. The trained autoencoder and the trained twin network model constitute the density clustering model.
3. The cell density clustering method according to claim 2, characterized in that: The step of training the autoencoder using the cell training image vector set to obtain the trained autoencoder comprises: Inputting the cell training image vector in the cell training image vector set into the encoding layer of the autoencoder to obtain a latent vector of the cell training image vector; Inputting the latent vector into the decoding layer of the autoencoder to obtain a reconstructed image vector of the cell training image vector; A preset error function is used to calculate a second error value between the cell training image vector and the reconstructed image vector, and the parameters of the encoding layer and the decoding layer are adjusted to minimize the error value to obtain an autoencoder of the density clustering model.
4. The cell density clustering method according to claim 2, characterized in that: The twin network model includes a first neural network and a second neural network. The twin network model is trained using the cell training image vector set and the cell reconstruction image vector set to obtain a trained twin network model including: Inputting the cell training image vector in the cell training image vector set into the first neural network to obtain a first feature map; Inputting the cell reconstruction image vector in the cell reconstruction image vector set into the second neural network to obtain a second feature map; Calculate a third error value between the first feature map and the second feature map, and optimize the first neural network and the second neural network according to the third error value to obtain the trained twin network model.
5. The cell density clustering method according to claim 4, characterized in that: The weight of the first neural network is the same as the weight of the second neural network, and the structure of the first neural network is the same as the structure of the second neural network.
6. The cell density clustering method according to claim 4, characterized in that: Inputting the cell training image vector in the cell training image vector set into the first neural network to obtain a first feature map comprises: Inputting the cell training image vector into the first neural network; The cell training image vector and the matrix in the first neural network are calculated to obtain features of the cell training image vector to form the first feature map.
7. The cell density clustering method according to claim 4, characterized in that: The calculating a third error value between the first characteristic graph and the second characteristic graph comprises: A mean absolute error function is used to calculate a mean absolute error between the first feature map and the second feature map, and the mean absolute error is used as a third error value between the first feature map and the second feature map.
8. A cell density clustering device, characterized in that: include: An image reconstruction module, used for inputting the image to be detected into the autoencoder of a preset number of density clustering models to obtain a preset number of reconstructed images to be detected, each of the density clustering models is composed of the autoencoder and the twin network model, each of the density clustering models corresponds to a density range, and each reconstructed image to be detected corresponds to a density clustering model; an error value calculation module, used for inputting the image to be detected and each of the reconstructed images to be detected into a twin network model of a density clustering model corresponding to each of the reconstructed images to be detected, and calculating a first error value between the image to be detected and each of the reconstructed images to be detected, wherein all the first error values constitute a first error value set, and each first error value corresponds to a density clustering model; The density range determination module is used to determine the minimum first error value in the first error value set, and use the density range corresponding to the density clustering model corresponding to the minimum first error value as the density range of the image to be detected.
9. An electronic device, characterized in that: The electronic device comprises: a memory storing at least one instruction; and A processor executes the instructions stored in the memory to implement the cell density clustering method according to any one of claims 1 to 7.
10. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the cell density clustering method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method for grouping cells according to density and electronic device employing method
US20220284720A1