In order to enable those skilled in the art to better understand the technical solutions of the present invention, the present invention will be further described in detail below in conjunction with the accompanying drawings.
 like figure 1 As shown, the present invention provides a kind of animal recognition method based on deep learning algorithm, comprises the steps:
 S101. Sign an insurance agreement, collect and obtain images of insured livestock;
 Specifically, the insurance purchase agreement can be signed offline or online. After the signing is completed, images of livestock can be obtained by using image acquisition devices with cameras such as mobile phones, cameras, and pads. The purpose of the present invention is to identify animals in the livestock breeding industry, so as to carry out financial insurance for livestock and reduce the risk of livestock financial insurance industry. Specifically, the user insurance agreement can also be signed online, such as using a PC to complete the signing of the online insurance agreement on the computer client; it can also be completed by downloading an APP on a mobile device (such as a mobile phone). Online insurance agreement signing.
 S102. Construct a neural network model, use the insured livestock image set to train the neural network model, and obtain an image feature recognition model;
 The neural network referred to in the present invention is referred to as neural network (NNs) or connection model (ConnectionModel) for short, and it is a kind of algorithmic mathematical model that imitates animal neural network behavior characteristic, carries out distributed parallel information processing. This kind of network depends on the complexity of the system, and achieves the purpose of processing information by adjusting the interconnection relationship between a large number of internal nodes. A computational model, to be divided into a neural network, usually requires a large number of connected nodes (also called 'neurons'), and has two characteristics: each neuron, through a specific output function (also called activation function activation function), calculates and processes weighted input values from other adjacent neurons; the strength of information transmission between neurons is defined by the so-called weighted value, and the algorithm will continuously learn by itself and adjust this weighted value. On this basis, the computational model of the neural network relies on a large amount of data for training. Therefore, after the neural network is constructed in the present invention, the constructed neural network is trained with animal images to improve the accuracy of the neural network.
 Specifically, the neural network module includes but is not limited to VGG, Facenet and the like. Input animal images into the neural network model, use the neural network model to train and verify the image set, so as to update the relevant parameters and algorithm branches in the neural model, and form an image recognition model for new features of this type of animal (optionally include local feature recognition models such as pig face recognition models, pig noses, etc., and also optionally include pig body overall recognition models). Specifically, in this embodiment, the neural network model includes an input layer, a convolutional layer, a batch normalization layer, a nonlinear layer, a pooling layer, a fully connected layer, a softmax loss layer, and the like. Among them, the data input layer is used to receive animal images and preprocess the animal images; the convolution layer is used to extract the image features of the preprocessed animal images; the batch normalization layer is used to plan the image features ; Nonlinear layer, used for nonlinear transformation of image features or normalized image features; pooling layer, used for mapping image features and animal images; fully connected layer, used for linear transformation of image features; softmax Loss layer, used to calculate the error of predicted class and label class.
 Specifically, construct the neural network model, and use the insured livestock image set to train the neural network model. Optionally, first set the animal image data set as a training sample set and a correction sample set; secondly, pass the training sample set through the neural network in turn Layer neurons to obtain a preliminary image feature recognition model; finally, the corrected sample set is input to the preliminary image feature recognition model for parameter correction to obtain an image feature recognition model.
 S103. Receive the image of the livestock to be identified and input it into the image feature recognition model, calculate the similarity between the livestock to be identified and the insured livestock to determine whether the livestock to be identified is the insured livestock, and if so, settle the claim according to the insurance agreement.
 The purpose of the present invention is to apply financial insurance to the livestock breeding industry, thereby promoting the development of the livestock breeding industry, developing the livestock industry, and contributing to the increase of farmers' income. The most difficult thing in the livestock insurance process is to identify whether the sick or dead livestock are insured. Therefore, in order to solve this sub-problem, the present invention uses the deep learning algorithm in artificial intelligence, relies on the neural network model, and uses the collected images of insured livestock (Livestock head or other partial images) train the neural network model to complete the relevant feature extraction and obtain the image feature recognition model. The special image recognition model includes the relationship between the livestock image and the corresponding calculation method. The feature recognition model recognizes the image of the livestock to be identified, and can complete the feature extraction of the image of the livestock to be identified, so as to calculate the similarity with each image of the insured livestock, so as to determine whether the image of the animal to be identified is the same individual animal or whether it is an insured animal (Specifically, the judgment is completed based on the comparison between the similarity degree and the preset threshold value. When the similarity degree is not less than the threshold value, it is judged as insured livestock, otherwise it is not insured livestock), so as to judge whether to carry out the claims process and lower the threshold of the livestock insurance industry. Compared with the traditional technology, the present invention does not need to implant any marks on the living animal, which can reduce the risk of injury to the living animal; it is very easy for the user to take pictures or video, which can speed up the related business and reduce the business risk. the cost of.
 Further, before constructing the neural network model, using the insured livestock image set to train the neural network model, and obtaining the image feature recognition model, it includes preprocessing the insured livestock image. Among them, such as figure 2 As shown, the preprocessing of the insured livestock image includes
 S201. Acquire an image set of each livestock and detect the feature frame of the animal image. The image set includes at least one kind of picture; the more pictures of each livestock, the more accurate the feature extraction of the livestock.
 By collecting images of livestock, the image of each livestock is marked for distinction, in preparation for the later start of the claim settlement process, and to prevent claims caused by malicious intentions of others. During specific implementation, the processing and marking of each insured livestock image can be optionally implemented in a set manner, such as S1(p1, p2...pn), where N is a natural number not less than 1.
 During specific implementation, the optional FaceDetectionListener of the animal image frame in the present invention is used to detect the animal image features, and the detected animal image features (such as local parts such as pig face, pig nose, or the whole pig body) are drawn out with a rectangular frame . The present invention can optionally use PlayCameraV1.0.0 to obtain it through processing in the open and preview of the Camera.
 Specifically, the following preprocessing can be performed on the animal image between the detection feature frames of the animal image:
 1. After grayscale, binarize, hough transform, and detect the longest straight line;
 2. Calculate the slope and angle, and then correct it;
 x1 = xy_long(:,1);
 % Find the slope of the line segment
 I1 = imrotate(I, -90-angle, 'bilinear').
 S202. Mark the animal image feature frames in each image set.
 Since the size of each animal image frame may be different, in specific implementation, in order to facilitate management, the images in the range of each livestock feature area are firstly normalized, and optionally all the livestock feature areas are normalized to a uniform resolution, Such as 50*50.
 Further, in this embodiment, as image 3 shown in S103 includes
 S1031. Determine whether the number of images of livestock to be identified is not 1, if the number of images of identified livestock is 1, execute S1033, otherwise execute S1032.
 S1032. Determine whether the livestock to be identified is an insured livestock;
 During specific implementation, the similarity between the livestock to be identified and the insured livestock can be calculated, and the similarity is compared with a threshold. If the similarity is not less than the threshold, it is determined that the livestock to be identified is an insured livestock, otherwise it is not. If the livestock to be identified is A, the calculated similarity between A and S1 in the insured livestock is 50%, the similarity with S2 is 80%, and the similarity with S3 is 98%, assuming the threshold is 90%, then A judges A It is S3, which belongs to insured livestock.
 S1033. Judging whether the livestock to be identified is an insured livestock and whether the images of each livestock to be identified correspond to the same livestock.
 further, such as Figure 4 shown, the S103 also includes
 S301. Obtain the contact information of the livestock breeder according to the insurance application agreement; since the insurance application agreement can be filled out manually or online, when the insurance application agreement is manually filled out, the image recognition algorithm can be used to extract the insurance from the picture of the insurance agreement The contact information of the person; when the insurance agreement is filled out online, the system can directly obtain and read the contact information column.
 S302. Collect livestock epidemic information and/or breeding guidance information from the server of the livestock service center in real time, and send the livestock epidemic information and/or breeding guidance information to livestock farmers corresponding to the contact information.
 The purpose of the present invention is to apply financial insurance to animal husbandry so as to promote its development, and then contribute to the increase of farmers' income. Therefore, optional breeding is very important. At the same time, in order to reduce the risk of financial insurance companies, the present invention collects livestock epidemic situation information and/or breeding guidance information from the server of the animal husbandry service center and sends them to farmers, so as to realize scientific guidance for farmers to breed and improve breeding. Efficiency, thereby reducing the breeding risk of farmers, and reducing the insurance investment risk of financial insurance companies.
 like Figure 5 As shown, the present invention also provides a financial insurance application system based on animal recognition, including an image acquisition module 10 , a recognition model module 20 and a claim judgment module 30 .
 During specific implementation, the financial insurance system based on animal identification can be applied to the client of mobile devices (such as mobile phones, PADs, PCs, etc.), and users can complete the insurance by downloading the client APP or accessing the client interface Livestock image processing and identification of livestock images to be identified
 No, to complete the claim.
 The image collection module 10 is used to collect and obtain the images of the insured livestock after signing the insurance agreement; specifically, the image collection module can optionally use a reserved interface to access the camera of the mobile device, thereby completing the purpose of collecting images of the insured livestock, or use a professional camera to collect.
 Recognition model module 20, is used for constructing neural network model, utilizes insured livestock image set to train neural network model, obtains image feature recognition model;
 The claim settlement judgment module 30 is used to receive the image of the livestock to be identified, and input it into the image feature recognition model, and calculate the similarity between the livestock to be identified and the insured livestock to determine whether the livestock to be identified is an insured livestock, and if so, settle the claim according to the insurance agreement .
 Further, the recognition model module includes
 The preprocessing sub-module preprocesses the images of insured livestock;
 Among them, the preprocessing submodule includes
 An extraction unit, configured to obtain an image set of each livestock, the image set includes at least one type of picture;
 An identification unit is used for labeling each image set.
 Further, the claims judgment module includes
 A quantity judging unit, configured to judge whether the number of images of livestock to be identified is not 1;
 The livestock identification unit is used to determine whether the livestock to be identified is an insured livestock and whether the images corresponding to each image of the livestock to be identified correspond to the same animal if the number of images to identify the livestock is not 1; or if the number of images to identify the livestock If it is 1, it is judged whether the livestock to be identified is an insured livestock.
 Further, the claims judgment module includes
 The contact information extraction unit is used to obtain the contact information of the livestock farmers according to the insurance agreement;
 The breeding information push unit is used to collect livestock breeding information and/or breeding guidance information within a preset range, and send the livestock breeding information and/or breeding guidance information to livestock farmers corresponding to the contact information.
During specific implementation, the animal identification system based on the deep learning algorithm described in the present invention can be optionally applied to the field of finance and insurance. For example, if a farmer raises 500 pigs and insures 100 pigs with an insurance company, the insurance company only needs to ask the farmer to take pictures of the 100 pigs, and use the original trained pig faces in the background. The model learns the new images of the 100 pigs, completes the extraction of the relevant features of the 100 pigs, and stores them in the model. When the farmer reports that one of the 100 pigs insured is sick or dead, the farmer only needs to record or take a photo of the pig and upload it to the insurance company. Algorithm) to judge whether the pig provided by breeding is one of the 100 pigs previously insured, so as to decide whether to pay compensation.
 Certain exemplary embodiments of the present invention have been described above only by way of illustration, and it goes without saying that those skilled in the art can use various methods without departing from the spirit and scope of the present invention. The described embodiments are modified. Therefore, the above drawings and descriptions are illustrative in nature and should not be construed as limiting the protection scope of the claims of the present invention.