Data processing method and apparatus

By extracting and fusing image features and text features, combining contrast learning and hyperbolic spatial mapping, the problem of low accuracy of existing trademark recognition algorithms is solved, and a more efficient trademark recognition effect is achieved.

WO2024245349A1PCT designated stage expired Publication Date: 2024-12-05HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/096385
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-30
Filing Date
2024-05-30
Publication Date
2024-12-05

AI Technical Summary

Technical Problem

The existing trademark identification algorithm based on object detection only uses image features in image classification, resulting in poor trademark identification accuracy.

Method used

By acquiring an image containing text, the first neural network extracts image features and the second neural network extracts text features, and fuses the two, and uses the fused feature representation to perform trademark recognition to improve the recognition accuracy of the model. Specific methods include designing multi-level contrast loss functions using contrast learning, enhancing discrimination between different levels, and improving the effect of feature representation through dimensional alignment and hyperbolic spatial mapping.

Benefits of technology

It significantly improves the recognition accuracy of the included text images, improves the noise interference problem, and improves the accuracy and robustness of trademark recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024096385_05122024_PF_FP_ABST
    Figure CN2024096385_05122024_PF_FP_ABST
Patent Text Reader

Abstract

A data processing method, which is applied to image processing. The method comprises: acquiring a first image and a second image, wherein the first image and the second image each include text; obtaining image features of the first image and the second image by means of a first neural network; by means of a second neural network, obtaining text features of the text included in the first image and the second image, and fusing a first feature representation and a third feature representation to obtain a first target feature representation; fusing a second feature representation and a fourth feature representation to obtain a second target feature representation; and determining a loss according to the relationship between the first target feature representation and the second target feature representation, and updating the first neural network according to the loss. In the present application, image features and text features of images including text are extracted, the image features and the text features are fused, and a model is updated by means of a fused feature representation, such that the recognition precision of a trained model on the images including the text can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

A data processing method and device thereof

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on May 30, 2023, with application number 202310627422.0 and invention name “A data processing method and device thereof”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of artificial intelligence, and in particular to a data processing method and device thereof. Background Art

[0003] Artificial Intelligence (AI) is the theory, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a branch of computer science that seeks to understand the essence of intelligence and develop new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.

[0004] Trademark recognition is widely used in e-commerce and machine vision, typically in copyright verification, brand recognition, product search and recommendation, and other applications. Trademark recognition is also widely used in numerous industrial vision scenarios, such as target customer identification, hazardous chemical logo recognition, and product inspection.

[0005] Existing trademark recognition algorithms based on object detection use an object extraction model to detect all possible image regions within an input image as candidate targets. An image classification network then classifies these candidate regions and outputs either a target trademark prediction or a prediction of no trademark. However, existing image classification networks only use image features for trademark recognition, resulting in poor accuracy.

[0006] Summary of the Invention

[0007] This application provides a data processing method that can improve the recognition accuracy of a model for images containing text.

[0008] In a first aspect, the present application provides a data processing method, comprising: acquiring a first image, the first image containing text; processing the first image through a first neural network to obtain a first feature representation; the first feature representation is an image feature of the first image; processing the first image through a second neural network to obtain a second feature representation; the second feature representation is a text feature of the text contained in the first image; fusing the first feature representation and the second feature representation to obtain a first target feature representation; and determining the category of the first image based on the first target feature representation.

[0009] By using the above method, i.e. extracting the image features of the image containing text, extracting the text features of the text, fusing the image features and the text features, and using the fused feature representation for trademark recognition, the recognition accuracy of the model for images containing text can be improved.

[0010] In one possible implementation, the first image is a trademark, and determining the category of the first image based on the first target feature representation includes: determining the category of the trademark based on the similarity between the first target feature representation and multiple preset feature representations; each preset feature representation is obtained by feature extraction of a category of trademarks.

[0011] In a possible implementation, the method further includes: dimensionally aligning the second feature representation and the first feature representation; fusing the first feature representation and the second feature representation to obtain a first target feature representation, including: fusing the dimensionally aligned first feature representation and the second feature representation to obtain the first target feature representation.

[0012] In a possible implementation, the first target feature representation and each of the preset feature representations are features mapped into a hyperbolic metric space. The hyperbolic metric space can accommodate a multi-level data structure.

[0013] In a second aspect, an embodiment of the present application provides a data processing method, including: acquiring a first image and a second image; the first image and the second image contain text; processing the first image and the second image separately through a first neural network to obtain a first feature representation and a second feature representation; the first feature representation is an image feature of the first image, and the second feature representation is an image feature of the second image; processing the first image and the second image separately through a second neural network to obtain a third feature representation and a fourth feature representation; the first feature representation is a text feature of the text contained in the first image, and the second feature representation is a text feature of the text contained in the second image; fusing the first feature representation and the third feature representation to obtain a first target feature representation; fusing the second feature representation and the fourth feature representation to obtain a second target feature representation; determining a loss based on the relationship between the first target feature representation and the second target feature representation, and updating the first neural network based on the loss.

[0014] By using the above method, i.e. extracting the image features of the image containing text, extracting the text features of the text, fusing the image features and the text features, and using the fused feature representation for trademark recognition, the recognition accuracy of the model for images containing text can be improved.

[0015] In a possible implementation, the first image and the second image contain a trademark.

[0016] In one possible implementation, the first image and the second image include different styles of the same trademark; determining the loss based on the relationship between the first target feature representation and the second target feature representation includes: determining the loss through comparative learning based on the relationship between the first target feature representation and the second target feature representation, the loss being used to increase the first distance between the first target feature representation and the second target feature representation.

[0017] In one possible implementation, the first and second images include different trademarks; determining a loss based on the relationship between the first and second target feature representations includes: determining a loss through comparative learning based on the relationship between the first and second target feature representations, the loss being used to increase a second distance between the first and second target feature representations; and the increase in the second distance is greater than the increase in the first distance. Compared to when the first and second images include different styles of the same trademark, when the first and second images include different trademarks, the difference between the trademarks included in the images is greater, and therefore a greater increase in the distance between the features during comparative learning is required.

[0018] In one possible implementation, the first image and the second image include the same style of the same trademark, and determining the loss based on the relationship between the first target feature representation and the second target feature representation includes: determining the loss through comparative learning based on the relationship between the first target feature representation and the second target feature representation, and the loss is used to narrow the distance between the first target feature representation and the second target feature representation.

[0019] In a possible implementation, the first image and the second image are obtained by cropping the original image after target detection is performed on the original image through a detection network, and the first image is an image in which the detection network can recognize the target, and the second image is an image in which the detection network cannot recognize the target; determining the loss based on the relationship between the first target feature representation and the second target feature representation includes: determining the loss through contrastive learning based on the relationship between the first target feature representation and the second target feature representation, and the loss is used to increase the distance between the first target feature representation and the second target feature representation.

[0020] In a possible implementation, the first image and the second image are obtained by cropping the original image after target detection is performed on the original image by a detection network, and the first image and the second image are images in which the detection network cannot recognize the target; determining the loss based on the relationship between the first target feature representation and the second target feature representation includes: determining the loss through contrastive learning based on the relationship between the first target feature representation and the second target feature representation, and the loss is used to narrow the distance between the first target feature representation and the second target feature representation.

[0021] In the embodiment of the present application, by designing a multi-level contrast loss function, contrast learning loss functions are designed at different levels to enhance the discriminability between different levels; the noise (negative) samples and positive samples are contrasted and learned, which significantly improves the noise interference problem.

[0022] In a possible implementation, the first target feature representation and the second target feature representation are features mapped into a hyperbolic space.

[0023] In a third aspect, the present application provides a data processing device, comprising:

[0024] A processing module, configured to acquire a first image, where the first image contains text;

[0025] Processing the first image through a first neural network to obtain a first feature representation, wherein the first feature representation is an image feature of the first image;

[0026] Processing the first image through a second neural network to obtain a second feature representation; the second feature representation is a text feature of text contained in the first image;

[0027] Fusing the first feature representation and the second feature representation to obtain a first target feature representation;

[0028] Determine a category of the first image based on the first target feature representation.

[0029] In a possible implementation, the first image is a trademark, and determining the category of the first image according to the first target feature representation includes:

[0030] The category of the trademark is determined based on the similarity between the first target feature representation and multiple preset feature representations; each preset feature representation is obtained by extracting features from a category of trademarks.

[0031] In a possible implementation, the processing module is further configured to: dimensionally align the second feature representation and the first feature representation;

[0032] The processing module is specifically used to: fuse the first feature representation and the second feature representation after dimension alignment to obtain a first target feature representation.

[0033] In a possible implementation, the first target feature representation and each of the preset feature representations are features mapped into a hyperbolic space.

[0034] In a fourth aspect, the present application provides a data processing device, comprising:

[0035] A processing module, configured to acquire a first image and a second image; the first image and the second image contain text;

[0036] Processing the first image and the second image separately through a first neural network to obtain a first feature representation and a second feature representation; the first feature representation is an image feature of the first image, and the second feature representation is an image feature of the second image;

[0037] processing the first image and the second image respectively through a second neural network to obtain a third feature representation and a fourth feature representation; the first feature representation is a text feature of the text contained in the first image, and the second feature representation is a text feature of the text contained in the second image;

[0038] Fusing the first feature representation and the third feature representation to obtain a first target feature representation;

[0039] Fusing the second feature representation and the fourth feature representation to obtain a second target feature representation;

[0040] A loss is determined based on a relationship between the first target feature representation and the second target feature representation, and the first neural network is updated based on the loss.

[0041] In one possible implementation, the first image and the second image include a trademark.

[0042] In a possible implementation, the first image and the second image include different styles of the same trademark; and the processing module is specifically configured to:

[0043] According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through contrastive learning, where the loss is used to increase a first distance between the first target feature representation and the second target feature representation.

[0044] In a possible implementation, the first image and the second image include different trademarks; and the processing module is specifically configured to:

[0045] According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through comparative learning, and the loss is used to increase the second distance between the first target feature representation and the second target feature representation; and the increase in the second distance is greater than the increase in the first distance.

[0046] In a possible implementation, the first image and the second image include the same style of the same trademark, and the processing module is specifically configured to:

[0047] According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through contrastive learning, where the loss is used to narrow the distance between the first target feature representation and the second target feature representation.

[0048] In a possible implementation, the first image and the second image are obtained by cropping an original image after performing target detection on the original image through a detection network, and the first image is an image in which the detection network can recognize the target, and the second image is an image in which the detection network cannot recognize the target;

[0049] The processing module is specifically used to:

[0050] According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through contrastive learning, where the loss is used to increase the distance between the first target feature representation and the second target feature representation.

[0051] In a possible implementation, the first image and the second image are obtained by cropping an original image after performing target detection on the original image through a detection network, and the first image and the second image are images in which the detection network cannot recognize the target; the processing module is specifically configured to:

[0052] According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through contrastive learning, where the loss is used to narrow the distance between the first target feature representation and the second target feature representation.

[0053] In a possible implementation, the first target feature representation and the second target feature representation are features mapped into a hyperbolic space.

[0054] In the fifth aspect, an embodiment of the present application provides a data processing device, which may include a memory, a processor, and a bus system, wherein the memory is used to store programs, and the processor is used to execute the programs in the memory to perform the first aspect and any optional method thereof, as well as the second aspect and any optional method thereof.

[0055] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer-readable storage medium is run on a computer, the computer executes the above-mentioned first aspect and any optional method thereof, and the above-mentioned second aspect and any optional method thereof.

[0056] In a seventh aspect, an embodiment of the present application provides a computer program which, when executed on a computer, enables the computer to execute the above-mentioned first aspect and any optional method thereof, and the above-mentioned second aspect and any optional method thereof.

[0057] In an eighth aspect, the present application provides a chip system comprising a processor configured to support the execution of a data processing device to implement the functions described in the aforementioned aspects, such as transmitting or processing the data or information described in the aforementioned methods. In one possible design, the chip system further comprises a memory configured to store program instructions and data necessary for executing the device or training the device. The chip system may consist of a single chip or may include a chip and other discrete components. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] FIG1A is a schematic diagram of a structure of an artificial intelligence main framework;

[0059] Figures 1B to 1C are schematic diagrams of the application system framework of the present application;

[0060] FIG2 is a schematic diagram of an optional hardware structure of a terminal;

[0061] FIG3 is a schematic diagram of the structure of a server;

[0062] FIG4 is a schematic diagram of a system architecture of the present application;

[0063] Figure 5 is a process of cloud services;

[0064] FIG6 is a flowchart of a data processing method provided in an embodiment of the present application;

[0065] 7 to 11A are schematic diagrams of a process of a data processing method provided in an embodiment of the present application;

[0066] FIG11B and FIG11C are schematic diagrams of data distribution;

[0067] FIG11D is a flowchart of a data processing method provided in an embodiment of the present application;

[0068] FIG11E is a schematic diagram of data distribution;

[0069] FIG11F is a flowchart of a data processing method provided in an embodiment of the present application;

[0070] FIG12 is a schematic structural diagram of a data processing device provided in an embodiment of the present application;

[0071] FIG13 is a schematic diagram of a structure of an execution device provided in an embodiment of the present application;

[0072] FIG14 is a schematic diagram of a structure of a training device provided in an embodiment of the present application;

[0073] FIG15 is a schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION

[0074] The following describes the embodiments of the present application in conjunction with the accompanying drawings. The terms used in the implementation methods of the present application are only used to explain the specific embodiments of the present application and are not intended to limit the present application.

[0075] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0076] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, and this is merely a way of distinguishing the objects of the same attributes when describing them in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0077] As used herein, the terms "substantially," "about," and similar terms are used as terms of approximation, not as terms of degree, and are intended to take into account the inherent deviations in measurements or calculations that one of ordinary skill in the art would recognize. Furthermore, the use of "may" when describing embodiments of the present application refers to "one or more possible embodiments." As used herein, the terms "use," "using," and "used" may be considered synonymous with the terms "utilize," "utilizing," and "utilized," respectively. Additionally, the term "exemplary" is intended to refer to an example or illustration.

[0078] First, let's describe the overall workflow of an AI system. See Figure 1A, which shows a schematic diagram of the main AI framework. This AI framework will be explained from two perspectives: the "intelligent information chain" (horizontal axis) and the "IT value chain" (vertical axis). The "intelligent information chain" reflects the entire process from data acquisition to processing. For example, it could be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, and intelligent execution and output. Throughout this process, data undergoes a condensed journey from "data-information-knowledge-wisdom." The "IT value chain," spanning the underlying infrastructure of human intelligence, information (provided and processed by technology), and the system's industrial ecosystem, reflects the value that AI brings to the information technology industry.

[0079] (1) Infrastructure

[0080] Infrastructure provides computing power for AI systems, enabling communication with the outside world and supporting this through a foundational platform. External communication occurs through sensors; computing power is provided by intelligent chips (CPUs, NPUs, GPUs, ASICs, FPGAs, and other hardware accelerators). The foundational platform includes a distributed computing framework and network-related platform guarantees and support, including cloud storage and computing, and interconnected networks. For example, sensors communicate with the outside world to acquire data, which is then fed into the intelligent chips within the distributed computing system provided by the foundational platform for computation.

[0081] (2) Data

[0082] Data above the infrastructure layer represents data sources for AI. This data includes graphics, images, voice, and text, as well as IoT data from traditional devices. This includes business data from existing systems and sensor data such as force, displacement, liquid level, temperature, and humidity.

[0083] (3) Data processing

[0084] Data processing generally includes data training, machine learning, deep learning, search, reasoning, decision-making, etc.

[0085] Among them, machine learning and deep learning can symbolize and formalize data for intelligent information modeling, extraction, preprocessing, and training.

[0086] Reasoning refers to the process of simulating human intelligent reasoning in computers or intelligent systems, using formalized information to perform machine thinking and solve problems based on reasoning control strategies. Typical functions are search and matching.

[0087] Decision-making refers to the process of making decisions after intelligent information is reasoned, and usually provides functions such as classification, sorting, and prediction.

[0088] (4) General ability

[0089] After the data has undergone the data processing mentioned above, some general capabilities can be further formed based on the results of the data processing, such as algorithms or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.

[0090] (5) Smart products and industry applications

[0091] Smart products and industry applications refer to the products and applications of artificial intelligence systems in various fields. They are the encapsulation of the overall artificial intelligence solution, which productizes intelligent information decision-making and realizes practical application. Its application areas mainly include: smart terminals, smart transportation, smart medical care, autonomous driving, smart cities, etc.

[0092] This application can be applied to the field of image processing in the field of artificial intelligence. Taking image processing as an example, the following will introduce multiple application scenarios that have been implemented in products.

[0093] First, the application scenario of this application is introduced.

[0094] This application can be applied to, but is not limited to, applications with image processing functions (hereinafter referred to as image processing applications) or cloud services provided by cloud-side servers, etc., which are described below:

[0095] 1. Image processing applications:

[0096] The product form of the embodiment of the present application can be an image processing application, in particular, a trademark recognition application. The application with the trademark recognition function can be run on a terminal device or a cloud-side server.

[0097] In one possible implementation, a trademark recognition application can perform tasks such as trademark recognition based on an input image and obtain a processing result. The processing result can be a trademark recognition result (for example, a cropped area of ​​the area where the trademark is located in the image and the category of the trademark, such as which manufacturer it belongs to).

[0098] In one possible implementation, the user can open an image processing application installed on the terminal device and input an image. The image processing application can process the image using the method provided in the embodiment of the present application and present the processing results to the user (the presentation method can be but is not limited to display, saving, uploading to the cloud side, etc.).

[0099] In one possible implementation, a user can open an image processing application installed on a terminal device and input an image. The image processing application can send the image to a server on the cloud side. The server on the cloud side processes the image using the method provided in an embodiment of the present application and transmits the processing result back to the terminal device. The terminal device can present the processing result to the user (the presentation method can be but is not limited to display, saving, uploading to the cloud side, etc.).

[0100] Next, the image processing application in the embodiment of this application is introduced from the perspective of functional architecture and product architecture that implements the functions.

[0101] Referring to FIG. 1B , FIG. 1B is a schematic diagram of the functional architecture of an image processing application in an embodiment of the present application:

[0102] In one possible implementation, as shown in FIG1B , an image processing application 102 may receive input parameters 101 (e.g., including an image) and generate a processing result 103. The image processing application 102 may be executed on, for example, at least one computer system and include computer code that, when executed by one or more computers, causes the computers to execute the method provided in the embodiments of the present application.

[0103] Referring to FIG. 1C , FIG. 1C is a schematic diagram of the physical architecture for running an image processing application in an embodiment of the present application:

[0104] Referring to FIG1C , FIG1C shows a schematic diagram of a system architecture. The system may include a terminal 100 and a server 200. The server 200 may include one or more servers (FIG1C illustrates one server as an example), and the server 200 may provide the method provided in the embodiments of the present application to one or more terminals.

[0105] Among them, an image processing application can be installed on the terminal 100. The above application and web page can provide an interface. The terminal 100 can receive relevant parameters entered by the user on the trademark recognition interface and send the above parameters to the server 200. The server 200 can obtain the processing results based on the received parameters and return the processing results to the terminal 100.

[0106] It should be understood that in some optional implementations, the terminal 100 can also complete the action of obtaining the processing result based on the received parameters by itself without the need for the cooperation of the server, and the embodiments of the present application are not limited to this.

[0107] Next, the product form of the terminal 100 in FIG1C is described;

[0108] The terminal 100 in the embodiment of the present application can be a mobile phone, a tablet computer, a wearable device, an in-vehicle device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., and the embodiment of the present application does not impose any restrictions on this.

[0109] FIG2 shows a schematic diagram of an optional hardware structure of the terminal 100 .

[0110] 2 , the terminal 100 may include components such as a radio frequency unit 110, a memory 120, an input unit 130, a display unit 140, a camera 150 (optional), an audio circuit 160 (optional), a speaker 161 (optional), a microphone 162 (optional), a processor 170, an external interface 180, and a power supply 190. Those skilled in the art will appreciate that FIG2 is merely an example of a terminal or multi-function device and does not limit the terminal or multi-function device. The terminal or multi-function device may include more or fewer components than shown, or may combine certain components or have different components.

[0111] The input unit 130 can be used to receive input digital or character information and generate key signal input related to user settings and function control of the portable multifunction device. Specifically, the input unit 130 may include a touch screen 131 (optional) and / or other input devices 132. The touch screen 131 can detect user touch operations on or near it (for example, operations performed on or near the touch screen using a finger, joint, stylus, or any other suitable object) and drive corresponding connected devices according to pre-set programs. The touch screen can detect user touch actions on the touch screen, convert the touch actions into touch signals and transmit them to the processor 170. It can also receive and execute commands sent by the processor 170; the touch signals include at least touch point coordinate information. The touch screen 131 provides an input interface and an output interface between the terminal 100 and the user. Touch screens can be implemented using various types, including resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch screen 131, the input unit 130 may also include other input devices. Specifically, the other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.

[0112] The input device 132 may receive input images and the like.

[0113] The display unit 140 may be used to display information input by the user or provided to the user, various menus of the terminal 100, interactive interfaces, file display, and / or playback of any multimedia file. In an embodiment of the present application, the display unit 140 may be used to display the interface of an image processing application, processing results, etc.

[0114] Memory 120 can be used to store instructions and data. It primarily includes an instruction storage area and a data storage area. The data storage area can store various data, such as multimedia files and text. The instruction storage area can store software units such as the operating system, applications, and instructions required for at least one function, or subsets or extensions thereof. It may also include non-volatile random access memory (RAM). It provides processor 170 with management functions for the hardware, software, and data resources within the computing and processing device, supporting control software and applications. It is also used to store multimedia files and running programs and applications.

[0115] The processor 170 is the control center of the terminal 100. It connects all components of the terminal 100 using various interfaces and circuits. By executing instructions stored in the memory 120 and accessing data stored therein, it executes various functions of the terminal 100 and processes data, thereby providing overall control of the terminal device. Optionally, the processor 170 may include one or more processing units. Preferably, the processor 170 may integrate an application processor and a modem processor, with the application processor primarily processing the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into the processor 170. In some embodiments, the processor and memory may be implemented on a single chip; in other embodiments, they may be implemented on separate chips. The processor 170 may also generate corresponding operational control signals and send them to the corresponding components of the computing and processing device. It may also read and process data in the software, particularly the data and programs in the memory 120, to enable the various functional modules therein to perform their corresponding functions, thereby controlling the corresponding components to operate as instructed.

[0116] Among them, the memory 120 can be used to store software codes related to the data processing method, the processor 170 can execute the steps of the chip's data processing method, and can also schedule other units (such as the above-mentioned input unit 130 and display unit 140) to implement corresponding functions.

[0117] The RF unit 110 (optional) can be used to send and receive information or receive and send signals during a call. For example, after receiving downlink information from the base station, it is passed to the processor 170 for processing; in addition, it sends the designed uplink data to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF unit 110 can also communicate with network devices and other devices via wireless communication. This wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

[0118] In this embodiment of the present application, the RF unit 110 may send the image to the server 200 and receive the processing result sent by the server 200.

[0119] It should be understood that the radio frequency unit 110 is optional and can be replaced by other communication interfaces, such as a network port.

[0120] The terminal 100 also includes a power supply 190 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 170 through a power management system, thereby managing functions such as charging, discharging, and power consumption through the power management system.

[0121] The terminal 100 further includes an external interface 180 , which may be a standard Micro USB interface or a multi-pin connector, and may be used to connect the terminal 100 to other devices for communication, or to connect a charger to charge the terminal 100 .

[0122] Although not shown, the terminal 100 may also include a flash, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with different functions, etc., which are not described in detail here. Some or all of the methods described below may be applied to the terminal 100 shown in FIG.

[0123] Next, the product form of the server 200 in FIG1C is described;

[0124] FIG3 provides a schematic diagram of the structure of a server 200. As shown in FIG3, the server 200 includes a bus 201, a processor 202, a communication interface 203, and a memory 204. The processor 202, the memory 204, and the communication interface 203 communicate with each other via the bus 201.

[0125] Bus 201 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, FIG3 shows only one thick line, but this does not imply that there is only one bus or only one type of bus.

[0126] The processor 202 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0127] The memory 204 may include volatile memory, such as random access memory (RAM). The memory 204 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard drive (HDD), or solid state drive (SSD).

[0128] The memory 204 may be used to store software codes related to the data processing method, and the processor 202 may execute the steps of the data processing method of the chip, and may also schedule other units to implement corresponding functions.

[0129] It should be understood that the above-mentioned terminal 100 and server 200 can be centralized or distributed devices, and the processors in the above-mentioned terminal 100 and server 200 (such as processor 170 and processor 202) can be hardware circuits (such as application specific integrated circuit (ASIC), field-programmable gate array (FPGA), general-purpose processor, digital signal processor (DSP), microprocessor or microcontroller, etc.), or a combination of these hardware circuits. For example, the processor can be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.

[0130] It should be understood that the steps related to the model reasoning process in the embodiments of this application involve AI-related operations. When performing AI operations, the instruction execution architecture of the terminal device and server is not limited to the processor-memory architecture described above. The system architecture provided in the embodiments of this application is described in detail below with reference to Figure 4.

[0131] FIG4 is a schematic diagram of the system architecture provided by an embodiment of the present application. As shown in FIG4 , the system architecture 500 includes an execution device 510 , a training device 520 , a database 530 , a client device 540 , a data storage system 550 , and a data acquisition system 560 .

[0132] The execution device 510 includes a calculation module 511, an I / O interface 512, a pre-processing module 513, and a post-processing module 514. The calculation module 511 may include the target model / rule 501, and the pre-processing module 513 and the post-processing module 514 are optional.

[0133] The execution device 510 may be a terminal device or a server that runs the above-mentioned image processing application.

[0134] The data acquisition device 560 is used to collect training samples. The training samples can be multiple images, etc. After collecting the training samples, the data acquisition device 560 stores these training samples in the database 530.

[0135] The training device 520 can train the neural network to be trained (such as the first neural network, the second neural network (optional), the third neural network, etc. in the embodiment of the present application) based on the training samples maintained in the database 530 to obtain the target model / rule 501.

[0136] It should be understood that the training device 520 can perform a pre-training process on the neural network to be trained based on the training samples maintained in the database 530, or fine-tune the model based on the pre-training.

[0137] It should be noted that, in actual applications, the training samples maintained in the database 530 may not all be collected by the data acquisition device 560, but may also be received from other devices. It should also be noted that the training device 520 may not train the target model / rule 501 entirely based on the training samples maintained in the database 530, but may also obtain training samples from the cloud or other places for model training. The above description should not be used as a limitation on the embodiments of the present application.

[0138] The target model / rule 501 obtained through training with the training device 520 can be applied to different systems or devices, such as the execution device 510 shown in FIG4 . The execution device 510 can be a terminal, such as a mobile phone terminal, a tablet computer, a laptop computer, an augmented reality (AR) / virtual reality (VR) device, an in-vehicle terminal, etc., or a server, etc.

[0139] Specifically, the training device 520 may transfer the trained model to the execution device 510 .

[0140] In Figure 4, the execution device 510 is configured with an input / output (I / O) interface 512 for data interaction with external devices. The user can input data (such as images in the embodiment of the present application) to the I / O interface 512 through the client device 540.

[0141] Preprocessing module 513 and preprocessing module 514 are used to preprocess the input data received by I / O interface 512. It should be understood that preprocessing module 513 and preprocessing module 514 may be absent or only one preprocessing module may be present. If preprocessing module 513 and preprocessing module 514 are absent, computing module 511 may be used directly to process the input data.

[0142] When the execution device 510 preprocesses the input data, or when the computing module 511 of the execution device 510 performs calculations and other related processing, the execution device 510 can call the data, code, etc. in the data storage system 550 for corresponding processing, and can also store the data, instructions, etc. obtained from the corresponding processing in the data storage system 550.

[0143] Finally, the I / O interface 512 provides the processed results to the client device 540 and thus to the user.

[0144] In the scenario shown in FIG. 4 , the user can manually input data, and this "manual input data" can be operated through the interface provided by I / O interface 512. Alternatively, client device 540 can automatically send input data to I / O interface 512. If user authorization is required for client device 540 to automatically send input data, the user can set the corresponding permissions in client device 540. The user can view the output of execution device 510 on client device 540, which can be presented in a display, sound, action, or other specific form. Client device 540 can also serve as a data acquisition terminal, collecting input data and output results from I / O interface 512 as new sample data and storing them in database 530. Of course, collection can also be performed without client device 540, with I / O interface 512 directly storing the input data and output results from I / O interface 512 as new sample data in database 530.

[0145] It is worth noting that FIG4 is merely a schematic diagram of a system architecture provided by an embodiment of the present application, and the positional relationships between the devices, components, modules, etc. shown in the figure do not constitute any limitation. For example, in FIG4 , the data storage system 550 is an external memory relative to the execution device 510. In other cases, the data storage system 550 can also be placed in the execution device 510. It should be understood that the execution device 510 can be deployed in the client device 540.

[0146] From the inference side of the model:

[0147] In the embodiment of the present application, the computing module 511 of the above-mentioned execution device 510 can obtain the code stored in the data storage system 550 to implement the steps related to the model reasoning process in the embodiment of the present application.

[0148] In an embodiment of the present application, the computing module 511 of the execution device 510 may include a hardware circuit (such as an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a general-purpose processor, a digital signal processor (DSP), a microprocessor or a microcontroller, etc.), or a combination of these hardware circuits. For example, the training device 520 may be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.

[0149] Specifically, the computing module 511 of the execution device 510 can be a hardware system with an execution instruction function, and the steps related to the model reasoning process provided in the embodiment of the present application can be software codes stored in the memory. The computing module 511 of the execution device 510 can obtain the software code from the memory and execute the obtained software code to implement the steps related to the model reasoning process provided in the embodiment of the present application.

[0150] It should be understood that the computing module 511 of the execution device 510 can be a combination of a hardware system that does not have the function of executing instructions and a hardware system that has the function of executing instructions. Some of the steps related to the model reasoning process provided in the embodiment of the present application can also be implemented by the hardware system that does not have the function of executing instructions in the computing module 511 of the execution device 510, which is not limited here.

[0151] From the training side of the model:

[0152] In an embodiment of the present application, the above-mentioned training device 520 can obtain the code stored in the memory (not shown in Figure 4, which can be integrated into the training device 520 or deployed separately from the training device 520) to implement the steps related to model training in the embodiment of the present application.

[0153] In an embodiment of the present application, the training device 520 may include a hardware circuit (such as an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a general-purpose processor, a digital signal processor (DSP), a microprocessor or a microcontroller, etc.), or a combination of these hardware circuits. For example, the training device 520 may be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.

[0154] It should be understood that the training device 520 can be a combination of a hardware system that does not have the function of executing instructions and a hardware system that has the function of executing instructions. Some of the steps related to model training provided in the embodiments of the present application can also be implemented by the hardware system in the training device 520 that does not have the function of executing instructions, which is not limited here.

[0155] 2. Trademark recognition cloud services provided by the server:

[0156] In a possible implementation, the server may provide trademark recognition services to the terminal side through an application programming interface (API).

[0157] Among them, the terminal device can send relevant parameters (such as images) to the server through the API provided by the cloud. The server can obtain processing results based on the received parameters, etc., and return the processing results to the terminal.

[0158] The description of the terminal and the server can be the same as that of the above embodiments, and will not be repeated here.

[0159] FIG5 shows the process of using a trademark recognition cloud service provided by a cloud platform.

[0160] 1. Activate and purchase content review services.

[0161] 2. Users can download the software development kit (SDK) corresponding to the content review service. Usually, the cloud platform provides multiple development versions of the SDK for users to choose according to the requirements of the development environment, such as JAVA version SDK, Python version SDK, PHP version SDK, Android version SDK, etc.

[0162] 3. After the user downloads the corresponding version of the SDK to the local computer as needed, they import the SDK project into the local development environment, configure and debug it in the local development environment. The local development environment can also be used to develop other functions, forming an application that integrates trademark recognition capabilities.

[0163] 4. When trademark recognition is needed during use, trademark recognition applications can trigger a trademark recognition API call. When the application triggers trademark recognition, it initiates an API request to the running instance of the trademark recognition service in the cloud environment. The API request includes an image, which is then processed by the running instance in the cloud environment to obtain the result.

[0164] 5. The cloud environment returns the processing results to the application, thereby completing a method call provided in an embodiment of the present application.

[0165] Since the embodiments of the present application involve the application of a large number of neural networks, in order to facilitate understanding, the relevant terms and related concepts such as neural networks involved in the embodiments of the present application are first introduced below.

[0166] (1) Neural Network

[0167] A neural network can be composed of neural units. A neural unit can refer to an operation unit that takes xs (i.e., input data) and intercept 1 as input. The output of the operation unit can be:

[0168] Where s = 1, 2, ... n, n is a natural number greater than 1, Ws is the weight of xs, and b is the bias of the neural unit. f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal of the neural unit into the output signal. The output signal of the activation function can be used as the input of the next convolutional layer, and the activation function can be a sigmoid function. A neural network is a network formed by connecting multiple single neural units mentioned above, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field. The local receptive field can be an area composed of several neural units.

[0169] (2) Deep Neural Networks

[0170] Deep Neural Network (DNN), also known as multi-layer neural network, can be understood as a neural network with many hidden layers. There is no special metric for "many" here. Based on the position of different layers in DNN, the neural network inside DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally speaking, the first layer is the input layer, the last layer is the output layer, and the layers in between are all hidden layers. The layers are fully connected, that is, any neuron in the i-th layer must be connected to any neuron in the i+1-th layer. Although DNN looks complicated, the work of each layer is actually not complicated. Simply put, it is the following linear relationship expression: in, is the input vector, is the output vector, is the offset vector, W is the weight matrix (also called coefficient), and α() is the activation function. Each layer is just an input vector After such a simple operation, the output vector Since there are many DNN layers, the coefficient W and the offset vector The definition of these parameters in DNN is as follows: Take the coefficient W as an example: Assume that in a three-layer DNN, the linear coefficient from the 4th neuron in the second layer to the 2nd neuron in the third layer is defined as The superscript 3 represents the layer number of the coefficient W, while the subscript corresponds to the output of the third layer index 2 and the input of the second layer index 4. In summary, the coefficient from the kth neuron in the L-1th layer to the jth neuron in the Lth layer is defined as It's important to note that the input layer has no W parameter. In deep neural networks, more hidden layers allow the network to better capture complex real-world situations. Theoretically, a model with more parameters has higher complexity and greater "capacity," meaning it can handle more complex learning tasks. Training a deep neural network is essentially the process of learning the weight matrix, with the ultimate goal of obtaining the weight matrices for all layers of a trained deep neural network (a weight matrix formed by the vectors W across many layers).

[0171] (3) Backpropagation algorithm

[0172] Convolutional neural networks can use the back propagation (BP) algorithm to correct the size of the parameters in the initial super-resolution model during training, reducing the reconstruction error loss of the super-resolution model. Specifically, the forward propagation of the input signal to the output generates an error loss. This error loss information is then backpropagated to update the parameters of the initial super-resolution model, thereby converging the error loss. The BP algorithm is a backward propagation movement dominated by the error loss, aiming to obtain the optimal super-resolution model parameters, such as the weight matrix.

[0173] (4) Loss function

[0174] During the training of a deep neural network, because we want the output of the deep neural network to be as close as possible to the desired predicted value, we can compare the current network's predicted value with the desired target value and then update the weight vector of each layer of the neural network based on the difference between the two. (Of course, there is usually an initialization process before the first update, which is to pre-configure the parameters for each layer in the deep neural network.) For example, if the network's predicted value is too high, the weight vector is adjusted to make it predict a lower value. This adjustment is continued until the deep neural network can predict the desired target value or a value very close to the desired target value. Therefore, it is necessary to predefine "how to compare the difference between the predicted value and the target value." This is the loss function (or objective function), which is an important equation used to measure the difference between the predicted value and the target value. For example, the loss function output value (loss) indicates a greater difference, so training a deep neural network becomes a process of minimizing this loss as much as possible.

[0175] Trademark recognition is widely used in e-commerce and machine vision, typically in copyright verification, brand recognition, product search and recommendation, and other applications. Trademark recognition is also widely used in numerous industrial vision scenarios, such as target customer identification, hazardous chemical logo recognition, and product inspection.

[0176] Existing trademark recognition algorithms based on object detection use an object extraction model to detect all possible image regions within an input image as candidate targets. An image classification network then classifies these candidate regions and outputs either a target trademark prediction or a prediction of no trademark. However, existing image classification networks only use image features for trademark recognition, resulting in poor accuracy.

[0177] In order to solve the above problems, the present invention provides a data processing method. The data processing method of the present invention is described in detail below with reference to the accompanying drawings.

[0178] First, the trademark recognition method in the embodiment of the present application is introduced from the perspective of model training, with reference to Figure 6, which is a flow chart of a data processing method provided in the embodiment of the present application. As shown in Figure 6, the data processing method provided in the embodiment of the present application may include steps 601 to 606, and these steps are described in detail below.

[0179] 601. Acquire a first image and a second image; the first image and the second image contain text.

[0180] The first image and the second image may be training samples for model training.

[0181] In one possible implementation, the model can be trained using contrastive learning. The first and second images can be positive samples, and during contrastive learning, the distance between the features of the positive samples needs to be shortened. The first and second images can also be negative samples, and during contrastive learning, the distance between the features of the negative samples needs to be shortened.

[0182] The first image and the second image may be trademarks or other images containing text.

[0183] Taking trademarks as an example, for example, when the first image and the second image are positive samples, the first image and the second image may include the same trademark or trademarks of similar styles.

[0184] For example, when the first image and the second image are negative samples, the first image and the second image may include different trademarks, or trademarks with greatly different styles.

[0185] It should be understood that the same trademark or trademarks of similar style here can be trademarks with the same text and similar styles such as font, color, shape, etc.

[0186] In one possible implementation, the first image or the second image may be an image corresponding to a trademark in a standard library. The trademarks in the standard library may be annotated trademarks, such as those shown in FIG10 . The standard target template library may include trademarks of multiple categories (e.g., Category 1, Category 2, etc., as shown in FIG10 ). Trademarks of the same category may also be divided into trademarks of different styles (e.g., Category 1, Category 2, etc., as shown in FIG10 ). Training samples determined from the standard library can be directly determined to be positive or negative samples based on their annotations.

[0187] In one possible implementation, for an unlabeled image, the detection model can be used to crop out the image region containing the trademark in the original image (e.g., the first image or the second image in the embodiment of the present application). The detection model can identify the image region and determine whether the trademark in the image region is a trademark with an identifiable category, without identifying the specific trademark category.

[0188] Among them, images of trademarks whose categories cannot be identified can be used as positive samples, and images of trademarks whose categories can be identified and images of trademarks whose categories cannot be identified can be used as negative samples.

[0189] Next, we introduce a training method for the detection model:

[0190] Optionally, labeled data can be used to train the trademark detection model. Optionally, in order to improve the detection accuracy of the detection model, the trademark detection model can also be trained based on both unlabeled data and labeled data.

[0191] Referring to FIG. 7 , steps S11 and S12 in FIG. 7 are schematic diagrams of a method for training a detection model:

[0192] Referring to Figures 7, 8 and 9, Figures 7, 8 and 9 are schematic diagrams of the training method of the detection model, wherein steps S11 and S12 in Figure 7 are the training process of the detection model, and Figure 8 is a schematic diagram of the pre-training stage. Specifically, the labeled data L can be used to train the trademark detection model M1 (step s11), and M1 is used as the initialization model. In Figure 9, the unlabeled data U and the labeled data L can be used to train the detection model M2 (step S12).

[0193] As shown in FIG8 , the pre-training phase algorithm may include a template-based positive sample data generation algorithm 310 and training a model M1 using labeled data.

[0194] As shown in Figure 9, the model M1 can be trained by the semi-supervised target detection algorithm S12. Specifically, M1 can be used as an initialization model, and a new detection model M2 can be trained using unlabeled data U and labeled data L. Optionally, strong data enhancement and weak data enhancement operations can be performed on the unlabeled data U respectively (the embodiment of the present application does not limit the method of data enhancement, and the degree of image enhancement by strong data enhancement is higher than that by weak data enhancement). The labeled data set L is subjected to perspective (or affine transformation) transformation data enhancement to allow the standard trademark graphic to adapt to the shooting angle of the background, and then the output of M1 is used as a pseudo-label to train the model M2. Among them, M2 can be used as a detection model to process the original image to obtain the first image and the second image.

[0195] The embodiment of the present application utilizes a semi-supervised trademark detection algorithm for unlabeled data. By performing data generation operations such as random mixing and random pasting of trademarks in a priori template library, the number of positive samples is increased. In addition, a perspective data enhancement scheme based on scene distribution is proposed. By introducing data enhancement based on perspective changes, the sample diversity can be increased and the robustness of the model can be improved.

[0196] In addition, the first image and the second image may also be images obtained after certain data enhancement processing.

[0197] In addition, the first image and the second image may also be randomly sampled from a standard library and images obtained through a detection model.

[0198] 602. Process the first image and the second image separately through a first neural network to obtain a first feature representation and a second feature representation; the first feature representation is an image feature of the first image, and the second feature representation is an image feature of the second image.

[0199] In one possible implementation, the first image and the second image can be processed by a first neural network to obtain an image feature representation (i.e., the first feature representation and the second feature representation in the embodiment of the present application). The first neural network can be the neural network to be trained in the embodiment of the present application. For example, referring to FIG10 , the retrieval feature vector extraction model in FIG10 can perform the above step 602. Specifically, referring to FIG11A , the image feature extraction network in FIG11A can be the first neural network in the embodiment of the present application.

[0200] 603. Process the first image and the second image separately using a second neural network to obtain a third feature representation and a fourth feature representation; the first feature representation is a text feature of the text contained in the first image, and the second feature representation is a text feature of the text contained in the second image;

[0201] In one possible implementation, the second neural network can extract text features (or character features) in the image. For example, the second neural network can be an optical character recognition (OCR) network (or part thereof, such as a feature extraction network of the OCR).

[0202] In a possible implementation, the first image and the second image may be processed separately by a second neural network to obtain a third feature representation and a fourth feature representation.

[0203] The second neural network may be a pre-trained model.

[0204] 604. Fuse the first feature representation and the third feature representation to obtain a first target feature representation.

[0205] 605. Fuse the second feature representation and the fourth feature representation to obtain a second target feature representation.

[0206] In one possible implementation, the first feature representation and the third feature representation can be dimensionally aligned (the sizes of the feature representations are adjusted to be consistent, for example, this can be achieved using a neural network (exemplarily, it can include linear operations and feedforward FC layers)), and the dimensionally aligned first feature representation and the third feature representation are fused to obtain a first target feature representation.

[0207] In one possible implementation, the second feature representation and the fourth feature representation can be dimensionally aligned (the sizes of the feature representations are adjusted to be consistent, for example, this can be achieved using a neural network (exemplarily, it can include linear operations and feedforward FC layers)), and the dimensionally aligned second feature representation and the fourth feature representation are fused to obtain a second target feature representation.

[0208] It should be understood that the alignment operation object of the dimension alignment can be one of the image or text branches. For example, the dimension of the third feature representation can be adjusted so that the dimension of the adjusted third feature representation is consistent with that of the first feature representation.

[0209] In a possible implementation, the first target feature representation and the second target feature representation may be features mapped into a hyperbolic metric space. The hyperbolic metric space may be adapted to a multi-level data structure.

[0210] In one implementation, the data in the hyperbolic space can be expressed based on a conformal model, which represents the mapping of the hyperbolic space to the Euclidean space via a conformal mapping. For example, the conformal model can be a Poincare model, a hyperboloid model, or a Klein model. The conformal model can be used to characterize the hyperbolic space, defining a series of vector algebraic transformations and geometric constraints for the hyperbolic gyro vector space.

[0211] 606. Determine a loss based on a relationship between the first target feature representation and the second target feature representation, and update the first neural network based on the loss.

[0212] In one possible implementation, the first image and the second image include different styles of the same trademark. The first image and the second image can serve as negative samples. Then, based on the relationship between the first target feature representation and the second target feature representation, a loss can be determined through contrastive learning. The loss is used to increase the first distance between the first target feature representation and the second target feature representation.

[0213] In one possible implementation, the first and second images include different trademarks. The first and second images can serve as negative samples. A loss can then be determined through contrastive learning based on the relationship between the first and second target feature representations. The loss is used to increase the second distance between the first and second target feature representations, with the increase in the second distance being greater than the increase in the first distance. Compared to when the first and second images include different versions of the same trademark, when the first and second images include different trademarks, the difference between the trademarks is greater, so a higher increase in the distance between the features is required during contrastive learning.

[0214] It should be understood that the first distance and the second distance here can be understood as different distance calculation results obtained by the same (or different) distance calculation methods.

[0215] In one possible implementation, the first image and the second image may include the same style of the same trademark. The first image and the second image may serve as negative samples. Then, based on the relationship between the first target feature representation and the second target feature representation, a loss may be determined through contrastive learning. The loss is used to narrow the distance between the first target feature representation and the second target feature representation.

[0216] In one possible implementation, the first image and the second image are obtained by cropping the original image after target detection is performed by a detection network (such as the model M2 introduced in the above embodiment), and the first image is an image in which the detection network can recognize the target, and the second image is an image in which the detection network cannot recognize the target. The first image and the second image can be used as negative samples, and then the loss can be determined through comparative learning based on the relationship between the first target feature representation and the second target feature representation. The loss is used to increase the distance between the first target feature representation and the second target feature representation.

[0217] In a possible implementation, the first image and the second image are obtained by cropping the original image after target detection is performed on the original image through a detection network, and the first image and the second image are images in which the detection network cannot recognize the target. The first image and the second image can be used as negative samples, and then the loss can be determined through comparative learning based on the relationship between the first target feature representation and the second target feature representation. The loss is used to narrow the distance between the first target feature representation and the second target feature representation.

[0218] Exemplarily, referring to Figure 10, the non-target samples obtained by inference using the model M2 can be used as negative samples N to constitute the first-level positive and negative samples; the various subclasses in the standard target template library T and other subclasses are used to constitute the second-level positive and negative samples, and the contrast loss function F is used to train the model (for example, the image feature extraction network shown in Figure 11A can be updated).

[0219] Next, we introduce a calculation diagram of the loss in contrastive learning:

[0220] Referring to FIG11B , FIG11B is a schematic diagram of a contrast loss calculation, wherein the left side of FIG11B shows the original data distribution, and the right side shows the new data distribution after being constrained by the contrast loss function. The calculation process is to calculate the distance between each sample and the negative samples at different levels (for example, as shown in FIG11C and the following formula):

[0221] Among them, λi represents the constant coefficient between each item, Ci represents the samples in the P1 category, Ci' represents other samples of the same type as Ci, Cj represents other subcategories of the same category P1, Ck, Cn represent samples in different categories P2, P3, among which sim can use different distance metrics.

[0222] As shown in Figure 11B, P1 can be a sample including the same trademark, C1, C2, and C3 can be samples including different styles of the same trademark, P2 can be a sample including the same trademark, C4, C5, and C6 can be different styles of the same trademark, and N can be a sample including trademark categories that the detection model cannot identify.

[0223] Alternatively, a distance metric in hyperbolic sine space can be used:

[0224] In the embodiment of the present application, by designing a multi-level contrast loss function, contrast learning loss functions are designed at different levels to enhance the discriminability between different levels; the noise (negative) samples and positive samples are contrasted and learned, which significantly improves the noise interference problem.

[0225] The embodiment of the present application provides a data processing method, comprising: obtaining a first image and a second image; the first image and the second image contain a trademark; processing the first image and the second image separately through a first neural network to obtain a first feature representation and a second feature representation; the first feature representation is an image feature of the first image, and the second feature representation is an image feature of the second image; processing the first image and the second image separately through a second neural network to obtain a third feature representation and a fourth feature representation; the first feature representation is a text feature of the text contained in the first image, and the second feature representation is a text feature of the text contained in the second image; fusing the first feature representation and the third feature representation to obtain a first target feature representation; fusing the second feature representation and the fourth feature representation to obtain a second target feature representation; determining a loss based on the relationship between the first target feature representation and the second target feature representation, and updating the first neural network based on the loss. By the above method, i.e., extracting the image features and text features of the trademark, fusing the image features and text features, and using the fused feature representation to update the model, the trademark recognition accuracy of the trained model can be improved.

[0226] Referring to FIG11D , FIG11D is a schematic diagram of an application process of an embodiment of the present application, which includes three sub-algorithms: (1) Semi-supervised trademark detection and trademark recognition algorithm 100 based on combined data enhancement. First, a teacher model is trained in a supervised manner using partially annotated data and a trademark template library. Then, a new student model is trained using unannotated data and a pre-trained teacher model in combination with a semi-supervised learning algorithm based on perspective transformation data enhancement. (2) Trademark recognition algorithm 200 based on image feature and character feature fusion, which uses a standard trademark template library and non-target samples inferred using the student model to form the first-level positive and negative samples, and the second-level positive and negative samples between the subclasses of the template library. After the same data enhancement algorithm, each sample is extracted by the image feature extractor and the character feature extractor respectively. After the feature vector dimension is aligned, it is sent to the feature fusion MLP; (3) Trademark recognition algorithm 300 based on multi-level representation metric: the output feature vector is mapped to the hyperbolic metric space via the exponential mapping algorithm. In the hyperbolic metric space, based on the multi-scale labels of the samples, a multi-level loss function is calculated. The calculation method can be referred to as follows:

[0227] Where D represents the distance measurement method, optionally, cosine distance can be used; l_i,j,n means that the i-th sample is on the nth level with the j-th sample.

[0228] Refer to Table 1, which shows a performance comparison of the method provided in the embodiment of the present application with the prior art on service data. Table 2 shows a performance comparison of the method provided in the embodiment of the present application with the prior art on service data. Table 3 shows the results of the ablation experiment.

[0229] Table 1

[0230] Table 2

[0231] As shown in Tables 1 and 2, the method provided in the embodiment of the present application improves the recall rate by 4% compared with the solution that only uses partially labeled data, and improves the recall by 2.6% compared with the industry's SOTA semi-supervised solution; the method provided in the embodiment of the present application improves the accuracy by 52% and the recall by 6% compared with the traditional CV operator, and improves the accuracy by 4% and the recall by 4% compared with the industry's SOTA metric learning algorithm.

[0232] Table 3 Logo matching ablation experiment

[0233] Among them, MLCL stands for Multi-Level Contrastive Learning and MMFF stands for Multi-Modality Feature Fusion.

[0234] Referring to FIG11E , FIG11E is a feature map comparison. The multi-level representation metric can cluster the subclass features and increase the distance between them and the noise samples.

[0235] Table 3 shows that multi-level metric learning plays a crucial role in improving performance. Compared with single-level metric learning, it improves precision by 1.5% and recall by 1%. As shown in Figure 11E, noisy data can easily be confused with positive samples, leading to misidentification. Multi-level metric learning treats noise as negative samples and compares them with all positive samples. As can be seen in the rightmost figure of Figure 11E, negative samples are well aggregated, the intra-class distance of positive samples is reduced, the inter-class distance is increased, and the discriminability is enhanced.

[0236] In addition, from the perspective of model reasoning, an embodiment of the present application also provides a data processing method, including: obtaining a first image, the first image containing text; processing the image through a first neural network (for example, the trained first neural network obtained through the embodiment corresponding to Figure 6) to obtain a first feature representation; the first feature representation is the image feature of the first image; processing the image through a second neural network (for example, the second neural network in the embodiment corresponding to Figure 6) to obtain a second feature representation; the second feature representation is the text feature of the text contained in the first image; fusing the first feature representation and the second feature representation to obtain a first target feature representation; determining the category of the first image according to the first target feature representation based on the similarity between the first target feature representation and multiple preset feature representations.

[0237] In one possible implementation, the first image is a trademark; for example, the category of the trademark can be determined based on the similarity between the first target feature representation and multiple preset feature representations; each preset feature representation is obtained by feature extraction of a category of trademarks.

[0238] This application does not limit the calculation method of the similarity here.

[0239] In a possible implementation, the second feature representation and the first feature representation may be dimensionally aligned; and the dimensionally aligned first feature representation and the second feature representation may be fused to obtain a first target feature representation.

[0240] In a possible implementation, the first target feature representation and each of the preset feature representations are features mapped into a hyperbolic space.

[0241] The method on the inference side is similar to that on the training side in the feature extraction part. Please refer to the introduction of the corresponding embodiment in Figure 6, and the similarities will not be repeated here.

[0242] Refer to Figure 11F, which is a schematic diagram of the framework of the reasoning side in the embodiment of the present application: wherein, the framework mainly includes three parts: 1) using the target detection network to detect candidate targets; 2) using the retrieval feature extraction module designed in the embodiment of the present application (mainly image feature and text feature extraction, fusion and spatial transformation) to extract features as retrieval feature vectors; 3) using this feature vector to search in the standard target feature vector library, calculate the similarity with the standard target vector in the library, if the maximum similarity is less than the threshold t, then output the unknown class, otherwise output the category corresponding to the maximum similarity.

[0243] 12 , which is a schematic diagram of the structure of a data processing device provided in an embodiment of the present application. As shown in FIG12 , a data processing device 1200 provided in an embodiment of the present application includes:

[0244] The processing module 1201 is configured to obtain a first image and a second image; the first image and the second image contain text;

[0245] Processing the first image and the second image separately through a first neural network to obtain a first feature representation and a second feature representation; the first feature representation is an image feature of the first image, and the second feature representation is an image feature of the second image;

[0246] processing the first image and the second image respectively through a second neural network to obtain a third feature representation and a fourth feature representation; the first feature representation is a text feature of the text contained in the first image, and the second feature representation is a text feature of the text contained in the second image;

[0247] Fusing the first feature representation and the third feature representation to obtain a first target feature representation;

[0248] Fusing the second feature representation and the fourth feature representation to obtain a second target feature representation;

[0249] A loss is determined based on a relationship between the first target feature representation and the second target feature representation, and the first neural network is updated based on the loss.

[0250] The specific description of the processing module 1201 can refer to the description of steps 601 to 606 in the above embodiment, which will not be repeated here.

[0251] In a possible implementation, the first image and the second image are trademarks.

[0252] In a possible implementation, the first image and the second image include different styles of the same trademark; and the processing module is specifically configured to:

[0253] According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through contrastive learning, where the loss is used to increase a first distance between the first target feature representation and the second target feature representation.

[0254] In a possible implementation, the first image and the second image include different trademarks; and the processing module is specifically configured to:

[0255] According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through comparative learning, and the loss is used to increase the second distance between the first target feature representation and the second target feature representation; and the increase in the second distance is greater than the increase in the first distance.

[0256] In a possible implementation, the first image and the second image include the same style of the same trademark, and the processing module is specifically configured to:

[0257] According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through contrastive learning, where the loss is used to narrow the distance between the first target feature representation and the second target feature representation.

[0258] In a possible implementation, the first image and the second image are obtained by cropping an original image after performing target detection on the original image through a detection network, and the first image is an image in which the detection network can recognize the target, and the second image is an image in which the detection network cannot recognize the target;

[0259] The processing module is specifically used to:

[0260] According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through contrastive learning, where the loss is used to increase the distance between the first target feature representation and the second target feature representation.

[0261] In a possible implementation, the first image and the second image are obtained by cropping an original image after performing target detection on the original image through a detection network, and the first image and the second image are images in which the detection network cannot recognize the target; the processing module is specifically configured to:

[0262] According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through contrastive learning, where the loss is used to narrow the distance between the first target feature representation and the second target feature representation.

[0263] In a possible implementation, the first target feature representation and the second target feature representation are features mapped into a hyperbolic space.

[0264] In addition, an embodiment of the present application further provides a data processing device, including:

[0265] A processing module, configured to acquire a first image, where the first image contains text;

[0266] Processing the first image through a first neural network to obtain a first feature representation, wherein the first feature representation is an image feature of the first image;

[0267] Processing the first image through a second neural network to obtain a second feature representation; the second feature representation is a text feature of text contained in the first image;

[0268] fusing the first feature representation and the second feature representation to obtain a first target feature representation;

[0269] Determine a category of the first image based on the first target feature representation.

[0270] In a possible implementation, the first image is a trademark, and determining the category of the first image according to the first target feature representation includes:

[0271] The category of the trademark is determined based on the similarity between the first target feature representation and multiple preset feature representations; each preset feature representation is obtained by extracting features from a category of trademarks.

[0272] In a possible implementation, the processing module is further configured to: dimensionally align the second feature representation and the first feature representation;

[0273] The processing module is specifically used to: fuse the first feature representation and the second feature representation after dimension alignment to obtain a first target feature representation.

[0274] In a possible implementation, the first target feature representation and each of the preset feature representations are features mapped into a hyperbolic space.

[0275] Next, an execution device provided in an embodiment of the present application is introduced. Please refer to Figure 13. Figure 13 is a structural diagram of an execution device provided in an embodiment of the present application. The execution device 1300 can be specifically manifested as a virtual reality VR device, a mobile phone, a tablet, a laptop computer, a smart wearable device, a monitoring data processing device or a server, etc., which is not limited here. Specifically, the execution device 1300 includes: a receiver 1301, a transmitter 1302, a processor 1303 and a memory 1304 (wherein the number of processors 1303 in the execution device 1300 can be one or more, and Figure 13 takes one processor as an example), wherein the processor 1303 may include an application processor 13031 and a communication processor 13032. In some embodiments of the present application, the receiver 1301, the transmitter 1302, the processor 1303 and the memory 1304 may be connected via a bus or other means.

[0276] Memory 1304 may include read-only memory and random access memory, and provides instructions and data to processor 1303. A portion of memory 1304 may also include non-volatile random access memory (NVRAM). Memory 1304 stores processor and operation instructions, executable modules, or data structures, or subsets or extended sets thereof. The operation instructions may include various operation instructions for implementing various operations.

[0277] Processor 1303 controls the operation of the execution device. In specific applications, the various components of the execution device are coupled together via a bus system. In addition to a data bus, the bus system may also include a power bus, a control bus, and a status signal bus. However, for clarity, all bus systems are referred to as a bus system in the figure.

[0278] The methods disclosed in the above embodiments of the present application can be applied to or implemented by processor 1303. Processor 1303 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in processor 1303. The above processor 1303 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor, or a microcontroller, and can further include an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The processor 1303 can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in conjunction with the embodiments of the present application can be directly implemented as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 1304. Processor 1303 reads information from memory 1304 and, in conjunction with its hardware, completes the steps involved in the model inference process in the above method.

[0279] Receiver 1301 can be used to receive input digital or character information and generate signal input related to executing device-related settings and function control. Transmitter 1302 can be used to output digital or character information through the first interface. Transmitter 1302 can also be used to send instructions to the disk pack through the first interface to modify data in the disk pack. Transmitter 1302 can also include a display device such as a display screen.

[0280] The present application also provides a training device. Please refer to FIG. 14 , which is a schematic diagram of a structure of a training device provided by an embodiment of the present application. Specifically, the training device 1400 is implemented by one or more servers. The training device 1400 may vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1414 (e.g., one or more processors), a memory 1432, and one or more storage media 1430 (e.g., one or more mass storage devices) storing application programs 1442 or data 1444. The memory 1432 and storage medium 1430 may be either ephemeral or persistent storage. The program stored in the storage medium 1430 may include one or more modules (not shown), each of which may include a series of instruction operations on the training device. Furthermore, the CPU 1414 may be configured to communicate with the storage medium 1430 to execute the series of instruction operations in the storage medium 1430 on the training device 1400.

[0281] The training device 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input and output interfaces 1458; or, one or more operating systems 1441, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0282] In the embodiment of the present application, the central processing unit 1414 is used to execute actions related to model training in the above embodiments.

[0283] An embodiment of the present application also provides a computer program product, which, when running on a computer, enables the computer to execute the steps executed by the aforementioned execution device, or enables the computer to execute the steps executed by the aforementioned training device.

[0284] A computer-readable storage medium is also provided in an embodiment of the present application, which stores a program for signal processing. When the computer-readable storage medium is run on a computer, it enables the computer to execute the steps executed by the aforementioned execution device, or enables the computer to execute the steps executed by the aforementioned training device.

[0285] The execution device, training device or terminal device provided in the embodiments of the present application can specifically be a chip, and the chip includes: a processing unit and a communication unit, the processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, a pin or a circuit, etc. The processing unit can execute the computer execution instructions stored in the storage unit, so that the chip in the execution device executes the data processing method described in the above embodiment, or so that the chip in the training device executes the data processing method described in the above embodiment. Optionally, the storage unit is a storage unit in the chip, such as a register, a cache, etc. The storage unit can also be a storage unit located outside the chip in the wireless access device, such as a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM), etc.

[0286] Specifically, see Figure 15 , which is a schematic diagram of the structure of a chip provided in an embodiment of the present application. The chip can be represented as a neural network processor NPU 1500. NPU 1500 is mounted on the host CPU (host CPU) as a coprocessor and is assigned tasks by the host CPU. The core of the NPU is arithmetic circuit 1503, which is controlled by controller 1504 to extract matrix data from memory and perform multiplication operations.

[0287] In some implementations, arithmetic circuit 1503 includes multiple processing units (PEs). In some implementations, arithmetic circuit 1503 is a two-dimensional systolic array. Arithmetic circuit 1503 can also be a one-dimensional systolic array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition. In some implementations, arithmetic circuit 1503 is a general-purpose matrix processor.

[0288] For example, assume there are input matrix A, weight matrix B, and output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from weight memory 1502 and caches it on each PE in the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from input memory 1501 and performs a matrix operation on matrix B. The partial or final matrix result is stored in accumulator 1508.

[0289] Unified memory 1506 is used to store input and output data. Weight data is directly transferred to weight memory 1502 through the Direct Memory Access Controller (DMAC) 1505. Input data is also transferred to unified memory 1506 through the DMAC.

[0290] BIU stands for Bus Interface Unit 1510 , which is used for interaction between the AXI bus, DMAC, and instruction fetch buffer (IFB) 1509 .

[0291] The bus interface unit 1510 (BIU) is used for the instruction fetch memory 1509 to obtain instructions from the external memory, and is also used for the storage unit access controller 1505 to obtain the original data of the input matrix A or the weight matrix B from the external memory.

[0292] DMAC is mainly used to transfer input data in the external memory DDR to the unified memory 1506 or transfer weight data to the weight memory 1502 or transfer input data to the input memory 1501.

[0293] The vector calculation unit 1507 includes multiple operation processing units. When necessary, it further processes the output of the operation circuit 1503, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc. It is mainly used for non-convolutional / fully connected layer network calculations in neural networks, such as batch normalization, pixel-level summation, and upsampling of feature planes.

[0294] In some implementations, the vector calculation unit 1507 can store the processed output vector in the unified memory 1506. For example, the vector calculation unit 1507 can apply a linear function or a nonlinear function to the output of the operation circuit 1503, such as linear interpolation of the feature plane extracted by the convolution layer, or accumulate a vector of values ​​to generate an activation value. In some implementations, the vector calculation unit 1507 generates a normalized value, a pixel-level summed value, or both. In some implementations, the processed output vector can be used as an activation input to the operation circuit 1503, for example, for use in subsequent layers in a neural network.

[0295] An instruction fetch buffer 1509 connected to the controller 1504 is used to store instructions used by the controller 1504;

[0296] Unified memory 1506, input memory 1501, weight memory 1502, and instruction fetch memory 1509 are all on-chip memories. External memories are private to the NPU hardware architecture.

[0297] The processor mentioned in any of the above places can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits for controlling the execution of the above program.

[0298] It should also be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided in this application, the connection relationship between the modules indicates that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines.

[0299] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course can also be implemented by special hardware including application-specific integrated circuits, special CPUs, special memories, special components, etc. In general, all functions performed by computer programs can be easily implemented with corresponding hardware, and the specific hardware structures used to implement the same function can also be diverse, such as analog circuits, digital circuits or special circuits, etc. However, for the present application, software program implementation is a better implementation method in most cases. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer's floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., and includes a number of instructions to enable a computer device (which can be a personal computer, training equipment, or network equipment, etc.) to execute the methods described in each embodiment of the present application.

[0300] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0301] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, a computer, a training device or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website, a computer, a training device or a data center. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

Claims

1. A data processing method, characterized in that: The method comprises: Acquire a first image, wherein the first image contains text; Processing the first image through a first neural network to obtain a first feature representation; the first feature representation is an image feature of the first image; Processing the first image by a second neural network to obtain a second feature representation; the second feature representation is a text feature of the text contained in the first image; Fusing the first feature representation and the second feature representation to obtain a first target feature representation; The category of the first image is determined according to the first target feature representation.

2. The method according to claim 1, characterized in that The first image is a trademark, and determining the category of the first image according to the first target feature representation includes: The category of the trademark is determined based on the similarity between the first target feature representation and multiple preset feature representations; each preset feature representation is obtained by extracting features from a category of trademarks.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: Dimensionally aligning the second feature representation and the first feature representation; The fusing the first feature representation and the second feature representation to obtain a first target feature representation includes: The first feature representation and the second feature representation after dimension alignment are fused to obtain a first target feature representation.

4. The method according to any one of claims 1 to 3, characterized in that: The first target feature representation and each of the preset feature representations are features mapped into a hyperbolic space.

5. A data processing method, characterized in that: The method comprises: Acquire a first image and a second image; the first image and the second image contain text; Processing the first image and the second image respectively through a first neural network to obtain a first feature representation and a second feature representation; the first feature representation is an image feature of the first image, and the second feature representation is an image feature of the second image; Processing the first image and the second image respectively through a second neural network to obtain a third feature representation and a fourth feature representation; the first feature representation is a text feature of the text contained in the first image, and the second feature representation is a text feature of the text contained in the second image; Fusing the first feature representation and the third feature representation to obtain a first target feature representation; Fusing the second feature representation and the fourth feature representation to obtain a second target feature representation; A loss is determined based on a relationship between the first target feature representation and the second target feature representation, and the first neural network is updated based on the loss.

6. The method according to claim 5, characterized in that The first image and the second image contain a trademark.

7. The method according to claim 5 or 6, characterized in that: The first image and the second image include different styles of the same trademark; and determining the loss according to the relationship between the first target feature representation and the second target feature representation includes: According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through contrastive learning, where the loss is used to increase a first distance between the first target feature representation and the second target feature representation.

8. The method according to claim 5 or 6, characterized in that: The first image and the second image include different trademarks; and determining the loss according to the relationship between the first target feature representation and the second target feature representation includes: According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through contrastive learning, and the loss is used to increase the second distance between the first target feature representation and the second target feature representation; and the increase in the second distance is greater than the increase in the first distance.

9. The method according to claim 5 or 6, characterized in that: The first image and the second image include the same style of the same trademark, and determining the loss according to the relationship between the first target feature representation and the second target feature representation includes: According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through contrastive learning, and the loss is used to shorten the distance between the first target feature representation and the second target feature representation.

10. The method according to any one of claims 5 to 9, characterized in that: The first image and the second image are obtained by cropping the original image after performing target detection on the original image through the detection network, and the first image is an image in which the detection network can recognize the target, and the second image is an image in which the detection network cannot recognize the target; The determining the loss according to the relationship between the first target feature representation and the second target feature representation includes: According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through contrastive learning, where the loss is used to increase the distance between the first target feature representation and the second target feature representation.

11. The method according to any one of claims 5 to 10, characterized in that: The first image and the second image are obtained by cropping an original image after performing target detection on the original image through a detection network, and the first image and the second image are images in which the detection network cannot recognize the target; The determining the loss according to the relationship between the first target feature representation and the second target feature representation includes: According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through contrastive learning, and the loss is used to shorten the distance between the first target feature representation and the second target feature representation.

12. The method according to any one of claims 5 to 11, characterized in that: The first target feature representation and the second target feature representation are features mapped into a hyperbolic space.

13. A data processing device, characterized in that: include: A processing module, configured to obtain a first image, wherein the first image contains text; Processing the first image through a first neural network to obtain a first feature representation; the first feature representation is an image feature of the first image; Processing the first image by a second neural network to obtain a second feature representation; the second feature representation is a text feature of the text contained in the first image; Fusing the first feature representation and the second feature representation to obtain a first target feature representation; The category of the first image is determined according to the first target feature representation.

14. The device according to claim 13, characterized in that The first image is a trademark, and determining the category of the first image according to the first target feature representation includes: The category of the trademark is determined based on the similarity between the first target feature representation and multiple preset feature representations; each preset feature representation is obtained by extracting features from a category of trademarks.

15. The device according to claim 13 or 14, characterized in that The processing module is further used to: dimensionally align the second feature representation and the first feature representation; The processing module is specifically used to: fuse the first feature representation and the second feature representation after dimension alignment to obtain a first target feature representation.

16. A data processing device, characterized in that: include: A processing module, configured to acquire a first image and a second image; the first image and the second image contain text; Processing the first image and the second image respectively through a first neural network to obtain a first feature representation and a second feature representation; the first feature representation is an image feature of the first image, and the second feature representation is an image feature of the second image; Processing the first image and the second image respectively through a second neural network to obtain a third feature representation and a fourth feature representation; the first feature representation is a text feature of the text contained in the first image, and the second feature representation is a text feature of the text contained in the second image; Fusing the first feature representation and the third feature representation to obtain a first target feature representation; Fusing the second feature representation and the fourth feature representation to obtain a second target feature representation; A loss is determined based on a relationship between the first target feature representation and the second target feature representation, and the first neural network is updated based on the loss.

17. The device according to claim 16, characterized in that The first image and the second image include different styles of the same trademark; the processing module is specifically used to: According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through contrastive learning, where the loss is used to increase a first distance between the first target feature representation and the second target feature representation.

18. The device according to claim 16, characterized in that The first image and the second image include different trademarks; and the processing module is specifically configured to: According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through contrastive learning, and the loss is used to increase the second distance between the first target feature representation and the second target feature representation; and the increase in the second distance is greater than the increase in the first distance.

19. The device according to claim 16, characterized in that The first image and the second image include the same style of the same trademark, and the processing module is specifically used to: According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through contrastive learning, and the loss is used to shorten the distance between the first target feature representation and the second target feature representation.

20. The device according to any one of claims 16 to 19, characterized in that The first image and the second image are obtained by cropping the original image after performing target detection on the original image through the detection network, and the first image is an image in which the detection network can recognize the target, and the second image is an image in which the detection network cannot recognize the target; The processing module is specifically used for: According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through contrastive learning, where the loss is used to increase the distance between the first target feature representation and the second target feature representation.

21. The device according to any one of claims 16 to 20, characterized in that The first image and the second image are obtained by cropping the original image after performing target detection on the original image through the detection network, and the first image and the second image are images in which the detection network cannot recognize the target; the processing module is specifically used to: According to the relationship between the first target feature representation and the second target feature representation, a loss is determined through contrastive learning, and the loss is used to shorten the distance between the first target feature representation and the second target feature representation.

22. The device according to any one of claims 16 to 21, characterized in that The first target feature representation and the second target feature representation are features mapped into a hyperbolic space.

23. A computer storage medium, characterized in that The computer storage medium stores one or more instructions which, when executed by one or more computers, cause the one or more computers to perform the operations of the method of any one of claims 1 to 12.

24. A computer program product, characterized in that The method comprises computer-readable instructions, and when the computer-readable instructions are executed on a computer device, the computer device is caused to execute the method according to any one of claims 1 to 12.

25. A system comprising at least one processor and at least one memory; the processor and the memory are connected via a communication bus and communicate with each other; The at least one memory is used to store code; The at least one processor is configured to execute the code to perform the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Data processing method and device

    CN116883715A

  • Document image classification method and device

    CN110298338A

  • Image category identification method and device

    CN110705460A

  • Commodity infringement detection method and device, equipment, medium and product

    CN115620019A

  • Method of searching trademarks and apparatus for searching trademarks

    KR102234385B1