Multi-scale perception model based on converter model, target identification method and related equipment

Through the multi-scale perception model based on the converter model, combined with the image feature extraction network and the convolution classification head network, the problem of poor recognition of small targets by the pre-trained model is solved, and low-cost and efficient multi-scale target recognition is achieved.

CN118628823AActive Publication Date: 2024-09-10BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202410797020.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-09-10
Estimated Expiration
2044-06-19

AI Technical Summary

Technical Problem

Existing pre-trained models are not effective in small target recognition, and the cost of training data annotation and iteration is high.

Method used

Using a multi-scale perception model based on the transformer model, multiple Patch Token sequences are extracted through the image feature extraction network and feature fusion network, and the convolution classification head network is used for target recognition, combined with the pre-trained Transformer model and convolution structure, to achieve Multi-scale target recognition.

Benefits of technology

It performs well in small target recognition, has a small amount of training parameters, fast iteration speed, and low iteration cost, and can effectively reduce deployment resources and model iteration costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628823A
    Figure CN118628823A
Patent Text Reader

Abstract

The invention provides a multi-scale perception model based on a converter model, and the model comprises an image feature extraction network which comprises an encoder formed by stacking multiple stages of attention modules, and is used for outputting a plurality of image block token (Patch Token) sequences extracted by the multiple stages of attention modules based on an input to-be-recognized image; the feature fusion network is used for fusing the plurality of image block token sequences to obtain a fused target image block token sequence; and the at least one convolution point class head network is used for performing target identification on the target image block token sequence to obtain at least one target object in the to-be-identified image and a corresponding identification result. Based on the multi-scale sensing model based on the converter model, the invention further provides a target identification method and related equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a multi-scale perception model based on a converter model, a target recognition method and related equipment. Background Art

[0002] The Visual Transformer (ViT) model is a model that applies the Transformer model to image classification. The Transformer uses a self-attention mechanism, which enables the model to obtain information about all other pixels when processing a single pixel, and better obtain the global structure of the image.

[0003] With the continuous development of deep learning, a large number of excellent pre-trained models have emerged in recent years. This kind of pre-trained model trained on large-scale data can learn universal features and has strong generalization ability. Performing downstream image classification tasks based on such pre-trained models is usually better than training a small model from scratch. Moreover, due to the reduction in the number of parameters involved in training, the iteration speed is also faster. However, most of the training of pre-trained models is based on fine-tuning the global features output by the model, so it is often not effective in the recognition of small targets. For the recognition of small targets, you may consider training a classification model, but the cost of training data annotation is high, and adding categories requires retraining the classification model, which has a high iteration cost. Summary of the invention

[0004] In view of this, the embodiments of the present disclosure provide a multi-scale perception model based on a transformer model, a target recognition method and related devices, which can realize multi-scale target recognition in image classification tasks, especially having better effects in the recognition of small targets. In addition, the multi-scale perception model based on the transformer model also has the characteristics of small training parameters, fast iteration speed and low iteration cost.

[0005] The multi-scale perception model based on the converter model described in the embodiment of the present disclosure may include:

[0006] An image feature extraction network, comprising: an encoder formed by stacking multi-level attention modules, configured to output a plurality of image patch token sequences extracted by the multi-level attention modules based on an input image to be recognized;

[0007] A feature fusion network, used to fuse the multiple Patch Token sequences to obtain a fused target Patch Token sequence; and

[0008] At least one convolutional classification head network is used to perform target recognition on the target Patch Token sequence to obtain at least one target object in the image to be recognized and its corresponding recognition result.

[0009] In an embodiment of the present disclosure, the image feature extraction network includes:

[0010] An image segmentation module, used for segmenting the image to be identified into a plurality of image patches;

[0011] A linear mapping module, used to perform linear mapping on the multiple patches respectively to obtain feature vectors (Embedding) corresponding to the multiple patches; and

[0012] The encoder includes a multi-level stacked attention module, which is used to encode the Embeddings corresponding to the multiple Patches, and obtain the Patch Token sequences extracted by each attention module in the multi-level attention module.

[0013] In an embodiment of the present disclosure, the image feature extraction network is implemented by a pre-trained transformer-based image classification model.

[0014] In an embodiment of the present disclosure, the feature fusion network is used to fuse the multiple Patch Token sequences by adding them together or by splicing the feature dimensions together.

[0015] In an embodiment of the present disclosure, the feature fusion network includes:

[0016] A Patch Token sequence selection module, configured to select a candidate Patch Token sequence from the plurality of Patch Token sequences; and

[0017] The fusion module is used to fuse the selected candidate Patch Token sequences to obtain the target Patch Token sequence.

[0018] In an embodiment of the present disclosure, the convolutional classification head network includes: a classification network formed by stacking multiple convolutional modules; and a fully connected layer.

[0019] In an embodiment of the present disclosure, the convolution module is a residual block; or, the convolution module is a dense block.

[0020] Corresponding to the above-mentioned multi-scale perception model based on the converter model, the embodiment of the present disclosure also discloses a target recognition method. The above-mentioned target recognition method may include: extracting multiple Patch Token sequences corresponding to the input image to be recognized; fusing the multiple Patch Token sequences to obtain a fused target Patch Token sequence; and performing target recognition on the target Patch Token sequence to obtain at least one target object in the image to be recognized and its corresponding recognition result.

[0021] In an embodiment of the present disclosure, extracting multiple Patch Token sequences corresponding to an input image to be identified includes: dividing the image to be identified into multiple Patches based on an image segmentation module based on a pre-trained Transformer-based image classification model; linearly mapping the multiple Patches respectively based on a linear mapping module based on a pre-trained transformer-based image classification model to obtain Embeddings corresponding to the multiple Patches; and encoding the Embeddings corresponding to the multiple Patches using a multi-level stacked attention module based on an encoder based on a pre-trained transformer-based image classification model to obtain Patch Token sequences extracted by each attention module in the multi-level attention module.

[0022] In an embodiment of the present disclosure, fusing the multiple Patch Token sequences includes: fusing the multiple Patch Token sequences by adding them together or fusing the multiple Patch Token sequences by splicing feature dimensions together.

[0023] In an embodiment of the present disclosure, fusing the multiple Patch Token sequences includes: selecting a candidate Patch Token sequence from the multiple Patch Token sequences; and fusing the selected candidate Patch Token sequences to obtain the target Patch Token sequence.

[0024] In an embodiment of the present disclosure, fusing the selected candidate Patch Token sequences includes: fusing the multiple candidate Patch Token sequences by adding them together or fusing the multiple candidate Patch Token sequences by splicing feature dimensions.

[0025] In an embodiment of the present disclosure, target recognition of the target Patch Token sequence includes: performing target recognition on the target Patch Token sequence based on a convolutional classification head network; wherein the convolutional classification head network includes: a classification network formed by stacking multiple convolutional modules; and a fully connected layer.

[0026] In addition, an embodiment of the present disclosure further provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned target recognition method when executing the program.

[0027] An embodiment of the present disclosure further provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the above-mentioned target recognition method.

[0028] An embodiment of the present disclosure further provides a computer program product, including computer program instructions, which, when executed on a computer, enable the computer to execute the above-mentioned target recognition method.

[0029] The convolutional classification head network used in the multi-scale perception model based on the converter model, the target recognition method and the related devices described in the embodiments of the present disclosure adopts a convolutional structure, so it has a strong perception ability for local information of the image, and the image feature extraction network used adopts a converter model structure, so it has a strong global inductive modeling ability. Therefore, the multi-scale perception model based on the converter model, the target recognition method and the related devices provided by the embodiments of the present disclosure can simultaneously have the perception ability of global information and information, so that multi-scale target recognition can be realized, and it has good performance for both large and small targets.

[0030] In addition, the image feature extraction network can be implemented by a pre-trained network based on a transformer model, so it has a strong generalization ability. Moreover, since the image feature extraction network does not participate in training, in the embodiments of the present disclosure, both the training cost and the iteration cost of the model are very low.

[0031] Furthermore, since the above-mentioned image feature extraction network does not participate in training, when deploying the above-mentioned multi-scale perception model based on the converter model, multiple trained convolutional classification head networks can be merged together and share a backbone network to construct a multi-classification model. This construction method can support multiple categories without basically increasing the inference cost. At the same time, the addition of new categories will not affect the existing categories, which greatly reduces the cost of deployment resources and the cost of model iteration. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0033] Figure 1 The structure of the multi-scale perception model based on the converter model described in some embodiments of the present disclosure is shown.

[0034] Figure 2 The internal structure of the image feature extraction network 110 described in the embodiment of the present disclosure is shown.

[0035] Figure 3 The visualization results of reconstructing the first 10 dimensions of the Patch Token output by 12 attention modules of a ViT model are shown.

[0036] Figure 4 The internal structure of the feature fusion network 120 described in the embodiment of the present disclosure is shown.

[0037] Figure 5 The internal structure of the convolution classification head network 130 according to the embodiment of the present disclosure is shown.

[0038] Figure 6 The structure of the multi-classification model described in the embodiment of the present disclosure is shown.

[0039] Figure 7 The implementation process of the target recognition method described in some embodiments of the present disclosure is shown.

[0040] Figure 8 A more specific schematic diagram of the hardware structure of an electronic device described in some embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0041] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0042] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0043] It is understandable that before using the technical solutions of each embodiment of the present disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved will be informed to the user in an appropriate manner, and the user's authorization will be obtained.

[0044] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly remind the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can independently choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0045] As an optional but non-limiting implementation, in response to receiving the user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0046] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0047] As mentioned above, although performing downstream image classification tasks based on pre-trained models has the characteristics of fast iteration speed and better results, performing downstream image classification tasks based on pre-trained models usually does not perform well in recognizing small objects.

[0048] In view of the above problems, an embodiment of the present disclosure provides a multi-scale perception model based on a converter model. Figure 1The structure of the multi-scale perception model based on the converter model described in some embodiments of the present disclosure is shown. Figure 1 As shown, the multi-scale perception model based on the converter model includes the following network modules:

[0049] An image feature extraction network 110, comprising an encoder formed by stacking multiple levels of attention modules, for outputting a sequence of tokens (Patch Token) of multiple image patches extracted by the multiple levels of attention modules based on an input image to be recognized;

[0050] A feature fusion network 120 is used to fuse the above-mentioned multiple Patch Token sequences to obtain a fused target Patch Token sequence; and

[0051] At least one convolutional classification head network 130 is used to perform target recognition on the target Patch Token sequence to obtain at least one target object in the image to be recognized and its corresponding recognition result.

[0052] The structures of the above-mentioned networks are described in detail below with reference to the accompanying drawings and specific examples.

[0053] Figure 2 The internal structure of the image feature extraction network 110 described in the embodiment of the present disclosure is shown. Figure 2 As shown, the image feature extraction network 110 may include:

[0054] An image segmentation module 210 is used to segment the image to be identified into a plurality of image patches;

[0055] A linear mapping module 220, configured to perform linear mapping on the plurality of image blocks respectively to obtain feature vectors (Embedding) corresponding to the plurality of image blocks; and

[0056] The encoder 230 includes a multi-level stacked attention module, which is used to encode the feature vectors corresponding to the above-mentioned multiple image blocks, and obtain the above-mentioned multiple Patch Token sequences extracted by each attention module in the above-mentioned multi-level attention module.

[0057] In the embodiment of the present disclosure, the image feature extraction network 110 can be implemented by a pre-trained Transformer-based image classification model, for example, by a pre-trained ViT model, etc. Therefore, the specific structure and training method of the image segmentation module 210, the linear mapping module 220, and the encoder 230 can refer to the ViT model or other pre-trained Transformer-based image classification models, and will not be described in detail here.

[0058] In addition, it should be noted that, usually, in addition to the length and width of the image, each pixel of an image will also correspond to information of multiple dimensions. For example, for an RGB image, each pixel will correspond to a pixel value of three dimensions. Therefore, in the embodiments of the present disclosure, the above-mentioned multiple Patch Token sequences generally refer to Patch Token sequences containing multiple dimensions. In other words, assuming that the image to be identified is divided into K patches, each patch corresponds to information of N dimensions, and the above-mentioned image feature extraction network 110 includes M-level attention modules, then the above-mentioned image feature extraction network 110 will output M groups of Patch Token sequences, and each group of Patch Token sequences corresponds to the output of an attention module. Among them, each group of Patch Token sequences contains K Patch Tokens, and each Patch Token also corresponds to N dimensions. Furthermore, the number of Patch Tokens contained in each Patch Token sequence is the number of image blocks into which the image to be identified is divided. Among them, for the convenience of display, Figure 2 Only one dimension of data is shown after a set of Patch Token sequences are transformed into two-dimensional features.

[0059] It can be understood that the ViT model can obtain both shallow and deep semantic features of the image by stacking the Patch Token output by each attention module, so that the ViT model can have a better understanding of entity class targets (for example, animals, flags, sculptures, etc.) and abstract semantics (for example, horror, disgust, etc.). However, the Transformer-based model has an "over-smoothing" problem. The model obtains the relationship between input image blocks through the self-attention mechanism, and this process may cause the model's feature expression to gradually lose its difference in the continuous learning process, and all features tend to be consistent or too close, which reduces the gap between features and leads to a decrease in effect. Experiments have found that if only the Patch Token output by the last level of attention module of the ViT model is used for classification tasks, the recognition of some entity targets (for example, flags, logos, etc.) is very poor. The recognition of these entity targets usually relies more on some shallow features, such as color, texture, edge, brightness and other basic visual elements. Figure 3 The visualization results of reconstructing the first 10 dimensions of the Patch Token output by 12 attention modules of a ViT model are shown. Figure 3 It can be seen that the Patch Token output by the middle-level attention module contains more intuitive shallow semantic information, such as Figure 3Based on the above research, we can draw the following conclusions: by fusing the Patch Token output by the multi-level attention module, the model can have a better understanding of the entity class targets in the image and the abstract semantics of the image, which allows the model to retain both the shallow features and deep semantics of the image when training downstream classification tasks, and achieve better target recognition results.

[0060] Specifically, in the embodiment of the present disclosure, the feature fusion network 120 can fuse the above-mentioned multiple Patch Token sequences by adding them to obtain a fused target Patch Token sequence. That is to say, the corresponding Patch Tokens of the multiple Patch Token sequences output by the multi-level attention module are directly added to obtain the added target Patch Token sequence. As an alternative, other fusion methods can also be used for fusion, such as feature fusion by splicing feature dimensions, etc. The embodiment of the present disclosure does not limit the fusion method of multiple Patch Token sequences.

[0061] In some other embodiments of the present disclosure, as an alternative to the above-mentioned solution, multiple candidate Patch Token sequences may be selected from the above-mentioned multiple Patch Token sequences, and then the selected candidate Patch Token sequences may be fused. In the process of selecting the candidate Patch Token sequence, multiple factors such as the number of attention modules and the level of the attention modules may be considered. For example, considering that the Patch Token sequence output by the attention module at the middle level contains more intuitive shallow semantic information, it is possible to consider starting with the Patch Token sequence output by the attention module at a certain middle level, and selecting the Patch Token sequence output by the attention module at the last level as the above-mentioned candidate Patch Token sequence. Specifically, the Patch Token sequence output by the attention modules at the last two-thirds of the levels may be selected as the above-mentioned candidate Patch Token sequence according to the number of attention modules, and so on. For another example, multiple candidate Patch Token sequences may also be selected from the above-mentioned multiple Patch Token sequences according to a pre-set selection rule, such as selecting at a certain interval, and so on. It should be noted that the embodiments of the present disclosure do not limit the selection method of the candidate Patch Token sequence. In the above situation, Figure 4 FIG. 1 shows the internal structure of the feature fusion network 120 according to the embodiment of the present disclosure. Figure 4 As shown, the feature fusion network 120 may include:

[0062] A Patch Token sequence selection module 410, configured to select a candidate Patch Token sequence from the plurality of Patch Token sequences; and

[0063] The fusion module 420 is used to fuse the selected candidate Patch Token sequences to obtain the above-mentioned target Patch Token sequence.

[0064] Specifically, in the embodiment of the present disclosure, the above fusion module 420 can fuse the selected target Patch Token sequence by adding. As an alternative, other fusion methods can also be used for fusion, such as feature fusion by splicing feature dimensions, etc. The embodiment of the present disclosure does not limit the fusion method used by the fusion module 420.

[0065] Figure 5 FIG. 1 shows the internal structure of the convolution classification head network 130 according to an embodiment of the present disclosure. Figure 5 As shown, the above-mentioned convolution classification head network 130 may include: a classification network 510 formed by stacking multiple convolution modules 512 and a fully connected layer 520. Among them, the above-mentioned classification network 510 formed by stacking multiple convolution modules 512 can be implemented in a variety of ways. For example, the above-mentioned convolution module 512 can be a residual block (Residual Block) or a dense block (Dense Block). In other words, the above-mentioned classification network 510 can be implemented by a residual network composed of multiple Residual Blocks, or it can be implemented by a dense network composed of multiple Dense Blocks, and so on.

[0066] As mentioned above, in the embodiments of the present disclosure, the above-mentioned image feature extraction network 110 can be implemented by a pre-trained ViT model, or can also be implemented by other pre-trained Transformer-based image classification models. Therefore, the above-mentioned image feature extraction network 110 does not participate in the update of model weights during training. The training of the Transformer-based multi-scale perception model described in the embodiments of the present disclosure only involves the parameter training of the above-mentioned convolutional classification head network 130. That is, the parameters of the convolutional classification head network 130 are trained based on the error between the target recognition result of the image in the sample data and the annotation result of the corresponding image.

[0067] In addition, since the above-mentioned image feature extraction network 110 does not participate in training, multiple trained convolutional classification head networks can be merged together and share a backbone network to construct a multi-classification model. This construction method greatly reduces the deployment resource cost. Figure 6 The structure of the multi-classification model described in the embodiment of the present disclosure is shown. Figure 6 As shown, the convolution classification head network 130 connected to the feature fusion network 120 may include multiple convolution classification head networks, each of which corresponds to a classification task, thereby forming a multi-classification model to achieve multi-classification tasks.

[0068] It can be seen that in the multi-scale perception model based on the converter model provided in the embodiment of the present disclosure, on the one hand, its convolutional classification head network 130 adopts a convolutional structure, so it has a strong perception ability for local information of the image; on the other hand, its image feature extraction network 110 adopts a converter model structure, so it has a strong global inductive modeling ability. Therefore, the multi-scale perception model based on the converter model provided in the embodiment of the present disclosure can simultaneously have the ability to summarize global information and the perception ability of local information by combining the backbone network of the converter model and the convolutional head network, so that multi-scale target recognition can be achieved, and it has good recognition performance for targets with larger or smaller scales, and it also has a good recognition effect for targets with larger scale changes. Moreover, the self-attention mechanism of the converter model can capture information in a global range and better obtain the long-distance dependency between Patch Tokens. In particular, in the embodiments of the present invention, Patch Token is used instead of selecting another output classification token (Class Token) of the encoder for downstream classification tasks. This is because Patch Token still retains the location information of image features to a certain extent, and it is similar to the feature map extracted by the convolutional neural backbone network. A classification head network with a convolutional structure can be further selected during classification. By performing operations on the features through small-scale convolution kernels, local features of the image can be captured more effectively.

[0069] In addition, the above-mentioned image feature extraction network 110 can be implemented through a pre-trained ViT network or other pre-trained networks based on transformer models, so it has strong generalization capabilities. Moreover, since the above-mentioned image feature extraction network 110 does not participate in training, in the embodiments of the present disclosure, both the training cost and the iteration cost of the model are very low. Experiments have confirmed that the training of the above-mentioned multi-scale perception model greatly reduces the requirements for the amount of positive example data, and the training can be completed with dozens of positive examples, and it is not easy to have overfitting problems. Compared with training a classification model from scratch, the speed of model training can be increased by more than 20 times.

[0070] Based on the above-mentioned multi-scale perception model based on the converter model, an embodiment of the present disclosure also discloses a target recognition method. Figure 7 The implementation process of the target recognition method described in the embodiment of the present disclosure is shown. Figure 7 As shown, the above target recognition method may include:

[0071] In step 710, multiple Patch Token sequences corresponding to the input image to be recognized are extracted;

[0072] In step 720, the plurality of Patch Token sequences are merged to obtain a merged target Patch Token sequence; and

[0073] In step 730, target recognition is performed on the target Patch Token sequence to obtain at least one target object in the image to be recognized and its corresponding recognition result.

[0074] In an embodiment of the present disclosure, the above-mentioned multiple Patch Token sequences are respectively output by the multi-level stacked attention modules constituting the encoder in the above-mentioned image extraction network.

[0075] In an embodiment of the present disclosure, the above step 710 may specifically include: first, dividing the image to be identified into multiple Patches; second, linearly mapping the above multiple Patches respectively to obtain the Embeddings corresponding to the above multiple Patches; finally, encoding the Embeddings corresponding to the above multiple Patches respectively by the above multi-level attention module to obtain the above multiple Patch Token sequences.

[0076] In practical applications, the above step 710 can be implemented by a pre-trained ViT model or other pre-trained Transformer-based image classification models.

[0077] In some embodiments of the present disclosure, the above step 720 may specifically include: fusing the above multiple Patch Token sequences in an addition manner to obtain a fused target Patch Token sequence.

[0078] In some other embodiments of the present disclosure, the above step 720 may specifically include: fusing the above multiple Patch Token sequences by means of feature dimension splicing to obtain a fused target Patch Token sequence.

[0079] In some other embodiments of the present disclosure, the above step 720 may specifically include: first selecting multiple candidate Patch Token sequences from the above multiple Patch Token sequences, and then fusing the selected candidate Patch Token sequences to obtain a fused target Patch Token sequence.

[0080] Specifically, in the process of selecting candidate Patch Token sequences, multiple factors such as the number of attention modules and the level of the attention modules can be considered. For example, considering that the Patch Token sequence output by the attention module at the middle level contains more intuitive shallow semantic information, it is possible to consider starting from the Patch Token sequence output by the attention module at a certain middle level, and selecting the Patch Token sequence output by the attention module at the last level as the above-mentioned candidate Patch Token sequence. For another example, multiple candidate Patch Token sequences can also be selected from the above-mentioned multiple Patch Token sequences according to pre-set selection rules, such as selecting at certain intervals, etc. It should be noted that the embodiments of the present disclosure do not limit the selection method of the candidate Patch Token sequence.

[0081] In an embodiment of the present disclosure, the above step 730 can be implemented by a convolutional classification head network. The above convolutional classification head network may include: a classification network formed by stacking multiple convolutional modules and a fully connected layer. The above classification network formed by stacking multiple convolutional modules can be implemented in a variety of ways, for example, it can be implemented by a residual network composed of multiple ResidualBlocks, or it can be implemented by a dense network composed of multiple Dense Blocks, etc. The above convolutional classification head network can be trained based on the error between the target recognition result of the image in the sample data and the annotation result of the corresponding image.

[0082] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the target recognition method described in any of the above embodiments is implemented.

[0083] Figure 8 A more specific hardware structure diagram of an electronic device provided in this embodiment is shown, and the device may include: a processor 2010, a memory 2020, an input / output interface 2030, a communication interface 2040, and a bus 2050. The processor 2010, the memory 2020, the input / output interface 2030, and the communication interface 2040 are connected to each other in communication within the device through the bus 2050.

[0084] The processor 2010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0085] The memory 2020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 2020 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 2020 and are called and executed by the processor 2010.

[0086] The input / output interface 2030 is used to connect input / output devices to realize information input and output. The input / output devices can be configured in the device as components, or can be externally connected to the device to provide corresponding functions. The input devices can include microphones, various sensors, etc., and the output devices can include displays, speakers, vibrators, indicator lights, etc.

[0087] The communication interface 2040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0088] The bus 2050 includes a path that transmits information between the various components of the device (eg, the processor 2010, the memory 2020, the input / output interface 2030, and the communication interface 2040).

[0089] It should be noted that, although the above device only shows the processor 2010, the memory 2020, the input / output interface 2030, the communication interface 2040, and the bus 2050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0090] The electronic device of the above embodiment is used to implement the corresponding target recognition method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0091] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the target recognition method described in any of the above embodiments.

[0092] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0093] The computer instructions stored in the storage medium of the above embodiments are used to enable the computer to execute the task processing method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0094] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Based on the concept of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of simplicity.

[0095] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present disclosure difficult to understand, the known power / ground connections to the integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present disclosure difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure will be implemented (that is, these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it is apparent to those skilled in the art that the embodiments of the present disclosure can be implemented without these specific details or with changes in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0096] Although the present disclosure has been described in conjunction with specific embodiments of the present disclosure, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0097] The embodiments of the present disclosure are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present disclosure should be included in the scope of protection of the present disclosure.

Claims

1. A multi-scale perception model based on a converter model, comprising: An image feature extraction network, comprising: an encoder formed by stacking multi-level attention modules, configured to output a plurality of image block token Patch Token sequences extracted by the multi-level attention modules based on an input image to be recognized; A feature fusion network, used for fusing the multiple image block token sequences to obtain a fused target image block token sequence; and At least one convolutional classification head network is used to perform target recognition on the target image block token sequence to obtain at least one target object in the image to be recognized and its corresponding recognition result.

2. The multi-scale perception model based on the transformer model according to claim 1, wherein: The image feature extraction network comprises: An image segmentation module, used for segmenting the image to be identified into a plurality of image blocks; A linear mapping module, used to perform linear mapping on the multiple image blocks respectively to obtain feature vectors Embedding corresponding to the multiple image blocks; and The encoder includes a multi-level stacked attention module, which is used to encode the feature vectors corresponding to the multiple image blocks, and obtain the image block token sequences extracted by each attention module in the multi-level attention module.

3. The multi-scale perception model based on the transformer model according to claim 1 or 2, wherein: The image feature extraction network is implemented through a pre-trained transformer-based image classification model.

4. The multi-scale perception model based on the transformer model according to claim 1, wherein: The feature fusion network is used to fuse the multiple image block token sequences by adding or by splicing feature dimensions.

5. The multi-scale perception model based on the transformer model according to claim 1, wherein: The feature fusion network includes: an image block token sequence selection module, configured to select a candidate image block token sequence from the plurality of image block token sequences; and The fusion module is used to fuse the selected candidate image block token sequences to obtain the target image block token sequence.

6. The multi-scale perception model based on the transformer model according to claim 1, wherein: The convolution classification head network includes: a classification network formed by stacking multiple convolution modules; and a fully connected layer.

7. The multi-scale perception model based on the transformer model according to claim 6, wherein: The convolution module is a residual block; or, the convolution module is a dense block.

8. A target recognition method, comprising: Extracting multiple image block token sequences corresponding to the input image to be recognized; Fusing the multiple image block token sequences to obtain a fused target image block token sequence; as well as Target recognition is performed on the target image block token sequence to obtain at least one target object in the image to be recognized and its corresponding recognition result.

9. The target recognition method according to claim 8, wherein: Extracting a plurality of image block tokens corresponding to the input image to be recognized The image block token sequence includes: The image to be identified is segmented into a plurality of image blocks based on an image segmentation module of a pre-trained converter-based image classification model; Based on a pre-trained linear mapping module of a converter-based image classification model, linear mapping is performed on the plurality of image blocks respectively to obtain feature vectors corresponding to the plurality of image blocks; and An encoder based on a pre-trained converter-based image classification model encodes feature vectors corresponding to the multiple image blocks using multi-level stacked attention modules to obtain image block token sequences extracted by each attention module in the multi-level attention modules.

10. The target recognition method according to claim 8, wherein: The fusing of the multiple image block token sequences includes: fusing the multiple image block token sequences by adding them together or fusing the multiple image block token sequences by splicing them in feature dimensions.

11. The target recognition method according to claim 8, wherein: Fusing the plurality of image block token sequences comprises: selecting a candidate image block token sequence from the plurality of image block token sequences; and The selected candidate image block token sequences are fused to obtain the target image block token sequence.

12. The target recognition method according to claim 11, wherein: Fusing the selected candidate image block token sequences includes: fusing the multiple candidate image block token sequences by adding them together or fusing the multiple candidate image block token sequences by splicing them in feature dimensions.

13. The target recognition method according to claim 8, wherein: Performing target recognition on the target image block token sequence includes: performing target recognition on the target image block token sequence based on a convolutional classification head network; wherein the convolutional classification head network includes: a classification network formed by stacking multiple convolutional modules; and a fully connected layer.

14. An electronic device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the target recognition method according to any one of claims 8 to 13 is implemented.

15. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the target recognition method according to any one of claims 8 to 13.

16. A computer program product, comprising computer program instructions, which, when executed on a computer, enable the computer to execute the target recognition method according to any one of claims 8 to 13.

Citation Information

Patent Citations

  • Target detection method and device, equipment, medium and product

    CN114283281A

  • Token recombination model-based shallow-deep feature fusion method and system

    CN116958765A

  • Image classification method and system, electronic equipment and storage medium

    CN117333719A

  • Monocular self-supervision depth estimation method and system for laparoscope video image

    CN117876453A

  • Low-light image enhancement method and system based on global-local illumination perception

    CN118195947A