Multi-source fusion cattle feature analysis and identification method and system

Through a multi-source fusion cattle feature analysis method, using image enhancement and morphological scoring models, the problems of angle and lighting interference in cattle feature recognition were solved, achieving a more accurate health status assessment.

CN120635937AInactive Publication Date: 2025-09-12QIANCHENG YUNKE (ZHUHAI HENGQIN) TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510586518.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-08
Publication Date
2025-09-12
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing cattle feature recognition methods are easily affected by shooting angles, lighting conditions and image occlusion, and it is difficult to effectively identify diseased areas, affecting the accuracy of health status assessment.

Method used

A multi-source fusion cattle feature analysis method was adopted. Through manual annotation and preprocessing of images, an image enhancement model was constructed. Combined with multi-angle images, feeding records and environmental data, a morphological scoring model was used to assess cattle health.

Benefits of technology

It improves the accuracy of cattle health status assessment, reduces the interference of shooting angles and lighting conditions, and can identify diseased areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120635937A_ABST
    Figure CN120635937A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image recognition, and discloses a multi-source fusion cattle feature analysis and recognition method and system, and the method comprises the following steps: S101, constructing a training data set of an image enhancement model; step S102, obtaining a second image through the image enhancement model; step S103, constructing a feeding sequence and an environment sequence; step S104, constructing a training data set of the morphological scoring model; step S105, collecting basic information of the cattle to pre-train the form scoring model; step S106, obtaining a form score of the cattle through a form scoring model; according to the method, interference of factors such as a shooting angle, an illumination condition and image shielding is reduced through the image enhancement model, a lesion area of the cattle can be identified, and characteristics of a multi-angle image, a feeding record and environment data are fused through the form scoring model, so that the accuracy of cattle health state evaluation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition technology, and more specifically, to a multi-source fusion cattle feature analysis and recognition method and system. Background Art

[0002] Amid the rapid development of smart ranching and precision farming, individual cattle identification and health assessment are becoming key technologies for improving dairy production efficiency. Currently, mainstream research focuses on image-based cattle feature recognition methods. These methods typically extract image features using convolutional neural networks (CNNs). These feature maps are then vectorized using global average pooling or global maximum pooling, and then fed into a fully connected layer to predict the cattle's morphological score or identity.

[0003] Although the above method can improve the level of automated recognition to a certain extent, it has the following limitations: 1. In actual pasture applications, a single image data source is easily interfered with by factors such as shooting angle, lighting conditions, and image occlusion, and lacks the integration of multi-source data, which may lead to low accuracy in cattle feature recognition; 2. The cattle epidermis may cause visual symptoms (such as plaques, hair loss, scabs, etc.) due to diseases such as fungal infections and skin inflammation. These lesions may have similarities with the natural patterns of the cattle in the image, making it easy to misidentify the diseased areas as normal features, thereby affecting the accurate assessment of the cattle's health status. Summary of the Invention

[0004] The present invention provides a multi-source fusion cattle feature analysis and identification method and system to solve the technical problems in the above-mentioned background technology.

[0005] The present invention provides a multi-source fusion cattle feature analysis and identification method, comprising the following steps: Step S101, manually marking the lesion area in the normal light images of the cattle at four angles, and performing preprocessing to obtain the first image as a training data set for the image enhancement model; Step S102: input the normal lighting images of the cattle at four angles into the trained image enhancement model to output a second image; The normal illumination image, the first image, and the second image have the same size; Step S103, within a preset time period, collecting cattle feeding records and environmental data at preset time intervals, and performing normalization processing to obtain feeding sequences and environmental sequences; Step S104: manually labeling the morphological scores of the cattle, segmenting the second images from the four angles to construct graph structure data, and using the feeding sequence and the environment sequence as a training data set for the morphological scoring model; Step S105, before training the morphological scoring model, collecting basic information of the cattle to pre-train the morphological scoring model; Step S106: input the graph structure data, feeding sequence and environment sequence into the trained morphological scoring model to output the morphological score of the cattle.

[0006] Furthermore, the normal lighting images and common lighting images of the cow at four angles are collected individually, and the four angles are the front side perspective, the rear side perspective, the left side perspective, and the right side perspective of the cow.

[0007] Furthermore, preprocessing to obtain the first image includes the following steps: Step S201: Divide the normal illumination image into M×N sub-regions, perform local histogram equalization on the three channels of each sub-region, and perform bilinear interpolation on the boundary pixels of each sub-region to obtain a first image; Step S202, randomly adjusting the normal illumination image by gamma transformation to obtain a first image; Step S203, obtaining a first image by adding Gaussian noise to the normal illumination image; Gaussian noise is a normally distributed noise with a mean of 0 added to each pixel value of a normal illumination image, and the noise amplitude control parameter ranges from 10 to 30; Step S204, randomly adjusting the normal illumination image by Gaussian blur to obtain a first image; Gaussian blur is a convolution process of a normal light image using a two-dimensional Gaussian kernel. The size of the two-dimensional Gaussian kernel is a custom parameter, and the blur intensity control parameter ranges from 1 to 3. Step S205 , randomly selecting a position in the normal illumination image to generate a rectangular frame of random size, and regenerating pixel values ​​within the rectangular frame to obtain a first image; The random position is the upper left corner of the rectangular box, the length of the rectangular box ranges from H / 5 to H / 20, the width of the rectangular box ranges from H / 10 to H / 20, H and W represent the length and width of the normal illumination image respectively, and the pixel value in the rectangular box ranges from 120 to 140; Step S206, randomly rotating the normal illumination image to obtain a first image; The rotation range is between ±5° and ±15°.

[0008] Furthermore, the local histogram equalization process is to first count the frequency of occurrence of each pixel value in a single channel sub-region, and determine that the frequency of occurrence is greater than or equal to a preset frequency threshold, then clip the frequency of the excess part and evenly distribute it to other pixel values, and then divide it by the number of pixels in a single channel sub-region to obtain the frequency of the pixel value, and finally accumulate the frequency from the pixel value of 0 to the frequency of the pixel value to obtain the cumulative frequency, and then multiply it by 255 and round it down as the new pixel value with the same pixel value in the single channel sub-region, where the preset frequency threshold is equal to the contrast limit threshold multiplied by the number of pixels in the single channel sub-region, and the contrast limit threshold, M and N are all custom parameters.

[0009] Furthermore, the image enhancement model is built based on the YOLOV8 model, and the absolute error loss and SSIM structural similarity loss of the pixel values ​​of the normal illumination images at four angles and the second images at four angles are added.

[0010] Furthermore, the second image at each angle is divided into A×B sub-regions, each sub-region is used as a node of the graph structure data, and edges between corresponding nodes are constructed between adjacent sub-regions and between boundary sub-regions of the second images at adjacent angles, where A and B are both custom parameters.

[0011] Furthermore, the morphological scoring model consists of a first sequence analysis layer, a second sequence analysis layer, a feature extraction layer, an aggregation layer, a feature fusion layer, and a fully connected layer; The first sequence analysis layer inputs the feeding sequence and outputs the first vector; The second sequence analysis layer inputs the environment sequence and outputs the second vector; The feature extraction layer extracts feature maps of sub-regions corresponding to all nodes of the graph structure data through a convolutional neural network model, and converts them into a third vector representation through global average pooling. The number of dimensions of the third vector is the same as the number of convolution kernels in the convolutional neural network model. The aggregation layer inputs graph structure data and outputs the fourth vector; The feature fusion layer is used to fuse the first, second, and fourth vectors to obtain the fifth vector, and then input the fifth vector into the fully connected layer to output the morphological score of the cattle. wherein the first vector, the second vector, the fourth vector and the fifth vector have the same number of dimensions; Both the first sequence analysis layer and the second sequence analysis layer are built based on the LSTM model.

[0012] Furthermore, the aggregation layer is constructed based on the GAT model. The aggregation layer updates the third vectors corresponding to all nodes of the graph structure data to obtain an update vector, stacks the update vectors of all nodes to construct an update matrix, and then outputs the fourth vector through nonlinear mapping.

[0013] Furthermore, during the image acquisition stage, the electronic ear tags of the cattle are synchronously read to obtain the basic information of the corresponding cattle, and the sex and age of the cattle are used as sample labels of the pre-training samples of the morphological scoring model.

[0014] The present invention provides a multi-source fusion cattle feature analysis and identification system, comprising: The first module is used to manually mark the lesion area in the normal light images of the cattle at four angles, and perform preprocessing to obtain the first image as a training data set for the image enhancement model; The second module is used to input the normal lighting images of the cattle at four angles into the trained image enhancement model and output a second image; The third module is used to collect feeding records and environmental data of cattle at preset time intervals within a preset time period, and perform normalization processing to obtain feeding sequences and environmental sequences; The fourth module is used to manually annotate the morphological scores of cattle. The second image from four angles is segmented to construct graph structure data, which is used together with the feeding sequence and environment sequence as the training data set for the morphological scoring model. The fifth module is used to collect basic information of cattle to pre-train the morphological scoring model before training the morphological scoring model; The sixth module is used to input the graph structure data, feeding sequence and environment sequence into the trained morphological scoring model and output the morphological score of the cattle.

[0015] The beneficial effects of the present invention are that: while the present invention reduces interference from factors such as shooting angle, lighting conditions and image occlusion through the image enhancement model, it can also identify the diseased areas of cattle, and simultaneously integrate the features of multi-angle images, feeding records and environmental data through the morphological scoring model, thereby improving the accuracy of cattle health status assessment. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is a flow chart of a multi-source fusion cattle feature analysis and identification method of the present invention; Figure 2 is a flow chart of obtaining a first image through preprocessing according to the present invention; Figure 3 It is a schematic diagram of a multi-source fusion cattle feature analysis and identification system of the present invention.

[0017] In the figure: first module 301, second module 302, third module 303, fourth module 304, fifth module 305, and sixth module 306. DETAILED DESCRIPTION

[0018] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed solely to enable those skilled in the art to better understand and implement the subject matter described herein, and that the functions and arrangements of the elements discussed may be varied without departing from the scope of this specification. Various examples may omit, substitute, or add various processes or components as needed. In addition, features described with respect to some examples may also be combined in other examples.

[0019] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in one or more embodiments of the present invention should have the usual meanings understood by people with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar words used in one or more embodiments of the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprising" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship may also change accordingly.

[0020] like Figures 1 to 3 As shown, a multi-source fusion cattle feature analysis and identification method includes the following steps: Step S101, manually marking the lesion area in the normal light images of the cattle at four angles, and performing preprocessing to obtain the first image as a training data set for the image enhancement model; Step S102: input the normal lighting images of the cattle at four angles into the trained image enhancement model to output a second image; The normal illumination image, the first image, and the second image have the same size; Step S103, within a preset time period, collecting cattle feeding records and environmental data at preset time intervals, and performing normalization processing to obtain feeding sequences and environmental sequences; Step S104: manually labeling the morphological scores of the cattle, segmenting the second images from the four angles to construct graph structure data, and using the feeding sequence and the environment sequence as a training data set for the morphological scoring model; Step S105, before training the morphological scoring model, collecting basic information of the cattle to pre-train the morphological scoring model; Step S106: input the graph structure data, feeding sequence and environment sequence into the trained morphological scoring model to output the morphological score of the cattle.

[0021] It should be noted that the training dataset consists of multiple training samples, each training sample includes sample data and sample labels. The sample data and sample labels of the training samples of the image enhancement model are the first image and the normal light image with annotations, respectively. The sample data of the training samples of the morphological scoring model include graph structure data, feeding sequence and environment sequence. The sample label of the training samples of the morphological scoring model is morphological score, and the training dataset can be divided into a training set (for updating the parameters of the model), a validation set (for monitoring whether the model is overfitting and parameter fine-tuning) and a test set (for evaluating the performance of the model) in a ratio of 7:2:1. In addition, commonly used annotation tools can be Labelme, LabelImg, CVAT, etc., which will not be elaborated here.

[0022] In one embodiment of the present invention, the normal lighting images and ordinary lighting images of the cow at four angles are collected individually, and the four angles are the front side perspective, the rear side perspective, the left side perspective and the right side perspective of the cow.

[0023] It should be noted that individual recognition can accurately match the shooting perspective and reduce the interference of multiple cows in the same frame. It is also adapted to the automated physical examination process of cattle, such as single cow standing detection, thereby improving the accuracy of cattle health status assessment.

[0024] In one embodiment of the present invention, the feeding data includes daily feed intake, daily water intake and number of historical illnesses, and may also include number of ruminations, standing time, number of lying times, etc.; the environmental data includes indoor temperature, relative humidity, light intensity and concentration of harmful gases (such as ammonia), etc.; the number of sequence units of the feeding sequence and the environmental sequence is equal to the preset time period divided by the preset time interval, where the preset time period and the preset time interval are both custom parameters, and the number of sequence units of the feeding sequence and the environmental sequence may also be different. For example, if the feeding data is collected every day within 7 days, the number of sequence units of the feeding sequence is 7; for example, if the environmental data is collected every hour within 1 day, the number of sequence units of the environmental sequence is 24, which will not be elaborated here.

[0025] In one embodiment of the present invention, the normalization processing method of the feeding records and environmental data can be a Min-Max normalization method or a Z-Score normalization method.

[0026] In one embodiment of the present invention, Figure 2 As shown, preprocessing to obtain the first image includes the following steps: Step S201: Divide the normal illumination image into M×N sub-regions, perform local histogram equalization on the three channels of each sub-region, and perform bilinear interpolation on the boundary pixels of each sub-region to obtain a first image; The local histogram equalization process is to first count the frequency of occurrence of each pixel value in a single channel sub-region, and determine that the frequency is greater than or equal to the preset frequency threshold. Then, the frequency of the excess part is clipped and evenly distributed to other pixel values, and then divided by the number of pixels in the single channel sub-region to obtain the frequency of the pixel value. Finally, the cumulative frequency is obtained by adding the pixel value from 0 to the frequency of the pixel value, and then multiplied by 255 and rounded down as the new pixel value with the same pixel value in the single channel sub-region. The preset frequency threshold is equal to the contrast limit threshold multiplied by the number of pixels in the single channel sub-region. The contrast limit threshold, M, and N are all custom parameters. For example, the contrast limit threshold is set to 0.01, and M and N are both set to 4. The frequency of the i-th pixel value The calculation formula is as follows: ,in represents the frequency of occurrence of the i-th pixel value, Represents the number of pixels in a single channel sub-region, represents the contrast limit threshold, Indicates the frequency of occurrence of the excess portion of the clipping; It should be noted that the normal illumination image includes three RGB channels, and the pixel value of each channel ranges from 0 to 255. For example, the size of the normal illumination image is 256×256, which is divided into 4×4 sub-regions. The number of pixels in a single channel sub-region is 64×64=4096. Assuming that the pixel value is 120 and appears 200 times in the sub-region, and the preset frequency threshold is 4096×0.01=40.96≈41, the excess 159 / 255≈0.62 is evenly distributed to other pixel values, so the frequency of the pixel value is 41 / 4096. Finally, the cumulative frequency is obtained by adding the pixel value 0 to the frequency of the pixel value. Assuming the cumulative frequency is 0.72, the rounding down of 0.72×255 is equal to 183, so the pixel value of a single channel sub-region is uniformly changed from the original 120 to 183. The calculation formula for bilinear interpolation is as follows: ,in represents the updated boundary pixel value, and Respectively represent the horizontal and vertical relative coordinates of the pixel in the sub-region, and Represent the upper left and lower left neighboring pixel values, and Represent the upper right and lower right neighboring pixel values ​​respectively; It should be noted that the horizontal and vertical relative coordinates of a pixel in a subregion are equal to the horizontal and vertical coordinates of the pixel minus the horizontal and vertical coordinates of the upper left corner of the subregion, divided by the length and width of the subregion respectively. For example, if the size of a normal illumination image is 256×256, the horizontal and vertical coordinates of the pixel are 74 and 130 respectively, and the horizontal and vertical coordinates of the upper left corner of the subregion are 64 and 128 respectively, then the horizontal and vertical relative coordinates of the pixel in the subregion are (74-64) / 64≈0.156 and (130-128) / 64≈0.031 respectively; Step S202, randomly adjusting the normal illumination image by gamma transformation to obtain a first image; The calculation formula of gamma transform is as follows: ,in represents the pixel value of the first image, Represents the normalized pixel value of the normal lighting image, Indicates the adjustment factor, the value range of the adjustment factor is between 0.5 and 1.5; Step S203, obtaining a first image by adding Gaussian noise to the normal illumination image; Gaussian noise is a normally distributed noise with a mean of 0 and a noise amplitude control parameter (standard deviation) ranging from 10 to 30, added to each pixel value of a normal illumination image. Step S204, randomly adjusting the normal illumination image by Gaussian blur to obtain a first image; Gaussian blur is a convolution process performed on a normally illuminated image using a two-dimensional Gaussian kernel. The size of the two-dimensional Gaussian kernel is a custom parameter. For example, the size of the two-dimensional Gaussian kernel is set to 3×3, and the blur intensity control parameter (the standard deviation of the two-dimensional Gaussian kernel) ranges from 1 to 3. Step S205 , randomly selecting a position in the normal illumination image to generate a rectangular frame of random size, and regenerating pixel values ​​within the rectangular frame to obtain a first image; The random position is the upper left corner of the rectangular box, the length of the rectangular box ranges from H / 5 to H / 20, the width of the rectangular box ranges from H / 10 to H / 20, H and W represent the length and width of the normal illumination image respectively, and the pixel value in the rectangular box ranges from 120 to 140; Step S206, randomly rotating the normal illumination image to obtain a first image; The rotation range is between ±5° and ±15°.

[0027] It should be noted that local histogram equalization is used to enhance local contrast and simulate complex light and shadow structures; gamma transformation is used to adjust image brightness and simulate overexposure or underexposure; Gaussian noise and Gaussian blur are added to simulate shooting shake or focus offset; random generation of rectangular frames is used to simulate partial occlusion of the image; random rotation is used to simulate shooting angle offset; therefore, the form of the first image includes multiple situations, which can improve the robustness of the image enhancement model.

[0028] In one embodiment of the present invention, the image enhancement model is constructed based on the YOLOV8 model, and the absolute error loss and SSIM structural similarity loss of the pixel values ​​of the normal illumination image at four angles and the second image at four angles are added.

[0029] It should be noted that the value range of SSIM structural similarity loss is between 0 and 1. The closer it is to 1, the more similar the image structure is. The image enhancement model adds additional encoders and decoders on the basis of the original YOLOV8 model. The encoder reuses the C2f (cross-stage partial fusion) module and SPPF (spatial pyramid pooling) module of the YOLOV8 model. The decoder adopts the progressive upsampling of UNet, that is, the size of the feature map is restored layer by layer through transposed convolution, so as to ensure that the image is enhanced while being able to identify the lesion area. I will not go into details here.

[0030] In one embodiment of the present invention, the second image at each angle is divided into A×B sub-regions, each sub-region serves as a node of the graph structure data, and edges between corresponding nodes are constructed between adjacent sub-regions and between boundary sub-regions of the second images at adjacent angles, where A and B are both custom parameters. For example, if A and B are both set to 8, there are a total of 8×8×4=256 sub-regions, that is, the graph structure data includes 256 nodes.

[0031] In one embodiment of the present invention, the morphological scoring model consists of a first sequence analysis layer, a second sequence analysis layer, a feature extraction layer, an aggregation layer, a feature fusion layer, and a fully connected layer; The first sequence analysis layer inputs the feeding sequence and outputs the first vector; The second sequence analysis layer inputs the environment sequence and outputs the second vector; The feature extraction layer extracts feature maps of sub-regions corresponding to all nodes of the graph structure data through a convolutional neural network model, and converts them into a third vector representation through global average pooling. The number of dimensions of the third vector is the same as the number of convolution kernels in the convolutional neural network model. For example, the number of dimensions of the third vector is set to 8. The aggregation layer inputs graph structure data and outputs the fourth vector; The feature fusion layer is used to fuse the first, second, and fourth vectors to obtain the fifth vector, and then input the fifth vector into the fully connected layer to output the morphological score of the cattle. The first vector, the second vector, the fourth vector, and the fifth vector have the same number of dimensions.

[0032] It should be noted that the number of dimensions of the first vector, the second vector, and the fourth vector are all custom parameters. For example, if the number of dimensions of the first vector, the second vector, and the fourth vector are all set to 16, the number of dimensions of the fifth vector is also 16.

[0033] In one embodiment of the present invention, the first sequence analysis layer and the second sequence analysis layer are both constructed based on an LSTM (long short-term memory recurrent neural network) model, and can also be constructed based on an RNN (recurrent neural network) model, and the feeding records and environmental data of the next time point of the input sequence can be used as sample labels for pre-training samples of the first sequence analysis layer and the second sequence analysis layer, respectively.

[0034] In one embodiment of the present invention, the aggregation layer is constructed based on the GAT (Graph Attention Network) model. The aggregation layer updates the third vector corresponding to all nodes of the graph structure data to obtain an update vector, stacks the update vectors of all nodes to construct an update matrix, and then outputs a fourth vector through nonlinear mapping. The calculation formula of nonlinear mapping is as follows: ,in The fourth vector representing the output of the aggregation layer, represents the update matrix, and represent the first weight parameter and the second weight parameter respectively, and represent the first bias parameter and the second bias parameter respectively, Represents the PReLU activation function.

[0035] It should be noted that the number of dimensions of the update vector is a custom parameter. For example, the number of dimensions of the update vector is set to 8. According to the above content, the size of the update matrix is ​​256×8. Then the first weight parameter needs to be designed as a vector of 1×256, the first bias parameter needs to be designed as a vector of 1×8, the second weight parameter needs to be designed as a matrix of 8×16, and the second bias parameter needs to be designed as a vector of 1×16.

[0036] In one embodiment of the present invention, the aggregation layer can also be constructed based on a GCN (graph convolutional network) model, which is not described here in detail.

[0037] In one embodiment of the present invention, the calculation formula of the feature fusion layer includes: ,in Represents the fifth vector output by the feature fusion layer, and Respectively represent the i-th vector (one of the first vector, the second vector and the fourth vector) and the corresponding gate vector, represents element-wise multiplication; ,in and Respectively represent the weight parameters and bias parameters corresponding to the i-th vector, represents the Gaussian error function.

[0038] It should be noted that, according to the above content, the corresponding weight parameters need to be designed as a 16×16 matrix, and the bias parameters need to be designed as a 1×16 vector. The corresponding gating vector has 16 dimensions.

[0039] In one embodiment of the present invention, the electronic ear tags (RFID tags) of cattle are synchronously read during the image acquisition stage to obtain basic information of the corresponding cattle, including the unique number of the cattle, the unique code of the ear tag, the sex and the age at birth, wherein the sex and the age at birth of the cattle are used as sample labels of the pre-training samples of the morphological scoring model.

[0040] In one embodiment of the present invention, Figure 3 As shown, a multi-source fusion cattle feature analysis and identification system includes: The first module 301 is used to manually mark the lesion area in the normal light images of the cattle at four angles, and perform preprocessing to obtain the first image as a training data set for the image enhancement model; The second module 302 is configured to input the normal illumination images of the cattle at four angles into the trained image enhancement model and output a second image; The third module 303 is used to collect feeding records and environmental data of cattle at preset time intervals within a preset time period, and perform normalization processing to obtain feeding sequences and environmental sequences; The fourth module 304 is used to manually label the morphological scores of cattle, segment the second images from four angles to construct graph structure data, and use the data together with the feeding sequence and the environment sequence as a training data set for the morphological scoring model; The fifth module 305 is used to collect basic information of cattle to pre-train the morphological scoring model before training the morphological scoring model; The sixth module 306 is used to input the graph structure data, feeding sequence and environment sequence into the trained morphological scoring model, and output the morphological score of the cattle.

[0041] It should be noted that the intervals and thresholds are set for ease of comparison. The threshold size depends on the amount of sample data and the cardinality set by those skilled in the art for each set of sample data, as long as it does not affect the proportional relationship between the parameter and the quantized value. Furthermore, the above formulas are all dimensionless numerical calculations. These formulas are derived from software simulations of the most recent real-world conditions using large amounts of data. The preset parameters in these formulas are set by those skilled in the art based on actual conditions.

[0042] The above describes the embodiments of this embodiment, but this embodiment is not limited to the above specific implementation methods. The above specific implementation methods are merely illustrative and not restrictive. Ordinary technicians in this field can also make many forms based on the inspiration of this embodiment, all of which are protected by this embodiment.

Claims

1. A multi-source fusion cattle feature analysis and identification method, characterized in that: The following steps are involved: Step S101, manually marking the lesion area in the normal light images of the cattle at four angles, and performing preprocessing to obtain the first image as a training data set for the image enhancement model; Step S102: input the normal lighting images of the cattle at four angles into the trained image enhancement model to output a second image; The normal illumination image, the first image, and the second image have the same size; Step S103, within a preset time period, collecting cattle feeding records and environmental data at preset time intervals, and performing normalization processing to obtain feeding sequences and environmental sequences; Step S104: manually labeling the morphological scores of the cattle, segmenting the second images from the four angles to construct graph structure data, and using the feeding sequence and the environment sequence as a training data set for the morphological scoring model; Step S105, before training the morphological scoring model, collecting basic information of the cattle to pre-train the morphological scoring model; Step S106: input the graph structure data, feeding sequence and environment sequence into the trained morphological scoring model to output the morphological score of the cattle.

2. The multi-source fusion cattle feature analysis and identification method according to claim 1 is characterized in that: The normal lighting images and common lighting images of the cow at four angles are collected from a single individual, and the four angles are the front, rear, left and right perspectives of the cow.

3. The multi-source fusion cattle feature analysis and identification method according to claim 1, characterized in that: The preprocessing step to obtain the first image includes the following steps: Step S201: Divide the normal illumination image into M×N sub-regions, perform local histogram equalization on the three channels of each sub-region, and perform bilinear interpolation on the boundary pixels of each sub-region to obtain a first image; Step S202, randomly adjusting the normal illumination image by gamma transformation to obtain a first image; Step S203, obtaining a first image by adding Gaussian noise to the normal illumination image; Gaussian noise is a normally distributed noise with a mean of 0 added to each pixel value of a normal illumination image, and the noise amplitude control parameter ranges from 10 to 30; Step S204, randomly adjusting the normal illumination image by Gaussian blur to obtain a first image; Gaussian blur is a convolution process of a normal light image using a two-dimensional Gaussian kernel. The size of the two-dimensional Gaussian kernel is a custom parameter, and the blur intensity control parameter ranges from 1 to 3. Step S205 , randomly selecting a position in the normal illumination image to generate a rectangular frame of random size, and regenerating pixel values ​​within the rectangular frame to obtain a first image; The random position is the upper left corner of the rectangular box, the length of the rectangular box ranges from H / 5 to H / 20, the width of the rectangular box ranges from H / 10 to H / 20, H and W represent the length and width of the normal illumination image respectively, and the pixel value in the rectangular box ranges from 120 to 140; Step S206, randomly rotating the normal illumination image to obtain a first image; The rotation range is between ±5° and ±15°.

4. The multi-source fusion cattle feature analysis and identification method according to claim 3 is characterized in that: The local histogram equalization process is to first count the frequency of occurrence of each pixel value in a single channel sub-region, and determine that the frequency is greater than or equal to the preset frequency threshold. Then, the frequency of the excess part is clipped and evenly distributed to other pixel values. The frequency of the pixel value is then divided by the number of pixels in the single channel sub-region to obtain the frequency of the pixel value. Finally, the cumulative frequency is obtained by adding the pixel value from 0 to the frequency of the pixel value, and then multiplied by 255 and rounded down as the new pixel value with the same pixel value in the single channel sub-region. The preset frequency threshold is equal to the contrast limit threshold multiplied by the number of pixels in the single channel sub-region. The contrast limit threshold, M, and N are all custom parameters.

5. The method for analyzing and identifying cattle characteristics by multi-source fusion according to claim 1, characterized in that: The image enhancement model is built based on the YOLOV8 model, and adds the absolute error loss and SSIM structural similarity loss of the pixel values ​​of the normal illumination images at four angles and the second images at four angles.

6. The multi-source fusion cattle feature analysis and identification method according to claim 1, characterized in that: The second image at each angle is divided into A×B sub-regions, each sub-region is used as a node of the graph structure data, and edges between corresponding nodes are constructed between adjacent sub-regions and between boundary sub-regions of the second images at adjacent angles, where A and B are both custom parameters.

7. The multi-source fusion cattle feature analysis and identification method according to claim 6, characterized in that: The morphological scoring model consists of the first sequence analysis layer, the second sequence analysis layer, the feature extraction layer, the aggregation layer, the feature fusion layer, and the fully connected layer; The first sequence analysis layer inputs the feeding sequence and outputs the first vector; The second sequence analysis layer inputs the environment sequence and outputs the second vector; The feature extraction layer extracts feature maps of sub-regions corresponding to all nodes of the graph structure data through a convolutional neural network model, and converts them into a third vector representation through global average pooling. The number of dimensions of the third vector is the same as the number of convolution kernels in the convolutional neural network model. The aggregation layer inputs graph structure data and outputs the fourth vector; The feature fusion layer is used to fuse the first, second, and fourth vectors to obtain the fifth vector, and then input the fifth vector into the fully connected layer to output the morphological score of the cattle. wherein the first vector, the second vector, the fourth vector and the fifth vector have the same number of dimensions; Both the first sequence analysis layer and the second sequence analysis layer are built based on the LSTM model.

8. The multi-source fusion cattle feature analysis and identification method according to claim 7 is characterized in that: The aggregation layer is built based on the GAT model. The aggregation layer updates the third vector corresponding to all nodes of the graph structure data to obtain an update vector, stacks the update vectors of all nodes to construct an update matrix, and then outputs the fourth vector through nonlinear mapping.

9. The multi-source fusion cattle feature analysis and identification method according to claim 1, characterized in that: During the image acquisition phase, the electronic ear tags of the cattle are synchronously read to obtain the basic information of the corresponding cattle, and the sex and age of the cattle are used as sample labels for the pre-training samples of the morphological scoring model.

10. A multi-source fusion cattle feature analysis and identification system, characterized by: Executing a multi-source fusion cattle feature analysis and identification method as claimed in any one of claims 1 to 9, comprising: The first module is used to manually mark the lesion area in the normal light images of the cattle at four angles, and perform preprocessing to obtain the first image as a training data set for the image enhancement model; The second module is used to input the normal lighting images of the cattle at four angles into the trained image enhancement model and output a second image; The third module is used to collect feeding records and environmental data of cattle at preset time intervals within a preset time period, and perform normalization processing to obtain feeding sequences and environmental sequences; The fourth module is used to manually annotate the morphological scores of cattle. The second image from four angles is segmented to construct graph structure data, which is used together with the feeding sequence and environment sequence as the training data set for the morphological scoring model. The fifth module is used to collect basic information of cattle to pre-train the morphological scoring model before training the morphological scoring model; The sixth module is used to input the graph structure data, feeding sequence and environment sequence into the trained morphological scoring model and output the morphological score of the cattle.

Citation Information

Cited By

  • Machine vision-based hippocampus sex and pregnancy identification method and automatic sorting system

    CN121259469A