Training method of autoregressive generative model, image processing method and electronic device

By using a discriminative image segmenter to extract image features and convert them into discrete features, and train an autoregressive generation model, the problem of low performance of commonly used segmenters in image generation tasks is solved, and the generation and understanding capabilities of the model are improved.

CN118097323BActive Publication Date: 2024-10-18ALIBABA DAMO (HANGZHOU) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410487300.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-22
Publication Date
2024-10-18
Estimated Expiration
2044-04-22

AI Technical Summary

Technical Problem

Commonly used word segmenters cannot effectively handle image generation tasks, resulting in low performance of autoregressive generation models and inconsistent training methods for large models, resulting in a lack of effective solutions.

Method used

A discriminative image segmenter is used to extract features from the image and convert them into discrete features, which are used to train the autoregressive generation model, filter out the visual underlying redundant information, and focus on modeling the semantic information of the image.

Benefits of technology

The performance of the autoregressive generation model is improved, allowing it to more efficiently generate and understand the content of the image, and solves the problem of low performance caused by word segmenter processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118097323B_ABST
    Figure CN118097323B_ABST
Patent Text Reader

Abstract

This application discloses a training method for an autoregressive generative model, an image processing method, and an electronic device, relating to large model technology and the field of image processing. The training method includes: acquiring a first image; extracting features from the first image using a discriminative image segmenter to obtain image features of the first image, wherein the image features are used to represent the semantic information of the first image; comparing the image features of the first image with the vector features of multiple discrete vectors to determine the discrete features of the first image, wherein different discrete vectors correspond to different discrete features; and training the autoregressive generative model using the discrete features of the first image. This application solves the technical problem that using commonly used segmenters to process the input data of the autoregressive generative model leads to low performance of the autoregressive generative model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to large model technology and image processing fields, and specifically, to a training method for an autoregressive generation model, an image processing method, and an electronic device. Background Art

[0002] The autoregressive generative model relies on the tokenizer to preprocess the input data. A good tokenizer can help the model converge quickly and improve generalization ability. Therefore, the tokenizer plays a vital role in the autoregressive generative model.

[0003] However, the word segmenters commonly used in actual application scenarios cannot handle image generation tasks, and are not consistent with the autoregressive training method of large models, which limits the performance of the autoregressive generation model.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide a training method, an image processing method and an electronic device for an autoregressive generative model, so as to at least solve the technical problem that the input data of the autoregressive generative model is processed using a commonly used word segmenter, resulting in low performance of the autoregressive generative model.

[0006] According to one aspect of an embodiment of the present application, a training method for an autoregressive generative model is provided, including: acquiring a first image; performing feature extraction on the first image using a discriminative image segmentor to obtain image features of the first image, wherein the image features are used to characterize semantic information of the first image; comparing the image features of the first image with vector features of multiple discrete vectors to determine discrete features of the first image, wherein different discrete vectors correspond to different discrete features; and training the autoregressive generative model using the discrete features of the first image.

[0007] According to another aspect of an embodiment of the present application, an image processing method is also provided, including: obtaining an image to be processed; using a discriminative image segmentor to perform feature extraction on the image to be processed to obtain image features of the image to be processed, wherein the image features are used to characterize the semantic information of the image to be processed; comparing the image features of the image to be processed with vector features of multiple discrete vectors to determine the discrete features of the image to be processed, wherein different discrete vectors correspond to different discrete features; using a trained autoregressive generative model to process the discrete features of the image to be processed to obtain a processing result of the image to be processed, wherein the trained autoregressive generative model is a model trained using the above method.

[0008] According to another aspect of an embodiment of the present application, an image processing method is also provided, including: upon receiving an image generation instruction, constructing a preset indicator based on the image generation instruction; inputting the preset indicator into a trained autoregressive generation model, and obtaining a generated image output by the trained autoregressive generation model, wherein the trained autoregressive generation model is a model trained using the above method.

[0009] According to another aspect of an embodiment of the present application, a training method for an autoregressive generative model is also provided, including: in response to an input instruction acting on an operation interface, displaying a first image on the operation interface; in response to a training instruction acting on the operation interface, displaying a training result of the autoregressive generative model on the operation interface, wherein the training result is a result of training the autoregressive generative model using discrete features of the first image, the discrete features of the first image are features obtained by comparing the image features of the first image with vector features of multiple discrete vectors, different discrete vectors correspond to different discrete features, and the image features of the first image are features obtained by extracting features of the first image using a discriminative image segmentor.

[0010] According to another aspect of an embodiment of the present application, a training method for an autoregressive generative model is also provided, including: obtaining a first image by calling a first interface, wherein the first interface includes a first parameter, and the parameter value of the first parameter includes the first image; performing feature extraction on the first image using a discriminative image segmentor to obtain image features of the first image, wherein the image features are used to characterize the semantic information of the first image; comparing the image features of the first image with vector features of multiple discrete vectors to determine the discrete features of the first image, wherein different discrete vectors correspond to different discrete features; training the autoregressive generative model using the discrete features of the first image to obtain the training results of the autoregressive generative model; outputting the training results of the autoregressive generative model by calling a second interface, wherein the second interface includes a second parameter, and the parameter value of the second parameter includes the training results of the autoregressive generative model.

[0011] According to another aspect of an embodiment of the present application, a training device for an autoregressive generative model is also provided, including: an acquisition module for acquiring a first image; an extraction module for performing feature extraction on the first image using a discriminative image segmentor to obtain image features of the first image, wherein the image features are used to characterize semantic information of the first image; a determination module for comparing the image features of the first image with vector features of multiple discrete vectors to determine the discrete features of the first image, wherein different discrete vectors correspond to different discrete features; and a training module for training the autoregressive generative model using the discrete features of the first image.

[0012] According to another aspect of an embodiment of the present application, an image processing device is also provided, including: an acquisition module, used to acquire an image to be processed; an extraction module, used to use a discriminative image segmentor to perform feature extraction on the image to be processed, and obtain image features of the image to be processed, wherein the image features are used to characterize the semantic information of the image to be processed; a determination module, used to compare the image features of the image to be processed with vector features of multiple discrete vectors, and determine the discrete features of the image to be processed, wherein different discrete vectors correspond to different discrete features; a processing module, used to use a trained autoregressive generation model to process the discrete features of the image to be processed, and obtain a processing result of the image to be processed, wherein the trained autoregressive generation model is a model trained using the above-mentioned method.

[0013] According to another aspect of an embodiment of the present application, an image processing device is also provided, including: a construction module, which is used to construct a preset indicator based on the image generation instruction when an image generation instruction is received; a generation module, which is used to input the preset indicator into a trained autoregressive generation model and obtain a generated image output by the trained autoregressive generation model, wherein the trained autoregressive generation model is a model trained using the above-mentioned method.

[0014] According to another aspect of an embodiment of the present application, a training device for an autoregressive generative model is also provided, including: a first display module, used to respond to an input instruction acting on an operation interface, and display a first image on the operation interface; a second display module, used to respond to a processing instruction acting on the operation interface, and display a training result of the autoregressive generative model on the operation interface, wherein the training result is a result of training the autoregressive generative model using discrete features of the first image, the discrete features of the first image are features obtained by comparing the image features of the first image with vector features of multiple discrete vectors, different discrete vectors correspond to different discrete features, and the image features of the first image are features obtained by extracting features of the first image using a discriminative image segmentor.

[0015] According to another aspect of an embodiment of the present application, a training device for an autoregressive generation model is also provided, including: a first calling module, used to obtain a first image by calling a first interface, wherein the first interface includes a first parameter, and the parameter value of the first parameter includes the first image; an extraction module, used to perform feature extraction on the first image using a discriminative image segmentor to obtain image features of the first image, wherein the image features are used to characterize the semantic information of the first image; a determination module, used to compare the image features of the first image with vector features of multiple discrete vectors to determine the discrete features of the first image, wherein different discrete vectors correspond to different discrete features; a training module, used to train the autoregressive generation model using the discrete features of the first image to obtain the training results of the autoregressive generation model; a second calling module, used to output the training results of the autoregressive generation model by calling a second interface, wherein the second interface includes a second parameter, and the parameter value of the second parameter includes the training results of the autoregressive generation model.

[0016] According to another aspect of the embodiments of the present application, an electronic device is further provided, including: a memory storing an executable program; and a processor for running the program, wherein the method of each embodiment of the present application is executed when the program is running.

[0017] According to another aspect of an embodiment of the present application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in each embodiment of the present application.

[0018] According to another aspect of the embodiments of the present application, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present application is implemented.

[0019] According to another aspect of an embodiment of the present application, a computer program product is also provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present application is implemented.

[0020] According to another aspect of the embodiments of the present application, a computer program is also provided, and when the computer program is executed by a processor, the methods in the various embodiments of the present application are implemented.

[0021] In an embodiment of the present application, a first image is acquired, a discriminative image segmentor is used to extract features of the first image, image features of the first image are obtained, the image features of the first image are compared with vector features of multiple discrete vectors, the discrete features of the first image are determined, and the discrete features of the first image are used to train the autoregressive generative model, so as to achieve the purpose of training the autoregressive generative model. It is easy to notice that the discriminative image segmentor can be used to extract the image features of the first image, and the image features can be converted into discrete features to reduce the data dimension to be processed. Since the discrete features filter out the visual underlying redundant information of the first image and only retain the semantic information, when the autoregressive generative model is trained using the discrete features of the first image, the autoregressive generative model can focus on the semantic information of the modeled image without considering the underlying visual texture features, so that the autoregressive generative model can generate and understand the content to be expressed by the image more efficiently, and the technical effect of improving the performance of the autoregressive generative model is achieved, thereby solving the technical problem that the input data of the autoregressive generative model is processed by a commonly used segmenter, resulting in low performance of the autoregressive generative model.

[0022] It is easy to notice that the above general description and the following detailed description are only for the purpose of exemplifying and explaining the present application, and do not constitute a limitation of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0024] Figure 1 It is a schematic diagram of an application scenario of a training method for an autoregressive generation model according to an embodiment of the present application;

[0025] Figure 2 is a flowchart of a training method for an autoregressive generative model according to Example 1 of the present application;

[0026] Figure 3 is a schematic diagram of an optional training method for an autoregressive generation model according to an embodiment of the present application;

[0027] Figure 4 is a flowchart of an image processing method according to Embodiment 2 of the present application;

[0028] Figure 5 is a flowchart of an image processing method according to Embodiment 3 of the present application;

[0029] Figure 6 is a flowchart of a training method for an autoregressive generation model according to Example 4 of the present application;

[0030] Figure 7 is a flow chart of a training method for an autoregressive generation model according to Example 5 of the present application;

[0031] Figure 8 is a schematic diagram of a training device for an autoregressive generation model according to Example 6 of the present application;

[0032] Fig. 9 is a schematic diagram of an image processing device according to Embodiment 7 of the present application;

[0033] Fig.10 is a schematic diagram of an image processing device according to Embodiment 8 of the present application;

[0034] Fig.11 is a schematic diagram of a training device for an autoregressive generation model according to Example 9 of the present application;

[0035] Fig.12 is a schematic diagram of a training device for an autoregressive generation model according to Example 10 of the present application;

[0036] Fig.13 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.

[0038] It should be noted that 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 sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0039] The technical solution provided in this application is mainly implemented using large-scale model technology. The large model here refers to a deep learning model with large-scale model parameters, which can usually contain hundreds of millions, tens of billions, hundreds of billions, trillions or even more than 10 trillion model parameters. The large model can also be called a foundation model / foundation model. The large model is pre-trained with large-scale unlabeled corpus to produce a pre-trained model with more than 100 million parameters. This model can adapt to a wide range of downstream tasks, and the model has good generalization ability, such as large-scale language model (LLM), multi-modal pre-training model, etc.

[0040] It should be noted that when the large model is actually applied, the pre-trained model can be fine-tuned through a small number of samples so that the large model can be applied to different tasks. For example, the large model can be widely used in natural language processing (NLP), computer vision, speech processing and other fields, and can be specifically applied to computer vision tasks such as visual question answering (VQA), image caption (IC), image generation, etc. It can also be widely used in natural language processing tasks such as text-based sentiment classification, text summary generation, and machine translation. Therefore, the main application scenarios of the large model include but are not limited to digital assistants, intelligent robots, search, online education, office software, e-commerce, intelligent design, etc. In the embodiment of the present application, data processing through an autoregressive generative model in the image understanding and image generation scenarios is used as an example for explanation.

[0041] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:

[0042] Tokenizer: A word segmenter used to convert computer data into discrete representations.

[0043] Discriminative Tokenizer: Discriminative tokenizer, suitable for image data.

[0044] Discriminative Image Segmenter: A vision model trained via contrastive learning without manual image annotation.

[0045] DINO: It is a deep learning model for self-supervised visual learning. The core idea is to learn a set of transferable visual feature representations by contrastive learning on large-scale unlabeled datasets. DINO can be understood as an abbreviation consisting of the two words Distillation and NO labels, which not only expresses the characteristics of DINO's self-distillation method, but also highlights that it is a model based on unsupervised learning.

[0046] Autoregressive generative model: It is a generative model based on time series data and relies on serial dependency in the data, that is, the value of a time point in the sequence can be predicted by its previous values.

[0047] K-Means: An unsupervised clustering machine learning algorithm.

[0048] A-iGPT: A pre-trained model for image generation based on discriminative tokenizer.

[0049] Misaligned prediction: An important concept in the field of machine learning is the model's ability to predict data that is inconsistent with the distribution of training data. Example 1

[0050] According to an embodiment of the present application, a training method for an autoregressive generative model is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0051] Considering that the model parameters of the autoregressive generation model are huge and the computing resources of the mobile terminal are limited, the training method of the autoregressive generation model provided in the embodiment of the present application can be applied to Figure 1 The application scenarios shown are not limited to these. Figure 1 In the application scenario shown, the autoregressive generation model is deployed in the server 10, and the server 10 can be connected to one or more client devices 20 through a local area network connection, a wide area network connection, an Internet connection, or other types of data networks. The client device 20 here may include but is not limited to: a smart phone, a tablet computer, a laptop computer, a PDA, a personal computer, a smart home device, a vehicle-mounted device, etc. The client device 20 can interact with the user through a graphical user interface to implement the call of the autoregressive generation model, thereby implementing the method provided in the embodiment of the present application.

[0052] In an embodiment of the present application, a system composed of a client device and a server can perform the following steps: the client device obtains a first image input by a user through a graphical user interface and sends it to a server; the server extracts features of the first image using a discriminative image segmentor to obtain image features of the first image, compares the image features of the first image with vector features of multiple discrete vectors, determines the discrete features of the first image, and trains an autoregressive generative model using the discrete features of the first image. It should be noted that, if the operating resources of the client device can meet the deployment and operating conditions of a large model, the embodiment of the present application can be performed in the client device.

[0053] Under the above operating environment, this application provides Figure 2 The training method of the autoregressive generative model shown. Figure 2 Flowchart of the training method of the autoregressive generation model according to Example 1 of the present application. Figure 2 As shown, the method may include the following steps:

[0054] Step S202, acquiring a first image.

[0055] The above-mentioned first image can be an image provided by the user for training the autoregressive generative model. In order to achieve the purpose of model training, the user often needs to provide multiple images. In an embodiment of the present application, an example is given in which the user provides multiple images and the first image is any one of the multiple images provided by the user.

[0056] In an optional embodiment, the user can select multiple images that are desired to be used to train the autoregressive generative model from a local database through a graphical user interface provided by a client device, and upload them to a server, and the server processes each image according to the scheme provided in the embodiment of the present application. In another optional embodiment, the user can download multiple images that are desired to be used to train the autoregressive generative model from the Internet through a graphical user interface provided by a client device, and upload them to a server, and the server processes each image according to the scheme provided in the embodiment of the present application.

[0057] Step S204: extract features from the first image using a discriminative image segmentor to obtain image features of the first image, wherein the image features are used to represent semantic information of the first image.

[0058] The above-mentioned discriminative image segmenter can be a pre-trained discriminative self-supervised visual model, which is used as an image segmenter in the embodiment of the present application. In order to realize the self-supervised training of the model, the discriminative image segmenter can be divided into the following types: contrastive learning, triple loss, center loss, self-supervised clustering, self-supervised regression, self-supervised target detection and self-supervised image segmentation. In the embodiment of the present application, DINO can be selected as the image segmenter to extract features from the first image, but it is not limited to this. Users can also choose other models as needed.

[0059] It should be noted that in order to ensure the universal performance of the constructed discriminative image segmentor on a variety of images, some images can be selected from a category-rich image benchmark dataset as training data to train the discriminative image segmentor.

[0060] In an optional embodiment, the first image can be input into a trained discriminative image segmentor for feature extraction, and high-dimensional abstract features of the first image are extracted as image features of the first image. Compared with an image segmentor that focuses on encoding underlying visual information, the image feature can filter out the underlying visual redundant information of the image and retain only semantic information.

[0061] Optionally, in the process of feature extraction using a discriminative image segmentor, the input image can be segmented in the form of patches, divided into non-overlapping image blocks, and then input into a trained discriminative image segmentor for feature extraction to obtain a representation sequence of the same length as the patch sequence.

[0062] Step S206: Compare the image features of the first image with the vector features of the plurality of discrete vectors to determine the discrete features of the first image, wherein different discrete vectors correspond to different discrete features.

[0063] The above-mentioned multiple discrete vectors can be pre-constructed vectors, each of which has a unique discrete serial number and vector representation, wherein the discrete serial number can be used as a discrete feature corresponding to the discrete vector. Optionally, multiple discrete vectors can be generated by clustering algorithms, vector quantization, deep learning models, etc. In the embodiment of the present application, the clustering method is used as an example to illustrate the generation process of multiple discrete vectors. In the embodiment of the present application, multiple discrete vectors can be generated synchronously through a clustering algorithm during the training of the discriminative image segmentor, or after the training of the discriminative image segmentor is completed, the discriminative image segmentor can be used to process large-scale images separately, and multiple discrete vectors can be generated through a clustering algorithm. It should be noted that in order to reduce the processing complexity of multiple discrete vectors, in the embodiment of the present application, the method of synchronously generating multiple discrete vectors during the training of the discriminative image segmentor is used as an example for explanation.

[0064] In an optional embodiment, during the training of the discriminative image segmentor, after obtaining a representation sequence of the same length as the image patch sequence, the patch representations of multiple images can be merged into a large feature matrix, and then a clustering algorithm is used to train on the feature matrix to obtain multiple cluster centers. Therefore, the multiple cluster centers can be used as multiple discrete vectors. At this time, the image features of the cluster centers are the vector features of the discrete vectors, and a unique discrete serial number is generated for each cluster center as the discrete feature corresponding to the cluster center.

[0065] After the multiple discrete vectors are constructed, the discrete features of the first image can be obtained by comparing the image features of the first image with the multiple discrete vectors to determine the discrete vector with the highest similarity to the image features of the first image.

[0066] Step S208: training the autoregressive generation model using the discrete features of the first image.

[0067] The above-mentioned autoregressive generative model can be a visual generative model using an autoregressive training method, such as a multimodal large model, an autoregressive Transformer Decoder-only architecture model, PixelRNN (Pixel Recurrent Neural Network), VAR (Visual Autoregressive Modeling), etc., but not limited to this. In the embodiment of the present application, the autoregressive Transformer Decoder-only architecture model is taken as an example for detailed description, and the model is named A-iGPT.

[0068] In an optional embodiment, the autoregressive generative model can be trained using the discrete features of the first image, the discrete features of the first image are used as the input sequence of the autoregressive generative model, and the gradient is updated by calculating the cross entropy loss between the input sequence and the output sequence of the autoregressive generative model.

[0069] Through the steps provided in the above embodiment of the present application, a first image is acquired, a discriminative image word segmenter is used to extract features of the first image, image features of the first image are obtained, the image features of the first image are compared with the vector features of multiple discrete vectors, the discrete features of the first image are determined, and the discrete features of the first image are used to train the autoregressive generative model, so as to achieve the purpose of training the autoregressive generative model. It is easy to notice that the discriminative image word segmenter can be used to extract the image features of the first image, and the image features represent the high-dimensional semantic information of the first image, and the visual underlying redundant information of the first image is filtered out. Then, when the autoregressive generative model is trained using the discrete features of the first image constructed based on the image features of the first image, the autoregressive generative model can focus on the semantic information of the modeled image without considering the underlying visual texture features, so that the autoregressive generative model can generate and understand the content to be expressed by the image more efficiently, and the technical effect of improving the performance of the autoregressive generative model is achieved, thereby solving the technical problem that the input data of the autoregressive generative model is processed by a commonly used word segmenter, resulting in low performance of the autoregressive generative model.

[0070] In the above embodiment of the present application, a discriminative image segmentor is used to extract features of a first image to obtain image features of the first image, including: segmenting the first image to obtain multiple image blocks; extracting features of the multiple image blocks using a discriminative image segmentor to obtain image block features of the multiple image blocks; and merging the image block features of the multiple image blocks to obtain image features of the first image.

[0071] In an optional embodiment, the processing process of the word segmenter is usually to divide the preprocessed text into smaller units for feature extraction. Therefore, the discriminative image word segmenter can adopt a similar processing method. First, the first image is divided into patches to obtain multiple small image blocks. Then, the discriminative image word segmenter is used to extract features from each image block to obtain image block features of each image block. Finally, the image features of multiple image blocks are merged in a sequence to obtain image features of the first image, that is, a representation sequence with the same length as the patch sequence is obtained.

[0072] In the above embodiment of the present application, a discriminative image segmentor is used to perform feature extraction on multiple image blocks to obtain image block features of the multiple image blocks, including: obtaining position codes of the multiple image blocks, wherein the position codes are used to characterize the positions of the multiple image blocks in the first image; and inputting the multiple image blocks and the position codes of the multiple image blocks into the discriminative image segmentor to obtain image block features of the multiple image blocks output by the discriminative image segmentor.

[0073] In an optional embodiment, in order to accurately determine the positions of different image blocks in the first image and ensure that the image block features can accurately reflect the positional relationship between different image blocks, the positions of the image blocks in the first image can be used to generate two-dimensional position codes of the image blocks. The specific generation process can refer to the current position code generation method, which is not described in detail here. After obtaining the position codes of multiple image blocks, the multiple image blocks and the corresponding position codes can be added, and then input into a discriminative image segmentor for feature extraction to obtain image block features of the multiple image blocks.

[0074] In the above-mentioned embodiment of the present application, the image features of the first image are compared with the vector features of multiple discrete vectors to determine the discrete features of the first image, including: determining the similarity between the image features of the first image and the vector features of the multiple discrete vectors; based on the similarity, determining the target discrete vector corresponding to the image features of the first image from the multiple discrete vectors; and determining the discrete features of the target discrete vector as the discrete features of the first image.

[0075] The target discrete vector may be a discrete vector having the highest similarity with the image feature of the first image from among the multiple discrete vectors.

[0076] In an optional embodiment, the similarity between the first image and each discrete vector can be determined by calculating the Euclidean distance, cosine similarity, or Pearson correlation coefficient between the image features of the first image and the vector features of each discrete vector. In the embodiment of the present application, the calculation of the Euclidean distance is used as an example for explanation. After determining the similarity between the first image and each discrete vector, the discrete vector with the maximum similarity can be determined from multiple discrete vectors as the target discrete vector, and then the discrete features of the target discrete vector are read as the discrete features of the first image.

[0077] In the above-mentioned embodiment of the present application, the method also includes: extracting preset images in a preset data set to generate multiple second images; using a discriminative image segmentor to extract features of the multiple second images to obtain image features of the multiple second images; performing clustering operations on the image features of the multiple second images to obtain multiple cluster centers; determining the image features of the multiple cluster centers as vector features of multiple discrete vectors; and randomly generating discrete features of multiple discrete vectors.

[0078] The above-mentioned preset data set can be an image data set with rich categories, can be a public data set on the Internet, such as the image benchmark data set ImageNet, or can be an image data set customized according to user needs, but is not limited to this. In the embodiments of the present application, the image benchmark data set ImageNet is taken as an example for explanation.

[0079] In an optional embodiment, since the amount of data in the image benchmark data set ImageNet is large, in order to ensure the universal performance of the discriminative image segmentor on a variety of images, a certain number of images can be randomly extracted from the image benchmark data set ImageNet as training images for the discriminative image segmentor (i.e., the multiple second images mentioned above), and then the discriminative image segmentor is trained using the training images, that is, the training images are input into the discriminative image segmentor for feature extraction to obtain image features of the training images, and then the image features of the training images are clustered by a clustering algorithm to obtain multiple cluster centers. Therefore, the multiple cluster centers can be used as multiple discrete vectors. At this time, the image features of the cluster centers are the vector features of the discrete vectors, and a unique discrete serial number is randomly generated for each cluster center as the discrete feature corresponding to the cluster center.

[0080] In the above-mentioned embodiment of the present application, a preset image in a preset data set is extracted to generate multiple second images, including: randomly extracting a preset image from the preset data set according to a preset extraction ratio; and randomly flipping the preset image to generate multiple second images.

[0081] The above-mentioned preset extraction ratio can be set according to the processing accuracy of the discriminative image segmenter, and can also be set according to user needs, for example, it can be 10%, 20%, 30%, etc., but is not limited thereto.

[0082] In an optional embodiment, 10% of the images can be randomly selected from the image benchmark dataset ImageNet as preset images, and the diversity of the data can be expanded by random cropping and random flipping to obtain the training images for training the discriminative image segmenter, that is, the second image mentioned above. The size of the random cropping here can be set as needed, for example, it can be 256*256, 512*512, etc., but is not limited to this.

[0083] In the above embodiment of the present application, a clustering operation is performed on the image features of multiple second images to obtain multiple cluster centers, including: merging the image features of multiple second images to obtain a feature matrix; and using a clustering algorithm to perform training on the feature matrix to obtain multiple cluster centers.

[0084] In an optional embodiment, in order to implement a clustering operation, the image features of multiple second images can be merged into a large feature matrix, and then the K-Means clustering algorithm can be trained on the feature matrix to obtain multiple cluster centers, wherein the vocabulary size of the discriminative image segmentor, that is, the size of multiple discrete vectors, can be determined by setting the number K of multiple cluster centers.

[0085] Combine the following Figure 3 A preferred embodiment of the present application is described in detail. Figure 3 As shown in , for an image, it can be divided into multiple image blocks and processed by a discriminative image segmentor to obtain the image features of the image, and multiple cluster centers are determined by the K-Means clustering algorithm. Then, the image block features of the image block are compared with multiple cluster centers, and the discrete serial numbers of the cluster centers with the highest similarity are selected as the identifiers of different image blocks (that is, the discrete features of the image blocks), as shown in Figure 3 As shown, the final discrete features of the image, that is, the discrete feature sequence is [eos,c1,c2,c3,...,c L-3 ,c L-2 ,c L-1 ], eos is a special symbol indicating the start of a sequence.

[0086] In the above embodiment of the present application, the discrete features of the first image are a sequence composed of discrete features of multiple image blocks in the first image; the autoregressive generation model is trained using the discrete features of the first image, including: performing a dislocation operation on the discrete features of the first image to obtain the dislocated discrete features of the first image; using the discrete features of the first image as the input of the autoregressive generation model, and using the dislocated discrete features of the first image as the output of the autoregressive generation model to construct training data; and training the autoregressive generation model using the training data.

[0087] In an optional embodiment, the autoregressive generative model can be trained by staggered prediction. Specifically, the discrete sequence can be staggered by one position as the input and output of the model, such as Figure 3 The training prediction target of input c1 is c2, so the input sequence is [eos,c1,c2,c3,...,c L-3 ,c L-2 ,c L-1 ], the output sequence is [c1,c2,c3,...,c L-2 ,c L-1 ,c L ]. At the same time, the model uses the attention mask mechanism to limit all inputs of the current time step to only see the inputs of the past time steps, such as Figure 3 In c3, you can only see eos, c1, c2, c3, but not c4 and subsequent sequences.

[0088] In order to verify the performance of the autoregressive generative model trained in the above way, the autoregressive generative model was tested on two evaluation benchmarks: image understanding and image generation. In the 1000-category image classification task, the classification accuracy of the autoregressive generative model was better than that of other autoregressive generative models, verifying the image understanding ability; at the same time, in the two image simulation tasks of unconditional and categorical conditions, the autoregressive generative model obtained better results than other autoregressive generative models in terms of the two generation indicators of FID (Frechet Inception Distance) and IS (Inception Score).

[0089] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0090] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0091] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application. Example 2

[0092] According to an embodiment of the present application, an image processing method is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0093] Under the above operating environment, this application provides Figure 4 The image processing method shown. Figure 4 : is a flow chart of an image processing method according to Embodiment 2 of the present application. Figure 4 As shown, the method may include the following steps:

[0094] Step S402, obtaining an image to be processed.

[0095] The above-mentioned image to be processed may be an image that needs to be processed by a trained autoregressive generative model. The method for acquiring the image is similar to the method for acquiring the first image in Example 1, and will not be elaborated here.

[0096] Step S404: extract features of the image to be processed by using a discriminative image segmentor to obtain image features of the image to be processed, wherein the image features are used to represent semantic information of the image to be processed.

[0097] The feature extraction method of the image to be processed is similar to the feature extraction method of the first image in Example 1, and will not be described in detail here.

[0098] Step S406: compare the image features of the image to be processed with the vector features of multiple discrete vectors to determine the discrete features of the image to be processed, wherein different discrete vectors correspond to different discrete features.

[0099] The feature comparison method of the image to be processed is similar to the feature comparison method of the first image in Example 1, and will not be described in detail here.

[0100] Step S408, using the trained autoregressive generation model to process the discrete features of the image to be processed to obtain a processing result of the image to be processed, wherein the trained autoregressive generation model is a model trained using the method provided in the above embodiment 1.

[0101] In an optional embodiment, after the autoregressive generative model is trained using the training method of the autoregressive generative model provided in Example 1 to obtain the trained autoregressive generative model, the discrete features of the image to be processed can be input into the trained autoregressive generative model, and the trained autoregressive generative model processes the discrete features of the image to be processed to obtain a processing result of the image to be processed. The processing result here can be a result generated by semantic understanding of the image to be processed, for example, the category of the image to be processed, but is not limited to this.

[0102] Through the steps provided in the above embodiment of the present application, a first image is acquired, a discriminative image word segmenter is used to extract features of the first image, image features of the first image are obtained, the image features of the first image are compared with the vector features of multiple discrete vectors, the discrete features of the first image are determined, and the discrete features of the image to be processed are processed by the trained autoregressive generative model to obtain the generated result of the image to be processed, so as to achieve the purpose of autoregressive generative model reasoning. It is easy to notice that the discriminative image word segmenter can be used to extract the image features of the first image, and the image features represent the high-dimensional semantic information of the first image, and filter out the visual underlying redundant information of the first image. Then, when the autoregressive generative model is trained using the discrete features of the first image constructed based on the image features of the first image, the autoregressive generative model can focus on the semantic information of the modeled image without considering the relatively underlying visual texture features, so that the autoregressive generative model can generate and understand the content to be expressed by the image more efficiently, and the technical effect of improving the performance of the autoregressive generative model is achieved, thereby solving the technical problem that the input data of the autoregressive generative model is processed by a commonly used word segmenter, resulting in low performance of the autoregressive generative model.

[0103] In the above embodiment of the present application, the discrete features of the image to be processed are processed using a trained autoregressive generation model to obtain a processing result of the image to be processed, including: using the trained autoregressive generation model to process the discrete features of the image to be processed to obtain the misaligned discrete features of the image to be processed; using a classifier to process the misaligned discrete features of the image to be processed to obtain a processing result of the image to be processed, wherein the processing result of the image to be processed is used to characterize the category of the image to be processed.

[0104] In an optional embodiment, the trained autoregressive generative model can achieve excellent performance in image understanding tasks. In order to perform image understanding tasks, a linear classifier can be pre-trained. The discrete features of the image to be processed can be input into the trained autoregressive generative model to obtain the dislocated discrete features of the image to be processed, and then the linear classifier can be used to perform image decomposition (classification) of the image to be processed.

[0105] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1. Example 3

[0106] According to an embodiment of the present application, an image processing method is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0107] Under the above operating environment, this application provides Figure 5 The image processing method shown. Figure 5 is a flow chart of an image processing method according to Embodiment 3 of the present application. Figure 5 As shown, the method may include the following steps:

[0108] Step S502: upon receiving an image generation instruction, constructing a preset indicator based on the image generation instruction.

[0109] The above-mentioned preset indicator may be a special symbol indicating the start of a sequence, for example, it may be represented by eos, but is not limited thereto.

[0110] Step S504, inputting the preset indicator into the trained autoregressive generation model, and obtaining the generated image output by the trained autoregressive generation model, wherein the trained autoregressive generation model is a model trained by the above method.

[0111] In an optional embodiment, after the autoregressive generative model is trained using the training method of the autoregressive generative model provided in Example 1 to obtain a trained autoregressive generative model, the trained autoregressive generative model can achieve excellent performance in image generation tasks. First, an eos symbol is input into the trained autoregressive generative model to predict the next symbol c1. In this process, c1 is randomly sampled according to the predicted probability, and then c1 is input into the model again to predict the next c2. This iterative process can generate a complete image sequence.

[0112] Through the steps provided in the above embodiment of the present application, a first image is acquired, a discriminative image word segmenter is used to extract features of the first image, image features of the first image are obtained, the image features of the first image are compared with the vector features of multiple discrete vectors, the discrete features of the first image are determined, and the discrete features of the image to be processed are processed by the trained autoregressive generative model to obtain the generated result of the image to be processed, so as to achieve the purpose of autoregressive generative model reasoning. It is easy to notice that the discriminative image word segmenter can be used to extract the image features of the first image, and the image features represent the high-dimensional semantic information of the first image, and filter out the visual underlying redundant information of the first image. Then, when the autoregressive generative model is trained using the discrete features of the first image constructed based on the image features of the first image, the autoregressive generative model can focus on the semantic information of the modeled image without considering the relatively underlying visual texture features, so that the autoregressive generative model can generate and understand the content to be expressed by the image more efficiently, and the technical effect of improving the performance of the autoregressive generative model is achieved, thereby solving the technical problem that the input data of the autoregressive generative model is processed by a commonly used word segmenter, resulting in low performance of the autoregressive generative model.

[0113] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1. Example 4

[0114] According to an embodiment of the present application, a training method for an autoregressive generative model is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0115] Under the above operating environment, this application provides Figure 6 The training method of the autoregressive generative model shown. Figure 6 4 is a flowchart of the training method of the autoregressive generation model according to Example 4 of the present application. Figure 6 As shown, the method may include the following steps:

[0116] Step S602: Displaying a first image on the operation interface in response to an input instruction on the operation interface.

[0117] The above-mentioned operation interface can be a graphical user interface provided by the client device, and the above-mentioned input instructions can be instructions generated by the user operating on the graphical user interface, for example, the user clicks the "Upload" button on the graphical user interface, or the user clicks the "Search" button on the graphical user interface, but is not limited to this, and can also be generated by clicking other buttons or other sliding operations.

[0118] In an optional embodiment, the user can click the "Upload" button on the graphical user interface to generate an input instruction, which instructs to select multiple images that are desired to be used to train the autoregressive generative model from the local database, and upload them to the server, and the server processes each image according to the scheme provided in the embodiment of the present application. In another optional embodiment, the user can click the "Search" button on the graphical user interface to generate an input instruction, which instructs to download multiple images that are desired to be used to train the autoregressive generative model from the network, and upload them to the server, and the server processes each image according to the scheme provided in the embodiment of the present application.

[0119] Step S604, in response to the training instruction on the operation interface, the training result of the autoregressive generative model is displayed on the operation interface, wherein the training result is the result of training the autoregressive generative model using the discrete features of the first image, the discrete features of the first image are the features obtained by comparing the image features of the first image with the vector features of multiple discrete vectors, different discrete vectors correspond to different discrete features, and the image features of the first image are the features obtained by extracting features of the first image using a discriminative image segmentor.

[0120] The above-mentioned training instructions can be instructions generated by the user operating on the graphical user interface, for example, the user clicks the "training" button on the graphical user interface, but is not limited to this, and can also be generated by clicking other buttons or other sliding operations.

[0121] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1. Example 5

[0122] According to an embodiment of the present application, a training method for an autoregressive generative model is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0123] Under the above operating environment, this application provides Figure 7The training method of the autoregressive generative model shown. Figure 7 Flowchart of the training method of the autoregressive generation model according to Example 5 of the present application. Figure 7 As shown, the method may include the following steps:

[0124] Step S702: acquiring a first image by calling a first interface, wherein the first interface includes a first parameter, and a parameter value of the first parameter includes the first image.

[0125] The first interface mentioned above may be an interface between the client device and the server, through which the client device may upload the first image to the server.

[0126] Step S704: extract features from the first image using a discriminative image segmentor to obtain image features of the first image, wherein the image features are used to represent semantic information of the first image.

[0127] Step S706: Compare the image features of the first image with the vector features of the plurality of discrete vectors to determine the discrete features of the first image, wherein different discrete vectors correspond to different discrete features.

[0128] Step S708: train the autoregressive generation model using the discrete features of the first image to obtain a training result of the autoregressive generation model.

[0129] Step S710: outputting the training result of the autoregressive generation model by calling the second interface, wherein the second interface includes a second parameter, and the parameter value of the second parameter includes the training result of the autoregressive generation model.

[0130] The above-mentioned second interface may be an interface between the client device and the server, through which the server may return the training result of the autoregressive generation model to the client device.

[0131] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1. Example 6

[0132] According to an embodiment of the present application, a training device for an autoregressive generation model for implementing the training method of the above-mentioned autoregressive generation model is also provided, such as Figure 8 As shown, the device 800 includes: an acquisition module 802 , an extraction module 804 , a determination module 806 and a training module 808 .

[0133] Among them, the acquisition module 802 is used to acquire the first image; the extraction module 804 is used to use a discriminative image segmentor to extract features of the first image to obtain image features of the first image, wherein the image features are used to characterize the semantic information of the first image; the determination module 806 is used to compare the image features of the first image with vector features of multiple discrete vectors to determine the discrete features of the first image, wherein different discrete vectors correspond to different discrete features; the training module 808 is used to train the autoregressive generation model using the discrete features of the first image.

[0134] It should be noted that the acquisition module 802, extraction module 804, determination module 806 and training module 808 correspond to steps S202 to S208 in Example 1, and the four modules and corresponding steps implement the same instances and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units may be hardware components or software components stored in a memory and processed by one or more processors, and the above-mentioned modules may also be part of the device and may run in the server 10 provided in Example 1.

[0135] In the above embodiment of the present application, the extraction module includes: a division unit, an extraction unit and a first merging unit.

[0136] Among them, the division unit is used to segment the first image to obtain multiple image blocks; the extraction unit is used to use a discriminative image segmentor to extract features of the multiple image blocks to obtain image block features of the multiple image blocks; the first merging unit is used to merge the image block features of the multiple image blocks to obtain the image features of the first image.

[0137] In the above embodiment of the present application, the extraction unit is also used to obtain position codes of multiple image blocks, wherein the position codes are used to characterize the positions of the multiple image blocks in the first image; the multiple image blocks and the position codes of the multiple image blocks are input into the discriminative image segmentor to obtain image block features of the multiple image blocks output by the discriminative image segmentor.

[0138] In the above embodiment of the present application, the determination module includes: a first determination unit, a second determination unit and a third determination unit.

[0139] The first determination unit is used to determine the similarity between the image features of the first image and the vector features of multiple discrete vectors; the second determination unit is used to determine, based on the similarity, a target discrete vector corresponding to the image features of the first image from multiple discrete vectors; and the third determination unit is used to determine that the discrete features of the target discrete vector are the discrete features of the first image.

[0140] In the above embodiment of the present application, the device further includes: an extraction module, a clustering module, a first determination module and a second determination module.

[0141] Among them, the extraction module is used to extract the preset images in the preset data set to generate multiple second images; the extraction module is also used to use the discriminative image segmentor to extract features of the multiple second images to obtain image features of the multiple second images; the clustering module is used to perform clustering operations on the image features of the multiple second images to obtain multiple cluster centers; the first determination module is used to determine that the image features of the multiple cluster centers are vector features of multiple discrete vectors; the second determination module is used to randomly generate discrete features of multiple discrete vectors.

[0142] In the above embodiments of the present application, the extraction module includes: an extraction unit and an operation unit.

[0143] The extraction unit is used to randomly extract a preset image from a preset data set according to a preset extraction ratio; the operation unit is used to perform a random flip operation on the preset image to generate a plurality of second images.

[0144] In the above embodiment of the present application, the clustering module includes: a second merging unit and a training unit.

[0145] The second merging unit is used to merge the image features of the plurality of second images to obtain a feature matrix; and the training unit is used to perform training on the feature matrix using a clustering algorithm to obtain a plurality of cluster centers.

[0146] In the above embodiment of the present application, the discrete features of the first image are a sequence composed of discrete features of multiple image blocks in the first image; the training unit is also used to perform a dislocation operation on the discrete features of the first image to obtain the dislocated discrete features of the first image; the discrete features of the first image are used as the input of the autoregressive generation model, and the dislocated discrete features of the first image are used as the output of the autoregressive generation model to construct training data; and the autoregressive generation model is trained using the training data.

[0147] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1. Example 7

[0148] According to an embodiment of the present application, an image processing device for implementing the above-mentioned image processing method is also provided. Fig. 9 As shown, the device 900 includes: an acquisition module 902 , an extraction module 904 , a determination module 906 and a processing module 908 .

[0149] Among them, the acquisition module 902 is used to acquire the image to be processed; the extraction module 904 is used to use a discriminative image segmentor to perform feature extraction on the image to be processed to obtain image features of the image to be processed, wherein the image features are used to characterize the semantic information of the image to be processed; the determination module 906 is used to compare the image features of the image to be processed with the vector features of multiple discrete vectors to determine the discrete features of the image to be processed, wherein different discrete vectors correspond to different discrete features; the processing module 908 is used to use a trained autoregressive generation model to process the discrete features of the image to be processed to obtain a processing result of the image to be processed, wherein the trained autoregressive generation model is a model trained using the above method.

[0150] It should be noted that the acquisition module 902, extraction module 904, determination module 906 and processing module 908 correspond to steps S402 to S408 in Example 2, and the four modules and corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in Example 1. It should be noted that the modules or units may be hardware components or software components stored in a memory and processed by one or more processors, and the modules may also be part of a device and run in the server 10 provided in Example 1.

[0151] In the above embodiments of the present application, the processing module includes: a first processing unit and a second processing unit.

[0152] Among them, the first processing unit is used to use the trained autoregressive generation model to process the discrete features of the image to be processed to obtain the dislocated discrete features of the image to be processed; the second processing unit is used to use the classifier to process the dislocated discrete features of the image to be processed to obtain the processing result of the image to be processed, wherein the processing result of the image to be processed is used to characterize the category of the image to be processed.

[0153] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1. Example 8

[0154] According to an embodiment of the present application, an image processing device for implementing the above-mentioned image processing method is also provided. Fig.10 As shown, the device 1000 includes: a construction module 1002 and a generation module 1004.

[0155] Among them, the construction module 1002 is used to construct a preset indicator based on the image generation instruction when an image generation instruction is received; the generation module 1004 is used to input the preset indicator into the trained autoregressive generation model, and obtain the generated image output by the trained autoregressive generation model, wherein the trained autoregressive generation model is a model trained using the above method.

[0156] It should be noted that the above-mentioned construction module 1002 and generation module 1004 correspond to steps S502 to S504 in Example 3, and the examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units may be hardware components or software components stored in a memory and processed by one or more processors, and the above-mentioned modules may also be part of the device and may run in the server 10 provided in Example 1.

[0157] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1. Example 9

[0158] According to an embodiment of the present application, a training device for an autoregressive generation model for implementing the training method of the above-mentioned autoregressive generation model is also provided, such as Fig.11 As shown, the device 1100 includes: a first display module 1102 and a second display module 1104 .

[0159] Among them, the first display module 1102 is used to respond to input instructions on the operation interface and display the first image on the operation interface; the second display module 1104 is used to respond to training instructions on the operation interface and display the training results of the autoregressive generation model on the operation interface, wherein the training results are the results of training the autoregressive generation model using the discrete features of the first image, the discrete features of the first image are the features obtained by comparing the image features of the first image with the vector features of multiple discrete vectors, different discrete vectors correspond to different discrete features, and the image features of the first image are the features obtained by extracting features of the first image using a discriminative image segmentor.

[0160] It should be noted that the first display module 1102 and the second display module 1104 correspond to steps S602 to S604 in Example 4, and the examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units may be hardware components or software components stored in a memory and processed by one or more processors, and the above-mentioned modules may also be part of the device and may run in the server 10 provided in Example 1.

[0161] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1. Example 10

[0162] According to an embodiment of the present application, a training device for an autoregressive generation model for implementing the training method of the above-mentioned autoregressive generation model is also provided, such as Fig.12 As shown, the device 1200 includes: a first calling module 1202, an extraction module 1204, a determination module 1206, a training module 1208 and a second calling module 1210.

[0163] Among them, the first calling module 1202 is used to obtain the first image by calling the first interface, wherein the first interface includes a first parameter, and the parameter value of the first parameter includes the first image; the extraction module 1204 is used to use a discriminative image segmentor to extract features of the first image to obtain image features of the first image, wherein the image features are used to characterize the semantic information of the first image; the determination module 1206 is used to compare the image features of the first image with the vector features of multiple discrete vectors to determine the discrete features of the first image, wherein different discrete vectors correspond to different discrete features; the training module 1208 is used to train the autoregressive generation model using the discrete features of the first image to obtain the training results of the autoregressive generation model; the second calling module 1210 is used to output the training results of the autoregressive generation model by calling the second interface, wherein the second interface includes a second parameter, and the parameter value of the second parameter includes the training results of the autoregressive generation model.

[0164] It should be noted that the first calling module 1202, the extraction module 1204, the determination module 1206, the training module 1208 and the second calling module 1210 correspond to steps S702 to S710 in Example 5, and the five modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units may be hardware components or software components stored in a memory and processed by one or more processors, and the above-mentioned modules may also be part of the device and may run in the server 10 provided in Example 1.

[0165] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1. Embodiment 11

[0166] The embodiment of the present application may provide an electronic device, which may be any electronic device in a group of electronic devices. Optionally, in this embodiment, the electronic device may also be replaced by a terminal device such as a mobile terminal.

[0167] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0168] In this embodiment, the computer terminal can execute the program code in the method.

[0169] Optionally, Fig.13 is a structural block diagram of an electronic device according to an embodiment of the present application. Fig.13 As shown, the electronic device A may include: one or more (only one is shown in the figure) processors 1302, a memory 1304, a storage controller, and a peripheral interface, wherein the peripheral interface is connected to a radio frequency module, an audio module, and a display.

[0170] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the methods and devices in the embodiments of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implementing the methods in the above embodiments. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal A via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0171] The processor can call the information and application stored in the memory through the transmission device to execute the following steps: obtain a first image; use a discriminative image segmentor to extract features of the first image to obtain image features of the first image, wherein the image features are used to characterize the semantic information of the first image; compare the image features of the first image with vector features of multiple discrete vectors to determine the discrete features of the first image, wherein different discrete vectors correspond to different discrete features; and use the discrete features of the first image to train an autoregressive generation model.

[0172] Optionally, the processor may also execute program code of the following steps: segmenting the first image to obtain multiple image blocks; performing feature extraction on the multiple image blocks using a discriminative image segmentor to obtain image block features of the multiple image blocks; and merging the image block features of the multiple image blocks to obtain image features of the first image.

[0173] Optionally, the processor may also execute the program code of the following steps: obtaining position codes of multiple image blocks, wherein the position codes are used to characterize the positions of the multiple image blocks in the first image; inputting the multiple image blocks and the position codes of the multiple image blocks into a discriminative image segmentor to obtain image block features of the multiple image blocks output by the discriminative image segmentor.

[0174] Optionally, the processor may also execute program code of the following steps: determining the similarity between the image features of the first image and the vector features of multiple discrete vectors; based on the similarity, determining the target discrete vector corresponding to the image features of the first image from multiple discrete vectors; and determining the discrete features of the target discrete vector as the discrete features of the first image.

[0175] Optionally, the processor may also execute program codes of the following steps: extracting preset images from a preset data set to generate multiple second images; performing feature extraction on the multiple second images using a discriminative image segmentor to obtain image features of the multiple second images; performing clustering operations on the image features of the multiple second images to obtain multiple cluster centers; determining the image features of the multiple cluster centers as vector features of multiple discrete vectors; and randomly generating discrete features of multiple discrete vectors.

[0176] Optionally, the processor may also execute program codes of the following steps: randomly extracting a preset image from a preset data set according to a preset extraction ratio; and performing a random flipping operation on the preset image to generate a plurality of second images.

[0177] Optionally, the processor may also execute program codes of the following steps: merging image features of multiple second images to obtain a feature matrix; and training the feature matrix using a clustering algorithm to obtain multiple cluster centers.

[0178] Optionally, the discrete features of the first image are a sequence composed of discrete features of multiple image blocks in the first image; the above-mentioned processor can also execute the program code of the following steps: using the discrete features of the first image to train the autoregressive generation model, including: performing a dislocation operation on the discrete features of the first image to obtain the dislocated discrete features of the first image; using the discrete features of the first image as the input of the autoregressive generation model, and using the dislocated discrete features of the first image as the output of the autoregressive generation model to construct training data; and training the autoregressive generation model using the training data.

[0179] The processor can also call the information and application programs stored in the memory through the transmission device to execute the following steps: obtain the image to be processed; use a discriminative image segmentor to extract features of the image to be processed to obtain image features of the image to be processed, wherein the image features are used to characterize the semantic information of the image to be processed; compare the image features of the image to be processed with the vector features of multiple discrete vectors to determine the discrete features of the image to be processed, wherein different discrete vectors correspond to different discrete features; use a trained autoregressive generation model to process the discrete features of the image to be processed to obtain the generation result of the image to be processed, wherein the trained autoregressive generation model is a model trained using the above method.

[0180] Optionally, the processor may also execute the following steps of program code: using a trained autoregressive generative model to process discrete features of an image to be processed to obtain misaligned discrete features of the image to be processed, and using a classifier to process the misaligned discrete features of the image to be processed to obtain a generated result of the image to be processed, wherein the generated result of the image to be processed is used to characterize the category of the image to be processed; or, using a trained autoregressive generative model to process discrete features of an image to be processed to obtain misaligned discrete features of the image to be processed, and generating a generated result of the image to be processed based on the misaligned discrete features of the image to be processed, wherein the generated result of the image to be processed is used to characterize the generated image corresponding to the image to be processed.

[0181] The processor can call the information and application programs stored in the memory through the transmission device to execute the following steps: respond to the input instruction on the operation interface and display the first image on the operation interface; respond to the training instruction on the operation interface and display the training result of the autoregressive generation model on the operation interface, wherein the training result is the result of training the autoregressive generation model using the discrete features of the first image, the discrete features of the first image are the features obtained by comparing the image features of the first image with the vector features of multiple discrete vectors, different discrete vectors correspond to different discrete features, and the image features of the first image are the features obtained by extracting features of the first image using a discriminative image segmentor.

[0182] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain the first image by calling the first interface, wherein the first interface includes a first parameter, and the parameter value of the first parameter includes the first image; use a discriminative image segmentor to extract features of the first image to obtain image features of the first image, wherein the image features are used to characterize the semantic information of the first image; compare the image features of the first image with vector features of multiple discrete vectors to determine the discrete features of the first image, wherein different discrete vectors correspond to different discrete features; use the discrete features of the first image to train the autoregressive generation model to obtain the training results of the autoregressive generation model; output the training results of the autoregressive generation model by calling the second interface, wherein the second interface includes a second parameter, and the parameter value of the second parameter includes the training results of the autoregressive generation model.

[0183] By adopting the embodiment of the present application, a training and reasoning scheme of an autoregressive generative model is provided. The purpose of training the autoregressive generative model is achieved by acquiring a first image, extracting features of the first image using a discriminative image segmentor, obtaining image features of the first image, comparing the image features of the first image with vector features of multiple discrete vectors, determining the discrete features of the first image, and using the discrete features of the first image to train the autoregressive generative model. It is easy to notice that the discriminative image segmentor can be used to extract the image features of the first image, and the image features can be converted into discrete features to reduce the data dimension to be processed. Since the discrete features filter out the visual underlying redundant information of the first image and only retain the semantic information, when the autoregressive generative model is trained using the discrete features of the first image, the autoregressive generative model can focus on the semantic information of the modeled image without considering the underlying visual texture features, so that the autoregressive generative model can generate and understand the content to be expressed by the image more efficiently, and the technical effect of improving the performance of the autoregressive generative model is achieved, thereby solving the technical problem that the input data of the autoregressive generative model is processed by a commonly used segmenter, resulting in low performance of the autoregressive generative model.

[0184] It is understood by those skilled in the art that the structure shown in the figure is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, and other terminal devices. The figure does not limit the structure of the above-mentioned electronic device. For example, the electronic device A may also include more or fewer components (such as a network interface, a display device, etc.) than those shown in the figure, or have a configuration different from that shown in the figure.

[0185] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc. Example 12

[0186] The embodiment of the present application further provides a computer-readable storage medium. Optionally, in this embodiment, the computer-readable storage medium can be used to store the program code executed by the method provided in the above embodiment.

[0187] Optionally, in this embodiment, the above storage medium may be located in any electronic device in a group of electronic devices in a computer network, or in any mobile terminal in a group of mobile terminals.

[0188] Optionally, in this embodiment, a computer-readable storage medium is configured to store program code for executing the following steps: acquiring a first image; performing feature extraction on the first image using a discriminative image segmentor to obtain image features of the first image, wherein the image features are used to characterize semantic information of the first image; comparing the image features of the first image with vector features of multiple discrete vectors to determine discrete features of the first image, wherein different discrete vectors correspond to different discrete features; and training an autoregressive generative model using the discrete features of the first image.

[0189] Optionally, the computer-readable storage medium is also configured to store program code for performing the following steps: segmenting the first image to obtain multiple image blocks; performing feature extraction on the multiple image blocks using a discriminative image segmentor to obtain image block features of the multiple image blocks; and merging the image block features of the multiple image blocks to obtain image features of the first image.

[0190] Optionally, the computer-readable storage medium is also configured to store program code for performing the following steps: obtaining position codes of multiple image blocks, wherein the position codes are used to characterize positions of the multiple image blocks in a first image; inputting the multiple image blocks and the position codes of the multiple image blocks into a discriminative image segmentor to obtain image block features of the multiple image blocks output by the discriminative image segmentor.

[0191] Optionally, the computer-readable storage medium is also configured to store program code for performing the following steps: determining the similarity between image features of the first image and vector features of multiple discrete vectors; based on the similarity, determining a target discrete vector corresponding to the image features of the first image from multiple discrete vectors; and determining the discrete features of the target discrete vector to be the discrete features of the first image.

[0192] Optionally, the computer-readable storage medium is also configured to store program code for executing the following steps: extracting preset images from a preset data set to generate multiple second images; performing feature extraction on the multiple second images using a discriminative image segmentor to obtain image features of the multiple second images; performing clustering operations on the image features of the multiple second images to obtain multiple cluster centers; determining the image features of the multiple cluster centers as vector features of multiple discrete vectors; and randomly generating discrete features of multiple discrete vectors.

[0193] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: randomly extracting a preset image from a preset data set according to a preset extraction ratio; and performing a random flipping operation on the preset image to generate a plurality of second images.

[0194] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: merging image features of multiple second images to obtain a feature matrix; and training the feature matrix using a clustering algorithm to obtain multiple cluster centers.

[0195] Optionally, the discrete features of the first image are a sequence composed of discrete features of multiple image blocks in the first image; the computer-readable storage medium is also configured to store program code for executing the following steps: using the discrete features of the first image to train the autoregressive generative model, including: performing a dislocation operation on the discrete features of the first image to obtain the dislocated discrete features of the first image; using the discrete features of the first image as input to the autoregressive generative model, and using the dislocated discrete features of the first image as output of the autoregressive generative model to construct training data; and training the autoregressive generative model using the training data.

[0196] Optionally, in this embodiment, the computer-readable storage medium is configured to store program codes for executing the following steps: obtaining an image to be processed; performing feature extraction on the image to be processed using a discriminative image segmentor to obtain image features of the image to be processed, wherein the image features are used to characterize the semantic information of the image to be processed; comparing the image features of the image to be processed with vector features of multiple discrete vectors to determine the discrete features of the image to be processed, wherein different discrete vectors correspond to different discrete features; and processing the discrete features of the image to be processed using a trained autoregressive generative model to obtain a generation result of the image to be processed, wherein the trained autoregressive generative model is a model trained using the above method.

[0197] Optionally, the computer-readable storage medium is also configured to store program code for executing the following steps: using a trained autoregressive generative model to process the discrete features of the image to be processed to obtain the misaligned discrete features of the image to be processed, and using a classifier to process the misaligned discrete features of the image to be processed to obtain a generated result of the image to be processed, wherein the generated result of the image to be processed is used to characterize the category of the image to be processed; or, using a trained autoregressive generative model to process the discrete features of the image to be processed to obtain the misaligned discrete features of the image to be processed, and generating the generated result of the image to be processed based on the misaligned discrete features of the image to be processed, wherein the generated result of the image to be processed is used to characterize the generated image corresponding to the image to be processed.

[0198] Optionally, in this embodiment, the computer-readable storage medium is configured to store program codes for executing the following steps: in response to an input instruction acting on an operation interface, displaying a first image on the operation interface; in response to a training instruction acting on the operation interface, displaying a training result of an autoregressive generative model on the operation interface, wherein the training result is a result of training the autoregressive generative model using discrete features of the first image, the discrete features of the first image are features obtained by comparing image features of the first image with vector features of multiple discrete vectors, different discrete vectors correspond to different discrete features, and the image features of the first image are features obtained by extracting features of the first image using a discriminative image segmentor.

[0199] Optionally, in this embodiment, a computer-readable storage medium is configured to store program code for performing the following steps: acquiring a first image by calling a first interface, wherein the first interface includes a first parameter, and a parameter value of the first parameter includes the first image; performing feature extraction on the first image using a discriminative image segmentor to obtain image features of the first image, wherein the image features are used to characterize semantic information of the first image; comparing the image features of the first image with vector features of multiple discrete vectors to determine discrete features of the first image, wherein different discrete vectors correspond to different discrete features; training an autoregressive generative model using the discrete features of the first image to obtain training results of the autoregressive generative model; and outputting the training results of the autoregressive generative model by calling a second interface, wherein the second interface includes a second parameter, and a parameter value of the second parameter includes the training results of the autoregressive generative model. Embodiment 13

[0200] The embodiment of the present application further provides a computer program product. Optionally, in this embodiment, the computer program product may include a computer program, and the computer program implements the method provided in the embodiment when executed by a processor. Embodiment 14

[0201] The embodiments of the present application also provide a computer program product. Optionally, the computer program product may include a non-volatile computer-readable storage medium, which may be used to store a computer program, and when the computer program is executed by a processor, the method provided in the embodiments is implemented. Embodiment 15

[0202] The embodiment of the present application further provides a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, the method provided in the above embodiment is implemented.

[0203] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0204] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0205] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0206] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0207] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0208] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc., which can store program code.

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

Claims

1. A training method for an autoregressive generative model, It is characterized in that include: acquiring a first image; Using a discriminative image segmentor to extract features from the first image to obtain image features of the first image, wherein the image features are used to represent semantic information of the first image, and the discriminative image segmentor is a pre-trained discriminative self-supervised visual model; Comparing the image features of the first image with the vector features of a plurality of discrete vectors to determine the discrete features of the first image, wherein different discrete vectors correspond to different discrete features, the vector features of the plurality of discrete vectors are generated by a clustering algorithm, and the different discrete features are used to represent a unique discrete serial number generated for each cluster center; Training an autoregressive generative model using discrete features of the first image; The discrete features of the first image are a sequence of discrete features of multiple image blocks in the first image, and the autoregressive generative model is trained using the discrete features of the first image, including: performing a dislocation operation on the discrete features of the first image to obtain the dislocated discrete features of the first image; and training the autoregressive generative model based on the discrete features of the first image and the dislocated discrete features of the first image.

2. The method according to claim 1, It is characterized in that The step of extracting features from the first image using a discriminative image segmentor to obtain image features of the first image includes: Segmenting the first image to obtain a plurality of image blocks; Using the discriminative image segmentor to extract features from the multiple image blocks to obtain image block features of the multiple image blocks; The image block features of the multiple image blocks are merged to obtain image features of the first image.

3. The method according to claim 2, It is characterized in that The step of extracting features from the plurality of image blocks using the discriminative image segmentor to obtain image block features of the plurality of image blocks includes: Acquire position codes of the multiple image blocks, wherein the position codes are used to represent positions of the multiple image blocks in the first image; The multiple image blocks and the position codes of the multiple image blocks are input into the discriminative image segmentor to obtain image block features of the multiple image blocks output by the discriminative image segmentor.

4. The method according to claim 1, It is characterized in that The comparing the image feature of the first image with the vector features of a plurality of discrete vectors to determine the discrete features of the first image includes: Determining similarities between image features of the first image and vector features of the plurality of discrete vectors; Based on the similarity, determining a target discrete vector corresponding to the image feature of the first image from the multiple discrete vectors; The discrete features of the target discrete vector are determined as the discrete features of the first image.

5. The method according to any one of claims 1 to 4, It is characterized in that The method further comprises: Extracting a preset image from a preset data set to generate a plurality of second images; Using the discriminative image segmenter to extract features from the plurality of second images to obtain image features of the plurality of second images; Performing a clustering operation on the image features of the plurality of second images to obtain a plurality of cluster centers; Determine the image features of the multiple cluster centers as vector features of the multiple discrete vectors; Discrete features of the plurality of discrete vectors are randomly generated.

6. The method according to claim 5, It is characterized in that The step of extracting a preset image from a preset data set to generate a plurality of second images includes: Randomly extracting the preset image from the preset data set according to a preset extraction ratio; The preset image is randomly flipped to generate the plurality of second images.

7. The method according to claim 5, It is characterized in that The clustering operation is performed on the image features of the plurality of second images to obtain a plurality of cluster centers, including: Merging the image features of the plurality of second images to obtain a feature matrix; A clustering algorithm is used to perform training on the feature matrix to obtain the multiple cluster centers.

8. The method according to claim 1, It is characterized in that Training the autoregressive generative model based on the discrete features of the first image and the dislocated discrete features of the first image includes: Using the discrete features of the first image as input of the autoregressive generative model and using the dislocated discrete features of the first image as output of the autoregressive generative model to construct training data; The autoregressive generative model is trained using the training data.

9. An image processing method, It is characterized in that include: Get the image to be processed; Using a discriminative image segmentor to extract features of the image to be processed, to obtain image features of the image to be processed, wherein the image features are used to represent semantic information of the image to be processed; Comparing the image features of the image to be processed with the vector features of a plurality of discrete vectors to determine the discrete features of the image to be processed, wherein different discrete vectors correspond to different discrete features; The discrete features of the image to be processed are processed using a trained autoregressive generation model to obtain a processing result of the image to be processed, wherein the trained autoregressive generation model is a model trained using the method described in any one of claims 1 to 8.

10. An image processing method, It is characterized in that include: In case of receiving the image generation instruction, constructing a preset indicator based on the image generation instruction; The preset indicator is input into a trained autoregressive generation model, and a generated image output by the trained autoregressive generation model is obtained, wherein the trained autoregressive generation model is a model trained using the method described in any one of claims 1 to 8.

11. A training method for an autoregressive generative model, It is characterized in that include: In response to an input instruction acting on the operation interface, displaying a first image on the operation interface; In response to a training instruction applied to the operation interface, a training result of an autoregressive generative model is displayed on the operation interface, wherein the discrete features of the first image are a sequence of discrete features of a plurality of image blocks in the first image, and the training result is a result of training the autoregressive generative model using the discrete features of the first image and the dislocated discrete features of the first image, the dislocated discrete features of the first image are obtained by dislocating the discrete features of the first image, the discrete features of the first image are features obtained by comparing the image features of the first image with vector features of a plurality of discrete vectors, different discrete vectors correspond to different discrete features, the image features of the first image are features obtained by extracting features from the first image using a discriminative image segmentor, the discriminative image segmentor is a pre-trained discriminative self-supervised visual model, the vector features of the plurality of discrete vectors are generated by a clustering algorithm, and the different discrete features are used to represent a unique discrete serial number generated for each cluster center.

12. A training method for an autoregressive generative model, It is characterized in that include: Acquire a first image by calling a first interface, wherein the first interface includes a first parameter, and a parameter value of the first parameter includes the first image; Using a discriminative image segmentor to extract features from the first image to obtain image features of the first image, wherein the image features are used to represent semantic information of the first image, and the discriminative image segmentor is a pre-trained discriminative self-supervised visual model; Comparing the image features of the first image with the vector features of a plurality of discrete vectors to determine the discrete features of the first image, wherein different discrete vectors correspond to different discrete features, the vector features of the plurality of discrete vectors are generated by a clustering algorithm, and the different discrete features are used to represent a unique discrete serial number generated for each cluster center; Using the discrete features of the first image to train an autoregressive generation model to obtain a training result of the autoregressive generation model; Outputting the training result of the autoregressive generation model by calling a second interface, wherein the second interface includes a second parameter, and a parameter value of the second parameter includes the training result of the autoregressive generation model; The discrete features of the first image are a sequence of discrete features of multiple image blocks in the first image, and the autoregressive generative model is trained using the discrete features of the first image, including: performing a dislocation operation on the discrete features of the first image to obtain the dislocated discrete features of the first image; and training the autoregressive generative model based on the discrete features of the first image and the dislocated discrete features of the first image.

13. An electronic device, It is characterized in that include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 12 when running.

14. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored executable program, wherein when the executable program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 12.

15. A computer program product, It is characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Sign language action recognition method and discrete coding model training method

    CN115937968A

  • Image recognition method, medium, device and computing equipment

    CN117011581A