Chip, image processing method and device, and storage medium

By using numerical operation units and vector operation units in the image processing chip to perform bilinear interpolation operations, the problem of non-overlapping vertices in image area of ​​interest pooling processing is solved, and the accuracy and processing efficiency of image recognition are improved.

CN118537709APending Publication Date: 2024-08-23SHANGHAI POWERTENSORS INTELLIGENT TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410445993.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-12
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

In the pooling process of the image area of ​​interest in the existing technology, the vertices of the area do not coincide with the pixels of the feature map, resulting in a reduction in processing accuracy and affecting the accuracy of image recognition.

Method used

The numerical operation unit and vector operation unit determine the feature point configuration information in the image area of ​​interest, and perform bilinear interpolation operations to obtain the feature information for pooling processing to ensure processing accuracy and efficiency.

Benefits of technology

It improves the confidence and image recognition accuracy of the image area of ​​interest, simplifies the pooling process, and improves the processing speed and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537709A
    Figure CN118537709A
Patent Text Reader

Abstract

The invention provides a chip, an image processing method, a chip, a device and a storage medium, and the chip comprises a numerical value operation unit and a vector operation unit. The numerical calculation unit is used for determining an image region of interest of the to-be-processed feature map of the pooling layer, determining configuration information of a plurality of feature points based on region information of the image region of interest and storing the configuration information into a register, and the configuration information is used for indicating the position of each feature point in the image region of interest; the vector operation unit is used for reading the configuration information in the register, performing bilinear interpolation operation on each feature point based on the configuration information to obtain feature information, and determining a pooling processing result of a feature map corresponding to the region of interest of the image based on the feature information, the feature information is used for indicating a pixel value of a region matched with the feature point in the region of interest of the image. The chip provided by the invention is beneficial to improving the pooling processing efficiency of the region of interest of the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of computers, and in particular, to a chip, an image processing method, an apparatus, and a storage medium. Background Art

[0002] With the popularization of image processing technology, the requirements for image recognition accuracy in various usage scenarios are becoming increasingly higher. In related image processing technologies, feature maps are usually pooled through a pooling layer. Before pooling, it is necessary to identify the region of interest (ROI) in the feature map and perform image processing on the ROI. The region vertices of the image region of interest identified by the prior art usually do not coincide with the pixel points of the feature map. At this time, it is necessary to adjust the region vertices to coincide with the pixel points of the feature map before processing the image region of interest. However, if the deviation between the adjusted image region of interest and the initial image region of interest is large, it will affect the processing accuracy of the pooling layer on the image region of interest, thereby reducing the accuracy of image recognition for the complete image. Summary of the invention

[0003] The embodiments of the present disclosure at least provide a chip, an image processing method, an apparatus, and a storage medium.

[0004] In a first aspect, an embodiment of the present disclosure provides a chip, including a numerical operation unit and a vector operation unit;

[0005] The numerical operation unit is used to determine the image region of interest of the feature map to be processed by the pooling layer, and determine the configuration information of multiple feature points based on the region information of the image region of interest, and store the configuration information in a register, wherein the configuration information is used to indicate the position of each feature point in the image region of interest;

[0006] The vector operation unit is used to read the configuration information in the register, and perform a bilinear interpolation operation on each of the feature points based on the configuration information to obtain feature information, and determine a pooling processing result of the feature map corresponding to the image region of interest based on the feature information, wherein the feature information is used to indicate the pixel value of the area in the image region of interest that matches the feature point.

[0007] In an optional implementation manner, the image region of interest includes a plurality of sub-regions; and the numerical calculation unit is further used for:

[0008] Determine sub-configuration information of at least one target feature point in each of the sub-regions based on the region information, and obtain at least one sub-configuration information; wherein the sub-configuration information is used to indicate the position of each of the target feature points in the sub-region;

[0009] For each sub-configuration information, each sub-configuration information is stored in a register matching the sub-region.

[0010] In an optional implementation manner, the region information includes: region vertex coordinates of the image region of interest, first size information of the image region of interest, and second size information of the feature map; the numerical calculation unit is further used for:

[0011] Based on the first size information and the region vertex coordinates, determine the coordinate information of each of the feature points in an image coordinate system; wherein the image coordinate system is a two-dimensional coordinate system constructed based on the feature map;

[0012] Determine target interval information based on the first size information and the second size information; wherein the target interval information is used to indicate the interval between any two adjacent feature points in the direction of each coordinate axis of the image coordinate system;

[0013] The coordinate information and the target interval information are determined as the configuration information.

[0014] In an optional implementation manner, the numerical calculation unit is further used for:

[0015] Based on the first size information and the preset feature size, a first offset distance is determined; wherein the first offset distance is used to indicate the offset distance of each feature point relative to the coordinates of the region vertex on each coordinate axis, wherein the preset feature size is used to indicate the size information of the pooling processing result;

[0016] A sum operation is performed on the region vertex coordinates and the first offset distance, and a coordinate value in the coordinate information is determined based on the sum operation result.

[0017] In an optional implementation manner, the numerical calculation unit is further used for:

[0018] Obtaining a preset feature size, and determining a target coefficient based on the preset feature size; wherein the preset feature size is used to indicate size information of a pooling processing result;

[0019] A ratio between the first size information and the second size information is determined to obtain a target ratio, and the target interval information is determined based on a product between the target ratio and the target coefficient.

[0020] In an optional implementation, the number of the pooling layers includes multiple; the numerical operation unit is further used for:

[0021] Performing target detection on the feature map to obtain a plurality of candidate image regions of interest, and obtaining the number of preset image regions of interest set for each pooling layer;

[0022] When it is determined that the number of the multiple candidate image regions of interest is greater than the number of the preset image regions of interest, at least one candidate image region of interest is selected from the multiple candidate image regions of interest as the image region of interest; wherein the number of the at least one candidate image region of interest is less than or equal to the preset number of image regions of interest.

[0023] In an optional implementation manner, the numerical calculation unit is further used for:

[0024] Determine the number of regions of interest of multiple candidate images;

[0025] Determine the accuracy information of the neural network to which the pooling layer belongs for the target verification set under the number of regions of interest of each candidate image;

[0026] The number of candidate image regions of interest corresponding to the target accuracy information that meets the accuracy requirement is determined as the number of preset image regions of interest of the pooling layer.

[0027] In an optional implementation manner, the image region of interest includes a plurality of sub-regions; and the vector operation unit is further used for:

[0028] Determine a feature point located in each of the sub-areas among the plurality of feature points;

[0029] A target feature point that meets the feature requirements is determined among the feature points located in each of the sub-regions, and a pooling processing result of the feature map corresponding to the image region of interest is determined based on the feature information of the target feature point.

[0030] In a second aspect, the present disclosure also provides an image processing method, including:

[0031] Acquire an image to be processed, and determine an image region of interest of a feature map to be processed in a pooling layer based on the image to be processed;

[0032] and determining configuration information of a plurality of feature points based on the region information of the image region of interest; wherein the configuration information is used to indicate the position of each feature point in the image region of interest;

[0033] Performing a bilinear interpolation operation on each of the feature points based on the configuration information to obtain feature information; wherein the feature information is used to indicate the pixel value of the area in the region of interest of the image that matches the feature point;

[0034] A pooling result of a feature map corresponding to the image region of interest is determined based on the feature information.

[0035] In a third aspect, the present disclosure also provides an image processing device, including:

[0036] A first determining unit is used to obtain an image to be processed, and determine an image region of interest of a feature map to be processed of a pooling layer based on the image to be processed;

[0037] A second determining unit is used to determine configuration information of a plurality of feature points based on the region information of the image region of interest; wherein the configuration information is used to indicate the position of each feature point in the image region of interest;

[0038] A feature extraction unit, configured to perform a bilinear interpolation operation on each of the feature points based on the configuration information to obtain feature information; wherein the feature information is used to indicate a pixel value of an area in the region of interest of the image that matches the feature point;

[0039] The third determining unit is used to determine the pooling processing result of the feature map corresponding to the image region of interest based on the feature information.

[0040] In a fourth aspect, an embodiment of the present disclosure further provides a chip, comprising: the steps in the first aspect, or any possible implementation of the first aspect.

[0041] In a fifth aspect, an embodiment of the present disclosure further provides a computer device, comprising: a chip, a memory and a bus, wherein the memory stores machine-readable instructions executable by the chip, and when the computer device is running, the chip communicates with the memory through the bus, and when the machine-readable instructions are executed by the chip, the above-mentioned second aspect, or the steps in any possible implementation of the second aspect, are performed.

[0042] In a sixth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a chip, the steps of the above-mentioned first aspect or any possible implementation of the first aspect are executed.

[0043] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.

[0045] Figure 1 A schematic diagram showing a related solution for identifying an image region of interest in an image provided by an embodiment of the present disclosure;

[0046] Figure 2 A flowchart of an image processing method provided by an embodiment of the present disclosure is shown;

[0047] Figure 3 A schematic diagram showing an image region of interest in a feature map corresponding to a pooling layer provided in an embodiment of the present disclosure is shown;

[0048] Figure 4 A schematic diagram illustrating the bilinear interpolation operation principle provided by an embodiment of the present disclosure is shown;

[0049] Figure 5 A schematic diagram of an image processing device provided by an embodiment of the present disclosure is shown;

[0050] Figure 6 A schematic diagram of a chip provided by an embodiment of the present disclosure is shown;

[0051] Figure 7 A schematic diagram of a board provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.

[0053] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0054] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.

[0055] The study found that in the existing schemes for pooling the image region of interest, such as Figure 1 As shown in , since the vertices of the image region of interest usually do not overlap with the pixels of the feature map. At this time, the vertex positions of the vertices of the image region of interest are unknown, so it is impossible to perform pooling processing on the image region of interest. Therefore, it is necessary to project the vertices of the image region of interest onto the pixels of the feature map, so as to perform processing based on the image region of interest obtained after projection. However, as Figure 1 As shown, there is a certain deviation between the projected image region of interest and the initial image region of interest, which leads to poor confidence in the projected image region of interest, that is, the completeness of the target to be processed contained in the image region of interest is poor, resulting in poor image recognition accuracy for the image to be processed.

[0056] Based on this, in the embodiment of the present disclosure, the configuration information of multiple feature points in the image region of interest can be determined based on the region information of the image region of interest, and then a bilinear interpolation operation is performed on each feature point based on the configuration information to obtain feature information of each feature point in the image region of interest, wherein the feature information can be used to determine the pooling processing result of the feature map corresponding to the image region of interest. It can be seen from the above description that in the embodiment of the present disclosure, the feature map of the image region of interest can be pooled without changing the region vertices of the image region of interest, thereby improving the confidence of the image region of interest, and then improving the accuracy of image recognition.

[0057] Since the operation process of the bilinear interpolation operation described above is relatively complicated, in an optional implementation, the bilinear difference operation can be completed on a CPU (Central Processing Unit) or a GPU (Graphics Processing Unit). However, since the CPU or GPU processes the bilinear difference operation slowly, it is easy to cause low processing efficiency of the image region of interest. Based on this, in the disclosed embodiment, the bilinear difference operation and the pooling operation can be applied to a chip, for example, an AI smart chip. The pooling process of the image region of interest is realized by the numerical operation unit and the vector operation unit in the AI ​​smart chip, which can simplify the pooling process and thus improve the pooling speed. By storing the configuration information of multiple feature points in the register of the chip, a register interface can be provided for the numerical operation unit and the vector operation unit, so as to realize the pooling process of the image region of interest through the dynamic cooperation between the numerical operation unit and the vector operation unit, that is, the numerical operation unit calculates the configuration information of multiple feature points and stores it in the register, and the vector operation unit calculates the feature information of each feature point, and determines the pooling result, thereby improving the pooling efficiency of the image region of interest.

[0058] To facilitate understanding of this embodiment, an image processing method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the image processing method provided in the embodiment of the present disclosure is generally a chip with certain computing capabilities, such as a processing unit of a terminal device or a server or other processing device. In some possible implementations, the image processing method can be implemented by the chip calling a computer-readable instruction stored in a memory.

[0059] See also Figure 2 FIG. 1 is a flowchart of an image processing method provided by an embodiment of the present disclosure, wherein the method includes steps S101 to S107, wherein:

[0060] S101: Acquire an image to be processed, and determine an image region of interest of a feature map to be processed in a pooling layer based on the image to be processed.

[0061] In an embodiment of the present disclosure, after determining the image region of interest of the feature map corresponding to the pooling layer, multiple feature points in the image region of interest can be determined, wherein the number of the feature points and the determination method can be determined based on the size of the output feature map set by the pooling layer.

[0062] Here, if the size of the output feature map is k×k, then the image region of interest can be divided into k×k sub-regions, wherein each sub-region contains k×k feature points. In each sub-region, each sub-region can be further divided into k×k rectangular regions, and the center point of each rectangle is determined as a feature point in the sub-region, thereby obtaining k×k feature points in the sub-region.

[0063] like Figure 3 The figure shows a schematic diagram of the image region of interest in the feature map corresponding to the pooling layer, wherein the size of the output feature map is 2×2, that is, the image region of interest contains 4 sub-regions, and each sub-region contains 4 feature points.

[0064] S103: Determine configuration information of a plurality of feature points based on the region information of the image region of interest; wherein the configuration information is used to indicate the position of each feature point in the image region of interest.

[0065] After determining multiple feature points in the above-mentioned image region of interest, the region information of the image region of interest can be obtained, and the configuration information of the multiple feature points can be determined based on the region information, wherein the configuration information is used to indicate the position of each feature point in the above-mentioned image region of interest. The specific method for determining the configuration information will be introduced in detail in the following implementation manner.

[0066] After determining the configuration information of the plurality of feature points in the region of interest of the image, a bilinear difference operation may be performed on each feature point based on the feature information to obtain the feature information.

[0067] S105: performing a bilinear interpolation operation on each of the feature points based on the configuration information to obtain feature information; wherein the feature information is used to indicate a pixel value of an area in the image region of interest that matches the feature point.

[0068] S107: Determine a pooling processing result of a feature map corresponding to the image region of interest based on the feature information.

[0069] In the embodiment of the present disclosure, a bilinear interpolation operation may be performed on each feature point based on the position of each feature point indicated by the configuration information in the image region of interest to obtain feature information of each feature point.

[0070] When implementing it, you can combine Figure 4 The principle of the bilinear interpolation operation is described as follows: Figure 4 As shown, the feature point corresponding to the bilinear interpolation operation is point P in the image region of interest. First, the pixel points adjacent to the feature point P in the feature map can be obtained, that is, Figure 4Q1, Q2, Q3, Q4 in , wherein the adjacent pixel points are pixel points in the feature map corresponding to the image region of interest.

[0071] Next, the auxiliary feature points R1 and R2 corresponding to the feature point P in the Y direction can be determined based on the two-dimensional coordinate system constructed based on the feature map, wherein the auxiliary feature points R1 and R2 are used to assist in determining the feature information of the feature point P. The auxiliary feature point R1 can be understood as the intersection of a straight line passing through point Q1 and parallel to the X-axis and a straight line passing through point P and parallel to the Y-axis, and the auxiliary feature point R2 can be understood as the intersection of a straight line passing through point Q3 and parallel to the X-axis and a straight line passing through point P and parallel to the Y-axis.

[0072] Get the pixel values ​​of the above-mentioned pixel points Q1, Q2, Q3, and Q4, and respectively get the distance d1 between the pixel point Q1 and the auxiliary feature point R1, the distance d3 between the pixel point Q3 and the auxiliary feature point R2, the distance d3 between the pixel point Q1 and the pixel point Q2, and the distance d4 between the pixel point Q3 and the pixel point Q4, and calculate the following information:

[0073] And the pixel difference Q2-Q1 between the pixel point Q1 and the pixel point Q2, and the pixel difference Q4-Q3 between the pixel point Q3 and the pixel point Q4 are calculated.

[0074] Then, the pixel value of the auxiliary feature point R1 can be expressed as: The pixel value of the auxiliary feature point R2 can be expressed as:

[0075] Next, the distance d5 between the auxiliary feature point R1 and the feature point P, and the distance d6 between the auxiliary feature point R1 and the auxiliary feature point R2 can be obtained, and the pixel value of the feature point P can be determined based on the distance d5, the distance d6, the pixel value of the auxiliary feature point R2, and the pixel value of the auxiliary feature point R1.

[0076] Specifically, the pixel value of the feature point P And based on the pixel value of the feature point P, the feature information of the feature point P is determined.

[0077] As can be seen from the above, the feature information of each feature point can be determined based on the above configuration information through bilinear interpolation operation, and then the pooling processing result of the feature map corresponding to the image region of interest can be determined based on the feature information.

[0078] It can be seen from the above description that in the embodiments of the present disclosure, bilinear difference operations and pooling operations can be applied to chips, for example, AI smart chips. By implementing pooling processing of image regions of interest through the numerical operation unit and vector operation in the AI ​​smart chip, the pooling process can be simplified, thereby improving the pooling processing speed. By storing the feature information in the register of the chip, a register interface can be provided for the numerical operation unit and the vector operation unit to implement pooling processing of image regions of interest through dynamic cooperation between the numerical operation unit and the vector operation unit, thereby improving the pooling processing efficiency of image regions of interest.

[0079] In an optional implementation, the number of the above-mentioned pooling layers is multiple, and the above-mentioned step S101, determining the image region of interest of the feature map to be processed in the pooling layer based on the image to be processed, specifically includes the following process:

[0080] S11: Determine the feature map to be processed by the pooling layer based on the image to be processed.

[0081] S12: Performing target detection on the feature map to obtain a plurality of candidate image regions of interest, and obtaining the number of preset image regions of interest set for each pooling layer.

[0082] S13: When it is determined that the number of the multiple candidate image regions of interest is greater than the number of the preset image regions of interest, select at least one candidate image region of interest from the multiple candidate image regions of interest as the image region of interest; wherein the number of the at least one target candidate image region of interest is less than or equal to the number of the preset image regions of interest.

[0083] In an embodiment of the present disclosure, during the above-mentioned image processing process, the number of pooling layers set can be multiple, wherein a number of preset image regions of interest is set for each pooling layer, wherein the number of preset image regions of interest corresponding to each pooling layer can be the same or different, and the present disclosure does not make any specific limitation on this.

[0084] It should be understood that for each pooling layer, the processing accuracy for different numbers of image regions of interest is different, and the preset number of image regions of interest is the number of image regions of interest with the best processing accuracy for the pooling layer. For example, the processing accuracy when the number of image regions of interest processed by the pooling layer is 500 may be better than when the number of image regions of interest is 600, so 500 is set as the preset number of image regions of interest corresponding to the pooling layer.

[0085] Based on this, in the process of performing pooling processing through the image region of interest of the feature map corresponding to the pooling layer, the number of preset image regions of interest set for the pooling layer can be determined first. And it is determined whether the number of multiple candidate image regions of interest identified in the above feature map meets the number of preset image regions of interest corresponding to the pooling layer. When the number of candidate image regions of interest identified in the above feature map does not meet the number of preset image regions of interest corresponding to the pooling layer, it specifically includes the following situations:

[0086] Case 1: It is determined that the number of the plurality of candidate image regions of interest is greater than the number of preset image regions of interest.

[0087] In the embodiment of the present disclosure, the screening threshold set for the above-mentioned pooling layer can be obtained, and the confidence of each candidate image region of interest can be obtained respectively, the confidence of each candidate image region of interest can be compared with the above-mentioned screening threshold, and at least one candidate image region of interest whose confidence is greater than or equal to the screening threshold can be determined as the above-mentioned image region of interest among the candidate image regions of interest. It should be understood that the number of at least one candidate image region of interest whose confidence is greater than or equal to the screening threshold is less than or equal to the above-mentioned preset number of image regions of interest.

[0088] Case 2: It is determined that the number of the plurality of candidate image regions of interest is less than the number of preset image regions of interest.

[0089] In the embodiment of the present disclosure, all of the above-mentioned multiple candidate image regions of interest may be determined as the above-mentioned image regions of interest. Alternatively, the difference between the number of the above-mentioned multiple candidate image regions of interest and the number of preset image regions of interest may be obtained, and at least one empty set equal to the difference may be determined to determine the multiple candidate image regions of interest and at least one empty set as the above-mentioned image regions of interest, wherein the empty set may be used to indicate an image region of interest with a size of 0.

[0090] Based on this, in an embodiment of the present disclosure, a plurality of candidate image regions of interest can be obtained in the process of performing target detection on the above-mentioned feature map, and the obtained plurality of candidate image regions of interest are screened based on a preset number of image regions of interest to obtain image regions of interest that meet the preset number of image regions of interest, wherein, as described above, the preset number of image regions of interest is the number of image regions of interest with the best processing accuracy for the pooling layer, and therefore, screening the obtained plurality of candidate image regions of interest based on the preset number of image regions of interest can improve the processing accuracy of the above-mentioned pooling layer.

[0091] In an optional implementation, the implementation corresponding to the above step S101 further includes the following process:

[0092] (1) Determine the number of regions of interest of multiple candidate images;

[0093] (2) determining the accuracy information of the neural network to which the pooling layer belongs for the target verification set under the number of regions of interest of each candidate image;

[0094] (3) The number of candidate image regions of interest corresponding to the target accuracy information that meets the accuracy requirement is determined as the number of preset image regions of interest of the pooling layer.

[0095] In an embodiment of the present disclosure, the above-mentioned pooling layer can be trained using the above-mentioned target verification set, so that the number of candidate image regions of interest corresponding to the target accuracy information that meets the accuracy requirements is determined as the number of preset image regions of interest of the pooling layer, wherein the target verification set may include at least one sample for training the pooling layer.

[0096] In the process of determining the number of preset image regions of interest corresponding to the above-mentioned pooling layer, we can first determine the number of multiple candidate image regions of interest, and then identify the above-mentioned target verification set based on the number of each candidate image region of interest, and obtain the accuracy information of identifying the target verification set under each number of candidate image regions of interest, wherein the accuracy information can be used to indicate the average value of the confidence of each image region of interest obtained when identifying each image region of interest in the target verification set.

[0097] After determining the accuracy information of identifying the target verification set under each number of candidate image regions of interest, the number of candidate image regions of interest corresponding to the target accuracy information that meets the accuracy requirement can be determined as the number of preset image regions of interest of the pooling layer. Here, the target accuracy information that meets the accuracy requirement can be understood as: the highest accuracy information. At this time, the number of candidate image regions of interest corresponding to the highest accuracy information can be determined as the number of preset image regions of interest of the pooling layer.

[0098] For example, the numbers of the above-mentioned multiple candidate image regions of interest are 100, 200, and 300 respectively. The above-mentioned target verification set can be identified based on the number of each candidate image region of interest, and the accuracy information of the target verification set identification under each candidate image region of interest number can be obtained. For example, for the number of candidate image regions of interest of 100, the accuracy information of the target verification set identification is 90%, for the number of candidate image regions of interest of 200, the accuracy information of the target verification set identification is 93%, and for the number of candidate image regions of interest of 300, the accuracy information of the target verification set identification is 89%. In the case where the number of candidate image regions of interest with the highest accuracy information is determined as the preset number of image regions of interest of the pooling layer, the above-mentioned preset number of image regions of interest can be determined as 200.

[0099] In the embodiment of the present disclosure, the above-mentioned pooling layer can be trained using the above-mentioned target verification set, so that the number of candidate image regions of interest corresponding to the target accuracy information that meets the accuracy requirements is determined as the preset number of image regions of interest of the pooling layer, so that the processing accuracy of the pooling layer is higher when processing based on the preset number of image regions of interest.

[0100] In an optional implementation, the above-mentioned image region of interest includes multiple sub-regions, the above-mentioned configuration information includes multiple sub-configuration information, and the above-mentioned step S103, determining the configuration information of multiple feature points based on the region information of the image region of interest, specifically includes the following process:

[0101] Based on the region information, sub-configuration information of at least one target feature point in each of the sub-regions is determined to obtain the plurality of sub-configuration information; wherein the sub-configuration information is used to indicate the position of each of the target feature points in the sub-region.

[0102] In the disclosed embodiment, it can be seen from the above that the number of sub-regions in the image region of interest and the number of feature points in each sub-region can be determined based on the output feature map size set by the above pooling layer. For example, if the output feature map size is k×k, then the image region of interest can be divided into k×k sub-regions, where each sub-region contains k×k feature points.

[0103] like Figure 3 As shown, a two-dimensional coordinate system can be constructed based on the above-mentioned feature map, then the area information of the above-mentioned image region of interest can be used to indicate the coordinate information and size information of the image region of interest in the two-dimensional coordinate system, and therefore, the sub-configuration information of at least one target feature point in each sub-region of the image region of interest can be determined based on the area information.

[0104] In an embodiment of the present disclosure, a corresponding register can be set in advance for each sub-region in the above-mentioned image region of interest, and the register is used to store sub-configuration information of at least one target feature point in the sub-region. This facilitates determining the register storing the sub-configuration information of the target feature point based on the sub-region to which the target feature point belongs when performing a bilinear interpolation operation on the above-mentioned target feature point, and searching for the sub-configuration information of the target feature point in the register, thereby improving the efficiency of searching for the sub-configuration information.

[0105] In an optional embodiment, the above-mentioned area information includes: the area vertex coordinates of the image area of ​​interest, the first size information of the image area of ​​interest and the second size information of the feature map. The above-mentioned step S103, based on the area information of the image area of ​​interest, determines the configuration information of multiple feature points, specifically including the following process:

[0106] S1011: Based on the first size information and the region vertex coordinates, determine the coordinate information of each of the feature points in the image coordinate system; wherein the image coordinate system is a two-dimensional coordinate system constructed based on the feature map.

[0107] In the embodiment of the present disclosure, Figure 3 It can be known that the above-mentioned image region of interest is a rectangular region, and the region vertex coordinates of the above-mentioned image region of interest may include any region vertex coordinates of the four region vertices of the image region of interest, or all region vertex coordinates.

[0108] Here, the coordinate information of any feature point in the image region of interest in the image coordinate system can be first determined based on the first size information and the region vertex coordinates, for example: Figure 3 The point M shown can determine the coordinate information of the point M based on the regional vertex coordinates of the vertex O in the region of interest of the above image.

[0109] Next, the coordinate information of other feature points in the image area of ​​interest except point M can be determined based on the following target interval information. For example, if the coordinate of point M is (x1, y1), and the distance between point M and point N is d, then the coordinate information of point N can be (x1+d, y1).

[0110] S1012: Determine target interval information based on the first size information and the second size information; wherein the target interval information is used to indicate the interval between any two adjacent feature points in the direction of each coordinate axis of the image coordinate system.

[0111] In the embodiment of the present disclosure, since the coordinate axis directions of the above two-dimensional coordinate system are divided into x direction and y direction, in the process of determining the above target interval information, the target interval information can be used to indicate the interval between any two adjacent points in the x direction and the y direction.

[0112] Here, the intervals between any two adjacent feature points in the directions of the coordinate axes may be the same or different. For example, if the above-mentioned image region of interest is a square, then the intervals between any two adjacent feature points in the directions of the coordinate axes are the same.

[0113] Therefore, the square may be set as a preset area shape, and when the image ROI is determined to be the preset area shape, the interval between any two adjacent points in the image ROI in the x direction or the y direction may be determined as the target interval information.

[0114] S1013: Determine the coordinate information and the target interval information as the configuration information.

[0115] In the disclosed embodiment, the above-mentioned coordinate information and target interval information may be determined as the above-mentioned configuration information, so that bilinear interpolation operation is performed on each feature point in the image region of interest based on the configuration information, thereby improving the accuracy of the feature information obtained by the bilinear interpolation operation.

[0116] In an optional implementation, the above step S1011, based on the first size information and the region vertex coordinates, determines the coordinate information of each feature point in the image coordinate system, specifically includes the following process:

[0117] (1) determining a first offset distance based on the first size information and a preset feature size; wherein the first offset distance is used to indicate an offset distance of a corresponding feature point relative to the coordinates of a vertex of the region on each coordinate axis; and the preset feature size is used to indicate size information of a pooling processing result;

[0118] (2) performing a sum operation on the coordinates of the region vertices and the first offset distance, and determining a coordinate value in the coordinate information based on the sum operation result.

[0119] In an embodiment of the present disclosure, the first size information of the image region of interest and the size information of the above-mentioned pooling layer processing result, that is, the above-mentioned preset size information, can be obtained. Here, the pooling layer processing result can be the above-mentioned output feature map, and the size information of the pooling layer processing result is used to indicate the size of the output feature map.

[0120] Specifically, assuming that the size information of the pooling layer processing result is k×k, the width of the image region of interest indicated by the first size information is roi_w, the height of the image region of interest is roi_h, and the region vertices corresponding to the above region vertex coordinates are as follows: Figure 3 The vertex O shown, the first offset distance indicates the offset distance of the feature point M relative to the coordinates of the vertex of the region on each coordinate axis.

[0121] Then, the above first offset distance may include the following sub-offset distances: and / or Here, the sub-offset distance Used to indicate the offset distance of point M in the x direction of the image coordinate system, sub-offset distance Used to indicate the offset distance of point M in the y direction of the image coordinate system.

[0122] Based on this, the above-mentioned area vertex coordinates and the above-mentioned first offset distance can be summed up, and the coordinate value in the above-mentioned coordinate information can be determined based on the summation result. Here, the coordinate information includes the coordinate value of the corresponding feature point in each coordinate axis direction.

[0123] Specifically, taking the above feature point M as an example, assuming that the region vertex coordinates of the above vertex O are (x2, y2), then the coordinate value of the feature point M in the x direction can be expressed as: Similarly, the coordinate value of the feature point M in the y direction can be expressed as: Therefore, the above coordinate information can be expressed as

[0124] It should be understood that the feature points used to calculate the coordinate information above may be other feature points in the above-mentioned image area of ​​interest in addition to the above-mentioned M points. The specific principle of calculating the coordinate values ​​of other feature points is the same as the principle of calculating the coordinate values ​​of the above-mentioned M points, and the specific calculation process is not given here.

[0125] In an embodiment of the present disclosure, a first offset distance can be determined based on the above-mentioned first size information and a preset feature size, so as to determine the coordinate value in the above-mentioned coordinate information by summing the first offset distance with the coordinates of the region vertices. In this way, when the position and coordinates of the above-mentioned feature map and the region of interest of the image change, the coordinate value can be dynamically determined based on the above-mentioned method for determining the coordinate value, thereby improving the scope of application of the present disclosure.

[0126] In an optional implementation manner, the above S1012, determining the target interval information based on the first size information and the second size information, specifically includes the following process:

[0127] (1) obtaining a preset feature size, and determining a target coefficient based on the preset feature size; wherein the preset feature size is used to indicate size information of a pooling processing result;

[0128] (2) determining a ratio between the first size information and the second size information to obtain a target ratio, and determining the target interval information based on the product of the target ratio and the target coefficient.

[0129] In the embodiment of the present disclosure, if the preset characteristic size is k×k, then the target coefficient can be If the width of the feature map indicated by the second size information is i_w and the height of the feature map is i_h, then the target ratio between the first size information and the second size information may include a first ratio in the x direction of the two-dimensional coordinate system and a second ratio in the y direction of the two-dimensional coordinate system, wherein the first ratio is: The second ratio is:

[0130] Based on this, since the target interval information is determined based on the product of the target ratio and the target coefficient, the target interval information may include first sub-interval information in the x direction in the two-dimensional coordinate system and second sub-interval information in the y direction in the two-dimensional coordinate system, wherein the first sub-interval information is: The second sub-interval information is

[0131] It should be understood that after determining the target interval information, the interval between any two adjacent feature points in each coordinate axis direction of the image coordinate system can be determined based on the target interval information. Specifically, the interval between any two adjacent feature points in the x direction can be: The interval between any two adjacent feature points in the above y direction can be:

[0132]

[0133] In an embodiment of the present disclosure, the target interval information can be determined based on preset size information and the ratio between the first size information and the second size information. Thus, when the position and coordinates of the feature map and the image region of interest change, the interval between any two adjacent feature points in the coordinate axis directions of the image coordinate system can be dynamically determined based on the target interval information, thereby improving the scope of application of the present disclosure.

[0134] In an optional embodiment, in addition to dynamically determining the above-mentioned coordinate information and target interval information, fixed parameters can also be predetermined and stored in registers. Different from the above-mentioned coordinate information and target interval information, the fixed parameters can be applied to bilinear interpolation operations of feature maps of different sizes and image regions of interest. For example, the fixed parameters can include at least one of the following: the number of sub-regions in the image region of interest, the number of feature points in the image region of interest, the above-mentioned preset feature size, the number of hardware loops (i.e., the number of feature information required to be calculated for all feature points in the above-mentioned image region of interest), and the memory access step size corresponding to each loop (used to locate the configuration information stored in the above-mentioned register and the storage location of the fixed parameters).

[0135] In an optional implementation, the above-mentioned image region of interest includes multiple sub-regions, and the above-mentioned step S107, determining the pooling processing result of the feature map corresponding to the image region of interest based on the feature information, specifically includes the following process:

[0136] S1071: Determine a feature point located in each of the sub-areas among the multiple feature points.

[0137] In the embodiment of the present disclosure, firstly, a plurality of sub-regions contained in the above-mentioned image region of interest can be determined, and the feature points in each sub-region can be determined, and at the same time, feature information of each feature point in each sub-region obtained based on the above-mentioned bilinear interpolation operation can be obtained, wherein the feature information is used to indicate the pixel value of the region matching the corresponding feature point.

[0138] S1072: Determine a target feature point that meets the feature requirements among the feature points located in each of the sub-regions, and determine a pooling processing result of the feature map corresponding to the image region of interest based on the feature information of the target feature point.

[0139] In the embodiment of the present disclosure, the pooling processing result of the above-mentioned image region of interest can be determined by the following pooling methods:

[0140] Method 1: Determine target feature points that meet feature requirements among the feature points located in each sub-region.

[0141] In the embodiment of the present disclosure, the feature point with the largest pixel value indicated by the feature information in each sub-region can be determined as the target feature point that meets the feature requirements through the maxpooling operation. It should be understood that each sub-region corresponds to a target feature point. Figure 3 For the image region of interest shown in FIG. 1 , the pooling processing result of the image region of interest includes four target feature points.

[0142] Alternatively, the median of the pixel values ​​indicated by the feature information in each sub-region may be determined, and the feature point indicated by the median of the pixel value may be determined as the target feature point that meets the feature requirement. Here, the present disclosure does not specifically limit the content of the feature requirement, and is subject to the ability to implement this solution.

[0143] Method 2: Determine the average value of the pixel values ​​indicated by the feature information corresponding to the feature points in each sub-region.

[0144] In the disclosed embodiment, feature information corresponding to the feature points in each sub-region can be first obtained to determine the pixel value of each feature point based on the feature information corresponding to each feature point. Next, the pixel values ​​of the feature points in each sub-region can be averaged through an average pooling operation to obtain the average pixel value corresponding to each sub-region, and the average pixel value is used as the feature information of each sub-region.

[0145] It should be understood that, for the feature map corresponding to the above-mentioned pooling layer, the feature map contains multiple image regions of interest, each feature region corresponds to a pooling processing result, and the pooling processing result of the feature map corresponding to the pooling layer can be determined based on the pooling processing result of each image region of interest.

[0146] In the embodiments of the present disclosure, the pooling processing results of the above-mentioned image region of interest can be determined by the above-mentioned multiple pooling methods, so that the method of determining the pooling processing results in the present disclosure is more diversified, so that it can be applicable to more usage scenarios.

[0147] See also Figure 4 FIG. 1 is a schematic diagram of the structure of a chip provided by an embodiment of the present disclosure, wherein the chip includes: a numerical operation unit 10 and a vector operation unit 20, wherein:

[0148] The numerical calculation unit 10 is used to determine the image region of interest of the feature map to be processed by the pooling layer, and determine the configuration information of multiple feature points based on the region information of the image region of interest, and store the configuration information in a register, wherein the configuration information is used to indicate the position of each feature point in the image region of interest.

[0149] In an embodiment of the present disclosure, in an embodiment of the present disclosure, after determining the image region of interest of the feature map corresponding to the pooling layer, multiple feature points in the image region of interest can be determined, wherein the number of the feature points and the determination method can be determined based on the size of the output feature map set by the pooling layer.

[0150] Here, if the size of the output feature map is k×k, then the image region of interest can be divided into k×k sub-regions, wherein each sub-region contains k×k feature points. In each sub-region, each sub-region can be further divided into k×k rectangular regions, and the center point of each rectangular region is determined as a feature point in the sub-region, thereby obtaining k×k feature points in the sub-region.

[0151] like Figure 3 The figure shows a schematic diagram of the image region of interest in the feature map corresponding to the pooling layer, wherein the size of the output feature map is 2×2, that is, the image region of interest contains 4 sub-regions, and each sub-region contains 4 feature points.

[0152] After determining multiple feature points in the above-mentioned image region of interest, the region information of the image region of interest can be obtained, and the configuration information of the multiple feature points can be determined based on the region information, wherein the configuration information is used to indicate the position of each feature point in the above-mentioned image region of interest. The specific method for determining the configuration information is described as follows and will not be repeated here.

[0153] After determining the configuration information for storing the feature information in the register for multiple feature points in the image region of interest, the feature information can be stored in the register to read the feature information in the register, thereby performing the bilinear difference operation based on the read feature information.

[0154] It should be understood that, in the process of related bilinear interpolation calculation, the reason why the above-mentioned bilinear interpolation operation needs to be completed by CPU or GPU is precisely because the calculation process of the bilinear interpolation operation is relatively complicated and the calculation parameters required are relatively complicated. The chip cannot dynamically obtain the calculation parameters during the bilinear interpolation operation.

[0155] Therefore, in the present disclosure, the configuration information of multiple feature points can be determined based on the area information of the above-mentioned image area of ​​interest, and the configuration information can be directly stored in a register so that the configuration information can be directly obtained when performing a bilinear interpolation operation, and the calculation parameters can be determined based on the configuration information, thereby completing the above-mentioned bilinear interpolation operation.

[0156] The vector operation unit 20 is used to read the configuration information in the register, and perform a bilinear interpolation operation on each of the feature points based on the configuration information to obtain feature information, and determine a pooling processing result of the feature map corresponding to the image region of interest based on the feature information, wherein the feature information is used to indicate the pixel value of the area in the image region of interest that matches the feature point.

[0157] In the disclosed embodiment, configuration information may be first read from a register, and bilinear interpolation may be performed on each feature point based on the position of each feature point in the image region of interest indicated by the configuration information to obtain feature information of each feature point.

[0158] When implementing it, you can combine Figure 3 The principle diagram of the bilinear interpolation operation is described. The specific operation process of the bilinear interpolation operation is as described in the implementation method corresponding to the above step S105, and will not be repeated here.

[0159] As can be seen from the above, if you want to determine the feature information of the feature points in the above-mentioned image region of interest, you need to determine the position of each feature point in the image region of interest. Therefore, the above-mentioned bilinear interpolation operation can determine the feature information of each feature point based on the above-mentioned configuration information. After determining the feature information of each feature point, the pooling processing result of the feature map corresponding to the image region of interest can be determined based on the feature information. The specific process of determining the pooling processing result of the feature map corresponding to the image region of interest is as described above, and will not be repeated here.

[0160] From the above description, it can be seen that in the embodiment of the present disclosure, the feature points in the image region of interest of the feature map can be directly identified, and a bilinear interpolation operation can be performed on the feature points based on the configuration information of each feature point to obtain the feature information of each feature point in the image region of interest, that is, the pixel value of the area matching the feature point, without projecting the image region of interest onto the feature point, thereby improving the confidence of the image region of interest and further improving the accuracy of image recognition.

[0161] In an optional implementation, the above-mentioned image region of interest includes multiple sub-regions, and the above-mentioned numerical calculation unit 10 is further used for:

[0162] (1) determining sub-configuration information of at least one target feature point in each of the sub-regions based on the region information, to obtain a plurality of sub-configuration information; wherein the sub-configuration information is used to indicate a position of each of the target feature points in the sub-region;

[0163] (2) Each sub-region configuration information is stored in a register matching the sub-region.

[0164] In the disclosed embodiment, it can be seen from the above that the number of sub-regions in the image region of interest and the number of feature points in each sub-region can be determined based on the output feature map size set by the above pooling layer. For example, if the output feature map size is k×k, then the image region of interest can be divided into k×k sub-regions, where each sub-region contains k×k feature points.

[0165] like Figure 3 As shown, a two-dimensional coordinate system can be constructed based on the above-mentioned feature map, then the area information of the above-mentioned image region of interest can be used to indicate the coordinate information and size information of the image region of interest in the two-dimensional coordinate system, and therefore, the sub-configuration information of at least one target feature point in each sub-region of the image region of interest can be determined based on the area information.

[0166] In the disclosed embodiment, a corresponding register may be pre-set for each sub-region in the above-mentioned image region of interest, for storing sub-configuration information of feature points in the sub-region, so that when performing a bilinear interpolation operation on the above-mentioned target feature point, based on the sub-region to which the target feature point belongs, the register storing the sub-configuration information of the target feature point is determined, and the sub-configuration information of the target feature point is searched in the register, thereby improving the efficiency of searching for the sub-configuration information.

[0167] In an optional implementation, the region information includes: region vertex coordinates of the image region of interest, first size information of the image region of interest, and second size information of the feature map, and the numerical calculation unit is further used for:

[0168] (1) determining the coordinate information of each of the feature points in an image coordinate system based on the first size information and the coordinates of the region vertices; wherein the image coordinate system is a two-dimensional coordinate system constructed based on the feature map;

[0169] (2) determining target interval information based on the first size information and the second size information; wherein the target interval information is used to indicate the interval between any two adjacent feature points in the direction of each coordinate axis of the image coordinate system;

[0170] (3) Determine the coordinate information and the target interval information as the configuration information.

[0171] In the embodiment of the present disclosure, Figure 3 It can be known that the above-mentioned image region of interest is a rectangular region, and the region vertex coordinates of the above-mentioned image region of interest may include the coordinates of any vertex among the four vertices of the image region of interest, or the coordinates of all vertices.

[0172] Here, the coordinate information of any feature point in the image region of interest in the image coordinate system can be first determined based on the above-mentioned first size information and the coordinates of the region vertices. The specific method for determining the coordinate information of the feature point in the image region of interest in the image coordinate system is as described in the implementation method corresponding to the above-mentioned step S101, and will not be repeated here.

[0173] In the embodiment of the present disclosure, since the coordinate axis directions of the above two-dimensional coordinate system are divided into x direction and y direction, in the process of determining the above target interval information, the target interval information can be used to indicate the interval between any two adjacent points in the x direction and the y direction.

[0174] The specific method of determining the target interval information is as described in the implementation corresponding to the above step S101, and will not be repeated here.

[0175] In the disclosed embodiment, the above-mentioned coordinate information and target interval information may be determined as the above-mentioned configuration information, so that bilinear interpolation operation is performed on each feature point in the image region of interest based on the configuration information, thereby improving the accuracy of the feature information obtained by the bilinear interpolation operation.

[0176] In an optional implementation, the numerical calculation unit 10 is further used for:

[0177] (1) determining a first offset distance based on the first size information and a preset feature size; wherein the first offset distance is used to indicate an offset distance of a corresponding feature point relative to the coordinates of a vertex of the region on each coordinate axis; and the preset feature size is used to indicate size information of a pooling processing result;

[0178] (2) performing a sum operation on the coordinates of the region vertices and the first offset distance, and determining a coordinate value in the coordinate information based on the sum operation result.

[0179] In an embodiment of the present disclosure, the first size information of the image region of interest and the size information of the above-mentioned pooling layer processing result, that is, the above-mentioned preset size information, can be obtained. Here, the pooling layer processing result can be the above-mentioned output feature map, and the size information of the pooling layer processing result is used to indicate the size of the output feature map.

[0180] The specific method of determining the coordinate value in the above coordinate information is as described in the implementation method corresponding to the above step S101, and will not be repeated here.

[0181] In an embodiment of the present disclosure, a first offset distance can be determined based on the above-mentioned first size information and a preset feature size, so as to determine the coordinate value in the above-mentioned coordinate information by summing the first offset distance with the coordinates of the region vertices. In this way, when the position and coordinates of the above-mentioned feature map and the region of interest of the image change, the coordinate value can be dynamically determined based on the above-mentioned method for determining the coordinate value, thereby improving the scope of application of the present disclosure.

[0182] In an optional implementation, the numerical calculation unit 10 is further used for:

[0183] (1) obtaining a preset feature size, and determining a target coefficient based on the preset feature size; wherein the preset feature size is used to indicate size information of a pooling processing result;

[0184] (2) determining a ratio between the first size information and the second size information to obtain a target ratio, and determining the target interval information based on the product of the target ratio and the target coefficient.

[0185] In the embodiment of the present disclosure, the target coefficient, the target ratio, and the target interval information are determined based on the product of the target coefficient and the target ratio as described in the implementation corresponding to step S101, which will not be repeated here.

[0186] In an embodiment of the present disclosure, the target interval information can be determined based on preset size information and the ratio between the first size information and the second size information. Thus, when the position and coordinates of the feature map and the image region of interest change, the interval between any two adjacent feature points in the coordinate axis directions of the image coordinate system can be dynamically determined based on the target interval information, thereby improving the scope of application of the present disclosure.

[0187] In an optional embodiment, in addition to dynamically determining the above-mentioned coordinate information and target interval information, fixed parameters can also be predetermined and stored in registers. Different from the above-mentioned coordinate information and target interval information, the fixed parameters can be applied to bilinear interpolation operations of feature maps of different sizes and image regions of interest. For example, the fixed parameters can include at least one of the following: the number of sub-regions in the image region of interest, the number of feature points in the image region of interest, the above-mentioned preset feature size, the number of hardware loops (i.e., the number of feature information required to be calculated for all feature points in the above-mentioned image region of interest), and the memory access step size corresponding to each loop (used to locate the configuration information stored in the above-mentioned register and the storage location of the fixed parameters).

[0188] In an optional implementation, the number of the pooling layers is multiple, and the numerical calculation unit 10 is further used for:

[0189] (1) performing target detection on the feature map to obtain a plurality of candidate image regions of interest, and obtaining the number of preset image regions of interest set for each pooling layer;

[0190] (2) When it is determined that the number of the multiple candidate image regions of interest is greater than the number of the preset image regions of interest, select at least one candidate image region of interest from the multiple candidate image regions of interest as the image region of interest; wherein the number of the at least one candidate image region of interest is less than or equal to the number of the preset image regions of interest.

[0191] In an embodiment of the present disclosure, during the above-mentioned image processing process, the number of pooling layers set can be multiple, wherein a number of preset image regions of interest is set for each pooling layer, wherein the number of preset image regions of interest corresponding to each pooling layer can be the same or different, and the present disclosure does not make any specific limitation on this.

[0192] It should be understood that for each pooling layer, the processing accuracy for different numbers of image regions of interest is different, and the preset number of image regions of interest is the number of image regions of interest with the best processing accuracy for the pooling layer. For example, the processing accuracy when the number of image regions of interest processed by the pooling layer is 500 may be better than when the number of image regions of interest is 600, so 500 is set as the preset number of image regions of interest corresponding to the pooling layer.

[0193] Based on this, the process of performing pooling processing on the image region of interest of the feature map corresponding to the pooling layer is as described in the process corresponding to the above step S101, and will not be repeated here.

[0194] In the embodiment of the present disclosure, a plurality of candidate image regions of interest can be obtained in the process of performing target detection on the above-mentioned feature map, and the plurality of candidate image regions of interest obtained are screened based on a preset number of image regions of interest to obtain image regions of interest that meet the preset number of image regions of interest, wherein, as described above, the preset number of image regions of interest is the number of image regions of interest with the best processing accuracy for the pooling layer, and therefore, screening the plurality of candidate image regions of interest obtained based on the preset number of image regions of interest can improve the processing accuracy of the above-mentioned pooling layer.

[0195] In an optional implementation, the numerical calculation unit 10 is further used for:

[0196] (1) Determine the number of regions of interest of multiple candidate images;

[0197] (2) determining the accuracy information of the neural network to which the pooling layer belongs for the target verification set under the number of regions of interest of each candidate image;

[0198] (3) The number of candidate image regions of interest corresponding to the target accuracy information that meets the accuracy requirement is determined as the number of preset image regions of interest of the pooling layer.

[0199] In an embodiment of the present disclosure, the pooling layer may be trained using the target verification set, thereby determining the number of candidate image regions of interest corresponding to the target accuracy information that meets the accuracy requirements as the number of preset image regions of interest for the pooling layer, wherein the target verification set may include at least one sample of a feature map for training the pooling layer.

[0200] Specifically, the process of determining the number of preset image regions of interest corresponding to the pooling layer is as described in the process corresponding to step S101 above, and will not be repeated here.

[0201] In the embodiment of the present disclosure, the above-mentioned pooling layer can be trained using the above-mentioned target verification set, so that the number of candidate image regions of interest corresponding to the target accuracy information that meets the accuracy requirements is determined as the preset number of image regions of interest of the pooling layer, so that the processing accuracy of the pooling layer is higher when processing based on the preset number of image regions of interest.

[0202] In an optional implementation, the above-mentioned image region of interest includes multiple sub-regions, and the above-mentioned vector operation unit 20 is further used for:

[0203] (1) determining a feature point located in each of the sub-areas among the plurality of feature points;

[0204] (2) determining a target feature point that meets the feature requirements among the feature points located in each of the sub-regions, and determining a pooling processing result of the feature map corresponding to the image region of interest based on the feature information of the target feature point.

[0205] In the embodiment of the present disclosure, firstly, a plurality of sub-regions contained in the above-mentioned image region of interest can be determined, and the feature points in each sub-region can be determined, and at the same time, feature information of each feature point in each sub-region obtained based on the above-mentioned bilinear interpolation operation can be obtained, wherein the feature information is used to indicate the pixel value of the region matching the corresponding feature point.

[0206] In addition, in the embodiment of the present disclosure, the pooling processing result of the above-mentioned image region of interest can be determined by the above-mentioned several pooling methods, as described in the process corresponding to the above-mentioned step S105, which will not be repeated here.

[0207] It should be understood that, for the feature map corresponding to the above-mentioned pooling layer, the feature map contains multiple image regions of interest, each feature region corresponds to a pooling processing result, and the pooling processing result of the feature map corresponding to the pooling layer can be determined based on the pooling processing result of each image region of interest.

[0208] In the embodiments of the present disclosure, the pooling processing results of the above-mentioned image region of interest can be determined by the above-mentioned multiple pooling methods, so that the method of determining the pooling processing results in the present disclosure is more diversified, so that it can be applicable to more usage scenarios.

[0209] In summary, in the embodiments of the present disclosure, bilinear difference operations and pooling operations can be applied to chips, for example, AI smart chips. Pooling of image regions of interest is achieved through the numerical operation unit and vector operation in the AI ​​smart chip, which can simplify the pooling process and thus improve the pooling speed. By storing the feature information in the registers of the chip, a register interface can be provided for the numerical operation unit and the vector operation unit to achieve pooling of image regions of interest through dynamic coordination between the numerical operation unit and the vector operation unit, thereby improving the efficiency of pooling of image regions of interest.

[0210] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0211] Based on the same inventive concept, an image processing device corresponding to the image processing method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned image processing method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0212] Reference Figure 5 FIG. 1 is a schematic diagram of an image processing device provided by an embodiment of the present disclosure, wherein the device comprises: a first determining unit 51, a second determining unit 52, a feature extraction unit 53, and a third determining unit 54; wherein,

[0213] A first determining unit 51 is used to obtain an image to be processed, and determine an image region of interest of a feature map to be processed of a pooling layer based on the image to be processed;

[0214] A second determining unit 52 is used to determine configuration information of a plurality of feature points based on the region information of the image region of interest; wherein the configuration information is used to indicate the position of each feature point in the image region of interest;

[0215] A feature extraction unit 53, configured to perform a bilinear interpolation operation on each of the feature points based on the configuration information to obtain feature information; wherein the feature information is used to indicate a pixel value of an area in the image region of interest that matches the feature point;

[0216] The third determining unit 54 is used to determine the pooling processing result of the feature map corresponding to the image region of interest based on the feature information.

[0217] In the disclosed embodiments, bilinear difference operations and pooling operations can be applied to a chip, for example, an AI smart chip. Pooling of image regions of interest is achieved through the numerical operation unit and vector operation in the AI ​​smart chip, which can simplify the pooling process and thus improve the pooling speed. By storing the feature information in the register of the chip, a register interface can be provided for the numerical operation unit and the vector operation unit to achieve pooling of image regions of interest through dynamic coordination between the numerical operation unit and the vector operation unit, thereby improving the efficiency of pooling of image regions of interest.

[0218] In a possible implementation manner, the image region of interest includes multiple sub-regions, the configuration information includes multiple sub-configuration information, and the second determining unit 52 is further configured to:

[0219] Determine sub-configuration information of at least one target feature point in each of the sub-regions based on the region information, and obtain a plurality of sub-configuration information; wherein the sub-configuration information is used to indicate the position of each of the target feature points in the sub-region;

[0220] Each sub-region configuration information is stored in a register matching the sub-region.

[0221] In a possible implementation manner, the region information includes: region vertex coordinates of the image region of interest, first size information of the image region of interest, and second size information of the feature map, and the second determining unit 52 is further configured to:

[0222] Based on the first size information and the region vertex coordinates, determine the coordinate information of each of the feature points in an image coordinate system; wherein the image coordinate system is a two-dimensional coordinate system constructed based on the feature map;

[0223] Determine target interval information based on the first size information and the second size information; wherein the target interval information is used to indicate the interval between any two adjacent feature points in the direction of each coordinate axis of the image coordinate system;

[0224] The coordinate information and the target interval information are determined as the configuration information.

[0225] In a possible implementation manner, the second determining unit 52 is further configured to:

[0226] Based on the first size information and the preset characteristic size, a first offset distance is determined; wherein the first offset distance is used to indicate the offset distance of the corresponding characteristic point on each coordinate axis relative to the coordinates of the vertex of the region; and the preset characteristic size is used to indicate the size information of the pooling processing result;

[0227] A sum operation is performed on the region vertex coordinates and the first offset distance, and a coordinate value in the coordinate information is determined based on the sum operation result.

[0228] In a possible implementation manner, the second determining unit 52 is further configured to:

[0229] Obtaining a preset feature size, and determining a target coefficient based on the preset feature size; wherein the preset feature size is used to indicate size information of a pooling processing result;

[0230] A ratio between the first size information and the second size information is determined to obtain a target ratio, and the target interval information is determined based on a product between the target ratio and the target coefficient.

[0231] In a possible implementation manner, the number of the pooling layers is multiple, and the first determining unit 51 is further configured to:

[0232] Determine the feature map to be processed of the pooling layer based on the image to be processed;

[0233] Performing target detection on the feature map to obtain a plurality of candidate image regions of interest, and obtaining the number of preset image regions of interest set for each pooling layer;

[0234] When it is determined that the number of the multiple candidate image regions of interest is greater than the number of the preset image regions of interest, at least one candidate image region of interest is selected from the multiple candidate image regions of interest as the image region of interest; wherein the number of the at least one target candidate image region of interest is less than or equal to the number of the preset image regions of interest.

[0235] In a possible implementation manner, the first determining unit 51 is further configured to:

[0236] Determine the number of regions of interest of multiple candidate images;

[0237] Determine the accuracy information of the neural network to which the pooling layer belongs for the target verification set under the number of regions of interest of each candidate image;

[0238] The number of candidate image regions of interest corresponding to the target accuracy information that meets the accuracy requirement is determined as the number of preset image regions of interest of the pooling layer.

[0239] In a possible implementation manner, the image region of interest includes a plurality of sub-regions, and the third determining unit 54 is further configured to:

[0240] Determine a feature point located in each of the sub-areas among the plurality of feature points;

[0241] A target feature point that meets the feature requirements is determined among the feature points located in each of the sub-regions, and a pooling processing result of the feature map corresponding to the image region of interest is determined based on the feature information of the target feature point.

[0242] For descriptions of the processing flow of each unit in the device and the interaction flow between each unit, reference may be made to the relevant descriptions in the above method embodiments, which will not be described in detail here.

[0243] Corresponds to Figure 2 The image processing method in the present disclosure also provides a chip 600, such as Figure 6 FIG. 6 is a schematic diagram of the structure of a chip 600 provided in an embodiment of the present disclosure, including:

[0244] Chip 61, memory 62, and bus 63; memory 62 is used to store execution instructions, and the chip 61 communicates with the memory 62 via bus 63, so that the chip 61 executes the following instructions:

[0245] Acquire an image to be processed, and determine an image region of interest of a feature map to be processed in a pooling layer based on the image to be processed;

[0246] Determine configuration information of a plurality of feature points based on the region information of the image region of interest; wherein the configuration information is used to indicate the position of each feature point in the image region of interest;

[0247] Performing a bilinear interpolation operation on each of the feature points based on the configuration information to obtain feature information; wherein the feature information is used to indicate the pixel value of the area in the region of interest of the image that matches the feature point;

[0248] A pooling result of a feature map corresponding to the image region of interest is determined based on the feature information.

[0249] The present disclosure also provides a board, which includes a packaging structure encapsulating at least one of the above chips. Figure 7 , which provides an exemplary board card, the board card includes the chip 600 and may also include other components, including but not limited to: a storage device 704 and an interface device 706.

[0250] The memory device is connected to the chip in the chip package structure via a bus for storing data. The memory device may include multiple groups of memory cells 708, such as DDR SDRAM (Double Data Rate SDRAM), etc. Each group of memory cells is connected to the chip via a bus.

[0251] The interface device is electrically connected to the chip in the chip packaging structure. The interface device is used to realize data transmission between the chip and an external device 710 (e.g., a terminal, a server, a camera, etc.). In one embodiment, the interface device may include a PCIE interface, or a network interface, or other interface, which is not limited by the present disclosure.

[0252] The present disclosure also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a chip, the steps of the image processing method described in the above method embodiment are executed. The storage medium may be a volatile or non-volatile computer-readable storage medium.

[0253] The embodiments of the present disclosure also provide a computer program product, which carries a program code. The instructions included in the program code can be used to execute the steps of the image processing method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.

[0254] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).

[0255] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.

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

[0257] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0258] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that can be executed by a chip. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a chip (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0259] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A chip, It is characterized in that include: Numerical operation unit and vector operation unit; The numerical operation unit is used to determine the image region of interest of the feature map to be processed by the pooling layer, and determine the configuration information of multiple feature points based on the region information of the image region of interest, and store the configuration information in a register, wherein the configuration information is used to indicate the position of each feature point in the image region of interest; The vector operation unit is used to read the configuration information in the register, and perform a bilinear interpolation operation on each of the feature points based on the configuration information to obtain feature information, and determine a pooling processing result of the feature map corresponding to the image region of interest based on the feature information, wherein the feature information is used to indicate the pixel value of the area in the image region of interest that matches the feature point.

2. The chip according to claim 1, It is characterized in that The image region of interest includes a plurality of sub-regions; the numerical calculation unit is also used for: Determine sub-configuration information of at least one target feature point in each of the sub-regions based on the region information, and obtain at least one sub-configuration information; wherein the sub-configuration information is used to indicate the position of the target feature point in the sub-region; For each sub-configuration information, the sub-configuration information is stored in a register matching the sub-region.

3. The chip according to claim 1 or 2, It is characterized in that The region information includes: the region vertex coordinates of the image region of interest, the first size information of the image region of interest and the second size information of the feature map; the numerical calculation unit is also used for: Based on the first size information and the region vertex coordinates, determine the coordinate information of each of the feature points in an image coordinate system; wherein the image coordinate system is a two-dimensional coordinate system constructed based on the feature map; Determine target interval information based on the first size information and the second size information; wherein the target interval information is used to indicate the interval between any two adjacent feature points in the direction of each coordinate axis of the image coordinate system; The coordinate information and the target interval information are determined as the configuration information.

4. The chip according to claim 3, It is characterized in that The numerical calculation unit is also used for: Based on the first size information and the preset feature size, a first offset distance is determined; wherein the first offset distance is used to indicate the offset distance of each feature point relative to the coordinates of the region vertex on each coordinate axis, wherein the preset feature size is used to indicate the size information of the pooling processing result; A sum operation is performed on the region vertex coordinates and the first offset distance, and a coordinate value in the coordinate information is determined based on the sum operation result.

5. The chip according to claim 3 or 4, It is characterized in that The numerical calculation unit is also used for: Obtaining a preset feature size, and determining a target coefficient based on the preset feature size; wherein the preset feature size is used to indicate size information of a pooling processing result; A ratio between the first size information and the second size information is determined to obtain a target ratio, and the target interval information is determined based on a product between the target ratio and the target coefficient.

6. The chip according to any one of claims 1 to 5, It is characterized in that The number of the pooling layers includes multiple; the numerical operation unit is also used for: Performing target detection on the feature map to obtain a plurality of candidate image regions of interest, and obtaining the number of preset image regions of interest set for each pooling layer; When it is determined that the number of the multiple candidate image regions of interest is greater than the number of the preset image regions of interest, at least one candidate image region of interest is selected from the multiple candidate image regions of interest as the image region of interest; wherein the number of the at least one candidate image region of interest is less than or equal to the preset number of image regions of interest.

7. The image chip according to claim 6, It is characterized in that The numerical calculation unit is also used for: Determine the number of regions of interest of multiple candidate images; Determine the accuracy information of the neural network to which the pooling layer belongs for the target verification set under the number of regions of interest of each candidate image; The number of candidate image regions of interest corresponding to the target accuracy information that meets the accuracy requirement is determined as the number of preset image regions of interest of the pooling layer.

8. The chip according to any one of claims 1 to 7, It is characterized in that The image region of interest includes a plurality of sub-regions; the vector operation unit is further used for: Determine a feature point located in each of the sub-areas among the plurality of feature points; A target feature point that meets the feature requirements is determined among the feature points located in each of the sub-regions, and a pooling processing result of the feature map corresponding to the image region of interest is determined based on the feature information of the target feature point.

9. An image processing method, It is characterized in that include: Acquire an image to be processed, and determine an image region of interest of a feature map to be processed in a pooling layer based on the image to be processed; Determine configuration information of a plurality of feature points based on the region information of the image region of interest; wherein the configuration information is used to indicate the position of each feature point in the image region of interest; Performing a bilinear interpolation operation on each of the feature points based on the configuration information to obtain feature information; wherein the feature information is used to indicate the pixel value of the area in the region of interest of the image that matches the feature point; A pooling result of a feature map corresponding to the image region of interest is determined based on the feature information.

10. An image processing device, It is characterized in that include: A first determining unit is used to obtain an image to be processed, and determine an image region of interest of a feature map to be processed of a pooling layer based on the image to be processed; A second determining unit is used to determine configuration information of a plurality of feature points based on the region information of the image region of interest; wherein the configuration information is used to indicate the position of each feature point in the image region of interest; A feature extraction unit, configured to perform a bilinear interpolation operation on each of the feature points based on the configuration information to obtain feature information; wherein the feature information is used to indicate a pixel value of an area in the region of interest of the image that matches the feature point; The third determining unit is used to determine the pooling processing result of the feature map corresponding to the image region of interest based on the feature information.

11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by the chip, the steps of the image processing method as claimed in claim 9 are executed.

Citation Information

Patent Citations

  • Pooling operation method and circuit based on ROI

    CN110503193A

  • Deep learning model construction method, image processing method and readable storage medium

    CN112348082A

  • Model training method and device

    CN115731530A

  • Image processing method, readable medium and electronic equipment

    CN116310388A

  • Data processing device and method

    CN116820733A