Imaging position determination method and device, terminal equipment and storage medium
By performing image segmentation and convolutional neural network processing on laminar flow images, the problem of inaccurately determining the relationship between image acquisition position and focal position in existing technologies is solved, thereby improving the accuracy of focal position calculation.
Patent Information
- Application Number
- CN202311738554.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-12-29
- Filing Date
- 2023-12-15
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2043-12-15
AI Technical Summary
Existing methods for determining image sharpness cannot take into account the morphological information of the image, resulting in deviations in the calculation of the focal position and making it impossible to accurately determine the relative relationship between the image acquisition position and the focal position.
The laminar flow image to be identified is segmented, the particle image is adjusted to a preset size, and then input into the target convolutional neural network. The relative positional relationship between the image and the focal point is determined according to the output category.
By comprehensively considering the image's shape and blur information, the relative relationship between the laminar flow image acquisition position and the focal position is accurately determined, thus improving the accuracy of the focal position calculation.
Smart Images

Figure CN118314202B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of image processing, and particularly relates to an imaging position determination method and device, a terminal device and a computer readable storage medium. BACKGROUND
[0002] With the rapid development of science and technology, image processing technology is increasingly concerned and valued, and is widely used in various industries.
[0003] At present, the urine sediment examination equipment obtains the formed component image in the urine sample through the planar laminar flow imaging principle, which is used for analyzing the concentration of the formed component. Since the laminar flow has a certain thickness, the particles in the laminar flow may have certain fluctuations, and then the particles before, on and after the focal point may exist in the same large image. The existing image sharpness determination method mainly performs image segmentation on the collected large image to obtain multiple particle images in the large image, and then calculates the sharpness of each particle image by using the gradient-based image sharpness calculation method, and takes the average as the sharpness corresponding to the large image. Therefore, the existing image sharpness determination method can only calculate the sharpness of the image, without considering the morphological information of the image, and cannot determine whether the image corresponds to the position before or after the focal point. Moreover, it is not appropriate to take the average sharpness of all particle images in the large image as the sharpness of the large image, which may cause deviation in the calculation of the focal point position.
[0004] In summary, the existing image sharpness determination method does not consider the morphology of the particle image in the calculation of the image sharpness, and cannot reflect the relative relationship between the image acquisition position and the focal point position, thereby causing deviation in the calculation of the focal point position. SUMMARY
[0005] The main purpose of the present application is to provide an imaging position determination method, device, terminal device and computer readable storage medium. The relative relationship between the current laminar flow image acquisition position and the focal point position is determined by comprehensively considering the morphology and blur information of the image, thereby facilitating the subsequent calculation of the focal point position.
[0006] In order to achieve the above purpose, the present application provides an imaging position determination method, which comprises:
[0007] performing image segmentation processing on the first laminar flow image to be recognized to obtain a plurality of first particle images;
[0008] adjusting the size of each of the plurality of first particle images to a preset size to obtain a second particle image corresponding to each of the plurality of first particle images;
[0009] respectively inputting the plurality of second particle images into a target convolutional neural network to obtain a first category corresponding to each of the plurality of second particle images;
[0010] determine a relative position relationship between the first laminar flow image and a focal point according to the plurality of first categories.
[0011] Optionally, the method further comprises:
[0012] construct a training data set according to the morphological information and the blur information;
[0013] perform model training on an initially constructed initial convolutional neural network according to the training data set to obtain a target convolutional neural network.
[0014] Optionally, the step of constructing a training data set according to the morphological information and the blur information comprises:
[0015] obtain a plurality of second laminar flow images, and determine a second category corresponding to each of the plurality of second laminar flow images according to an image acquisition position of each of the plurality of second laminar flow images;
[0016] respectively perform image segmentation processing on the plurality of second laminar flow images to obtain a plurality of third particle images corresponding to each of the plurality of second laminar flow images;
[0017] respectively adjust a size of each of the plurality of third particle images to a preset size to obtain a fourth particle image corresponding to each of the plurality of third particle images;
[0018] construct a training data set based on morphological information and blur information corresponding to each of the plurality of fourth particle images.
[0019] Optionally, the step of performing model training on an initially constructed initial convolutional neural network according to the training data set to obtain a target convolutional neural network comprises:
[0020] perform model training on an initially constructed initial convolutional neural network according to the training data set;
[0021] determine a loss value corresponding to each of a plurality of continuous model training times based on a loss function, and detect a coefficient of variation corresponding to the plurality of loss values;
[0022] when the coefficient of variation is less than a preset value, stop the model training, and obtain a target convolutional neural network.
[0023] Optionally, after the step of detecting the coefficient of variation corresponding to the plurality of loss values, the method further comprises:
[0024] when the coefficient of variation is greater than or equal to a preset value, detect a model training time;
[0025] When the number of model training times is equal to a preset number of times, stop the model training, and obtain a target convolutional neural network.
[0026] Optionally, the step of adjusting the size of each of the plurality of first particle images to a preset size to obtain a second particle image corresponding to each of the plurality of first particle images comprises:
[0027] extracting grayscale information corresponding to each of the plurality of first particle images to obtain a grayscale image corresponding to each of the plurality of first particle images;
[0028] performing algorithm processing on the plurality of grayscale images based on an image size adjustment algorithm to obtain a second particle image corresponding to each of the plurality of grayscale images.
[0029] Optionally, the step of determining the relative positional relationship between the first laminar flow image and the focal point according to the plurality of first categories comprises:
[0030] determining a target category of the first laminar flow image, wherein the target category is a first category with the largest number in the plurality of first categories;
[0031] determining the relative positional relationship between the first laminar flow image and the focal point according to the target category.
[0032] In addition, to achieve the above-mentioned purpose, the present application also provides an imaging position determination device, which comprises:
[0033] an image segmentation module configured to perform image segmentation processing on a first laminar flow image to be identified to obtain a plurality of first particle images;
[0034] a size adjustment module configured to adjust the size of each of the plurality of first particle images to a preset size to obtain a second particle image corresponding to each of the plurality of first particle images;
[0035] a model calculation module configured to input each of the plurality of second particle images into a target convolutional neural network to obtain a first category corresponding to each of the plurality of second particle images;
[0036] a relative position module configured to determine a relative positional relationship between the first laminar flow image and a focal point according to the plurality of first categories.
[0037] In addition, to achieve the above-mentioned purpose, the present application also provides a terminal device, which comprises a memory, a processor, and an imaging position determination program stored in the memory and executable on the processor, wherein the imaging position determination program of the terminal device, when executed by the processor, implements the steps of the imaging position determination method as described above.
[0038] Further, in order to achieve the above object, the present application also provides a computer readable storage medium, wherein the computer readable storage medium stores an imaging position determination program, and the imaging position determination program, when executed by a processor, implements the steps of the imaging position determination method.
[0039] The imaging position determination method, device, terminal equipment and computer readable storage medium provided by the embodiments of the present application are as follows: the first layer flow image to be identified is subjected to image segmentation processing to obtain a plurality of first particle images; the size of each of the plurality of first particle images is adjusted to a preset size to obtain a second particle image corresponding to each of the plurality of first particle images; each of the plurality of second particle images is input into a target convolutional neural network to obtain a first category corresponding to each of the plurality of second particle images; and the relative positional relationship between the first layer flow image and a focal point is determined according to the plurality of first categories.
[0040] The embodiments of the present application obtain a plurality of particle images, i.e., first particle images, by subjecting the first layer flow image to be identified to image segmentation, adjust the size of each of the plurality of first particle images to a uniform size, i.e., a preset size, to obtain a second particle image corresponding to each of the plurality of first particle images, then input each of the second particle images into a target convolutional neural network to obtain a first category corresponding to each of the second particle images, and finally determine the relative positional relationship between the first layer flow image and a focal point according to the plurality of first categories obtained, so that the present application determines the relative relationship between the current layer flow image acquisition position and the focal point position by comprehensively considering the shape and blur information of the image, thereby facilitating the calculation of the focal point position. BRIEF DESCRIPTION OF DRAWINGS
[0041] Figure 1 is a device structure schematic diagram of a hardware running environment of a terminal equipment involved in the embodiments of the present application;
[0042] Figure 2 is a step flow schematic diagram of the first embodiment of the imaging position determination method of the present application;
[0043] Figure 3 is a convolutional neural network architecture schematic diagram involved in an embodiment of the imaging position determination method of the present application;
[0044] Figure 4 is a layer flow image sequence analysis result schematic diagram involved in an embodiment of the imaging position determination method of the present application;
[0045] Figure 5 is a category particle image schematic diagram involved in an embodiment of the imaging position determination method of the present application;
[0046] Figure 6 This is a schematic diagram of the functional modules of an embodiment of the imaging position determination device of the present invention.
[0047] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0048] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0049] Reference Figure 1 , Figure 1 This is a schematic diagram of the hardware operating environment of the terminal device involved in the embodiment of the present invention.
[0050] The terminal device in this embodiment of the invention can be a urine sediment testing device.
[0051] like Figure 1 As shown, the terminal device may include: a processor 1001, such as a CPU; a communication bus 1002; a user interface 1003; a network interface 1004; and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0052] Those skilled in the art will understand that Figure 1 The terminal device structure shown does not constitute a limitation on the terminal device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0053] like Figure 1 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an imaging position determination program.
[0054] exist Figure 1 In the terminal shown, network interface 1004 is mainly used to connect to the backend server and communicate data with it; user interface 1003 is mainly used to connect to the client and communicate data with it; and processor 1001 can be used to call the imaging position determination program stored in memory 1005 and perform the following operations:
[0055] perform image segmentation processing on the first layer flow image to be identified to obtain a plurality of first particle images;
[0056] respectively adjust sizes of the plurality of first particle images to a preset size to obtain a plurality of second particle images respectively corresponding to the plurality of first particle images;
[0057] respectively input the plurality of second particle images into a target convolutional neural network to obtain a plurality of first categories respectively corresponding to the plurality of second particle images;
[0058] determine a relative positional relationship between the first layer flow image and a focal point according to the plurality of first categories.
[0059] Optionally, the processor 1001 can also be configured to invoke an imaging position determination program stored in the memory 1005 and perform the following operations:
[0060] construct a training data set according to the shape information and the blur information;
[0061] perform model training on an initial convolutional neural network constructed in advance according to the training data set to obtain the target convolutional neural network.
[0062] Optionally, the processor 1001 can also be configured to invoke an imaging position determination program stored in the memory 1005 and perform the following operations:
[0063] obtain a plurality of second layer flow images, and determine a plurality of second categories respectively corresponding to the plurality of second layer flow images according to image acquisition positions of the plurality of second layer flow images;
[0064] respectively perform image segmentation processing on the plurality of second layer flow images to obtain a plurality of third particle images respectively corresponding to the plurality of second layer flow images;
[0065] respectively adjust sizes of the plurality of third particle images to a preset size to obtain a plurality of fourth particle images respectively corresponding to the plurality of third particle images;
[0066] construct a training data set based on shape information and blur information respectively corresponding to the plurality of fourth particle images.
[0067] Optionally, the processor 1001 can also be configured to invoke an imaging position determination program stored in the memory 1005 and perform the following operations:
[0068] perform model training on an initial convolutional neural network constructed in advance according to the training data set;
[0069] Determine a loss value corresponding to each of the plurality of continuous model training based on a loss function, and detect a coefficient of variation corresponding to the plurality of loss values;
[0070] When the coefficient of variation is less than a preset value, stop the model training, and obtain a target convolutional neural network.
[0071] Optionally, the processor 1001 can also be configured to call an imaging position determination program stored in the memory 1005, and after the step of detecting the coefficient of variation corresponding to the plurality of loss values, the processor 1001 further performs the following operations:
[0072] When the coefficient of variation is greater than or equal to a preset value, detect the number of model training times;
[0073] When the number of model training times is equal to a preset number, stop the model training, and obtain a target convolutional neural network.
[0074] Optionally, the processor 1001 can also be configured to call an imaging position determination program stored in the memory 1005, and perform the following operations:
[0075] Extract gray scale information corresponding to each of the plurality of first particle images, and obtain a gray scale image corresponding to each of the plurality of first particle images;
[0076] Respectively process the plurality of gray scale images based on an image size adjustment algorithm, and obtain a second particle image corresponding to each of the plurality of gray scale images.
[0077] Optionally, the processor 1001 can also be configured to call an imaging position determination program stored in the memory 1005, and perform the following operations:
[0078] Determine a target category of the first laminar flow image, wherein the target category is a first category with the largest number in the plurality of first categories;
[0079] Determine a relative position relationship between the first laminar flow image and a focal point according to the target category.
[0080] Based on the terminal device described above, each embodiment of the imaging position determination method is proposed.
[0081] Currently, the urine sediment examination equipment obtains the image of the formed component in the urine sample through the planar laminar flow imaging principle, and is used for analyzing the concentration of the formed component. Since the laminar flow has a certain thickness, the particles in the laminar flow may have certain fluctuations, and then the particles before, on and after the focus may exist in the same large image. The existing image definition determination method mainly performs image segmentation on the collected large image to obtain multiple particle images in the large image, and then calculates the definition of each particle image by using the gradient-based image definition calculation method, and takes the average as the definition of the large image. Therefore, the existing image definition determination method can only calculate the definition of the image, without considering the morphological information of the image, and cannot determine whether the image corresponds to the position before or after the focus. Moreover, it is not appropriate to take the average definition of all particle images in the large image as the definition of the large image, which may cause deviation in the calculation of the focus position.
[0082] In view of the above phenomenon, the present application provides an imaging position determination method. The method performs image segmentation on the first laminar flow image to be recognized to obtain multiple particle images, i.e. first particle images, adjusts the size of the multiple first particle images to a uniform size, i.e. a preset size, to obtain particle images of the multiple first particle images corresponding to the preset size, i.e. second particle images, then inputs all the second particle images into a target convolutional neural network to obtain the categories corresponding to each second particle image, i.e. first categories, and finally determines the relative position relationship between the first laminar flow image and the focus according to the obtained multiple first categories. In this way, the present application determines the relative relationship between the current laminar flow image acquisition position and the focus position by comprehensively considering the morphological and blur information of the image, thereby facilitating the calculation of the focus position.
[0083] Please refer to Figure 2 , Figure 2 The flowchart of the first embodiment of the imaging position determination method of the present application. It should be noted that although the logical order is shown in the flowchart, in some cases, the imaging position determination method of the present application can also execute the steps shown or described in a different order from here.
[0084] In the first embodiment of the imaging position determination method of the present application, the imaging position determination method of the present application comprises:
[0085] Step S10: performing image segmentation processing on the first laminar flow image to be recognized to obtain multiple first particle images;
[0086] In this embodiment, the urine sediment examination equipment performs image segmentation processing on the first laminar flow image to be recognized to obtain multiple particle images, i.e. first particle images.
[0087] Exemplarily, the urine sediment examination device performs image segmentation on the one laminar flow image to be identified to obtain 10 particle images.
[0088] Step S20: respectively adjusting sizes of the plurality of first particle images to a preset size to obtain second particle images corresponding to the plurality of first particle images respectively;
[0089] In this embodiment, the urine sediment examination device adjusts sizes of the plurality of first particle images obtained by performing segmentation on the laminar flow image to be identified to the preset size to obtain second particle images corresponding to the plurality of first particle images respectively, that is, the size of the second particle image is the preset size.
[0090] Exemplarily, the urine sediment examination device adjusts sizes of the ten first particle images obtained by performing segmentation on the laminar flow image to be identified, and specifically, the urine sediment examination device respectively adjusts sizes of the ten first particle images to the preset size 64*64 to obtain second particle images corresponding to the ten first particle images respectively, and the second particle image is the first particle image with the size of 64*64.
[0091] It should be noted that the preset size of the particle image is set to 64*64 after analyzing the prior probability of the size of various particles. It should be understood that the preset size of the particle image can be any image size meeting actual needs in different design needs based on actual application, and the imaging position determination method does not limit the size of the particle image set by the urine sediment examination device.
[0092] Step S30: respectively inputting the plurality of second particle images into a target convolutional neural network to obtain first categories corresponding to the plurality of second particle images respectively;
[0093] In this embodiment, the urine sediment examination device respectively inputs the second particle images corresponding to the plurality of first particle images into the target convolutional neural network to obtain an output of the target convolutional neural network, that is, the categories corresponding to the plurality of second particle images, that is, the first categories.
[0094] Exemplarily, the urine sediment examination device respectively inputs the ten second particle images with the size of 64*64 into the target convolutional neural network, and the target convolutional neural network calculates the output corresponding to the input according to the input, and specifically, the target convolutional neural network outputs the categories of the second particle images according to the second particle images. The target convolutional neural network is obtained by model training of the initial convolutional neural network based on the pre-constructed training data set.
[0095] It should be noted that, as Figure 5As shown, the categories of the particle images include five categories, namely, category 1, category 2, category 3, category 4 and category 5, wherein, category 1 represents that the position of the particle image is at the front end of the focal point away from the focal point position, category 2 represents that the position of the particle image is at the front end of the focal point closer to the focal point position, category 3 represents that the position of the particle image is near the focal point position, category 4 represents that the position of the particle image is at the rear end of the focal point closer to the focal point position, and category 5 represents that the position of the particle image is at the rear end of the focal point away from the focal point position, so that the category of the particle image can be determined according to the shape and blur information of the particle image.
[0096] It should be noted that the above first category represents the category corresponding to the particle image output by the trained convolutional neural network in actual application.
[0097] Step S40, determining the relative position relationship between the first flow image and the focal point according to the plurality of first categories.
[0098] In this embodiment, the urine sediment examination device determines the relative position relationship between the first flow image position and the focal point position according to the first categories corresponding to the respective second particle images output by the target convolutional neural network.
[0099] For example, the urine sediment examination device inputs ten second particle images each with a size of 64*64 into the target convolutional neural network to obtain the categories corresponding to the ten second particle images, that is, ten first categories, and determines the relative position relationship between the first flow image position and the focal point position according to the ten first categories.
[0100] Further, in a feasible embodiment, the imaging position method of the present application, the above step S40 can include:
[0101] Step S401, determining a target category of the first flow image, wherein the target category is the first category with the largest quantity in the plurality of first categories;
[0102] Step S402, determining the relative position relationship between the first flow image and the focal point according to the target category.
[0103] In this embodiment, the urine sediment examination device detects the first category with the largest quantity in the plurality of first categories, and determines the first category as the target category corresponding to the first flow image, and then determines the relative position relationship between the first flow image position and the focal point position according to the target category.
[0104] For example, if the urine sediment testing device determines that the categories of ten second particle images include nine category 1 and one category 2, then the target category corresponding to the first laminar flow image is determined to be category 1. Since category 1 indicates that the image position is at the focal front of the focal position far from the focal position, the position of the first laminar flow image is determined to be at the focal front of the focal position far from the focal position. If the urine sediment testing device determines that the categories of ten second particle images include five category 1 and five category 2, then the category of the first laminar flow image is determined to be unknown.
[0105] It should be noted that the above laminar flow image position refers to the position of the camera when the laminar flow image is captured by the camera of the urine sediment testing equipment, and the above focal position refers to the position of the camera when the laminar flow image captured by the camera of the urine sediment testing equipment is successfully focused.
[0106] For example, such as Figure 4 As shown, this is the analysis result of a laminar flow image sequence captured in an actual focusing process. The horizontal axis represents the ID of the laminar flow image sequence, totaling 500 images. The image ID reflects the position of the camera, i.e., the relative position between the image position and the focal point. All image IDs are divided into 5 parts, corresponding to 5 categories. The vertical axis represents the category, where 0 represents the unknown category, and 1-5 represent categories 1, 2, 3, 4, and 5.
[0107] In this embodiment, the imaging position determination method of the present invention performs image segmentation processing on the first laminar flow image to be identified using a urine sediment testing device to obtain multiple particle images, i.e., first particle images. The urine sediment testing device adjusts the size of the multiple first particle images obtained by segmenting the laminar flow image to be identified to a preset size to obtain a second particle image corresponding to each of the multiple first particle images. That is, the size of the second particle image is the preset size. The urine sediment testing device inputs the second particle images corresponding to each of the multiple first particle images into a target convolutional neural network to obtain the output of the target convolutional neural network, i.e., the category corresponding to each of the multiple second particle images, i.e., the first category. The urine sediment testing device detects the first category with the most occurrences among the multiple first categories and determines that the first category is the target category corresponding to the first laminar flow image. Then, based on the target category, it determines the relative positional relationship between the position of the first laminar flow image and the focal position.
[0108] Thus, the embodiment of the present application obtains a plurality of particle images, i.e., first particle images, by performing image segmentation on the first layer flow image to be identified, adjusts the sizes of the plurality of first particle images to a uniform size, i.e., a preset size, to obtain a plurality of particle images of the preset size corresponding to the plurality of first particle images, i.e., second particle images, then inputs all the second particle images into the target convolutional neural network one by one to obtain a category corresponding to each second particle image, i.e., a first category, and finally determines the relative positional relationship between the first layer flow image and the focal point according to the plurality of first categories obtained, so that the present application determines the relative relationship between the collection position of the current layer flow image and the focal point position by comprehensively considering the morphological and blur information of the image, thereby facilitating the calculation of the focal point position.
[0109] Further, based on the first embodiment of the imaging position determination method of the present application, a second embodiment of the imaging position determination method of the present application is proposed.
[0110] In the embodiment, the imaging position determination method of the present application can further include:
[0111] Step A, constructing a training data set according to the morphological information and the blur information;
[0112] Step B, performing model training on the initially constructed convolutional neural network according to the training data set to obtain a target convolutional neural network.
[0113] In the embodiment, the urine sediment testing device constructs a training data set according to the morphological information and the blur information of the particle image, and performs model training on the initially constructed convolutional neural network according to the training data in the training data set to obtain a target convolutional neural network.
[0114] For example, the urine sediment testing device performs model training on the initial convolutional neural network based on the training data set to obtain a trained target convolutional neural network, then constructs a test training set, in which there are 1000 particle images of each category, and a total of 5000 particle images, inputs the particle images into the trained target convolutional neural network to obtain a test set prediction accuracy, in which the accuracy of category 1 is 99%, the accuracy of category 2 is 97.8%, the accuracy of category 3 is 91.3%, the accuracy of category 4 is 95.9%, and the accuracy of category 5 is 99.2%.
[0115] For example, as Figure 3As shown, the present application adopts a large number of channel separable convolution and 1*1 convolution in the design of the convolutional neural network structure to improve the inference speed of the network. In addition, the network convolves the particle image with a size of 64*64 to 1*1, ensures that the network is deep enough, improves the representation ability of the network, and strengthens the classification performance of the network. The convolutional neural network architecture adopts a "straight cylinder type" design scheme, which is beneficial to improve the GPU (graphics processing unit) parallel computing efficiency. Among them, k represents the convolution kernel size, s represents the convolution kernel moving step, p represents the Pad layer number, ReLU represents the activation function type ReLU function, BatchNormalization represents batch normalization, and classNum represents the total number of classes. It should be noted that the convolutional neural network obtains an output according to the input, and the output is the total number of classes, that is, five categories. It should be understood that the five categories correspond to a five-dimensional vector. If the five-dimensional vector is (1, 0, 0, 0, 0,), it means that the category corresponding to the five-dimensional vector is category 1, that is, the category of the particle image input into the convolutional neural network is category 1.
[0116] Further, in a possible implementation, the imaging position determination method of the present application, the step A, can include:
[0117] Step A01, obtaining a plurality of second flow images, determining a plurality of second categories corresponding to the plurality of second flow images respectively according to the acquisition positions of the plurality of second flow images respectively;
[0118] In this embodiment, the urinary sediment examination equipment obtains a plurality of second flow images, and determines a plurality of second categories corresponding to the plurality of second flow images respectively according to the acquisition positions of the plurality of second flow images respectively.
[0119] For example, when the instrument is focused, the camera moves from the front position away from the focus point to the focus point direction until it reaches the rear position away from the focus point, and takes a flow image while moving. Repeat this process several times until enough layer flow images, i.e. second flow images, are collected. Assuming that n images are taken in one focusing process, these n images are taken by the camera at different positions. The id of the image reflects the position of the camera. Divide the n images into 5 parts according to the id number, and the 5 parts correspond to 5 categories.
[0120] It should be noted that the above-mentioned second category is the category corresponding to each particle image in the training data set for training the initial convolutional neural network.
[0121] Step A02, respectively performing image segmentation processing on the plurality of second flow images to obtain a plurality of third particle images corresponding to the plurality of second flow images respectively;
[0122] In the embodiment, the urine sediment examination device respectively performs image segmentation processing on the plurality of second flow images to obtain a plurality of third particle images respectively corresponding to the plurality of second flow images.
[0123] Exemplarily, image segmentation is performed on the n second flow images to obtain particle images in the images, and each second flow image can obtain a plurality of particle images after segmentation, and the categories of the particle images are the same as the categories of the flow images in which the particle images are located.
[0124] Step A03, respectively adjusting the sizes of the plurality of third particle images to a preset size to obtain a plurality of fourth particle images respectively corresponding to the plurality of third particle images;
[0125] In the embodiment, the urine sediment examination device respectively adjusts the sizes of the plurality of third particle images to a preset size to obtain a plurality of fourth particle images respectively corresponding to the plurality of third particle images.
[0126] Exemplarily, the urine sediment examination device adjusts the sizes of the plurality of particle images, i.e. the third particle images, obtained by segmenting the n second flow images to a preset size of 64*64, i.e. the fourth particle images. Step A04, constructing a training data set based on the morphological information and the blur information respectively corresponding to the plurality of fourth particle images.
[0127] In the embodiment, the urine sediment examination device constructs a training data set based on the morphological information and the blur information respectively corresponding to the plurality of fourth particle images.
[0128] Exemplarily, the urine sediment examination device takes the fourth particle images of the uniform size obtained after adjustment and the morphological and blur information corresponding to the fourth particle images as training data in the training data set.
[0129] Further, in a feasible embodiment, the imaging position determination method of the present application, the above-mentioned step B can include:
[0130] Step B01, model training is performed on an initial convolutional neural network constructed in advance according to the training data set;
[0131] Step B02, determining a loss value respectively corresponding to each of a plurality of continuous model training based on a loss function, and detecting a coefficient of variation corresponding to the plurality of loss values;
[0132] Step B03, when the coefficient of variation is less than a preset value, stopping the model training, and obtaining a target convolutional neural network.
[0133] In the embodiment, the urine sediment examination device performs model training on the pre-constructed initial convolutional neural network according to the pre-constructed training data set, determines the loss values corresponding to the respective continuous model training based on a loss function, calculates the coefficient of variation of the plurality of loss values, and stops the model training when the coefficient of variation is less than a preset value, and takes the current convolutional neural network as the final target convolutional neural network.
[0134] Exemplarily, the loss function of the model training process adopts cross-entropy loss, adopts an SGD (Stochastic Gradient Descent) optimization algorithm, the learning rate is fixed at 0.001, the momentum parameter is set to 0.9, the batchsize size is set to 128, and an early stopping criterion is adopted, that is, the CV (Coefficient of Variance) of the loss value is less than 0.005 within the last 10 iterations, the training is stopped in advance, and the convolutional neural network obtained by the current training is taken as the final target convolutional neural network.
[0135] Further, in a feasible embodiment, after the step B02, the imaging position determination method of the application can further include:
[0136] Step C, detecting the number of model training when the coefficient of variation is greater than or equal to the preset value;
[0137] Step D, stopping the model training and obtaining the target convolutional neural network when the number of model training is equal to the preset number.
[0138] In the embodiment, the urine sediment examination device detects the number of model training of the convolutional neural network when the coefficient of variation corresponding to the plurality of loss values is greater than or equal to the preset value, stops the model training when the number of model training is equal to the preset number, and takes the convolutional neural network obtained by the model training of the preset number as the target convolutional neural network.
[0139] Exemplarily, the urine sediment examination device sets the maximum number of iterations of the model training of the convolutional neural network to 200 times, that is, the preset number is 200 times, and if the coefficient of variation corresponding to the loss value obtained by the last 10 iterations is not less than the preset value 0.005, the model training is continuously performed until 200 times of model training are completed.
[0140] It should be noted that the maximum number of iterations of the model training of the convolutional neural network is set to 200 in the present application. In actual application, for the training data set in the present embodiment, 200 iterations are sufficient to achieve a variation coefficient of the loss values corresponding to the last 10 iterations less than a preset value. It should be understood that the maximum number of iterations can be any setting that meets the actual needs in different feasible implementations based on different design needs in actual application, and the present application does not limit the maximum number of iterations of the model training of the convolutional neural network.
[0141] In the present embodiment, the imaging position determination method of the present application obtains a plurality of second layer flow images through the urinary sediment examination equipment, determines a plurality of second categories corresponding to the plurality of second layer flow images respectively according to the respective collection positions of the plurality of second layer flow images, respectively performs image segmentation processing on the plurality of second layer flow images to obtain a plurality of third particle images corresponding to the plurality of second layer flow images respectively, then adjusts the sizes of the plurality of third particle images to a preset size respectively to obtain a plurality of fourth particle images corresponding to the plurality of third particle images respectively, and forms a training data set by the plurality of fourth particle images; the urinary sediment examination equipment performs model training on the initially constructed initial convolutional neural network according to the training data in the training data set to obtain a target convolutional neural network; the urinary sediment examination equipment performs model training on the initially constructed initial convolutional neural network according to the pre-constructed training data set, and determines a loss value corresponding to each of a plurality of continuous model training based on a loss function, calculates a variation coefficient of the plurality of loss values, and stops the model training when the variation coefficient is less than a preset value, and takes the current convolutional neural network as the finally obtained target convolutional neural network.
[0142] In this way, the present application obtains a trained target convolutional neural network by constructing a training data set and performing model training on the initially constructed initial convolutional neural network based on the training data set. The target convolutional neural network is used to output the category corresponding to each particle image, i.e., the relative position relationship between the particle image and the focal point, by comprehensively considering the shape and blur information of a plurality of particle images in a layer flow image, so as to qualitatively determine the sharpness of the layer flow image and further determine the relative position relationship between the layer flow image and the focal point. In addition, the particle image of a uniform size is convolved to 1*1 by the target convolutional neural network, so as to ensure that the network is deep enough, improve the representation ability of the network, and strengthen the classification performance of the network.
[0143] Further, based on the first embodiment and / or the second embodiment of the imaging position determination method of the present application, a third embodiment of the imaging position determination method of the present application is proposed.
[0144] In the present embodiment, the imaging position determination method of the present application, the above step S20 can include:
[0145] Step S201, extracting gray information corresponding to each of the plurality of first particle images to obtain a plurality of gray images corresponding to each of the plurality of first particle images;
[0146] Step S202, performing algorithm processing on the plurality of gray images based on an image size adjustment algorithm to obtain a plurality of second particle images corresponding to each of the plurality of gray images.
[0147] In this embodiment, the urine sediment test device extracts gray information corresponding to each of the plurality of first particle images to obtain a plurality of gray images corresponding to each of the plurality of first particle images, and then performs algorithm processing on the plurality of gray images based on an image size adjustment algorithm to obtain a plurality of second particle images corresponding to each of the plurality of gray images, wherein the second particle image is a gray image of a preset size.
[0148] Exemplarily, the input of the image size adjustment algorithm is an m*m gray image, and the gray range is [0, 255]; the output of the image size adjustment algorithm is a 64*64 normalized image, and the gray range is [-1, 1]. Specifically, first, the image is scaled to 64*64 size by using a bilinear interpolation method; second, the average value of the image gray is calculated, denoted as gmean; finally, after subtracting gmean from all pixel gray values, dividing by 255, and outputting a 64*64 normalized image.
[0149] In this embodiment, the imaging position determination method of the present application extracts gray information corresponding to each of the plurality of first particle images to obtain a plurality of gray images corresponding to each of the plurality of first particle images, and then performs algorithm processing on the plurality of gray images based on an image size adjustment algorithm to obtain a plurality of second particle images corresponding to each of the plurality of gray images, wherein the second particle image is a gray image of a preset size.
[0150] In this way, by adjusting the particle image to a uniform size, the requirement of the convolutional neural network for the input image is met.
[0151] In addition, the embodiment of the present application also provides an imaging position determination device.
[0152] Please refer to Figure 6 , Figure 6 for the function module schematic diagram of an embodiment of the imaging position determination device of the present application, as shown in the figure, the imaging position determination device of the present application comprises: Figure 6
[0153] The image segmentation module 10 is configured to perform image segmentation processing on the first layer flow image to be recognized to obtain a plurality of first particle images.
[0154] The size adjusting module 20 is configured to adjust the size of each of the first particle images to a preset size, so as to obtain a second particle image corresponding to each of the first particle images.
[0155] The model calculating module 30 is configured to input each of the second particle images into a target convolutional neural network, so as to obtain a first category corresponding to each of the second particle images.
[0156] The relative position module 40 is configured to determine a relative position relationship between the first layer flow image and the focal point according to the first categories.
[0157] Optionally, the imaging position determination device further comprises:
[0158] The training data set module is configured to construct a training data set according to the morphological information and the blur information.
[0159] The model training module is configured to perform model training on an initial convolutional neural network pre-constructed according to the training data set, so as to obtain the target convolutional neural network.
[0160] Optionally, the training data set module comprises:
[0161] The second category module is configured to obtain a plurality of second layer flow images, and determine a second category corresponding to each of the second layer flow images according to the acquisition position of each of the second layer flow images.
[0162] The third particle image module is configured to perform image segmentation processing on each of the second layer flow images, so as to obtain a plurality of third particle images corresponding to each of the second layer flow images.
[0163] The fourth particle image module is configured to adjust the size of each of the third particle images to a preset size, so as to obtain a fourth particle image corresponding to each of the third particle images.
[0164] The training data set unit is configured to construct a training data set based on the morphological information and the blur information corresponding to each of the fourth particle images.
[0165] Optionally, the model training module comprises:
[0166] The model training unit is configured to perform model training on an initial convolutional neural network pre-constructed according to the training data set.
[0167] The loss value unit is configured to determine a loss value corresponding to each of a plurality of continuous model training based on a loss function, and detect a coefficient of variation corresponding to the loss values.
[0168] A coefficient of variation unit is configured to stop the model training when the coefficient of variation is less than a preset value, and obtain the target convolutional neural network.
[0169] Optionally, the imaging position determination device further comprises:
[0170] A training frequency detection module is configured to detect the model training frequency when the coefficient of variation is greater than or equal to a preset value.
[0171] A target convolutional neural network module is configured to stop the model training when the model training frequency is equal to a preset frequency, and obtain the target convolutional neural network.
[0172] Optionally, the size adjustment module 20 comprises:
[0173] A grayscale image unit is configured to extract grayscale information corresponding to each of the first particle images, and obtain grayscale images corresponding to each of the first particle images.
[0174] A second particle image unit is configured to perform algorithm processing on the grayscale images based on an image size adjustment algorithm, and obtain second particle images corresponding to each of the grayscale images.
[0175] Optionally, the relative position module 40 comprises:
[0176] A target category unit is configured to determine a target category of the first laminar image, wherein the target category is a first category with the largest quantity among the first categories.
[0177] A relative position unit is configured to determine a relative position relationship between the first laminar image and a focal point according to the target category.
[0178] The present application also provides a computer storage medium having an imaging position determination program stored thereon, wherein the imaging position determination program, when executed by a processor, implements the steps of the imaging position determination program method according to any one of the above embodiments.
[0179] The computer storage medium of the present application has substantially the same embodiments as the above imaging position determination program method of the present application, and thus will not be described here.
[0180] The present application also provides a computer program product, which comprises a computer program, wherein the computer program, when executed by a processor, implements the steps of the imaging position determination method according to any one of the above embodiments, and thus will not be described here.
[0181] It should be noted that, in this document, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element preceded by "comprises a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or system that comprises the element.
[0182] The above-mentioned embodiment numbers of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0183] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by means of software and the necessary general hardware platform, of course, they can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, an optical disk) as described above, and includes a number of instructions for making a terminal device (which can be a TWS earphone or the like) execute the methods described in the various embodiments of the present application.
[0184] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent flow transformation made by using the content of the specification and drawings, or directly or indirectly applied to other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. An imaging position determination method characterized by comprising: The imaging position determination method comprises: performing image segmentation processing on the first laminar flow image to be identified to obtain a plurality of first particle images; adjusting the size of each of the plurality of first particle images to a preset size to obtain a second particle image corresponding to each of the plurality of first particle images; inputting each of the plurality of second particle images into a target convolutional neural network to obtain a first category corresponding to each of the plurality of second particle images, wherein the first category represents the relative positional relationship between the second particle image and the focal point; determining a target category of the first laminar flow image, wherein the target category is the first category with the largest number in the plurality of first categories; determining the relative positional relationship between the position of the first laminar flow image and the position of the focal point according to the target category, wherein the position of the first laminar flow image refers to the position of the camera of the urinary sediment testing device when the camera captures the first laminar flow image, and the position of the focal point refers to the position of the camera of the urinary sediment testing device when the camera successfully focuses on the laminar flow image; The method further comprises: obtaining a plurality of second laminar flow images, performing image segmentation processing on each of the plurality of second laminar flow images to obtain a plurality of third particle images corresponding to each of the plurality of second laminar flow images; adjusting the size of each of the plurality of third particle images to a preset size to obtain a fourth particle image corresponding to each of the plurality of third particle images; constructing a training data set based on the morphological information and the blur information corresponding to each of the plurality of fourth particle images; training an initial convolutional neural network constructed in advance based on the training data set to obtain a target convolutional neural network.
2. The imaging position determination method according to Claim 1, wherein The step of training the initial convolutional neural network constructed in advance based on the training data set to obtain the target convolutional neural network comprises: training the initial convolutional neural network constructed in advance based on the training data set; determining a loss value corresponding to each of a plurality of continuous model training based on a loss function, and detecting a coefficient of variation corresponding to the plurality of loss values; stopping the model training when the coefficient of variation is less than a preset value, and obtaining the target convolutional neural network.
3. The imaging position determination method according to Claim 2, wherein After the step of detecting the coefficient of variation corresponding to the plurality of loss values, the method further comprises: detecting the number of model training when the coefficient of variation is greater than or equal to a preset value; stopping the model training when the number of model training is equal to a preset number, and obtaining the target convolutional neural network.
4. The imaging position determination method of claim 1, wherein The step of adjusting the size of each of the plurality of first particle images to a preset size to obtain a second particle image corresponding to each of the plurality of first particle images comprises: extracting the gray scale information corresponding to each of the plurality of first particle images to obtain a gray scale image corresponding to each of the plurality of first particle images; performing algorithm processing on each of the plurality of gray scale images based on an image size adjustment algorithm to obtain a second particle image corresponding to each of the plurality of gray scale images.
5. An imaging position determination apparatus characterized by comprising: The imaging position determination device comprises: an image segmentation module configured to perform image segmentation processing on a first laminar flow image to be identified to obtain a plurality of first particle images; The size adjustment module adjusts sizes of the first particle images to preset sizes respectively to obtain second particle images corresponding to the first particle images respectively; The model calculation module inputs the second particle images into a target convolutional neural network respectively to obtain first categories corresponding to the second particle images respectively, wherein the first categories represent relative position relationships between the second particle images and a focal point; The relative position module determines a target category of the first laminar flow image, wherein the target category is a first category with the largest quantity in the first categories; and determines a relative position relationship between a position of the first laminar flow image and a position of the focal point according to the target category, wherein the position of the first laminar flow image refers to a position of a camera of a urinary sediment testing device when the camera captures the first laminar flow image, and the position of the focal point refers to a position of the camera when a laminar flow image captured by the camera is successfully focused. The training data set module obtains second laminar flow images, performs image segmentation processing on the second laminar flow images respectively to obtain third particle images corresponding to the second laminar flow images respectively, adjusts sizes of the third particle images to preset sizes respectively to obtain fourth particle images corresponding to the third particle images respectively, and constructs a training data set based on morphological information and blur information corresponding to the fourth particle images. The model training module performs model training on an initial convolutional neural network pre-constructed according to the training data set to obtain a target convolutional neural network.
6. A terminal device, characterized by comprising: The terminal device includes a memory, a processor, and an imaging position determination program stored on the memory and executable on the processor, and the imaging position determination program, when executed by the processor, implements the steps of the imaging position determination method of any one of claims 1 to 4.
7. A computer readable storage medium characterized by The computer readable storage medium stores an imaging position determination program, and the imaging position determination program, when executed by the processor, implements the steps of the imaging position determination method of any one of claims 1 to 4.
Citation Information
Patent Citations
Image definition detection method, system and device and storage medium
CN111311543A