Pork tracing method based on multi-source information fusion technology
By combining RFID and pig face recognition technology, using blockchain to store traceability data, the security and cost of RFID in the existing pork traceability system is solved, the safety and reliability of pork traceability system is realized, and the scientificity and efficiency of pig management are improved.
Patent Information
- Application Number
- CN202311581273.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-24
- Publication Date
- 2025-07-22
AI Technical Summary
In the existing pork traceability system, RFID electronic ear tags have security problems, high environmental requirements and expensive prices, and lack a comprehensive data management system, resulting in untrue and insecure traceability information.
Combining RFID technology and pig face recognition technology, by installing RFID tags with unique identification codes and pig face recognition models, we collect and process pig face image data, and use blockchain technology to store and manage traceability data to ensure data security and transparency.
It realizes the safety and reliability of the pork traceability system, can monitor the growth of pigs in real time, improves the accuracy and transparency of traceability information, reduces system costs, and enhances data security and management efficiency.
Smart Images

Figure CN120355426A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of radio frequency identification technology (RFID), pig face recognition technology and blockchain technology, and particularly to a pork traceability method based on multi-source information fusion technology. Background Art
[0002] With the rapid development of China's national economy and the steady improvement of people's living standards, the diet structure of consumers has changed greatly, the consumption ratio of meat, eggs and milk has increased significantly, and consumers' attention to the quality and safety of food has also increased unprecedentedly. Developed countries such as EU countries, the United States, and Australia have introduced laws and regulations, imposing mandatory requirements on the traceability of the quality and safety of meat products. As a daily meat product, pork accounts for a large proportion in China's consumption structure. There are problems such as difficult breeding and backward technology in pig farms, which are the main sources of pork, bringing great difficulties to the pig breeding industry. Therefore, it is of great significance to establish a suitable traceability system for pig farms.
[0003] Currently, there is no complete system to support the establishment of a data warehouse for the entire growth process of pigs for pig identity management and identity traceability. Currently, for pig identity management, ear tags or electronic ear tags (such as RFID radio frequency technology) are mostly used, and then the identity of the pig is confirmed by reading the information on the ear tag or electronic ear tag. However, the ear tag technology has the following disadvantages: putting an ear tag on the pig's ear will cause physical harm to the pig; if the ear tag falls off the pig or is damaged by the pig, the identity information of the pig will be lost; the ear tag information of different pig farms will be repeated, resulting in confusion in pork traceability information.
[0004] Electronic ear tags are complementary and upgraded products of visual ear tags. They are the basis of information intelligence. Many intelligent devices need to use electronic ear tags to complete automatic identification of information. With appropriate management software, pig safety and pig asset traceability and management can be achieved, and ultimately scientific management of pig farms can be achieved to achieve the goal of reducing costs and increasing efficiency. Electronic ear tags are ear tags based on RFID technology. The main advantage of RFID is non-contact identification. Under the background of African swine fever, whether it is for biosafety prevention and control of pig farms or effective tracking and tracing of pigs, wearing electronic ear tags for management is the simplest and most efficient, which greatly improves the work efficiency of employees and reduces costs. At the same time, electronic ear tags also have some shortcomings. The current security issues faced by RFID technology are mainly manifested in the illegal reading and malicious tampering of RFID electronic tag information, which makes the market have more and more doubts about its information protection and security level. Secondly, RFID technology has certain requirements for the use environment, and it should be used as much as possible in an environment without strong magnetic interference. In addition, the price of electronic ear tags is relatively high, and they have a service life and cannot be reused.
[0005] Pig face recognition is based on building an AI algorithm, and can identify the pig's identity through the pig's appearance features such as the distance between the two eyes, the position of the mouth, the width of the skull, the pattern, and the body proportions. In the specific operation, the pig's facial image is collected through a camera or special equipment, and the pig face recognition technology is used to analyze and compare the image. This technology can extract the facial features of the pig and compare them with the features in the existing pig face database to determine the pig's identity and attributes. At present, pig face recognition can not only determine the breed of pigs by identifying the facial features and body shape of animals, but also determine the health of pigs by identifying the body shape and movements of pigs, realize daily individual information management and full process traceability, and make pig breeding and production more scientific and controllable. By combining RFID and pig face recognition technology, the pork traceability system can achieve more comprehensive, accurate and reliable traceability to ensure the safety and quality of pork.
[0006] Blockchain technology includes cryptography, distributed storage, smart contracts and consensus mechanisms. It is a decentralized distributed ledger technology that maintains an unalterable data record through multiple nodes. In the pork traceability system, blockchain technology is used to store and manage pig traceability data and ensure the security and unalterability of the data. Each collected pig face image and RFID data will be packaged into a data block and verified and stored with other nodes through encryption and consensus mechanisms. Blockchain technology can realize decentralized storage, verification and sharing of data, ensuring the credibility and transparency of pork traceability data. Summary of the invention
[0007] In order to improve the traceability of the pork traceability system, enhance the security and transparency of data, and address consumers' concerns about pork quality and safety, the present invention proposes a pork traceability method based on multi-source information fusion technology. This method utilizes the technology of combining RFID and pig face recognition, which can solve the security and price problems of electronic ear tags and the problem of difficult pig face recognition operation. At the same time, blockchain technology can make up for the deficiency of the insecure combination of RFID and pig face recognition.
[0008] The technical solution of the present invention is implemented as follows:
[0009] A pork traceability method based on multi-source information fusion technology, the steps of which are as follows:
[0010] Step 1: Use RFID technology to install an RFID tag with a unique identification code for each pig; collect relevant information of pigs during the breeding, slaughtering, processing, and transportation stages;
[0011] Step 2: Use a camera to collect pig face data, preprocess the pig face data to obtain a data set, and then divide the data set into a training set and a test set;
[0012] Step 3: Use the training set to train the convolutional neural network to obtain an initial pig face recognition model;
[0013] Step 4: Use the test set to optimize the initial pig face recognition model to obtain an optimal pig face recognition model;
[0014] Step 5: Package the pig face data collected each time and the relevant information of the pig corresponding to the RFID tag into a data block, and upload the data block to the nodes in the blockchain network;
[0015] Step 6: The user provides the corresponding identifier to retrieve the traceability information of a specific pig through the query interface of the blockchain network.
[0016] The relevant information of the pigs includes quarantine information, feeding status, and diet situation.
[0017] The convolutional neural network includes an Input layer, a Focus network layer, a BackBone network layer, a PANet network layer, and an Output layer; the Input layer receives the input pig face image data and passes it to the next layer; the Focus network layer upsamples the channel dimension of the pig face image and downsamples the height and width of the pig face image; the Backbone network layer extracts multi-scale feature information in the pig face image through convolutional operations and the activation function sigmoid; the PANet network layer merges the feature information of the pig face images from different resolutions at multiple scales; the Output layer uses the softmax function for multi-class probability prediction to finally obtain the attention distribution.
[0018] The convolutional neural network is provided with an LSTM module, and the LSTM module is provided with a forget gate; the formula of the forget gate is:
[0019] f t = σ(W f ·[h t-1 , X t +b f );
[0020] In the formula, f t is the forget gate function; σ(*) is the sigmoid activation function; h t-1 is the output at time step t-1; t is the time step indicator; X t is the input at the current time step; b f is the convolutional layer bias term; W f is the convolutional layer weight;
[0021] The formula of the attention module of the convolutional neural network is:
[0022] e ij = tanh((h s ·w)+b)*u;
[0023] In the formula, e ij is the attention weight before normalization; tanh(*) is the hyperbolic tangent function; h s is the output at each time step; w is the convolutional weight; b is the convolutional bias term; u is the scaling factor; i is the attention indicator; j is the unidirectional time step; the formula of the attention weight of the neural network is:
[0024]
[0025] In the formula, a ij is the attention weight after normalization; k is the time step indicator; n is the number of unidirectional time steps.
[0026] The output formula of the neural network is:
[0027]
[0028] In the formula, o ij is the output feature after attention weighting; h j is the output at each time step.
[0029] In step five, the specific method of uploading the packaged data to the blockchain network includes:
[0030] Distributed ledger technology: Using the distributed ledger technology of blockchain, each piece of pork traceability data is recorded on the blockchain, and encryption algorithms are used to ensure the security and consistency of the data;
[0031] Smart contract: In the pork traceability system, smart contracts are used to manage and execute operations such as data storage, query, and verification, improving the efficiency and reliability of the system;
[0032] Consensus algorithm: A consensus algorithm is selected in the pork traceability system to ensure that each node agrees to newly added data blocks and jointly maintains the consistency of the entire blockchain;
[0033] Public verifiability: The data in the blockchain network is verified in an open manner; Consumers and regulators can obtain the traceability information of pork by scanning the traceability code on the pork packaging or accessing the public data on the blockchain to verify the authenticity and quality of the product;
[0034] Data privacy protection: Through encryption technology and permission management, blockchain technology can protect the data privacy in the pork traceability system; Only participants with corresponding permissions can access and modify the data to ensure the security and integrity of the data.
[0035] The consensus algorithm is proof of work or proof of stake.
[0036] Compared with the prior art, the beneficial effects produced by the present invention are:
[0037] In the pork traceability system, to solve the problem of the untruthfulness of traceability information, by storing the data in the blockchain network, the security and reliability of the traceability information are ensured; The technology of pig face recognition can be used to monitor the physical condition of pigs in real time, quickly query the corresponding RFID tag code, obtain the relevant information of the corresponding pig, and make correct handling in a timely manner; At the same time, the pig face recognition model can be continuously optimized according to the RFID tag; The combined use of the three technologies can obtain a more perfect pork traceability system.
[0038] For the pork traceability system, in order to make up for the defects such as the lack of RFID electronic ear tags, the present invention adopts the pig face recognition technology to realize the real-time monitoring and identification record of pigs, and at the same time uploads the information to the blockchain network to ensure the security of the information. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0040] Figure 1 This is the block diagram of the pork traceability system of the present invention.
[0041] Figure 2 This is the flow chart of the pork traceability of the present invention.
[0042] Figure 3 This is the structure diagram of LSTM of the present invention.
[0043] Figure 4 This is the structure diagram of the forgetting gate in the LSTM structure. Specific embodiments
[0044] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0045] The embodiment of the present invention provides a pork traceability method based on multi-source information fusion technology. For the pork traceability system, in order to make up for defects such as the lack of RFID electronic ear tags, the present invention uses pig face recognition technology to realize real-time monitoring and identification records of pigs, and at the same time uploads the information to the blockchain network to ensure the security of the information. As Figure 1 shown, the pork traceability system in the present invention consists of three parts, namely RFID tags, pig face recognition, and blockchain technology. The three parts together form the pork traceability system in the breeding stage.
[0046] 1. RFID tags
[0047] (1) Identification and recording: Use RFID technology to install an RFID tag with a unique identification code for each pig, and bind the RFID electronic tag to each pig. Install the tag on the pig's ear and ensure that the tag corresponds to the identity information of the pig. During the subsequent breeding and processing process, information such as the quarantine information, feeding status, and diet of the pig is entered into the tag.
[0048] (2) Data collection: When the pig passes through the RFID reader, the reader scans the unique identifier on the tag and uploads the information to the blockchain network.
[0049] 2. Pig face recognition
[0050] Accurately identify the identity of each pig according to the pig face recognition model, monitor the growth of the pig, and can be combined with the RFID tag. Through pig face recognition, the tag number of the corresponding pig can be accurately found and corresponding processing can be carried out in a timely manner. The specific implementation process is as follows:
[0051] (1) First, collect enough pig face photos and pig videos. This information can be collected by installing some cameras around the pig farm (at positions where all pigs can be clearly photographed). These cameras also facilitate the real-time monitoring of the pig breeding situation in the later stage. After collection, preprocess the pig face data to obtain the preprocessed dataset, and divide the preprocessed dataset into a training set and a test set.
[0052] (2) According to the pig source data video files obtained by the collection cameras, for each pig video, the program reads each video frame and converts the video frame into a picture. Then, use the training set to train the neural network to obtain an initial pig face recognition model. The neural network is a convolutional neural network, and the convolutional neural network includes an Input layer, a Focus network layer, a BackBone network layer, a PANet network layer, and an Output layer. The Input layer (Input Layer) receives the input pig face image data and passes it to the next layer; the main purpose of the Focus network layer (Focus Network Layer) is to reduce the number of parameters, the number of network layers, gradients, and the number of calculations. Its manifestation is to perform upsampling on the channel dimension (i.e., shape and contour) of the pig face image and downsampling on the height and width of the pig face image; the Backbone network layer (Backbone Network Layer) extracts features in the pig face image through convolutional operations and the sigmoid activation function. It usually consists of multiple convolutional layers and pooling layers to gradually reduce the size of the feature map and extract higher-level feature information; the PANet network layer (PANet Network Layer) combines information from pig face images with different resolutions at multiple scales to solve the problem of inconsistent pig face image resolutions, so as to better understand and manipulate pig face features in the subsequent processing; the Output layer (Output Layer) uses the softmax function to perform probability predictions for multiple categories and finally obtains the attention distribution.
[0053] (3) The convolutional neural network is set with an LSTM module. As Figure 3 shown, the LSTM module is set with a forget gate; Figure 4 in the branch where f is located in
[0054] is the forget gate set by the LSTM module, and the formula for the forget gate is: t f f = σ(W t-1 · [h t-1 , X t + b f );
[0055] In the formula, f t is the forget gate function; σ(*) is the sigmoid activation function; ht-1 is the output at time step t-1; t is the time step indicator; X t is the input at the current time step; b f is the bias term of the convolutional layer; W f is the weight of the convolutional layer; the whole calculation process is to fuse the output of the previous time step and the input of the current time step through the convolutional layer, and then activate it through the sigmoid function, and the output is restricted between 0 and 1, where 0 means all forgotten and 1 means all retained.
[0056] (4) The formula for the attention module of the convolutional neural network is:
[0057] e ij = tanh((h s ·w)+b)*u;
[0058] In the formula, e ij is the attention weight before normalization; tanh(*) is the hyperbolic tangent function; h s is the output of each time step; w is the convolutional weight; b is the convolutional bias term; u is the scaling factor; i is the attention indicator; j is the unidirectional time step; the formula for the attention weight of the neural network is:
[0059]
[0060] In the formula, a ij is the attention weight after normalization; k is the time step indicator; n is the number of unidirectional time steps. This calculation is to perform the activation of the normalized exponential softmax function, and the output is restricted between 0 and 1 to obtain the attention distribution.
[0061] (5) The output formula of the neural network is:
[0062]
[0063] In the formula, o ij is the output feature after attention weighting; h j is the output of each time step.
[0064] (6) Finally, use the test set to optimize the initial pig face recognition model to obtain the optimal pig face recognition model.
[0065] 3. Blockchain network
[0066] Pack the pig face image and RFID data collected each time into a data block and upload it to the nodes in the blockchain network for subsequent traceability. The technologies used by the blockchain network in the pork traceability system are as follows.
[0067] (1) Distributed ledger technology: Utilize the distributed ledger technology of blockchain to record each piece of pork traceability data on the blockchain and ensure the security and consistency of the data through encryption algorithms.
[0068] (2) Smart contract: A smart contract is an automated contract executed on the blockchain that can automatically execute code logic according to pre-set conditions and rules. In the pork traceability system, smart contracts can be used to manage and execute operations such as data storage, query, and verification, improving the efficiency and reliability of the system.
[0069] (3) Consensus algorithm: To ensure the consistency of blockchain data, a suitable consensus algorithm needs to be selected in the pork traceability system, such as Proof of Work (PoW), Proof of Stake (PoS), etc. The consensus algorithm ensures that each node agrees on the newly added data block and jointly maintains the consistency of the entire blockchain.
[0070] (4) Public verifiability: The data in the blockchain network can be verified in a public manner. Consumers and regulators can obtain the pork traceability information by scanning the traceability code on the pork packaging or accessing the public data on the blockchain to verify the authenticity and quality of the product.
[0071] (5) Data privacy protection: Through encryption technology and permission management, blockchain technology can protect the data privacy in the pork traceability system. Only participants with corresponding permissions can access and modify the data, ensuring the security and integrity of the data.
[0072] Traceability method: For each pig, traceability is required. It is necessary to ensure that the RFID tag correctly records the relevant information of the pig, and continuously optimize the pig face recognition model to achieve the best. The blockchain network stores the relevant data for subsequent traceability. The specific traceability method is as Figure 2 shown:
[0073] Step 1: Use RFID technology to install an RFID tag with a unique identification code for each pig; collect the relevant information of the pig during the breeding, slaughtering, processing, transportation and other stages.
[0074] Step 2: Use a camera to collect enough pig face materials (pig photos and videos), preprocess the pig face materials to obtain a data set, and then divide the data set into a training set and a test set.
[0075] Step 3: Use the training set to train the convolutional neural network to obtain an initial pig face recognition model; first, use the forget gate of the convolutional neural network to calculate the output of the time step, that is, the output of h j The output. Secondly, calculate the attention module to obtain the normalized attention weight aij , the output after attention weighting can be obtained by combining the output of the time step, resulting in the output feature o. ij , thus obtaining the initial pig face recognition model.
[0076] Step 4: Use the test set to optimize the initial pig face recognition model to obtain the optimal pig face recognition model;
[0077] Step 5: Package the pig face data collected each time and the relevant information of the pig corresponding to the RFID tag into a data block, and upload the data block to the nodes in the blockchain network; before uploading the data to the blockchain, encrypt the data using an encryption algorithm. The collected data is submitted to the blockchain network as a transaction. The transaction can include the identity information of the data uploader, the timestamp, and the data itself. These transactions are added to the block to be packaged and wait for the miners in the network to verify and process. In the blockchain network, the miner nodes verify the submitted transactions and reach an agreement through the consensus algorithm. Each node will save a complete copy of the blockchain to ensure redundant backup and reliability of the data.
[0078] Step 6: Through the query interface of the blockchain network, the data stored on the blockchain can be accessed and queried as needed. The user provides the corresponding identifier (such as the RFID tag or pig face recognition data) through the query interface of the blockchain network to retrieve the traceability information of a specific pig.
[0079] In the pork traceability system, to solve the problem of the authenticity of traceability information, the present invention ensures the security and reliability of traceability information by storing the data in the blockchain network. The present invention uses the technology of pig face recognition to monitor the physical condition of pigs in real time, quickly query the corresponding RFID tag code, obtain the relevant information of the corresponding pig, and make correct handling in a timely manner. At the same time, the pig face recognition model can be continuously optimized according to the RFID tag. The combination of the three technologies can obtain a more perfect pork traceability system.
[0080] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A pork traceability method based on multi-source information fusion technology, characterized in that The steps are as follows: Step 1: Use RFID technology to install an RFID tag with a unique identification code on each pig; collect relevant information of pigs during the breeding, slaughtering, processing, and transportation stages; Step 2: Use a camera to collect pig face data, preprocess the pig face data to obtain a data set, and then divide the data set into a training set and a test set; Step 3: Use the training set to train a convolutional neural network to obtain an initial pig face recognition model; Step 4: Use the test set to optimize the initial pig face recognition model to obtain an optimal pig face recognition model; Step 5: Package the pig face data collected each time and the relevant information of the pig corresponding to the RFID tag into a data block, and upload the data block to the nodes in the blockchain network; Step 6: The user provides a corresponding identifier to retrieve the traceability information of a specific pig through the query interface of the blockchain network.
2. The pork traceability method based on multi-source information fusion technology according to claim 1, wherein The relevant information of the pigs includes quarantine information, feeding status, and diet.
3. The pork traceability method based on multi-source information fusion technology according to claim 1, characterized in that, The convolutional neural network includes an Input layer, a Focus network layer, a BackBone network layer, a PANet network layer, and an Output layer; the Input layer receives the input pig face image data and passes it to the next layer; the Focus network layer upsamples the channel dimension of the pig face image and downsamples the height and width of the pig face image; the Backbone network layer extracts multi-scale feature information in the pig face image through convolutional operations and the activation function sigmoid; The PANet network layer merges the feature information of pig face images from different resolutions at multiple scales; the Output layer uses the softmax function for multi-class probability prediction to finally obtain the attention distribution.
4. The pork traceability method based on multi-source information fusion technology according to claim 1, characterized in that, The convolutional neural network is provided with an LSTM module, and the LSTM module is provided with a forget gate; the formula of the forget gate is: f t = σ(W f · [h t-1 , X t + b f ); where, f t is the forgetting gate function; σ(*) is the sigmoid activation function; h t-1 is the output at time step t-1; t is the time step indicator; X t is the input at the current time step; b f is the bias term of the convolutional layer; W f is the weight of the convolutional layer.
5. The pork traceability method based on multi-source information fusion technology according to claim 4, characterized in that, The formula of the attention module of the convolutional neural network is: e ij = tanh((h s · w) + b) * u; where, e ij is the attention weight before normalization; tanh(*) is the hyperbolic tangent function; h s is the output at each time step; w is the convolution weight; b is the convolution bias term; u is the scaling factor; i is the attention indicator; j is the unidirectional time step; the formula for the attention weight of the neural network is: where a ij is the normalized attention weight; k is the time step indicator; n is the number of one-way time steps.
6. The pork traceability method based on multi-source information fusion technology according to claim 5, characterized in that, The output formula of the neural network is: where, o ij is the output feature after attention weighting; h j is the output at each time step.
7. The pork traceability method based on multi-source information fusion technology according to claim 1, characterized in that In Step 5, the specific method of uploading the packaged data to the blockchain network includes: Distributed ledger technology: Using the distributed ledger technology of the blockchain, record each piece of pork traceability data on the blockchain, and ensure the security and consistency of the data through encryption algorithms; Smart contract: In the pork traceability system, the smart contract is used to manage and execute data storage, query, and verification operations, improving the efficiency and reliability of the system; Consensus algorithm: Select a consensus algorithm in the pork traceability system to ensure that each node agrees to the newly added data block and jointly maintain the consistency of the entire blockchain; Public verifiability: The data in the blockchain network is verified in an open manner; consumers and regulators can obtain the traceability information of pork and verify the authenticity and quality of the product by scanning the traceability code on the pork package or accessing the public data on the blockchain; Data privacy protection: Through encryption technology and permission management, blockchain technology can protect the data privacy in the pork traceability system; only participants with corresponding permissions can access and modify the data to ensure the security and integrity of the data.
8. The pork traceability method based on multi-source information fusion technology according to claim 7, characterized in that, The consensus algorithm is proof of work or proof of stake.