Image recognition method and device and electronic equipment

By connecting multiple grouped convolutional units in series and fusing feature vector processing, the problem of balancing the amount of computation and accuracy in copy image recognition is solved, and efficient copy image recognition is achieved.

CN120673418APending Publication Date: 2025-09-19CHINA TELECOM BESTPAY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510702328.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-28
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing technologies have difficulty balancing computational complexity and accuracy when recognizing copied images. Methods based on texture and optical properties have fast computational speeds but low stability, while methods based on deep learning have high computational overhead and are difficult to calculate efficiently on CPUs or mobile phones.

Method used

The image is processed by connecting multiple grouped convolutional units in series, gradually increasing the number of channels of the feature map, and determining the probability that the image is a copy by fusing feature vectors, thereby reducing calculation time and improving recognition efficiency.

Benefits of technology

While ensuring recognition accuracy, it reduces the amount of calculation, improves the efficiency and accuracy of copy image recognition, and is suitable for deployment on different devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120673418A_ABST
    Figure CN120673418A_ABST
Patent Text Reader

Abstract

The invention discloses an image recognition method and device and electronic equipment. The method comprises the following steps: acquiring a to-be-recognized image; according to the to-be-recognized image, a fusion feature map is determined, and the fusion feature map comprises features representing copying features; inputting the fused feature map into the first group convolution unit in the plurality of group convolution units, and inputting the corresponding output into the next group convolution unit until the plurality of group convolution units are processed, thereby obtaining a plurality of multi-channel feature maps; and determining the probability that the to-be-recognized image is a duplicated image according to the plurality of multi-channel feature maps. According to the invention, a technical problem that it is difficult to balance the calculation amount and the accuracy when whether the to-be-recognized image is a copied image is recognized in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing, and in particular to an image recognition method, device and electronic equipment. Background Art

[0002] Currently, the following technologies are commonly used for photocopy recognition: Image texture analysis: This method determines whether an image is a photocopy by analyzing its texture characteristics. Photocopies often have different texture patterns than the original, for example due to the scanning process of the copier and the quality of the paper.

[0003] Common texture analysis methods include local binary patterns (LBP) and gray-level co-occurrence matrices (GLCMs). Optical feature analysis: Photocopied photos typically produce optical features that differ from those of the original. These features can be determined by analyzing aspects of the image, such as brightness, contrast, color saturation, and hue. For example, photocopied photos may exhibit background flare, blur, or distortion. In recent years, deep learning techniques such as convolutional neural networks (CNNs) have made significant progress in image recognition. By training on large image datasets, deep learning models can learn the differences between photocopied and original photos and accurately classify and recognize them.

[0004] Among the aforementioned methods, analysis methods based on texture and optical properties offer relatively fast computational speeds but lack stability. In practical applications, their accuracy and recall rates are low, failing to meet industrial needs. Deep learning-based methods, on the other hand, are computationally expensive, require long inference times, and place high demands on server performance. They cannot achieve efficient computation on CPUs or mobile phones, and their lightweight architectures compromise accuracy and recall.

[0005] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention

[0006] Embodiments of the present invention provide an image recognition method, apparatus, and electronic device to at least solve the technical problem in related arts of difficulty in balancing computational complexity and accuracy when identifying whether an image to be identified is a photocopied image.

[0007] According to one aspect of an embodiment of the present invention, there is provided an image recognition method, comprising: acquiring an image to be recognized; determining a fused feature map based on the image to be recognized, wherein the fused feature map includes features representing characteristics of a copy; inputting the fused feature map into a first grouped convolution unit among a plurality of grouped convolution units, and inputting the corresponding output into a next grouped convolution unit until the plurality of grouped convolution units are processed, thereby obtaining a plurality of multi-channel feature maps, wherein the plurality of grouped convolution units are connected in series, and the plurality of grouped convolution units are used to increase the number of channels of the corresponding feature maps to a corresponding predetermined number of channels, and the plurality of multi-channel feature maps are feature maps obtained after the plurality of grouped convolution units are respectively processed; and determining the probability that the image to be recognized is a copy image based on the plurality of multi-channel feature maps.

[0008] Optionally, determining a fused feature map based on the image to be identified includes: determining single-channel feature maps corresponding to the image to be identified under multiple channels, wherein the corresponding single-channel feature maps are obtained by processing corresponding convolution kernels; and obtaining a fused feature map based on multiple single-channel feature maps, wherein the number of output channels of the fused feature map is greater than the number of the multiple channels.

[0009] Optionally, determining the probability that the image to be identified is a copy image based on the multiple multi-channel feature maps includes: determining a fused feature vector based on the multiple multi-channel feature maps; and determining the probability that the image to be identified is a copy image based on the fused feature vector.

[0010] Optionally, determining a fused feature vector based on the multiple multi-channel feature maps includes: performing a stretching operation on the multiple multi-channel feature maps respectively to obtain multiple groups of one-dimensional vectors, wherein the multiple multi-channel feature maps correspond one-to-one to the multiple groups of one-dimensional vectors; obtaining an initial fused feature vector based on the multiple groups of one-dimensional vectors; and obtaining the fused feature vector based on the initial fused feature vector and the weight corresponding to the initial fused feature vector.

[0011] Optionally, obtaining the fused feature vector based on the initial fused feature vector and the weight corresponding to the initial fused feature vector includes: obtaining a weighted feature vector based on the initial fused feature vector and the weight corresponding to the initial fused feature vector; and performing scale compensation on the weighted feature vector to obtain the fused feature vector.

[0012] Optionally, based on the fused feature vector, determining the probability that the image to be identified is a copy image includes: obtaining a connection vector based on the fused feature vector; regularizing the connection vector to obtain a regularized processing vector; and inputting the regularized processing vector into an activation function layer to obtain the probability.

[0013] Optionally, determining a fused feature map based on the image to be identified includes: normalizing the image to be identified to obtain a matrix to be identified; and obtaining a fused feature map based on the matrix to be identified.

[0014] According to one aspect of an embodiment of the present invention, there is provided an image recognition device, comprising: an acquisition module for acquiring an image to be recognized; a first determination module for determining a fused feature map based on the image to be recognized, wherein the fused feature map includes features representing characteristics of a copy; a second determination module for inputting the fused feature map into a first grouped convolution unit among a plurality of grouped convolution units, and inputting the corresponding output into a next grouped convolution unit until the plurality of grouped convolution units are processed to obtain a plurality of multi-channel feature maps, wherein the plurality of grouped convolution units are connected in series, and the plurality of grouped convolution units are used to increase the number of channels of the corresponding feature maps to a corresponding predetermined number of channels, and the plurality of multi-channel feature maps are feature maps obtained after the plurality of grouped convolution units are respectively processed; and a third determination module for determining the probability that the image to be recognized is a copy image based on the plurality of multi-channel feature maps.

[0015] According to one aspect of an embodiment of the present invention, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the image recognition method as described in any one of the above items.

[0016] According to one aspect of an embodiment of the present invention, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform any of the image recognition methods described above.

[0017] In an embodiment of the present invention, an image to be identified is obtained. Based on the image to be identified, a fused feature map is determined, wherein the fused feature map includes features representing copy characteristics. The fused feature map is input into the first grouped convolution unit among a plurality of grouped convolution units, and the corresponding output is input into the next grouped convolution unit until the plurality of grouped convolution units are processed, thereby obtaining a plurality of multi-channel feature maps, wherein the plurality of grouped convolution units are connected in series, and the plurality of grouped convolution units are used to increase the number of channels of the corresponding feature map to the corresponding predetermined number of channels, and the plurality of multi-channel feature maps are feature maps obtained after the plurality of grouped convolution units are processed separately. Based on the plurality of multi-channel feature maps, the probability that the image to be identified is a copy image is determined. It can be seen that the original convolution unit is divided into multiple convolution units, which are processed in sequence, which disperses the computational complexity of each calculation and reduces the computation time. In addition, in the subsequent probability recognition, multiple multi-channel feature maps are used, that is, the feature maps generated by each convolution unit are used, which fully considers the features generated by convolutions at different levels. While ensuring accuracy, it can reduce the computational complexity and improve recognition efficiency, thereby solving the technical problem in related technologies of balancing the computational complexity and accuracy when identifying whether the image to be identified is a copy image. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0019] Figure 1 is a flowchart of an image recognition method according to an embodiment of the present invention;

[0020] Figure 2 is a flow chart of a photocopy recognition method based on group convolution provided in an optional embodiment of the present invention;

[0021] Figure 3 This is a flowchart of an image loading initialization module provided in an optional embodiment of the present invention;

[0022] Figure 4 is a flow chart of a feature fusion module based on an adaptive gating unit provided in an optional embodiment of the present invention;

[0023] Figure 5 is a flow chart of a channel promotion module provided in an optional embodiment of the present invention;

[0024] Figure 6 is a flow chart of a group convolution module based on adaptive gating provided in an optional embodiment of the present invention;

[0025] Figure 7is a flow chart based on an adaptive gating unit provided in an optional embodiment of the present invention;

[0026] Figure 8 is a flow chart of a feature fusion module provided in an optional embodiment of the present invention;

[0027] Figure 9 is a flow chart of an output module provided in an optional embodiment of the present invention;

[0028] Figure 10 is a structural block diagram of an image recognition device according to an embodiment of the present invention. DETAILED DESCRIPTION

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

[0030] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention 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 numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes 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.

[0031] Example 1

[0032] According to an embodiment of the present invention, an embodiment of an image recognition method 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.

[0033] Figure 1 is a flow chart of an image recognition method according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps:

[0034] Step S102, obtaining an image to be recognized;

[0035] In step S102 provided in this application, an image to be identified is obtained.

[0036] Among them, it involves images to be identified, which can come from a variety of data sources, including but not limited to file systems (such as image files read from a hard disk or storage device), networks (such as images downloaded from web pages, databases or servers), real-time streams from cameras (such as images captured by surveillance cameras or mobile phone cameras), or simulated images (such as images generated in computer graphics).

[0037] The image to be recognized is an image to be recognized as a copy image.

[0038] Step S104, determining a fused feature map based on the image to be recognized, wherein the fused feature map includes features representing copy characteristics;

[0039] In step S104 provided in the present application, a fusion feature map is determined based on the image to be identified.

[0040] This involves fused feature maps. In deep learning image recognition tasks, fused feature maps combine feature maps extracted by different layers of neural networks to form a feature map that contains more layers of information and a more comprehensive description. These feature maps can come from both shallow and deep layers of the neural network. Shallow feature maps typically contain low-level image information such as edges, texture, and color, while deep feature maps contain higher-level semantic information and abstract features.

[0041] The fused feature map includes features that represent photocopy characteristics. These features are key attributes or patterns extracted from images using a deep learning model that indicate whether an image is a photocopy. Photocopies typically have specific visual characteristics, such as background paper texture, sharp edges, image blur, and color distortion. The model learns and identifies these features to determine whether an input image is a photocopy.

[0042] The fused feature map contains multi-scale information and can more comprehensively describe the image, thus helping to improve the accuracy of photocopy recognition. Shallow features provide a keen perception of image details, while deep features provide an understanding of global structure. This combination can capture the unique patterns of photocopies.

[0043] Step S106: input the fused feature map into the first grouped convolution unit of the multiple grouped convolution units, and input the corresponding output into the next grouped convolution unit until the multiple grouped convolution units are processed, thereby obtaining multiple multi-channel feature maps, wherein the multiple grouped convolution units are connected in series, and the multiple grouped convolution units are used to increase the number of channels of the corresponding feature map to the corresponding predetermined number of channels. The multiple multi-channel feature maps are feature maps obtained after the multiple grouped convolution units are processed separately;

[0044] In step S106 provided in the present application, a plurality of multi-channel feature maps are obtained based on the fused feature map.

[0045] This involves the grouped convolution unit, an optimization technique in convolutional neural networks (CNNs). It divides the channels of the input feature map into several groups, performs a convolution operation on each group using an independent convolution kernel, and then combines the results of all groups. This technique can reduce the amount of computation while maintaining the expressiveness of the model. The grouped convolution unit consists of one or more grouped convolution layers and may also contain other layers such as batch normalization and activation function layers to further process and optimize the feature map.

[0046] This involves serial connections. In neural networks, serial connections (also called sequential connections) mean that the output of one layer or unit directly serves as the input of the next layer or unit. In this sentence, multiple grouped convolutional units are constructed by serial connections, which means that the output of each grouped convolutional unit directly serves as the input of the next grouped convolutional unit, forming a continuous processing flow.

[0047] This involves increasing the number of channels in the corresponding feature map to the corresponding predetermined number of channels. In a neural network, the number of channels in a feature map represents the number of dimensions representing different features in the feature map. Grouped convolutional units can selectively increase the number of channels in a feature map. This is usually done to enhance the model's feature expression capabilities, enabling it to capture more complex image characteristics. The predetermined number of channels refers to the target number of channels preset during network design or training, and each grouped convolutional unit may have a different predetermined number of channels.

[0048] Multiple multi-channel feature maps are involved. The feature maps obtained after each grouped convolution unit is considered multi-channel feature maps because they usually have multiple channels, each channel representing a certain feature or attribute of the image. Multiple multi-channel feature maps mean that the entire processing flow will produce a series of such feature maps, each representing a different level of feature expression.

[0049] This example illustrates how, during photocopy recognition, a fused feature map is processed through a series of grouped convolutional units to generate a multi-channel feature map. Starting with the input of the fused feature map to the first grouped convolutional unit, the feature map generated by each unit serves as the input to the next unit until all units are processed. This process ensures feature continuity and integrity, allowing the resulting multi-channel feature maps to fully reflect the characteristics of multiple layers of the image.

[0050] Since grouped convolution can significantly reduce the amount of computation, as the convolution operation of each group is independent of other groups, this parallel processing method can leverage the parallel computing capabilities of modern processors to accelerate the feature extraction process. Moreover, by gradually increasing the number of channels in the feature map, the grouped convolution units at each stage can focus on extracting specific aspects of the image. The resulting multi-channel feature map contains rich details and abstract information, which helps the model more accurately identify photocopies. Although the number of channels in the feature map is increased, the design of grouped convolution keeps the overall number of parameters and computational complexity of the model under control, preventing the model from being too bloated and ensuring its deployability and efficiency on different devices.

[0051] It should be noted that in order to further improve the recognition ability and efficiency of the model, skip connections can be added between grouped convolutional units, allowing the network to directly transfer features from certain levels to subsequent units, thereby avoiding information loss and accelerating the model training process. Skip connections are a key component in deep learning architectures such as residual networks (ResNet). They can help the model learn deeper features while avoiding the gradient vanishing problem and improving the stability of the model. In addition, it is possible to consider using a Squeeze-and-Excitation (SE) module after each grouped convolutional unit. The SE module can model the importance of features between channels. By adaptively reweighting each channel of the input feature map, the SE module can enhance the model's response to key features while reducing the interference of irrelevant features, thereby improving the accuracy of photocopy recognition.

[0052] Step S108 : determining the probability that the image to be identified is a copy image based on the plurality of multi-channel feature maps.

[0053] In step S108 provided in this application, a process of determining the probability that the image to be identified is a copy image based on multiple multi-channel feature maps is described.

[0054] The probability that the image to be identified is a photocopy is determined. In deep learning classification tasks, the model typically outputs a probability distribution, representing the probability that the input image belongs to each category. In the context of photocopy image recognition, the probability of a photocopy refers to the likelihood that the model determines the input image belongs to the photocopy category. This probability value ranges between 0 and 1, with values ​​closer to 1 indicating a higher likelihood that the model believes the image is a photocopy.

[0055] This step determines the probability of the image being identified as a copy using the previously extracted multi-channel feature maps. Optionally, these feature maps are fed into the model's final classification layer, which can be a fully connected layer. This layer, combined with an activation function such as the softmax function or the sigmoid function, converts the feature maps into a probability distribution, outputting the probability that the image being identified is a copy.

[0056] By integrating multiple multi-channel feature maps, the model can integrate multi-level and multi-angle information from the image. This comprehensive analysis enables the model to more comprehensively understand the image, improving the accuracy and robustness of photocopy image recognition. Because each feature map provides a unique perspective, the model can learn the various differences between photocopied and non-photocopied images during training. This helps the model make accurate judgments even when faced with unseen images, enhancing the model's generalization ability. The output probability value provides a quantitative basis for decision-making, allowing the system or user to take appropriate actions based on the probability. For example, setting a threshold. When the probability exceeds this threshold, the image can be automatically marked as a photocopy or further manual review can be performed, thereby improving the reliability and efficiency of the decision-making process.

[0057] Through the above steps S102-S108, the image to be identified is obtained. Based on the image to be identified, a fused feature map is determined, wherein the fused feature map includes features representing the characteristics of a copy. The fused feature map is input into the first grouped convolution unit among the multiple grouped convolution units, and the corresponding output is input into the next grouped convolution unit until the multiple grouped convolution units are processed, thereby obtaining multiple multi-channel feature maps, wherein the multiple grouped convolution units are connected in series, and the multiple grouped convolution units are used to increase the number of channels of the corresponding feature map to the corresponding predetermined number of channels, and the multiple multi-channel feature maps are feature maps obtained after the multiple grouped convolution units have completed processing respectively. Based on the multiple multi-channel feature maps, the probability that the image to be identified is a copy image is determined. It can be seen that the original convolution unit is divided into multiple convolution units, which are processed in sequence, which disperses the computational complexity of each calculation and reduces the computation time. In addition, in the subsequent probability recognition, multiple multi-channel feature maps are used, that is, the feature maps generated by each convolution unit are used, which fully considers the features generated by convolutions at different levels. While ensuring accuracy, it can reduce the computational complexity and improve recognition efficiency, thereby solving the technical problem in related technologies of balancing the computational complexity and accuracy when identifying whether the image to be identified is a copy image.

[0058] As an optional embodiment, determining a fused feature map based on the image to be identified includes: determining single-channel feature maps corresponding to the image to be identified under multiple channels, wherein the corresponding single-channel feature maps are obtained by processing corresponding convolution kernels; obtaining a fused feature map based on the multiple single-channel feature maps, wherein the number of output channels of the fused feature map is greater than the number of multiple channels.

[0059] In this embodiment, the process of determining the fused feature map is described.

[0060] This involves single-channel feature maps. In deep learning, especially convolutional neural networks (CNNs), feature maps are the result of a convolutional layer performing a convolution operation on an input image or a feature map from a previous layer. A single-channel feature map is a feature map obtained by processing an input image using a specific convolution kernel. It typically contains only one channel, and the value of each pixel represents the strength of a specific feature at that location. These features may be edges, textures, colors, etc.

[0061] This involves convolution kernels (filters), the basic components of convolutional neural networks, used to extract features from input images or feature maps. A convolution kernel is typically a small two-dimensional matrix that slides over the input image or feature map and generates a new feature map by performing a dot product and sum operation with each local region. Each convolution kernel may focus on extracting different types of features.

[0062] The number of output channels is limited to being greater than the number of channels. In convolutional neural networks, the number of channels usually refers to the depth or third dimension of a feature map (in addition to the two dimensions of width and height). In this context, this means that the depth (i.e., the number of channels) of the fused feature map is greater than the total number of channels in the original input image or single-channel feature map. The purpose of increasing the number of channels is to enhance the model's feature representation capabilities, allowing the model to capture more complex and diverse image features.

[0063] This fused feature map not only contains various detailed information of the original image, but may also introduce higher-level feature expressions through convolution operations, such as texture, shape or structural information. Through convolution kernel processing, key features in the image, such as edges, textures, etc., can be enhanced. These features are crucial for determining whether the image is a copy. The fused feature map aggregates the information of multiple single-channel feature maps, which enables the model to consider both shallow and deep features of the image at the same time, thereby enhancing the ability to identify copied images. The number of output channels of the fused feature map is greater than the number of multiple channels, which means that the model can learn a wider variety of image features, which helps to improve the accuracy of copy image recognition, especially when dealing with complex or diverse images.

[0064] As an optional embodiment, determining the probability that the image to be identified is a copy image based on multiple multi-channel feature maps includes: determining a fused feature vector based on the multiple multi-channel feature maps; and determining the probability that the image to be identified is a copy image based on the fused feature vector.

[0065] In this embodiment, the process of determining the probability is explained.

[0066] This involves fusion of feature vectors, which integrates the information from multiple multi-channel feature maps into a single vector representation. This integration can be achieved through "pooling" (such as average pooling and max pooling) and "flattening" (converting a multidimensional array into a one-dimensional vector). The purpose of fusion of feature vectors is to simplify the complex feature representation of the image into a compact numerical sequence, which facilitates further processing and decision-making.

[0067] The fused feature vector integrates multiple layers of image features, including low-level visual features (such as edges and textures) and high-level semantic features (such as the overall structure and pattern of the image). This comprehensive representation enables the model to understand images at different levels and dimensions, improving the accuracy and robustness of photocopy image recognition. By integrating information from multiple multi-channel feature maps, the model is able to learn more diverse image patterns during training, especially when dealing with photocopy images of various qualities or different types. This helps improve the model's generalization ability when faced with unseen images.

[0068] As an optional embodiment, a fused feature vector is determined based on multiple multi-channel feature maps, including: stretching the multiple multi-channel feature maps separately to obtain multiple groups of one-dimensional vectors, wherein the multiple multi-channel feature maps correspond one-to-one to the multiple groups of one-dimensional vectors; obtaining an initial fused feature vector based on the multiple groups of one-dimensional vectors; and obtaining a fused feature vector based on the initial fused feature vector and the weight corresponding to the initial fused feature vector.

[0069] In this embodiment, a process of extracting feature information from multiple multi-channel feature maps and obtaining a comprehensive fused feature vector through a specific weighted fusion method is described in photocopy recognition.

[0070] This involves a stretching operation, which converts a two-dimensional or multi-dimensional data structure into a one-dimensional vector. In this context, it refers to sequentially arranging the multi-channel values ​​of each pixel in a multi-channel feature map into a long vector. This is done to convert the feature map into a format suitable for processing by a fully connected layer, facilitating further feature fusion and classification.

[0071] This involves multiple sets of one-dimensional vectors. Through the above-mentioned stretching operation, a set of one-dimensional vectors is extracted from each multi-channel feature map, that is, each feature map corresponds to a set of one-dimensional vectors. These vectors contain all the numerical information contained in the feature map and are used for subsequent fusion and classification processes.

[0072] This involves the initial fused feature vector, which is the result of a preliminary integration of multiple sets of one-dimensional vectors. This is usually done without considering weights, through simple operations such as concatenation, to merge all one-dimensional vectors into a single vector. This vector contains information from all feature maps, but may not optimize the relative importance of features.

[0073] This involves weights, which refer to the importance or influence of each feature vector (or feature map) in the final fused feature vector. Through learning or design, weights can reflect the contribution of different feature maps to the recognition task, allowing the model to more effectively utilize these features during processing.

[0074] In this step, multiple multi-channel feature maps are converted into multiple sets of one-dimensional vectors through a stretching operation, facilitating subsequent feature integration and ensuring that the model fully utilizes the multi-level information of the image. Based on the initial fused feature vector, further fusion is performed by taking weights into account. This ensures that the model's final decision focuses on features that are more critical for identifying photocopies, thereby improving classification accuracy and robustness. The weights reflect the importance of each feature layer, enabling the model to optimize resource allocation during inference, reduce computation on irrelevant features, and improve recognition efficiency.

[0075] As an optional embodiment, a fused feature vector is obtained based on the initial fused feature vector and the weight corresponding to the initial fused feature vector, including: obtaining a weighted feature vector based on the initial fused feature vector and the weight corresponding to the initial fused feature vector; and performing scale compensation on the weighted feature vector to obtain a fused feature vector.

[0076] In this embodiment, the process of determining a fused feature vector is described.

[0077] This involves the initial fused feature vector. In deep learning, especially image recognition tasks, this term refers to the initial merging of multiple feature vectors extracted from an image (usually from different convolutional layers or feature extraction modules) into a single vector. This vector contains information from multiple levels and angles of the image, but the relative importance of each feature is not considered during the merging process, so it is called the "initial" fused feature vector.

[0078] This involves weighting feature vectors. By multiplying the initial fused feature vector by the corresponding weights, a new vector with adjusted feature importance is obtained. This operation allows the model to place greater emphasis on features that are more critical to copy image recognition in subsequent processing, while reducing the influence of unimportant features.

[0079] This involves scale compensation, a process used to maintain a reasonable numerical range and distribution of feature vectors or model outputs after weighting, scaling, and other operations. During the generation of weighted feature vectors, since the weight product may change the numerical range or distribution of features, scale compensation is necessary to ensure that the weighted feature vectors do not affect model performance due to excessively large or small values ​​in subsequent processing.

[0080] By assigning weights, the model automatically identifies and strengthens features critical for copy image recognition, reducing reliance on less important features and thus improving recognition accuracy. A scale compensation step ensures the stability of the weighted feature vectors within their numerical range, avoiding model instability caused by oversaturated or undersized values, thereby enhancing the model's predictive power and robustness. This weighting mechanism allows the model to prioritize highly important features even with limited computing resources, thereby ensuring recognition accuracy while reducing computational overhead and improving overall efficiency.

[0081] As an optional embodiment, the probability that the image to be identified is a photocopied image is determined based on the fused feature vector, including: obtaining a connection vector based on the fused feature vector; regularizing the connection vector to obtain a regularized processing vector; and inputting the regularized processing vector into an activation function layer to obtain a probability.

[0082] In this embodiment, the process of determining the probability is explained.

[0083] Among them, the connection vector is involved: a connection vector usually refers to a new vector obtained by concatenating the dimensions of multiple vectors or matrices. In copy image recognition, the connection vector may refer to the vector obtained by concatenating the fused feature vector with additional information (such as image metadata, location information, timestamp, etc.) after certain processing. However, depending on the context, the connection vector here is more likely to be the fused feature vector directly used as the input for the next step of processing, because the fused feature vector is usually already a vector that integrates information from multiple feature maps.

[0084] This involves regularization, a common technique in deep learning and machine learning to prevent overfitting. By adding regularization terms to the model training process, the size or complexity of the model parameters can be limited, making the model more likely to find simpler solutions with greater generalization capabilities during learning. Regularizing the vectors involves regularizing the connection vectors before inputting them into the activation function layer. This reduces the model's over-reliance on specific data points and improves its generalization capabilities.

[0085] This involves regularized vectors, which refer to connection vectors that have undergone regularization. The purpose of regularization is to reduce the complexity of model parameters and prevent the model from overfitting to the training data during training, thereby improving the model's generalization ability.

[0086] This involves the activation function layer: a key component in deep learning models, it introduces nonlinear characteristics, enabling the model to learn more complex patterns. Common activation functions include the rectified linear unit (ReLU) and the hyperbolic tangent function (tanh). In copy image recognition, the activation function layer is typically used as the output layer to convert the regularized processing vector into probability values. Common choices are the Sigmoid or Softmax functions, which convert the elements of the vector into probabilities between 0 and 1.

[0087] The above steps illustrate how, starting with the fused feature vector, regularization and activation function processing are used to ultimately determine the probability of whether the image to be identified is a photocopy. Specifically, the fused feature vector is first input as the concatenated vector to the next layer of the model. Regularization then reduces model complexity and prevents overfitting. While regularization is commonly performed by adding a regularization term to the loss function, such as sparsity regularization L1 or weight decay regularization L2, the description of this step more often implies some form of normalization of the vector itself, such as data normalization, to ensure that the vector's values ​​remain within a reasonable range before being processed by the activation function layer. The regularized vector is then input to the activation function layer, such as the sigmoid function, which converts each element of the vector into a probability of belonging to the photocopy class. The activation function layer normalizes the model output, transforming the model's complex linear combinations into easily understandable and interpretable output probabilities, facilitating subsequent decision-making or further analysis.

[0088] Regularization helps the model learn more general features, reducing its reliance on specific training data. This allows the model to make more accurate predictions when faced with unseen photocopied images. The activation function layer introduces nonlinearity, enabling the model to learn and express more complex image features and classification boundaries, which is crucial for distinguishing photocopied and non-photocopied images.

[0089] As an optional embodiment, determining a fusion feature map based on the image to be identified includes: normalizing the image to be identified to obtain a matrix to be identified; and obtaining a fusion feature map based on the matrix to be identified.

[0090] In this embodiment, a fused feature map is determined.

[0091] Among them, normalization is involved. In image recognition and deep learning, normalization usually refers to adjusting the pixel values ​​or feature values ​​of an image to a specific numerical range (such as between 0 and 1). Normalization ensures that all input images are numerically comparable, avoiding the impact of differences in numerical size or range on model performance. For images, a common normalization process is to divide the grayscale value or color value of each pixel by the maximum possible pixel value (usually 255), or subtract the mean and then divide by the standard deviation to achieve standardization with zero mean and unit variance.

[0092] This involves the to-be-identified matrix. In deep learning, images are typically represented as a multidimensional matrix, where each element represents the pixel value at the corresponding position in the image. After normalization, the to-be-identified image is converted into a standardized matrix form, the "to-be-identified matrix." This matrix serves as input for subsequent feature extraction and model processing.

[0093] In the above steps, the image to be recognized is normalized to adjust the pixel values ​​of the image to a uniform numerical range. The purpose of normalization is to eliminate differences in brightness, contrast, etc. between the images, ensure that the images are comparable when input into the model, and avoid large numerical differences affecting the training and prediction performance of the model.

[0094] The generation of fused feature maps means the model can automatically extract and integrate multi-level, multi-angle information from the image. This integration and optimization improves the accuracy and robustness of photocopy recognition, allowing the model to make relatively accurate judgments even when there are differences in image quality or copying effects. Normalization reduces the complexity of numerical calculations, helping to improve the model's computational efficiency and shorten the recognition process, which is particularly important for real-time or high-efficiency image recognition applications.

[0095] It should be noted that other image preprocessing can also be performed in the above process. That is, after reading the image, preprocessing may be required to adapt to the input requirements of a specific image recognition algorithm or model. The preprocessing steps may include: for example, resizing: adjusting the image to the size required by the algorithm or model, such as 224x224 pixels. For example, channel order conversion: according to the requirements of the algorithm or model, it may be necessary to convert the image channels from blue, green, red BGR to red, green, blue RGB, or vice versa. For example, pixel normalization: normalize the image pixel values ​​to a specific range (such as between 0-1) to improve the convergence speed and stability of the model. For example, color space conversion: as needed, the image may be converted from the RGB color space to hue, saturation, brightness space HSV, brightness color difference space YUV or other color spaces, etc., which are not limited here and can be customized according to actual applications and scenarios.

[0096] Based on the above embodiment and optional embodiment, an optional implementation manner is provided, which is described in detail below.

[0097] An optional embodiment of the present invention provides a photocopy recognition method based on an adaptive gating unit. Figure 2 The flowchart of a photocopy recognition method based on grouped convolution, provided in an optional embodiment of the present invention, is described below. This method significantly reduces the complexity of convolutional neural network reasoning and reduces computational overhead. Furthermore, the adaptive gating unit proposed in the present invention enables the model to understand the importance distribution of the current channel at each stage of reasoning, thereby optimizing resource allocation during reasoning, achieving better representation capabilities and model generalization. The present invention proposes a photocopy recognition method based on an adaptive gating unit that reduces computational complexity while maintaining the accuracy of deep learning methods, enabling the model to be applied to mobile hardware such as CPU processors and mobile phones.

[0098] Specifically, embodiments of the present invention provide a photocopy recognition method based on an adaptive gating unit. This method treats the determination of whether a photo is a photocopy as a binary classification problem and proposes a grouped convolutional neural network structure based on the adaptive gating unit to determine whether an input photo is a photocopy. In implementation, the image to be recognized must first be preprocessed, with channel conversion, resizing, and pixel normalization performed to convert it into a standard input format. The grouped convolutional neural network based on the adaptive gating unit proposed in the present invention is then used to perform predictions on the image. The adaptive gating unit proposed in the present invention is a module specifically designed for convolutional neural networks. It enables the model to adaptively calculate the importance of each layer of features during inference, automatically adjusting resource allocation based on importance, and improving the model's feature representation and generalization capabilities. Within a lightweight network framework, this method significantly enhances model recognition capabilities. Furthermore, based on grouped convolution, the present invention reorders channels from largest to smallest based on the weight information of the adaptive gating unit. This increases information exchange between network groups and makes it easier for high-weighted channels to be grouped together, thereby enhancing the feature representation capabilities of the grouped convolutional network. Finally, the present invention proposes a photocopy recognition method based on an adaptive gating unit. This method fuses shallow and deep feature maps, using the proposed adaptive gating unit to calculate the importance score of each layer's features and weight them. Shallow features include specific local features such as color and outline, while deep features are more abstract and contain global information about the image. This further enhances the network's expressive power, leading to higher recognition accuracy.

[0099] S1: Image loading initialization module prepares the image data to be classified and processes the image into a standard input format through channel conversion, size adjustment, and normalization operations;

[0100] S2: A grouped convolution module based on an adaptive gating unit, which uses the adaptive gating unit proposed in this invention in combination with a grouped convolutional neural network to extract features from the input image.

[0101] S3: A feature fusion module based on an adaptive gating unit, which weights the features of the shallow neural network and the deep network through the adaptive gating unit, and then concatenates them to obtain fused features;

[0102] S4: Prediction module, which inputs the fused features into a fully connected layer and output layer, and finally obtains the probability that the image to be identified is a photocopy;

[0103] The above step S1 includes:

[0104] S1.1: Load the image file and use the open source computer vision library OpenCV to read the image into memory. Then, adjust the channel order from BGR to RGB.

[0105] S1.2: Image resizing: Use the average interpolation algorithm to resize the image to 224*224 pixels;

[0106] S1.3: Normalize the image by dividing the pixel value at each position by 255 so that all pixel values ​​are in the range of 0-1.

[0107] Specifically, loading an image is the process of loading the image into memory and converting it into a tensor. Data preprocessing is a common method of convolutional neural networks. After channel conversion, size adjustment, and normalization, the image is converted into a 224*224*3 matrix with pixel values ​​ranging from 0 to 1.

[0108] The above step S2 includes:

[0109] S2.1: In the first stage, channel boosting, three 3*3 convolution kernels are used to perform depthwise convolution on the input image, and then 64 1*1 convolution kernels are used to increase the number of channels from 3 to 64;

[0110] S2.2: In the second stage, the first grouped convolution module based on adaptive gating units is used to extract features from the input feature map, compressing the image size by half while doubling the number of channels to 128.

[0111] S2.3: In the third stage, a second grouped convolutional module based on adaptive gating units is used to extract features from the input feature map, compressing the image size by half while doubling the number of channels to 256.

[0112] S2.4: In the fourth stage, the third grouped convolution module based on adaptive gating units is used to extract features from the input feature map, compressing the image size by half while doubling the number of channels to 512.

[0113] S2.5: In the fifth stage, the fourth grouped convolution module based on the adaptive gating unit is used to extract features from the input feature map. The image size is compressed by half, and the number of channels is doubled to 1024.

[0114] Specifically, the adaptive gating unit proposed in this application is based on a grouped convolutional neural network. The grouped convolutional neural network is divided into 5 stages, and each stage performs channel upsampling and feature map downsampling. The adaptive gating unit adds a branch to each grouped convolution. This branch is used to calculate the importance of each channel, and then multiply the weight by each channel separately, and finally multiply by the current number of channels. In addition, after the channel importance calculation is completed, it will be reordered according to importance.

[0115] The above step S3 includes:

[0116] S3.1: Average pool the feature maps obtained in steps S2.1-S2.5 and stretch them to obtain five layers of one-dimensional vectors with lengths of 64, 128, 256, 512, and 1024 respectively;

[0117] S3.2: Concatenate the above five vectors to obtain the fused feature vector of the deep layer and the shallow layer, with a length of 1984;

[0118] S3.3: Use the adaptive gating unit proposed in this application to calculate the weight of each layer of features, multiply the weights by the values ​​of the corresponding feature vectors to obtain a weighted 1984-dimensional vector, and finally multiply all vector values ​​by 1984 as weighted compensation to ensure that the feature distribution does not change.

[0119] Specifically, the feature maps of different stages are spliced ​​together, and both shallow and deep information can be input into the classification layer. At the same time, adaptive gating units are used to control the feature maps of different stages, which increases the feature expression ability of the model and finally obtains a 1984-dimensional fusion feature vector.

[0120] The above step S4 includes:

[0121] S4.1: Fully connected layer, input the feature vector obtained in step S3.2 into a fully connected layer with 1024 neurons to obtain a 1024-dimensional feature vector;

[0122] S4.2: Dropout layer, which randomly sets the vector value to 0 with a probability of 0.1;

[0123] S4.3: Output layer, outputs the vector of step S4.2 to the output layer with 2 neurons and then passes it through the sigmoid layer to obtain the final probability value.

[0124] Specifically, the prediction module aims to output the 1984-dimensional feature vector obtained in step S3 into a probability value, and judge the probability value of the image to be identified as a photocopy by the size of the probability value.

[0125] Figure 3 This is a flowchart of the image loading initialization module provided by an optional embodiment of the present invention, referring to Figure 3 As shown, it includes the following steps:

[0126] S1.1: Load the image file, use OpenCV to read the image into memory, and then adjust the channel order from BGR to RGB;

[0127] Specifically, image files are typically in PNG or jpg format. Using the OpenCV library, you can load image files into memory. By default, the three channels are in BGR order. For image prediction tasks, this typically requires converting to RGB channel order. This depends on the channel order of the image input during model training. This method uses the image channel order of "red," "green," and "blue," so converting the channel order is necessary. Specifically, this is accomplished by reversing the third dimension of the three-dimensional matrix read by OpenCV.

[0128] S1.2: Image resizing: Use the average interpolation algorithm to resize the image to 224*224 pixels;

[0129] Specifically, general convolutional neural networks have limitations on input images. The standard size used in the present invention is 224*224, and the size of the input image can be adjusted to 224*224 through the average interpolation algorithm.

[0130] S1.3: Normalize the image by dividing the pixel value at each position by 255 so that all pixel values ​​are in the range of 0-1.

[0131] Specifically, the normally read image pixel value is of int8 type and needs to be converted into a float type value before being input into the convolutional neural network. In order to increase the accuracy of the neural network, the present invention divides each pixel value by 255 to compress each pixel value to between 0 and 1.

[0132] Figure 4 This is a flow chart of a feature fusion module based on an adaptive gating unit provided in an optional embodiment of the present invention, referring to Figure 4 As shown, it includes the following steps:

[0133] S2.1: In the first stage, channel enhancement, three 3*3 convolution kernels are used to perform depth-wise convolution on the input image, and then 64 1*1 point-wise convolution kernels are used to increase the number of channels from 3 to 64;

[0134] Specifically, in order to reduce the number of parameters and computational complexity of the entire network, the present invention adopts the depth-wise + point-wise convolution method to increase the number of channels in the channel improvement link.

[0135] Figure 5 This is a flow chart of the channel promotion module provided by an optional embodiment of the present invention, referring to Figure 5 As shown, it includes the following steps:

[0136] First, depth-wise convolution performs independent convolution on each channel of the input feature map, with each channel assigned a corresponding convolution kernel. Specifically, each channel of the input feature map is convolved with a filter of the same size as the convolution kernel. This results in a convolution result with the same number of channels as the input feature map, but filtering is performed in the spatial dimension. Because depth-wise convolution performs independent convolution on each channel, the number of convolution kernel parameters is significantly reduced. In conventional convolution, each convolution kernel must be convolved with all channels of the input feature map, while depth-wise convolution requires only one convolution kernel per channel, significantly reducing the number of parameters. Low computational complexity: Due to the reduced number of parameters, depth-wise convolution also reduces computational complexity. Compared to conventional convolution, depth-wise convolution can reduce computational complexity and improve efficiency while maintaining sufficient feature extraction capabilities. Following depth-wise convolution, normalized batch normalization (BN) and the rectified linear unit (ReLU) activation function follow.

[0137] Then, point-wise convolution, also known as 1x1 convolution, is an operation that performs convolution calculations in the spatial dimension. It uses a 1x1 convolution kernel to perform a convolution operation on each pixel of the input feature map. Unlike ordinary convolution operations, point-wise convolution does not consider spatial position and only focuses on the channels in the feature map. Point-wise convolution can achieve information interaction and feature fusion between channels by linearly combining the channels of the input feature map. By adjusting the weights in the convolution kernel, the contribution of different channels to the final output can be controlled, thereby achieving a weighted combination of features. After increasing the number of channels to 64 through point-wise convolution, it is followed by BN and ReLU activation functions.

[0138] Finally, a 2*2 maximum pooling layer is used to halve the size of the feature map to obtain a 112*112*64 dimensional feature map.

[0139] S2.2: In the second stage, the first adaptive gating-based group convolution module is used to extract features from the input feature map. At the same time, the number of channels is doubled to 128, and the feature map size is compressed to 56*56.

[0140] Specifically, from the second to the fifth stage, each stage has the same structure: a grouped convolution module based on an adaptive gating unit. Each stage includes, in order: a channel boosting module, grouped convolution 1, an adaptive gating unit, channel weighting and reordering, batch normalization (BN) and relu convolution (ReLU), grouped convolution 2, an adaptive gating unit, channel weighting and reordering, batch normalization (BN) and relu convolution, a residual connection module, and a pooling module. The number of channels is doubled in the channel boosting module, while the size and number of channels remain unchanged in the adaptive gating-based grouped convolution. Finally, the pooling layer compresses the image size by half.

[0141] Figure 6 This is a flow chart of a packet convolution module based on adaptive gating provided by an optional embodiment of the present invention, with reference to Figure 6 As shown, it includes the following steps:

[0142] Channel enhancement module, which reuses the structure of the channel enhancement module in step S2.1. In the current module, the number of point-wise convolution kernels is 128, which increases the number of feature map channels from 64 to 128.

[0143] The grouped convolution module divides the input feature map into 8 groups based on the channels, with 16 channels in each group. The channels in each group are convolved with the convolution kernel in that group. In other words, for each convolution kernel, it only performs convolution operations with the channels in the corresponding group in the input feature map, and does not involve channels in other groups.

[0144] The BN+ReLU module is a standard post-convolutional processing module. BN and ReLU are commonly used as layer operations in deep neural networks, which can effectively improve model performance and training results. They are usually applied after convolutional layers or fully connected layers to increase the nonlinearity and stability of the model.

[0145] The adaptive gating unit module is used to adaptively calculate the importance score of each channel in the current feature map. After a conventional convolution and a BN+Relu, a new feature map is obtained. The feature map is then compressed into a 1*1*128-dimensional vector through the channel compression module. After a matrix operation, a 1*1*128-dimensional vector is obtained. Finally, a Softmax function is used to calculate the score of each channel.

[0146] Figure 7 This is a flow chart based on an adaptive gating unit provided by an optional embodiment of the present invention, referring to Figure 7 As shown, it includes the following steps:

[0147] The CBR module combines conventional convolution, batch normalization, and the ReLU activation function. It uses a 3x3 convolution to transform the input image, generating 112x112x128-dimensional features. Batch normalization is then used to normalize the data within the entire batch, ensuring that the feature map distribution remains within the standard normal distribution. Finally, the ReLU activation function is used for further processing.

[0148] The compression module is responsible for compressing the 112*112*128 feature map to a 1*1*128 dimension. Specifically, it first traverses each channel of the feature map, calculates the average value of each channel's 112*112 dimension, saves the average value of the channel, and finally obtains a 1*1*128 vector.

[0149] The matrix transformation module performs a necessary transformation for calculating channel importance. Its purpose is to project the 1x1x128-dimensional vector obtained by the compression module into a new vector space. Specifically, the 1x1x128-dimensional vector is multiplied by a 1x128x128-dimensional matrix. Note that the parameters of the matrix are learnable and are obtained through gradient descent. Finally, after matrix operations, a new 1x1x128-dimensional vector is obtained.

[0150] The Softmax module is used to calculate the importance score of each channel. Specifically, the softmax function can normalize the input vector to the range of 0-1, and the sum of the vectors is 1. The importance score of each channel can be obtained through the softmax function.

[0151] The channel weighting and rearrangement module is a process of weighting and rearranging the feature map after group convolution. It is worth mentioning that the present invention will perform a scaling operation after weighting. Specifically, because the entire feature map is equivalent to being divided by 128 during weighting, it is necessary to multiply it by 128 after weighting to maintain the feature distribution after group convolution unchanged. In addition, after the weighting and scaling operations are completed, the present invention will rearrange the channels from large to small according to the importance of the channels, so that channels with high channel importance can be more easily grouped into the same group. During the next group convolution, the information flow between important channels will be increased, thereby improving the feature expression ability of the model and improving the generalization ability of the model.

[0152] Residual connection modules are common in neural networks. They directly add the input and output to form a residual. By introducing residual connections, the network can directly learn the difference between input and output, rather than indirectly learning through the stacking of multiple nonlinear layers. This direct path makes it easier to transfer gradients, thereby alleviating the problem of vanishing gradients.

[0153] The pooling layer reduces the size of the feature map by half, compressing the 112*112*128 feature map to 56*56*128 feature map.

[0154] S2.3: In the third stage, a second adaptive gating-based grouped convolution module is used to extract features from the input feature map. The number of channels is doubled to 256, and the feature map size is compressed to 28*28.

[0155] Specifically, the feature extraction in the third stage is also based on the adaptive gated group convolution module, and its structure is consistent with that described in step S2.2. In this stage, the number of image channels is further increased to 256, and the size is further compressed to 28*28.

[0156] S2.4: In the fourth stage, the third adaptive gating-based group convolution module is used to extract features from the input feature map. At the same time, the number of channels is doubled to 512, and the feature map size is compressed to 14*14.

[0157] Specifically, the fourth stage feature extraction is also based on the adaptive gated group convolution module, and the structure is consistent with that described in step S2.2. In this stage, the number of image channels is further increased to 512, and the size is further compressed to 14*14.

[0158] S2.5: In the fifth stage, the fourth adaptive gating-based group convolution module is used to extract features from the input feature map. At the same time, the number of channels is doubled to 1024, and the feature map size is compressed to 7*7.

[0159] Specifically, the fifth stage feature extraction is also based on the adaptive gated group convolution module, and the structure is consistent with that described in step S2.2. In this stage, the number of image channels is further increased to 1024, and the size is further compressed to 7*7.

[0160] Figure 8 This is a flow chart of the feature fusion module provided by an optional embodiment of the present invention, referring to Figure 8 As shown, it includes the following steps:

[0161] S3.1: Perform average pooling on the feature maps obtained in steps S2.1-S2.5 and stretch them into one-dimensional feature vectors of 64, 128, 256, 512, and 1024 dimensions respectively;

[0162] Specifically, the feature map obtained in step S2.1 is 112*112*64, the feature map obtained in step S2.2 is 56*56*128, the feature map obtained in step S2.3 is 28*28*256, the feature map obtained in step S2.4 is 14*14*512, and the feature map obtained in step S2.5 is 7*7*1024, for a total of five feature maps. The feature maps obtained at different stages have features at different levels of abstraction. Each feature is average pooled to obtain 64-, 128-, 256-, 512-, and 1024-dimensional feature vectors, respectively.

[0163] S3.2: Perform concat operation on the above five vectors to obtain the fused feature vector of deep and shallow layers, with a length of 1984;

[0164] Specifically, the five vectors obtained in step S3.1 above are concatenated. Specifically, the five vectors are concatenated on the same dimension. The final feature dimension is the sum of 64, 128, 256, 512, and 1024, resulting in a 1984-dimensional feature vector.

[0165] S3.3: Adaptive gating unit. After the operation in step S3.2 is completed, the present invention uses the adaptive gating unit again to calculate the importance of features in different dimensions and perform weighting.

[0166] Specifically, the 1984-dimensional feature vector obtained in step S3.2 is first subjected to the gated unit calculation, using the same process as the adaptive gated unit module in step S2.2. A softmax is then applied to obtain a 1984 score, representing the feature importance distribution. Finally, this score is multiplied by the vector obtained in step S3.2. Furthermore, because the weighting operation scales the features by 1984, the final multiplication by 1984 is necessary to maintain a consistent feature distribution.

[0167] Figure 9 This is a flow chart of the output module provided by an optional embodiment of the present invention, referring to Figure 9 As shown, it includes the following steps:

[0168] S4.1: Fully connected layer, input the feature vector obtained in step S3.2 into a fully connected layer with 1024 neurons to obtain a 1024-dimensional feature vector;

[0169] Specifically, a fully connected layer multiplies the outputs of all previous hidden layers by a weight matrix and adds a bias term to produce the final output. Each neuron in a fully connected layer is connected to every neuron in the previous layer, allowing it to learn complex combinations and nonlinear mappings of input features. In this example, the number of neurons in the fully connected layer is 1024.

[0170] S4.2: dropout layer, during model training, randomly sets vector values ​​to 0 with a probability of 0.1;

[0171] Specifically, the Dropout layer randomly sets the output of some neurons to zero (i.e., the activation value is zero) during the training process, so that the network can only rely on the output of some neurons in each iteration. Specifically, for each neuron, its output is set to zero with probability p (0.1 in this invention), and the original output is retained with probability 1-p. In this way, the network will randomly remove some neurons in each iteration, causing the network structure and parameters to constantly change, thereby reducing the sharing and dependency between neurons. The dropout layer does not take effect during the predictive inference stage.

[0172] S4.3: Prediction layer, which outputs the vector from step S4.2 to an output layer with 2 neurons and then passes it through a sigmoid layer to obtain the final probability value;

[0173] Specifically, the number of neurons in the prediction layer is equal to the number of categories in the classification task. In the present invention, the number of categories is 2, and all prediction layers have two neurons. The output is converted into a category probability distribution using a sigmoid function. In the present invention, the probability score output by the second neuron is used as the score for the photocopy. By setting a threshold, it is possible to determine whether the image to be identified is a photocopy.

[0174] Through the above optional implementation, at least the following beneficial effects can be achieved:

[0175] (1) The adaptive gating unit proposed in this paper is a module specifically designed for convolutional neural networks. It enables the model to adaptively calculate the importance of each layer of features during inference, automatically adjusting resource allocation based on importance, improving the model's feature expression and generalization capabilities. Within a lightweight network framework, the model's recognition capabilities are significantly improved.

[0176] (2) Based on the grouped convolution, the present invention rearranges the importance of the channel sequence from large to small based on the weight information of the adaptive gating unit, which increases the information exchange between the various groups in the network and makes it easier for channels with high weights to be arranged in one group, thereby making the feature expression ability of the grouped convolutional network better.

[0177] (3) The present invention proposes a photocopy recognition method based on an adaptive gating unit. This method fuses shallow and deep feature maps, calculates the importance score of each layer of features using the adaptive gating unit proposed in the present invention, and then weights them. Shallow features include specific local features such as color and outline, while deep features are more abstract and include global image information, further enhancing the network's expressive power and achieving higher recognition accuracy.

[0178] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the present invention is not limited by the order of the actions described, because according to the present invention, 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 this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0179] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, 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, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of various embodiments of the present invention.

[0180] Example 2

[0181] According to an embodiment of the present invention, a device for implementing the above-mentioned image recognition method is also provided. Figure 10 is a structural block diagram of an image recognition device according to an embodiment of the present invention. Figure 10 As shown, the device includes: an acquisition module 1002, a first determination module 1004, a second determination module 1006 and a third determination module 1008. The device will be described in detail below.

[0182] An acquisition module 1002 is used to acquire an image to be identified; a first determination module 1004 is connected to the acquisition module 1002 and is used to determine a fused feature map based on the image to be identified, wherein the fused feature map includes features representing copy characteristics; a second determination module 1006 is connected to the first determination module 1004 and is used to input the fused feature map into the first grouped convolution unit of multiple grouped convolution units, and input the corresponding output into the next grouped convolution unit until the multiple grouped convolution units are processed to obtain multiple multi-channel feature maps, wherein the multiple grouped convolution units are connected in series, and the multiple grouped convolution units are used to increase the number of channels of the corresponding feature map to the corresponding predetermined number of channels, and the multiple multi-channel feature maps are feature maps obtained after the multiple grouped convolution units are processed respectively; a third determination module 1008 is connected to the second determination module 1006 and is used to determine the probability that the image to be identified is a copy image based on the multiple multi-channel feature maps.

[0183] It should be noted here that the above-mentioned acquisition module 1002, first determination module 1004, second determination module 1006 and third determination module 1008 correspond to steps S102 to S108 in implementing the image recognition method, and the instances and application scenarios implemented by multiple modules and corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiment 1.

[0184] Example 3

[0185] According to another aspect of an embodiment of the present invention, an electronic device is provided, including: a processor; and a memory for storing processor-executable instructions, wherein the processor is configured to execute the instructions to implement any one of the above-mentioned image recognition methods.

[0186] Example 4

[0187] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute any of the above-mentioned image recognition methods.

[0188] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0189] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0190] 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 exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as 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.

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

[0192] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0193] 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 invention, 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 and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.

[0194] The above is only a preferred embodiment of the present invention. 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 invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.

Claims

1. An image recognition method, characterized in that: include: Obtain the image to be recognized; Determining a fused feature map based on the image to be recognized, wherein the fused feature map includes features representing copy characteristics; Inputting the fused feature map into the first grouped convolution unit of a plurality of grouped convolution units, and inputting the corresponding output into the next grouped convolution unit, until the plurality of grouped convolution units are processed, thereby obtaining a plurality of multi-channel feature maps, wherein the plurality of grouped convolution units are connected in series, and the plurality of grouped convolution units are used to increase the number of channels of the corresponding feature map to the corresponding predetermined number of channels, and the plurality of multi-channel feature maps are feature maps obtained after the plurality of grouped convolution units are processed respectively; The probability that the image to be identified is a copied image is determined based on the multiple multi-channel feature maps.

2. The method according to claim 1, characterized in that Determining a fusion feature map based on the image to be identified includes: Determining single-channel feature maps corresponding to the image to be identified under multiple channels, wherein the corresponding single-channel feature maps are obtained by processing corresponding convolution kernels; A fused feature map is obtained based on the multiple single-channel feature maps, wherein the number of output channels of the fused feature map is greater than the number of the multiple channels.

3. The method according to claim 1, characterized in that Determining, based on the plurality of multi-channel feature maps, a probability that the image to be identified is a copy image, comprising: Determining a fusion feature vector based on the multiple multi-channel feature maps; The probability that the image to be identified is a copied image is determined based on the fused feature vector.

4. The method according to claim 3, characterized in that Determining a fusion feature vector based on the multiple multi-channel feature maps includes: Performing a stretching operation on each of the plurality of multi-channel feature maps to obtain a plurality of groups of one-dimensional vectors, wherein the plurality of multi-channel feature maps correspond one-to-one to the plurality of groups of one-dimensional vectors; Obtaining an initial fused feature vector based on the multiple groups of one-dimensional vectors; The fused feature vector is obtained according to the initial fused feature vector and the weight corresponding to the initial fused feature vector.

5. The method according to claim 4, characterized in that Obtaining the fused feature vector according to the initial fused feature vector and the weight corresponding to the initial fused feature vector includes: Obtaining a weighted feature vector according to the initial fused feature vector and the weight corresponding to the initial fused feature vector; Scale compensation is performed on the weighted feature vector to obtain the fused feature vector.

6. The method according to claim 3, characterized in that Determining the probability that the image to be identified is a copy image based on the fused feature vector includes: Obtaining a connection vector according to the fused feature vector; Performing regularization processing on the connection vector to obtain a regularized processing vector; The regularized processing vector is input into the activation function layer to obtain the probability.

7. The method according to any one of claims 1 to 6, characterized in that Determining a fusion feature map based on the image to be identified includes: Normalizing the image to be identified to obtain a matrix to be identified; A fusion feature map is obtained according to the matrix to be identified.

8. An image recognition device, characterized in that: include: An acquisition module, used for acquiring an image to be identified; A first determining module is configured to determine a fused feature map based on the image to be identified, wherein the fused feature map includes features representing copy characteristics; A second determination module is configured to input the fused feature map into the first grouped convolution unit of the plurality of grouped convolution units, and input the corresponding output into the next grouped convolution unit until the plurality of grouped convolution units are processed, thereby obtaining a plurality of multi-channel feature maps, wherein the plurality of grouped convolution units are connected in series, and the plurality of grouped convolution units are configured to increase the number of channels of the corresponding feature map to the corresponding predetermined number of channels, and the plurality of multi-channel feature maps are feature maps obtained after the plurality of grouped convolution units are processed respectively; The third determination module is used to determine the probability that the image to be identified is a copied image based on the multiple multi-channel feature maps.

9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the image recognition method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the image recognition method according to any one of claims 1 to 7.