Label reading method, device, electronic device and storage medium

By training the image recognition model and binding the tag information, the problem of pig logo being easily damaged during transportation and slaughtering is solved, and accurate reading and traceability of pig logo being achieved.

CN117745300BActive Publication Date: 2025-04-01GONGGUANG SHENZHEN MEAT INTELLIGENT TRADING MARKET CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311538330.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-17
Publication Date
2025-04-01
Estimated Expiration
2043-11-17

AI Technical Summary

Technical Problem

In breeding farms, pigs’ logos are easily contaminated and damaged during transportation and slaughtering, resulting in unclear or blurred marks, affecting the accuracy of traceability.

Method used

By inputting multiple sample images into the training model, the image recognition model is obtained, the identification image, overall appearance image and post-slaughtered image of the pig to be slaughtered are obtained, and the feature image is bound to the pig's cutting is determined to achieve accurate storage and reading of the tag information.

Benefits of technology

It improves the reading accuracy of pig logos, ensures the clarity and accuracy of traceability, and solves the problem of inconvenience in accurate identification of logos.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117745300B_ABST
    Figure CN117745300B_ABST
Patent Text Reader

Abstract

The present application provides a label reading method, device, electronic device and storage medium, which relates to the field of computer technology. The method includes: inputting a plurality of sample images into a training model to obtain a corresponding image recognition model, wherein the sample images are various appearance shape images of pigs after slaughter; obtaining the identification image and the overall appearance image corresponding to the pig to be slaughtered; obtaining the appearance image of the pig to be slaughtered after removing the identification, binding the appearance image without identification with the identification image and the overall appearance image and defining them as the first identification information; after the pig to be slaughtered is cut, obtaining the corresponding post-slaughter image, inputting the post-slaughter image into the image recognition model to determine the corresponding feature image, and determining the feature image as the second identification information; binding the first identification information with the second identification information and defining them as label information, storing the label information; reading the label information. The present application solves the problem in the related technology of traceability tracking that the identification of pigs is inconvenient to accurately identify.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and more specifically, to a tag reading method, device, electronic device and storage medium. Background Art

[0002] In the farms, markings can be made on different locations of the pigs by handwriting, manual stamping, lasers, etc. (for example, ear tags on pigs' ears). This can indicate pigs from different farms to facilitate disease and epidemic control, and can also indicate the health status of the pigs.

[0003] However, in actual situations, it may be necessary to trace the slaughtered pigs. However, after the pigs enter the slaughterhouse, the labels need to be removed before they are slaughtered. In addition, the labels are easily contaminated, bumped and worn during transportation, resulting in unclear or blurred labels, making it inconvenient to read the subsequent labels.

[0004] From the above, we can see that how to conveniently and accurately identify pigs still needs to be solved. Summary of the invention

[0005] The present application provides a tag reading method, device, electronic device and storage medium, which can solve the problem of inconvenience in accurately identifying pig identification and affecting traceability in related technologies. The technical solution is as follows:

[0006] According to one aspect of the present application, a label reading method includes: inputting a plurality of sample images into a training model to obtain a corresponding image recognition model, wherein the sample images are images of various appearance shapes of pigs after slaughter; obtaining an identification image and an overall appearance image corresponding to the pig to be slaughtered; obtaining an identification-free appearance image of the pig to be slaughtered after removing the identification, binding the identification-free appearance image with the identification image and the overall appearance image and defining them as first identification information; after the pig to be slaughtered is cut, obtaining a corresponding post-slaughter image, inputting the post-slaughter image into an image recognition model to determine a corresponding feature image, and determining the feature image as second identification information; binding the first identification information with the second identification information and defining them as label information, and storing the label information; reading the label information.

[0007] According to one aspect of the present application, a label reading device includes: a model acquisition module, which inputs multiple sample images into a training model to obtain a corresponding image recognition model, wherein the sample images are images of various appearance shapes of pigs after slaughter; an image acquisition module, which is used to obtain the identification image and the overall appearance image corresponding to the pig to be slaughtered; a first identification binding module, which obtains the identification-free appearance image of the pig to be slaughtered after the identification is removed, and is used to bind the identification-free appearance image with the identification image and the overall appearance image and define them as first identification information; a second identification determination module, which obtains the corresponding post-slaughter image after the pig to be slaughtered is cut, and inputs the post-slaughter image into the image recognition model to determine the corresponding feature image, and is used to determine the feature image as second identification information; a label binding module, which is used to bind the first identification information with the second identification information and define them as label information, and store the label information; a reading module, which is used to read the label information.

[0008] In an exemplary embodiment, the tag reading device further includes: a region position acquisition module, which is used to acquire the corresponding region position based on the post-slaughter image, wherein the region position is the region corresponding to the pig in the post-slaughter image; a target image determination module, which is used to determine the target image based on the region position, wherein the target image is the image corresponding to the pig in the post-slaughter image; and a feature image determination module, which inputs the target image into an image recognition model for determining the feature image.

[0009] In an exemplary embodiment, the label reading device also includes: a training feature image acquisition module, which inputs the sample image into the training model to obtain the corresponding training feature image; a loss value determination module, which is used to determine the loss value based on the training feature image and the original label, wherein the original label corresponds to the feature image of the sample image; and a judgment module, which is used to judge whether the loss value is greater than a preset loss threshold. If so, other sample images are exchanged to continue training the training model; otherwise, the training model is determined to be an image recognition model.

[0010] In an exemplary embodiment, the label reading device further includes: a third identification definition module, which obtains corresponding breeding information based on the identification image and is used to define the breeding information as third identification information; and a first label definition module, which binds the third identification information with the first identification information and the second identification information and defines them as label information.

[0011] In an exemplary embodiment, the label reading device further includes: a fourth identification definition module, which obtains corresponding slaughtering information after the pig to be slaughtered is cut, wherein the slaughtering information includes the corresponding slaughtering address and slaughtering time of the pig to be slaughtered, and is used to define the slaughtering information as fourth identification information; a second label definition module, which is used to bind the fourth identification information with the first identification information and the second identification information and define them as label information.

[0012] In an exemplary embodiment, the label reading device further includes: a first identification module, used to retrieve the first identification information for identification, and stop identification if the identification is successful; a second identification module, used to retrieve the second identification information for identification if the identification fails, and stop identification if the identification is successful; a third identification module, used to retrieve the third identification information for identification if the identification fails, and stop identification if the identification is successful; a fourth identification module, used to retrieve the fourth identification information for identification if the identification fails.

[0013] In an exemplary embodiment, the label reading device also includes: a target identification type acquisition module, used to obtain the target identification type; a target identification determination module, used to determine the corresponding target identification information based on the target identification type, wherein the target identification information is one or more of the first identification information, the second identification information, the third identification information, and the fourth identification information; and a target identification information reading module, used to read the target identification information.

[0014] According to one aspect of the present application, an electronic device includes at least one processor and at least one memory, wherein the memory stores computer-readable instructions; the computer-readable instructions are executed by one or more of the processors, so that the electronic device implements the tag reading method as described above.

[0015] According to one aspect of the present application, a storage medium stores computer-readable instructions thereon, and the computer-readable instructions are executed by one or more processors to implement the tag reading method as described above.

[0016] The beneficial effects of the technical solution provided by this application are:

[0017] In the above technical scheme, a plurality of sample images are input into a training model to obtain a corresponding image recognition model, an identification image and an overall appearance image corresponding to the pig to be slaughtered are obtained, an identification-removed appearance image of the pig to be slaughtered after the identification is removed is obtained, the identification-removed appearance image is bound to the identification image and the overall appearance image and defined as the first identification information, and after the pig to be slaughtered is cut, a corresponding post-slaughter image is obtained, the post-slaughter image is input into an image recognition model to determine a corresponding feature image, and the feature image is determined as the second identification information; the first identification information is bound to the second identification information and defined as label information, the label information is stored, and then the label information is read; in the process of tracing the pig, since the first identification information and the second identification information are both associated with the corresponding pig, the label information can be directly read, and the pig can be traced clearly and accurately, thereby effectively solving the problem in the related technology that the pig identification is inconvenient to accurately identify and affects the traceability and tracking. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative work.

[0019] Figure 1 It is a schematic diagram of the scenario involved in this application;

[0020] Figure 2 is a flow chart of a tag reading method according to an exemplary embodiment;

[0021] Figure 3 is a flowchart showing steps S010 to S030 in a tag reading method according to an exemplary embodiment;

[0022] Figure 4 is a flowchart showing steps S141 to S143 in a tag reading method according to an exemplary embodiment;

[0023] Figure 5 is a flowchart showing steps S151 to S154 in a tag reading method according to an exemplary embodiment;

[0024] Figure 6 is a flowchart showing steps S1601 to S1604 in a tag reading method according to an exemplary embodiment;

[0025] Figure 7 is a flowchart showing steps S1605 to S1607 in a tag reading method according to an exemplary embodiment;

[0026] Figure 8 is a structural block diagram of a tag reading device according to an exemplary embodiment;

[0027] Fig. 9 The present invention is a structural block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0028] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.

[0029] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present disclosure refers to the presence of the features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0030] As mentioned above, the labels printed on the pigs may become blurred during transportation and cleaning. As can be seen from the above, the related technology still has the defect of inconvenient label reading.

[0031] To this end, the tag reading method provided in the present application can effectively improve the accuracy of tag reading. Accordingly, the tag reading method is applicable to a tag reading device, which can be deployed in an electronic device, and the electronic device can be a tag reader.

[0032] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0033] Figure 1 It is a schematic diagram of a scenario involved in an image processing method. It should be noted that this scenario is only an example adapted to the present invention and cannot be considered as providing any limitation on the scope of use of the present invention.

[0034] The implementation environment includes a collector, a server, an electronic tag, a tag reader and a terminal.

[0035] Specifically, the collector can also be considered as an image acquisition device, including but not limited to electronic devices with shooting functions such as cameras, video cameras, and camcorders.

[0036] The server may be a desktop computer, a laptop computer, a server or other electronic device, or a computer cluster composed of multiple servers, or even a cloud computing center composed of multiple servers. The server is used to provide background services, for example, the background services include but are not limited to outputting feature images, etc.

[0037] A network communication connection is established in advance between the server and the acquisition end through wired or wireless means, and data transmission between the server and the acquisition end is realized through the network communication connection. The transmitted data includes but is not limited to: the image to be processed of the target object, etc.

[0038] In one application scenario, through the interaction between the collection end and the server, the collection end photographs and collects the images to be processed for the pigs to be slaughtered and the pork, and uploads the images to be processed to the server. After processing, the server stores the corresponding label information in the electronic tag. When the pork needs to be traced, the electronic tag can be read and identified by the label reader, and can be viewed at the terminal, where the terminal includes but is not limited to mobile phones, desktop computers and notebooks.

[0039] See also Figure 2 , the embodiment of the present application provides a tag reading method, comprising:

[0040] S110, inputting a plurality of sample images into a training model to obtain a corresponding image recognition model;

[0041] Among them, in the process of training the image recognition model, the sample images collected are images of various appearance shapes of pigs after slaughter. All sample images have appearance features of the pig, such as some marks, lines, wounds, knife cuts and other features on the pig's body. The final image recognition model is obtained through training with a large number of sample inputs.

[0042] In order to ensure the accuracy of the image recognition model in this solution, it is necessary to ensure that the accuracy of the results obtained when the sample image is input is high. For this purpose, multiple sample images are input into the training model to obtain the corresponding image recognition model. Figure 3 , perform the following steps:

[0043] S010, inputting the sample image into the training model to obtain the corresponding training feature image.

[0044] S020, determining a loss value based on the training feature image and the original label;

[0045] Among them, the original label corresponds to the feature image corresponding to the sample image. When calculating the loss value, a loss function can be used for calculation, and the loss function can adopt one or more of the norm loss function, cross entropy loss function, mean square error loss function, Hinge loss function, and logistic loss function.

[0046] S030, determining whether the loss value is greater than a preset loss threshold, if so, replacing other sample images to continue training the training model, otherwise determining that the training model is an image recognition model;

[0047] Among them, the loss threshold is pre-set in the system. When the loss value is greater than the loss threshold, it means that the training feature image obtained after the sample image is input into the training model is not accurate enough, which will affect the subsequent traceability of the pig, so the training model needs to be further trained; when the loss value between the training feature image and the original label is less than or equal to the loss threshold, it means that the training feature image can meet the traceability of the pig.

[0048] By executing steps S010 to S030, the accuracy of the image recognition module in this solution can be improved, which facilitates the traceability of subsequent label information.

[0049] S120, obtaining a logo image and an overall appearance image corresponding to the pig to be slaughtered;

[0050] Before the pigs are sent out from the farm, farm-related marks will be left on the pigs. The overall appearance image includes images collected from multiple angles with the farm marks left on the pigs, and there are multiple overall appearance images.

[0051] S130, obtaining an appearance image of the pig to be slaughtered after the identification is removed, binding the appearance image without identification, the identification image and the overall appearance image, and defining them as first identification information;

[0052] Among them, the identification-free appearance image is an image collected from multiple angles. There are also multiple identification-free appearance images. It should be noted that the identification-free appearance image is more targeted at the location where the pig is marked with the farm. If there is a mark at the identification location of the pig, after the mark of the farm is removed, the identification-free appearance image collected from multiple angles can ensure that the entire appearance of the pig is captured completely, thereby ensuring the integrity of the first identification information.

[0053] S140, after the pig to be slaughtered is cut, a corresponding post-slaughter image is obtained, the post-slaughter image is input into an image recognition model to determine a corresponding feature image, and the feature image is determined as the second identification information;

[0054] At this point, the pig has been cut into multiple pieces, and the feature image captures the features corresponding to each piece of pork. However, in the process of the camera capturing each piece of pork, the surrounding scenery will be captured, and the image recognition model mainly recognizes the features on the pork. Therefore, when the post-slaughter image is input into the image recognition model to determine the corresponding feature image, please refer to Figure 4 , and also perform the following steps:

[0055] S141, acquiring a corresponding area position based on the post-slaughter image;

[0056] The region position is the region corresponding to the pig in the post-slaughter image, and the position of the pork in the post-slaughter image is divided out at this time.

[0057] S142, determining a target image based on the region position;

[0058] The target image is the image corresponding to the pig in the post-slaughter image, that is, the image corresponding to the regional position in the post-slaughter image is extracted.

[0059] S143, input the target image into the image recognition model to determine the feature image.

[0060] When extracting the cut pork, by executing steps S141 to S143, the incision and the corresponding knife marks on each piece of pork can be accurately obtained, so that the characteristics of each piece of pork can be accurately obtained.

[0061] S150, binding the first identification information and the second identification information and defining them as label information, and storing the label information;

[0062] Among them, in the label information at this time, the first identification information includes the overall appearance characteristics of the pig from the farm to the slaughterhouse before cutting, and the second identification information includes the appearance characteristics of the pork after the pig is cut into each piece of pork.

[0063] As mentioned above, the label information is defined by binding the first identification information and the second identification information. In addition, more identification information can be defined for binding, thereby enriching the label information to facilitate subsequent traceability of pork.

[0064] For example, when the first identification information and the second identification information are bound and defined as tag information, the following steps are also performed. Figure 5 , specifically:

[0065] S151, acquiring corresponding breeding information based on the identification image, and defining the breeding information as third identification information;

[0066] Among them, the identification image can be obtained in advance, for example, when the pig is raised in a farm or sent out of a farm, the corresponding breeding information can be obtained from the corresponding identification image, and the breeding information includes information about the pig in the breeding process, such as: breeding site, breeding time, corresponding breeding feed and health status.

[0067] S152: Bind the third identification information with the first identification information and the second identification information and define them as label information.

[0068] S153, retrieve corresponding slaughter information;

[0069] Among them, the slaughter information is obtained after the pigs are sent to the slaughterhouse for slaughter. The slaughter information includes the slaughter address and slaughter time corresponding to the pigs to be slaughtered, and the slaughter information is defined as the fourth identification information.

[0070] S154: Bind the fourth identification information with the first identification information and the second identification information and define them as label information.

[0071] After binding the first identification information with the second identification information and executing steps S151 to S154, the third identification information and the fourth identification are simultaneously bound and associated with both the first identification information and the second identification information. This can enrich the amount of information recorded in the label information, and in the subsequent tracing process, information can be read from different identification information.

[0072] S160, reading tag information.

[0073] When it is necessary to trace the pork, the label information of the electronic note can be read, and when reading the label information, it can be read in the following manner.

[0074] See also Figure 6 , the specific reading process is as follows:

[0075] S1601, retrieve the first identification information for identification, and if the identification is successful, stop the identification.

[0076] Among them, when reading the electronic tag, the system can first read the first identification information in the tag information. When the first tag information is successfully identified, since other identification information is bound and associated with the first identification information, other identification information can be directly retrieved through the first identification information without identifying other identification information, so that the pig can be traced, so the identification can be stopped.

[0077] S1602: If the recognition fails, the second identification information is retrieved for recognition; if the recognition succeeds, the recognition is stopped.

[0078] Among them, after the first identification information is identified, the system automatically identifies the second identification information in the same tag information, which is consistent with the identification process of the first identification information. After the identification is successful, the identification can be stopped.

[0079] S1603, if the recognition fails, retrieve the third identification information for recognition; if the recognition succeeds, stop the recognition;

[0080] The identification process of the third identification information here is the same as the identification process of the second identification information mentioned above, so it will not be repeated here.

[0081] S1604, if the recognition fails, retrieve the fourth identification information for recognition;

[0082] If the third identification information fails to be identified, the fourth identification information can be retrieved to continue the identification.

[0083] By binding multiple identification information in the tag information, multiple identifications can be performed in the above identification process, thereby increasing the success rate of tag information identification.

[0084] In the identification process from step S1601 to step S1604, identification information is identified one by one. The identification can also be performed in the following manner. Figure 7 , specifically:

[0085] S1605, obtaining the target recognition type;

[0086] Among them, the label information includes first identification information, second identification information, third identification information and fourth identification information, and each identification information corresponds to a different identification type. The first identification information corresponds to the overall appearance type, the second identification information corresponds to the post-slaughter appearance type, the third identification information corresponds to the breeding information type, and the fourth identification information corresponds to the slaughter information type. Each identification information corresponds to an identification type; it should be pointed out that in the present application, the label information is bound to four types of identification information, but the scope of protection of the present application is not limited to the above four types of identification information, and more types of identification information can also be bound to the label information.

[0087] S1606, determining corresponding target identification information based on the target recognition type;

[0088] The target identification information is one or more of the first identification information, the second identification information, the third identification information, and the fourth identification information.

[0089] S1607, read the target identification information.

[0090] In the embodiment of the present application, the execution process of S1605 and S1607 can be exemplified as follows: when pork needs to be loaded and delivered, during the loading process, each label in the pig's label information can be identified. When the target identification type is the post-slaughter appearance type, the second identification information can be selected for identification. After successful identification, it can be determined which specific pig is loaded, and which farm and slaughterhouse it comes from, thereby preventing confusion in the loading process.

[0091] In the present application scheme, by recording information from the entire process from pig farming to pork distribution, when traceability is needed in the future, the label information in the electronic tag can be directly read at this time, and the identification information can be identified one by one as mentioned above, or the target identification type can be determined first and then the corresponding target identification information can be directly identified. It can quickly, conveniently and accurately track which pigs these pigs are, which farm they come from, which slaughterhouse they are slaughtered in, and the specific time they are slaughtered.

[0092] The following is an embodiment of the device of the present application, which can be used to execute the tag reading method involved in the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the method embodiment of the tag reading method involved in the present application.

[0093] See also Figure 8 In an embodiment of the present application, a label reading device is provided, including but not limited to: a model acquisition module 200, an image acquisition module 210, a first identification binding module 220, a second identification determination module 230, a label binding module 240 and a reading module 250.

[0094] The model acquisition module 200 inputs a plurality of sample images into a training model for acquiring a corresponding image recognition model, wherein the sample images are images of various appearance shapes of pigs after slaughter.

[0095] The image acquisition module 210 is used to acquire the identification image and the overall appearance image corresponding to the pig to be slaughtered.

[0096] The first identification binding module 220 obtains the identification-free appearance image of the pig to be slaughtered after the identification is removed, and is used to bind the identification-free appearance image with the identification image and the overall appearance image and define them as the first identification information.

[0097] The second identification determination module 230 obtains the corresponding post-slaughter image after the pig to be slaughtered is cut, and inputs the post-slaughter image into the image recognition model to determine the corresponding feature image, which is used to determine the feature image as the second identification information.

[0098] The tag binding module 240 is used to bind the first identification information and the second identification information to define them as tag information, and store the tag information.

[0099] The reading module 250 is used to read the tag information.

[0100] In an exemplary embodiment, the apparatus further includes, but is not limited to: a region position acquisition module 231 , a target image determination module 232 , and a feature image determination module 233 .

[0101] The region position acquisition module 231 is used to acquire the corresponding region position based on the post-slaughter image, and the region position is the region corresponding to the pig in the post-slaughter image.

[0102] The target image determination module 232 is used to determine the target image based on the region position, wherein the target image is the image corresponding to the pig in the post-slaughter image.

[0103] The feature image determination module 233 inputs the target image into the image recognition model for determining the feature image.

[0104] In an exemplary embodiment, the device further includes but is not limited to: a training feature image acquisition module 201 , a loss value determination module 202 , and a judgment module 203 .

[0105] The training feature image acquisition module 201 inputs the sample image into the training model to acquire the corresponding training feature image.

[0106] The loss value determination module 202 is used to determine the loss value based on the training feature image and the original label, wherein the original label corresponds to the feature image of the sample image.

[0107] The judgment module 203 is used to judge whether the loss value is greater than a preset loss threshold. If so, other sample images are used to continue training the training model. Otherwise, the training model is determined to be an image recognition model.

[0108] In an exemplary embodiment, the apparatus further includes but is not limited to: a third identification definition module 241 and a first tag definition module 242 .

[0109] The third identification definition module 241 acquires corresponding breeding information based on the identification image, and is used to define the breeding information as the third identification information.

[0110] The first tag definition module 242 binds the third identification information with the first identification information and the second identification information and defines the third identification information as tag information.

[0111] In an exemplary embodiment, the device further includes but is not limited to: a fourth identification definition module 243 and a second tag definition module 244 .

[0112] The fourth identification definition module 243 obtains corresponding slaughtering information after the pig to be slaughtered is cut, wherein the slaughtering information includes the corresponding slaughtering address and slaughtering time of the pig to be slaughtered, and is used to define the slaughtering information as the fourth identification information.

[0113] The second label definition module 244 is used to bind the fourth identification information with the first identification information and the second identification information and define them as label information.

[0114] In an exemplary embodiment, the device further includes but is not limited to: a first identification module 251 , a second identification module 252 , a third identification module 253 , and a fourth identification module 254 .

[0115] The first identification module 251 is used to retrieve the first identification information for identification, and if the identification is successful, stop the identification.

[0116] The second identification module 252 is used to retrieve the second identification information for identification if the identification fails, and to stop the identification if the identification succeeds.

[0117] The third identification module 253 is used to retrieve the third identification information for identification if the identification fails, and to stop the identification if the identification succeeds.

[0118] The fourth identification module 254 is used to retrieve the fourth identification information for identification if the identification fails.

[0119] In an exemplary embodiment, the device further includes, but is not limited to: a target recognition type acquisition module 255 , a target identification determination module 256 , and a target identification information reading module 157 .

[0120] The target recognition type acquisition module 255 is used to acquire the target recognition type.

[0121] The target identification determination module 256 is used to determine corresponding target identification information based on the target recognition type, wherein the target identification information is one or more of the first identification information, the second identification information, the third identification information, and the fourth identification information.

[0122] The target identification information reading module 257 is used to read the target identification information.

[0123] It should be noted that the tag reading device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when performing tag reading. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the tag reading device will be divided into different functional modules to complete all or part of the functions described above.

[0124] In addition, the embodiments of the tag reading device and the tag reading method provided in the above embodiments belong to the same concept, and the specific manner in which each module performs the operation has been described in detail in the method embodiment, which will not be repeated here.

[0125] It should be noted that the tag reading device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when performing tag reading. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the tag reading device will be divided into different functional modules to complete all or part of the functions described above.

[0126] In addition, the embodiments of the tag reading device and the tag reading method provided in the above embodiments belong to the same concept, and the specific manner in which each module performs the operation has been described in detail in the method embodiment, which will not be repeated here.

[0127] See also Fig. 9 In an embodiment of the present application, an electronic device 4000 is provided, and the electronic device 400 may include: a desktop computer, a laptop computer, a server, etc.

[0128] exist Fig. 9 In the embodiment, the electronic device 4000 includes at least one processor 4001 and at least one memory 4003.

[0129] The data interaction between the processor 4001 and the memory 4003 can be realized through at least one communication bus 4002. The communication bus 4002 may include a path for transmitting data between the processor 4001 and the memory 4003. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0130] Optionally, the electronic device 4000 may further include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.

[0131] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0132] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program instructions or codes in the form of instructions or data structures and can be accessed by the electronic device 400, but is not limited to this.

[0133] Computer-readable instructions are stored in the memory 4003 , and the processor 4001 can read the computer-readable instructions stored in the memory 4003 through the communication bus 4002 .

[0134] The computer-readable instructions are executed by one or more processors 4001 to implement the tag reading method in the above-mentioned embodiments.

[0135] In addition, an embodiment of the present application provides a storage medium on which computer-readable instructions are stored. The computer-readable instructions are executed by one or more processors to implement the tag reading method as described above.

[0136] In the past, if the pork needed to be traced later by markings left on the pigs, especially during the pork distribution process, the markings no longer existed, resulting in great inconvenience in tracing the source. Through the scheme of the embodiments of the present application, the image information required for pork from breeding, slaughtering and other information can be directly collected by the camera, and then the collected images can be collected and processed. First of all, no large cost will be incurred. In the process of tracing the source, only the identification information in the corresponding electronic tag needs to be read, and the corresponding identification information can be read and identified in a variety of ways. When the identification is successful, other identification information bound to the identification information can be displayed for understanding at the first time, which is convenient for query and tracing, and the required corresponding information can also be accurately displayed.

[0137] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0138] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A tag reading method, characterized in that: include: Inputting a plurality of sample images into a training model to obtain a corresponding image recognition model, wherein the sample images are images of various appearance shapes of pigs after slaughter; Obtaining identification images and overall appearance images corresponding to the pigs to be slaughtered; Acquire an appearance image of the pig to be slaughtered after the identification is removed, bind the appearance image without identification, the identification image and the overall appearance image, and define them as first identification information; After the pig to be slaughtered is cut, a corresponding post-slaughter image is obtained, the post-slaughter image is input into an image recognition model to determine a corresponding feature image, and the feature image is determined as the second identification information; The first identification information and the second identification information are bound and defined as label information, and the label information is stored, wherein at this time, in the label information, the first identification information includes the overall appearance characteristics of the pig from the breeding farm to the slaughterhouse before cutting, and the second identification information includes the appearance characteristics of the pork after the pig is cut into each piece of pork; Read tag information.

2. The method according to claim 1, characterized in that In the process of inputting the post-slaughter image into the image recognition model to determine the corresponding feature image, the method further includes: Acquiring a corresponding region position based on the post-slaughter image, wherein the region position is a region corresponding to the pig in the post-slaughter image; Determine a target image based on the region position, wherein the target image is an image corresponding to the pig in the post-slaughter image; The target image is input into the image recognition model to determine the feature image.

3. The method according to claim 1, characterized in that When the plurality of sample images are input into the training model to obtain the corresponding image recognition model, the method further comprises: Input the sample image into the training model to obtain the corresponding training feature image; Determining a loss value based on the training feature image and the original label, wherein the original label corresponds to the feature image of the sample image; Determine whether the loss value is greater than the preset loss threshold. If so, exchange other sample images to continue training the training model. Otherwise, determine that the training model is an image recognition model.

4. The method according to claim 1, characterized in that When the first identification information and the second identification information are bound and defined as tag information, the method further includes: Acquire corresponding breeding information based on the identification image, and define the breeding information as third identification information; The third identification information is bound to the first identification information and the second identification information and defined as label information.

5. The method according to claim 4, characterized in that When the first identification information and the second identification information are bound and defined as tag information, the method further includes: Retrieve corresponding slaughter information, wherein the slaughter information is obtained after the pig is sent to the slaughterhouse for slaughter, and the slaughter information includes the slaughter address and slaughter time corresponding to the pig to be slaughtered, and the slaughter information is defined as the fourth identification information; The fourth identification information is bound to the first identification information and the second identification information and defined as label information.

6. The method according to claim 5, characterized in that In the process of reading the tag information, the method further includes: Retrieving the first identification information for identification, and if the identification is successful, stopping the identification; If the recognition fails, the second identification information is retrieved for recognition; if the recognition succeeds, the recognition is stopped; If the recognition fails, the third identification information is retrieved for recognition; if the recognition succeeds, the recognition is stopped; If the recognition fails, the fourth identification information is retrieved for recognition.

7. The method according to claim 5, characterized in that In the process of reading the tag information, the method further includes: Get the target identification type; Determine corresponding target identification information based on the target recognition type, wherein the target identification information is one or more of first identification information, second identification information, third identification information, and fourth identification information; Read the target identification information.

8. A label reading device, characterized in that: include: A model acquisition module, inputting a plurality of sample images into a training model to acquire a corresponding image recognition model, wherein the sample images are images of various appearance shapes of pigs after slaughter; An image acquisition module is used to acquire an identification image and an overall appearance image corresponding to the pig to be slaughtered; A first identification binding module, which obtains the identification-free appearance image of the pig to be slaughtered after the identification is removed, and is used to bind the identification-free appearance image with the identification image and the overall appearance image and define them as first identification information; The second identification determination module obtains the corresponding post-slaughter image after the pig to be slaughtered is cut, inputs the post-slaughter image into the image recognition model to determine the corresponding feature image, and is used to determine the feature image as the second identification information; A label binding module is used to bind the first identification information and the second identification information and define them as label information, and store the label information, wherein at this time, in the label information, the first identification information includes the overall appearance characteristics of the pig from the breeding farm to the slaughterhouse before cutting, and the second identification information includes the appearance characteristics of the pork after the pig is cut into each piece of pork; The reading module is used to read the tag information.

9. An electronic device, characterized in that: include: at least one processor and at least one memory, wherein: The memory has computer-readable instructions stored thereon; The computer-readable instructions are executed by one or more of the processors so that the electronic device implements the tag reading method according to any one of claims 1 to 7.

10. A storage medium having computer-readable instructions stored thereon, characterized in that: The computer-readable instructions are executed by one or more processors to implement the tag reading method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Tracing method, tracing device and tracing system

    CN110189148A

  • Pork traceability system based on block chain technology

    CN114255047A

  • Local pig identification and identification system and method

    CN116740759A