Disclosure of Invention
The invention provides a system and a method for selecting a breeding pig based on visual analysis, which are used for solving the problems of inconvenience in manual observation and probability of picking up a 'bad' breeding pig, improving the working efficiency, increasing the observation accuracy and relieving the body pressure caused by repeated squatting of a raising person, and adopts the following technical scheme:
the invention provides a system and a method for selecting breeding pigs based on visual analysis, comprising the following steps: the RFI D identification module is used for identifying pig information and detecting and identifying whether the pig passes through the fixed channel; the image acquisition module is used for acquiring images to be compared of all directions of the pig when the pig sent by the RFI D identification module is received and the pig passes through the fixed channel identification signal; the image processing module is used for processing the images to be compared of the pigs collected by the image collection module, comparing the processed images to be compared with a reference picture of a selected sow standard available nipple photo in a database system called by the image processing module to obtain a result of similarity with the reference picture, and classifying the images to be compared according to the similarity result and nipple types preset by the reference picture so as to select proper breeding pigs; the control center is used for receiving the signal of the RFI D recognition module and sending an instruction to control the operation of the image acquisition module and the image processing module.
Preferably, the rfid identification module includes: the RFID electronic tag, a read-write antenna and a reader-writer; the RFI D electronic tag is arranged on a pig, the read-write antenna is assembled in the fixed channel, and the reader-writer is loaded in the control center.
Preferably, the fixed channel is connected to the ingestion zone and the drinking rest zone; the joint of the fixed channel, the feeding area and the drinking area is respectively provided with a one-way channel door; the pigs can only move to the drinking water rest area in one way through one of the fixed channels from the feeding area, otherwise, if the pigs only try to return from the drinking water rest area through the channel door, the one-way channel door cannot be opened; the water from the drinking rest area to the feeding area needs to pass through another fixed channel; the other fixed channel is also provided with a one-way channel door, and pigs can only move from the drinking water rest area to the feeding area in one way through the channel, so that a one-way channel which can only move from the feeding area to the drinking water rest and back to the feeding area is formed; the width of the fixed channel is 50 cm to 75 cm, so that images of each pig can be acquired, and confusion is avoided; the length of the fixed channel is not smaller than the lengths of two pigs, the upper limit of the length of the channel can be adjusted according to the number of the pigs and the size of a farm, and the height of the fixed channel and the height of the channel door are required to be larger than the calibrated heights of pigs; wherein, the length of the pig is 130 cm to 200 cm, and the height of the pig is 50 cm to 90 cm.
Preferably, the image acquisition module adopts an embedded camera probe and is arranged in the fixed channel; at least one embedded camera is arranged on the ground of the fixed channel, and at least one embedded camera probe is respectively arranged at a position 10cm to 20 cm above the bottoms of the left wall and the right wall of the fixed channel; an automatically adjustable light source is arranged in the fixed channel, and is automatically controlled by a control center, so that light rays during shooting are ensured; the pigs are continuously shot after passing through the fixed channel, the shooting frequency is once in two seconds, and the images to be compared of a plurality of pigs are obtained.
Preferably, the image processing module includes:
an image processing unit: for processing the image to be compared; comparing the picture to be compared with the reference picture to obtain a result similar to the reference picture, and classifying the picture to be compared according to the similarity result and the preset nipple type of the reference picture so as to select pigs which can be bred;
an image change recording unit: the pig nipple count was recorded and the pig nipple change was recorded for each nipple.
The processing procedure of the image processing unit preferably comprises:
s1, preprocessing the image to be compared acquired by the image module, and removing useless background to obtain a preprocessed image;
s2, adjusting the preprocessed image to be the same as a preset reference picture in a database system, and obtaining a picture with the adjusted size;
s3, converting the picture with the adjusted size into a gray level histogram;
s4, dividing the gray level histogram into a plurality of areas according to gray levels;
s5, carrying out summation operation on the gray level of each region to obtain a vector of the picture to be compared;
s6, obtaining cosine values of the vector of the picture to be compared and the vector of the reference picture, obtaining similarity, classifying the picture to be compared according to a result of the similarity and a preset nipple typing of the reference picture, selecting a nipple type capable of being bred with representativeness according to a classification result, and selecting a pig capable of being bred according to the nipple type; the closer the vector cosine value is to 1, the higher the similarity is, if the cosine value is smaller than 0.45, the larger the difference between the to-be-compared picture and the reference picture is, and when the representative nipple type is found, the picture can be stored in the system as the reference picture after being processed by a breeder after being evaluated.
Preferably, the image change recording unit process of the image processing module includes:
a1, acquiring the pictures to be compared of each nipple of the same pig in a preset time period by using the image acquisition module;
a2, respectively comparing the pictures to be compared with the reference pictures in the preset time period to respectively obtain the similarity with the reference pictures;
a3, classifying the pictures to be compared according to the result of the similarity with the reference picture and the preset nipple types of the reference picture to obtain nipple types of the pictures to be compared, thereby determining the nipple classification type of each nipple of the same pig, determining whether the nipple types are degraded from effective nipples or become ineffective nipples, and determining the pig suitable for breeding according to the nipple classification types.
Preferably, the working process of the control center includes:
b1, the control center utilizes a reader-writer to identify RFI D electronic tag signals which are sensed by a reader-writer antenna and are only worn by pigs;
b2, when the control center recognizes the RFI D electronic tag signal, sending an instruction to the image acquisition module to acquire an image, and acquiring the image to be compared;
and B3, the control center sends an instruction to the image processing module to work for processing the image to be compared, and determines nipple typing closest to the reference picture according to the similarity between the image to be processed and the reference picture result, so that a proper breeding pig is selected.
Preferably, a method of breeding pig selection based on visual analysis comprises:
w1, identifying pig information through the RFI D identification module, detecting whether the pig passes through a fixed channel, and acquiring pictures if the pig passes through the fixed channel;
w2, the control center receives the signal of the RFI D recognition module and sends an instruction to the picture acquisition module, and the picture acquisition module acquires images to be compared of pigs;
w3, extracting characteristics of individual information in the image to be compared through the image processing module to obtain an image vector to be compared;
w4, processing the reference picture through the picture processing module to obtain a reference picture vector;
w5, calculating cosine values of the vectors of the picture to be compared and the vector of the reference picture through the picture processing module so as to judge the similarity of the picture to be compared and the reference picture;
w6, classifying the nipple of the picture to be compared according to the similarity result and the preset nipple typing of the reference picture, and selecting a nipple type with representativeness for breeding according to the classification result so as to select breedable pigs; the closer the vector cosine value is to 1, the higher the similarity is, if the cosine value is smaller than 0.45, the larger the difference between the to-be-compared picture and the reference picture is, and when the representative nipple type is found, the picture can be stored in the system as the reference picture after being processed by a breeder after being evaluated.
Preferably, the image processing module in W3 performs feature extraction on individual information in the image to be compared, and the process includes:
w3-1, preprocessing the image to be compared acquired by the image module, and removing useless background to obtain a preprocessed image;
w3-2, adjusting the preprocessed image to be the same as a preset reference picture in a database system, and obtaining a picture with the adjusted size;
w3-3, converting the picture with the adjusted size into a gray level histogram;
w3-4, dividing the gray level histogram into a plurality of areas according to gray level;
and W3-5, carrying out summation operation on the gray level of each region to obtain the vector of the picture to be compared.
The invention has the beneficial effects that:
the invention provides a system and a method for selecting a breeding pig through the vision analysis system, and the system and the method can be used for collecting all directions of the pig, and the collected pictures are stored in the system in real time, so that a breeder can conveniently check the pictures; the grading of each nipple of each pig can be accurately known, and the problem that the abdomen of the pig breeding is not well observed is effectively solved; the accuracy and the efficiency of observation can be improved, the inconvenience and the burden caused by repeated observation of raising personnel are reduced, meanwhile, the basis of people and pigs is reduced, the bacterial infection probability is reduced, and the stress response of sows is not caused; when a representative nipple is found through the picture, the representative nipple can be stored in the system as a reference picture; the nipple change condition of the pigs can be recorded, and the nipple change is used as the production guidance of production personnel; the nipple number of each pig can be identified and recorded through the pictures and classified; if the effective nipple is degraded or becomes an ineffective nipple, the production personnel can be prompted to search for problems in production, and the problems are avoided; the fixed channel is set to be used as a place for collecting nipple photos of pigs, so that images of each pig are collected, and confusion is avoided.
Detailed Description
The preferred embodiments of the present invention will be described below with reference to the accompanying drawings, it being understood that the preferred embodiments described herein are for illustration and explanation of the present invention only, and are not intended to limit the present invention.
The embodiment of the invention provides a system and a method for selecting breeding pigs based on visual analysis, wherein the system comprises the following steps:
the RFI D identification module is used for identifying pig information and detecting whether the pig passes through the fixed channel or not;
the image acquisition module is used for acquiring images to be compared of all directions of the pig when the pig sent by the RFI D identification module is received and the pig passes through the fixed channel identification signal;
the image processing module is used for processing the images to be compared of pigs acquired by the image collection module, comparing the processed images to be compared with a reference picture of a selected sow standard available nipple photo in a database system called by the picture processing module to obtain similarity with the reference picture, classifying the nipple of the images to be compared according to a result of the similarity and a nipple type preset by the reference picture, and selecting a proper sow according to a classification result;
the control center is used for receiving the signal of the RFI D recognition module and sending an instruction to control the operation of the image acquisition module and the image processing module.
The working principle of the above embodiment is: the pig body is also provided with an RFI D tag, the information of the pig is marked, the control center is identified through the RFI D identification module, the RFI D identification module is used for identifying whether the pig only passes through the fixed channel, if the pig only passes through the fixed channel, the control channel is closed, an instruction is sent to the image acquisition module to acquire images of all directions of the pig, and if the pig only passes through the fixed channel, the channel is continuously opened; the control center controls the image processing module to process the image acquired by the image acquisition module, compares the processed image to be compared with a reference picture of a standard available nipple photo of a selected sow in a database system called by the image processing module to obtain a result of similarity with the reference picture, classifies the image to be compared according to the result of similarity and a nipple type preset by the reference picture, and selects a proper sow according to the classification result;
the technical scheme has the effects that: by clearly identifying pig information by utilizing RFI D, the control center controls image acquisition and image processing, so that the contact between farm workers and pigs can be reduced, the cross infection probability of bacteria can be reduced, the artificial squatting pressure can be reduced, the stress response of the pigs can be reduced, the observation accuracy can be improved, the observation efficiency can be improved, and the acquired pictures and comparison results can be input into the system, so that the convenience is brought to the viewing, comparison and calling of the farmers.
An implementation fixed channel of the invention is connected with a feeding area and a drinking rest area, as shown in figure 1 of the specification; the joint of the fixed channel, the feeding area and the drinking area is respectively provided with a one-way channel door; the pigs can only move to the drinking water rest area in one way through one of the fixed channels from the feeding area, otherwise, if the pigs only try to return from the drinking water rest area through the channel door, the one-way channel door cannot be opened; the pigs can only move unidirectionally from the drinking water rest area to the feeding area through the channel, so that a unidirectional channel is formed in which the pigs can only move from the feeding area to the drinking water rest and then back to the feeding area; the width of the fixed channel ranges from 50 cm to 75 cm, so that images of each pig can be acquired, and confusion is avoided; the length of the fixed channel is not smaller than the lengths of two pigs, the upper limit of the length of the channel can be adjusted according to the number of the pigs and the size of a farm, and the height of the fixed channel and the height of a channel door are larger than the nominal height of pigs; wherein, the length of the pig is 130 cm to 200 cm, and the height of the pig is 50 cm to 90 cm.
The working principle of the technical scheme is as follows: the breeding farm is divided into a feeding area and a drinking water rest area, the feeding area and the drinking water rest area are connected through unidirectional fixed channels, pigs are guaranteed to only pass through the channels in a unidirectional mode through limiting the size of the fixed channels and the arrangement of the channel doors, the RFI D recognition module is used for recognizing whether the pigs only pass through the fixed channels, if the pigs only pass through the fixed channels, the channels are closed, all-direction images of the pigs are collected, and if the pigs not pass through the fixed channels, the channels are continuously opened.
The technical scheme has the effects that: through the size of fixed passageway and the setting of fixed passageway door, guarantee that the pig can only one-way through fixed passageway to ensure that the image of every pig can be gathered, and can not take place to confuse, convenient management.
The RI FD identification module comprises an RI FD electronic tag, a read-write antenna and a reader-writer; the RI FD electronic tag is fixed on a pig, the read-write antenna is assembled in the fixed channel, and the reader-writer is loaded in the control center.
The working principle of the technical scheme is as follows: the reader-writer identifies the electronic tag sensed by the reader-writer antenna, and the electronic tag is fixed on the pig body, so that information of pigs is obtained, and the information corresponds to the pigs one by one.
The technical scheme has the effects that: through RI FD remote identification, reduce the contact of people and pig, the label is fixed in on one's body with the pig, makes shooting picture and pig information one-to-one, avoids chaotic.
An image acquisition module of one embodiment of the invention adopts an embedded camera probe and is arranged in a fixed channel; at least one embedded camera is arranged on the ground of the fixed channel, and at least one embedded camera probe is respectively arranged at a position 10cm to 20 cm above the bottoms of the left wall and the right wall of the fixed channel; the fixed channel is internally provided with an automatically adjustable light source, so that light rays during shooting are ensured; the pigs are continuously shot by the camera after passing through the fixed channel, the shooting frequency is once every two seconds, and the images to be compared of a plurality of pigs are obtained.
The working principle of the technical scheme is as follows: the embedded cameras are arranged at the bottom of the fixed channel and the height of the walls at the two sides of the fixed channel from 10cm to 20 cm, so that the omnidirectional pictures of the nipples of pigs can be taken in an omnidirectional manner, the shape, the change and the number of the nipples can be recorded, and the embedded cameras are not easy to damage by the passing pigs; the light source can be automatically adjusted to adjust the light rays during shooting, so that a clearer picture is ensured to be shot.
The technical scheme has the effects that: the camera is used for replacing manual collection of the nipple photo of the pig, so that the repeated squatting and observing pressure of workers can be reduced, the shape, change and quantity of the nipple of the pig can be recorded in real time, the repeated observation and comparison can be realized, the observation accuracy can be improved, a database can be established, and a basis is provided for the problems in the selection and production of the breeding pigs; light during the adjustable shooting of light source guarantees to take clearer picture to the difficult pig that passes through of embedded camera is damaged.
The image processing module comprises an image processing module and an image change recording unit, wherein the image processing unit is used for processing the images to be compared; comparing the picture to be compared with the reference picture to obtain a result of similarity with the reference picture, and classifying the picture to be compared according to the result of similarity and the preset nipple type of the reference picture so as to select pigs which can be bred;
an image change recording unit: the pig nipple count was recorded and the pig nipple change was recorded for each nipple.
The working principle of the technical scheme is as follows: processing the picture to be compared by using a picture processing module to obtain a vector of a comparison image; calculating vector values of the contrast images and vector values of the reference pictures to obtain results of similarity, classifying the images to be compared according to the results of the similarity and preset nipple types of the reference pictures to obtain nipple classification types of the images to be compared, selecting pigs which can be bred, recording nipple counts of the pigs, and recording nipple change conditions of each nipple.
The technical scheme has the effects that: the processed pictures are compared with the pictures, the vision is more visual, the result is more accurate, the selection of the breeding pigs is quicker, and the nipple change condition of the pigs can be recorded in real time.
An embodiment of the invention is an image processing unit process as shown in fig. 3 of the specification, comprising:
s1, preprocessing the image to be compared acquired by the image module, and removing useless background to obtain a preprocessed image;
s2, adjusting the preprocessed image to be the same as a preset reference picture in a database system, and obtaining a picture with the adjusted size;
s3, converting the picture with the adjusted size into a gray level histogram;
s4, dividing the gray level histogram into a plurality of areas according to gray levels;
s5, carrying out summation operation on the gray level of each region to obtain a vector of the picture to be compared;
s6, obtaining cosine values of the vector of the picture to be compared and the vector of the reference picture, obtaining similarity, classifying the picture to be compared according to a result of the similarity and a preset nipple typing of the reference picture, selecting a nipple type capable of being bred with representativeness according to a classification result, and selecting a pig capable of being bred according to the nipple type; the vector cosine value is closer to 1, which means that the similarity is higher, if the cosine value is smaller than 0.45, the difference between the to-be-compared picture and the reference picture is larger, and when the representative nipple type is found, the picture can be stored in the system as the reference picture after being evaluated by a breeder after being processed.
The working principle of the technical scheme is as follows: firstly, preprocessing a picture to be compared through a picture processing unit, including removing useless background, adjusting the picture to be compared to the same size as a reference picture, converting the picture into a gray level histogram, dividing the gray level histogram of the picture with the adjusted size into different areas according to gray level, summing each area to obtain a vector of the picture to be compared, performing cosine value calculation on the vector of the picture to be compared and a preset picture, and judging the similarity of the picture to be compared and the reference picture according to a cosine value result; if a new representative nipple type appears, the system is added as a new reference picture after checking by a worker.
The technical scheme has the effects that: comparing the processed and calculated results to enable the comparison result to be more fit, and increasing the accuracy of comparison; if a new representative nipple type appears, the worker is checked by the worker and then added into the system as a new reference picture.
An embodiment of the present invention provides an image change recording unit process comprising:
a1, acquiring the pictures to be compared of each nipple of the same pig within a preset time period by using the image acquisition module, wherein the preset time period can be set arbitrarily according to production requirements, such as one week, half month or one month;
a2, respectively comparing the pictures to be compared with the reference pictures in the preset time period to respectively obtain the similarity with the reference pictures;
a3, classifying the pictures to be compared according to the result of the similarity with the reference picture and the preset nipple types of the reference picture to obtain nipple types of the pictures to be compared, thereby determining the nipple classification type of each nipple of the same pig, determining whether the nipple types are degraded from effective nipples or become ineffective nipples, and determining the pig suitable for breeding according to the nipple classification types.
The working principle of the technical scheme is as follows: and shooting pictures to be compared in a preset time period by using a camera, recording the nipple change of each pig, judging whether the nipple type is degraded from an effective nipple or changed into an ineffective nipple change of each pig according to a plurality of pictures to be compared in the preset time period, determining the nipple classification type of each nipple of each pig, and determining the pig according to the nipple classification type.
The technical scheme has the effects that: when a representative nipple is found through the picture, the representative nipple can be stored in the system as a reference picture; the nipple change condition of the pigs can be recorded, and the nipple change is used as the production guidance of production personnel; the nipple number of each pig can be identified and recorded through the picture and classified, if the effective nipple is degraded or becomes invalid nipple, the production personnel can be prompted to find the problem in production, and the problem is avoided.
The working process of the control center according to one embodiment of the present invention is shown in fig. 2 of the specification, and includes:
b1, the control center utilizes a reader-writer to identify RFI D electronic tag signals which are sensed by a reader-writer antenna and are only worn by pigs;
b2, when the control center recognizes the RFI D electronic tag signal, sending an instruction to the image acquisition module to acquire an image, and acquiring the image to be compared;
and B3, the control center sends an instruction to the image processing module to work for processing the image to be compared, and the nipple typing closest to the reference picture is determined according to the similarity between the image to be processed and the reference picture result, so that a proper sow is selected.
The working principle of the technical scheme is as follows: the reader-writer identifies RFI D electronic tag signals which are sensed by the reader-writer antenna and are worn by pigs, and when the control center identifies the RFI D electronic tag signals, a command is sent to the image acquisition module to acquire images to be compared; and the control center sends an instruction to the image processing module to work for processing the image to be compared, and determines nipple typing closest to the reference picture according to the similarity between the image to be processed and the reference picture result, so that a proper breeding pig is selected.
The technical scheme has the effects that: the control center realizes automatic control and mentions the working efficiency.
One embodiment of the invention provides a method for selecting breeding pigs based on visual analysis, which comprises the following steps:
w1, identifying pig information through the RFI D identification module, detecting whether the pig passes through a fixed channel, and acquiring pictures if the pig passes through the fixed channel;
w2, the control center receives the signal of the RFI D recognition module and sends an instruction to the picture acquisition module, and the picture acquisition module acquires images to be compared of pigs;
w3, extracting characteristics of individual information in the image to be compared through the image processing module to obtain an image vector to be compared;
w4, processing the reference picture through the picture processing module to obtain a reference picture vector;
w5, calculating cosine values of the vectors of the picture to be compared and the vector of the reference picture through the picture processing module so as to judge the similarity of the picture to be compared and the reference picture;
w6, classifying the nipple of the picture to be compared according to the similarity result and the preset nipple typing of the reference picture, selecting a representative nipple type capable of breeding according to the classification result, and selecting a pig capable of breeding; wherein a closer vector cosine value to 1 indicates a higher similarity; if the vector cosine value is smaller than 0.45, the difference between the picture to be compared and the reference picture is larger, and manual review is needed; when a representative nipple type is found, the picture can be stored in the system as a reference picture after being processed by a breeder after evaluation.
The nipple typing of the reference picture in one embodiment of the invention is shown in the accompanying figure 4 of the specification:
class 1: an elongated, long and sharp nipple, which is the breast with the most excellent development;
class 2: round and moist nipple development is good, but breast development is not ideal;
class 3: the nipple is not pointed, sphincter is not visible, and the nipple is generally not good in lactation;
class 4: the canal is too short and the sphincter is reversed, which is a poorly developed nipple;
class 5: the nipple wears or does not develop well, called blind nipple, and does not have lactation function.
Respectively comparing the vector of the picture to be compared with the vector of the reference pictures of different types, selecting the vector cosine value with the largest value as the nearest type, and if the vector cosine values of the picture to be compared and all the reference pictures are smaller than 0.45, manually checking; in this embodiment, if the vector cosine value of the image to be compared and the reference image of the first type of the most excellent breast is the largest, and the cosine value is greater than 0.75, the corresponding pig is only suitable for breeding.
The working principle of the technical scheme is as follows: identifying pig information through the RFI D identification module, detecting whether the pig passes through the fixed channel or not, and acquiring pictures if the pig passes through the fixed channel; extracting features of the acquired pictures through a picture processing module to obtain picture vectors to be compared; and comparing the vector of the image to be compared with the vector of the reference pictures of different types to obtain a similarity result, and classifying the pictures to be compared according to the similarity result and nipple typing preset by the basic pictures, so as to select a proper breeding pig.
The technical effects of the technical scheme are as follows: by clearly identifying pig information by utilizing RFI D, the control center controls image acquisition and image processing, so that the contact between a farm worker and pigs can be reduced, the cross infection probability of bacteria is reduced, the artificial squatting pressure is reduced, the stress response of the pigs is reduced, and the observation efficiency is improved; the acquired pictures and comparison results are input into the system, so that the cultivation personnel can conveniently check, compare and call the pictures and the comparison results; comparing the result after the picture processing and the calculation, so that the comparison result is more fit, and the accuracy of the comparison is improved; by means of manual review, the nipple types with low similarity can be reviewed and classified again, and when the nipple types with the representativeness are found, after evaluation by breeding personnel, the pictures can be stored in the system as reference pictures after being processed.
In one embodiment of the invention, the image processing module is used for extracting the characteristics of the individual information in the image to be compared, and the process comprises the following steps:
w3-1, preprocessing the image to be compared acquired by the image module, and removing useless background to obtain a preprocessed image;
w3-2, adjusting the preprocessed image to be the same as a preset reference picture in a database system, and obtaining a picture with the adjusted size;
w3-3, converting the picture with the adjusted size into a gray level histogram;
w3-4, dividing the gray level histogram into a plurality of areas according to gray level;
and W3-5, carrying out summation operation on the gray level of each region to obtain the vector of the picture to be compared.
The working principle of the technical scheme is as follows: the picture to be compared is preprocessed through a picture processing unit, the picture to be compared is subjected to useless background removal and is adjusted to be the same as the reference picture in size, then the picture is converted into a gray level histogram, the gray level histogram of the picture with the adjusted size is divided into different areas according to gray levels, then the gray levels of each area are summed to obtain a vector of the picture to be compared, cosine value calculation is carried out on the vector of the picture to be compared and a vector of a preset picture, and therefore the similarity of the picture to be compared and the reference picture is judged.
The technical scheme has the effects that: and comparing the processed and calculated results to ensure that the compared results are more fit and the accuracy of comparison is improved.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.