Image recognition method, device, storage medium and system
By performing feature extraction and enhancement processing on the image to be recognized, the prediction results of the foreground target object are obtained, which solves the problems of high prediction difficulty and low accuracy in the target detection scenario with visual consistency between front and back, and achieves higher prediction accuracy.
Patent Information
- Application Number
- CN202211407645.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-10
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2042-11-10
AI Technical Summary
In existing technologies, image recognition methods for detecting targets with consistent front-to-back visual perception face significant challenges in prediction and exhibit low accuracy.
By extracting features from the image to be recognized, pyramid features, edge features, and region features are obtained. Spatial information enhancement processing is performed on the pyramid features, and guided enhancement processing is performed using the edge features and region features to obtain the prediction results of the foreground target object.
It improves the prediction accuracy of foreground target objects in the scene of visual consistency between front and back, and solves the problems of high prediction difficulty and low accuracy.
Smart Images

Figure CN115908173B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more specifically, to an image recognition method, apparatus, storage medium, and system. Background Technology
[0002] In image recognition, we often encounter target detection scenarios where visual consistency (such as similar color and texture statistics) is crucial. Examples include pest and disease detection in agriculture (especially detecting green insects parasitizing crop leaves), anomaly and defect localization in industry, and spot-the-difference video games. Therefore, improving the accuracy of visually consistent target detection has become a critical issue in this field. Summary of the Invention
[0003] This invention provides an image recognition method, apparatus, storage medium, and system to at least solve the technical problems of high prediction difficulty and low prediction accuracy in target detection in related technologies.
[0004] According to one aspect of the present invention, an image recognition method is provided, comprising: acquiring an image to be recognized, wherein the display content in the image to be recognized includes a foreground target object; performing feature extraction on the image to be recognized to obtain pyramid features, edge features, and region features corresponding to the foreground target object; performing spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; performing guided enhancement processing on the first enhanced feature using the edge features and region features to obtain a second enhanced feature; and acquiring a prediction result corresponding to the foreground target object based on the second enhanced feature.
[0005] According to another aspect of the present invention, an image recognition method is also provided, comprising: receiving an image to be recognized from a client, wherein the display content in the image to be recognized includes a foreground target object; performing feature extraction on the image to be recognized to obtain pyramid features, edge features, and region features corresponding to the foreground target object; performing spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; performing guided enhancement processing on the first enhanced feature using the edge features and region features to obtain a second enhanced feature; and obtaining a prediction result corresponding to the foreground target object based on the second enhanced feature; and feeding back the prediction result to the client.
[0006] According to another aspect of the present invention, an image recognition method is also provided, comprising: acquiring an agricultural scene image, wherein the displayed content in the agricultural scene image includes: a camouflaged insect target; performing feature extraction on the agricultural scene image to obtain pyramid features, edge features, and region features corresponding to the camouflaged insect target; performing spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; performing guided enhancement processing on the first enhanced feature using the edge features and region features to obtain a second enhanced feature; and locating the camouflaged insect target in the agricultural scene image based on the second enhanced feature.
[0007] According to another aspect of the present invention, an image recognition method is also provided, comprising: acquiring an industrial scene image, wherein the displayed content in the industrial scene image includes: a camouflage-colored defect target; performing feature extraction on the industrial scene image to obtain pyramid features, edge features, and region features corresponding to the camouflage-colored defect target; performing spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; performing guided enhancement processing on the first enhanced feature using the edge features and region features to obtain a second enhanced feature; and locating the camouflage-colored defect target in the industrial scene image based on the second enhanced feature.
[0008] According to another aspect of the present invention, an image recognition method is also provided, comprising: acquiring a game scene image, wherein the displayed content in the game scene image includes: a camouflage color distinguishing target; performing feature extraction on the game scene image to obtain pyramid features, edge features, and region features corresponding to the camouflage color distinguishing target; performing spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; performing guided enhancement processing on the first enhanced feature using the edge features and region features to obtain a second enhanced feature; and locating the camouflage color distinguishing target in the game scene image based on the second enhanced feature.
[0009] According to another aspect of the present invention, an image recognition device is also provided, comprising: an acquisition module for acquiring an image to be recognized, wherein the display content in the image to be recognized includes a foreground target object; an extraction module for extracting features from the image to be recognized to obtain pyramid features, edge features, and region features corresponding to the foreground target object; a first processing module for performing spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; a second processing module for performing guided enhancement processing on the first enhanced feature using the edge features and region features to obtain a second enhanced feature; and a recognition module for acquiring a prediction result corresponding to the foreground target object based on the second enhanced feature.
[0010] According to another aspect of the present invention, a storage medium is also provided, the storage medium including a stored program, wherein, when the program is executed, the device where the storage medium is located is controlled to perform any of the above-described image recognition methods.
[0011] According to another aspect of the present invention, an image recognition system is also provided, comprising: a processor; and a memory connected to the processor, configured to provide the processor with instructions for performing the following processing steps: acquiring an image to be recognized, wherein the display content in the image to be recognized includes: a foreground target object; performing feature extraction on the image to be recognized to obtain pyramid features, edge features, and region features corresponding to the foreground target object; performing spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; performing guided enhancement processing on the first enhanced feature using the edge features and region features to obtain a second enhanced feature; and acquiring a prediction result corresponding to the foreground target object based on the second enhanced feature.
[0012] In this embodiment of the invention, by acquiring an image to be identified, wherein the displayed content in the image to be identified includes a foreground target object, feature extraction is performed on the image to be identified to obtain pyramid features, edge features and region features corresponding to the foreground target object, spatial information enhancement processing is performed on the pyramid features to obtain a first enhanced feature, and the first enhanced feature is guided enhancement processing is performed using the edge features and region features to obtain a second enhanced feature, and further based on the second enhanced feature, the prediction result corresponding to the foreground target object is obtained.
[0013] It is noteworthy that, through the embodiments of the present invention, the edge features and region features corresponding to the foreground target object in the image to be identified are enhanced, and the prediction result corresponding to the foreground target object is further obtained. This achieves the purpose of determining the prediction result corresponding to the foreground target object based on the enhanced edge features and region features, thereby realizing the technical effect of improving the accuracy of the prediction result corresponding to the foreground target object in the target detection scene with consistent visual before and after, and thus solving the technical problems of high prediction difficulty and low prediction accuracy of target detection in related technologies. Attached Figure Description
[0014] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:
[0015] Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing an image recognition method is shown.
[0016] Figure 2 This is a flowchart of an image recognition method according to an embodiment of the present invention;
[0017] Figure 3 This is a schematic diagram of an optional image recognition process according to an embodiment of the present invention;
[0018] Figure 4 This is a schematic diagram of an optional region guidance process according to an embodiment of the present invention;
[0019] Figure 5 This is a schematic diagram of another optional region guidance process according to an embodiment of the present invention;
[0020] Figure 6 This is a flowchart of an optional image recognition method according to an embodiment of the present invention;
[0021] Figure 7 This is a schematic diagram illustrating image recognition on a cloud server according to an embodiment of the present invention;
[0022] Figure 8 This is a flowchart of another image recognition method according to an embodiment of the present invention;
[0023] Figure 9 This is a flowchart of another image recognition method according to an embodiment of the present invention;
[0024] Figure 10 This is a flowchart of another image recognition method according to an embodiment of the present invention;
[0025] Figure 11 This is a schematic diagram of the structure of an image recognition device according to an embodiment of the present invention;
[0026] Figure 12 This is a schematic diagram of the structure of another image recognition device according to an embodiment of the present invention;
[0027] Figure 13 This is a schematic diagram of the structure of another image recognition device according to an embodiment of the present invention;
[0028] Figure 14 This is a schematic diagram of the structure of another image recognition device according to an embodiment of the present invention;
[0029] Figure 15 This is a structural block diagram of another computer terminal according to an embodiment of the present invention. Detailed Implementation
[0030] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0032] First, some nouns or terms that appear in the description of the embodiments of the present invention shall be interpreted as follows:
[0033] Camouflaged targets: These are targets in the image to be identified whose color and texture statistical features are particularly similar to their surrounding environment.
[0034] A salient target is a boundary target in an image that has a significant difference from its surrounding environment.
[0035] Example 1
[0036] According to an embodiment of the present invention, an embodiment of an image recognition method is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0037] The method embodiment provided in Embodiment 1 of the present invention can be executed in a mobile terminal, computer terminal or similar computing device. Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing an image recognition method is shown. Figure 1As shown, the computer terminal 10 (or mobile device 10) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor (MCU) or a field-programmable gate array (FPGA) or similar processing device), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface, a Universal Serial Bus (USB) port (which may be included as one of the ports of a computer bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0038] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of the present invention, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0039] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the image recognition method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the above-mentioned image recognition method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0040] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0041] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0042] It should be noted here that, in some optional embodiments, the above... Figure 1 The computer device (or mobile device) shown may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that... Figure 1 This is only one instance of a specific particular instance and is intended to illustrate the types of components that may exist in the aforementioned computer device (or mobile device).
[0043] Among related technologies, there are three main image recognition methods for target detection scenarios.
[0044] The first method utilizes the Positioning and Focus Network (PFNet). The coarse region map of the target is initially located through the deep semantic feature layer of the Positioning Module (PM). Then, the coarse region map is fed into the cascaded Focus Module (FM) to obtain progressively refined segmentation results.
[0045] The second approach utilizes the Searching and Identifying Net (SINet). The coarse search module (SM) uses RF components to enhance the shallow, medium, and high feature groups of the feature pyramid. This enhanced feature is then combined with a rough coarse region map of the target (SM is typically a densely connected structure). Finally, the refined identification module (IM) uses the context module to generate new features and employs element-wise multiplication to reduce the gap between adjacent features, thus obtaining the identification result.
[0046] The third approach utilizes an upgraded version of the search and recognition network (SINet-V2). A coarse camouflage map is generated through SM to detect the target, and then the features are gradually refined through IM using cascaded and inverted attention to generate an accurate target region map.
[0047] However, the above three methods have low prediction accuracy for foreground objects in images requiring visual consistency. In contrast, the image recognition method described in this invention demonstrates better prediction performance in visually consistent target detection scenarios.
[0048] Under the above operating environment, the present invention provides, as follows: Figure 2 This illustrates an image recognition method. Figure 2 This is a flowchart of an image recognition method according to an embodiment of the present invention, such as... Figure 2 As shown, the image recognition method includes:
[0049] Step S21: Obtain the image to be recognized, wherein the displayed content in the image to be recognized includes: foreground target object;
[0050] Step S22: Extract features from the image to be recognized to obtain the pyramid features, edge features, and region features corresponding to the foreground target object;
[0051] Step S23: Perform spatial information enhancement processing on the pyramid features to obtain the first enhanced feature;
[0052] Step S24: Use edge features and region features to perform guided enhancement processing on the first enhancement feature to obtain the second enhancement feature;
[0053] Step S25: Based on the second enhanced feature, obtain the prediction result corresponding to the foreground target object.
[0054] In this embodiment of the invention, the image to be identified can be an image to be identified in a target detection scene with consistent visual characteristics. The content displayed in the image to be identified includes a foreground target object. The foreground target object can be a camouflaged target.
[0055] Feature extraction is performed on the image to be recognized to obtain the pyramid features, edge features, and region features corresponding to the foreground target object. Pyramid features are the features of each layer in the pyramid network (e.g., shallow, medium, and deep features). Edge features are the features of the boundaries between the foreground target object and other objects in the image to be recognized. Region features are the features of the region corresponding to the foreground target object.
[0056] To improve the accuracy of the prediction results, spatial information enhancement processing is performed on the above pyramid features to obtain the first enhanced features. Specifically, spatial information enhancement processing is performed on the features of each layer in the pyramid network, and the obtained first enhanced features include the enhanced features corresponding to each layer in the pyramid network.
[0057] Furthermore, the first enhancement feature is enhanced by utilizing the edge features and region features corresponding to the foreground target object to obtain the second enhancement feature, and then the prediction result corresponding to the foreground target object is obtained based on the second enhancement feature.
[0058] In this embodiment of the invention, by acquiring an image to be identified, wherein the displayed content in the image to be identified includes a foreground target object, feature extraction is performed on the image to be identified to obtain edge features and region features corresponding to the foreground target object, and enhanced features are obtained by performing pyramid feature enhancement processing on the edge features and region features, and further based on the enhanced features, the prediction result corresponding to the foreground target object is obtained.
[0059] It is noteworthy that, through the embodiments of the present invention, for target detection scenarios with non-salient targets, the edge features and region features corresponding to the foreground target object in the image to be identified are enhanced, and the prediction results corresponding to the foreground target object are further obtained. This achieves the purpose of determining the prediction results corresponding to the foreground target object based on the enhanced edge features and region features, thereby achieving the technical effect of improving the accuracy of the prediction results corresponding to the foreground target object in target detection scenarios with consistent visual perception before and after, and thus solving the technical problems of high prediction difficulty and low prediction accuracy in related technologies.
[0060] The method provided by this invention can be applied, but is not limited to, to scenarios where the saliency detection capability of image recognition is extended, especially to image recognition scenarios for locating non-saliency (such as similarity in statistical information such as color and texture), such as: pest and disease identification in the agricultural field, abnormal defect location (such as tire scratches, inconsistent thickness of industrial products, etc.) in the industrial field, and spot-the-difference gameplay in the field of video games.
[0061] In an optional embodiment, in step S22, feature extraction is performed on the image to be recognized to obtain the edge features and region features corresponding to the foreground target object, including the following method steps:
[0062] Step S221: Use a deep residual network model to extract features from the image to be recognized, and obtain edge features and region features. The deep residual network model is trained by machine learning using multiple sets of data. Each set of data includes: a sample image and the localization result of the sample foreground target in the sample image. The deep residual network model includes: multiple feature layers, including: a shallow edge feature layer, multiple intermediate feature layers and a deep semantic feature layer. The shallow edge feature layer is a shallow edge feature layer, the deep semantic feature layer is a deep semantic feature layer, and the multiple intermediate feature layers are intermediate feature layers that are sequentially connected between the shallow edge feature layer and the deep semantic feature layer.
[0063] The image recognition method provided by the above embodiments of the present invention can be applied to scenarios of non-salient target recognition. The following uses this scenario as an example to specifically describe the technical solution of the present invention.
[0064] In the process of recognizing images containing non-salient targets, the deep residual network model used for feature extraction can be a ResNet-50 network. By using this ResNet-50 residual network as the backbone network to extract features from images containing non-salient targets, the edge features and region features corresponding to the non-salient targets can be obtained.
[0065] The aforementioned deep residual network model can be trained using machine learning from multiple sets of data. Each set of data includes a sample image and the localization result of the foreground target in the sample image. In specific application scenarios, these multiple sets of data can come from commonly used test datasets.
[0066] Figure 3 This is a schematic diagram of an optional image recognition process according to an embodiment of the present invention, such as... Figure 3 As shown, the ResNet-50 deep residual network model used for feature extraction of the image to be recognized includes: a shallow edge feature layer, a first intermediate feature layer, a second intermediate feature layer, and a deep semantic feature layer.
[0067] Still as Figure 3 As shown, the feature extraction results obtained by using the ResNet-50 network to extract features from sample images include at least pyramid features, which include: shallow edge features corresponding to the shallow edge feature layer, first middle layer features corresponding to the first middle feature layer, second middle layer features corresponding to the second middle feature layer, and deep semantic features corresponding to the deep semantic feature layer.
[0068] In an optional embodiment, in step S221, a deep residual network model is used to extract features from the image to be recognized to obtain edge features, including the following method steps:
[0069] Step S2211: Upsample the deep semantic features in the deep semantic feature layer using a deep residual network model to obtain the first sampling result;
[0070] Step S2212: Jointly predict the first sampling result and the shallow edge features in the shallow edge feature layer to obtain the edge features.
[0071] The extraction results described above include at least edge features. Still as... Figure 3 As shown, the deep semantic features in the deep semantic feature layer of the pyramid network are upsampled using the ResNet-50 network to obtain the first sampling result; edge perception prediction is performed based on the first sampling result and the shallow edge features in the shallow edge feature layer to obtain the edge features, which are used for region guidance processing.
[0072] It should be noted that for the region-aware module of the network, the initial input features are upsampled F1 and F4 features. Through intermediate convolutional layers, upsampling layers, or downsampling layers, other intermediate features can be generated. Finally, the edge-aware module obtains an edge information map. The edge information map contains high-frequency signals (such as texture features, shape features, etc.).
[0073] In an optional embodiment, in step S221, a deep residual network model is used to extract features from the image to be recognized to obtain region features, including the following method steps:
[0074] Step S2213: Use a deep residual network model to downsample the shallow edge features in the shallow edge feature layer to obtain the second sampling result;
[0075] Step S2214: Jointly predict the second sampling result and the deep semantic features in the deep semantic feature layer to obtain the regional features.
[0076] The extraction results described above include at least regional features. Still as... Figure 3 As shown, the shallow edge features in the shallow edge feature layer of the pyramid network are downsampled using the ResNet-50 network to obtain a second sampling result. Based on the second sampling result and the deep semantic features in the deep semantic feature layer, region-aware prediction is performed to obtain region features, which are used for region-guided processing.
[0077] It should be noted that for the edge perception module of the network, the initial input features are downsampled F1 features and F4 features. Through intermediate convolutional layers, upsampling layers, or downsampling layers, other intermediate features can be generated. Finally, the region perception module obtains a region information map. The region information map contains low-frequency signals (such as the coarse prediction region corresponding to the foreground target object). In other words, when recognizing the foreground target object in the image to be recognized, the coarse prediction region where the foreground target object is located is obtained first, and then the detailed features of the foreground target object are obtained.
[0078] Still as Figure 3 As shown, spatial information enhancement processing is performed on the features of each feature layer of the pyramid network to obtain the first enhanced feature. Specifically, spatial information enhancement processing is performed on shallow features to obtain shallow feature enhancement, spatial information enhancement processing is performed on the first middle layer features to obtain the first middle layer feature enhancement, spatial information enhancement processing is performed on the second middle layer features to obtain the second middle layer feature enhancement, and spatial information enhancement processing is performed on deep features to obtain deep feature enhancement.
[0079] It should be noted that the Atrous Spatial Pyramid Pooling (ASPP) feature enhancement method is used to enhance the spatial information of the above deep features, and the novel Receptive Field Block (RFB) feature enhancement method is used to enhance the spatial information of the above shallow features, first mid-layer features, and second mid-layer features.
[0080] For example, the image to be identified is an RGB image with a size of 448×448, and the feature layers are: F0 feature layer (112×1122), F1 feature layer (112×112), F2 feature layer (56×56), F3 feature layer (28×28), and F4 feature layer (14×14). The F1 feature layer perceives the image to be identified and obtains the coarse edge (112×112) (equivalent to the edge feature mentioned above); the F4 feature layer perceives the image to be identified and obtains the area map (14×14) (equivalent to the area feature mentioned above).
[0081] Furthermore, the features in the F1, F2, F3, and F4 feature layers are enhanced to obtain enhanced features (denoted as F1_hance, F2_hance, F3_hance, and F4_hance, respectively). These enhanced features can have better semantic expression at the spatial level.
[0082] The edge and region information of the aforementioned non-salient targets are assigned to the corresponding features of each layer of ASPP to enhance the region and edge feature representation of the current layer. Simultaneously, since the color, texture, and other statistical information of non-salient targets in the image to be identified are very similar to the background, the region features are enhanced based on the background features corresponding to the image to be identified, which helps the network to more easily distinguish between foreground and background features.
[0083] In an optional embodiment, in step S24, based on the second enhanced feature, the prediction result corresponding to the foreground target object is obtained, including the following method steps:
[0084] Step S241: For each feature layer in the shallow edge feature layer and multiple intermediate feature layers, perform region and edge guidance processing on the edge features, region features and second enhancement features to obtain the guidance processing result corresponding to each feature layer;
[0085] Step S242: The second enhanced feature corresponding to the deep semantic feature layer is sequentially fused with the guided processing result corresponding to each feature layer to obtain the prediction result corresponding to the foreground target object.
[0086] Still as Figure 3 As shown, for each feature layer in the ResNet-50 network, the edge features obtained by edge perception (the aforementioned coarse edge), the region features obtained by region perception (the region map Area), and the second enhancement features (the aforementioned F1_hance, F2_hance, F3_hance, and F4_hance) are subjected to region guidance processing (equivalent to the aforementioned region and edge guidance processing) to obtain the guidance processing result corresponding to each feature layer.
[0087] The deep second enhanced feature (F4_hance) corresponding to the deep semantic feature layer is sequentially fused with the guided processing results corresponding to each feature layer (F1 feature layer, F2 feature layer and F3 feature layer) to obtain the prediction result corresponding to the foreground target object.
[0088] In an optional embodiment, in step S241, region and edge guidance processing is performed on the edge features, region features, and second enhancement features to obtain the guidance processing result corresponding to each feature layer, including the following method steps:
[0089] Step S2411: Perform region guidance processing on the region features and the second enhancement features to obtain the first guidance processing sub-result, and perform region guidance processing on the background features and the second enhancement features to obtain the second guidance processing sub-result, wherein the background features are determined by the region features;
[0090] Step S2412: Perform channel-level feature enhancement processing on the first guidance processing sub-result to obtain the third guidance processing sub-result, and perform channel-level feature enhancement processing on the second guidance processing sub-result to obtain the fourth guidance processing sub-result.
[0091] Step S2413: The third and fourth guidance processing results are merged to obtain the fifth guidance processing result;
[0092] Step S2414: Perform edge guidance processing on the fifth guidance processing sub-result and edge features to obtain the guidance processing result corresponding to each feature layer.
[0093] Taking the identification of an image containing non-salient targets as an example, such as... Figure 3 As shown, region-guided processing is used to enhance semantic features and edge features, and then assigns the enhanced semantic features and edge features to the semantic features and edge features of each layer in the network.
[0094] Figure 4 This is a schematic diagram of an optional region guidance process according to an embodiment of the present invention, such as... Figure 4 As shown, region guidance processing is used to guide the target edge region information and background. Based on the region features obtained by region perception, the edge features obtained by edge perception, and the second enhanced features corresponding to each feature layer except the deep semantic feature layer, region guidance processing is performed to obtain the guidance processing results (including the shallow guidance processing results, the first middle-layer guidance processing results, and the second middle-layer guidance processing results as shown in 4).
[0095] Figure 5 This is a schematic diagram of another optional region guidance process according to an embodiment of the present invention, such as... Figure 5 As shown, region guidance processing includes region guidance processing and edge guidance processing.
[0096] In the region-guided processing, the region features obtained from region perception and the second enhanced features are subjected to region-guided processing to obtain the first guided processing sub-result, and the background features corresponding to the region features and the second enhanced features are subjected to region-guided processing to obtain the second guided processing sub-result.
[0097] Furthermore, in the regional guidance processing, the first guidance processing sub-result is subjected to channel-level feature enhancement processing to obtain the third guidance processing sub-result, and the second guidance processing sub-result is subjected to channel-level feature enhancement processing to obtain the fourth guidance processing sub-result.
[0098] For example, the specific implementation of performing channel-level feature enhancement processing on the first guided processing sub-result to obtain the third guided processing sub-result is as follows: embed a squeeze-and-excitation block (SEBlock) in the neural network model corresponding to the region guided processing, and use the SEBlock to enhance the features of the first guided processing sub-result based on the feature map and weight information of the current layer feature channel (from the previous layer of the current layer) to obtain the third guided processing result.
[0099] In the process of feature enhancement of the first guided processing result using SEBlock, the squeezing part of SEBlock performs global average pooling on the feature map layer of the first guided processing result to obtain the globally compressed feature vector corresponding to the current feature layer; the excitation part of SEBlock obtains the weight information of each feature channel in the current feature layer through two fully connected layers, uses the weight information to perform weighted processing on the feature map, and outputs the weighted processing result (as the input of the next layer). Thus, the features corresponding to the first guided processing result are further enhanced.
[0100] Similarly, based on the aforementioned feature enhancement method embedding SEBlock, channel-level feature enhancement is performed on the second guided processing sub-result to obtain the fourth guided processing sub-result. Channel-level feature enhancement is used to model and analyze the correlation between feature layer channels, and to enhance important features to improve feature representation.
[0101] In edge guidance processing, the third and fourth guidance processing sub-results are fused to obtain the fifth guidance processing sub-result. Edge guidance processing is then performed using the edge features obtained from edge perception and this fifth guidance processing sub-result to obtain the guidance processing result corresponding to each feature layer.
[0102] In an optional embodiment, in step S242, the second enhanced feature corresponding to the deep semantic feature layer is sequentially fused with the guided processing result corresponding to each feature layer to obtain the prediction result corresponding to the foreground target object, including the following method steps:
[0103] Step S2421: Determine whether there is an intermediate feature layer adjacent to the deep semantic feature layer;
[0104] Step S2422: In response to the existence of an intermediate feature layer adjacent to the deep semantic feature layer, feature fusion is performed on the second enhanced feature corresponding to the deep semantic feature layer and the guided processing result corresponding to the adjacent intermediate feature layer to obtain the fusion result corresponding to the adjacent intermediate feature layer.
[0105] Step S2423: Starting from the adjacent intermediate feature layer, along the direction from the deep semantic feature layer to the shallow edge feature layer, determine in turn whether there is a previous feature layer adjacent to the current feature layer.
[0106] Step S2424: In response to the existence of a previous feature layer adjacent to the current feature layer, feature fusion is performed sequentially on the fusion result corresponding to the current feature layer and the guidance processing result corresponding to the previous feature layer until the prediction result corresponding to the foreground target object is obtained through the fusion result corresponding to the shallow edge feature layer.
[0107] Taking the identification of an image containing non-salient targets as an example, such as... Figure 3 As shown, it is determined whether there is an intermediate feature layer adjacent to the deep semantic feature layer (F4 feature layer). When there is an intermediate feature layer adjacent to the deep semantic feature layer, the second enhanced feature (F4_hance) corresponding to the deep semantic feature layer is fused with the guided processing result corresponding to the adjacent intermediate feature layer to obtain the fusion result corresponding to the adjacent intermediate feature layer.
[0108] In other words, the process iterates through multiple network layers, fusing features from higher layers (the current layer) with adjacent lower layers in sequence to obtain the fusion result of the current layer. For example, fusing the second enhancement feature F1_hance and the second enhancement feature F2_hance yields prediction region map map1; fusing the second enhancement feature F2_hance and the second enhancement feature F3_hance yields prediction region map map2; and fusing the second enhancement feature F3_hance and the second enhancement feature F4_hance yields prediction region map map3.
[0109] From adjacent intermediate feature layers (such as Figure 3 Starting from the second intermediate feature layer shown (i.e., the F3 feature layer mentioned above), along the direction from the deep semantic feature layer to the shallow edge feature layer (i.e. from the F4 feature layer to the F1 feature layer), it is determined in turn whether there is a previous feature layer adjacent to the current feature layer (in this example, the F4 feature layer, F3 feature layer and F2 feature layer have a previous feature layer adjacent to the current feature layer).
[0110] Still as Figure 3As shown, for the F4 feature layer (which has an adjacent preceding feature layer, i.e., the F3 feature layer), the fusion result (predicted region map map3) corresponding to the F4 feature layer and the guided processing result (such as...) corresponding to the F3 feature layer are compared. Figure 4 The second layer of the process (followed by the second layer of the process) is used for feature fusion to obtain feature fusion result 1; similarly, feature fusion is performed on the F3 and F2 feature layers to obtain feature fusion result 2; similarly, feature fusion is performed on the F2 and F1 feature layers to obtain feature fusion result 3. Since the F1 feature layer does not have an adjacent preceding feature layer, feature fusion result 3 can be used as the prediction result for the non-significant target (equivalent to the foreground target object mentioned above).
[0111] It is easy to understand that when performing feature fusion on the fusion result corresponding to the current feature layer and the guided processing result corresponding to the previous feature layer in sequence, the prediction result corresponding to the foreground target object can be obtained through the fusion result corresponding to the shallow edge feature layer (such as the F1 feature layer mentioned above). At this time, the above fusion iteration process can be terminated.
[0112] It should be noted that when recognizing an image containing non-salient targets, in addition to using the merging function (such as Concat) mentioned in this embodiment to merge the feature layer and the edge map, the feature layer and the edge map can also be merged by direct addition or direct multiplication.
[0113] It should be noted that, compared with the prior art, the method provided by the present invention performs region perception and edge perception based on shallow edge features and high-level semantic features, extracts edge information maps and region information maps of foreground target objects, and assigns these edge information maps and region information maps to each layer of features of the pyramid, thereby strengthening the edge feature expression and region feature expression of each layer of features of the pyramid, and further obtaining more accurate prediction results.
[0114] It is easy to understand that the key points of the image recognition method provided by this invention are: to obtain region maps and edge maps by performing coarse prediction through shallow edge features and high-level semantic features; to enhance the features of each layer of the pyramid network by using a dual-guided approach of region maps and edge maps; and to further enhance the expression of edge features through feature fusion.
[0115] The image recognition method provided in the embodiments of the present invention achieves superior performance on common test datasets.
[0116] The test dataset mentioned above includes at least one of the following:
[0117] (1) The first image dataset consists of 2.5K images (K images for training and 0.5K images for testing), covering eight different categories;
[0118] (2) Second image dataset, a target-level image dataset with manual annotations;
[0119] (3) The 10K dataset for camouflage object detection (COD);
[0120] (4) A new test dataset is used to evaluate the generalization ability of the camouflaged target detection model.
[0121] One embodiment of the present invention also provides an image recognition method that runs on a cloud server. Figure 6 This is a flowchart of an optional image recognition method according to an embodiment of the present invention, such as... Figure 6 As shown, the image recognition method includes:
[0122] Step S61: Receive the image to be recognized from the client, wherein the display content in the image to be recognized includes: foreground target object;
[0123] Step S62: Extract features from the image to be recognized to obtain pyramid features, edge features and region features corresponding to the foreground target object; perform spatial information enhancement processing on the pyramid features to obtain the first enhanced feature; use the edge features and region features to perform guided enhancement processing on the first enhanced feature to obtain the second enhanced feature; and obtain the prediction result corresponding to the foreground target object based on the second enhanced feature.
[0124] Step S63: Feedback the prediction results to the client.
[0125] Optionally, Figure 7 This is a schematic diagram illustrating image recognition on a cloud server according to an embodiment of the present invention, such as... Figure 7 As shown, the client uploads the image to be recognized to the cloud server. The content displayed in the image includes a foreground target object. The cloud server extracts features from the image to obtain pyramid features, edge features, and region features corresponding to the foreground target object. Spatial information enhancement processing is applied to the pyramid features to obtain a first enhanced feature. The edge and region features are then used to guide the enhancement processing of the first enhanced feature to obtain a second enhanced feature. Finally, a prediction result corresponding to the foreground target object is obtained based on the second enhanced feature. The cloud server then returns the prediction result corresponding to the image to be recognized to the client. The final prediction result is provided to the user through the client's graphical user interface.
[0126] It should be noted that the image recognition method provided in the embodiments of the present invention can be applied, but is not limited to, scenarios where the saliency detection capability of image recognition is extended. In particular, it can be applied to image recognition scenarios for locating non-saliency (such as similarity in statistical information such as color and texture) targets. Through the interaction between the SaaS server and the client, feature extraction is performed on the image to be recognized from the client to obtain pyramid features, edge features, and region features corresponding to the foreground target object. Spatial information enhancement processing is performed on the pyramid features to obtain the first enhanced feature. The edge features and region features are used to guide the enhancement processing of the first enhanced feature to obtain the second enhanced feature. The prediction result corresponding to the foreground target object is then obtained based on the second enhanced feature, and the returned prediction result is provided to the user through the client.
[0127] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0128] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they 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. This computer software product is stored in a storage medium (such as read-only memory (ROM), random access memory (RAM), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0129] Example 2
[0130] According to embodiments of the present invention, under the above-described operating environment, the present invention also provides, as follows: Figure 8 This illustrates an image recognition method. Figure 8 This is a flowchart of another image recognition method according to an embodiment of the present invention, such as... Figure 8 As shown, the image recognition method includes:
[0131] Step S81: Acquire an agricultural scene image, wherein the content displayed in the agricultural scene image includes: camouflaged insect targets;
[0132] Step S82: Extract features from the agricultural scene image to obtain the pyramid features, edge features, and region features corresponding to the camouflaged insect target;
[0133] Step S83: Perform spatial information enhancement processing on the pyramid features to obtain the first enhanced feature.
[0134] Step S84: Use edge features and region features to perform guided enhancement processing on the first enhancement feature to obtain the second enhancement feature;
[0135] Step S85: Based on the second enhanced features, locate the camouflage insect target in the agricultural scene image.
[0136] In this embodiment of the invention, the agricultural scene image can be an image to be identified in a camouflage insect target detection scenario (such as a pest and disease identification scenario) within the agricultural field. The content displayed in the agricultural scene image includes camouflage insect targets (such as green insect targets on the green leaves of crops).
[0137] Feature extraction was performed on the agricultural scene image to obtain the pyramid features, edge features, and region features corresponding to the camouflaged insect target. Pyramid features are the features of each layer in the pyramid network (e.g., shallow, medium, and deep features). Edge features are the boundary features between the camouflaged insect target and other objects in the agricultural scene image (such as crop leaves, soil, etc.). Region features are the features of the region corresponding to the camouflaged insect target.
[0138] To improve the accuracy of the localization results for camouflaged insect targets, spatial information enhancement processing is performed on the aforementioned pyramid features to obtain the aforementioned first enhanced features. Specifically, spatial information enhancement processing is performed on the features of each layer in the pyramid network, and the resulting first enhanced features include the enhanced features corresponding to each layer in the pyramid network.
[0139] Furthermore, the first enhancement feature is enhanced by using the edge and region features corresponding to the camouflaged insect target to obtain the second enhancement feature, and then the camouflaged insect target is located in the agricultural scene image based on the second enhancement feature.
[0140] In this embodiment of the invention, by acquiring an agricultural scene image, wherein the displayed content in the agricultural scene image includes: camouflaged insect targets, feature extraction is performed on the agricultural scene image to obtain pyramid features, edge features, and region features corresponding to the camouflaged insect targets, spatial information enhancement processing is performed on the pyramid features to obtain a first enhanced feature, and the first enhanced feature is guided enhancement processing using the edge features and region features to obtain a second enhanced feature, and further based on the second enhanced feature, the camouflaged insect targets are located in the agricultural scene image.
[0141] It is noteworthy that, through the embodiments of the present invention, for target detection scenarios of non-salient targets in the agricultural field, the edge features and region features corresponding to camouflaged insect targets in agricultural scene images are enhanced, and the prediction results corresponding to camouflaged insect targets are further obtained. This achieves the purpose of accurately locating camouflaged insect targets in agricultural scene images based on the enhanced edge features and region features, thereby realizing the technical effect of improving the accuracy of camouflaged insect target location in insect target detection scenarios in the agricultural field, and thus solving the technical problems of high detection difficulty and low location accuracy of camouflaged insect targets in related technologies.
[0142] It should be noted that, compared with the prior art, the method provided by the present invention can perform region perception and edge perception based on shallow edge features and high-level semantic features in the camouflage insect identification scenario in the agricultural field, extract edge information maps and region information maps of camouflage insect targets, and assign these edge information maps and region information maps to each layer of the pyramid features, thereby strengthening the edge feature expression and region feature expression of each layer of the pyramid features, and further accurately locating camouflage insect targets in agricultural scene images.
[0143] It is easy to understand that the key point of the image recognition method provided by this invention is: in the scenario of identifying camouflaged insects in the agricultural field, coarse prediction is performed through shallow edge features and high-level semantic features to obtain region maps and edge maps; the features of each layer of the pyramid network are enhanced by using a dual-guided approach of region maps and edge maps; and the expression of edge features is further strengthened through feature fusion.
[0144] It should be noted that the preferred implementation of this embodiment can be found in the relevant description in Embodiment 1, and will not be repeated here.
[0145] Example 3
[0146] According to embodiments of the present invention, under the above-described operating environment, the present invention also provides, as follows: Figure 9 This illustrates an image recognition method. Figure 9 This is a flowchart of another image recognition method according to an embodiment of the present invention, such as... Figure 9As shown, the image recognition method includes:
[0147] Step S91: Acquire an industrial scene image, wherein the displayed content in the industrial scene image includes: camouflage color defect target;
[0148] Step S92: Extract features from the industrial scene image to obtain the pyramid features, edge features, and region features corresponding to the camouflage color defect target;
[0149] Step S93: Perform spatial information enhancement processing on the pyramid features to obtain the first enhanced feature;
[0150] Step S94: Use edge features and region features to perform guided enhancement processing on the first enhancement feature to obtain the second enhancement feature;
[0151] Step S95: Based on the second enhanced features, locate the camouflage color defect target in the industrial scene image.
[0152] In this embodiment of the invention, the industrial scene image can be an image to be identified in a camouflage-colored defect target detection scenario in the industrial field (such as a defect identification scenario for industrial products). The content displayed in the industrial scene image includes camouflage-colored defect targets (such as silver defect targets on silver metal workpieces).
[0153] Feature extraction was performed on the industrial scene image to obtain the pyramid features, edge features, and region features corresponding to the camouflage-colored defect target. Pyramid features are the features of each layer in the pyramid network (e.g., shallow, medium, and deep features). Edge features are the boundary features between the camouflage-colored defect target and other objects in the industrial scene image (such as the workbench, other areas of the workpiece, etc.). Region features are the features of the region corresponding to the camouflage-colored defect target.
[0154] To improve the accuracy of the localization results of camouflage-defect targets, spatial information enhancement processing is performed on the aforementioned pyramid features to obtain the aforementioned first enhanced features. Specifically, spatial information enhancement processing is performed on the features of each layer in the pyramid network, and the obtained first enhanced features include the enhanced features corresponding to each layer in the pyramid network.
[0155] Furthermore, the first enhancement feature is enhanced by using the edge and region features corresponding to the camouflage defect target to obtain the second enhancement feature, and then the camouflage defect target is located in the industrial scene image based on the second enhancement feature.
[0156] In this embodiment of the invention, by acquiring an industrial scene image, wherein the displayed content in the industrial scene image includes a camouflage-colored defect target, feature extraction is performed on the industrial scene image to obtain pyramid features, edge features, and region features corresponding to the camouflage-colored defect target, spatial information enhancement processing is performed on the pyramid features to obtain a first enhanced feature, and the first enhanced feature is guided enhancement processing is performed using the edge features and region features to obtain a second enhanced feature, and further based on the second enhanced feature, the camouflage-colored defect target is located in the industrial scene image.
[0157] It is noteworthy that, through the embodiments of the present invention, for target detection scenarios of non-salient targets in the industrial field, the edge features and region features corresponding to camouflage-colored defect targets in industrial scene images are enhanced, and the prediction results corresponding to camouflage-colored defect targets are further obtained. This achieves the purpose of accurately locating camouflage-colored defect targets in industrial scene images based on the enhanced edge features and region features, thereby realizing the technical effect of improving the accuracy of camouflage-colored defect target location in defect target detection scenarios in the industrial field, and thus solving the technical problems of high detection difficulty and low location accuracy of camouflage-colored defect target location in related technologies.
[0158] It should be noted that, compared with the prior art, the method provided by the present invention can perform region perception and edge perception based on shallow edge features and high-level semantic features in the camouflage insect identification scenario in the industrial field, extract edge information maps and region information maps of camouflage defect targets, and assign these edge information maps and region information maps to each layer of the pyramid features, thereby strengthening the edge feature expression and region feature expression of each layer of the pyramid features, and further accurately locating camouflage defect targets in industrial scene images.
[0159] It is easy to understand that the key point of the image recognition method provided by this invention is: in the scenario of camouflage color defect recognition in the industrial field, coarse prediction is performed through shallow edge features and high-level semantic features to obtain region maps and edge maps; the features of each layer of the pyramid network are enhanced by using the dual guidance of region maps and edge maps; and the expression of edge features is further strengthened through feature fusion.
[0160] It should be noted that the preferred implementation of this embodiment can be found in the relevant description in Embodiment 1, and will not be repeated here.
[0161] Example 4
[0162] According to embodiments of the present invention, under the above-described operating environment, the present invention also provides, as follows: Figure 10 This illustrates an image recognition method. Figure 10 This is a flowchart of another image recognition method according to an embodiment of the present invention, such as... Figure 10As shown, the image recognition method includes:
[0163] Step S1001: Obtain a game scene image, wherein the display content in the game scene image includes: camouflage color to distinguish targets;
[0164] Step S1002: Extract features from the game scene image to obtain the pyramid features, edge features, and region features corresponding to the camouflage color distinguishing target;
[0165] Step S1003: Perform spatial information enhancement processing on the pyramid features to obtain the first enhanced feature;
[0166] Step S1004: Use edge features and region features to perform guided enhancement processing on the first enhancement feature to obtain the second enhancement feature;
[0167] Step S1005: Based on the second enhanced feature, locate the camouflage color distinguishable target in the game scene image.
[0168] In this embodiment of the invention, the game scene image can be an image to be identified in a camouflage-colored distinguishable target detection scenario (such as a spot-the-difference game scenario) within the game domain. The content displayed in the game scene image includes camouflage-colored distinguishable targets (such as distinguishable targets similar to the game background texture).
[0169] Feature extraction is performed on the game scene image to obtain the pyramid features, edge features, and region features corresponding to the camouflage color-differentiating targets. Pyramid features are the features of each layer in the pyramid network (e.g., shallow, mid-layer, and deep features). Edge features are the boundary features between the camouflage color-differentiating targets and other objects in the game scene image (such as other game characters, game scene background, etc.). Region features are the features of the regions corresponding to the camouflage color-differentiating targets.
[0170] To improve the accuracy of target localization results based on camouflage color differentiation, spatial information enhancement processing is performed on the aforementioned pyramid features to obtain the aforementioned first enhanced features. Specifically, spatial information enhancement processing is performed on the features of each layer in the pyramid network, and the resulting first enhanced features include the enhanced features corresponding to each layer in the pyramid network.
[0171] Furthermore, the first enhancement feature is enhanced by using the edge and region features corresponding to the camouflage color-differentiating target to obtain the second enhancement feature, and then the camouflage color-differentiating target is located in the game scene image based on the second enhancement feature.
[0172] In this embodiment of the invention, a game scene image is acquired, wherein the displayed content in the game scene image includes: a camouflage color distinguishing target. Feature extraction is performed on the game scene image to obtain pyramid features, edge features, and region features corresponding to the camouflage color distinguishing target. Spatial information enhancement processing is performed on the pyramid features to obtain a first enhanced feature. The edge features and region features are used to perform guided enhancement processing on the first enhanced feature to obtain a second enhanced feature. Furthermore, based on the second enhanced feature, the camouflage color distinguishing target is located in the game scene image.
[0173] It is noteworthy that, through the embodiments of the present invention, for target detection scenarios of non-salient targets in the game domain, the edge features and region features corresponding to the camouflage-colored distinguishable targets in the game scene image are enhanced, and the prediction results corresponding to the camouflage-colored distinguishable targets are further obtained. This achieves the purpose of accurately locating the camouflage-colored distinguishable targets in the game scene image based on the enhanced edge features and region features, thereby realizing the technical effect of improving the accuracy of camouflage-colored distinguishable target location in the distinguishable target detection scenario in the game domain, and thus solving the technical problems of high detection difficulty and low location accuracy of camouflage-colored distinguishable targets in related technologies.
[0174] It should be noted that, compared with the prior art, the method provided by the present invention can perform region perception and edge perception based on shallow edge features and high-level semantic features in the camouflage insect recognition scenario in the game field, extract edge information maps and region information maps of camouflage distinguishable targets, and assign these edge information maps and region information maps to each layer of the pyramid features, thereby strengthening the edge feature expression and region feature expression of each layer of the pyramid features, and further accurately locating camouflage distinguishable targets in game scene images.
[0175] It is easy to understand that the key point of the image recognition method provided by this invention is: in the camouflage color defect recognition scenario in the game field, coarse prediction is performed through shallow edge features and high-level semantic features to obtain region maps and edge maps; the features of each layer of the pyramid network are enhanced by using the dual guidance of region maps and edge maps; and the expression of edge features is further strengthened through feature fusion.
[0176] It should be noted that the preferred implementation of this embodiment can be found in the relevant description in Embodiment 1, and will not be repeated here.
[0177] Example 5
[0178] According to an embodiment of the present invention, an apparatus embodiment for implementing the above-described image recognition method is also provided. Figure 11 This is a schematic diagram of the structure of an image recognition device according to an embodiment of the present invention, such as... Figure 11As shown, the device includes: an acquisition module 1101, an extraction module 1102, a first processing module 1103, a second processing module 1104, and an identification module 1105, wherein,
[0179] The acquisition module 1101 is used to acquire an image to be recognized, wherein the display content in the image to be recognized includes a foreground target object; the extraction module 1102 is used to extract features from the image to be recognized to obtain pyramid features, edge features, and region features corresponding to the foreground target object; the first processing module 1103 is used to perform spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; the second processing module 1104 is used to perform guided enhancement processing on the first enhanced feature using edge features and region features to obtain a second enhanced feature; and the recognition module 1105 is used to obtain the prediction result corresponding to the foreground target object based on the second enhanced feature.
[0180] Optionally, the extraction module 1102 is further configured to: extract features from the image to be identified using a deep residual network model to obtain edge features and region features. The deep residual network model is trained using multiple sets of data through machine learning. Each set of data includes: a sample image and the localization result corresponding to the foreground target in the sample image. The deep residual network model includes: multiple feature layers, which include: a shallow edge feature layer, multiple intermediate feature layers, and a deep semantic feature layer. The shallow edge feature layer is a shallow edge feature layer, the deep semantic feature layer is a deep semantic feature layer, and the multiple intermediate feature layers are intermediate feature layers that are sequentially connected between the shallow edge feature layer and the deep semantic feature layer.
[0181] Optionally, the extraction module 1102 is further configured to: perform upsampling processing on the deep semantic features in the deep semantic feature layer using a deep residual network model to obtain a first sampling result; and jointly predict the first sampling result and the shallow edge features in the shallow edge feature layer to obtain edge features.
[0182] Optionally, the extraction module 1102 is further configured to: use a deep residual network model to downsample the shallow edge features in the shallow edge feature layer to obtain a second sampling result; and jointly predict the second sampling result with the deep semantic features in the deep semantic feature layer to obtain regional features.
[0183] Optionally, the recognition module 1105 is further configured to: perform region and edge guidance processing on edge features, region features and second enhancement features for each feature layer in the shallow edge feature layer and multiple intermediate feature layers to obtain the guidance processing result corresponding to each feature layer; and perform feature fusion on the second enhancement feature corresponding to the deep semantic feature layer with the guidance processing result corresponding to each feature layer in sequence to obtain the prediction result corresponding to the foreground target object.
[0184] Optionally, the aforementioned recognition module 1105 is further configured to: perform region-guided processing on the region features and the second enhancement features to obtain a first guidance processing sub-result, and perform region-guided processing on the background features and the second enhancement features to obtain a second guidance processing sub-result, wherein the background features are determined by the region features; perform channel-level feature enhancement processing on the first guidance processing sub-result to obtain a third guidance processing sub-result, and perform channel-level feature enhancement processing on the second guidance processing sub-result to obtain a fourth guidance processing sub-result; perform fusion processing on the third guidance processing sub-result and the fourth guidance processing sub-result to obtain a fifth guidance processing sub-result; and perform edge guidance processing on the fifth guidance processing sub-result and the edge features to obtain the guidance processing result corresponding to each feature layer.
[0185] Optionally, the identification module 1105 is further configured to: determine whether there is an intermediate feature layer adjacent to the deep semantic feature layer; in response to the existence of an intermediate feature layer adjacent to the deep semantic feature layer, perform feature fusion on the second enhanced feature corresponding to the deep semantic feature layer and the guided processing result corresponding to the adjacent intermediate feature layer to obtain the fusion result corresponding to the adjacent intermediate feature layer; starting from the adjacent intermediate feature layer, along the direction from the deep semantic feature layer to the shallow edge feature layer, sequentially determine whether there is a preceding feature layer adjacent to the current feature layer; in response to the existence of a preceding feature layer adjacent to the current feature layer, sequentially perform feature fusion on the fusion result corresponding to the current feature layer and the guided processing result corresponding to the preceding feature layer, until the prediction result corresponding to the foreground target object is obtained through the fusion result corresponding to the shallow edge feature layer.
[0186] It should be noted that the acquisition module 1101, extraction module 1102, first processing module 1103, second processing module 1104, and identification module 1105 mentioned above correspond to steps S21 to S25 in Embodiment 1. The five modules and their corresponding steps implement the same examples and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should also be noted that the above modules, as part of the device, can run in the computer terminal 10 provided in Embodiment 1.
[0187] In this embodiment of the invention, by acquiring an image to be identified, wherein the displayed content in the image to be identified includes a foreground target object, feature extraction is performed on the image to be identified to obtain pyramid features, edge features and region features corresponding to the foreground target object, spatial information enhancement processing is performed on the pyramid features to obtain a first enhanced feature, and the first enhanced feature is guided enhancement processing is performed using the edge features and region features to obtain a second enhanced feature, and further based on the second enhanced feature, the prediction result corresponding to the foreground target object is obtained.
[0188] It is noteworthy that, through the embodiments of the present invention, for target detection scenarios with non-salient targets, the edge features and region features corresponding to the foreground target object in the image to be identified are enhanced, and the prediction results corresponding to the foreground target object are further obtained. This achieves the purpose of determining the prediction results corresponding to the foreground target object based on the enhanced edge features and region features, thereby achieving the technical effect of improving the accuracy of the prediction results corresponding to the foreground target object in target detection scenarios with consistent visual perception before and after, and thus solving the technical problems of high prediction difficulty and low prediction accuracy in related technologies.
[0189] According to an embodiment of the present invention, an apparatus embodiment for implementing another image recognition method described above is also provided. Figure 12 This is a schematic diagram of the structure of another image recognition device according to an embodiment of the present invention, such as... Figure 12 As shown, the device includes: an acquisition module 1201, an extraction module 1202, a first processing module 1203, a second processing module 1204, and a positioning module 1205, wherein,
[0190] The acquisition module 1201 is used to acquire an agricultural scene image, wherein the displayed content in the agricultural scene image includes: camouflaged insect targets; the extraction module 1202 is used to extract features from the agricultural scene image to obtain pyramid features, edge features, and region features corresponding to the camouflaged insect targets; the first processing module 1203 is used to perform spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; the second processing module 1204 is used to perform guided enhancement processing on the first enhanced feature using edge features and region features to obtain a second enhanced feature; and the localization module 1205 is used to localize the camouflaged insect targets in the agricultural scene image based on the second enhanced feature.
[0191] It should be noted that the acquisition module 1201, extraction module 1202, first processing module 1203, second processing module 1204, and positioning module 1205 mentioned above correspond to steps S81 to S85 in Embodiment 2. The five modules and their corresponding steps implement the same examples and application scenarios, but are not limited to the content disclosed in Embodiment 2. It should also be noted that the above modules, as part of the device, can run in the computer terminal 10 provided in Embodiment 2.
[0192] In this embodiment of the invention, by acquiring an agricultural scene image, wherein the displayed content in the agricultural scene image includes: camouflaged insect targets, feature extraction is performed on the agricultural scene image to obtain pyramid features, edge features, and region features corresponding to the camouflaged insect targets, spatial information enhancement processing is performed on the pyramid features to obtain a first enhanced feature, and the first enhanced feature is guided enhancement processing using the edge features and region features to obtain a second enhanced feature, and further based on the second enhanced feature, the camouflaged insect targets are located in the agricultural scene image.
[0193] It is noteworthy that, through the embodiments of the present invention, for target detection scenarios of non-salient targets in the agricultural field, the edge features and region features corresponding to camouflaged insect targets in agricultural scene images are enhanced, and the prediction results corresponding to camouflaged insect targets are further obtained. This achieves the purpose of accurately locating camouflaged insect targets in agricultural scene images based on the enhanced edge features and region features, thereby realizing the technical effect of improving the accuracy of camouflaged insect target location in insect target detection scenarios in the agricultural field, and thus solving the technical problems of high detection difficulty and low location accuracy of camouflaged insect targets in related technologies.
[0194] It should be noted that, compared with the prior art, the method provided by the present invention can perform region perception and edge perception based on shallow edge features and high-level semantic features in the camouflage insect identification scenario in the agricultural field, extract edge information maps and region information maps of camouflage insect targets, and assign these edge information maps and region information maps to each layer of the pyramid features, thereby strengthening the edge feature expression and region feature expression of each layer of the pyramid features, and further accurately locating camouflage insect targets in agricultural scene images.
[0195] According to an embodiment of the present invention, an apparatus embodiment for implementing yet another image recognition method described above is also provided. Figure 13 This is a schematic diagram of the structure of another image recognition device according to an embodiment of the present invention, such as... Figure 13 As shown, the device includes: an acquisition module 1301, an extraction module 1302, a first processing module 1303, a second processing module 1304, and a positioning module 1305, wherein,
[0196] The acquisition module 1301 is used to acquire an industrial scene image, wherein the displayed content in the industrial scene image includes a camouflage-colored defect target; the extraction module 1302 is used to extract features from the industrial scene image to obtain pyramid features, edge features, and region features corresponding to the camouflage-colored defect target; the first processing module 1303 is used to perform spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; the second processing module 1304 is used to perform guided enhancement processing on the first enhanced feature using the edge features and region features to obtain a second enhanced feature; and the localization module 1305 is used to localize the camouflage-colored defect target in the industrial scene image based on the second enhanced feature.
[0197] It should be noted that the acquisition module 1301, extraction module 1302, first processing module 1303, second processing module 1304, and positioning module 1305 mentioned above correspond to steps S91 to S95 in Embodiment 3. The five modules and their corresponding steps implement the same examples and application scenarios, but are not limited to the content disclosed in Embodiment 3. It should also be noted that the above modules, as part of the device, can run in the computer terminal 10 provided in Embodiment 3.
[0198] In this embodiment of the invention, by acquiring an industrial scene image, wherein the displayed content in the industrial scene image includes a camouflage-colored defect target, feature extraction is performed on the industrial scene image to obtain pyramid features, edge features, and region features corresponding to the camouflage-colored defect target, spatial information enhancement processing is performed on the pyramid features to obtain a first enhanced feature, and the first enhanced feature is guided enhancement processing is performed using the edge features and region features to obtain a second enhanced feature, and further based on the second enhanced feature, the camouflage-colored defect target is located in the industrial scene image.
[0199] It is noteworthy that, through the embodiments of the present invention, for target detection scenarios of non-salient targets in the industrial field, the edge features and region features corresponding to camouflage-colored defect targets in industrial scene images are enhanced, and the prediction results corresponding to camouflage-colored defect targets are further obtained. This achieves the purpose of accurately locating camouflage-colored defect targets in industrial scene images based on the enhanced edge features and region features, thereby realizing the technical effect of improving the accuracy of camouflage-colored defect target location in defect target detection scenarios in the industrial field, and thus solving the technical problems of high detection difficulty and low location accuracy of camouflage-colored defect target location in related technologies.
[0200] According to an embodiment of the present invention, an apparatus embodiment for implementing yet another image recognition method described above is also provided. Figure 14 This is a schematic diagram of the structure of another image recognition device according to an embodiment of the present invention, such as... Figure 14As shown, the device includes: an acquisition module 1401, an extraction module 1402, a first processing module 1403, a second processing module 1404, and a positioning module 1405, wherein,
[0201] The acquisition module 1401 is used to acquire a game scene image, wherein the displayed content in the game scene image includes: camouflage color distinguishing target; the extraction module 1402 is used to extract features from the game scene image to obtain pyramid features, edge features, and region features corresponding to the camouflage color distinguishing target; the first processing module 1403 is used to perform spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; the second processing module 1404 is used to perform guided enhancement processing on the first enhanced feature using edge features and region features to obtain a second enhanced feature; and the localization module 1405 is used to localize the camouflage color distinguishing target in the game scene image based on the enhanced features.
[0202] It should be noted that the acquisition module 1401, extraction module 1402, first processing module 1403, second processing module 1404, and positioning module 1405 mentioned above correspond to steps S1001 to S1005 in Embodiment 4. The four modules and their corresponding steps implement the same examples and application scenarios, but are not limited to the content disclosed in Embodiment 4. It should also be noted that the above modules, as part of the device, can run in the computer terminal 10 provided in Embodiment 4.
[0203] In this embodiment of the invention, a game scene image is acquired, wherein the displayed content in the game scene image includes: a camouflage color distinguishing target. Feature extraction is performed on the game scene image to obtain pyramid features, edge features, and region features corresponding to the camouflage color distinguishing target. Spatial information enhancement processing is performed on the pyramid features to obtain a first enhanced feature. The edge features and region features are used to perform guided enhancement processing on the first enhanced feature to obtain a second enhanced feature. Furthermore, based on the second enhanced feature, the camouflage color distinguishing target is located in the game scene image.
[0204] It is noteworthy that, through the embodiments of the present invention, for target detection scenarios of non-salient targets in the game domain, the edge features and region features corresponding to the camouflage-colored distinguishable targets in the game scene image are enhanced, and the prediction results corresponding to the camouflage-colored distinguishable targets are further obtained. This achieves the purpose of accurately locating the camouflage-colored distinguishable targets in the game scene image based on the enhanced edge features and region features, thereby realizing the technical effect of improving the accuracy of camouflage-colored distinguishable target location in the distinguishable target detection scenario in the game domain, and thus solving the technical problems of high detection difficulty and low location accuracy of camouflage-colored distinguishable targets in related technologies.
[0205] It should be noted that the preferred implementation of this embodiment can be found in the relevant descriptions in Embodiments 1 to 4, and will not be repeated here.
[0206] Example 6
[0207] According to an embodiment of the present invention, an embodiment of an electronic device is also provided, which may be any computing device in a group of computing devices. The electronic device includes: a processor and a memory, wherein:
[0208] The memory, connected to the processor, is used to provide the processor with instructions to perform the following processing steps: acquiring an image to be recognized, wherein the display content in the image to be recognized includes a foreground target object; extracting features from the image to be recognized to obtain pyramid features, edge features, and region features corresponding to the foreground target object; performing spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; using the edge features and region features to perform guided enhancement processing on the first enhanced feature to obtain a second enhanced feature; and acquiring the prediction result corresponding to the foreground target object based on the second enhanced feature.
[0209] In this embodiment of the invention, by acquiring an image to be identified, wherein the displayed content in the image to be identified includes a foreground target object, feature extraction is performed on the image to be identified to obtain pyramid features, edge features and region features corresponding to the foreground target object, spatial information enhancement processing is performed on the pyramid features to obtain a first enhanced feature, and the first enhanced feature is guided enhancement processing is performed using the edge features and region features to obtain a second enhanced feature, and further based on the second enhanced feature, the prediction result corresponding to the foreground target object is obtained.
[0210] It is noteworthy that, through the embodiments of the present invention, for target detection scenarios with non-salient targets, the edge features and region features corresponding to the foreground target object in the image to be identified are enhanced, and the prediction results corresponding to the foreground target object are further obtained. This achieves the purpose of determining the prediction results corresponding to the foreground target object based on the enhanced edge features and region features, thereby achieving the technical effect of improving the accuracy of the prediction results corresponding to the foreground target object in target detection scenarios with consistent visual perception before and after, and thus solving the technical problems of high prediction difficulty and low prediction accuracy in related technologies.
[0211] It should be noted that the preferred implementation of this embodiment can be found in the relevant description in Embodiment 1, and will not be repeated here.
[0212] Example 7
[0213] Embodiments of the present invention can provide a computer terminal, which can be any computer terminal device in a group of computer terminals. Optionally, in this embodiment, the computer terminal can also be replaced by a mobile terminal or other terminal device.
[0214] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.
[0215] In this embodiment, the computer terminal described above can execute the program code for the following steps in the image recognition method: acquiring an image to be recognized, wherein the display content in the image to be recognized includes: a foreground target object; extracting features from the image to be recognized to obtain pyramid features, edge features, and region features corresponding to the foreground target object; performing spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; using the edge features and region features to perform guided enhancement processing on the first enhanced feature to obtain a second enhanced feature; and based on the second enhanced feature, obtaining the prediction result corresponding to the foreground target object.
[0216] Optionally, Figure 15 This is a structural block diagram of another computer terminal according to an embodiment of the present invention, such as... Figure 15 As shown, the computer terminal may include one or more (only one is shown in the figure) processors 122, memory 124, and peripheral interfaces 126.
[0217] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the image recognition method and apparatus in this embodiment of the invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned image recognition method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0218] The processor can invoke information and application programs stored in the memory through the transmission device to perform the following steps: acquiring an image to be recognized, wherein the displayed content in the image to be recognized includes a foreground target object; extracting features from the image to be recognized to obtain pyramid features, edge features, and region features corresponding to the foreground target object; performing spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; using the edge features and region features to perform guided enhancement processing on the first enhanced feature to obtain a second enhanced feature; and obtaining a prediction result corresponding to the foreground target object based on the second enhanced feature.
[0219] Optionally, the processor may also execute program code for the following steps: extracting features from the image to be recognized using a deep residual network model to obtain edge features and region features. The deep residual network model is trained using multiple sets of data through machine learning. Each set of data includes: a sample image and the localization result corresponding to the foreground target in the sample image. The deep residual network model includes: multiple feature layers, which include: a shallow edge feature layer, multiple intermediate feature layers, and a deep semantic feature layer. The shallow edge feature layer is a shallow edge feature layer, the deep semantic feature layer is a deep semantic feature layer, and the multiple intermediate feature layers are intermediate feature layers that are sequentially connected between the shallow edge feature layer and the deep semantic feature layer.
[0220] Optionally, the processor may also execute program code that performs the following steps: upsampling the deep semantic features in the deep semantic feature layer using a deep residual network model to obtain a first sampling result; and jointly predicting the first sampling result with the shallow edge features in the shallow edge feature layer to obtain edge features.
[0221] Optionally, the processor may also execute program code that performs the following steps: downsampling the shallow edge features in the shallow edge feature layer using a deep residual network model to obtain a second sampling result; and jointly predicting the second sampling result with the deep semantic features in the deep semantic feature layer to obtain regional features.
[0222] Optionally, the processor may also execute program code that performs the following steps: for each of the shallow edge feature layers and multiple intermediate feature layers, perform region and edge guidance processing on the edge features, region features and second enhancement features to obtain the guidance processing result corresponding to each feature layer; and perform feature fusion between the second enhancement feature corresponding to the deep semantic feature layer and the guidance processing result corresponding to each feature layer to obtain the prediction result corresponding to the foreground target object.
[0223] Optionally, the processor may also execute program code for the following steps: performing region-guided processing on the region features and the second enhancement features to obtain a first guidance processing sub-result, and performing region-guided processing on the background features and the second enhancement features to obtain a second guidance processing sub-result, wherein the background features are determined by the region features; performing channel-level feature enhancement processing on the first guidance processing sub-result to obtain a third guidance processing sub-result, and performing channel-level feature enhancement processing on the second guidance processing sub-result to obtain a fourth guidance processing sub-result; performing fusion processing on the third guidance processing sub-result and the fourth guidance processing sub-result to obtain a fifth guidance processing sub-result; and performing edge guidance processing on the fifth guidance processing sub-result and the edge features to obtain the guidance processing result corresponding to each feature layer.
[0224] Optionally, the processor may also execute program code for the following steps: determining whether there is an intermediate feature layer adjacent to the deep semantic feature layer; in response to the existence of an intermediate feature layer adjacent to the deep semantic feature layer, performing feature fusion on the second enhanced feature corresponding to the deep semantic feature layer and the guided processing result corresponding to the adjacent intermediate feature layer to obtain the fusion result corresponding to the adjacent intermediate feature layer; starting from the adjacent intermediate feature layer, sequentially determining whether there is a preceding feature layer adjacent to the current feature layer along the direction from the deep semantic feature layer to the shallow edge feature layer; in response to the existence of a preceding feature layer adjacent to the current feature layer, sequentially performing feature fusion on the fusion result corresponding to the current feature layer and the guided processing result corresponding to the preceding feature layer, until the prediction result corresponding to the foreground target object is obtained through the fusion result corresponding to the shallow edge feature layer.
[0225] The processor can invoke information and application programs stored in the memory through the transmission device to perform the following steps: receiving an image to be recognized from the client, wherein the displayed content in the image to be recognized includes a foreground target object; extracting features from the image to be recognized to obtain pyramid features, edge features, and region features corresponding to the foreground target object; performing spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; using the edge features and region features to perform guided enhancement processing on the first enhanced feature to obtain a second enhanced feature; and obtaining a prediction result corresponding to the foreground target object based on the second enhanced feature; and feeding back the prediction result to the client.
[0226] The processor can access information and applications stored in the memory via a transmission device to perform the following steps: acquiring an agricultural scene image, wherein the displayed content in the agricultural scene image includes: camouflaged insect targets; extracting features from the agricultural scene image to obtain pyramid features, edge features, and region features corresponding to the camouflaged insect targets; performing spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; using the edge features and region features to perform guided enhancement processing on the first enhanced feature to obtain a second enhanced feature; and locating the camouflaged insect targets in the agricultural scene image based on the second enhanced feature.
[0227] The processor can access information and applications stored in the memory via a transmission device to perform the following steps: acquiring an industrial scene image, wherein the displayed content in the industrial scene image includes a camouflage-colored defect target; extracting features from the industrial scene image to obtain pyramid features, edge features, and region features corresponding to the camouflage-colored defect target; performing spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; using the edge features and region features to perform guided enhancement processing on the first enhanced feature to obtain a second enhanced feature; and locating the camouflage-colored defect target in the industrial scene image based on the second enhanced feature.
[0228] The processor can access information and applications stored in the memory via a transmission device to perform the following steps: acquiring a game scene image, wherein the displayed content in the game scene image includes: a camouflage-colored distinguishing target; extracting features from the game scene image to obtain pyramid features, edge features, and region features corresponding to the camouflage-colored distinguishing target; performing spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; using the edge features and region features to perform guided enhancement processing on the first enhanced feature to obtain a second enhanced feature; and locating the camouflage-colored distinguishing target in the game scene image based on the second enhanced feature.
[0229] In this embodiment of the invention, by acquiring an image to be identified, wherein the displayed content in the image to be identified includes a foreground target object, feature extraction is performed on the image to be identified to obtain pyramid features, edge features and region features corresponding to the foreground target object, spatial information enhancement processing is performed on the pyramid features to obtain a first enhanced feature, and the first enhanced feature is guided enhancement processing is performed using the edge features and region features to obtain a second enhanced feature, and further based on the second enhanced feature, the prediction result corresponding to the foreground target object is obtained.
[0230] It is noteworthy that, through the embodiments of the present invention, for target detection scenarios with non-salient targets, the edge features and region features corresponding to the foreground target object in the image to be identified are enhanced, and the prediction results corresponding to the foreground target object are further obtained. This achieves the purpose of determining the prediction results corresponding to the foreground target object based on the enhanced edge features and region features, thereby achieving the technical effect of improving the accuracy of the prediction results corresponding to the foreground target object in target detection scenarios with consistent visual perception before and after, and thus solving the technical problems of high prediction difficulty and low prediction accuracy in related technologies.
[0231] Those skilled in the art will understand that Figure 15 The structure shown is for illustrative purposes only. The computer terminal can also be a smartphone (such as an Android phone, an iOS phone, etc.), a tablet computer, a mobile computer, or a mobile internet device (MID). Figure 15 This does not limit the structure of the aforementioned electronic devices. For example, a computer terminal may also include components that are more... Figure 15 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 15 The different configurations shown.
[0232] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0233] According to an embodiment of the present invention, an embodiment of a storage medium is also provided. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the image recognition method provided in Embodiment 1.
[0234] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0235] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: acquiring an image to be identified, wherein the display content in the image to be identified includes a foreground target object; extracting features from the image to be identified to obtain pyramid features, edge features, and region features corresponding to the foreground target object; performing spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; using the edge features and region features to perform guided enhancement processing on the first enhanced feature to obtain a second enhanced feature; and acquiring a prediction result corresponding to the foreground target object based on the second enhanced feature.
[0236] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: extracting features from the image to be identified using a deep residual network model to obtain edge features and region features, wherein the deep residual network model is trained using multiple sets of data through machine learning, and each set of data includes: a sample image and the localization result corresponding to the sample foreground target in the sample image, the deep residual network model includes: multiple feature layers, the multiple feature layers include: a shallow edge feature layer, multiple intermediate feature layers and a deep semantic feature layer, the shallow edge feature layer is a shallow edge feature layer, the deep semantic feature layer is a deep semantic feature layer, and the multiple intermediate feature layers are intermediate feature layers that are sequentially connected between the shallow edge feature layer and the deep semantic feature layer.
[0237] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: upsampling the deep semantic features in the deep semantic feature layer using a deep residual network model to obtain a first sampling result; and jointly predicting the first sampling result with the shallow edge features in the shallow edge feature layer to obtain edge features.
[0238] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: using a deep residual network model to downsample the shallow edge features in the shallow edge feature layer to obtain a second sampling result; and jointly predicting the second sampling result with the deep semantic features in the deep semantic feature layer to obtain regional features.
[0239] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: for each of the shallow edge feature layers and multiple intermediate feature layers, perform region and edge guidance processing on the edge features, region features, and second enhancement features to obtain the guidance processing result corresponding to each feature layer; perform feature fusion on the second enhancement features corresponding to the deep semantic feature layer with the guidance processing result corresponding to each feature layer in sequence to obtain the prediction result corresponding to the foreground target object.
[0240] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: performing region guidance processing on the region features and the second enhancement features to obtain a first guidance processing sub-result, and performing region guidance processing on the background features and the second enhancement features to obtain a second guidance processing sub-result, wherein the background features are determined by the region features; performing channel-level feature enhancement processing on the first guidance processing sub-result to obtain a third guidance processing sub-result, and performing channel-level feature enhancement processing on the second guidance processing sub-result to obtain a fourth guidance processing sub-result; performing fusion processing on the third guidance processing sub-result and the fourth guidance processing sub-result to obtain a fifth guidance processing sub-result; and performing edge guidance processing on the fifth guidance processing sub-result and the edge features to obtain the guidance processing result corresponding to each feature layer.
[0241] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: determining whether there is an intermediate feature layer adjacent to the deep semantic feature layer; in response to the existence of an intermediate feature layer adjacent to the deep semantic feature layer, performing feature fusion on the second enhanced feature corresponding to the deep semantic feature layer and the guided processing result corresponding to the adjacent intermediate feature layer to obtain the fusion result corresponding to the adjacent intermediate feature layer; starting from the adjacent intermediate feature layer, sequentially determining whether there is a preceding feature layer adjacent to the current feature layer along the direction from the deep semantic feature layer to the shallow edge feature layer; in response to the existence of a preceding feature layer adjacent to the current feature layer, sequentially performing feature fusion on the fusion result corresponding to the current feature layer and the guided processing result corresponding to the preceding feature layer, until the prediction result corresponding to the foreground target object is obtained through the fusion result corresponding to the shallow edge feature layer.
[0242] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: receiving an image to be identified from a client, wherein the displayed content in the image to be identified includes a foreground target object; performing feature extraction on the image to be identified to obtain pyramid features, edge features, and region features corresponding to the foreground target object; performing spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; performing guided enhancement processing on the first enhanced feature using the edge features and region features to obtain a second enhanced feature; and obtaining a prediction result corresponding to the foreground target object based on the second enhanced feature; and feeding back the prediction result to the client.
[0243] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: acquiring an agricultural scene image, wherein the displayed content in the agricultural scene image includes: a camouflaged insect target; extracting features from the agricultural scene image to obtain pyramid features, edge features, and region features corresponding to the camouflaged insect target; performing spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; using the edge features and region features to perform guided enhancement processing on the first enhanced feature to obtain a second enhanced feature; and locating the camouflaged insect target in the agricultural scene image based on the second enhanced feature.
[0244] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: acquiring an industrial scene image, wherein the displayed content in the industrial scene image includes: a camouflage-colored defect target; extracting features from the industrial scene image to obtain pyramid features, edge features, and region features corresponding to the camouflage-colored defect target; performing spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; using the edge features and region features to perform guided enhancement processing on the first enhanced feature to obtain a second enhanced feature; and locating the camouflage-colored defect target in the industrial scene image based on the second enhanced feature.
[0245] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: acquiring a game scene image, wherein the displayed content in the game scene image includes: a camouflage-distinguished target; extracting features from the game scene image to obtain pyramid features, edge features, and region features corresponding to the camouflage-distinguished target; performing spatial information enhancement processing on the pyramid features to obtain a first enhanced feature; using the edge features and region features to perform guided enhancement processing on the first enhanced feature to obtain a second enhanced feature; and locating the camouflage-distinguished target in the game scene image based on the second enhanced feature.
[0246] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0247] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0248] In the several embodiments provided by this invention, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection of units or modules may be electrical or other forms.
[0249] The units described as separate components may or may not be physically separate. 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 network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0250] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0251] If the integrated unit is implemented as 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, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, ROM, RAM, portable hard drives, magnetic disks, or optical disks.
[0252] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. An image recognition method characterized by, The method comprises: obtaining a to-be-recognized image, wherein the display content in the to-be-recognized image comprises a foreground target object; performing feature extraction on the to-be-recognized image to obtain pyramid features, edge features and region features corresponding to the foreground target object; performing spatial information enhancement processing on the pyramid features to obtain first enhanced features; performing guided enhancement processing on the first enhanced features by using the edge features and the region features to obtain second enhanced features; obtaining a prediction result corresponding to the foreground target object based on the second enhanced features.
2. The image recognition method of claim 1, wherein, The feature extraction on the to-be-recognized image to obtain the edge features and the region features corresponding to the foreground target object comprises: performing feature extraction on the to-be-recognized image by using a deep residual network model to obtain the edge features and the region features, wherein the deep residual network model is obtained by machine learning training by using a plurality of groups of data, each group of data in the plurality of groups of data comprises a sample image and a positioning result corresponding to a sample foreground target in the sample image, and the deep residual network model comprises a plurality of feature layers, the plurality of feature layers comprise a shallow edge feature layer, a plurality of intermediate feature layers and a deep semantic feature layer, and the plurality of intermediate feature layers are connected in sequence between the shallow edge feature layer and the deep semantic feature layer.
3. The image recognition method of claim 2, wherein, The feature extraction on the to-be-recognized image by using the deep residual network model to obtain the edge features comprises: performing up-sampling processing on deep semantic features in the deep semantic feature layer by using the deep residual network model to obtain a first sampling result; performing joint prediction on the first sampling result and shallow edge features in the shallow edge feature layer to obtain the edge features.
4. The image recognition method of claim 2, wherein, The feature extraction on the to-be-recognized image by using the deep residual network model to obtain the region features comprises: performing down-sampling processing on shallow edge features in the shallow edge feature layer by using the deep residual network model to obtain a second sampling result; performing joint prediction on the second sampling result and deep semantic features in the deep semantic feature layer to obtain the region features.
5. The image recognition method of claim 2, wherein, The obtaining of the prediction result corresponding to the foreground target object based on the second enhanced features comprises: for each feature layer in the shallow edge feature layer and the plurality of intermediate feature layers, performing region and edge guided processing on the edge features, the region features and the second enhanced features to obtain a guided processing result corresponding to each feature layer; performing feature fusion on the second enhanced features corresponding to the deep semantic feature layer and the guided processing result corresponding to each feature layer in sequence to obtain the prediction result corresponding to the foreground target object.
6. The image recognition method of claim 5, wherein, The region and edge guided processing on the edge features, the region features and the second enhanced features to obtain the guided processing result corresponding to each feature layer comprises: The region feature and the second enhanced feature are subjected to region guidance processing to obtain a first guided processing sub-result, and the background feature and the second enhanced feature are subjected to region guidance processing to obtain a second guided processing sub-result, wherein the background feature is determined by the region feature; The first guided processing sub-result is subjected to channel level feature strengthening processing to obtain a third guided processing sub-result, and the second guided processing sub-result is subjected to channel level feature strengthening processing to obtain a fourth guided processing sub-result; The third guided processing sub-result and the fourth guided processing sub-result are subjected to fusion processing to obtain a fifth guided processing sub-result; The fifth guided processing sub-result and the edge feature are subjected to edge guidance processing to obtain a guided processing result corresponding to each feature layer.
7. The image recognition method of claim 5, wherein, The second enhanced feature corresponding to the deep semantic feature layer is sequentially subjected to feature fusion with the guided processing result corresponding to each feature layer to obtain the prediction result corresponding to the foreground target object, including: determining whether there is an intermediate feature layer adjacent to the deep semantic feature layer; in response to the existence of the intermediate feature layer adjacent to the deep semantic feature layer, performing feature fusion on the second enhanced feature corresponding to the deep semantic feature layer and the guided processing result corresponding to the adjacent intermediate feature layer to obtain a fusion result corresponding to the adjacent intermediate feature layer; starting from the adjacent intermediate feature layer, sequentially determining whether there is a previous feature layer adjacent to the current feature layer from the deep semantic feature layer to the shallow edge feature layer; in response to the existence of the previous feature layer adjacent to the current feature layer, sequentially performing feature fusion on the fusion result corresponding to the current feature layer and the guided processing result corresponding to the previous feature layer until the prediction result corresponding to the foreground target object is obtained through the fusion result corresponding to the shallow edge feature layer.
8. An image recognition method characterized by, including: receiving a to-be-recognized image from a client, wherein the display content in the to-be-recognized image includes a foreground target object; performing feature extraction on the to-be-recognized image to obtain pyramid features, edge features and region features corresponding to the foreground target object, performing spatial information enhancement processing on the pyramid features to obtain first enhanced features, performing guided enhancement processing on the first enhanced features by using the edge features and the region features to obtain second enhanced features, and obtaining a prediction result corresponding to the foreground target object based on the second enhanced features; feeding back the prediction result to the client.
9. An image recognition method characterized by, including: obtaining an agricultural scene image, wherein the display content in the agricultural scene image includes a camouflage color insect target; performing feature extraction on the agricultural scene image to obtain pyramid features, edge features and region features corresponding to the camouflage color insect target; performing spatial information enhancement processing on the pyramid features to obtain first enhanced features; performing guided enhancement processing on the first enhanced features by using the edge features and the region features to obtain second enhanced features; based on the second enhanced features, positioning the camouflage color insect target in the agricultural scene image.
10. An image recognition method characterized by, The method comprises the following steps: An industrial scene image is acquired, wherein the display content in the industrial scene image comprises a camouflage color defect target; Feature extraction is performed on the industrial scene image to obtain pyramid features, edge features and region features corresponding to the camouflage color defect target; The pyramid features are subjected to spatial information enhancement processing to obtain first enhanced features; The first enhanced features are subjected to guided enhancement processing using the edge features and the region features to obtain second enhanced features; The camouflage color defect target is located in the industrial scene image based on the second enhanced features.
11. An image recognition method characterized by, The method comprises the following steps: A game scene image is acquired, wherein the display content in the game scene image comprises a camouflage color distinguishing target; Feature extraction is performed on the game scene image to obtain pyramid features, edge features and region features corresponding to the camouflage color distinguishing target; The pyramid features are subjected to spatial information enhancement processing to obtain first enhanced features; The first enhanced features are subjected to guided enhancement processing using the edge features and the region features to obtain second enhanced features; The camouflage color distinguishing target is located in the game scene image based on the second enhanced features.
12. An image recognition apparatus characterized by comprising: The method comprises the following steps: An acquisition module is configured to acquire a to-be-recognized image, wherein the display content in the to-be-recognized image comprises a foreground target object; An extraction module is configured to perform feature extraction on the to-be-recognized image to obtain pyramid features, edge features and region features corresponding to the foreground target object; A first processing module is configured to perform spatial information enhancement processing on the pyramid features to obtain first enhanced features; A second processing module is configured to perform guided enhancement processing on the first enhanced features using the edge features and the region features to obtain second enhanced features; An identification module is configured to acquire a prediction result corresponding to the foreground target object based on the second enhanced features.
13. A storage medium, characterized by The storage medium comprises a stored program, wherein the program controls a device in which the storage medium is located to perform the image recognition method in any one of claims 1 to 8 when the program is running.
14. An image recognition system characterized by, The method comprises the following steps: A processor; And A memory connected with the processor, configured to provide the processor with instructions for processing the following processing steps: A to-be-recognized image is acquired, wherein the display content in the to-be-recognized image comprises a foreground target object; Feature extraction is performed on the to-be-recognized image to obtain pyramid features, edge features and region features corresponding to the foreground target object; The pyramid features are subjected to spatial information enhancement processing to obtain first enhanced features; The first enhanced features are subjected to guided enhancement processing using the edge features and the region features to obtain second enhanced features; A prediction result corresponding to the foreground target object is acquired based on the second enhanced features.
Citation Information
Patent Citations
Image processing method and device, equipment, storage medium and computer program product
CN114359819A
Video saliency target detection system and method based on space-time convolutional neural network
CN114926760A