Target detection method, target detection device, equipment and storage medium
Through neural network models, feature slices, stacking and splicing, feature extraction and fusion of medical images, solving the problem of degradation of micro lesions detection performance in medical images, and achieving high-accurate lesion area detection, avoiding missed diagnosis and improving detection efficiency.
Patent Information
- Application Number
- CN202411679973.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-03-25
AI Technical Summary
In the case of low image resolution or small target objects, the performance of existing object detection methods will degrade, resulting in the possibility of tiny lesions in the lesion area in medical images being ignored, resulting in missed diagnosis.
By slicing the image to be detected by the feature transformation layer based on the neural network model, multiple feature layers and their corresponding feature layers are obtained; then channel information is determined based on the number of feature layers, stacked and spliced to obtain a feature map; then channel features are extracted based on the convolutional layer, feature fusion is performed using the attention module, and target acquisition is finally performed based on the prediction layer.
Accurately detect lesion areas in medical images, avoid missed diagnosis, improve consultation efficiency and accuracy, meet the detection needs for lesion areas, and improve detection results.
Smart Images

Figure CN119693610A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a target detection method, a target detection device, a computer device, and a computer-readable storage medium. Background Art
[0002] Convolutional neural networks (CNNs) based on deep learning have achieved great success in computer vision tasks such as image classification and object detection. Among them, object detection is to find specific object categories and their exact locations in a given image, and small object detection is an important research topic in the field of object detection.
[0003] However, their performance drops rapidly in difficult target detection tasks such as those with low image resolution or small target objects. For example, in the detection of tumors, lesions or abnormal areas in medical images, some lesions in medical images are very small and are likely to be ignored, resulting in missed diagnoses. Summary of the invention
[0004] The present application provides a target detection method, a target detection device, a computer device and a computer-readable storage medium, which are intended to accurately detect the lesion area in the medical image when the lesion area in the medical image is very small, avoid missed diagnosis and improve the efficiency of medical consultation.
[0005] To achieve the above object, the present application provides a target detection method, the method comprising:
[0006] Acquire an image to be detected, and perform slicing processing on the image to be detected based on the feature transformation layer of the neural network model to obtain multiple feature layers and their corresponding feature layer numbers;
[0007] Determine channel information according to the number of feature layers, and stack and splice the multiple feature layers according to the channel information to obtain a feature map corresponding to the image to be detected;
[0008] Based on the convolution layer of the neural network model, feature extraction is performed on each channel corresponding to the feature map to obtain channel features of each channel;
[0009] Based on the attention module of the neural network model, feature fusion processing is performed on the channel features corresponding to each channel to obtain image features;
[0010] Based on the prediction layer of the neural network model, target acquisition is performed on the feature map according to the image features to obtain a target area corresponding to the image to be detected.
[0011] To achieve the above object, the present application also provides a target detection device, which includes:
[0012] A feature layer generation module is used to obtain an image to be detected, and based on the feature transformation layer of the neural network model, slice the image to be detected to obtain multiple feature layers and their corresponding feature layer numbers;
[0013] A feature map generation module, used to determine channel information according to the number of feature layers, and stack and splice the multiple feature layers according to the channel information to obtain a feature map corresponding to the image to be detected;
[0014] The channel feature extraction module is used to extract features of each channel corresponding to the feature map based on the convolution layer of the neural network model to obtain the channel features of each channel.
[0015] A feature fusion module, used to perform feature fusion processing on the channel features corresponding to each channel based on the attention module of the neural network model to obtain image features;
[0016] The target detection module is used to collect targets on the feature map based on the prediction layer of the neural network model according to the image features to obtain the target area corresponding to the image to be detected.
[0017] In addition, to achieve the above-mentioned purpose, the present application also provides a computer device, which includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement any one of the target detection methods provided in the embodiments of the present application when executing the computer program.
[0018] In addition, to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor enables the processor to implement any target detection method provided in the embodiments of the present application.
[0019] The target detection method, target detection device, computer equipment and computer-readable storage medium disclosed in the embodiments of the present application are based on the feature transformation layer of the neural network model, slicing the image to be detected to obtain multiple feature layers and their corresponding feature layer numbers; determining the channel information according to the feature layer number, and stacking and splicing the multiple feature layers according to the channel information to obtain the feature map corresponding to the image to be detected; based on the convolution layer of the neural network model, extracting the features of each channel corresponding to the feature map to obtain the channel features of each channel; based on the attention module of the neural network model, performing feature fusion processing on the channel features corresponding to each channel to obtain the image features; based on the prediction layer of the neural network model, target acquisition is performed on the feature map according to the image features to obtain the target area corresponding to the image to be detected. In this way, when the lesion area of the medical image is very small, the lesion area in the medical image can be accurately detected, avoiding missed diagnosis and improving the efficiency and accuracy of the consultation, thereby meeting the detection requirements for the lesion area and improving the detection effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0021] Figure 1 is a scene schematic diagram of a target detection method provided in an embodiment of the present application;
[0022] Figure 2 It is a flowchart of a target detection method provided in an embodiment of the present application;
[0023] Figure 3 A schematic block diagram of a network framework of a neural network model provided in an embodiment of the present application;
[0024] Figure 4 A schematic block diagram of a network framework of an FC module provided in an embodiment of the present application;
[0025] Figure 5 A schematic block diagram of a network framework of an attention module provided in an embodiment of the present application;
[0026] Figure 6 is a schematic block diagram of a target detection device provided in one embodiment of the present application;
[0027] Figure 7 It is a schematic block diagram of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0029] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor do they have to be executed in the order described. For example, some operations / steps can also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions. In addition, although the functional modules are divided in the device schematic, in some cases, the module division can be different from that in the device schematic.
[0030] The term "and / or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0031] Convolutional neural networks (CNNs) based on deep learning have achieved great success in computer vision tasks such as image classification and object detection. However, their performance drops rapidly in difficult object detection tasks such as those with low image resolution or small objects. For example, in the detection of tumors, lesions or abnormal areas in medical images, some lesions are very small and are likely to be ignored, resulting in missed diagnosis.
[0032] A flawed but common design in existing CNN architectures is to use strided convolution and pooling layers to upsample feature maps, which leads to the loss of fine-grained information and the learning of less efficient feature representations.
[0033] The present application proposes a target detection method, a target detection device, a computer device and a computer-readable storage medium, which can accurately detect the lesion area in the medical image when the lesion area in the medical image is very small, avoid missed diagnosis and improve the efficiency and accuracy of the diagnosis, thereby meeting the detection needs for the lesion area and improving the detection effect.
[0034] The method can be applied to a server, and of course can also be applied to a terminal device to generate a corresponding topic segmentation model, wherein the terminal device may include a fixed terminal such as a mobile phone, a tablet computer, a personal digital assistant (PDA), etc. The server can be, for example, a separate server or a server cluster. However, for ease of understanding, the following embodiments will be described in detail by applying the server target detection method.
[0035] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0036] like Figure 1 As shown, the target detection method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. The application environment includes a terminal device 110 and a server 120, wherein the terminal device 110 can communicate with the server 120 through a network. Specifically, the server 120 obtains the image to be detected, and based on the feature transformation layer of the neural network model, slices the image to be detected to obtain multiple feature layers and their corresponding feature layer numbers; determines the channel information according to the feature layer number, and stacks and splices the multiple feature layers according to the channel information to obtain a feature map corresponding to the image to be detected; based on the convolution layer of the neural network model, extracts features from each channel corresponding to the feature map to obtain channel features of each channel; based on the attention module of the neural network model, performs feature fusion processing on the channel features corresponding to each channel to obtain image features; based on the prediction layer of the neural network model, performs target acquisition on the feature map according to the image features to obtain the target area corresponding to the image to be detected, and sends the target area to the terminal device 110. Among them, the server 120 can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal device 110 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application does not limit this.
[0037] See also Figure 2 , Figure 2 This is a schematic flow chart of a target detection method provided in an embodiment of the present application. The target detection method can be applied to a server, so that when the lesion area in the medical image is very small, the lesion area in the medical image can be accurately detected, thereby avoiding missed diagnosis and improving the efficiency and accuracy of the consultation, thereby meeting the detection needs for the lesion area and improving the detection effect.
[0038] like Figure 2 As shown, the target detection method includes steps S101 to S105.
[0039] S101, obtaining an image to be detected, and slicing the image to be detected based on a feature transformation layer of a neural network model to obtain a plurality of feature layers and their corresponding feature layer numbers.
[0040] The image to be detected may be a medical image, a traffic image, a landscape image, etc., for example, a tumor image, a lesion image, or a vehicle image, etc. The neural network model may be a neural network model corresponding to a target detection algorithm, and the target detection algorithm may include a target detection algorithm such as YOLOV5. The feature layer is a layer composed of pixels with the same feature value, which can be obtained by slicing the image to be detected. The number of feature layers is the number corresponding to the feature layer.
[0041] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0042] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0043] like Figure 3 As shown, Figure 3 A schematic block diagram of a network framework of a neural network model provided in an embodiment of the present application. The neural network model may include an input terminal, a reference network, a Neck network, and a Head output terminal, wherein the input terminal, the reference network, the Neck network, and the Head output terminal are connected in sequence.
[0044] Among them, the baseline network includes a feature transformation layer (FC module) and a convolution layer, the Neck network includes an attention module (SELayer module), and the Head output includes a prediction layer. This application uses the FC module to replace each strided convolution and pooling layer in the neural network model corresponding to the original YOLOV5 algorithm, thereby avoiding the loss of fine-grained information and improving the learning efficiency of small feature representations, so that the neural network model can detect smaller targets.
[0045] In some embodiments, the image to be detected is subjected to interval sampling processing according to the pixel points of the image to be detected to obtain the pixel values corresponding to each pixel point; the image to be detected is sliced and combined according to the pixel points and their corresponding pixel values to obtain multiple feature layers; the number of the multiple feature layers is summarized to obtain the number of feature layers. In this way, the image to be detected can be sliced accurately to obtain the feature layers and the number of feature layers.
[0046] Among them, the pixel value is the value assigned by the computer when the pixel is digitized, which represents the average brightness information of the pixel.
[0047] Specifically, the image to be detected is subjected to interval sampling processing according to the pixel points of the image to be detected, so as to determine the pixel value corresponding to each pixel point in the image to be detected; the image to be detected is sliced according to the pixel points, so as to cut out the image blocks corresponding to the pixel points, and the image blocks are combined according to the pixel value corresponding to each pixel point, so as to generate multiple different feature layers; the number of feature layers generated is summarized to obtain the number of feature layers.
[0048] like Figure 4 As shown, exemplarily, the image to be detected is sampled at intervals according to the pixel points of the image to be detected, so as to determine the pixel value corresponding to each pixel point in the image to be detected, for example, the pixel values corresponding to each pixel point are 1, 2, 3, and 4 respectively; the image to be detected is sliced according to the pixel points to cut out the image blocks corresponding to the pixel points, and the image blocks are combined according to the pixel values corresponding to each pixel point, at this time four independent feature layers are obtained, so the number of feature layers is 4, and at this time it can be determined that the input channel is expanded four times.
[0049] Among them, neighboring sampling is performed on the image to be detected, so that four pictures can be generated. The information of the four pictures is complementary, and there is no information loss. In this way, the size information (H*W) in the image can be concentrated in the channel space, and the input channel is expanded by 4 times, that is, the spliced picture becomes 12 channels compared to the original RGB three-channel mode.
[0050] In some embodiments, the image to be detected is sliced according to the pixel points to obtain multiple image blocks; the pixel values corresponding to each image block are obtained, and the image blocks with the same pixel values are combined and processed to obtain multiple feature layers. In this way, multiple feature layers can be accurately obtained.
[0051] The image blocks may be image blocks corresponding to each pixel point.
[0052] Specifically, the image to be detected is sliced according to the boundaries of the pixel points to obtain a plurality of image blocks; the pixel value corresponding to each image block is obtained, and the image blocks with the same pixel value are combined and processed to obtain a plurality of feature layers.
[0053] like Figure 4 As shown, exemplarily, the image to be detected is sliced according to the boundaries of the pixel points to obtain multiple image blocks, and the pixel values corresponding to each image block are obtained. For example, the pixel values corresponding to each pixel point are 1, 2, 3, and 4 respectively; the image blocks with a pixel value of 1 are combined to generate a feature layer composed of image blocks with pixel values of 1, and so on, the image blocks with a pixel value of 2 are combined to generate a feature layer composed of image blocks with pixel values of 2, thereby obtaining multiple feature layers.
[0054] Exemplarily, the size information of each image block can be calculated by the following formula:
[0055]
[0056] Among them, f 0,0 is the size information of the image block corresponding to row 0 and column 0, f 1,0 is the size information of the image block corresponding to the 1st row and the 0th column, and so on. X is the size information of the image corresponding to the feature layer. The size can be expressed as S×S×C1, where S is the length and width, C1 is the number of channels, and scale is the scale factor, which can be determined by the number of channels.
[0057] S102, determining channel information according to the number of feature layers, and stacking and splicing the multiple feature layers according to the channel information to obtain a feature map corresponding to the image to be detected.
[0058] The channel information may be used to represent the basic information of the channel, such as the channel dimension. The feature map is an image with channel features obtained by stacking and splicing multiple feature layers.
[0059] Specifically, the channel dimension can be determined according to the number of feature layers, thereby determining the corresponding scaling factor.
[0060] In some embodiments, the channels corresponding to the feature layers with the same pixel values are merged according to the channel dimension to obtain multiple sub-feature maps, and the multiple sub-feature maps are stacked and spliced to obtain the feature map corresponding to the image to be detected. In this way, the sub-feature maps can be accurately generated, and the feature maps can be stacked and spliced to obtain the feature maps.
[0061] Among them, the sub-feature map can be generated by merging the channels corresponding to the feature layers.
[0062] Specifically, channels corresponding to feature layers with the same pixel values are merged according to the channel dimension, thereby increasing the number of features of the image, while the information under each feature remains unchanged, and multiple sub-feature maps are generated; multiple sub-feature maps are stacked and spliced to obtain a feature map corresponding to the image to be detected.
[0063] S103. Based on the convolutional layer of the neural network model, extract features of each channel corresponding to the feature map to obtain channel features of each channel.
[0064] The convolution layer of the neural network model is a non-strided (i.e., stride=1) convolution layer with a filter. Channel features are used to represent the detection of a certain feature, and the strength of a value at a certain point in the channel is a response to the strength of the current feature.
[0065] Specifically, the reason for using non-strided convolution is to retain all discriminative feature information as much as possible. Otherwise, for example, using strided convolution like the prior art, such as using 3×3 convolution with stride=3, the feature map will be "shrinked", but each pixel is sampled only once; if stride=2, asymmetric sampling will occur, where even and odd rows / columns are sampled at different times. In general, a step size greater than 1 will result in non-discriminatory loss of information, so this application uses non-strided convolution.
[0066] In some embodiments, according to the channel dimension, each channel corresponding to the feature map is compressed to obtain a first target feature map, and each channel corresponding to the first target feature map is subjected to feature extraction to obtain channel features of each channel. Thus, the channel features of each channel can be accurately extracted while retaining all discriminant feature information as much as possible.
[0067] Among them, the first target feature map is a feature map obtained after convolution, that is, channel compression.
[0068] Specifically, each channel corresponding to the feature map can be compressed by one time according to the channel dimension, so as to generate a first target feature map; and then feature extraction processing is performed on each channel corresponding to the first target feature map, so as to obtain channel features of each channel.
[0069] Exemplarily, the feature map can be subjected to global average pooling processing to compress the two-dimensional features (H*W) of each channel in the feature map into one real number, that is, the feature map is transformed from [h, w, c] ==> [1, 1, c] to generate a first target feature map; then, feature extraction processing is performed on each channel corresponding to the first target feature map to obtain channel features of each channel.
[0070] S104: Based on the attention module of the neural network model, feature fusion processing is performed on the channel features corresponding to the various channels to obtain image features.
[0071] Among them, the present application embeds an attention module (SELayer) in the Neck network of the neural network model, so that the neural network model can pay more attention to the detection target of the diseased area, thereby improving the detection effect. The image feature can be the feature information highlighted in the feature map. The image feature is the feature information obtained after the channel feature is fused.
[0072] In some embodiments, the weight coefficient corresponding to each channel is determined according to the channel features corresponding to each channel; and the channel features corresponding to each channel are subjected to weighted feature fusion processing according to the weight coefficients corresponding to each channel to obtain image features. In this way, the weight coefficient corresponding to each channel can be accurately determined, so that the tiny features in the feature map can be highlighted, thereby accurately detecting the lesion area in the medical image, avoiding missed diagnosis and improving the efficiency of consultation.
[0073] Among them, Figure 5 As shown in the figure, since convolution only operates in local space (without global receptive field), it is difficult to obtain enough information to extract the relationship features between channels. In order to extract the relationship between channels, the spatial features on each channel must first be encoded (compressed) into a global feature (which can be understood as the fusion of the feature information of each channel), which is implemented by global flat pooling, with an output dimension of 1x1xC.
[0074] After obtaining the 1x1xC global features of Squeeze, add a FC fully connected layer (Fully Connected) to predict the importance of each channel. After obtaining the importance of different channels, act (excite) on the corresponding channels of the previous feature map, and then perform subsequent operations.
[0075] Finally, we need to perform a scale operation. After obtaining a 1×1×C vector, we can perform a scale operation on the original feature map. It is very simple, which is to multiply the channel weights. The original feature vector is W×H×C. The weight values of each channel calculated by the SE module are multiplied by the two-dimensional matrix of the corresponding channel of the original feature map, and the result is output.
[0076] Specifically, according to the channel features corresponding to each channel, the weight coefficient corresponding to each channel is determined according to the channel features; according to the weight coefficient corresponding to each channel, the corresponding weight coefficient is assigned to each channel, so that the channel features corresponding to each channel are subjected to weighted feature fusion processing according to the weight coefficient, so as to obtain the image features.
[0077] Exemplarily, if it is determined that the channels of the feature map include channel A, channel B and channel C, according to the channel features corresponding to channel A, channel B and channel C, and according to the channel features, the weight coefficients corresponding to channel A, channel B and channel C are determined to be 50%, 30% and 20% respectively; according to the weight coefficients corresponding to channel A, channel B and channel C, corresponding weight coefficients are assigned to channel A, channel B and channel C, and weighted feature fusion processing is performed on the channel features corresponding to each channel according to the weight coefficients, thereby obtaining image features.
[0078] In some embodiments, the feature map is normalized according to the channel features corresponding to each channel to obtain a second target feature map; the number of channels corresponding to the second target feature map is obtained, and the importance of each channel is predicted according to the number of channels to obtain the importance of each channel; and the weight coefficient corresponding to each channel is determined according to the importance of each channel. In this way, the weight coefficient corresponding to each channel can be accurately determined.
[0079] Among them, the second target feature map is a feature map generated after normalization processing.
[0080] Specifically, the SE module can explicitly model the interdependence between channels, obtain the importance of each channel through learning, and then weight the features on each channel according to this importance, so as to highlight important features and suppress unimportant features.
[0081] Exemplarily, the correlation between channels is constructed through two fully connected layers, and the number of output weight values is the same as the number of channels of the input feature map, that is, [1, 1, c] ==> [1, 1, c]; finally, the normalized weight obtained above is weighted to the features of each channel. By multiplying each channel by a weight coefficient, that is, [h, w, c]*[1, 1, c] ==> [h, w, c]. The SE module is not added in the prior art, so the importance of each channel of the feature map is the same. By embedding the SE module, the present application can make the importance of each feature channel different, so that the neural network model focuses on certain channels with large weight values.
[0082] S105. Based on the prediction layer of the neural network model, target acquisition is performed on the feature map according to the image features to obtain a target area corresponding to the image to be detected.
[0083] The prediction layer is used to perform target detection on the feature map. The target region is an object or region obtained after target detection, for example, the target region can be a tumor, lesion or abnormal region in a medical image.
[0084] Specifically, the prediction layer based on the neural network model can more accurately collect targets on the feature map according to the image features, so that the prediction layer pays more attention to tiny targets to be detected, thereby accurately obtaining the target area corresponding to the image to be detected.
[0085] The target detection method disclosed in the embodiment of the present application is based on the feature transformation layer of the neural network model, slicing the image to be detected to obtain multiple feature layers and their corresponding feature layer numbers; determining the channel information according to the feature layer number, and stacking and splicing the multiple feature layers according to the channel information to obtain the feature map corresponding to the image to be detected; based on the convolution layer of the neural network model, extracting the features of each channel corresponding to the feature map to obtain the channel features of each channel; based on the attention module of the neural network model, performing feature fusion processing on the channel features corresponding to each channel to obtain the image features; based on the prediction layer of the neural network model, performing target acquisition on the feature map according to the image features to obtain the target area corresponding to the image to be detected. In this way, when the lesion area of the medical image is very small, the lesion area in the medical image can be accurately detected, avoiding missed diagnosis and improving the efficiency and accuracy of the consultation, thereby meeting the detection requirements for the lesion area and improving the detection effect.
[0086] See also Figure 6 , Figure 6 It is a schematic block diagram of a target detection device provided in an embodiment of the present application. The target detection device can be configured in a server to execute the aforementioned target detection method.
[0087] like Figure 6 As shown, the target detection device 200 includes: a feature layer generation module 201, a feature map generation module 202, a channel feature extraction module 203, a feature fusion module 204 and a target detection module 205.
[0088] The feature layer generation module 201 is used to obtain an image to be detected, and based on the feature transformation layer of the neural network model, slice the image to be detected to obtain multiple feature layers and their corresponding feature layer numbers;
[0089] A feature map generating module 202 is used to determine channel information according to the number of feature layers, and stack and splice the multiple feature layers according to the channel information to obtain a feature map corresponding to the image to be detected;
[0090] The channel feature extraction module 203 is used to extract features of each channel corresponding to the feature map based on the convolution layer of the neural network model to obtain channel features of each channel.
[0091] A feature fusion module 204 is used to perform feature fusion processing on the channel features corresponding to each channel based on the attention module of the neural network model to obtain image features;
[0092] The target detection module 205 is used to collect targets on the feature map based on the prediction layer of the neural network model according to the image features to obtain the target area corresponding to the image to be detected.
[0093] In some embodiments, the feature layer generation module 201 is also used to perform interval sampling processing on the image to be detected according to the pixel points of the image to be detected to obtain pixel values corresponding to each pixel point; slice and combine the image to be detected according to the pixel points and their corresponding pixel values to obtain multiple feature layers; and summarize the number of the multiple feature layers to obtain the number of feature layers.
[0094] In some embodiments, the feature layer generation module 201 is also used to slice the image to be detected according to the pixel points to obtain multiple image blocks; obtain the pixel value corresponding to each of the image blocks, and combine the image blocks with the same pixel value to obtain multiple feature layers.
[0095] In some embodiments, the feature map generation module 202 is also used to merge the channels corresponding to the feature layers with the same pixel values according to the channel dimension to obtain multiple sub-feature maps; and stack and splice the multiple sub-feature maps to obtain the feature map corresponding to the image to be detected.
[0096] In some embodiments, the channel feature extraction module 203 is also used to compress each channel corresponding to the feature map according to the channel dimension to obtain a first target feature map; and perform feature extraction processing on each channel corresponding to the first target feature map to obtain channel features of each channel.
[0097] In some embodiments, the feature fusion module 204 is further used to determine the weight coefficient corresponding to each channel according to the channel features corresponding to each channel; and perform weighted feature fusion processing on the channel features corresponding to each channel according to the weight coefficients corresponding to each channel to obtain image features.
[0098] In some embodiments, the feature fusion module 204 is further used to normalize the feature map according to the channel features corresponding to the channels to obtain a second target feature map; obtain the number of channels corresponding to the second target feature map, and predict the importance of each channel according to the number of channels to obtain the importance of each channel; determine the weight coefficient corresponding to each channel according to the importance of each channel.
[0099] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, modules and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0100] The method and apparatus of the present application can be used in many general or special computing system environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer terminal devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices.
[0101] Exemplarily, the above method and apparatus may be implemented in the form of a computer program. The computer program may be implemented in the form of a computer program. Figure 7 Runs on the computer device shown.
[0102] See also Figure 7 , Figure 7 1 is a schematic diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0103] like Figure 7 As shown, the computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a volatile storage medium, a non-volatile storage medium and an internal memory.
[0104] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any target detection method.
[0105] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0106] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any target detection method.
[0107] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art can understand that the structure of the computer device is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0108] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0109] Among them, in some embodiments, the processor is used to run a computer program stored in a memory to implement the following steps: obtaining an image to be detected, and based on the feature transformation layer of the neural network model, slicing the image to be detected to obtain multiple feature layers and their corresponding feature layer numbers; determining channel information according to the feature layer number, and stacking and splicing the multiple feature layers according to the channel information to obtain a feature map corresponding to the image to be detected; based on the convolution layer of the neural network model, extracting features of each channel corresponding to the feature map to obtain channel features of each channel; based on the attention module of the neural network model, performing feature fusion processing on the channel features corresponding to each channel to obtain image features; based on the prediction layer of the neural network model, performing target acquisition on the feature map according to the image features to obtain a target area corresponding to the image to be detected.
[0110] In some embodiments, the processor is further used to perform interval sampling processing on the image to be detected according to the pixel points of the image to be detected to obtain pixel values corresponding to each pixel point; slice and combine the image to be detected according to the pixel points and their corresponding pixel values to obtain multiple feature layers; and summarize the number of the multiple feature layers to obtain the number of feature layers.
[0111] In some implementations, the image to be detected is sliced according to the pixel points to obtain a plurality of image blocks; a pixel value corresponding to each of the image blocks is obtained, and image blocks with the same pixel value are combined to obtain a plurality of feature layers.
[0112] In some embodiments, the channels corresponding to the feature layer with the same pixel value are merged according to the channel dimension to obtain multiple sub-feature maps; the multiple sub-feature maps are stacked and spliced to obtain the feature map corresponding to the image to be detected.
[0113] In some embodiments, according to the channel dimension, compression processing is performed on each channel corresponding to the feature map to obtain a first target feature map; feature extraction processing is performed on each channel corresponding to the first target feature map to obtain channel features of each channel.
[0114] In some implementations, a weight coefficient corresponding to each channel is determined based on the channel features corresponding to each channel; and a weighted feature fusion process is performed on the channel features corresponding to each channel based on the weight coefficients corresponding to each channel to obtain image features.
[0115] In some embodiments, the feature map is normalized according to the channel features corresponding to the channels to obtain a second target feature map; the number of channels corresponding to the second target feature map is obtained, and the importance of each channel is predicted according to the number of channels to obtain the importance of each channel; and the weight coefficient corresponding to each channel is determined according to the importance of each channel.
[0116] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions, and when the program instructions are executed, any target detection method provided in the embodiment of the present application is implemented.
[0117] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.
[0118] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.
[0119] The present invention refers to a new application model of computer technologies such as storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. of the blockchain language model. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the blockchain underlying platform, platform product service layer, and application service layer.
[0120] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A target detection method, characterized in that: The method comprises: Acquire an image to be detected, and perform slicing processing on the image to be detected based on the feature transformation layer of the neural network model to obtain multiple feature layers and their corresponding feature layer numbers; Determine channel information according to the number of feature layers, and stack and splice the multiple feature layers according to the channel information to obtain a feature map corresponding to the image to be detected; Based on the convolution layer of the neural network model, feature extraction is performed on each channel corresponding to the feature map to obtain channel features of each channel; Based on the attention module of the neural network model, feature fusion processing is performed on the channel features corresponding to each channel to obtain image features; Based on the prediction layer of the neural network model, target acquisition is performed on the feature map according to the image features to obtain a target area corresponding to the image to be detected.
2. The method according to claim 1, characterized in that The feature transformation layer based on the neural network model performs slicing processing on the image to be detected to obtain multiple feature layers and their corresponding feature layer numbers, including: Performing interval sampling processing on the image to be detected according to the pixel points of the image to be detected to obtain the pixel value corresponding to each pixel point; Slicing and combining the image to be detected according to the pixel points and their corresponding pixel values to obtain multiple feature layers; The quantities of the multiple feature layers are summed up to obtain the number of feature layers.
3. The method according to claim 2, characterized in that The step of slicing and combining the image to be detected according to the pixel points and the pixel values to obtain multiple feature layers includes: Slicing the image to be detected according to the pixel points to obtain a plurality of image blocks; The pixel values corresponding to the image blocks are obtained, and the image blocks with the same pixel values are combined to obtain multiple feature layers.
4. The method according to claim 1, characterized in that: The channel information includes a channel dimension, and the stacking and splicing processing of the multiple feature layers according to the channel information to obtain a feature map corresponding to the image to be detected includes: Merging channels corresponding to the feature layers with the same pixel values according to the channel dimension to obtain multiple sub-feature maps; The multiple sub-feature maps are stacked and spliced to obtain a feature map corresponding to the image to be detected.
5. The method according to claim 1, characterized in that The channel information includes a channel dimension, and the convolution layer based on the neural network model extracts features of each channel corresponding to the feature map to obtain channel features of each channel, including: According to the channel dimension, compress each channel corresponding to the feature map to obtain a first target feature map; Perform feature extraction processing on each channel corresponding to the first target feature map to obtain channel features of each channel.
6. The method according to claim 1, characterized in that Based on the attention module of the neural network model, feature fusion processing is performed on the channel features corresponding to each channel to obtain image features, including: Determine the weight coefficient corresponding to each channel according to the channel characteristics corresponding to each channel; According to the weight coefficients corresponding to the channels, weighted feature fusion processing is performed on the channel features corresponding to the channels to obtain image features.
7. The method according to claim 6, characterized in that Determining the weight coefficient corresponding to each channel according to the channel characteristics corresponding to each channel includes: According to the channel features corresponding to the channels, the feature map is normalized to obtain a second target feature map; Obtaining the number of channels corresponding to the second target feature map, and predicting the importance of each channel according to the number of channels to obtain the importance of each channel; The weight coefficient corresponding to each channel is determined according to the importance of each channel.
8. A target detection device, characterized in that: include: A feature layer generation module is used to obtain an image to be detected, and based on the feature transformation layer of the neural network model, slice the image to be detected to obtain multiple feature layers and their corresponding feature layer numbers; A feature map generation module, used to determine channel information according to the number of feature layers, and stack and splice the multiple feature layers according to the channel information to obtain a feature map corresponding to the image to be detected; The channel feature extraction module is used to extract features of each channel corresponding to the feature map based on the convolution layer of the neural network model to obtain the channel features of each channel. A feature fusion module, used to perform feature fusion processing on the channel features corresponding to each channel based on the attention module of the neural network model to obtain image features; The target detection module is used to collect targets on the feature map based on the prediction layer of the neural network model according to the image features to obtain the target area corresponding to the image to be detected.
9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and implement, when executing the computer program: The target detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the target detection method according to any one of claims 1 to 7.