Image chain anti-counterfeiting method for meat traceability of bred animals

By constructing image chain data that restores and authenticates watermarks, the problem of meat image tampering is solved, the security and transparency of the meat supply chain is achieved, and the traceability and authenticity of meat images are ensured.

CN118552384APending Publication Date: 2024-08-27DONGGUAN LISHENG MACHINERY EQUIP
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410689772.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

Existing technology is difficult to effectively prevent meat image tampering attacks, resulting in threats to the security and transparency of the meat supply chain.

Method used

The image chain anti-counterfeiting method is used to store the meat processing images in a chain by constructing recovery watermarks and authentication watermarks, detecting whether the image chain data has been tampered with, and restoring the traceability information when tampering is found to achieve anti-counterfeiting certification of the image chain data.

Benefits of technology

It improves the efficiency of anti-counterfeiting authentication of meat images, can efficiently detect and identify malicious tampering, and ensures the safety and transparency of the meat supply chain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118552384A
    Figure CN118552384A
Patent Text Reader

Abstract

The invention provides an image chain anti-counterfeiting method for meat traceability of bred animals, and relates to the technical field of image anti-counterfeiting, and the method comprises the steps: constructing a recovery watermark and an authentication watermark corresponding to each meat processing image based on the obtained meat processing images of the bred animals and corresponding traceability information; based on the recovery watermark and the authentication watermark, performing chain storage on the meat processing image to obtain image chain data; detecting whether the image chain data is tampered or not by using the authentication watermark, if so, marking the meat processing image as a tampered image, positioning the tampered part of the tampered image, and restoring the traceability information of the meat processing image based on the restoration watermark of the tampered image and the corresponding tampered part to obtain an identification result; and otherwise, marking the meat processing image as a real image, and synthesizing the real image and the identification result to obtain an anti-counterfeiting authentication result so as to realize anti-counterfeiting authentication of the image chain data. According to the invention, the problem that anti-counterfeiting detection and traceability of meat images are difficult is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image anti-counterfeiting technology, and in particular to an image chain anti-counterfeiting method for tracing the origin of farmed animal meat. Background Art

[0002] With the continued strong economic growth and the continuous upgrading and optimization of residents' dietary structure, the demand for meat products has shown a significant growth trend. However, in order to make huge profits, some unscrupulous merchants do not hesitate to sell low-priced meat products as high-quality farmed animal meat products. This fraud has aggravated the public's concerns about the authenticity and safety of meat products, and has put forward higher requirements for the trust of the entire meat market.

[0003] Although the current farmed animal meat traceability process has improved the transparency of the supply chain to a certain extent, there are still a number of security risks in the actual implementation process. For example, attack strategies such as local tampering attacks, whole-block injection attacks and whole-block deletion attacks are still difficult to prevent. Summary of the invention

[0004] In view of the above-mentioned deficiencies in the prior art, the present invention provides an image chain anti-counterfeiting method for traceability of farmed animal meat, which solves the problem that meat images are difficult to detect and trace for anti-counterfeiting.

[0005] In order to achieve the above-mentioned purpose of the invention, the technical solution adopted by the present invention is: an image chain anti-counterfeiting method for tracing the origin of farmed animal meat, comprising:

[0006] S1: Based on the obtained meat processing images of farmed animals and the corresponding traceability information, a recovery watermark and an authentication watermark corresponding to each meat processing image are constructed;

[0007] S2: Based on the recovery watermark and the authentication watermark, the meat processing image is chain-stored to obtain image chain data;

[0008] S3: using the authentication watermark, detecting whether the image chain data has been tampered with, if so, marking the meat processing image as a tampered image, locating the tampered part and inputting it into S4; otherwise, marking the meat processing image as a true image and inputting it into S5;

[0009] S4: based on the restored watermark of the tampered image and the corresponding tampered part, restore the traceability information of the meat processing image to obtain an identification result;

[0010] S5: The real image and the recognition result are combined to obtain an anti-counterfeiting authentication result, thereby realizing anti-counterfeiting authentication of the image chain data.

[0011] The beneficial effects of the present invention are as follows: the processor detects and determines the anti-counterfeiting authentication result through the recovery watermark and authentication watermark of the image chain data. By constructing the image chain data, the meat processing images are closely connected in series to improve the efficiency of image anti-counterfeiting authentication; through the embedded recovery watermark and authentication watermark, malicious tampering behavior can be efficiently detected and identified, and then the original and complete traceability information can be restored to ensure the safety and transparency of the meat supply chain.

[0012] Furthermore, the S1 includes:

[0013] S110: constructing a restoration watermark corresponding to the meat processing image based on the acquired traceability information corresponding to the meat processing image of the farmed animal, wherein the traceability information includes the farmed animal number and the segmentation sequence number;

[0014] S120: dividing the acquired meat processing image of farmed animals into blocks to obtain block images;

[0015] S130: Processing the block images using a hash calculation formula to obtain an authentication sequence corresponding to each block image;

[0016] S140: The authentication sequences of all the block images of the same processed meat image are integrated to obtain the authentication watermark of the processed meat image.

[0017] Furthermore, the expression of the restored watermark of the meat processing image is:

[0018] Re=text bin (randormOrder);

[0019] randormOrder=randperm(l);

[0020] text bin =dec2bin(text dec );

[0021] text dec =unicode2native(text str ,′UTF-8′);

[0022] Among them, Re represents the recovery watermark, text bin represents binary recovery watermark, randormOrder represents random order, randperm(l) represents scrambling function, dec2bin represents binary conversion function, text dec Indicates the traceability information after encoding, unicode2native indicates the encoding conversion function, text str Indicates the traceability information, UTF-8 indicates UTF-8 encoding, and l indicates the length of the binary recovery watermark.

[0023] Furthermore, the expression of the authentication sequence corresponding to the block image is:

[0024] HashLink r,c,p =gethash(X1 r,c );

[0025] Among them, HashLink r,c,p Indicates X1 r,c Generated authentication sequence HashLink r,c The value at index p, gethash represents the hash calculation formula, X1 r,c Represents the image block of image X1 located at position (r, c), r and c represent the row index value and column index value of the image block respectively, and p represents the pixel index value in the image block.

[0026] Further, the S2 includes:

[0027] S210: embedding the recovery watermark and the authentication watermark into the meat processing image to obtain data to be stored:

[0028]

[0029] Among them, X1R i,j Represents the R channel to be stored, i and j represent the row and column index values ​​of the image pixel respectively, Re k Indicates the value of the recovery bit at index k, where k represents the index value, l1 represents the maximum capacity that can be embedded in the R channel, and X1B i,j Indicates the B channel data to be stored;

[0030] S220: Based on the data to be stored, chain storage is performed according to the farmed animal number and the segmentation sequence number to obtain image chain data.

[0031] Further, the S3 includes:

[0032] S310: Based on the image chain data, obtaining a reconstruction authentication watermark corresponding to the meat processing image;

[0033] S320: Compare the authentication watermark and the reconstructed authentication watermark to detect whether the image chain data is tampered with, and obtain a detection result;

[0034] S330: For the meat processing image with a detection result of 0, it is marked as a tampered image, the tampered part is located and the process goes to S4; for the meat processing image with a detection result of 1, it is marked as a real image and the process goes to S5.

[0035] Furthermore, the expressions of the authentication watermark and the reconstructed authentication watermark corresponding to the meat processing image are:

[0036]

[0037] EHashLink1 r,c,p =bitget(Y2B r,c,p ,1);

[0038] Among them, NHashLink1 represents the reconstructed authentication watermark of Y1, r and c represent the row index value and column index value of the image block respectively, p represents the pixel index value in the image block, EHashLink1 represents the authentication watermark, bitget represents the valid bit acquisition function, and Y2B r,c,p It represents the p-th pixel in the image block with row and column r and c of channel B of image Y2 in the image chain data, M represents the number of rows of image Y1, N represents the number of columns of image Y1, Y1 represents the image numbered Y1 in the image chain data, and Y2 represents the image numbered Y2 in the image chain data.

[0039] Furthermore, the expression of the detection result is:

[0040]

[0041] Among them, D r,c Indicates the test result, NHashLink1 r,c Represents the reconstructed authentication watermark of the rth row and cth column in the Y1 image, EHashLink1 r,c It represents the authentication watermark of the rth row and cth column in the Y1 image, where r and c represent the row index and column index of the image block respectively.

[0042] Further, the S4 includes:

[0043] S410: Extracting the restoration watermark of the tampered image:

[0044]

[0045] Among them, ERe k represents the kth recovered watermark extracted, bitget represents the valid bit acquisition function, Y1R i,j Represents the pixel of the R channel of the Y1 image in the image chain data, Y1G i,j represents the pixel of the G channel of the Y1 image in the image chain data, k represents the index value, l1 represents the maximum capacity that can be embedded in the R channel, and l represents the total length of the recovered bits;

[0046] S420: Based on the restored watermark of the tampered image and the tampered part, the traceability information of the meat processing image is restored to obtain the identification result:

[0047] Etextstr =native2unicode(Etext dec ,′UTF-8');

[0048] Etext dec =bin2dec(Etext bin );

[0049] Etext bin (randormOrder) = ERe;

[0050] randormOrder=randperm(l);

[0051] Among them, Etext str Indicates the recognition result, i.e. the recovered string data. native2unicode means converting the character array in the local encoding format to the Unicode encoding format. Etext dec Indicates restoring the watermark in decimal form, UTF-8 indicates UTF-8 encoding, bin2dec indicates converting binary to decimal, Etext bin represents the scrambled binary recovery watermark, randormOrder represents the scrambling sequence, ERe represents the extracted recovery watermark, randperm(l) represents the scrambling function, and l represents the length of the binary recovery watermark. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] This specification will be further described in the form of exemplary embodiments, which will be described in detail by the accompanying drawings. These embodiments are not restrictive, and in these embodiments, the same number represents the same structure, wherein:

[0053] Figure 1 It is an exemplary flow chart of an image chain anti-counterfeiting method for traceability of farmed animal meat according to some embodiments of this specification. DETAILED DESCRIPTION

[0054] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0055] Example

[0056] Figure 1This is an exemplary flow chart of an image chain anti-counterfeiting method for tracing the origin of farmed animal meat according to some embodiments of this specification. Figure 1 As shown, the process includes the following steps. In some embodiments, the process can be executed by a processor.

[0057] S1: Based on the acquired meat processing images and the corresponding traceability information, a recovery watermark and an authentication watermark corresponding to each meat processing image are constructed.

[0058] The meat processing image is a processed image obtained by cutting and packaging the meat, for example, the meat processing image may include a pork processing image, a mutton processing image, and a beef processing image.

[0059] The traceability information is the corresponding relationship information between the meat processing image and the farmed animal. For example, the traceability information may include the farmed animal number, cutting sequence number, precise weight, cutting part, production time and product name corresponding to the meat processing image.

[0060] In some embodiments, the processor can use the installed camera to extract processed meat processing images and obtain corresponding traceability information based on the uploaded processed meat information.

[0061] The recovery watermark is watermark information used to reflect the relationship between the meat processing image and the corresponding farmed animal. For example, the recovery watermark can be a watermark including the meat block number, meat block part, weight, timestamp, breed, total weight of farmed animals, gender, health status at slaughter, feeding method, pasture environment and quarantine results.

[0062] In some embodiments, the processor may use the traceability information to construct a recovery watermark corresponding to the meat processing image.

[0063] The authentication watermark is a watermark used to determine whether the meat processing image has been tampered with.

[0064] In some embodiments, the processor may extract image features of the meat processing image to obtain a corresponding authentication watermark.

[0065] In some embodiments, the processor can implement S1 based on the following steps: S110: Based on the traceability information corresponding to the obtained meat processing image of the farmed animal, construct a recovery watermark corresponding to the meat processing image, and the traceability information includes the farmed animal number and the segmentation sequence number; S120: Divide the obtained meat processing image of the farmed animal into blocks to obtain block images; S130: Use a hash calculation formula to process the block images to obtain an authentication sequence corresponding to each block image; S140: Combine the authentication sequences of all block images of the same meat processing image to obtain an authentication watermark of the meat processing image.

[0066] In some embodiments, the expression of the restored watermark of the meat processing image may be:

[0067] Re=text bin (randormOrder);

[0068] randormOrder=randperm(l);

[0069] text bin =dec2bin(text dec );

[0070] text dec =unicode2native(text str ,′UTF-8′);

[0071] Among them, Re represents the recovery watermark, text bin represents binary recovery watermark, randormOrder represents random order, randperm(l) represents scrambling function, dec2bin represents binary conversion function, text dec Indicates the traceability information after encoding, unicode2native indicates the encoding conversion function, text str Indicates the traceability information, UTF-8 indicates UTF-8 encoding, and l indicates the length of the binary recovery watermark.

[0072] In some embodiments, the scrambling function may be generated by a seed rng(seed), where seed represents a seed and rng represents a generating function.

[0073] The farmed animal number is a number used to distinguish different individuals of farmed animals.

[0074] The segmentation sequence number is a sequence number that reflects the adjacent relationship after the meat processing image is segmented.

[0075] In some embodiments, the processor may obtain the farmed animal number and the segmentation sequence number by numbering during processing.

[0076] The block image is an image that reflects the local information of the meat processing image.

[0077] In some embodiments, the processor may segment the meat processing image based on pixel values ​​to obtain segmented images. For example, the processor may segment the meat processing image X1={X1 i,j The RGB channels of |i=1,2,…,M,j=1,2,…,N} are evenly divided to obtain a block image of size 4×4.

[0078] The authentication sequence is a sequence of 16 authentication bits reflecting the authentication information of the block image.

[0079] In some embodiments, the authentication sequence expression corresponding to the block image may be:

[0080] HashLink r,c,p =gethash(X1 r,c );

[0081] Among them, HashLink r,c,p Indicates X1 r,c Generated authentication sequence HashLink r,c The value at index p, gethash represents the hash calculation formula, X1 r,c Represents the image block of image X1 located at position (r, c), r and c represent the row index value and column index value of the image block respectively, and p represents the pixel index value in the image block.

[0082] In some embodiments, the processor may integrate the authentication sequences corresponding to all the block images of the same processed meat image to obtain the authentication watermark corresponding to the processed meat image.

[0083] S2: Based on the recovery watermark and the authentication watermark, the meat processing image is stored in a chain to obtain image chain data.

[0084] The image chain data is the meat processing image data containing the recovery watermark and the authentication watermark stored in a chain.

[0085] In some embodiments, the processor can implement S2 based on the following steps: S210: embed the recovery watermark and the authentication watermark into the meat processing image to obtain the data to be stored; S220: based on the data to be stored, chain storage according to the farmed animal number and the segmentation sequence number to obtain image chain data.

[0086] The data to be stored is meat processing image data including a restoration watermark and an authentication watermark.

[0087] In some embodiments, the processor may embed the recovery watermark into the LSB of pixels in the R and G channels of the meat processing image, and obtain the authentication watermark through the authentication sequence to construct the data to be stored.

[0088] In some embodiments, the expression of the data to be stored may be:

[0089]

[0090] Among them, X1R i,j Represents the R channel to be stored, i and j represent the row and column index values ​​of the image pixel respectively, Re kIndicates the value of the recovery bit at index k, where k represents the index value, l1 represents the maximum capacity that can be embedded in the R channel, and X1B i,j Indicates the B channel data to be stored.

[0091] In some embodiments, the processor can chain the data to be stored according to the segmentation sequence number and the farmed animal number based on the restored watermark in the meat processing image, and obtain image chain data in which adjacent meat processing images of the same farmed animal are located at adjacent positions in the image chain.

[0092] S3: Use the authentication watermark to detect whether the image chain data is tampered with. If so, mark the meat processing image as a tampered image, locate the tampered part and input it into S4; otherwise, mark the meat processing image as a real image and input it into S5.

[0093] The tampered image is the meat-processed image in the image chain data that has been attacked and tampered with externally.

[0094] The real image is a meat processing image in the image chain data that has not been tampered with and is consistent with the original meat processing image.

[0095] In some embodiments, the processor can implement S3 based on the following steps: S310: Based on the image chain data, obtain the reconstructed authentication watermark corresponding to the meat processing image; S320: Compare the authentication watermark and the reconstructed authentication watermark to detect whether the image chain data has been tampered with, and obtain the detection result; S330: For the meat processing image with a detection result of 0, mark it as a tampered image, locate its tampered part and input it into S4; for the meat processing image with a detection result of 1, mark it as a real image and input it into S5.

[0096] The reconstructed authentication watermark is used to compare with the original authentication watermark to determine whether the meat processing image has been tampered with.

[0097] In some embodiments, the processor may extract the authentication watermark of Y1 from the LSB of a pixel of the B channel of image Y2 that is immediately adjacent to Y1 in the image chain sequence.

[0098] In some embodiments, the expressions of the authentication watermark and the reconstructed authentication watermark corresponding to the meat processing image may be:

[0099]

[0100] EHashLink1 r,c,p =bitget(Y2B r,c,p ,1);

[0101] Among them, NHashLink1 represents the reconstructed authentication watermark of Y1, r and c represent the row index value and column index value of the image block respectively, p represents the pixel index value in the image block, EHashLink1 represents the authentication watermark, bitget represents the valid bit acquisition function, and Y2B r,c,p It represents the p-th pixel in the image block with row and column r and c of channel B of image Y2 in the image chain data, M represents the number of rows of image Y1, N represents the number of columns of image Y1, Y1 represents the image numbered Y1 in the image chain data, Y2 represents the image numbered Y2 in the image chain data, and p represents the pixel index value in the image block.

[0102] The detection result is a matrix used to reflect the tampering detection result of the meat processing image in the image chain data.

[0103] In some embodiments, the expression of the detection result can be:

[0104]

[0105] Among them, D r,c Indicates the test result, NHashLink1 r,c Represents the reconstructed authentication watermark of the rth row and cth column in the Y1 image, EHashLink1 r,c It represents the authentication watermark of the rth row and cth column in the Y1 image, where r and c represent the row index and column index of the image block respectively.

[0106] In some embodiments, the portion marked as 1 in the detection result is a genuine and authentic image that has not been tampered with, and the portion marked as 0 in the detection result is a portion of the image that has been maliciously tampered with.

[0107] In some embodiments, the processor may mark the meat processing image with a detection result of 0 as a tampered image, locate the part with a detection result of 0 as the tampered part, and input S4; for the meat processing image with all detection results of 1, it may be marked as a real image and input S5.

[0108] S4: Based on the restored watermark of the tampered image and the corresponding tampered part, the traceability information of the meat processing image is restored to obtain an identification result.

[0109] The recognition result is an identification result reflecting the malicious tampering behaviors and locations such as meat injection, deletion and forgery of the tampered image.

[0110] In some embodiments, the processor may implement S4 based on the following steps: S410: extracting the restoration watermark of the tampered image; S420: restoring the traceability information of the meat processing image based on the restoration watermark of the tampered image and the tampered part to obtain an identification result.

[0111] In some embodiments, the expression of the restored watermark of the tampered image can be:

[0112]

[0113] Among them, ERe k represents the kth recovered watermark extracted, bitget represents the valid bit acquisition function, Y1R i,j Represents the pixel of the R channel of the Y1 image in the image chain data, Y1G i,j It represents the pixel of the G channel of the Y1 image in the image chain data, k represents the index value, l1 represents the maximum capacity that can be embedded in the R channel, and l represents the total length of the recovered bits.

[0114] In some embodiments, the expression of the recognition result may be:

[0115] Etext str =native2unicode(Etext dec ,′UTF-8');

[0116] Etext dec =bin2dec(Etext bin );

[0117] Etext bin (randormOrder) = ERe;

[0118] randormOrder=randperm(l);

[0119] Among them, Etext str Indicates the recognition result, i.e. the recovered string data. native2unicode means converting the character array in the local encoding format to the Unicode encoding format. Etext dec Indicates restoring the watermark in decimal form, UTF-8 indicates UTF-8 encoding, bin2dec indicates converting binary to decimal, Etext bin represents the scrambled binary recovery watermark, randormOrder represents the scrambling sequence, ERe represents the extracted recovery watermark, randperm(l) represents the scrambling function, and l represents the length of the binary recovery watermark.

[0120] S5: The real image and the recognition result are combined to obtain an anti-counterfeiting authentication result, thereby realizing anti-counterfeiting authentication of the image chain data.

[0121] The anti-counterfeiting authentication result is the processing result used to perform anti-counterfeiting authentication on the image chain data.

[0122] In some embodiments, the processor can combine the real image detection result and the tampered image recognition result to obtain the anti-counterfeiting authentication result.

[0123] In some embodiments, the processor can confirm whether the image chain data has been attacked by local tampering attacks, whole block injection attacks, whole block deletion, etc. based on the anti-counterfeiting authentication results, thereby realizing anti-counterfeiting authentication of the image chain data.

[0124] In some embodiments of this specification, the processor detects and determines the anti-counterfeiting authentication result through the recovery watermark and authentication watermark of the image chain data. By constructing the image chain data, the meat processing images are closely connected in series to improve the efficiency of image anti-counterfeiting authentication; through the embedded recovery watermark and authentication watermark, malicious tampering behavior can be efficiently detected and identified, and then the original and complete traceability information can be restored to ensure the safety and transparency of the meat supply chain.

Claims

1. An image chain anti-counterfeiting method for tracing the origin of farmed animal meat, It is characterized in that include: S1: Based on the obtained meat processing images of farmed animals and the corresponding traceability information, a recovery watermark and an authentication watermark corresponding to each meat processing image are constructed; S2: Based on the recovery watermark and the authentication watermark, the meat processing image is chain-stored to obtain image chain data; S3: using the authentication watermark, detecting whether the image chain data has been tampered with, if so, marking the meat processing image as a tampered image, locating the tampered part and inputting it into S4; otherwise, marking the meat processing image as a true image and inputting it into S5; S4: based on the restored watermark of the tampered image and the corresponding tampered part, restore the traceability information of the meat processing image to obtain an identification result; S5: The real image and the recognition result are combined to obtain an anti-counterfeiting authentication result, thereby realizing anti-counterfeiting authentication of the image chain data.

2. The image chain anti-counterfeiting method for tracing the origin of farmed animal meat according to claim 1, It is characterized in that The S1 includes: S110: constructing a restoration watermark corresponding to the meat processing image based on the acquired traceability information corresponding to the meat processing image of the farmed animal, wherein the traceability information includes the farmed animal number and the segmentation sequence number; S120: dividing the acquired meat processing image of farmed animals into blocks to obtain block images; S130: Processing the block images using a hash calculation formula to obtain an authentication sequence corresponding to each block image; S140: The authentication sequences of all the block images of the same processed meat image are integrated to obtain the authentication watermark of the processed meat image.

3. The image chain anti-counterfeiting method for tracing the origin of farmed animal meat according to claim 1, It is characterized in that The expression of the restored watermark of the meat processing image is: Re=text bin (randomOrder); randormOrder=randperm(l); text bin =dec2bin(text dec ); text dec =unicode2native(text str ,′UTF-8′); Among them, Re represents the recovery watermark, text bin represents binary recovery watermark, randormOrder represents random order, randperm(l) represents scrambling function, dec2bin represents binary conversion function, text dec Indicates the traceability information after encoding, unicode2native indicates the encoding conversion function, text str Indicates the traceability information, UTF-8 indicates UTF-8 encoding, and l indicates the length of the binary recovery watermark.

4. The image chain anti-counterfeiting method for tracing the origin of farmed animal meat according to claim 2, It is characterized in that The expression of the authentication sequence corresponding to the block image is: HashLink r,c,p =gethash(X1 r,c ); Among them, HashLink r,c,p Indicates X1 r,c Generated authentication sequence HashLink r,c The value at index p, gethash represents the hash calculation formula, X1 r,c Represents the image block of image X1 located at position (r, c), r and c represent the row index value and column index value of the image block respectively, and p represents the pixel index value in the image block.

5. The image chain anti-counterfeiting method for tracing the origin of farmed animal meat according to claim 2, It is characterized in that The S2 includes: S210: embedding the recovery watermark and the authentication watermark into the meat processing image to obtain data to be stored: Among them, X1R i,j Represents the R channel to be stored, i and j represent the row and column index values ​​of the image pixel respectively, Re k Indicates the value of the recovery bit at index k, where k represents the index value, l1 represents the maximum capacity that can be embedded in the R channel, and X1B i,j Indicates the B channel data to be stored; S220: Based on the data to be stored, chain storage is performed according to the farmed animal number and the segmentation sequence number to obtain image chain data.

6. The image chain anti-counterfeiting method for tracing the origin of farmed animal meat according to claim 1, It is characterized in that The S3 includes: S310: Based on the image chain data, obtaining a reconstruction authentication watermark corresponding to the meat processing image; S320: Compare the authentication watermark and the reconstructed authentication watermark to detect whether the image chain data is tampered with, and obtain a detection result; S330: For the meat processing image with a detection result of 0, it is marked as a tampered image, the tampered part is located and the process goes to S4; for the meat processing image with a detection result of 1, it is marked as a real image and the process goes to S5.

7. The image chain anti-counterfeiting method for tracing the origin of farmed animal meat according to claim 6, It is characterized in that The expressions of the authentication watermark and the reconstructed authentication watermark corresponding to the meat processing image are: EHashLink1 r,c,p =bitget(Y2B r,c,p ,1); Among them, NHashLink1 represents the reconstructed authentication watermark of Y1, r and c represent the row index value and column index value of the image block respectively, p represents the pixel index value in the image block, EHashLink1 represents the authentication watermark, bitget represents the valid bit acquisition function, and Y2B r,c,p It represents the p-th pixel in the image block with row and column r and c of channel B of image Y2 in the image chain data, M represents the number of rows of image Y1, N represents the number of columns of image Y1, Y1 represents the image numbered Y1 in the image chain data, and Y2 represents the image numbered Y2 in the image chain data.

8. The image chain anti-counterfeiting method for tracing the origin of farmed animal meat according to claim 6, It is characterized in that The expression of the detection result is: Among them, D r,c Indicates the test result, NHashLink1 r,c Represents the reconstructed authentication watermark of the rth row and cth column in the Y1 image, EHashLink1 r,c It represents the authentication watermark of the rth row and cth column in the Y1 image, where r and c represent the row index and column index of the image block respectively.

9. The image chain anti-counterfeiting method for tracing the origin of farmed animal meat according to claim 1, It is characterized in that The S4 includes: S410: Extracting the restoration watermark of the tampered image: Among them, ERe k represents the kth recovered watermark extracted, bitget represents the valid bit acquisition function, Y1R i,j Represents the pixel of the R channel of the Y1 image in the image chain data, Y1G i,j represents the pixel of the G channel of the Y1 image in the image chain data, k represents the index value, l1 represents the maximum capacity that can be embedded in the R channel, and l represents the total length of the recovered bits; S420: Based on the restored watermark of the tampered image and the tampered part, the traceability information of the meat processing image is restored to obtain the identification result: Etext str =native2unicode(Etext dec ,′UTF-8'); Etext dec =bin2dec(Etext bin ); Etext bin (randormOrder)=ERe; randormOrder=randperm(l); Among them, Etext str Indicates the recognition result, i.e. the recovered string data. native2unicode means converting the character array in the local encoding format to the Unicode encoding format. Etext dec Indicates restoring the watermark in decimal form, UTF-8 indicates UTF-8 encoding, bin2dec indicates converting binary to decimal, Etext bin represents the scrambled binary recovery watermark, randormOrder represents the scrambling sequence, ERe represents the extracted recovery watermark, randperm(l) represents the scrambling function, and l represents the length of the binary recovery watermark.

Citation Information

Cited By

  • Block chain double-chain cold chain traceability management system for meat quality fluctuation

    CN120125258A

  • Blockchain Double-Chain Cold Chain Traceability Management System for Fluctuations in Meat Quality

    CN120125258B