Protozoa image collection and identification system and usage method
By designing an automated protozoa image acquisition and recognition system, using microscopes and data processing systems, the automatic identification of protozoa is achieved, solving the accuracy and efficiency of manual microscopy, and improving the detection accuracy and efficiency.
Patent Information
- Application Number
- CN202411420868.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-10-12
AI Technical Summary
In the prior art, artificial microscopy of protozoa in water quality detection relies on operator experience, resulting in eye fatigue, reduced accuracy and low efficiency. Especially when the sample volume is large, the recognition accuracy and efficiency are lower, and convenient and efficient protozoa are urgently needed. Image collection and recognition system.
A protozoa image acquisition and recognition system was designed, including a microscope, an electric platform and a mobile controller. Combined with a data processing system, the pre-processing, cutting and classification detection modules are used to achieve automatic recognition and output recognition results. and image number and coordinates.
Automatic identification of protozoa is achieved, which reduces subjective errors in manual microscopy, improves detection accuracy and efficiency, simplifies operations, reduces the labor intensity of the operator, and improves work efficiency.
Smart Images

Figure CN118961703B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of protozoan detection, and in particular to a protozoan image collection and identification system and a method for using the system. Background Art
[0002] The "two worms" refer to Giardia lamblia and Cryptosporidium, which are pathogenic microorganisms of the cytosporidial protozoan class. They parasitize the intestinal systems of animals and humans, causing zoonotic protozoan diseases with diarrhea as the main clinical symptom, leading to gastrointestinal diseases and nutritional imbalances, and are particularly posing a major threat to the health of people with low immunity. There is currently no specific medicine to treat the infection of the "two worms", and people can only rely on their own immunity. Therefore, detecting the "two worms" in the water, discovering the pollution source, and blocking it in time is an effective means of controlling the "two worms".
[0003] At present, "two worms" are extended indicators for water quality detection, and the corresponding detection method is proposed in "Standard Test Methods for Drinking Water Hygiene" GB / T5750-2006. The method proposes that the identification of "two worms" requires the operator to observe under a microscope. This process relies entirely on manual microscopy, which has certain technical requirements for the operator. The operator needs to have rich experience in identifying "two worms". Due to the particularity of the sample, the operator needs to use the microscope for a long time without interruption, which will cause eye fatigue and affect the accuracy of the identification results. In addition, the subjective error of manual microscopy is relatively large, which reduces the accuracy of the detection. When the sample volume is large, the accuracy and efficiency of manual identification will be lower. Therefore, a convenient and efficient protozoan image collection and identification system is urgently needed. Summary of the invention
[0004] In view of this, the purpose of this application is to propose a protozoan image collection and identification system and a method of use for solving the above technical problems.
[0005] In a first aspect of the present application, a protozoan image acquisition and identification system is provided, comprising: an image acquisition system, comprising a microscope, an electric platform and a mobile controller, wherein the electric platform is arranged in the microscope, and is used to load a sample and drive the sample to move in the horizontal direction and the vertical direction; the mobile controller is arranged in the electric platform, and is used to control the movement of the electric platform; the microscope is used to acquire images of the sample; a data processing system, which is electrically connected to the image acquisition system, comprises an electric platform control module, a database module, a preprocessing module, a cutting module, a classification detection module, and a result output module; the electric platform control module is electrically connected to the mobile controller, and is used to adjust the electric platform to change the microscope. field of view and focal length; the database module is electrically connected to the microscope to store the pictures; the preprocessing module is electrically connected to the database module to sort the chromaticity of each pixel point of the picture and perform mean processing to obtain an average range, and filter out a target picture from the picture according to the average range; the cropping module is electrically connected to the preprocessing module to crop the target picture to obtain a standard picture; the classification detection module is electrically connected to the cropping module to input the standard picture into a pre-trained protozoan classification model for detection to obtain a recognition result; the result output module is electrically connected to the classification detection module to output the recognition result and the corresponding picture number and coordinates.
[0006] Furthermore, the data processing system is a computer, and the microscope is provided with a collection camera.
[0007] Furthermore, the protozoan classification model is a neural network model built based on ResNet-18, including 1 input layer, 4 convolutional layers, 1 pooling layer, 1 fully connected layer and 1 output layer.
[0008] Furthermore, the kernel size of the first two convolutional layers is 3*3, the number of kernels is 64, and the step size is 1; the kernel size of the last two convolutional layers is 3*3, the number of kernels is 128, and the step size is 1; the kernel size of the pooling layer is 2*2, the number of kernels is 64, and the step size is 2; the kernel size of the fully connected layer is 3*3, the number of kernels is 3; and the number of kernels of the output layer is 3.
[0009] The second aspect of the present application provides a method for using the protozoan image acquisition and identification system as described in the first aspect above, including: placing a sample on an electric platform and selecting a scanning area; controlling the electric platform to move according to a preset trajectory and controlling a microscope to acquire images; inputting the images into a data processing system for preprocessing, cropping, classification and detection, and obtaining identification results and corresponding image numbers and coordinates.
[0010] Furthermore, controlling the electric platform to move according to a preset trajectory and controlling the microscope to collect pictures includes: controlling the electric platform to move horizontally according to a serpentine trajectory so that the microscope corresponds to each field of view of the sample; controlling the electric platform to move vertically for focusing in each field of view of the microscope, and controlling the microscope to collect pictures, the number of focusing times for each field of view is 40 to 100 times, and the focusing time for each time is 5 to 10 seconds.
[0011] Furthermore, the preprocessing includes: sorting the pixels of each of the images by size according to the chromaticity of the pixels; calculating the average value of the chromaticity of the n largest pixels corresponding to each of the images as the maximum average value; calculating the average value of the chromaticity of the m smallest pixels corresponding to each of the images as the minimum average value; calculating the difference between the maximum average value and the minimum average value to obtain the average range of the image, wherein m and n are positive integers and m is greater than n; when the minimum average value is greater than a first preset value and the average range is greater than a second preset value, the image corresponding to the average range is the target image.
[0012] Furthermore, n is 12, m is 100, the first preset value is 50, and the second preset value is 50.
[0013] Furthermore, the cutting includes: selecting a target point on the target image and extending it in all directions to form a first cutting pattern, and cutting the target image according to the first cutting pattern to obtain a standard image; when the first cutting pattern overlaps with an edge portion of the target image, extending from the overlapping edge to the inner side of the target image to form a second cutting pattern, and cutting the target image according to the second cutting pattern to obtain a standard image, wherein the first cutting pattern and the second cutting pattern have the same shape and size.
[0014] Furthermore, the first cutting pattern and the second cutting pattern are both squares with a size of 30*30.
[0015] As can be seen from the above, the present application provides a protozoan image acquisition and identification system and a method of use, wherein the protozoan image acquisition and identification system comprises: an image acquisition system, comprising a microscope, an electric platform and a mobile controller, wherein the electric platform is arranged in the microscope, for loading samples and driving the samples to move in the horizontal and vertical directions; the mobile controller is arranged in the electric platform, for controlling the movement of the electric platform; the microscope is used to collect images of the samples; a data processing system, which is electrically connected to the image acquisition system, comprises an electric platform control module, a database module, a preprocessing module, a cutting module, a classification detection module, and a result output module; the electric platform control module is used to adjust the electric platform to change the field of view and focal length of the microscope; the database module is used to store images; the preprocessing module is used to sort the chromaticity of each pixel point of the image, and perform mean processing to obtain an average range, and filter out a target image from the image according to the average range; and the cutting module is used to perform mean processing on the chromaticity of each pixel point of the image. The cutting module is used to cut the target image to obtain a standard image; the classification detection module is used to input the standard image into a pre-trained protozoan classification model for detection to obtain an identification result; the result output module is used to output the identification result and the corresponding image number and coordinates; the image acquisition system and the data processing system can realize the automatic identification of protozoa. The operator only needs to place the sample on the electric platform and determine the scanning area. The system controls the microscope to automatically scan, focus, take pictures and identify, and output the results to the interface display, which greatly improves the work efficiency, reduces the subjective error caused by manual microscopy, and improves the detection accuracy. In addition, because the collected images are pre-processed, impurity images can be screened out, which greatly improves the recognition efficiency of subsequent classification detection. The protozoan image acquisition and identification system and the method of use are simple and convenient, save time and effort, can quickly collect and identify protozoan images, and have high recognition efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0017] Figure 1 This is a schematic diagram of the module structure of a protozoan image collection and identification system in an embodiment of the present application;
[0018] Figure 2 This is a schematic diagram of the pre-processing process in the embodiment of the present application;
[0019] Figure 3 This is a schematic diagram of a process cut out in an embodiment of the present application;
[0020] Figure 4A schematic diagram of a picture with a dark background and containing protozoa;
[0021] Figure 5 This is a schematic diagram of the irregular shape of the protozoa;
[0022] Figure 6 It is a schematic diagram of the dim picture of the protozoa;
[0023] Figure 7 This is a schematic diagram of the incomplete picture of the deep protozoan;
[0024] Figure 8 Schematic diagram of a picture that is blurry and contains protozoa. DETAILED DESCRIPTION
[0025] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0026] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be understood by people with ordinary skills in the field to which the present application belongs. "Include" or "comprising" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0027] The "two worms" refer to Giardia lamblia and Cryptosporidium, which are pathogenic microorganisms of the cytosporidial protozoan class. They parasitize the intestinal systems of animals and humans, causing zoonotic protozoan diseases with diarrhea as the main clinical symptom, leading to gastrointestinal diseases and nutritional imbalances, and are particularly posing a major threat to the health of people with low immunity. There is currently no specific medicine to treat the infection of the "two worms", and people can only rely on their own immunity. Therefore, detecting the "two worms" in the water, discovering the pollution source, and blocking it in time is an effective means of controlling the "two worms".
[0028] At present, "two worms" are extended indicators for water quality detection, and the corresponding detection method is proposed in "Standard Test Methods for Drinking Water Hygiene" GB / T5750-2006. The method proposes that the identification of "two worms" requires the operator to observe under a microscope. This process relies entirely on manual microscopy, which has certain technical requirements for the operator. The operator needs to have rich experience in identifying "two worms". Due to the particularity of the sample, the operator needs to use the microscope for a long time without interruption, which will cause eye fatigue and affect the accuracy of the identification results. In addition, the subjective error of manual microscopy is relatively large, which reduces the accuracy of the detection. When the sample volume is large, the accuracy and efficiency of manual identification will be lower. Therefore, a convenient and efficient protozoan image collection and identification system is urgently needed.
[0029] Below, through specific embodiments and combined Figures 1 to 8 To describe the technical solution of this application in detail.
[0030] In some embodiments of the present application, a protozoan image collection and recognition system is provided, such as Figure 1 As shown, it includes: an image acquisition system, including a microscope, an electric platform and a mobile controller, the electric platform is arranged in the microscope, and is used to load samples and drive the samples to move in the horizontal direction and the vertical direction; the mobile controller is arranged in the electric platform, and is used to control the movement of the electric platform; the microscope is used to collect pictures of the samples; a data processing system is electrically connected to the image acquisition system, and includes an electric platform control module, a database module, a preprocessing module, a cutting module, a classification detection module, and a result output module; the electric platform control module is electrically connected to the mobile controller, and is used to adjust the electric platform to change the field of view and focal length of the microscope; the data The library module is electrically connected to the microscope and is used to store the pictures; the preprocessing module is electrically connected to the database module and is used to sort the chromaticity of each pixel point of the picture and perform mean processing to obtain an average range, and filter out a target picture from the picture according to the average range; the cropping module is electrically connected to the preprocessing module and is used to crop the target picture to obtain a standard picture; the classification detection module is electrically connected to the cropping module and is used to input the standard picture into a pre-trained protozoan classification model for detection to obtain a recognition result; the result output module is electrically connected to the classification detection module and is used to output the recognition result and the corresponding picture number and coordinates.
[0031] The image acquisition system includes a microscope, an electric platform and a mobile controller. The electric platform is arranged in the microscope, and is used to load samples and drive the samples to move in the horizontal and vertical directions so as to adjust the sample field of view and focus operation; the mobile controller is arranged in the electric platform, and is used to control the movement of the electric platform; the microscope is a fluorescence microscope, and a collection camera is provided on the microscope for collecting pictures of the samples.
[0032] The data processing system is a computer, which is electrically connected to the image acquisition system and includes an electric platform control module, a database module, a preprocessing module, a cutting module, a classification detection module, and a result output module; the electric platform control module is used to adjust the electric platform to change the field of view and focal length of the microscope; the database module is used to store pictures, and can also store known protozoan pictures and labels.
[0033] The preprocessing module is used to sort the chromaticity of the pixels of each image and perform mean processing to obtain the average range. The target image is selected from the image according to the average range. By preprocessing the image, most of the impurity images can be screened out and the valid target images can be retained, such as Figure 2 As shown, the left side is the unfiltered picture, and the right side is the filtered picture. It can be seen that the impurity pictures are filtered out, which greatly reduces the pictures for subsequent recognition and detection, and because the impurities are filtered out, the accuracy of subsequent recognition can also be improved.
[0034] The cropping module is used to crop the target image to obtain a standard image, and the size of the standard image is, for example, 30*30; the classification detection module is used to input the standard image into a pre-trained protozoan classification model for detection to obtain a recognition result, and the standard image is input into a pre-trained protozoan classification model for detection to obtain a recognition result. The protozoan classification model can adopt the recognition model in the relevant technology, or the convolutional neural network recognition model in the subsequent examples. The recognition result is, for example, the probability of Giardia, the probability of Cryptosporidium, or the probability of non-two-parasites, etc.; the result output module is used to output the recognition result and the corresponding image number and coordinates, and the Argmax function can be used to select the category with the largest probability value as the recognition result of the image.
[0035] The process of automatic protozoan identification can be realized through the image acquisition system and the data processing system. The operator only needs to place the sample on the electric platform and determine the scanning area. The system controls the microscope to perform automatic scanning, automatic focusing, automatic photography and automatic identification, and outputs the results to the interface display, which greatly improves the work efficiency, reduces the subjective error caused by manual microscopy, and improves the detection accuracy. In addition, because the collected images are pre-processed, impurity images can be screened out, which greatly improves the recognition efficiency of subsequent classification detection. The protozoan image acquisition and identification system and its use method are simple and convenient, save time and effort, can quickly collect protozoan images and identify them, and have high recognition efficiency.
[0036] In some embodiments, the protozoan classification model is a neural network model built based on ResNet-18, including 1 input layer, 4 convolutional layers, 1 pooling layer, 1 fully connected layer and 1 output layer.
[0037] The specific structure of the protozoan classification model is shown in Table 1. The kernel size of the first two convolutional layers is 3*3, the number of kernels is 64, and the stride is 1; the kernel size of the last two convolutional layers is 3*3, the number of kernels is 128, and the stride is 1; the kernel size of the pooling layer is 2*2, the number of kernels is 64, and the stride is 2; the kernel size of the fully connected layer is 3*3, the number of kernels is 3; and the number of kernels of the output layer is 3.
[0038] Table 1 Protozoa classification model structure
[0039]
[0040] The convolution layer and pooling layer perform convolution calculations on the input image. The convolution calculation is a convolution operation used to extract the feature information of the "two worms" in the image, and then obtain the "two worms" features in the image. The fully connected layer is used to perform regression analysis on the extracted feature information, including Giardia classifiers, Cryptosporidium classifiers, and non-two worm classifiers. The output layer outputs a one-dimensional array to obtain the probability distribution of the three categories of results.
[0041] In some embodiments, a cross entropy loss function can be used to train the model. The training data is tens of thousands of artificially labeled protozoan pathogenic microorganisms and impurity images. The image format is jpg format and the size is 30*30. By experimentally comparing various adaptive learning rate optimization algorithms, the Adam optimization algorithm is selected to update the weights and biases of the convolutional neural network.
[0042] In some embodiments of the present application, a method for using a protozoan image acquisition and identification system is provided, including: placing a sample on an electric platform and selecting a scanning area; controlling the electric platform to move according to a preset trajectory and controlling a microscope to acquire images; inputting the images into a data processing system for preprocessing, cropping, classification and detection, and obtaining identification results and corresponding image numbers and coordinates.
[0043] You can click "Connect Microscope" on the computer and then set the image saving path; observe through the eyepiece and move the sample position through the electric platform. Generally, the upper left corner of the circumscribed rectangle of the circle drawn by the sample is defined as the starting point. After moving to the position, click the "Set Starting Point" button on the software interface, and then observe through the eyepiece and move the sample to the lower right corner of the rectangle. Click the "Set End Point" button on the software interface. After the setting is completed, the scanning area is determined, and the microscope is switched from eyepiece observation to camera observation, and then click the "Start Scan" button; start serpentine scanning from the user-defined starting point, and the camera takes pictures at the same time, and saves the pictures to the user-specified path folder. At this time, the user only needs to wait, and all work software will be automatically completed.
[0044] After collecting the picture, the data processing system will perform preprocessing, cropping, and classification detection to obtain the recognition results and the corresponding picture numbers and coordinates. The preprocessing operation is implemented through the preprocessing module, the cropping operation is implemented through the cropping module, and the classification detection operation is implemented through the classification detection module.
[0045] In some embodiments, controlling the electric platform to move according to a preset trajectory and controlling the microscope to collect pictures includes: controlling the electric platform to move horizontally according to a serpentine trajectory so that the microscope corresponds to each field of view of the sample; controlling the electric platform to move vertically for focusing in each field of view of the microscope, and controlling the microscope to collect pictures, the number of focusing times for each field of view is 40 to 100 times, and the focusing time for each time is 5 to 10 seconds.
[0046] By focusing multiple times at one position and collecting pictures, the clearest picture is selected to be retained based on the image quality assessment algorithm. If the number of focusing times is less than 40 times, the image may be out of focus range and a clear picture cannot be obtained. If the number of focusing times is more than 100 times, each sample will take a long time.
[0047] After obtaining the image to be identified, you can first reduce the image size and uniformly compress it to 1 / 4 of the original image size, and use mean filtering technology to remove random noise in the image to improve image quality and speed up post-processing.
[0048] In some embodiments, the preprocessing includes: sorting the pixels of each of the images by size according to the chromaticity of the pixels; calculating the average value of the chromaticity of the n largest pixels corresponding to each of the images as the maximum average value; calculating the average value of the chromaticity of the m smallest pixels corresponding to each of the images as the minimum average value; calculating the difference between the maximum average value and the minimum average value to obtain the average range of the image, wherein m and n are positive integers and m is greater than n; when the minimum average value is greater than a first preset value and the average range is greater than a second preset value, the image corresponding to the average range is the target image.
[0049] The chromaticity of each pixel can be expressed as f(x, y). The four classic sorting algorithms ROW_NUMBER(), rank(), Dense_rank(), and Ntile() in the MySQL database can be used to sort the pixels. In view of the continuous and repetitive characteristics of the Dense_rank() sorting algorithm, pixels of the same chromaticity will be grouped together and the sorting numbers of each group will be the same. It is most reasonable to select this algorithm. The sorting can be sorted from large to small chromaticity, or from small to large, without specific restrictions. n is, for example, 10 to 14, without specific restrictions. For example, n is 12, then the 12 pixels with the largest chromaticity are selected from the sorted pixels to calculate the chromaticity average value to obtain the maximum value average value max_aver(12). m is greater than n, m is, for example, 80 to 120, without specific restrictions. For example, m is 100, then the 100 pixels with the smallest chromaticity are selected from the sorted pixels to calculate the chromaticity average value to obtain the minimum value average value min_aver(100). The average range is max_aver(12)-min_aver(100). Calculating the average range facilitates the subsequent screening of target images.
[0050] The first preset value is, for example, 40 to 60, and the minimum average value is set to be greater than the first preset value to ensure that the image has a certain chromaticity and is a normal image. The second preset value is, for example, 30 to 70, and the average range is set to be greater than the second preset value, which means that the image chromaticity discrimination is high. The image is retained as the target image, and the impurity images with low chromaticity discrimination are screened out, thereby greatly reducing the recognition load, reducing the image throughput that needs to be detected and identified, and speeding up the overall automatic recognition speed.
[0051] In some embodiments, n is 12, m is 100, the first preset value is 50, and the second preset value is 50. After testing, by setting n to 12 and m to 100, retaining pictures with min_aver (100)>50 and max_aver (12)-min_aver (100)<50 as target pictures, the subsequent recognition effect is the best, not only with high recognition accuracy but also short recognition time.
[0052] In some embodiments, cropping includes scanning pixel point information of the preprocessed image, determining "two bugs" suspicious point information through a DBSCAN clustering algorithm, and cropping the image into a specific size.
[0053] The screening criteria are based on the apple green color of the two insects under a microscope. The G (green) of the three color channels R (red), G (green) and B (blue) is used as the criterion. Usually, the value range of the green channel is [10,80]. According to the experiment, the value range of the G (green) channel of the two insects is [30,50]. With this as the criterion, when the G (green) channel value of the pixel point is within the value range, the point coordinates corresponding to the pixel point are saved in a fixed list. If it is not within the value range, the pixel point is ignored. Then, the coordinates of the pixel points in the fixed list are clustered by DBSCAN. DBSCAN is a density-based spatial clustering algorithm that can find all dense areas of sample points and treat these dense areas as clusters one by one. The pixel point coordinates in the fixed list are clustered, and each cluster is a suspicious point. The center coordinates of each suspicious point are obtained, and the image is cropped into a 30*30 pixel image with the coordinates as the center.
[0054] In some embodiments, the cutting includes: selecting a target point on the target image and extending it in all directions to form a first cutting pattern, and cutting the target image according to the first cutting pattern to obtain a standard image; when the first cutting pattern overlaps with an edge portion of the target image, extending from the overlapping edge to the inner side of the target image to form a second cutting pattern, and cutting the target image according to the second cutting pattern to obtain a standard image, wherein the first cutting pattern and the second cutting pattern have the same shape and size.
[0055] The target point on the target image can be determined by the conventional DBSCAN clustering algorithm. The target point is the center coordinate of the suspicious point after clustering. The first cropping figure is, for example, a 30*30 square. The target point is selected and extended in all directions, that is, the first cropping figure is extended outward with the target point as the center. The target image is cropped according to the first cropping figure to obtain a standard image. This step is the operation of the aforementioned conventional cropping algorithm.
[0056] When the first cropping pattern overlaps with the edge of the target image, that is, the first cropping pattern is located at the edge of the field of view, a complete standard image cannot be obtained. At this time, it is necessary to extend from the overlapping edge to the inside to form a second cropping pattern. The second cropping pattern is also a 30*30 square. The formation process is as follows: Figure 3As shown, the first cutting figure on the left side of the first row overlaps with the upper edge portion of the target figure, and can be extended downward to form a second cutting figure; the first cutting figure on the left side of the second row overlaps with the lower edge portion of the target figure, and can be extended upward to form a second cutting figure; the first cutting figure on the left side of the third row overlaps with the left edge portion of the target figure, and can be extended to the right to form a second cutting figure; in this way, the target image is cut according to the second cutting figure to obtain a standard image, which is a real image that has not been stretched or processed, and will not cause deformation to the image, thereby ensuring the accuracy of subsequent recognition.
[0057] In some embodiments, the protozoan classification model is trained using characteristic images as standard images, wherein the characteristic images include images with a dark background and containing protozoa, images with irregular protozoan morphology, images with dim protozoa, images with incomplete protozoa, or images with blurred images and containing protozoa.
[0058] The existing recognition algorithms can only complete the recognition process of conventional samples. For samples of some characteristic types, ordinary automatic recognition methods do not have the ability to continue learning and therefore cannot identify them. During the model training process, special types of characteristic images can be added for recognition learning to improve the accuracy of model detection.
[0059] Characteristic images include images with dark backgrounds and containing protozoa, images with irregular protozoa shapes, dim protozoa images, incomplete protozoa images, or blurred images and containing protozoa. Figure 4 As shown, it can be a picture with a background grayscale of 70 to 120, a protozoan grayscale of 80 to 150, and a picture with irregular protozoan morphology such as Figure 5 As shown, it can be a picture of the shape of the protozoa that is not round or oval; a dark picture of the protozoa such as Figure 6 As shown, it can be a picture with a background grayscale of 20 to 30 and a protozoan grayscale of 25 to 50; a picture with a defective protozoan is as follows Figure 7 As shown in the figure, it can be a picture with incomplete protozoan shape due to cropping; a picture with blurred image and containing protozoan is shown in the figure. Figure 8 As shown, the picture can be a picture with a pixel density less than 400ppi. By adding five types of picture samples for training, after testing, the recognition accuracy can be improved by up to 24%.
[0060] In some embodiments, the protozoan classification model is iteratively trained using a KL divergence function (Kullback-Leibler Divergence).
[0061] In order to improve the recognition effect of the model, the error function can be used to estimate the difference between the true value and the predicted value to optimize the model parameters. The error function includes the mean square error function, the cross entropy loss function or the KL divergence function. After a long period of neural network testing, it is found that the KL divergence function is more accurate in measuring the difference between the network output and the true distribution in this model. Its calculation formula is KL = ∑ ylog(y / y'), where y is the probability distribution of the true number of protozoa, and y' is the probability distribution of the predicted number of protozoa. The smaller the value of KL divergence, the closer the predicted result is to the true value.
[0062] Comparative Example 1
[0063] The initial protozoan classification model shown in Table 1 was trained using regular protozoan image samples (excluding characteristic images). The initial learning rate was 0.001, the batch size range was 4-10, and the iteration was 200 cycles. The cross entropy loss function was used to estimate the difference between the true value and the predicted value, and the Adam optimization algorithm was selected to update the weights and bias of the convolutional neural network.
[0064] The sample was placed on the electric platform, and the scanning area was selected; the electric platform was controlled to move along a serpentine trajectory and the microscope was controlled to collect images; the image was input into the data processing system without preprocessing, and the standard image was directly cropped. The cropping method was the conventional clustering cropping method. When the image edge was cropped, no compensation was performed, and only a stretching operation was performed; the standard image was input into the trained protozoan classification model to obtain the recognition result, which was compared with the true result and the precision, recall and F1 value were calculated. The precision P represents the probability that all samples predicted as positive are actually positive samples, and the recall R represents the probability that the samples actually positive are predicted as positive samples. The F1 value represents the weighted reconciliation of P and R by 50%, and the F1 value is used as the core indicator for judging the recognition effect. The higher the F1 value, the better the recognition effect. This method was used to test 12 groups of samples, of which 6 groups contained Giardia lamblia and the other 6 groups contained Cryptosporidium. The test results are shown in Table 2.
[0065] Table 2 Comparison of recognition effects of comparative example 1
[0066]
[0067] Example 1
[0068] The initial protozoan classification model shown in Table 1 was trained using samples of protozoan images doped with five types of characteristic images. The initial learning rate was 0.001, the batch size range was 4-10, and the iteration was 200 cycles. The KL divergence function was used to estimate the difference between the true value and the predicted value, and the Adam optimization algorithm was selected to update the weights and biases of the convolutional neural network.
[0069] The 12 groups of samples in comparative example 1 were placed on a motorized platform respectively, and a scanning area was selected; the motorized platform was controlled to move along a serpentine trajectory and the microscope was controlled to collect images; the images were input into a data processing system, the images were preprocessed, and images with min_aver (100) > 50 and max_aver (12) - min_aver (100) < 50 were retained as target images; the target images were cropped by a compensatory cropping method to obtain standard images, and when the image edge was cropped, the image was cropped inwards for compensation without stretching; the standard images were input into a trained protozoan classification model to obtain recognition results, which were compared with the actual results and the precision, recall and F1 values were calculated. The test results are shown in Table 3. The recognition effects were significantly improved compared with those in comparative example 1.
[0070] Table 3 Comparison of recognition effects of Example 1
[0071]
[0072] Table 4 shows a comparison of the time taken by the model to recognize Giardia in Example 1 and Comparative Example 1. It can be seen that the recognition time without preprocessing is much longer than that after preprocessing.
[0073] Table 4 Recognition time comparison table
[0074]
[0075] Example 2
[0076] The initial protozoan classification model shown in Table 1 was trained using samples of protozoan images doped with five types of characteristic images. The initial learning rate was 0.001, the batch size range was 4-10, and the iteration was 200 cycles. The KL divergence function was used to estimate the difference between the true value and the predicted value, and the Adam optimization algorithm was selected to update the weights and biases of the convolutional neural network.
[0077] A group of Cryptosporidium and a group of Giardia samples were placed on a motorized platform respectively, and a scanning area was selected; the motorized platform was controlled to move along a serpentine trajectory and the microscope was controlled to collect images; the images were input into a data processing system, and preprocessed, and images with max_aver (12) - min_aver (100) < 50 were retained as target images; the target images were cropped using a compensatory cropping method to obtain standard images, and when cropping to the edge of the image, the image was cropped inwards for compensation without stretching; the standard images were input into a trained protozoan classification model to obtain recognition results, which were compared with the true results and the precision, recall and F1 value were calculated.
[0078] Example 3
[0079] The method of Example 2 is used for recognition, except that during preprocessing, pictures with max_aver (10) - min_aver (100) < 50 are retained as target pictures, and finally the precision, recall and F1 value are calculated.
[0080] Example 4
[0081] The method of Example 2 is used for recognition, except that during preprocessing, pictures with max_aver (12) - min_aver (120) < 50 are retained as target pictures, and finally the precision, recall and F1 value are calculated.
[0082] The test results of Example 2 to Example 4 are shown in Table 5. It can be seen that the recognition effect is best when n is 12 and m is 100.
[0083] Table 5 Comparison of recognition effects of different n and m
[0084]
[0085] Example 5
[0086] The initial protozoan classification model shown in Table 1 was trained using samples of protozoan images doped with five types of characteristic images. The initial learning rate was 0.001, the batch size range was 4-10, and the iteration was 200 cycles. The KL divergence function was used to estimate the difference between the true value and the predicted value, and the Adam optimization algorithm was selected to update the weights and biases of the convolutional neural network.
[0087] A group of Cryptosporidium and a group of Giardia samples were placed on a motorized platform respectively, and a scanning area was selected; the motorized platform was controlled to move along a serpentine trajectory and the microscope was controlled to collect images; the images were input into a data processing system, and preprocessed, and images with min_aver (100)>50 and max_aver (12)-min_aver (100)<50 were retained as target images; the target images were cropped using a compensatory cropping method to obtain standard images, and when cropping to the edge of the image, the image was cropped inwards for compensation without stretching; the standard images were input into a trained protozoan classification model to obtain recognition results, which were compared with the true results and the precision, recall and F1 value were calculated.
[0088] Example 6
[0089] The method of Example 5 is used for recognition, except that during preprocessing, pictures with max_aver (10) - min_aver (100) < 30 are retained as target pictures, and finally the precision, recall and F1 value are calculated.
[0090] Example 7
[0091] The method of Example 5 is used for recognition, except that during preprocessing, pictures with max_aver (10) - min_aver (100) < 70 are retained as target pictures, and finally the precision, recall and F1 value are calculated.
[0092] The test results of Examples 5 to 7 are shown in Table 6. It can be seen that when the second preset value is 50, the comprehensive recognition effect is the best, the time consumption is short, and the accuracy is high.
[0093] Table 6 Comparison of recognition effects of different second preset values
[0094]
[0095] Comparative Example 2
[0096] The recognition is performed using the method of Comparison 1. The difference is that the target image is cropped by the compensatory cropping method to obtain the standard image. When the edge of the image is cropped, the compensation is extended inward for cropping without stretching. Finally, the precision, recall and F1 value are calculated. The test results are shown in Table 7. The recognition effect after compensatory cropping is significantly improved compared with Comparison Example 1.
[0097] Table 7 Comparative Example 2 Recognition Effect Comparison Table
[0098]
[0099] Comparative Example 3
[0100] The method of comparison 1 was used for recognition. The difference was that the protozoan image samples mixed with five types of characteristic images were input into the initial protozoan classification model shown in Table 1 for training and finally the precision, recall rate and F1 value were calculated. The test results are shown in Table 8. The recognition effect after characteristic image training was significantly improved compared with comparison example 1.
[0101] Table 8 Comparative Example 3 Recognition Effect Comparison Table
[0102]
[0103] Example 8
[0104] The initial protozoan classification model shown in Table 1 was trained using samples of protozoan images doped with five types of characteristic images. The initial learning rate was 0.001, the batch size range was 4-10, and the iteration was 200 cycles. The mean square error function was used to estimate the difference between the true value and the predicted value, and the Adam optimization algorithm was selected to update the weights and biases of the convolutional neural network.
[0105] A group of Cryptosporidium and a group of Giardia samples were placed on a motorized platform respectively, and a scanning area was selected; the motorized platform was controlled to move along a serpentine trajectory and the microscope was controlled to collect images; the images were input into a data processing system, and preprocessed, and images with min_aver (100)>50 and max_aver (12)-min_aver (100)<50 were retained as target images; the target images were cropped using a compensatory cropping method to obtain standard images, and when cropping to the edge of the image, the image was cropped inwards for compensation without stretching; the standard images were input into a trained protozoan classification model to obtain recognition results, which were compared with the true results and the precision, recall and F1 value were calculated.
[0106] Example 9
[0107] The method of Example 8 is used for recognition, except that the cross entropy loss function is used to estimate the difference between the true value and the predicted value, and finally the precision, recall and F1 value are calculated.
[0108] Example 10
[0109] The method of Example 8 is used for recognition, except that the KL divergence function is used to estimate the difference between the true value and the predicted value, and finally the precision, recall and F1 value are calculated.
[0110] The test results of Example 8 to Example 10 are shown in Table 9, and it can be seen that the recognition effect is best when the KL divergence function is used for iterative training.
[0111] Table 9 Comparison of recognition effects of different error functions
[0112]
[0113] A person skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0114] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the device can be shown in the form of a block diagram, so as to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present application will be implemented (that is, these details should be fully within the scope of understanding of those skilled in the art). Where specific details are set forth to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or with changes in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0115] Although the present application has been described in conjunction with specific embodiments thereof, many alternatives, modifications and variations of these embodiments will be apparent to those skilled in the art in light of the foregoing description.
[0116] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.
Claims
1. A protozoan image collection and recognition system, characterized in that: include: An image acquisition system comprises a microscope, an electric platform and a mobile controller, wherein the electric platform is arranged in the microscope and is used to load a sample and drive the sample to move in the horizontal direction and the vertical direction; the mobile controller is arranged in the electric platform and is used to control the movement of the electric platform; the microscope is used to acquire images of the sample; A data processing system, electrically connected to the image acquisition system, comprising an electric platform control module, a database module, a preprocessing module, a cutting module, a classification detection module, and a result output module; the electric platform control module is electrically connected to the mobile controller, and is used to adjust the electric platform to change the field of view and focal length of the microscope; The database module is electrically connected to the microscope and is used to store the pictures; The preprocessing module is electrically connected to the database module, and is used to sort the chromaticity of the pixels of each of the images and perform mean processing to obtain an average range, and select a target image from the images according to the average range, including: sorting the pixels of each of the images by size according to the chromaticity of the pixels; calculating the average value of the chromaticity of the n largest pixels corresponding to each of the images as the maximum average value; calculating the average value of the chromaticity of the m smallest pixels corresponding to each of the images as the minimum average value; calculating the difference between the maximum average value and the minimum average value to obtain the average range of the image, wherein m and n are positive integers and m is greater than n; when the minimum average value is greater than a first preset value, and the average range is greater than a second preset value, the image corresponding to the average range is the target image; wherein n is 12, m is 100, the first preset value is 50, the The second preset value is 50; the cropping module is electrically connected to the preprocessing module, and is used to crop the target image to obtain a standard image, including: selecting a target point on the target image and extending it in all directions to form a first cropping pattern, and cropping the target image according to the first cropping pattern to obtain a standard image; when the first cropping pattern overlaps with an edge portion of the target image, a second cropping pattern is extended from the overlapping edge to the inner side of the target image, and the target image is cropped according to the second cropping pattern to obtain a standard image, wherein the first cropping pattern and the second cropping pattern have the same shape and size; the classification detection module is electrically connected to the cropping module, and is used to input the standard image into a pre-trained protozoan classification model for detection to obtain a recognition result; the result output module is electrically connected to the classification detection module, and is used to output the recognition result and the corresponding image number and coordinates.
2. The protozoan image collection and identification system according to claim 1, characterized in that: The data processing system is a computer, and the microscope is provided with a collection camera.
3. The protozoan image collection and identification system according to claim 1, characterized in that: The protozoan classification model is a neural network model built based on ResNet-18, including 1 input layer, 4 convolutional layers, 1 pooling layer, 1 fully connected layer and 1 output layer.
4. The protozoan image collection and identification system according to claim 3, characterized in that: The kernel size of the first two convolutional layers is 3*3, the number of kernels is 64, and the step size is 1; the kernel size of the last two convolutional layers is 3*3, the number of kernels is 128, and the step size is 1; the kernel size of the pooling layer is 2*2, the number of kernels is 64, and the step size is 2; the kernel size of the fully connected layer is 3*3, the number of kernels is 3; the number of kernels of the output layer is 3.
5. A method for using the protozoan image collection and identification system as described in any one of claims 1 to 4, characterized in that: include: Place the sample on the motorized platform and select the scanning area; Control the electric platform to move according to a preset trajectory and control the microscope to collect images; The image is input into a data processing system for preprocessing, cropping, classification and detection to obtain a recognition result and corresponding image number and coordinates.
6. The method for using the protozoan image collection and identification system according to claim 5, characterized in that: The controlling the electric platform to move according to a preset trajectory and controlling the microscope to collect images includes: controlling the electric platform to move horizontally according to a serpentine trajectory so that the microscope corresponds to each field of view of the sample; The electric platform is controlled to move vertically for focusing in each field of view of the microscope, and the microscope is controlled to collect pictures. The number of focusing times for each field of view is 40 to 100 times, and the focusing time for each time is 5 to 10 seconds.
7. The method for using the protozoan image collection and identification system according to claim 5, characterized in that: The preprocessing includes: sorting the pixels of each of the images by size according to the chromaticity of the pixels; calculating the average value of the chromaticity of the n largest pixels corresponding to each of the images as the maximum average value; calculating the average value of the chromaticity of the m smallest pixels corresponding to each of the images as the minimum average value; calculating the difference between the maximum average value and the minimum average value to obtain the average range of the image, wherein m and n are positive integers and m is greater than n; when the minimum average value is greater than a first preset value and the average range is greater than a second preset value, the image corresponding to the average range is the target image.
8. The method for using the protozoan image collection and identification system according to claim 7, characterized in that: n is 12, m is 100, the first preset value is 50, and the second preset value is 50.
9. The method for using the protozoan image collection and identification system according to claim 7, characterized in that: The cutting includes: selecting a target point on the target image and extending it in all directions to form a first cutting pattern, and cutting the target image according to the first cutting pattern to obtain a standard image; when the first cutting pattern overlaps with an edge portion of the target image, extending from the overlapping edge to the inner side of the target image to form a second cutting pattern, and cutting the target image according to the second cutting pattern to obtain a standard image, wherein the first cutting pattern and the second cutting pattern have the same shape and size.
10. The method for using the protozoan image collection and identification system according to claim 9, characterized in that: The first cutting pattern and the second cutting pattern are both squares with a size of 30*30.
Citation Information
Patent Citations
Microscope automatic two-insect identification system and method
CN111240004A
