Training method of autoencoder, cell quantity detection method and related equipment

By using an autoencoder training method and optimizing feature vectors and latent features, the problem of low efficiency in cell number detection in medical images is solved, and fast and accurate cell number detection is achieved.

CN115471438BActive Publication Date: 2026-03-20FU TAI HUA IND SHENZHEN +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-24
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Existing technologies are inefficient in detecting cell counts in medical images and require a large number of sample images to train the target detection model.

Method used

An autoencoder training method is adopted, which extracts feature vectors and latent features from sample medical images and optimizes the autoencoder using a loss function, thereby reducing the number of sample images and improving detection efficiency.

Benefits of technology

By training with a small number of sample images, the autoencoder can quickly and accurately detect the number of cells in medical images, thus improving detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115471438B_ABST
    Figure CN115471438B_ABST
Patent Text Reader

Abstract

The application provides a self-encoder training method, a cell quantity detection method and related equipment. The self-encoder training method comprises the following steps: extracting a first feature vector in a sample medical image and inputting the first feature vector into the self-encoder to obtain a first latent feature; obtaining a first prediction value of the cell quantity based on the first latent feature; inputting the first latent feature into the self-encoder to obtain a reconstructed image; and optimizing the self-encoder based on the reconstructed image. The cell quantity detection method comprises the following steps: extracting a second feature vector of a medical image to be detected; inputting the second feature vector into the self-encoder to obtain a second latent feature; and obtaining the cell quantity based on the second latent feature. The image detection result can be quickly obtained through the application.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image detection, and in particular to a training method of autoencoder, a cell quantity detection method and related equipment. BACKGROUND

[0002] At present, the detection of cell quantity in medical images mostly adopts a supervised learning method. For example, a Single Shot MultiBox Detector (SSD) target detection model is used for detection. When the medical image is detected by the target detection model, complex and diverse feature information needs to be extracted. Therefore, a large number of sample images need to be used in the training of the target detection model, resulting in low efficiency. SUMMARY

[0003] In view of the above, it is necessary to provide a training method of autoencoder, a cell quantity detection method and related equipment. By using the trained autoencoder to detect the cell quantity in the medical image, the detection efficiency can be improved.

[0004] The present application provides a training method of autoencoder, which comprises: acquiring a plurality of sample medical images; extracting a first feature vector in each sample medical image; inputting the first feature vector into the autoencoder and extracting a first latent feature of each sample medical image according to the first feature vector; obtaining a first predicted value of the cell quantity in each sample medical image based on the first latent feature; inputting the first latent feature into the autoencoder and reconstructing each sample medical image according to the first latent feature to obtain a plurality of reconstructed images; and optimizing the autoencoder based on the plurality of reconstructed images.

[0005] In a possible implementation, each sample medical image comprises a cell quantity label value.

[0006] In a possible implementation, obtaining the first predicted value of the cell quantity in the sample medical image based on the first latent feature comprises: extracting a plurality of first cell feature encodings in the first latent feature; and determining the first predicted value of the cell quantity in the sample medical image according to the plurality of first cell feature encodings.

[0007] In a possible implementation, optimizing the autoencoder based on the plurality of reconstructed images comprises: establishing a first loss function according to the plurality of sample medical images and the plurality of reconstructed images; establishing a second loss function according to the label value and the first predicted value; and optimizing the autoencoder based on the first loss function and the second loss function.

[0008] In a possible implementation, the establishing the first loss function according to the sample medical images and the reconstructed images comprises: calculating errors between each sample medical image and each reconstructed image to obtain a plurality of first errors; obtaining a first average error based on the plurality of first errors, and setting the first average error as the first loss function.

[0009] In a possible implementation, the establishing the second loss function according to the label values and the first prediction values comprises: calculating errors between the label value of each sample medical image and the first prediction value to obtain a plurality of second errors; obtaining a second average error based on the plurality of second errors, and setting the second average error as the second loss function.

[0010] In a possible implementation, the optimizing the autoencoder based on the first loss function and the second loss function comprises: obtaining a third loss function based on the first loss function and the second loss function, wherein the third loss function is obtained by the following formula: L3(a, X) = m1L1(X) + m2L2(a), L1(X) is the first loss function, L2(a) is the second loss function, L3(a, X) is the third loss function, m1 is a weight of the first loss function, and m2 is a weight of the second loss function; adjusting parameters of the autoencoder, and calculating a function value of the third loss function according to the adjusted autoencoder; and if the function value reaches a minimum, obtaining an optimized autoencoder.

[0011] The application further provides a method for detecting cell quantity by using the autoencoder trained by the training method of the autoencoder, the method comprising: obtaining a to-be-detected medical image; extracting a second feature vector of the to-be-detected medical image; inputting the second feature vector into the autoencoder and extracting a second latent feature of the to-be-detected medical image according to the second feature vector; obtaining a second prediction value of cell quantity in the to-be-detected medical image based on the second latent feature; and taking the second prediction value as the cell quantity of the to-be-detected medical image.

[0012] The application further provides an electronic device, which comprises a processor and a memory, and the processor is configured to execute a computer program stored in the memory to implement the training method of the autoencoder or the cell quantity detection method.

[0013] The application further provides a computer readable storage medium, which stores at least one instruction, and the at least one instruction is executed by a processor to implement the training method of the autoencoder or the cell quantity detection method.

[0014] The training method of the autoencoder, the cell quantity detection method, the electronic device and the storage medium disclosed by the present application can obtain an optimized autoencoder through a small amount of sample images, and can quickly count the cell quantity in a medical image to be detected through the optimized autoencoder, thereby improving the detection efficiency of cells. BRIEF DESCRIPTION OF DRAWINGS

[0015] Figure 1 is a structural schematic diagram of an electronic device provided by a preferred embodiment of the present application.

[0016] Figure 2 is a flowchart of a preferred embodiment of the training method of an autoencoder disclosed by the present application.

[0017] Figure 3 is a flowchart of a preferred embodiment of the cell quantity detection method disclosed by the present application.

[0018] Figure 4 is a functional module diagram of a preferred embodiment of the training system of an autoencoder disclosed by the present application. DETAILED DESCRIPTION

[0019] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be described in detail below with reference to the drawings and specific embodiments.

[0020] Please refer to Figure 1 , Figure 1 is a schematic diagram of an electronic device according to an embodiment of the present application. As shown in Figure 1 , the training system 10 of the autoencoder runs in the electronic device 1. The electronic device 1 includes, but is not limited to, a memory 11, at least one processor 12, the training system 10 of the autoencoder stored in the memory 11 and executable on the at least one processor 12, and at least one communication bus 13.

[0021] The at least one processor 12 implements the steps in the embodiments of the training method of the autoencoder and the cell quantity detection method described below when executing the training system 10 of the autoencoder.

[0022] For example, the training system 10 of the autoencoder can be divided into one or more modules / units, which are stored in the memory 11 and executed by the at least one processor 12 to complete the present application. The one or more modules / units can be a series of computer-readable instruction segments capable of completing a specific function, which are used to describe the execution process of the training system 10 of the autoencoder in the electronic device 1.

[0023] The electronic device 1 can be a computer, a mobile phone, a tablet computer, a personal digital assistant (PDA), and the like, which is installed with an application program. Those skilled in the art can understand that the schematic Figure 1 The electronic device 1 is only an example and does not constitute a limitation on the electronic device 1, and can include more or fewer components than the diagram, or combine certain components, or different components, for example, the electronic device 1 can also include an input / output device, a network access device, a bus, and the like.

[0024] As Figure 2 shown is a flowchart of a preferred embodiment of the training method of the autoencoder of the present application. The order of the steps in the flowchart can be changed according to different needs, and some steps can be omitted. In the present embodiment, the training method of the autoencoder comprises:

[0025] S101, obtaining a plurality of sample medical images.

[0026] In the present embodiment, the autoencoder needs to be trained by a plurality of sample medical images first, and then the trained autoencoder is used to identify the number of cells in the to-be-detected medical image. The sample medical images can be high-resolution digital images obtained by scanning and collecting through a fully automatic microscope or an optical magnification system. The sample medical images include cells and some impurities.

[0027] In the present embodiment, the sample medical images have a cell number label value. The label value represents the accurate value of the number of cells carried in the sample medical images. The present application trains and optimizes the autoencoder through the sample medical images, so that the predicted value of the number of cells output by the optimized autoencoder is more and more close to the label value. When the optimized autoencoder is used to identify the to-be-detected image, the accurate value of the number of cells in the to-be-detected image can be obtained.

[0028] In the present embodiment, it is assumed that the number of obtained sample medical images is N.

[0029] S102, extracting a first feature vector in each sample medical image.

[0030] In the present embodiment, the vectorization processing is performed on each sample medical image to obtain the first feature vector of each sample medical image. The first feature vectors are X1, X2, …, X i ,…,X N By extracting the first feature vector of the sample medical image, the autoencoder can be directly used to process the first feature vector.

[0031] S103, input the first feature vector to the autoencoder and extract the first latent feature of each sample medical image according to the first feature vector.

[0032] An autoencoder is an unsupervised neural network that tries to reproduce the input signal as much as possible. In order to achieve this reproduction, the autoencoder must extract the most important features that can represent the input data, somewhat similar to principal component analysis, which finds the main components that can represent the original information.

[0033] In this embodiment, in order to obtain the predicted value of the number of cells in each sample medical image, the main features of each sample medical image need to be extracted by the autoencoder, wherein the main features are the cell features in the sample medical image.

[0034] In this embodiment, the autoencoder includes an encoding layer and a decoding layer. The encoding layer is used to extract features of the first feature vector input to the autoencoder, convert the high-dimensional feature vector into a low-dimensional feature vector, and generate a plurality of feature encodings. Each feature encoding corresponds to a cell in the sample medical image. The plurality of feature encodings are determined as the first latent feature. The decoding layer is used to decode and reconstruct the first latent feature output by the encoding layer, and output a reconstructed image.

[0035] In this embodiment, the first feature vector X i (i=1, 2, …, N) is input to the encoding layer of the autoencoder, and the encoding layer extracts features of the first feature vector X i (i=1, 2, …, N) to obtain the first latent feature h i (i=1, 2, …, N). The first latent feature includes a plurality of feature encodings.

[0036] The representative feature information of the sample medical image is extracted by the encoding layer of the autoencoder, which not only extracts the cell features in the sample medical image, but also excludes other redundant information and reduces the amount of sample images used.

[0037] S104, based on the first latent feature, obtaining a first predicted value of the number of cells in each sample medical image.

[0038] In this embodiment, the first predicted value of the number of cells in each sample medical image based on the first latent feature includes:

[0039] Extracting a plurality of first cell feature encodings in the first latent feature, wherein each first cell encoding represents a cell in the sample medical image;

[0040] A first predicted value of the number of cells in the sample medical image is determined according to the plurality of first cell feature encodings. Specifically, the number of the plurality of first cell feature encodings is determined as the first predicted value.

[0041] In the embodiment, since the encoding layer of the untrained autoencoder will have some errors in the process of feature extraction on the original data, there will be some errors between the first predicted value and the labeled value. The autoencoder can be optimized by adjusting the errors subsequently.

[0042] S105, input the first latent feature to the autoencoder, and reconstruct each sample medical image according to the first latent feature to obtain a plurality of reconstructed images.

[0043] In the embodiment, the first latent feature h i (i=1, 2,..., N) is input to the decoding layer, and the decoding layer reconstructs the first feature vector using the first latent feature h i (i=1, 2,..., N) to obtain a reconstructed first feature vector X i * (i=1, 2,..., N). The reconstructed first feature vector is restored to obtain the reconstructed image. The input X i Since the encoding layer of the untrained autoencoder will have errors in the process of feature extraction on the original data, the decoding layer will also have some deviations in the process of reconstructing the original image, so there will be some reconstruction errors between the output X i * and the X i . The autoencoder can also be optimized by adjusting the reconstruction errors subsequently.

[0044] S106, optimizing the autoencoder based on the plurality of reconstructed images.

[0045] In order to make the features extracted by the encoding layer more accurate, that is, to make the decoding layer restore the main features of the original image as much as possible, it is necessary to continuously reduce the reconstruction error in the training process. If the reconstruction error is close to 0, that is, the reconstructed image output by the decoding layer is almost equal to the original image, it can be said that the features extracted by the encoding layer are the features of the original image.

[0046] In the embodiment, based on the step S104 and the step S105, the reducing the reconstruction error includes two aspects, one aspect is to make the first cell prediction value output by the encoding layer as close as possible to the label value; the other aspect is to make the reconstructed image output by the decoding layer as close as possible to the sample medical image.

[0047] In the embodiment, the optimizing the auto-encoder based on the plurality of reconstructed images includes: establishing a first loss function according to the plurality of sample medical images and the plurality of reconstructed images; establishing a second loss function according to the label value and the first prediction value; and optimizing the auto-encoder based on the first loss function and the second loss function.

[0048] Specifically, (1) calculating the error between each sample medical image and each reconstructed image to obtain a plurality of first errors, obtaining a first average error based on the plurality of first errors, and setting the first average error as the first loss function. Wherein, the method for calculating the error includes cross-entropy algorithm and mean square error algorithm, which can be selected and set according to the actual needs of the user. In the embodiment, the mean square error algorithm is used to obtain the first loss function as

[0049] (2) calculating the error between the label value and the first prediction value of each sample medical image to obtain a plurality of second errors, obtaining a second average error based on the plurality of second errors, and setting the second average error as the second loss function. In the embodiment, the second loss function is Wherein, a i represents the cell number label value of the i-th sample medical image, represents the first prediction value of the i-th sample medical image. In other embodiments, other methods can be selected to calculate the second error, for example, calculating the mean square error of the label value and the first prediction value of each sample medical image.

[0050] (3) obtaining a third loss function based on the first loss function and the second loss function, wherein L3(a, X) = m1L1(X) + m2L2(a), m1 is the weight of the first loss function, and m2 is the weight of the second loss function. For example, m1 can be 0.5, and m2 can be 0.5. During the training of the autoencoder, the first loss function and the second loss function change with the change of the autoencoder parameters, so the third loss function can be regarded as a function of the autoencoder parameters. The autoencoder parameters are continuously adjusted by using the gradient descent method, so that the third loss function reaches a minimum value. The purpose of the gradient descent method is to obtain each extreme point of the third loss function, and calculate the value of the autoencoder parameters when the third loss function reaches the minimum value according to the extreme point, so as to obtain an autoencoder structure with the highest precision, and obtain the optimized autoencoder.

[0051] In the embodiment, by minimizing the third loss function value, that is, minimizing the error between the predicted value and the labeled value, and the error between the sample medical image and the reconstructed image, the cell quantity result output by the encoding layer is more accurate.

[0052] As shown in FIG. 1, it is a flowchart of a preferred embodiment of the cell quantity detection method of the present application. According to different needs, the order of the steps in the flowchart can be changed, and some steps can be omitted. Figure 3

[0053] S201, obtaining a to-be-detected medical image.

[0054] In the embodiment, the to-be-detected medical image can be a high-resolution digital image obtained by scanning and collecting through a full-automatic microscope or an optical magnification system. The to-be-detected medical image includes cells and some impurities.

[0055] S202, extracting a second feature vector of the to-be-detected medical image.

[0056] In order to use the trained autoencoder for cell quantity detection, the to-be-detected medical image needs to be converted into a feature vector.

[0057] In the embodiment, the to-be-detected medical image is subjected to vectorization processing to obtain a second feature vector of the to-be-detected medical image.

[0058] S203, inputting the second feature vector into the autoencoder and extracting a second latent feature of the to-be-detected medical image according to the second feature vector.

[0059] ​In the embodiment, the second feature vector is operated by using the encoding layer of the autoencoder to obtain a second latent feature of each sample medical image. The second latent feature is a plurality of feature encodings, and each feature encoding corresponds to a cell.

[0060] S204, obtaining a second prediction value of the number of cells in the to-be-detected medical image based on the second latent feature.

[0061] In the embodiment, obtaining the second prediction value of the number of cells in the to-be-detected medical image based on the second latent feature comprises:

[0062] extracting a plurality of second cell feature encodings in the second latent feature, wherein each second cell encoding represents a cell in the to-be-detected medical image;

[0063] determining the second prediction value of the number of cells in the to-be-detected medical image according to the plurality of second cell feature encodings, specifically, determining the number of the second cell feature encodings as the second prediction value.

[0064] S205, taking the second prediction value as the number of cells in the to-be-detected medical image.

[0065] In the embodiment, when the autoencoder trained by the training method of the autoencoder is used for cell number detection, the error of cell number detection is very small and can be ignored, so the second prediction value of the number of cells obtained in the step S204 is the number of cells in the to-be-detected medical image.

[0066] Please refer to Figure 4 In the embodiment, the training system 10 of the autoencoder can be divided into one or more modules, the one or more modules can be stored in the processor 12, and the processor 12 executes the training method of the autoencoder of the embodiment of the present application. The one or more modules can be a series of computer program instruction segments capable of completing a specific function, and the instruction segments are used to describe the execution process of the training system 10 of the autoencoder in the electronic device 1. For example, the training system 10 of the autoencoder can be divided into Figure 4 the acquisition module 101, the extraction module 102 and the processing module 103.

[0067] The first acquisition module 101 is configured to acquire a plurality of sample medical images; the extraction module 102 is configured to extract a first feature vector in each sample medical image; the extraction module 102 is further configured to input the first feature vector into the autoencoder and extract a first latent feature of the each sample medical image according to the first feature vector; the processing module 103 is configured to obtain a first predicted value of the number of cells in the each sample medical image based on the first latent feature; the extraction module 102 is further configured to input the first latent feature into the autoencoder, and reconstruct each sample medical image according to the first latent feature to obtain a plurality of reconstructed images; and the processing module 103 is further configured to optimize the autoencoder based on the plurality of reconstructed images.

[0068] The acquisition module 101 is further configured to acquire a to-be-detected medical image; the extraction module 102 is further configured to extract a second feature vector of the to-be-detected medical image; the extraction module 102 is further configured to input the second feature vector into the optimized autoencoder and extract a second latent feature of the to-be-detected medical image according to the second feature vector; the processing module 103 is further configured to obtain a second predicted value of the number of cells in the to-be-detected medical image based on the second latent feature; and the processing module 103 is further configured to take the second predicted value as the number of cells of the to-be-detected medical image.

[0069] The at least one processor 12 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, discrete hardware components, etc. The processor 12 can be a microprocessor or can also be any conventional processor, etc. The processor 12 is a control center of the electronic device 1, and connects various parts of the entire electronic device 1 through various interfaces and lines.

[0070] The memory 11 can be used to store the training system 10 and / or modules / units of the autoencoder, and the processor 12 realizes various functions of the electronic device 1 by running or executing the computer programs and / or modules / units stored in the memory 11 and calling the data stored in the memory 11. The memory 11 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required by at least one function, etc.; and the data storage area can store data created according to the use of the electronic device 1, etc. In addition, the memory 11 can include a non-volatile / volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash storage device, or other storage devices.

[0071] The memory 11 stores program codes, and the at least one processor 12 can call the program codes stored in the memory 11 to perform related functions. For example, Figure 4 Each module (the acquisition module 101, the extraction module 102, and the processing module 103) described in the above embodiment is a program code stored in the memory 11 and executed by the at least one processor 12, so as to realize the functions of the modules to improve the detection efficiency.

[0072] It should be noted that the modules / units integrated in the electronic device 1 can be stored in a computer-readable storage medium if they are realized in the form of software function units and sold or used as independent products. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can also be implemented by a computer program to instruct related hardware to complete, and the computer program can be stored in a computer-readable storage medium. When the processor executes the computer program, the steps of each method embodiment described above can be realized. The computer program code can be in the form of source code, object code, an executable file, or some intermediate form, etc. The computer-readable medium can include any entity or device, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM).

[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application but not limit the present application. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced equivalently without departing from the spirit and scope of the technical solutions of the present application.

Claims

1. A training method for an autoencoder, characterized in that, The method includes: Acquire multiple sample medical images; Extract the first feature vector from each sample medical image; Input the first feature vector into the autoencoder and extract the first latent feature of each sample medical image based on the first feature vector; Obtaining a first predicted value of the number of cells in each sample medical image based on the first latent feature includes: extracting multiple first cell feature codes from the first latent feature, and determining the first predicted value of the number of cells in the sample medical image based on the number of the multiple first cell feature codes; The first latent feature is input into the autoencoder, and each sample medical image is reconstructed based on the first latent feature to obtain multiple reconstructed images; Optimizing the autoencoder based on the first predicted value, the cell number marker value corresponding to each sample medical image, the multiple sample medical images, and the multiple reconstructed images includes: establishing a first loss function based on the multiple sample medical images and the multiple reconstructed images; establishing a second loss function based on the marker value and the first predicted value; and optimizing the autoencoder based on the first loss function and the second loss function.

2. The training method for the autoencoder according to claim 1, characterized in that, The step of establishing the first loss function based on the sample medical image and the reconstructed image includes: The error between each sample medical image and each reconstructed image is calculated to obtain multiple first errors; A first average error is obtained based on the plurality of first errors, and the first average error is set as the first loss function.

3. The training method for the autoencoder according to claim 1, characterized in that, The step of establishing a second loss function based on the labeled value and the first predicted value includes: The error between the labeled value and the first predicted value of each sample medical image is calculated to obtain multiple second errors; A second average error is obtained based on the plurality of second errors, and the second average error is set as the second loss function.

4. The training method for the autoencoder according to claim 1, characterized in that, The optimization of the autoencoder based on the first loss function and the second loss function includes: A third loss function is obtained based on the first loss function and the second loss function, wherein the third loss function is obtained by the following formula: L3(a,X)=m1L1(X)+m2L2(a), where L1(X) is the first loss function, L2(a) is the second loss function, L3(a,X) is the third loss function, m1 is the weight of the first loss function, and m2 is the weight of the second loss function. Adjust the parameters of the autoencoder, and calculate the function value of the third loss function based on the adjusted autoencoder; If the function value reaches its minimum, the optimized autoencoder is obtained.

5. A method for cell number detection using an autoencoder obtained by training an autoencoder according to any one of claims 1 to 4, characterized in that, The cell count detection method includes: Acquire the medical image to be tested; Extract the second feature vector of the medical image to be detected; The second feature vector is input into the optimized autoencoder, and the second latent feature of the medical image to be detected is extracted based on the second feature vector. A second predicted value for the number of cells in the medical image to be detected is obtained based on the second latent feature; The second predicted value is used as the number of cells in the medical image to be detected.

6. An electronic device, characterized in that, The electronic device includes a processor and a memory, the processor being configured to execute a computer program stored in the memory to implement the autoencoder training method as described in any one of claims 1 to 4 or the cell number detection method as described in claim 5.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction, which, when executed by a processor, implements the autoencoder training method as described in any one of claims 1 to 4 or the cell number detection method as described in claim 5.

Citation Information

Patent Citations

  • Cell detection method, device and apparatus for glomerular pathological section image

    CN110490840A

  • Pulmonary emphysema image processing method and system based on low data requirements

    CN110930378A