A method and system for managing pig body condition based on computer vision scoring

Based on computer visual scores, the image and basic description of text assessment of pigs were used to solve the problem of low artificial evaluation accuracy and low efficiency in existing technologies, and realized more scientific and objective pig screening and management.

CN118968564BActive Publication Date: 2025-01-24SICHUAN ACADEMY OF AGRICULTURAL MACHINERY SCIENCES +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411441826.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-01-24
Estimated Expiration
2044-10-16

AI Technical Summary

Technical Problem

The existing pig farms use manual measurement, recording and analysis to evaluate the pig body condition, with limited accuracy, low efficiency, and subjectivity and labor intensity.

Method used

Based on computer visual scores, the image group and basic description text of the pigs are obtained, and the body type information and hair scores are extracted. The binding body score and hair scoring determine the target pig farming from the preliminary pig collection.

Benefits of technology

It achieves accurate and convenient screening of pig body condition, reduces the labor intensity of manual measurement and analysis, and improves the scientificity and objectivity of assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118968564B_ABST
    Figure CN118968564B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for managing the physical condition of live pigs based on computer vision scoring, the method comprising: obtaining an image group and a first basic description text of each live pig to be evaluated; screening a preliminary set of breeding pigs from all the live pigs to be evaluated based on the first basic description text of each live pig to be evaluated; extracting a hip image containing only the hip in the first image based on the image group, and calculating the body shape information of each live pig to be evaluated, and calculating the body shape score according to the body shape information; inputting the hip image into a preset hair scoring model to obtain a hair score; determining a target breeding pig from the preliminary set of breeding pigs in combination with the body shape score and the hair score, so as to help breeders breed the target breeding pigs. The present invention provides an accurate and convenient method for screening breeding pigs by real-time shooting, processing and analyzing images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of breeding technology, and in particular to a method and system for managing pig body condition based on computer vision scoring. Background Art

[0002] The physical condition assessment of breeding pigs is a crucial part of pig farm management. It involves a comprehensive evaluation of multiple aspects of breeding pigs to ensure that the selected breeding pigs have excellent genetic quality and production performance. Currently, most pig farms use manual measurement, recording and analysis methods to assess the physical condition of pigs. Manual measurement methods have limited accuracy, cumbersome recording, difficult to accurately analyze and judge, and are time-consuming, labor-intensive, and inefficient. Summary of the invention

[0003] The purpose of the present invention is to provide a method and system for managing pig body condition based on computer vision scoring to improve the above-mentioned problems.

[0004] In order to achieve the above objectives, the present application provides the following technical solutions:

[0005] On the one hand, the embodiment of the present application provides a method for managing pig body condition based on computer vision scoring, the method comprising:

[0006] Obtain an image group and a first basic description text of each live pig to be evaluated, wherein the image group includes a first image and a second image, wherein the first image and the second image are images of the same live pig to be evaluated, respectively collected at a current moment and a previous moment, containing hip and environmental information; the first basic description text includes weight information, breeding time information, live back fat thickness information, and eye muscle area information;

[0007] Based on the first basic description text of each pig to be evaluated, a preliminary set of breeding pigs is selected from all the pigs to be evaluated; based on the image group, a buttocks image containing only the buttocks is extracted from the first image, and the body shape information of each pig to be evaluated is calculated, and the body shape score is calculated according to the body shape information; the buttocks image is input into a preset hair scoring model to obtain a hair score;

[0008] The target breeding pigs are determined from the preliminary breeding pig set in combination with the body shape score and the hair score, so as to help breeders to breed the target breeding pigs.

[0009] In a second aspect, an embodiment of the present application provides a pig body condition management system based on computer vision scoring, the system comprising:

[0010] An acquisition module is used to acquire an image group and a first basic description text of each live pig to be evaluated, wherein the image group includes a first image and a second image, wherein the first image and the second image are images of the same live pig to be evaluated, respectively collected at a current moment and a previous moment, containing hip and environmental information; the first basic description text includes weight information, breeding time information, live back fat thickness information, and eye muscle area information;

[0011] A first calculation module is used to select a preliminary set of breeding pigs from all the pigs to be evaluated based on the first basic description text of each pig to be evaluated; extract the buttocks image that only contains the buttocks in the first image based on the image group, and calculate the body shape information of each pig to be evaluated, and calculate the body shape score according to the body shape information; input the buttocks image into a preset hair scoring model to obtain a hair score;

[0012] The second calculation module is used to determine the target breeding pigs from the preliminary breeding pig set in combination with the body shape score and the hair score, so as to help breeders to breed the target breeding pigs.

[0013] In a third aspect, the embodiment of the present application provides a pig body condition management device based on computer vision scoring, the device comprising a memory and a processor. The memory is used to store a computer program; the processor is used to implement the steps of the above-mentioned pig body condition management method based on computer vision scoring when executing the computer program.

[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned method for managing the physical condition of pigs based on computer vision scoring are implemented.

[0015] The beneficial effects of the present invention are:

[0016] The present invention provides an accurate and convenient method for the screening of breeding pigs by real-time shooting, processing and analyzing images.

[0017] The present invention first collects the basic description text of each pig, and performs a preliminary screening of all the pigs according to the basic description text. In the screening process, two screening methods are used, which can screen out better breeding pigs compared with a single screening method; after screening out the preliminary breeding pigs, the collected images are analyzed, and the body shape score and hair score of the pigs are calculated through the images, and finally the target breeding pigs are determined in the preliminary breeding pig set based on the body shape score and hair score; the present invention adopts information management to reduce the labor intensity of manual measurement, analysis, recording, and judgment. And it greatly reduces the subjectivity of manual judgment on breeding pig screening due to various factors such as personal technology, experience, mental state, and cognitive bias, so that the screening results are more scientific, objective, and stable.

[0018] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or be understood by implementing the embodiments of the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 It is a schematic flow chart of a pig body condition management method based on computer vision scoring described in an embodiment of the present invention;

[0021] Figure 2 It is a schematic diagram of the structure of a pig body condition management system based on computer vision scoring described in an embodiment of the present invention;

[0022] Figure 3 It is a schematic diagram of the structure of the pig body condition management equipment based on computer vision scoring described in an embodiment of the present invention. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0024] It should be noted that similar reference numerals or letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0025] Example 1

[0026] like Figure 1 As shown, this embodiment provides a method for managing pig physical condition based on computer vision scoring, which includes step S1, step S2 and step S3.

[0027] Step S1, obtaining an image group and a first basic description text of each pig to be evaluated, wherein the image group includes a first image and a second image, and the first image and the second image are images of the same pig to be evaluated, respectively collected at a current moment and a previous moment, containing hip and environmental information; the first basic description text includes weight information, breeding time information, live back fat thickness information, and eye muscle area information;

[0028] In this step, in addition to the pig buttocks image, the first image and the second image also include other environmental information, such as a pig house. The first image and the second image can be understood as including the pig buttocks image and the pig house image; the first image and the second image can be collected by a camera behind the pig, and the time length between the current moment and the previous moment can be customized, for example, it can be 1 second. If the current moment is 12:30:11, then the previous moment can be 12:30:10; at the same time, the information included in the first basic description text is uploaded by the breeder, and the breeding time information can be understood as, for example, breeding for half a year, breeding for one year; the first basic description text can be, for example: weight information is **, breeding time information is **, live back fat thickness information is **, eye muscle area information is **, where Chinese characters are used for description instead of Arabic numerals;

[0029] Step S2, based on the first basic description text of each pig to be evaluated, a preliminary set of breeding pigs is selected from all the pigs to be evaluated; based on the image group, a hip image containing only the hips in the first image is extracted, and the body shape information of each pig to be evaluated is calculated, and the body shape score is calculated according to the body shape information; the hip image is input into a preset hair scoring model to obtain a hair score;

[0030] In this step, firstly, a preliminary set of breeding pigs is selected from all the pigs to be evaluated according to the first basic description text of the pigs to be evaluated. The specific implementation steps include step S21;

[0031] Step S21, obtaining the second basic description text of historical breeding pigs; clustering the first basic description texts of all the pigs to be evaluated to obtain multiple clustering clusters, selecting a part of the first basic description texts from each clustering cluster to train the multi-classification model, and obtaining the trained multi-classification model; obtaining a first preliminary breeding pig set based on the trained multi-classification model and all the second basic description texts, and calculating the similarity between each first basic description text and each second basic description text, and obtaining a second preliminary breeding pig set based on the similarity calculation results, and collecting the pigs to be evaluated that exist in both the first preliminary breeding pig set and the second preliminary breeding pig set to obtain a preliminary breeding pig set.

[0032] In this step, a large number of second basic description texts of historical breeding pigs are obtained; when clustering, the Kmeans algorithm can be used for clustering processing; in addition, in this step, two breeding pig screening methods are adopted. Compared with one breeding pig screening method, the screening method in this step can make the screened breeding pigs more objective and stable.

[0033] Meanwhile, in this step, a part of the first basic description text is selected from each cluster to train the multi-classification model, and the specific implementation steps of obtaining the trained multi-classification model include step S211;

[0034] Step S211, assign different symbols to each cluster, and count the number of first basic description texts contained in each cluster, which is recorded as the first value; analyze whether the differences between the first values ​​corresponding to any two clusters are less than a preset threshold. If they are, extract the same proportion of first basic description texts from each cluster and record them as training samples. Otherwise, extract the same number of first basic description texts from each cluster and record them as training samples; label the training samples, and the labeling information of each training sample is the symbol corresponding to each training sample. Use the labeled training samples to train the multi-classification model to obtain a trained multi-classification model.

[0035] In this step, if after clustering, 5 clusters are obtained, namely the first cluster, the second cluster, the third cluster, the fourth cluster, and the fifth cluster; a different symbol is assigned to each cluster, and the symbols corresponding to the first cluster, the second cluster, the third cluster, the fourth cluster, and the fifth cluster can be 1, 2, 3, 4, and 5 respectively; the preset threshold can be customized, and if it is less than the preset threshold, it means that the number of first basic description texts contained in the two clusters is not much different, then the number of first basic description texts obtained by extracting the same proportion of first basic description texts is also not much different, and the number of training samples in each category is relatively uniform; if it is greater than or equal to, it proves that the number of first basic description texts contained in the two clusters is quite different. If the number of training samples of each category is large, then extracting the same number of first basic description texts can also ensure that the number of training samples of each category is relatively uniform. This training sample selection method can ensure the uniform balance of the number of samples of each category. When labeling, the labeling information of each training sample is the symbol corresponding to each training sample, which can be understood as follows: if a training sample belongs to the first cluster, the symbol of the first cluster is 1, then the labeling information of this training sample is 1. In addition, during training, the xgboost model can be trained to obtain a trained multi-classification model. More specifically, the word frequency-inverse file frequency algorithm can be used to extract the feature vector of each training sample, and then the feature vector can be used to train the xgboost algorithm to obtain a trained multi-classification model.

[0036] Meanwhile, in step S21, based on the trained multi-classification model and all the second basic description texts, a first preliminary set of sows is obtained, and similarity calculation is performed between each first basic description text and each second basic description text respectively, and specific implementation steps of obtaining the second preliminary set of sows based on the similarity calculation results include steps S212 and S213;

[0037] Step S212, using the trained multi-classification model to classify all the second basic description texts, obtain the symbol corresponding to each second basic description text, count the number of second basic description texts corresponding to each symbol, record the symbol corresponding to the maximum number as the target symbol, record the first basic description text belonging to the target symbol in all the first basic description texts as the target basic description text, collect the pigs to be evaluated corresponding to each target basic description text to obtain the first preliminary breeding pig set, count the number of pigs in the first preliminary breeding pig set and record it as the second value L; calculate the similarity between each first basic description text and each second basic description text, wherein the similarity calculation formula is: , H represents the similarity between each first basic description text and each second basic description text, M represents the number of repeated words between each first basic description text and each second basic description text, and G represents the total number of words in each second basic description text. Represents the logarithm base and is greater than 1;

[0038] In this step, the first basic description texts belonging to the target symbol in all the first basic description texts are recorded as the target basic description texts. It can be understood that if the target symbol is 3, then in the step of "clustering all the first basic description texts of the pigs to be evaluated to obtain multiple clusters", the first basic description texts belonging to the third cluster after clustering are recorded as the target basic description texts, and then the corresponding pigs to be evaluated are grouped to obtain the first preliminary breeding pig set;

[0039] Step S213, perform mean calculation on all similarity calculation results corresponding to each first basic description text to obtain a first similarity calculation result; sort all the first similarity calculation results in order from large to small, and after sorting, select the first L first similarity calculation results in order from large to small, and collect the pigs to be evaluated corresponding to the selected first similarity calculation results to obtain a second preliminary breeding pig set.

[0040] In step S2, considering that when collecting the original image, the pig will move around, it is difficult to collect only the image of the pig's buttocks, and generally some pig house environment images will be collected, so the collected first image and the second image are processed, and then the buttocks image containing only the pig's buttocks is segmented from the first image; in this step, the buttocks image containing only the buttocks in the first image is extracted based on the image group, and the body shape information of each pig to be evaluated is calculated, and the body shape score is calculated according to the body shape information, and the buttocks image is input into a preset hair scoring model, and the specific implementation steps of obtaining the hair score include steps S22 and step S23;

[0041] Step S22, performing a first preprocessing on the first image and the second image to obtain a third image and a fourth image respectively, wherein the first preprocessing includes grayscale processing; performing a difference calculation on the third image and the fourth image to obtain a fifth image; performing a second preprocessing on the fifth image to obtain a sixth image, wherein the second preprocessing includes binarization processing, corrosion filtering processing and dilation processing; determining the minimum circumscribed rectangle corresponding to the buttocks of the pig to be evaluated in the sixth image, performing a ratio calculation on the length and width of the minimum circumscribed rectangle to obtain the body shape information; obtaining a body shape score correspondence table, wherein a body shape information range in the body shape score correspondence table corresponds to a body shape score; calculating the body shape score of each pig to be evaluated according to the body shape score correspondence table and the body shape information of each pig to be evaluated;

[0042] Step S23, extracting the buttocks image from the first image according to the coordinate information of the minimum circumscribed rectangle as the coordinate information of the buttocks image, performing image enhancement processing on the buttocks image to obtain an enhanced image, and inputting the enhanced image into a preset hair scoring model to obtain a hair score.

[0043] In this step, the third image is subtracted from the fourth image to obtain the fifth image, and the grayscale value of each pixel in the third image can be subtracted from the grayscale value of each pixel in the fourth image. Since the pixels corresponding to the stationary objects in the third image and the fourth image have the same grayscale value, the stationary objects in the third image and the fourth image can be eliminated by subtracting the third image from the fourth image, and the image of the moving object, i.e., the image of the pig's buttocks, can be obtained; that is, the object presented in the sixth image is usually the outline of the object, i.e., the image of the pig's buttocks we need, and then the length and width of the buttocks can be calculated by the minimum circumscribed rectangle, and then the ratio calculation can be performed to obtain the body shape information; the hair scoring model can use multiple hair images, annotate them with scores, and train a convolutional neural network model after annotation to obtain;

[0044] Step S3, determining target breeding pigs from the preliminary breeding pig set in combination with the body shape score and the hair score, so as to help breeders breed the target breeding pigs.

[0045] In this step, the target breeding pig is the breeding pig that is finally determined. After the target breeding pig is determined, its growth can be continuously monitored and data analyzed to timely discover and solve potential growth problems and optimize feeding management. More specifically, the breeder can adjust the feed formula and feeding amount in time according to the growth status to ensure that the breeding pig obtains sufficient nutritional support to promote the healthy growth of the breeding pig. This step can directly perform a weighted summation on the body shape score and the hair score to obtain a comprehensive score, and then find the pig to be evaluated with the largest comprehensive score in the preliminary breeding pig set, and use it as the target breeding pig; at the same time, the specific implementation steps of this step can also include step S31 and step S32;

[0046] Step S31, weighted summing the body shape score and the hair score to obtain a first comprehensive score, wherein the weight of the body shape score is greater than the weight of the hair score; obtaining factors affecting the health of the pigs, wherein the current breeding temperature, breeding humidity, and stocking density of each pig to be evaluated are obtained, and values ​​are assigned to the breeding temperature, breeding humidity, and stocking density, respectively, and weights are assigned at the same time, and the breeding temperature, breeding humidity, and stocking density are weighted summed to obtain a second value; at the same time, the illness probability corresponding to each pig to be evaluated is obtained, and an illness grade score table is obtained, in which one illness probability corresponds to one illness grade score, and the corresponding illness grade score is determined according to the illness grade score table;

[0047] In this step, the breeding temperature, breeding humidity and stocking density are closely related to the health of pigs, so they are obtained in this step;

[0048] Step S32, multiply the second numerical value, the disease level score and the disease probability corresponding to each pig to be evaluated to obtain a third numerical value, and subtract the third numerical value from the preset numerical value to obtain a second comprehensive score; weightedly sum the first comprehensive score and the second comprehensive score to obtain a third comprehensive score, and in the preliminary breeding pig set, find the pig to be evaluated with the largest third comprehensive score, and use it as the target breeding pig.

[0049] In this step, the third value is subtracted from the preset value to obtain a second comprehensive score, which is equivalent to the corresponding health level of each pig to be evaluated; in this step, body shape, hair, and health level are comprehensively considered. This calculation method can make the final score better reflect the physical condition of the pigs, and thus more accurately screen out breeding pigs.

[0050] Example 2

[0051] like Figure 2 As shown, this embodiment provides a pig physical condition management system based on computer vision scoring, and the system includes an acquisition module 1, a first calculation module 2 and a second calculation module 3.

[0052] Acquisition module 1, used to acquire an image group and a first basic description text of each pig to be evaluated, wherein the image group includes a first image and a second image, wherein the first image and the second image are images of the same pig to be evaluated, respectively collected at a current moment and a previous moment, containing hip and environmental information; the first basic description text includes weight information, breeding time information, live back fat thickness information, and eye muscle area information;

[0053] The first calculation module 2 is used to select a preliminary set of breeding pigs from all the pigs to be evaluated based on the first basic description text of each pig to be evaluated; extract the hip image containing only the hip in the first image based on the image group, and calculate the body shape information of each pig to be evaluated, and calculate the body shape score according to the body shape information; input the hip image into a preset hair scoring model to obtain a hair score;

[0054] The second calculation module 3 is used to determine the target breeding pigs from the preliminary breeding pig set in combination with the body shape score and the hair score, so as to help breeders to breed the target breeding pigs.

[0055] In a specific implementation of the present disclosure, the first calculation module 2 further includes an acquisition unit 21 .

[0056] The acquisition unit 21 is used to obtain the second basic description text of the historical breeding pigs; cluster the first basic description texts of all the pigs to be evaluated to obtain multiple clustering clusters, select a part of the first basic description texts from each clustering cluster to train the multi-classification model, and obtain the trained multi-classification model; based on the trained multi-classification model and all the second basic description texts, obtain the first preliminary breeding pig set, and at the same time calculate the similarity between each first basic description text and each second basic description text, obtain the second preliminary breeding pig set based on the similarity calculation results, and collect the pigs to be evaluated that exist in both the first preliminary breeding pig set and the second preliminary breeding pig set to obtain the preliminary breeding pig set.

[0057] In a specific implementation of the present disclosure, the acquisition unit 21 further includes a training unit 211 .

[0058] The training unit 211 is used to assign different symbols to each cluster, and at the same time count the number of first basic description texts contained in each cluster, which is recorded as a first value; analyze whether the differences between the first values ​​corresponding to any two clusters are less than a preset threshold. If they are all less than, the same proportion of first basic description texts are extracted from each cluster and recorded as training samples. Otherwise, the same number of first basic description texts are extracted from each cluster and recorded as training samples; the training samples are labeled, and the labeling information of each training sample is the symbol corresponding to each training sample. The multi-classification model is trained using the labeled training samples to obtain a trained multi-classification model.

[0059] In a specific implementation of the present disclosure, the acquisition unit 21 further includes a first calculation unit 212 and a second calculation unit 213 .

[0060] The first calculation unit 212 is used to classify all the second basic description texts using the trained multi-classification model, obtain the symbol corresponding to each second basic description text, count the number of second basic description texts corresponding to each symbol, record the symbol corresponding to the maximum number as the target symbol, record the first basic description texts belonging to the target symbol in all the first basic description texts as the target basic description text, collect the pigs to be evaluated corresponding to each target basic description text to obtain a first preliminary breeding pig set, count the number of pigs in the first preliminary breeding pig set and record it as a second value L; calculate the similarity between each first basic description text and each second basic description text, wherein the similarity calculation formula is: , H represents the similarity between each first basic description text and each second basic description text, M represents the number of repeated words between each first basic description text and each second basic description text, and G represents the total number of words in each second basic description text. Represents the logarithm base and is greater than 1;

[0061] The second calculation unit 213 is used to calculate the mean of all similarity calculation results corresponding to each first basic description text to obtain a first similarity calculation result; sort all the first similarity calculation results in order from large to small, and after sorting, select the first L first similarity calculation results in order from large to small, and collect the pigs to be evaluated corresponding to the selected first similarity calculation results to obtain a second preliminary breeding pig set.

[0062] In a specific implementation of the present disclosure, the first calculation module 2 further includes a third calculation unit 22 and a fourth calculation unit 23 .

[0063] The third calculation unit 22 is used to perform a first preprocessing on the first image and the second image to obtain a third image and a fourth image respectively, wherein the first preprocessing includes grayscale processing; performing difference calculation on the third image and the fourth image to obtain a fifth image; performing a second preprocessing on the fifth image to obtain a sixth image, wherein the second preprocessing includes binarization processing, corrosion filtering processing and expansion processing; determining the minimum circumscribed rectangle corresponding to the buttocks of the pig to be evaluated in the sixth image, performing ratio calculation on the length and width of the minimum circumscribed rectangle to obtain the body shape information; obtaining a body shape score correspondence table, wherein a body shape information range in the body shape score correspondence table corresponds to a body shape score; and calculating the body shape score of each pig to be evaluated according to the body shape score correspondence table and the body shape information of each pig to be evaluated;

[0064] The fourth calculation unit 23 is used to extract the buttocks image from the first image according to the coordinate information of the minimum circumscribed rectangle as the coordinate information of the buttocks image, perform image enhancement processing on the buttocks image to obtain an enhanced image, and input the enhanced image into a preset hair scoring model to obtain a hair score.

[0065] It should be noted that, regarding the system in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0066] Example 3

[0067] Corresponding to the above method embodiments, the embodiments of the present disclosure also provide a pig body condition management device based on computer vision scoring. The pig body condition management device based on computer vision scoring described below and the pig body condition management method based on computer vision scoring described above can be referenced to each other.

[0068] Figure 3 is a block diagram of a pig body condition management device 300 based on computer vision scoring according to an exemplary embodiment. Figure 3 As shown, the pig body condition management device 300 based on computer vision scoring may include: a processor 301, a memory 302. The pig body condition management device 300 based on computer vision scoring may also include one or more of a multimedia component 303, an I / O interface 304, and a communication component 305.

[0069] The processor 301 is used to control the overall operation of the pig body condition management device 300 based on computer vision scoring to complete all or part of the steps in the above-mentioned pig body condition management method based on computer vision scoring. The memory 302 is used to store various types of data to support the operation of the pig body condition management device 300 based on computer vision scoring. These data may include, for example, instructions for any application or method operating on the pig body condition management device 300 based on computer vision scoring, as well as application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 302 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk. The multimedia component 303 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 302 or sent via the communication component 305. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 304 provides an interface between the processor 301 and other interface modules, and the above-mentioned other interface modules can be keyboards, mice, buttons, etc. These buttons can be virtual buttons or physical buttons. The communication component 305 is used for wired or wireless communication between the pig condition management device 300 based on computer vision scoring and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 305 can include: Wi-Fi module, Bluetooth module, NFC module.

[0070] In an exemplary embodiment, the pig body condition management device 300 based on computer vision scoring can be implemented by one or more application specific integrated circuits (Application Specific Integrated Circuit, referred to as ASIC), digital signal processors (Digital Signal Processing Device, referred to as DSP), digital signal processing devices (Digital Signal Processing Device, referred to as DSPD), programmable logic devices (Programmable Logic Device, referred to as PLD), field programmable gate arrays (Field Programmable Gate Array, referred to as FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned pig body condition management method based on computer vision scoring.

[0071] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned pig body condition management method based on computer vision scoring are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 302 including program instructions, and the above-mentioned program instructions can be executed by the processor 301 of the pig body condition management device 300 based on computer vision scoring to complete the above-mentioned pig body condition management method based on computer vision scoring.

[0072] Example 4

[0073] Corresponding to the above method embodiment, the embodiment of the present disclosure also provides a readable storage medium. The readable storage medium described below and the pig body condition management method based on computer vision scoring described above can be referenced to each other.

[0074] A readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for managing pig body condition based on computer vision scoring in the above-mentioned method embodiment.

[0075] The readable storage medium may specifically be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or other readable storage medium that can store program codes.

[0076] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for managing pig body condition based on computer vision scoring, characterized in that: include: Obtain an image group and a first basic description text of each live pig to be evaluated, wherein the image group includes a first image and a second image, wherein the first image and the second image are images of the same live pig to be evaluated, respectively collected at a current moment and a previous moment, containing hip and environmental information; the first basic description text includes weight information, breeding time information, live back fat thickness information, and eye muscle area information; Based on the first basic description text of each pig to be evaluated, a preliminary set of breeding pigs is selected from all the pigs to be evaluated; Extracting a buttocks image that only contains the buttocks in the first image based on the image group, calculating the body shape information of each pig to be evaluated, and calculating the body shape score according to the body shape information; Inputting the buttocks image into a preset hair scoring model to obtain a hair score; Determine target breeding pigs from the preliminary breeding pig set in combination with the body shape score and the hair score, so as to help breeders breed the target breeding pigs; Among them, based on the first basic description text of each pig to be evaluated, a preliminary set of breeding pigs is selected from all the pigs to be evaluated, including: Obtain the second basic description text of the historical breeding pigs; cluster all the first basic description texts of the pigs to be evaluated to obtain multiple clusters, select a part of the first basic description texts from each cluster to train the multi-classification model, and obtain the trained multi-classification model; based on the trained multi-classification model and all the second basic description texts, obtain a first preliminary breeding pig set, and at the same time, calculate the similarity between each first basic description text and each second basic description text, obtain a second preliminary breeding pig set based on the similarity calculation results, and collect the pigs to be evaluated that exist in both the first preliminary breeding pig set and the second preliminary breeding pig set to obtain a preliminary breeding pig set; A portion of the first basic description text is selected from each cluster to train a multi-classification model, and a trained multi-classification model is obtained, including: Assign a different symbol to each cluster, and count the number of first basic description texts contained in each cluster, which is recorded as the first value; analyze whether the difference between the first values ​​corresponding to any two clusters is less than a preset threshold. If so, extract the same proportion of first basic description texts from each cluster and record them as training samples. Otherwise, extract the same number of first basic description texts from each cluster and record them as training samples; label the training samples, and the labeling information of each training sample is the symbol corresponding to each training sample. Use the labeled training samples to train the multi-classification model to obtain a trained multi-classification model; Based on the trained multi-classification model and all the second basic description texts, a first preliminary set of sows is obtained. At the same time, similarity calculation is performed between each first basic description text and each second basic description text, and a second preliminary set of sows is obtained based on the similarity calculation results, including: Use the trained multi-classification model to classify all the second basic description texts, obtain the symbol corresponding to each second basic description text, count the number of second basic description texts corresponding to each symbol, record the symbol corresponding to the maximum number as the target symbol, record the first basic description text belonging to the target symbol in all the first basic description texts as the target basic description text, collect the pigs to be evaluated corresponding to each target basic description text, obtain the first preliminary breeding pig set, count the number of pigs in the first preliminary breeding pig set and record it as the second value L; calculate the similarity between each first basic description text and each second basic description text, where the similarity calculation formula is: , H represents the similarity between each first basic description text and each second basic description text, M represents the number of repeated words between each first basic description text and each second basic description text, and G represents the total number of words in each second basic description text. Represents the logarithm base and is greater than 1; Perform mean calculation on all similarity calculation results corresponding to each first basic description text to obtain a first similarity calculation result; sort all the first similarity calculation results in order from large to small, and after sorting, select the first L first similarity calculation results in order from large to small, and collect the pigs to be evaluated corresponding to the selected first similarity calculation results to obtain a second preliminary breeding pig set.

2. The method for managing pig body condition based on computer vision scoring according to claim 1, characterized in that: Extracting a buttocks image that only contains the buttocks in the first image based on the image group, calculating the body shape information of each pig to be evaluated, calculating the body shape score according to the body shape information, and inputting the buttocks image into a preset hair scoring model to obtain a hair score, including: The first image and the second image are subjected to a first preprocessing to obtain a third image and a fourth image respectively, wherein the first preprocessing includes grayscale processing; the third image and the fourth image are subjected to difference calculation to obtain a fifth image; the fifth image is subjected to a second preprocessing to obtain a sixth image, wherein the second preprocessing includes binarization processing, corrosion filtering processing and dilation processing; the minimum circumscribed rectangle corresponding to the buttocks of the pig to be evaluated is determined in the sixth image, and the length and width of the minimum circumscribed rectangle are calculated by ratio to obtain the body shape information; a body shape score correspondence table is obtained, wherein a body shape information range in the body shape score correspondence table corresponds to a body shape score; the body shape score of each pig to be evaluated is calculated according to the body shape score correspondence table and the body shape information of each pig to be evaluated; The buttocks image is extracted from the first image according to the coordinate information of the minimum circumscribed rectangle as the coordinate information of the buttocks image, image enhancement processing is performed on the buttocks image to obtain an enhanced image, and the enhanced image is input into a preset hair scoring model to obtain a hair score.

3. A pig body condition management system based on computer vision scoring, characterized in that: include: An acquisition module is used to acquire an image group and a first basic description text of each live pig to be evaluated, wherein the image group includes a first image and a second image, wherein the first image and the second image are images of the same live pig to be evaluated, respectively collected at a current moment and a previous moment, containing hip and environmental information; the first basic description text includes weight information, breeding time information, live back fat thickness information, and eye muscle area information; A first calculation module is used to select a preliminary set of breeding pigs from all the pigs to be evaluated based on the first basic description text of each pig to be evaluated; Extracting a buttocks image that only contains the buttocks in the first image based on the image group, calculating the body shape information of each pig to be evaluated, and calculating the body shape score according to the body shape information; Inputting the buttocks image into a preset hair scoring model to obtain a hair score; A second calculation module is used to determine target breeding pigs from the preliminary breeding pig set in combination with the body shape score and the hair score, so as to help breeders breed the target breeding pigs; Wherein, the first computing module includes: An acquisition unit is used to acquire the second basic description text of historical breeding pigs; clustering the first basic description texts of all the pigs to be evaluated to obtain multiple clustering clusters, selecting a part of the first basic description texts from each clustering cluster to train a multi-classification model, and obtaining a trained multi-classification model; based on the trained multi-classification model and all the second basic description texts, a first preliminary breeding pig set is obtained, and at the same time, each first basic description text is respectively calculated with each second basic description text, and a second preliminary breeding pig set is obtained based on the similarity calculation results, and the pigs to be evaluated that exist in both the first preliminary breeding pig set and the second preliminary breeding pig set are grouped to obtain a preliminary breeding pig set; Get unit, including: The training unit is used to assign different symbols to each cluster, and count the number of first basic description texts contained in each cluster, which is recorded as the first value; analyze whether the difference between the first values ​​corresponding to any two clusters is less than a preset threshold value, if so, extract the same proportion of first basic description texts from each cluster and record them as training samples, otherwise, extract the same number of first basic description texts from each cluster and record them as training samples; label the training samples, the labeling information of each training sample is the symbol corresponding to each training sample, and use the labeled training samples to train the multi-classification model to obtain a trained multi-classification model; Get unit, including: The first calculation unit is used to classify all the second basic description texts using the trained multi-classification model, obtain the symbol corresponding to each second basic description text, count the number of second basic description texts corresponding to each symbol, record the symbol corresponding to the maximum number as the target symbol, record the first basic description texts belonging to the target symbol in all the first basic description texts as the target basic description text, collect the pigs to be evaluated corresponding to each target basic description text to obtain the first preliminary breeding pig set, count the number of pigs in the first preliminary breeding pig set and record it as the second value L; calculate the similarity between each first basic description text and each second basic description text, wherein the similarity calculation formula is: , H represents the similarity between each first basic description text and each second basic description text, M represents the number of repeated words between each first basic description text and each second basic description text, and G represents the total number of words in each second basic description text. Represents the logarithm base and is greater than 1; The second calculation unit is used to calculate the mean of all similarity calculation results corresponding to each first basic description text to obtain a first similarity calculation result; sort all the first similarity calculation results in order from large to small, and after sorting, select the first L first similarity calculation results in order from large to small, and collect the pigs to be evaluated corresponding to the selected first similarity calculation results to obtain a second preliminary breeding pig set.

4. The pig body condition management system based on computer vision scoring according to claim 3 is characterized in that: The first computing module includes: A third calculation unit is used to perform a first preprocessing on the first image and the second image to obtain a third image and a fourth image respectively, wherein the first preprocessing includes grayscale processing; performing difference calculation on the third image and the fourth image to obtain a fifth image; performing a second preprocessing on the fifth image to obtain a sixth image, wherein the second preprocessing includes binarization processing, corrosion filtering processing and dilation processing; determining the minimum circumscribed rectangle corresponding to the buttocks of the pig to be evaluated in the sixth image, performing ratio calculation on the length and width of the minimum circumscribed rectangle to obtain the body shape information; obtaining a body shape score correspondence table, wherein a body shape information range in the body shape score correspondence table corresponds to a body shape score; and calculating the body shape score of each pig to be evaluated according to the body shape score correspondence table and the body shape information of each pig to be evaluated; and a fourth calculation unit, for extracting the buttocks image from the first image based on the coordinate information of the minimum circumscribed rectangle as the coordinate information of the buttocks image, performing image enhancement processing on the buttocks image to obtain an enhanced image, and inputting the enhanced image into a preset hair scoring model to obtain a hair score.

Citation Information

Patent Citations

  • Big Duroc new strain breeding method

    CN107156026A

  • Method for estimating body condition score of animal, method for estimating weight of animal and computer program

    JP2024042192A