Method, device, equipment and medium for identifying the number of gestational sacs based on artificial intelligence
Through the artificial intelligence-based gestational sac detection method, the number of gestational sacs in animals is automatically identified, solving the problems of low artificial recognition rate and low efficiency in the prior art, and achieving high-precision and high-efficiency pregnancy examination.
Patent Information
- Application Number
- CN202011023124.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-25
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2040-09-25
AI Technical Summary
In the prior art, animal pregnancy examinations rely on manual identification of B-ultrasound pictures, which are limited by the brightness and resolution of the picture, resulting in low recognition rate and long time, increasing labor costs and reducing production efficiency.
Using artificial intelligence-based gestational sac detection method, the images to be detected in preset parts of livestock are collected and input into the pre-constructed gestational sac detection model, downsampling feature map processing, prediction parameter set, non-maximum value suppression and labeling, and automatically Identify the number of gestational sacs.
It improves the accuracy and efficiency of pregnancy test identification, reduces detection time, reduces labor costs, can conduct tests at earlier gestational age, and shortens pregnancy test time.
Smart Images

Figure CN112132064B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of breeding technology, and in particular to a method, device, computer equipment and storage medium for identifying the number of gestational sacs based on artificial intelligence. Background Art
[0002] In the field of livestock breeding, pregnancy testing of livestock is necessary to improve production efficiency.
[0003] Currently, animal pregnancy checks are performed manually by identifying and confirming the livestock's B-ultrasound images. However, since the brightness and resolution of the images produced by the B-ultrasound instrument are not high enough, the recognition rate of the human eye is limited. It requires inspectors to spend more time observing the images and accumulate a lot of experience. This will increase labor costs and reduce production efficiency for farms. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, computer equipment and storage medium for identifying the number of gestational sacs based on artificial intelligence to address the above technical problems.
[0005] A method for identifying the number of gestational sacs based on artificial intelligence, the method comprising:
[0006] Collect images of preset parts of livestock to be tested;
[0007] Inputting the image to be detected into a pre-constructed gestational sac detection model, so that the pre-constructed gestational sac detection model detects the gestational sac in the image to be detected and outputs a gestational sac detection result;
[0008] The number of gestational sacs of the livestock is determined according to the gestational sac detection result.
[0009] In one embodiment, the inputting the image to be detected into a pre-built gestational sac detection model so that the pre-built gestational sac detection model detects the gestational sac in the image to be detected and outputs a gestational sac detection result includes:
[0010] The image to be detected is input into the gestational sac detection model so that the gestational sac detection model downsamples the image to be detected through a preset network stride factor to obtain a downsampled feature map; the gestational sac is predicted for each unit in the downsampled feature map to obtain multiple sets of prediction parameter sets; according to the multiple sets of prediction parameter sets, the confidence that the gestational sac is included in the gestational sac detection area formed based on each unit in the downsampled feature map is calculated; based on non-maximum suppression processing of the confidence that the gestational sac is included in the gestational sac detection area, the confidence that the gestational sac is included in the gestational sac detection area is mapped to a probability value that the gestational sac is included in the gestational sac detection area; the gestational sac is labeled according to the size of the probability value, and the labeled gestational sac detection result is output.
[0011] In one embodiment, the method further comprises:
[0012] Obtaining the labeled gestational sac detection result output by the gestational sac detection model;
[0013] Determining the number of gestational sacs of the livestock according to the gestational sac detection result includes:
[0014] The number of gestational sacs of the livestock is calculated based on the number of annotations in the gestational sac detection result.
[0015] In one embodiment, the basic network in the gestational sac detection model is a mobilenet neural network.
[0016] In one embodiment, before collecting the image of the preset part of the livestock to be detected, the method further includes:
[0017] Get a sample image;
[0018] Acquire annotation information obtained by annotating the gestational sac included in the sample image;
[0019] The gestational sac detection model is constructed using the sample image and the annotation information.
[0020] In one embodiment, after acquiring the sample image, the method further includes:
[0021] Adjusting the saturation, exposure, hue and / or jitter of the sample image to obtain an adjusted sample image;
[0022] The using the sample image and the annotation information to construct the gestational sac detection model includes:
[0023] The gestational sac detection model is constructed using the adjusted sample image and the annotation information.
[0024] In one embodiment, the image to be detected also includes an identification mark of the livestock; after determining the number of gestational sacs of the livestock according to the gestational sac detection result, the method further includes:
[0025] Determining whether the number of gestational sacs is lower than a reference threshold;
[0026] If so, identification information of the livestock whose number of gestational sacs is lower than a reference threshold is generated according to the identity identifier and sent to the breeding monitoring terminal.
[0027] In one embodiment, the method further comprises:
[0028] The reference threshold is set according to the historical statistical data of the number of births of livestock on the breeding monitoring end.
[0029] A device for identifying the number of gestational sacs based on artificial intelligence, the device comprising:
[0030] An image acquisition module, used for acquiring images of preset parts of livestock to be detected;
[0031] A gestational sac detection module, used for inputting the image to be detected into a pre-constructed gestational sac detection model, so that the pre-constructed gestational sac detection model detects the gestational sac in the image to be detected and outputs a gestational sac detection result;
[0032] The gestational sac quantity determination module is used to determine the quantity of the gestational sac of the livestock according to the gestational sac detection result.
[0033] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method for identifying the number of gestational sacs based on artificial intelligence as described above are implemented.
[0034] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for identifying the number of gestational sacs based on artificial intelligence as described above.
[0035] The above-mentioned method, device, computer equipment and storage medium for identifying the number of gestational sacs based on artificial intelligence collect images to be detected of preset parts of livestock; input the images to be detected into a pre-constructed gestational sac detection model, so that the pre-constructed gestational sac detection model detects the gestational sac in the images to be detected and outputs the gestational sac detection results; and determines the number of gestational sacs of livestock according to the gestational sac detection results. This method realizes automatic recognition and detection of the images to be detected by establishing a gestational sac detection model, and finally obtains the number of gestational sacs of livestock. Compared with human eye recognition, this method reduces the detection time of each image to be detected, improves recognition accuracy, and improves pregnancy detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 This is a diagram of an application environment of a method for identifying the number of gestational sacs based on artificial intelligence in one embodiment;
[0037] Figure 2 It is a flowchart of a method for identifying the number of gestational sacs based on artificial intelligence in one embodiment;
[0038] Figure 3 A schematic diagram of a flow chart of a gestational sac detection step in an embodiment;
[0039] Figure 4 is a structural block diagram of a device for identifying the number of gestational sacs based on artificial intelligence in one embodiment;
[0040] Figure 5 is an internal structure diagram of a computer device in one embodiment;
[0041] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] The method for identifying the number of gestational sacs based on artificial intelligence provided in this application can be applied to Figure 1 In the application environment shown, the terminal 101 communicates with the server 102 through the network. The terminal 101 is an image acquisition device with a camera device, which can be but not limited to various B-ultrasound detectors, color ultrasound detectors, and devices capable of performing pregnancy tests. The server 102 can be implemented by an independent server or a server cluster consisting of multiple servers.
[0044] In one embodiment, Figure 2 As shown, a method for identifying the number of gestational sacs based on artificial intelligence is provided, and the method is applied to Figure 1 Taking the server 102 in the example as an example, the following steps are included:
[0045] Step S201, collecting an image of a preset part of a livestock to be detected.
[0046] The livestock is livestock in a farm, such as pigs, cattle, sheep, rabbits, etc. For simplicity, the following embodiments are described using pigs as an example. The preset part refers to the part corresponding to the uterus of the livestock and the tissues nearby. For example, for a sow, the preset part refers to the hairless triangle connecting the abdomen and hind legs of the sow.
[0047] Specifically, the server 102 obtains the image to be detected sent from the terminal 101. Taking the sow as an example, after obtaining a clear image of the gestational sac in the hairless triangle area connecting the sow's abdomen and hind legs, the terminal 101, which can be a B-ultrasound detector, collects the image of the sow's gestational sac as the image to be detected.
[0048] Step S202: input the image to be detected into a pre-constructed gestational sac detection model, so that the pre-constructed gestational sac detection model detects the gestational sac in the image to be detected and outputs a gestational sac detection result.
[0049] The gestational sac is the initial form of pregnancy. The pre-built gestational sac detection model is an image recognition detection model obtained by pre-training parameters based on a certain algorithm combined with the gestational sac form of a certain type of livestock.
[0050] Specifically, the server 102 inputs the above-mentioned image to be detected into a pre-built gestational sac detection model, and the pre-built gestational sac detection model automatically detects the above-mentioned image to be detected, identifies the gestational sac, and marks all gestational sacs on the image to be detected, and outputs the image with the gestational sac marking as the gestational sac detection result.
[0051] Step S203, determining the number of gestational sacs of the livestock according to the gestational sac detection result.
[0052] Specifically, the server 102 calculates the number of marked gestational sacs on each image in the gestational sac detection result as the number of gestational sacs of the livestock.
[0053] In the above embodiment, a gestational sac detection model is established to realize automatic recognition and detection of images to be detected, and finally the number of gestational sacs of livestock is obtained. Compared with human eye recognition, the detection time of each image to be detected is reduced, the recognition accuracy is improved, and the efficiency of pregnancy detection is improved. Taking pigs as an example, human eye observation of B-ultrasound for pregnancy detection can basically only be performed on gestational age of more than 28 days. The AI algorithm can not only reduce the detectable gestational age, but also shorten the pregnancy detection time to seconds.
[0054] In one embodiment, Figure 3 As shown, in step S202, the image to be detected is input into a pre-built gestational sac detection model, so that the pre-built gestational sac detection model detects the gestational sac in the image to be detected and outputs the gestational sac detection result, which specifically includes:
[0055] Step S301: input the image to be detected into the gestational sac detection model, so that the gestational sac detection model downsamples the image to be detected through a preset network stride factor to obtain a downsampled feature map.
[0056] Specifically, the gestational sac detection model is a model pre-built based on the YOLO V3 algorithm, where YOLO is the abbreviation of You Only Look Once, which is a target detector that uses features learned by a deep convolutional neural network to detect objects contained in an image. The YOLO V3 version of the algorithm is used in this embodiment.
[0057] First, the gestational sac detection model performs dimensionality reduction processing on the image to be detected, and downsamples the image by the network stride factor. For example, if the network stride factor is set to 32, the image to be detected with a size of 416×416 (that is, the image is divided into 416×416 units) will be reduced in dimension into a downsampled feature map with a size of 13×13 (416 is a multiple of 32).
[0058] Step S302: The gestational sac detection model predicts the gestational sac for each unit in the downsampled feature map to obtain multiple sets of prediction parameter sets.
[0059] Specifically, for the downsampled feature graph that has been processed by dimensionality reduction, predict whether each unit contains a gestational sac, that is, calculate the conditional class probability Pr (Class i |Object), conditional class probability Pr(Class i |Object) represents the probability that a cell belongs to the i-th class Class, provided that the cell contains a target Object. In this embodiment, for example, there are 13×13 cells in the downsampled feature map with a size of 13×13. The conditional class probability Pr (Class i |Object), where the categories can be, for example, different categories of target images such as gestational sac and tissues and organs around the uterus, i represents the number of categories, and for each unit, the conditional category probabilities of different categories are predicted, such as the conditional category probabilities of containing gestational sac and the conditional category probabilities of containing uterus, as a set of prediction parameter sets for the unit, and the set of prediction parameter sets also includes the position parameters of each unit, including the center coordinates, the length and width of the unit, and other parameters. The prediction parameter sets of all units are calculated to obtain multiple sets of prediction parameter sets.
[0060] Step S303: The gestational sac detection model calculates the confidence that the gestational sac is contained in the gestational sac detection area formed by each unit in the downsampled feature map according to the multiple sets of prediction parameter sets.
[0061] The gestational sac detection area is a preset bounding box, and each cell corresponds to one or more bounding boxes. For example, in a gestational sac detection model based on YOLO V3, each cell can be set to correspond to three different bounding boxes. Optionally, the three different bounding boxes can be set to three different axis-aligned bounding boxes. In this step, for each bounding box, since each bounding box contains multiple different cells, the conditional class probability Pr (Class i |Object) to calculate the confidence that each bounding box contains a gestational sac.
[0062] Optionally, the confidence that each of the above-mentioned bounding boxes contains a gestational sac may also be compressed using a sigmoid function to facilitate the next step of numerical processing.
[0063] Step S304: the gestational sac detection model performs non-maximum suppression processing on the confidence that the gestational sac is contained in the gestational sac detection area, and maps the confidence that the gestational sac is contained in the gestational sac detection area to a probability value that the gestational sac is contained in the gestational sac detection area.
[0064] Among them, non-maximum suppression (NMS) is to suppress elements that are not maximum values. Specifically, non-maximum suppression is performed on the confidence that each of the above bounding boxes contains a gestational sac, the purpose is to remove redundant bounding boxes, and the probability value of the gestational sac being contained in the gestational sac detection area is calculated based on the result after non-maximum suppression.
[0065] Step S305: The gestational sac detection model marks the gestational sac according to the size of the above probability value, and outputs the marked gestational sac detection result.
[0066] Specifically, the above probability values are sorted according to their sizes, the probability values below the preset threshold are removed according to the preset threshold, and the gestational sac is marked on the image to be detected according to the remaining probability values to obtain a gestational sac detection result with an annotation. The gestational sac detection result is an image with a gestational sac annotation, wherein the gestational sac annotation corresponds one-to-one to different gestational sacs. For example, if there are 3 gestational sacs in the image, the gestational sac detection result carries 3 gestational sac annotations.
[0067] In the above embodiment, the gestational sac detection model pre-constructed based on the YOLO V3 target detection algorithm performs dimensionality reduction processing, gestational sac prediction, non-maximum suppression processing, and gestational sac labeling on the image to be detected to obtain a labeled gestational sac detection result. Since the YOLO V3 target detection algorithm performs prediction by setting multiple bounding boxes, it has the characteristics of fast speed and high accuracy, and can realize rapid detection of the number of gestational sacs in the image to be detected, saving labor costs and improving the efficiency of pregnancy detection.
[0068] In one embodiment, the method further includes: obtaining a gestational sac detection result with annotations output by the gestational sac detection model;
[0069] Accordingly, the above step S203 includes: calculating the number of gestational sacs of the livestock according to the number of annotations in the gestational sac detection result.
[0070] Specifically, after the server 102 obtains the annotated gestational sac detection result output by the gestational sac detection model, that is, the annotated gestational sac detection image, the number of gestational sacs of the livestock is calculated according to the number of annotations on the gestational sac detection image. For example, if there are 3 annotations, the number of gestational sacs of the livestock is calculated to be 3.
[0071] In the above embodiment, the number of gestational sacs is obtained by calculating the gestational sac detection image with gestational sac annotation output by the gestational sac detection model, thereby avoiding manual calculation and further improving the efficiency of pregnancy detection.
[0072] In one embodiment, the basic network in the above gestational sac detection model is a mobilenet neural network algorithm.
[0073] Specifically, since the above-mentioned gestational sac detection model is a detection model generated based on the YOLO V3 algorithm, the network structure is mainly divided into two parts. The first part is the basic network (backbone), which generally uses the darknet53 deep convolutional neural network, corresponding to the above-mentioned steps S301 to S304. The second part is the upsampling output layer, which mainly upsamples the detection results output by the darknet53 deep convolutional neural network and restores and enlarges the image. For example, in the above-mentioned embodiment, the downsampled feature map with a size of 13×13 is subjected to target detection and then upsampled and output to obtain a gestational sac detection result with a size of 416×416 with annotations. In this embodiment, the above-mentioned basic network (backbone) can use the mobilenet neural network algorithm. Mobilenet is a mobile terminal model proposed by Google. Its basic unit is depthwise separable convolution. The use of the mobilenet neural network algorithm can save most of the convolution parameters.
[0074] The above embodiment, by using the mobilenet neural network algorithm in the basic network, can not only reduce the complexity of model calculation, but also greatly reduce the model size and speed up the calculation. It is also suitable for devices with limited resources such as embedded devices. The method for identifying the number of gestational sacs based on artificial intelligence in this application can be applied to mobile terminals.
[0075] In one embodiment, before step S201, the method further includes: obtaining a sample image; obtaining annotation information obtained by annotating the gestational sac contained in the sample image; and constructing a gestational sac detection model using the sample image and the annotation information.
[0076] Specifically, gestational sac images of livestock such as sows are collected by image acquisition equipment such as a B-ultrasound detector as sample images; the gestational sac is manually or machine labeled on the B-ultrasound images to obtain sample images with labeled information, and the sample images with labeled information are input as training images into the YOLO V3 algorithm model or the mobilenet algorithm model for parameter adjustment training to obtain a trained gestational sac detection model.
[0077] In the above embodiment, the YOLO V3 algorithm model or the mobilenet algorithm model is trained by using sample images to obtain a gestational sac detection model with convergence of training, which provides a basic network model for subsequent gestational sac detection. On the other hand, in the existing B-ultrasound detection process, the detection site is easily affected by the bladder and other organs around the uterus. The gestational sac detection model trained by annotated data can improve the discrimination accuracy.
[0078] In one embodiment, after obtaining the sample image in the above steps, the steps further include: adjusting the saturation, exposure, hue and / or jitter of the sample image to obtain an adjusted sample image; the steps of using the sample image and the annotation information to construct a gestational sac detection model include: constructing a gestational sac detection model using the adjusted sample image and the annotation information.
[0079] Specifically, during the training process, after obtaining the sample image, the sample image can also be processed by one or more steps of saturation, exposure, hue, and jitter adjustment to obtain an adjusted sample image, and the adjusted sample image is used to mark the gestational sac. The image is then used to train the YOLO V3 algorithm model or the mobilenet algorithm model to obtain a gestational sac detection model that has converged in training.
[0080] Optionally, the image to be detected in step S201 may be subjected to the above-mentioned saturation, exposure, hue and / or jitter adjustment, and a subsequent gestational sac detection may be performed on the adjusted image to be detected.
[0081] In the above embodiment, by preprocessing the sample image and then performing gestational sac labeling and training, more accurate gestational sac detection model parameters can be obtained, thereby improving the accuracy of subsequent gestational sac identification and detection.
[0082] In one embodiment, the image to be detected also includes the identity of the livestock; after the above step S203, it also includes: judging whether the number of gestational sacs is lower than a reference threshold; if so, generating identification information of the livestock whose number of gestational sacs is lower than the reference threshold according to the identity and sending it to the breeding monitoring terminal.
[0083] Specifically, each livestock has a unique radio frequency identification code, which represents the identity of the livestock. The above-mentioned image to be detected also carries the identity of the livestock. After the number of gestational sacs of the livestock is calculated, the number of gestational sacs of the livestock is saved in the breeding system database, and a reference threshold is set, such as 4. The identity information of the sow corresponding to the image with a gestational sac below the reference threshold, such as less than 4, is sent to the breeding monitoring end, such as the terminal device of the relevant breeding personnel, so that the breeding personnel can consider whether to terminate the pregnancy to ensure the profitability of each pregnancy of the sow.
[0084] Optionally, a reference threshold may be set, and identification information of livestock above the reference threshold may be sent to a breeding monitoring terminal, so that breeding personnel can adjust subsequent livestock feeding strategies according to the current number of pregnancies of the livestock to achieve precise feeding.
[0085] In the above embodiment, by setting a reference threshold and sending identification information of livestock below the reference threshold to the breeding monitoring terminal, breeding personnel can understand the pregnancy status of livestock as soon as possible and make corresponding breeding strategies.
[0086] In one embodiment, the above method further includes: setting a reference threshold value based on historical statistical data on the number of livestock births from a breeding monitoring terminal.
[0087] Specifically, the server 102 may set a reference threshold value of, for example, 4 based on historical statistical data on the number of livestock births in the breeding farm, to ensure that the profit of each livestock pregnancy is maximized.
[0088] In the above embodiment, the server collects statistics on the historical production data of the breeding farm to set the reference threshold, thereby providing reference data for maximizing the output value of the breeding farm.
[0089] It should be understood that although Figure 1-3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-3At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0090] In one embodiment, Figure 4 As shown, a device 400 for identifying the number of gestational sacs based on artificial intelligence is provided, comprising: an image acquisition module 401, a gestational sac detection module 402 and a gestational sac number determination module 403, wherein:
[0091] An image acquisition module 401 is used to acquire an image of a preset part of the livestock to be detected;
[0092] The gestational sac detection module 402 is used to input the image to be detected into a pre-constructed gestational sac detection model, so that the pre-constructed gestational sac detection model detects the gestational sac in the image to be detected and outputs a gestational sac detection result;
[0093] The gestational sac quantity determination module 403 is used to determine the quantity of the gestational sac of the livestock according to the gestational sac detection result.
[0094] In one embodiment, the gestational sac detection module 402 is further used to:
[0095] The image to be detected is input into the gestational sac detection model so that the gestational sac detection model downsamples the image to be detected through a preset network stride factor to obtain a downsampled feature map; the gestational sac is predicted for each unit in the downsampled feature map to obtain multiple sets of prediction parameter sets; according to the multiple sets of prediction parameter sets, the confidence that the gestational sac is included in the gestational sac detection area formed based on each unit in the downsampled feature map is calculated; based on non-maximum suppression processing of the confidence that the gestational sac is included in the gestational sac detection area, the confidence that the gestational sac is included in the gestational sac detection area is mapped to a probability value that the gestational sac is included in the gestational sac detection area; the gestational sac is labeled according to the size of the probability value, and the labeled gestational sac detection result is output.
[0096] In one embodiment, the above-mentioned device 400 may also include: a detection result acquisition module, used to obtain the labeled gestational sac detection result output by the gestational sac detection model; a gestational sac quantity determination module 403, further used to calculate the number of gestational sacs of the livestock according to the number of the annotations in the gestational sac detection result.
[0097] In one embodiment, the basic network in the gestational sac detection model is a mobilenet neural network.
[0098] In one embodiment, the above-mentioned device 400 may also include: a model construction module, used to obtain a sample image; obtain annotation information obtained by annotating the gestational sac contained in the sample image; and use the sample image and the annotation information to construct the gestational sac detection model.
[0099] In one embodiment, the above-mentioned model construction module is also used to: after acquiring the sample image, adjust the saturation, exposure, hue and / or jitter of the sample image to obtain an adjusted sample image; the model construction module is further used to use the adjusted sample image and the annotation information to construct the gestational sac detection model.
[0100] In one implementation, the image to be detected also includes the identity of the livestock; the gestational sac quantity determination module 403 is also used for:
[0101] Determining whether the number of gestational sacs is lower than a reference threshold;
[0102] If so, identification information of the livestock whose number of gestational sacs is lower than a reference threshold is generated according to the identity identifier and sent to the breeding monitoring terminal.
[0103] In one embodiment, the gestational sac quantity determination module 403 is further used to: set the reference threshold value according to the historical statistical data of the number of livestock births by the breeding monitoring terminal.
[0104] For the specific definition of the device for identifying the number of gestational sacs based on artificial intelligence, please refer to the definition of the method for identifying the number of gestational sacs based on artificial intelligence above, which will not be repeated here. Each module in the above-mentioned device for identifying the number of gestational sacs based on artificial intelligence can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0105] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data on the number of gestational sacs of livestock. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for identifying the number of gestational sacs based on artificial intelligence is implemented.
[0106] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for identifying the number of gestational sacs based on artificial intelligence is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0107] Those skilled in the art will understand that Figure 5-6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0108] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0109] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0110] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0111] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0112] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for identifying the number of gestational sacs based on artificial intelligence, characterized in that: The method comprises: Collect images of preset parts of livestock to be tested; Inputting the image to be detected into a pre-constructed gestational sac detection model so that the pre-constructed gestational sac detection model detects the gestational sac in the image to be detected and outputs a gestational sac detection result, including: inputting the image to be detected into the gestational sac detection model so that the gestational sac detection model downsamples the image to be detected by a preset network stride factor to obtain a downsampled feature map; for each unit in the downsampled feature map, determining the conditional category probability that each unit contains each category, and using the conditional category probability that each unit contains each category as a set of prediction parameter sets for the unit; wherein the categories include gestational sac and tissue organs around the uterus; Inputting the image to be detected into a pre-constructed gestational sac detection model so that the pre-constructed gestational sac detection model detects the gestational sac in the image to be detected and outputs a gestational sac detection result, further comprising: calculating, based on multiple sets of prediction parameter sets, the confidence that the gestational sac is contained in the gestational sac detection area formed based on each unit in the down-sampled feature map; mapping the confidence that the gestational sac is contained in the gestational sac detection area to a probability value that the gestational sac is contained in the gestational sac detection area based on non-maximum suppression processing; annotating the gestational sac according to the size of the probability value, and outputting annotated gestational sac detection results; wherein the gestational sac detection area is a preset bounding box, each of the units corresponds to one or more bounding boxes, and each of the bounding boxes contains multiple different units; for each bounding box, the confidence of the gestational sac corresponding to the bounding box is determined according to the conditional category probability that each unit corresponding to the bounding box contains each category; The number of gestational sacs of the livestock is determined according to the gestational sac detection result.
2. The method according to claim 1, characterized in that The method further comprises: Obtaining the labeled gestational sac detection result output by the gestational sac detection model; Determining the number of gestational sacs of the livestock according to the gestational sac detection result includes: The number of gestational sacs of the livestock is calculated based on the number of annotations in the gestational sac detection result.
3. The method according to claim 1, characterized in that The basic network in the gestational sac detection model is a mobilenet neural network.
4. The method according to claim 1, characterized in that: Before collecting the image to be detected of the preset part of the livestock, the method further includes: Get a sample image; Acquire annotation information obtained by annotating the gestational sac included in the sample image; The gestational sac detection model is constructed using the sample image and the annotation information.
5. The method according to claim 4, characterized in that After obtaining the sample image, the method further includes: Adjusting the saturation, exposure, hue and / or jitter of the sample image to obtain an adjusted sample image; The using the sample image and the annotation information to construct the gestational sac detection model includes: The gestational sac detection model is constructed using the adjusted sample image and the annotation information.
6. The method according to any one of claims 1 to 5, characterized in that: The image to be detected also includes the identity mark of the livestock; after determining the number of gestational sacs of the livestock according to the gestational sac detection result, the method further includes: Determining whether the number of gestational sacs is lower than a reference threshold; If so, identification information of the livestock whose number of gestational sacs is lower than a reference threshold is generated according to the identity identifier and sent to the breeding monitoring terminal.
7. The method according to claim 6, characterized in that The method further comprises: The reference threshold is set according to the historical statistical data of the number of births of livestock on the breeding monitoring end.
8. A device for identifying the number of gestational sacs based on artificial intelligence, characterized in that: The device comprises: An image acquisition module, used for acquiring images of preset parts of livestock to be detected; The gestational sac detection module is used to input the image to be detected into a pre-built gestational sac detection model so that the pre-built gestational sac detection model detects the gestational sac in the image to be detected and outputs the gestational sac detection result, including: inputting the image to be detected into the gestational sac detection model so that the gestational sac detection model downsamples the image to be detected by a preset network stride factor to obtain a downsampled feature map; for each unit in the downsampled feature map, determining the conditional category probability that each unit contains each category, and using the conditional category probability that each unit contains each category as a set of prediction parameters for the unit; wherein the categories include gestational sac and tissues and organs around the uterus; The gestational sac detection module is further used to calculate, based on multiple sets of prediction parameter sets, the confidence that the gestational sac is contained in the gestational sac detection area formed by each unit in the downsampled feature map; based on non-maximum suppression processing of the confidence that the gestational sac is contained in the gestational sac detection area, map the confidence that the gestational sac is contained in the gestational sac detection area to a probability value that the gestational sac is contained in the gestational sac detection area; mark the gestational sac according to the size of the probability value, and output the marked gestational sac detection result; wherein the gestational sac detection area is a preset bounding box, each of the units corresponds to one or more bounding boxes, and each of the bounding boxes contains multiple different units; for each bounding box, the confidence of the gestational sac corresponding to the bounding box is determined according to the conditional category probability that each unit corresponding to the bounding box contains each category; The gestational sac quantity determination module is used to determine the quantity of the gestational sac of the livestock according to the gestational sac detection result.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method for identifying concrete cracks based on yolov3 deep learning model
AU2020101011A4
Method and device for identifying gestational sac tissue, and uterine cavity suction device
CN104899891A
Ovary and / or follicle automatic measurement method based on two-dimensional image
CN110693529A
Transverse process and spinous process detecting and positioning method based on target detection and clustering
CN111563880A
Three-dimensional ultrasonic abdominal hernia patch detection method and system based on deep learning
CN111626986A
