Image processing method and device
Through the combination of convolutional neural network and optical character recognition technology, image and text features are extracted and fused, and the attention model is input for recognition, which solves the accuracy and robustness problems of pet protection application image label recognition and achieves efficient image labeling. Identify.
Patent Information
- Application Number
- CN202210150893.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-18
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-02-18
AI Technical Summary
It is difficult for existing technologies to effectively identify and label voucher images used for pet protection applications, especially when combining image and text features, which lacks high accuracy and robustness.
Image features are extracted through convolutional neural networks and text features are extracted using optical character recognition technology, feature fusion is performed using weight vector pairs, and the attention model is input for image tag recognition to improve feature robustness and the comprehensiveness and accuracy of tag recognition.
The accuracy and robustness of image tag recognition are improved, the correlation between text features and image features of the voucher image is enhanced, and effective tag recognition of pet protection application images is achieved.
Smart Images

Figure CN114550156B
Abstract
Description
Technical Field
[0001] This document relates to the field of data processing technology, and in particular to an image processing method and device. Background Art
[0002] With the accelerated pace of social development, everyone who is a participant in social development faces increasing work and life pressures. In order to enrich their lives without bringing too much burden to their lives, more and more people like to keep pets. While raising pets, they can make themselves fulfilled, and it also helps their physical and mental health a lot. Especially for some elderly people living alone whose children are working hard in other places, the company of pets can make the elderly's life happier, and for some well-trained pets, when some accidents happen to the elderly, such as illness, the pets can also act as an alarm. Pets are equivalent to part of the family for their owners and are very important. Therefore, many services for pets have been generated, such as pet insurance. Summary of the invention
[0003] One or more embodiments of the present specification provide an image processing method, including: obtaining a voucher image submitted for a protection application for a captive participating in a protection project. Inputting the voucher image into a convolutional neural network to extract image features to obtain an image feature vector. Also, performing character recognition on the voucher image to obtain text feature information. Determining an image feature vector pair based on a weight vector pair and the image feature vector. Also, encoding the text feature information to obtain a text feature vector, and fusing the image feature vector with the text feature vector to obtain a fused feature vector. Inputting the image feature vector pair and the fused feature vector into an attention model to perform image label recognition to obtain a label recognition result.
[0004] One or more embodiments of the present specification provide an image processing device, including a voucher image acquisition module, configured to acquire a voucher image submitted for a protection application for a captive animal participating in a protection project. A feature extraction module, configured to input the voucher image into a convolutional neural network to extract image features to obtain an image feature vector, and to perform character recognition on the voucher image to obtain text feature information. A feature vector fusion module, configured to determine an image feature vector pair based on a weight vector pair and the image feature vector, and to encode the text feature information to obtain a text feature vector, and to fuse the image feature vector with the text feature vector to obtain a fused feature vector. An image label recognition module, configured to input the image feature vector pair and the fused feature vector into an attention model to perform image label recognition to obtain a label recognition result.
[0005] One or more embodiments of the present specification provide an image processing device, including: a processor; and a memory configured to store computer-executable instructions, wherein when the computer-executable instructions are executed, the processor is caused to: obtain a voucher image submitted for a guarantee application for a livestock participating in a guarantee project. The voucher image is input into a convolutional neural network for image feature extraction to obtain an image feature vector. And, character recognition is performed on the voucher image to obtain text feature information. An image feature vector pair is determined based on a weight vector pair and the image feature vector. And, encoding processing is performed on the text feature information to obtain a text feature vector, and the image feature vector is fused with the text feature vector to obtain a fused feature vector. The image feature vector pair and the fused feature vector are input into an attention model for image label recognition to obtain a label recognition result.
[0006] One or more embodiments of the present specification provide a storage medium for storing computer-executable instructions, which implement the following process when executed by a processor: obtain a voucher image submitted for a protection application for a captive participating in a protection project. Input the voucher image into a convolutional neural network to extract image features to obtain an image feature vector. Also, perform character recognition on the voucher image to obtain text feature information. Determine an image feature vector pair based on a weight vector pair and the image feature vector. Also, encode the text feature information to obtain a text feature vector, and fuse the image feature vector with the text feature vector to obtain a fused feature vector. Input the image feature vector pair and the fused feature vector into an attention model to perform image label recognition to obtain a label recognition result. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] In order to more clearly illustrate one or more embodiments of the present specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor.
[0008] Figure 1 A processing flow chart of an image processing method provided for one or more embodiments of this specification;
[0009] Figure 2 A schematic diagram of an image processing process provided for one or more embodiments of this specification;
[0010] Figure 3 A schematic diagram of a feature vector fusion processing process provided for one or more embodiments of this specification;
[0011] Figure 4 A processing flow chart of an image processing method applied to a pet insurance application scenario provided by one or more embodiments of this specification;
[0012] Figure 5 A schematic diagram of an image processing device provided for one or more embodiments of this specification;
[0013] Figure 6 A schematic diagram of the structure of an image processing device provided in one or more embodiments of this specification. DETAILED DESCRIPTION
[0014] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below in conjunction with the drawings in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this document.
[0015] An embodiment of an image processing method provided in this specification:
[0016] Reference Figure 1 The image processing method provided in this embodiment specifically includes steps S102 to S108.
[0017] Step S102, obtaining a voucher image submitted for a protection application for a pet participating in the protection project.
[0018] The image processing method provided by the present application, in the process of label recognition of the voucher image submitted for the protection application for domestic animals, extracts the image features of the voucher image through a convolutional neural network, and extracts the text feature information of the voucher image through character recognition, so as to improve the robustness of the features and the correlation between the text features and the image features of the voucher image by fusing the image feature vector and the text feature information after encoding, and on this basis, inputs the image feature vector pair and the fused feature vector into the attention model for image label recognition, and performs label recognition by combining the image features and the text features through the attention model, thereby improving the comprehensiveness and accuracy of image label recognition, and also improving the robustness of image label recognition for voucher images.
[0019] The pets described in this embodiment include pets that enhance the user's sense of pleasure on an emotional level (canine pets, cat pets, amphibian pets, etc.), and also include animals raised by users for economic purposes (for example, poultry, livestock, etc.). In addition, they also include animals raised for social welfare or environmental protection purposes (for example, protected animals raised in animal sanctuaries, stray animals raised by social welfare organizations for social welfare purposes, etc.).
[0020] The insured project refers to a project that takes pets as insured objects and provides related insured services for pets, such as a health insurance project that provides health insurance services for pets. The voucher image refers to an image related to pets used to submit an insurance application. For example, after pets become insured objects of a health insurance project, an insurance application can be submitted within the insurance period for the resources spent on the pets' illness and treatment, so as to apply to the insurance project for compensation for the resources spent on the pets' illness and treatment.
[0021] In this embodiment, in the process of applying for protection for the pets participating in the protection project, the protection application is made by submitting the corresponding voucher image of the pet. Here, the voucher image submitted for the protection application for the pets participating in the protection project is obtained. Specifically, the voucher image can be a rich text image, so that the image label of the voucher image can be more accurately determined based on the full combination of text features and image features in the rich text image.
[0022] Step S104: input the voucher image into a convolutional neural network to extract image features to obtain an image feature vector, and perform character recognition on the voucher image to obtain text feature information.
[0023] In this embodiment, feature extraction is performed on the credential image from two modalities, image and text, so as to perform label recognition on the credential image in both image and text modalities. Specifically, in the process of extracting image features of the credential image in image modality, the credential image is input into a convolutional neural network for image feature extraction to obtain the image feature vector output by the convolutional neural network; wherein the convolutional neural network may be a convolutional neural network in the form of VGG (Visual Geometry Group), ResNet, DenseNet or EfficientNet; in the process of extracting text features of the credential image in text modality, text features in the credential image are recognized by OCR (Optical Character Recognition) technology to obtain the text feature information.
[0024] like Figure 2As shown, on the one hand, the medical treatment certificate image of the pet's medical treatment is input into CNN (Convolutional Neural Networks) for image feature extraction (i.e., medical image feature extraction), and the image feature vector is output; on the other hand, the text features (i.e., medical text) in the medical treatment certificate image are identified through OCR (Optical Character Recognition) technology, and the text feature information is output.
[0025] Step S106, determining an image feature vector pair based on the weight vector pair and the image feature vector, encoding the text feature information to obtain a text feature vector, and fusing the image feature vector with the text feature vector to obtain a fused feature vector.
[0026] The weight vector pair described in this embodiment refers to a vector pair composed of two vectors for representing the weights of the image label type, that is, a weight vector pair composed of a first weight vector and a second weight vector, wherein the first weight vector is used to determine one of the input parameters of the input attention model in combination with the image feature vector (the input parameter corresponding to the Key in the attention model), and the second weight vector is used to determine another input parameter of the input attention model in combination with the image feature vector (the input parameter corresponding to the Value in the attention model), and the first weight vector and the second weight vector are learnable vectors, and the initial values of the first weight vector and the second weight vector can be pre-specified, and the weight values of the first weight vector and the second weight vector are adjusted during training or application.
[0027] In a specific implementation, based on the image feature vector obtained by extracting features from the credential image through the convolutional neural network, here, the image feature vector and the weight vector pair are combined to determine the image feature vector pair that is subsequently used to input into the attention model for image label recognition. Specifically, in an optional implementation provided by this embodiment, the image feature vector pair is determined based on the weight vector pair and the image feature vector, including: calculating a first image feature vector based on the first weight vector and the image feature vector, and calculating a second image feature vector based on the second weight vector and the image feature vector.
[0028] In addition, based on the text feature information of the voucher image obtained by character recognition, the text feature information is encoded and converted into a vector. Specifically, in an optional implementation provided by this embodiment, the text feature information is encoded to obtain a text feature vector, which specifically includes: inputting the text feature information into a text encoder for encoding, and outputting the text feature vector. Figure 2As shown, the text feature information is input into the Text Encoder for encoding and the text feature vector is output.
[0029] In a specific implementation process, after encoding the text feature information to obtain the text feature vector, the feature robustness of the text feature and the correlation between the text feature and the image feature are improved by fusing the image feature vector with the text feature vector. In an optional implementation provided by this embodiment, the image feature vector and the text feature vector are fused to obtain a fused feature vector in the following manner, including:
[0030] (1) performing vector alignment processing on the image feature vector and the text feature vector, and performing vector splicing on the obtained standard image feature vector and the standard text feature vector to obtain a spliced vector.
[0031] Among them, by aligning the image feature vector and the text feature vector, the image feature vector can be spliced with the text feature vector, so that the image features carried by the image feature vector are integrated into the text feature vector by splicing, so as to improve the feature robustness of the text features and the correlation between the text features and the image features in the same voucher image. In an optional implementation provided by this embodiment, the image feature vector and the text feature vector are aligned by vector transformation. Specifically, the image feature vector and the text feature vector are aligned, including: performing vector transformation on the image feature vector, and performing convolution processing on the image feature vector obtained by the transformation to obtain the standard image feature vector; performing vector transformation on the text feature vector, and performing the convolution processing on the text feature vector obtained by the transformation to obtain the standard text feature vector. It should be noted that the standard image feature vector and the standard text feature vector refer to image vectors and text vectors with equal vector dimensions and capable of performing vector operations on each other.
[0032] (2) Extract key features of a standard splicing vector obtained by performing vector alignment processing on the splicing vector to obtain a key feature vector.
[0033] The stitching vector obtained by stitching the standard image feature vector and the standard text feature vector is not equal to the vector dimension of the standard text feature vector. In order to make the stitching vector and the standard text feature vector maintain the same vector dimension, in an optional implementation provided by this embodiment, the stitching vector is aligned in the following manner:
[0034] Performing the convolution process on the splicing vector, and performing normalization process on the splicing vector obtained by the convolution process to obtain a normalized vector;
[0035] The normalized vector is activated by an activation function to obtain the standard concatenated vector.
[0036] This embodiment performs convolution processing on the splicing vector so that the splicing vector can maintain the same vector dimension as the standard text feature vector, and increases the nonlinearity of the splicing vector by normalizing and activating the splicing vector after the convolution processing, so that the features carried by the splicing vector are richer.
[0037] In addition, key features are extracted from the standard splicing vector to improve the feature significance of the splicing vector, and the baseline key feature vector constructed by the extracted key features is aligned with the standard text feature vector through convolution processing, and the nonlinearity of the baseline key feature vector is increased through normalization and activation processing, so that the features carried by the key feature vector finally obtained are richer. Specifically, in an optional implementation provided by this embodiment, the following method is used to extract key features from the splicing vector:
[0038] Extracting the feature with the largest eigenvalue in each dimension of the standard splicing vector as a key feature, and constructing a reference key feature vector based on the extracted key features;
[0039] Performing the convolution process on the reference key feature vector, and performing normalization process on the reference key feature vector obtained by the convolution process to obtain a normalized key feature vector;
[0040] The normalized key feature vector is activated by an activation function, and a feature vector obtained by the activation process is used as the key feature vector.
[0041] (3) Calculating the fused feature vector based on the key feature vector and the standard splicing vector.
[0042] This embodiment improves the feature significance and feature richness of the standard stitching vector of the fused image features by fusing the key feature vector obtained above with the standard stitching vector. Specifically, this embodiment provides an optional implementation method for calculating the fused feature vector based on the key feature vector and the standard stitching vector, which is implemented in the following manner: performing a dot product of the key feature vector and the standard stitching vector to obtain a product vector; performing vector summation of the product vector and the standard stitching vector to obtain the fused feature vector.
[0043] For example, Figure 2The feature vector fusion processing process of the feature fusion model (Feature Alignment) shown in Figure 3 As shown, in the feature fusion model, first, the reshape() method is used to perform vector transformation on the input image feature vector and text feature vector, and the image feature vector and text feature vector obtained after the vector transformation are subjected to 1×1 convolution processing (Conv) to obtain the standard image feature vector and the standard text feature vector;
[0044] Secondly, the standard image feature vector and the standard text feature vector are concatenated into a concatenated vector by the concat() method, and the concatenated vector is convolved (Conv), the convolution result is normalized by BN (Batch Normalization), and the activation function Relu() is called to activate the normalized result to obtain a standard concatenated vector.
[0045] Then, the maximum eigenvalue of each feature dimension of the standard concatenated vector is extracted through maxpool, and the maximum eigenvector is constructed based on the extracted eigenvalues. The maximum eigenvector is subjected to 1×1 convolution (Conv), the convolution result is normalized using BN (BatchNormalization), and the activation function Relu() is called to activate the normalized result to obtain the standard maximum eigenvector.
[0046] Finally, the standard concatenated vector is dot-multiplied with the standard maximum eigenvector, and the dot-product result is summed with the standard concatenated vector to obtain the fused eigenvector and output it.
[0047] Step S108, inputting the image feature vector pair and the fused feature vector into an attention model to perform image label recognition to obtain a label recognition result.
[0048] In this embodiment, the image feature vector pair and the fused feature vector are input into the attention model for attention calculation, and the image label type is determined by the result of the attention calculation, that is, image label recognition is performed. Based on the above calculation based on the first weight vector and the image feature vector to obtain the first image feature vector, and the calculation based on the second weight vector and the image feature vector to obtain the second image feature vector, the first image feature vector, the second image feature vector and the fused feature vector are input into the attention model for image label recognition to obtain a label recognition result. Optionally, during the process of image label recognition (attention calculation), the attention model uses the first image feature vector as the Key, the second image feature vector as the Value and the fused feature vector as the Query to perform image label recognition (attention calculation). Figure 2 As shown, the first image feature vector, the second image feature vector and the fused feature vector are input into the Transformer Decoder for attention calculation.
[0049] Based on this, in an optional implementation provided by this embodiment, the attention model specifically adopts the following method to perform image label recognition (attention calculation): a similarity algorithm is used to calculate the similarity between the fused feature vector and the first image feature vector; the similarity is used as a weight to calculate the weighted sum of the second image feature vector paired with the first image feature vector to obtain an attention value.
[0050] Specifically, after the attention model performs image label recognition (attention calculation) in the above manner to obtain the label recognition result, one or more image label types of the voucher image are determined based on the attention value contained in the label recognition result. In an optional implementation manner provided by this embodiment, the image label type of the voucher image is determined in the following manner:
[0051] Determine whether each attention value in the attention value sequence included in the tag recognition result is greater than a tag threshold of the tag type corresponding to each attention value;
[0052] If so, determining the label type corresponding to the target attention value in the attention sequence whose attention value is greater than the label threshold of the corresponding label type as the image label type of the voucher image;
[0053] If not, no action is required.
[0054] The following uses an image processing method provided by this embodiment in a pet insurance application scenario as an example to further illustrate the image processing method provided by this embodiment. Figure 4 , the image processing method applied to the pet insurance application scenario specifically includes the following steps.
[0055] Step S402, obtaining pet diagnosis and treatment images submitted for protection application for pets participating in the pet protection program.
[0056] Step S404: input the pet diagnosis and treatment image into a convolutional neural network to extract image features to obtain a diagnosis and treatment image vector.
[0057] Step S406, determining a diagnostic image vector pair based on the weight vector pair and the diagnostic image vector.
[0058] Step S408, using OCR to perform character recognition on the pet diagnosis and treatment image to obtain pet diagnosis and treatment information.
[0059] Step S410, input the pet medical information into a text encoder for encoding to obtain a medical text vector.
[0060] Step S412, inputting the diagnosis and treatment text vector and the diagnosis and treatment image vector into the feature fusion model to perform feature vector fusion to obtain the diagnosis and treatment fusion vector.
[0061] Among them, feature vector fusion includes: performing vector alignment processing on the diagnosis and treatment image vector and the diagnosis and treatment text vector, and performing vector splicing on the obtained standard diagnosis and treatment image vector and the standard diagnosis and treatment text vector to obtain a splicing vector, performing key feature extraction on the standard splicing vector obtained by performing vector alignment processing on the splicing vector to obtain a key feature vector, and calculating a fusion vector based on the key feature vector and the standard splicing vector.
[0062] Step S414, input the diagnosis and treatment image vector pair and the diagnosis and treatment fusion vector into the attention model for image label recognition to obtain the label recognition result.
[0063] Step S416, determining whether each attention value in the attention value sequence included in the tag recognition result is greater than a tag threshold of the tag type corresponding to each attention value;
[0064] If so, executing step S418, determining the label type corresponding to the target attention value in the attention sequence whose attention value is greater than the label threshold of the corresponding label type as the image label type of the pet diagnosis and treatment image;
[0065] If not, no action is required.
[0066] An embodiment of an image processing device provided in this specification is as follows:
[0067] In the above-mentioned embodiment, an image processing method is provided, and correspondingly, an image processing device running on a service client is also provided, which is described below with reference to the accompanying drawings.
[0068] Reference Figure 5 , which shows a schematic diagram of an image processing device provided by this embodiment.
[0069] Since the device embodiment corresponds to the method embodiment, the description is relatively simple, and the relevant parts can refer to the corresponding description of the method embodiment provided above. The device embodiment described below is only illustrative.
[0070] This embodiment provides an image processing device, including:
[0071] The voucher image acquisition module 502 is configured to acquire a voucher image submitted for a protection application for a captive animal participating in a protection project;
[0072] The feature extraction module 504 is configured to input the voucher image into a convolutional neural network to extract image features to obtain an image feature vector, and to perform character recognition on the voucher image to obtain text feature information;
[0073] A feature vector fusion module 506 is configured to determine an image feature vector pair based on the weight vector pair and the image feature vector, and to encode the text feature information to obtain a text feature vector, and to fuse the image feature vector with the text feature vector to obtain a fused feature vector;
[0074] The image label recognition module 508 is configured to input the image feature vector pair and the fused feature vector into the attention model to perform image label recognition and obtain a label recognition result.
[0075] An embodiment of an image processing device provided in this specification is as follows:
[0076] Corresponding to the image processing method described above, based on the same technical concept, one or more embodiments of this specification also provide an image processing device, which is used to execute the image processing method provided above. Figure 6 A schematic diagram of the structure of an image processing device provided in one or more embodiments of this specification.
[0077] This embodiment provides an image processing device, including:
[0078] like Figure 6 As shown, the image processing device may have relatively large differences due to different configurations or performances, and may include one or more processors 601 and memory 602, and the memory 602 may store one or more storage applications or data. Among them, the memory 602 may be a short-term storage or a persistent storage. The application stored in the memory 602 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the image processing device. Furthermore, the processor 601 may be configured to communicate with the memory 602 to execute a series of computer executable instructions in the memory 602 on the image processing device. The image processing device may also include one or more power supplies 603, one or more wired or wireless network interfaces 604, one or more input / output interfaces 605, one or more keyboards 606, etc.
[0079] In a specific embodiment, the image processing device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the image processing device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:
[0080] Obtain the voucher image for the protection application submitted for the captives participating in the protection project;
[0081] Inputting the voucher image into a convolutional neural network to extract image features to obtain an image feature vector, and performing character recognition on the voucher image to obtain text feature information;
[0082] Determining an image feature vector pair based on the weight vector pair and the image feature vector, encoding the text feature information to obtain a text feature vector, and fusing the image feature vector with the text feature vector to obtain a fused feature vector;
[0083] The image feature vector pair and the fused feature vector are input into an attention model to perform image label recognition to obtain a label recognition result.
[0084] An embodiment of a storage medium provided in this specification is as follows:
[0085] Corresponding to the image processing method described above, based on the same technical concept, one or more embodiments of this specification also provide a storage medium.
[0086] The storage medium provided in this embodiment is used to store computer executable instructions, and the computer executable instructions implement the following process when executed by a processor:
[0087] Obtain the voucher image for the protection application submitted for the captives participating in the protection project;
[0088] Inputting the voucher image into a convolutional neural network to extract image features to obtain an image feature vector, and performing character recognition on the voucher image to obtain text feature information;
[0089] Determining an image feature vector pair based on the weight vector pair and the image feature vector, encoding the text feature information to obtain a text feature vector, and fusing the image feature vector with the text feature vector to obtain a fused feature vector;
[0090] The image feature vector pair and the fused feature vector are input into an attention model to perform image label recognition to obtain a label recognition result.
[0091] It should be noted that the embodiments of the storage medium in this specification and the embodiments of the image processing method in this specification are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the aforementioned corresponding method, and the repeated parts will not be repeated.
[0092] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0093] In the 1930s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements to method flows). However, with the development of technology, many improvements to method flows today can be regarded as direct improvements to hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0094] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0095] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0096] For the convenience of description, the above device is described in terms of functions and is divided into various units and described separately. Of course, when implementing the embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0097] It should be understood by those skilled in the art that one or more embodiments of this specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0098] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0099] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0100] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0101] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0102] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0103] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0104] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0105] One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0106] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0107] The above description is only an embodiment of this document and is not intended to limit this document. For those skilled in the art, this document may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this document should be included in the scope of the claims of this document.
Claims
1. An image processing method, include: Obtain the voucher image for the protection application submitted for the captives participating in the protection project; Inputting the voucher image into a convolutional neural network to extract image features to obtain an image feature vector, and performing character recognition on the voucher image to obtain text feature information; Based on the first weight vector and the second weight vector, respectively, the image feature vector is used to calculate to obtain a first image feature vector and a second image feature vector, and an image feature vector pair is constructed based on the first image feature vector and the second image feature vector, and the text feature information is encoded to obtain a text feature vector, and the image feature vector is fused with the text feature vector to obtain a fused feature vector; The image feature vector pair and the fused feature vector are input into an attention model to perform image label recognition to obtain a label recognition result.
2. The image processing method according to claim 1, wherein the image feature vector is fused with the text feature vector to obtain a fused feature vector. include: Performing vector alignment processing on the image feature vector and the text feature vector, and performing vector splicing on the obtained standard image feature vector and the standard text feature vector to obtain a spliced vector; Performing vector alignment processing on the splicing vector to obtain a standard splicing vector, performing key feature extraction on the splicing vector, to obtain a key feature vector; The fused feature vector is calculated based on the key feature vector and the standard splicing vector.
3. The image processing method according to claim 2, wherein the image feature vector and the text feature vector are subjected to vector alignment processing. include: Performing vector transformation on the image feature vector, and performing convolution processing on the image feature vector obtained by the transformation to obtain the standard image feature vector; The text feature vector is subjected to vector transformation, and the text feature vector obtained by the transformation is subjected to the convolution process to obtain the standard text feature vector.
4. The image processing method according to claim 3, wherein the stitching vectors are subjected to vector alignment processing. include: Performing the convolution process on the splicing vector, and performing normalization process on the splicing vector obtained by the convolution process to obtain a normalized vector; The normalized vector is activated by an activation function to obtain the standard concatenated vector.
5. The image processing method according to claim 3, wherein the key feature extraction is: include: Extracting the feature with the largest eigenvalue in each dimension of the standard splicing vector as a key feature, and constructing a reference key feature vector based on the extracted key features; Performing the convolution process on the reference key feature vector, and performing normalization process on the reference key feature vector obtained by the convolution process to obtain a normalized key feature vector; The normalized key feature vector is activated by an activation function, and a feature vector obtained by the activation process is used as the key feature vector.
6. The image processing method according to claim 2, wherein the fusion feature vector is calculated based on the key feature vector and the standard splicing vector. include: Performing a dot multiplication of the key feature vector and the standard splicing vector to obtain a product vector; The product vector and the standard concatenated vector are vector-summed to obtain the fused feature vector.
7. The image processing method according to claim 1, wherein the text feature information is encoded to obtain a text feature vector. include: The text feature information is input into a text encoder for encoding, and the text feature vector is output.
8. According to the image processing method of claim 1, the attention model uses the first image feature vector as Key, the second image feature vector as Value, and the fused feature vector as Query to perform image label recognition.
9. The image processing method according to claim 8, wherein the image tag recognition is include: Calculating the similarity between the fused feature vector and the first image feature vector using a similarity algorithm; The similarity is used as a weight to calculate a weighted sum of the second image feature vector paired with the first image feature vector to obtain an attention value.
10. The image processing method according to claim 9, wherein after the step of inputting the image feature vector pair and the fused feature vector into the attention model for image label recognition and obtaining the label recognition result is performed, include: Determine whether each attention value in the attention value sequence included in the tag recognition result is greater than a tag threshold of the tag type corresponding to each attention value; If so, the label type corresponding to the target attention value whose attention value in the attention sequence is greater than the label threshold of the corresponding label type is determined as the image label type of the voucher image.
11. An image processing device, include: A voucher image acquisition module is configured to acquire a voucher image submitted for a guarantee application for a captive animal participating in a guarantee project; A feature extraction module is configured to input the voucher image into a convolutional neural network to extract image features to obtain an image feature vector, and to perform character recognition on the voucher image to obtain text feature information; a feature vector fusion module, configured to calculate the first image feature vector and the second image feature vector based on the first weight vector and the second weight vector respectively, and to construct an image feature vector pair based on the first image feature vector and the second image feature vector, and to encode the text feature information to obtain a text feature vector, and to fuse the image feature vector with the text feature vector to obtain a fused feature vector; The image label recognition module is configured to input the image feature vector pair and the fused feature vector into the attention model to perform image label recognition and obtain a label recognition result.
12. An image processing device, include: processor; and a memory configured to store computer executable instructions that, when executed, cause the processor to: Obtain the voucher image for the protection application submitted for the captives participating in the protection project; Inputting the voucher image into a convolutional neural network to extract image features to obtain an image feature vector, and performing character recognition on the voucher image to obtain text feature information; Based on the first weight vector and the second weight vector, respectively, the image feature vector is used to calculate to obtain a first image feature vector and a second image feature vector, and an image feature vector pair is constructed based on the first image feature vector and the second image feature vector, and the text feature information is encoded to obtain a text feature vector, and the image feature vector is fused with the text feature vector to obtain a fused feature vector; The image feature vector pair and the fused feature vector are input into an attention model to perform image label recognition to obtain a label recognition result.
13. A storage medium for storing computer executable instructions, wherein the computer executable instructions, when executed by a processor, implement the following process: Obtain the voucher image for the protection application submitted for the captives participating in the protection project; Inputting the voucher image into a convolutional neural network to extract image features to obtain an image feature vector, and performing character recognition on the voucher image to obtain text feature information; Based on the first weight vector and the second weight vector, respectively, the image feature vector is used to calculate to obtain a first image feature vector and a second image feature vector, and an image feature vector pair is constructed based on the first image feature vector and the second image feature vector, and the text feature information is encoded to obtain a text feature vector, and the image feature vector is fused with the text feature vector to obtain a fused feature vector; The image feature vector pair and the fused feature vector are input into an attention model to perform image label recognition to obtain a label recognition result.
