Image detection method, image detection device, equipment and readable storage medium
By introducing image detection models trained by reinforcement learning and integrated learning algorithms in the object detection method, the problem of difficulty in improving recognition efficiency and accuracy in the existing technology is solved, efficient and accurate image detection is achieved, and the construction of smart cities is promoted.
Patent Information
- Application Number
- CN202411700855.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-03-25
AI Technical Summary
The existing object detection methods can only weigh the trade-off between improving recognition efficiency and recognition accuracy, and cannot improve both at the same time.
An image detection method is adopted to obtain the target image to be processed and processed using the trained image detection model. The model includes a feature extraction model and an image classification model. The feature extraction model is trained through reinforcement learning algorithms, and the image classification model is trained through integrated learning algorithms. This method can dynamically learn image features, optimize screening, and improve detection efficiency and accuracy.
It has achieved the realization of high recognition accuracy while improving identification efficiency, and is suitable for the field of smart medical care in smart cities, and promoted the construction of smart cities.
Smart Images

Figure CN119693612A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image processing in artificial intelligence, and in particular to an image detection method, an image detection device, equipment and a storage medium. Background Art
[0002] Object detection is widely used in engineering scenarios such as autonomous driving road condition recognition. By integrating the segmentation and recognition of machine vision tasks, object detection can achieve better extraction and detection results for multiple targets in complex road traffic scenarios. Object detection can also be applied to the field of smart medical care. For example, in lesion inspection, by using object detection on lesion photos, the type of disease can be identified from the lesion photos. Automatic extraction and target recognition tasks in object detection tasks have high requirements for real-time performance and accuracy.
[0003] In practical applications, the two commonly used models in target detection, the two-stage model and the single-stage model, have their own defects. The two-stage model, such as the Fast RCNN model, has high accuracy but poor timeliness and cannot achieve real-time detection speed, while the single-stage model, such as the SSD model, has high timeliness but poor detection accuracy. Existing target detection methods can only optimize one of the directions of recognition efficiency or recognition accuracy, and cannot ensure recognition accuracy while improving recognition efficiency. Summary of the invention
[0004] The main purpose of this application is to provide an image detection method, an image detection device, an equipment and a storage medium, which aims to solve the problem that the existing target detection method can only optimize one of the recognition efficiency or recognition accuracy, and cannot ensure the recognition accuracy while improving the recognition efficiency. The image detection method provided in the embodiment of this application can be applied to the smart medical field of smart cities, thereby promoting the construction of smart cities.
[0005] In a first aspect, the present application provides an image detection method, comprising:
[0006] Obtaining a target image to be processed;
[0007] Acquire a trained image detection model, wherein the image detection model includes a feature extraction model and an image classification model, wherein the feature extraction model is obtained by training a feature filter in the target detection model according to a reinforcement learning algorithm, and the image classification model is obtained by training a classifier in the target detection model according to an ensemble learning algorithm;
[0008] Inputting the target image into the feature extraction model to perform feature extraction processing to obtain image feature information corresponding to the target image;
[0009] The image feature information is input into the image classification model for classification prediction to obtain a classification prediction result corresponding to the target image.
[0010] In a second aspect, the present application further provides an image detection device, the image detection device comprising:
[0011] An image acquisition module, used for acquiring a target image to be processed;
[0012] A model acquisition module is used to acquire a trained image detection model, wherein the image detection model includes a feature extraction model and an image classification model, wherein the feature extraction model is obtained by training a feature filter in the target detection model according to a reinforcement learning algorithm, and the image classification model is obtained by training a classifier in the target detection model according to an ensemble learning algorithm;
[0013] A feature extraction module is used to input the target image into the feature extraction model for feature extraction processing to obtain image feature information corresponding to the target image;
[0014] The classification prediction module is used to input the image feature information into the image classification model for classification prediction to obtain the classification prediction result corresponding to the target image.
[0015] In a third aspect, the present application also provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the image detection method as described above are implemented.
[0016] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the image detection method as described above are implemented.
[0017] The present application provides an image detection method, an image detection device, an equipment and a storage medium. The method includes: obtaining a target image to be processed; obtaining a trained image detection model, the image detection model includes a feature extraction model and an image classification model, the feature extraction model is obtained by training the feature filter in the target detection model according to the reinforcement learning algorithm, and the image classification model is obtained by training the classifier in the target detection model according to the ensemble learning algorithm; inputting the target image into the feature extraction model for feature extraction processing to obtain image feature information corresponding to the target image; inputting the image feature information into the image classification model for classification prediction to obtain the classification prediction result corresponding to the target image. The method performs image detection on the target image by using the image detection model obtained by training based on the reinforcement learning algorithm and the ensemble learning algorithm, and can dynamically learn the image features in the target image, optimize and screen the image features, and improve the efficiency and accuracy of image detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] 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.
[0019] Figure 1 A schematic diagram of the steps of an image detection method provided in an embodiment of the present application;
[0020] Figure 2 A schematic flow chart of sub-steps for screening an initial feature vector provided in an embodiment of the present application;
[0021] Figure 3 A schematic flowchart of sub-steps for extracting image features provided in an embodiment of the present application;
[0022] Figure 4 A schematic flowchart of sub-steps for generating a detection frame provided in an embodiment of the present application;
[0023] Figure 5 A schematic flowchart of sub-steps for screening and optimizing an initial detection frame provided in an embodiment of the present application;
[0024] Figure 6 A schematic block diagram of an image detection device provided in an embodiment of the present application;
[0025] Figure 7 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application.
[0026] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0027] 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.
[0028] 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.
[0029] Object detection is one of the important branches in the field of computer vision. It has been widely used in life, such as monitoring security, autonomous driving, and smart medical care. The task of object detection is to locate instances of a certain type of semantic object. With the rapid development of deep detection learning networks for detection tasks, the performance of various methods for object detection has been greatly improved. In practical applications, traditional methods for object detection can only optimize one of the two directions: recognition efficiency or recognition accuracy. It is impossible to improve recognition efficiency while ensuring recognition accuracy.
[0030] The embodiments of the present application provide an image detection method, device, equipment and storage medium, which are intended to solve the problem that the existing target detection method can only be optimized in one direction of recognition efficiency or recognition accuracy, and cannot ensure recognition accuracy while improving recognition efficiency. Among them, the image detection method can be applied to a terminal device or a server, and the terminal device can be an electronic device such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant and a wearable device; the server can be a single server or a server cluster composed of multiple servers. The following is an explanation using the application of the image detection method to a terminal device as an example.
[0031] 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.
[0032] Please refer to Figure 1 , Figure 1 A schematic diagram of the steps of an image detection method provided in an embodiment of the present application.
[0033] like Figure 1 As shown, the image detection method includes steps S101 to S104.
[0034] Step S101: Acquire a target image to be processed.
[0035] Exemplarily, the types of target images may include multiple types, including but not limited to road traffic maps, satellite images, etc. For example, the target image may be a road traffic map, including multiple image features, tree features, pedestrian features, and vehicle features, etc. The target image may also be a medical image, such as a magnetic resonance imaging image, an ultrasound image, and a pathological image, etc.
[0036] Step S102, obtaining a trained image detection model, the image detection model includes a feature extraction model and an image classification model, the feature extraction model is obtained by training the feature filter in the target detection model according to the reinforcement learning algorithm, and the image classification model is obtained by training the classifier in the target detection model according to the ensemble learning algorithm.
[0037] In some embodiments, step S102 also includes sub-step S1021 and sub-step S1021 before step S102.
[0038] Sub-step S1021: Obtain sample images to be trained.
[0039] Sub-step S1022: Based on the reinforcement learning algorithm, the sample image is input into the feature filter in the target detection model for iterative training to obtain a feature extraction model.
[0040] Exemplarily, based on a convolutional neural network, image features are extracted from sample images to obtain image features; based on a reinforcement learning algorithm, a feature filter is constructed, the image features are input into the feature filter for training, and the reinforcement learning algorithm parameters are updated according to the training results.
[0041] Exemplarily, the sample image is a nuclear magnetic resonance image, and feature extraction is performed on the sample image to obtain normal human soft tissue features and lesion tissue features in the sample image; a feature filter is constructed based on a reinforcement learning algorithm, and the normal human soft tissue features and lesion tissue features are input into the feature filter for training, and the filtering goal of the feature filter is to filter the normal human soft tissue features and retain the lesion tissue features. The reinforcement learning algorithm parameters are updated according to the training results.
[0042] In one embodiment, image features are input into a feature filter for training, including: performing a screening action on the image features based on a policy function in a reinforcement learning algorithm; scoring the screening action through a value function to obtain a scoring result; and updating the reinforcement learning algorithm parameters based on the scoring result.
[0043] Among them, the policy function is used to decide what kind of screening action to perform on the image features. The policy function can update its own decision-making behavior based on the decisions made in the past and the value function to improve the effect of the decision. The screening action includes marking the image features as key features and marking the image features as redundant features. The value function is used to judge the quality of the screening action after executing the screening action and make an evaluation, that is, a score.
[0044] Exemplarily, the sample image is an image of a road traffic environment, and the image features of the sample image include multiple categories, such as tree features, pedestrian features, and vehicle features. The training goal is to exclude tree features and pedestrian features and retain vehicle features; input the image features into the feature filter, and the feature filter performs screening actions based on the policy function: "mark tree features as key features", "mark pedestrian features as redundant features", and "mark vehicle features as key features"; the value function gives -1 points to "mark tree features as key features", 1 point to "mark pedestrian features as redundant features", and 1 point to "mark vehicle features as key features". The statistical scoring results are scored to obtain 1 point, and according to the scoring results, the parameters of the reinforcement learning algorithm are updated so that the next time the policy function performs screening, a better choice is made, that is, a higher score is obtained.
[0045] Exemplarily, the sample image is a pathological image, and the image features of the sample image include diseased tissue features and normal tissue features. The training goal is to filter out normal tissue features, and the image features are input into the feature filter. The feature filter performs screening actions based on the strategy function: "Mark normal tissue as redundant features" and "Mark diseased tissue as key features". The value function scores the corresponding screening actions: 1 point for "Mark normal tissue as redundant features", 1 point for "Mark diseased tissue as key features", and 2 points for statistical scoring. The reinforcement learning algorithm parameters are updated according to the scoring results, so that the next time the strategy function performs screening, a better choice can be made to obtain a higher score.
[0046] In one embodiment, performing a screening action on an image feature based on a policy function in a reinforcement learning algorithm includes: calculating the probability of performing a screening action on an image feature through a policy function, and selecting a screening action with the highest probability for execution. It should be noted that after performing the screening action, the policy function will update the policy function according to the scoring result of the value function to improve the correctness of the policy function in performing the screening action.
[0047] It should be noted that feature filters trained based on reinforcement learning algorithms can actively learn features in sample images, obtain required feedback from sample images, and dynamically execute screening strategies, so that feature filters can learn normal tissue features and case tissue features of pathological images in scenarios where dynamic filtering features are required, such as in smart medical care, so that the filters can achieve better filtering effects.
[0048] In some embodiments, before step S102, sub-step S1023 and sub-step S1024 are also included.
[0049] Sub-step S1023, obtaining feature information of sample images to be trained;
[0050] Sub-step S1024: Based on an ensemble learning algorithm, the sample image feature information is input into the classifier in the target detection model for iterative training to obtain an image classification model.
[0051] Exemplarily, multiple base learners are obtained, and the multiple base learners are integrated according to the set strategy to obtain an initial image classification model; the hyperparameters of the initial image classification model are optimized based on Bayes' theorem, and the hyperparameters of the initial classification model are updated according to the optimization results; the sample image feature information is input into the initial image classification model for iterative training; the initial image classification model is updated according to the iterative training results to obtain the image classification model.
[0052] It should be noted that the base learner is generated from the training data according to the learning algorithm, and the learning algorithm may include but is not limited to SVM, neural network, K-nearest neighbor, etc. The base learner may be generated from the training data according to the same learning algorithm, or may be generated from the training data according to different learning algorithms.
[0053] In some embodiments, obtaining an initial image classification model includes: obtaining a base learner based on sample image feature information; adjusting the weight of the sample image feature information according to the performance of the base learner, and increasing the weight of the sample image feature information misclassified by the base learner; training the next base learner based on the adjusted sample image feature information distribution; iterating this process until the number of base learners reaches a specified number T, integrating the T base learners through an integration strategy to obtain the initial image classification model.
[0054] The set strategy may include but is not limited to the averaging method, the voting method, and the stacking method. Exemplarily, the averaging method includes: the initial image classification model includes T base learners, the prediction result of the base learner is h(x), and the prediction result of each base learner is integrated by weighted average to obtain the prediction result of the initial image classification model, which is expressed as:
[0055]
[0056] In the formula, i represents the i-th base learner, w i is the prediction result weight of the i-th base learner, h i (x) represents the prediction result of the i-th base learner, and H(x) represents the prediction result of the initial image classification model.
[0057] In some embodiments, obtaining the initial image classification model may also include: performing T random sampling of sample image feature information using a bootstrap sampling method, each sampling obtaining a sampling set of m samples; based on the T sampling sets, training T independent base classifiers respectively; and integrating the T base learners through a collection strategy to obtain the initial image classification model.
[0058] Exemplarily, taking the sample image feature information as X-ray image feature information, the X-ray image feature information is randomly sampled T times using the self-service sampling method, and each sampling obtains a sampling set of X-ray image feature information of different human tissues in the X-ray image feature information; based on the T sampling sets, T independent base classifiers are trained respectively, and the T base classifiers learn the characteristics of different human tissues in the X-ray image feature information respectively; the T base learners are integrated through the set strategy to obtain an initial image classification model, and the initial image classification model learns the entire X-ray image feature information in more detail.
[0059] In some embodiments, the hyperparameters of the initial image classification model are optimized based on the Bayesian theorem, and the hyperparameters of the initial classification model are updated according to the optimization results to obtain the image classification model, including: randomly initializing the first hyperparameter of the initial image classification model; obtaining training sample data, and training the initial image classification model according to the sample data, and constructing a proxy model g(x) according to the first hyperparameter and the training results of the initial image classification model; substituting the proxy model g(x) into the sampling function u(x), finding the extreme point of the sampling function u(x), and taking the extreme point as the second hyperparameter, the formula is:
[0060] x * = argmax x u(x,g(x))
[0061] In the formula, x represents the first hyperparameter, x * The extreme point of the sampling function is represented as the second hyperparameter; the second hyperparameter is updated to the initial image classification model to obtain the final image classification model.
[0062] Among them, the proxy model g(x) is obtained based on the Gaussian process, fitting the initialized hyperparameters and the training results of the initial image classification model.
[0063] It should be noted that building an image classification model based on an integrated algorithm can integrate the prediction results of multiple base learners, improve the accuracy of prediction, and is not prone to overfitting. It can adaptively adjust model parameters to improve recognition accuracy, and is suitable for application scenarios that require identification of multiple different categories of targets. For example, in smart healthcare, medical images are diverse and complex. By training multiple base learners with multiple medical images and integrating them with an image classification model based on an integrated algorithm, it is possible to learn deep features of medical images and improve the accuracy of medical image prediction. Using Bayes' theorem to optimize the hyperparameters of the image classification model can refer to the hyperparameters that have been set before, guide the hyperparameter search method, reduce the number of iterations, and improve the efficiency of searching for the target hyperparameters.
[0064] Step S103: input the target image into the feature extraction model for feature extraction processing to obtain image feature information corresponding to the target image.
[0065] In some embodiments, step S103 includes sub-steps S1031 to S1033.
[0066] Step S1031: extract multiple initial feature vectors corresponding to the target image.
[0067] Exemplarily, the target image is input into a convolutional neural network algorithm for feature extraction to obtain multiple initial feature vectors corresponding to the target image, wherein there may be multiple convolutional neural network algorithms, including but not limited to VGG network, Resnet network, etc. Taking the VGG network as an example, the VGG network includes three parts, a convolution layer, a pooling layer, and a fully connected layer. The convolution layer performs a convolution operation on the target image to extract information from the target image. The purpose of the pooling layer is to select the features of the target image extracted in the convolution layer and exclude the features of the target image that are not affected by position. The goal of the fully connected layer is to classify and reduce the features of the target image and output the data as an initial feature vector.
[0068] For example, taking the target image as a pathological image, the pathological image is input into the convolutional neural network algorithm for feature extraction, and the microscopic cell features and glandular image features in the pathological image are obtained.
[0069] Step S1032: Screen multiple initial feature vectors to obtain a target feature vector.
[0070] Exemplarily, multiple initial feature vectors are input into the feature filter, redundant feature vectors are deleted, and the target feature vector is retained. It should be noted that in the initial feature vector, there will be redundant feature vectors that interfere with subsequent recognition. Taking the traffic environment image as an example, the target feature vector is the feature vector corresponding to the vehicle in the traffic environment image, and the redundant feature vector is the feature vector corresponding to the trees and pedestrians in the traffic environment image. In the pathological image, the target feature is the lesion tissue feature corresponding to the lesion area, such as the cell feature of the lesion and the hemangioma feature, and the redundant feature is the normal tissue feature.
[0071] Step S1033: extracting image feature information in the target image based on the target feature vector.
[0072] Exemplarily, based on the target feature vector, a detection frame is drawn on the target image; and the target image is segmented according to the detection frame to extract image feature information.
[0073] It should be noted that the target feature vector extracts the image feature information in the target image, which can subdivide the overall target image and convert the overall recognition into multiple small area recognitions to improve recognition efficiency. For example, in the field of smart medical care, it is necessary to slice and analyze the diseased tissue. By segmenting the image of the overall diseased tissue and converting it into multiple small areas for recognition, it is possible to better analyze the subtle areas and improve recognition efficiency.
[0074] Step S104: input the image feature information into the image classification model for classification prediction to obtain a classification prediction result corresponding to the target image.
[0075] Exemplarily, based on the image classification model, multiple classification predictions are performed on the image feature information to obtain multiple classification prediction results, and according to the set strategy, the multiple classification prediction results are integrated to obtain the classification prediction result corresponding to the target image.
[0076] For example, in the field of smart medical care, the sample image is a lesion image. By performing multiple classification predictions on the lesion image, the probabilities of obtaining multiple disease types in the lesion image are identified, all disease types are integrated according to the set strategy, and the disease type with the highest probability is selected as the classification prediction result.
[0077] It should be noted that, by training the image detection model based on the reinforcement learning algorithm and the ensemble learning algorithm, the target image is feature filtered, redundant feature vectors are reduced, and the target feature vector is retained, so that the subsequent recognition detection only needs to classify and predict the target feature vector, thereby improving the classification prediction efficiency. Classification prediction is performed based on the feature information of the image after feature filtering, so that the image detection model can dynamically learn the features of the target image to improve the recognition efficiency and ensure the recognition accuracy.
[0078] Please refer to Figure 2 , Figure 2 The following is a schematic flow chart of the sub-steps of screening the initial feature vector provided in the embodiment of the present application. Figure 2 As shown, sub-step S1032, screening multiple initial feature vectors to obtain a target feature vector, includes steps S201 to S204.
[0079] Step S201: perform screening actions on multiple initial feature vectors in sequence, and calculate the mean of the strategy reward function values corresponding to the multiple screening actions.
[0080] Exemplarily, a screening action is performed on multiple initial feature vectors in sequence, wherein the screening action marks the initial feature vectors as redundant features or key features. The screening action is scored based on the value function, and the strategy reward function is calculated; the results of the strategy reward functions corresponding to all the initial feature vectors are averaged to obtain the mean of all the strategy reward functions.
[0081] For example, when performing a screening action a t , the state of the feature filter changes from s′ t Convert to s t , then the strategy return function formula is:
[0082] Q(s t , a t )=(1-α)Q(s t , a t )+α(R(s t , a t )+γmaxQ(s′ t , a′ t ))
[0083] In the formula, s t Indicates that the feature filter performs a filtering action t The subsequent state, s′ t Indicates that the feature filter performs the screening action a′ t The subsequent state, Q(s t , a t ) represents the current policy reward function, Q(s′ t , a′ t ) indicates the execution of the filtering action a′ t The result of the policy reward function after the selection, α is the learning rate, which indicates how much the model parameters are adjusted in each step of parameter update, and the value range of the learning rate is between 0 and 1. γ is the discount rate, which indicates that after each screening action, Q(s′ t , a′ t ), the discount rate is between 0 and 1.
[0084] Among them, R(s t , a t ) is the value function, which means to perform the screening action a t Then score the screening action and get the execution screening action a t The corresponding score. R(s t , a t ) can represent the use of manual filtering action a t Scoring can also mean using other trained models to filter actions a t Scoring is performed, for example, using a neural network model to score the screening action. For example, the feature image and the screening action a t Input the trained neural network and output the screening action a t The corresponding scoring results.
[0085] Step S202: Calculate the feature similarity between any two initial feature vectors in all the initial feature vectors to obtain multiple feature similarities.
[0086] It should be noted that the calculation of feature similarity between any two initial feature vectors in the initial feature vectors includes a variety of algorithms, such as cosine similarity, Pearson correlation coefficient, and Jaccard similarity coefficient.
[0087] For example, taking cosine similarity as an example, any two initial feature vectors f x 、f y Input the cosine similarity calculation formula to calculate its similarity; the cosine similarity calculation formula is defined as:
[0088]
[0089] In the formula, γ is the feature similarity, ||f x || 2 Indicates that f is calculated using the L2 norm x Among them, f x is an n-dimensional feature vector, f x =(x 1 , x 2 , x 3 , ..x n ), then the L2 norm is used to calculate f x It is expressed as:
[0090]
[0091] Step S203: Mark the initial feature vectors corresponding to feature similarities greater than the mean as key feature vectors, and add them to a preset feature table.
[0092] The feature table contains two feature subsets, the key feature subset and the redundant feature subset. It should be noted that when the initial feature vector is marked as a key feature vector, it will be added to the key feature subset in the feature table. The initial feature vector corresponding to the feature similarity less than the mean will be marked as a redundant feature vector and added to the redundant feature subset in the feature table.
[0093] Step S204: taking all key feature vectors in the feature table as target feature vectors.
[0094] It should be noted that by calculating the mean of the strategy reward function and comparing the feature similarity between the mean and the feature vector, the key feature vector can be screened out. The feature vector can be continuously learned based on the input feature vector, and the feature vector can be dynamically screened to improve the screening effect of the feature vector. For example, in the scenarios of autonomous driving and assisted driving, it can better detect the environment, focus on the semantic information of the road, and improve the application effect in the vehicle driving scenario. For example, in the scenario of smart medical care, it can better filter interference factors in the process of identifying diseases and improve the accuracy of disease identification.
[0095] Please refer to Figure 3 , Figure 3 The following is a schematic flow chart of the sub-steps of extracting image features provided in an embodiment of the present application. Figure 3 As shown, step S1033 extracts image feature information in the target image based on the target feature vector, including step S301 and step S302.
[0096] Step S301: Generate a detection frame for the target feature vector to obtain a target detection frame in the target image.
[0097] Step S302: based on the target detection frame, segment and extract the target image to obtain a feature map.
[0098] Exemplarily, based on the coordinates of the target detection box, the target image is segmented to obtain a feature map corresponding to the area of the target detection box in the target image.
[0099] Exemplarily, taking a medical image as an example, the medical image includes a variety of tissue structure features. Based on the target detection frame, the different tissue structure features on the medical image are segmented to obtain different tissue structure features.
[0100] In one embodiment, there are multiple target detection frames, the target image is segmented, and sub-feature maps corresponding to the multiple target detection frames are obtained. Regions are merged according to the similarity of the sub-feature maps until they cannot be merged, thereby obtaining a final feature map.
[0101] It should be noted that by generating a target detection frame and obtaining a feature map based on the target detection frame, the identification content in the target image can be accurately obtained, thereby improving the prediction and recognition accuracy of the target image. In the field of smart medical care, by generating a target detection frame and obtaining a feature map based on the target detection frame, the characteristics of the diseased tissue in the pathological image can be accurately identified, thereby improving the prediction and recognition accuracy of the diseased tissue.
[0102] Please refer to Figure 4 , Figure 4 A schematic flow chart of the sub-steps of generating a detection frame provided in an embodiment of the present application. Figure 4 As shown, step S301 generates a detection frame for the target feature vector to obtain a target detection frame in the target image, including step S401 and step S402.
[0103] Step S401, generating a detection frame for the target image according to the target feature vector to obtain at least one initial detection frame;
[0104] For example, based on the target feature vector, a detection box is generated on the target image. Each point in the target feature vector generates 9 initial detection boxes, each of which contains four values (x1, y1, x2, y2) representing the coordinates of the upper left corner and lower right corner of the initial detection box. The 9 initial detection boxes generated for each point have 3 shapes, with aspect ratios width:height{1:1, 1:2, 2:1}.
[0105] Step S402: Screen and optimize all the initial detection frames to obtain the target detection frame.
[0106] Exemplarily, all the initial detection frames are classified and screened to filter out the initial detection frames containing unnecessary content; regression processing is performed on the initial detection frames to adjust the range of the initial screening frames to improve the accuracy of the initial screening frames to obtain the target screening frames.
[0107] It should be noted that by generating multiple initial detection frames and screening and optimizing the initial detection frames, the accuracy of the target detection frame can be improved, the amount of calculation can be reduced, and the efficiency of subsequent processing can be improved. In the field of smart medical care, screening and optimization through screening frames can improve the positioning accuracy of the lesion area and make subsequent diagnosis more accurate.
[0108] Please refer to Figure 5 , Figure 5 A schematic flow chart of the sub-steps of screening and optimizing the initial detection frame provided in an embodiment of the present application. Figure 5 As shown, step S402 screens and optimizes all the initial detection frames to obtain the target detection frame, including steps S501 to S503.
[0109] S501: Classify all initial detection frames, and determine the initial detection frame corresponding to the foreground type as the first detection frame.
[0110] Exemplarily, the initial detection frame is initially classified into two categories by a convolutional neural network, and the initial detection frame is classified into a foreground type and a background type. The initial detection frame corresponding to the background type is filtered, and the initial detection frame corresponding to the foreground type is determined as the first detection frame.
[0111] S502, adjusting the ranges of the plurality of first detection frames according to the range of the object in the target image to obtain a plurality of second detection frames;
[0112] Exemplarily, the first detection frame is first translated and then scaled, so that the range of the first detection frame is finally made as close as possible to the range of the object in the target image, thereby obtaining a plurality of second detection frames.
[0113] S503: Score the multiple second detection frames, and use the second detection frame with a score greater than a preset score as the target detection frame.
[0114] Exemplarily, the detection frames are sorted from large to small according to the object area scores, and some target detection frames whose width or height exceeds the target image size or is smaller than a preset threshold of the target image size are filtered out; then, after non-maximum suppression, the second detection frame whose score is greater than the preset score is selected as the target detection frame.
[0115] It should be noted that by classifying, adjusting and optimizing all the initial detection frames, and finally scoring and screening the detection frames, interfering detection frames can be filtered out and the accuracy of the target detection frames can be improved. In the field of smart medical care, interfering tissue areas can be filtered out through screening frame classification and optimization, the accuracy of pathological tissue can be improved, and subsequent diagnosis can be more accurate.
[0116] 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 and modules and units can refer to the corresponding processes in the aforementioned image detection method embodiments and will not be repeated here.
[0117] See also Figure 6 , Figure 6 It is a schematic block diagram of an image detection device provided in an embodiment of the present application. The image detection device can be configured in a computer device to execute the aforementioned image detection method.
[0118] like Figure 6 As shown, the image detection device 1000 includes: an image acquisition module 1001, a model acquisition module 1002, a feature extraction module 1003 and a classification prediction module 1004.
[0119] The image acquisition module 1001 is used to acquire a target image to be processed.
[0120] The model acquisition module 1002 is used to acquire a trained image detection model, wherein the image detection model includes a feature extraction model and an image classification model. The feature extraction model is obtained by training the feature filter in the target detection model according to a reinforcement learning algorithm, and the image classification model is obtained by training the classifier in the target detection model according to an integrated learning algorithm.
[0121] The feature extraction module 1003 is used to input the target image into the feature extraction model to perform feature extraction processing to obtain image feature information corresponding to the target image.
[0122] The classification prediction module 1004 is used to input the image feature information into the image classification model for classification prediction to obtain a classification prediction result corresponding to the target image.
[0123] The apparatus provided in the above embodiment may be implemented in the form of a computer program. The computer program may be Figure 7 Runs on the computer device shown.
[0124] See also Figure 7 , Figure 7 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. The computer device may be a server or a terminal device.
[0125] like Figure 7 As shown, the computer device includes a processor, a memory and a network interface connected via a system bus, wherein the memory may include a storage medium and an internal memory, and the storage medium may be non-volatile or volatile.
[0126] The 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 image detection method.
[0127] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0128] The internal memory provides an environment for the operation of the computer program in the storage medium. When the computer program is executed by the processor, the processor can execute any image detection method.
[0129] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 7The structure shown in the figure 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.
[0130] 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.
[0131] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0132] Obtain the target image to be processed. Obtain the trained image detection model, which includes a feature extraction model and an image classification model. The feature extraction model is obtained by training the feature filter in the target detection model according to the reinforcement learning algorithm, and the image classification model is obtained by training the classifier in the target detection model according to the ensemble learning algorithm. Input the target image into the feature extraction model for feature extraction processing to obtain the image feature information corresponding to the target image.
[0133] In one embodiment, when the processor inputs the target image into the feature extraction model for feature extraction processing to obtain image feature information corresponding to the target image, it is used to implement:
[0134] Extract multiple initial feature vectors corresponding to the target image. Filter and process the multiple initial feature vectors to obtain a target feature vector. Based on the target feature vector, extract image feature information in the target image.
[0135] In one embodiment, when the processor implements screening processing on multiple initial feature vectors to obtain a target feature vector, it is used to implement:
[0136] Perform screening actions on multiple initial feature vectors in sequence, and calculate the mean of the strategy return function values corresponding to the multiple screening actions. Calculate the feature similarity between any two initial feature vectors in all initial feature vectors to obtain multiple feature similarities. Mark the initial feature vectors corresponding to the feature similarity greater than the mean as key feature vectors and add them to the preset feature table. Use all the key feature vectors in the feature table as target feature vectors.
[0137] In one embodiment, the processor is used to implement the following when extracting image feature information from a target image based on a target feature vector:
[0138] Generate a detection frame for the target feature vector to obtain the target detection frame in the target image. Based on the target detection frame, segment and extract the target image to obtain a feature map.
[0139] In one embodiment, when the processor generates a detection frame for the target feature vector and obtains the target detection frame in the target image, it is used to implement:
[0140] Generate a detection frame for the target image according to the target feature vector to obtain at least one initial detection frame. Screen and optimize all initial detection frames to obtain a target detection frame.
[0141] In one embodiment, when the processor implements screening and optimizing all initial detection frames to obtain the target detection frame, it is used to implement:
[0142] Classify all initial detection frames, and determine the initial detection frame corresponding to the foreground type as the first detection frame. Adjust the range of multiple first detection frames according to the object range in the target image to obtain multiple second detection frames. Score the multiple second detection frames, and use the second detection frame with a score greater than the preset score as the target detection frame.
[0143] In one embodiment, before obtaining the trained image detection model, the processor is used to implement:
[0144] Obtain sample images to be trained. Based on the reinforcement learning algorithm, input the sample images into the feature filters in the target detection model for iterative training to obtain a feature extraction model.
[0145] In one embodiment, before obtaining the trained image detection model, the processor is used to implement:
[0146] Obtain the feature information of the sample image to be trained. Based on the ensemble learning algorithm, input the sample image feature information into the classifier in the target detection model for iterative training to obtain the image classification model.
[0147] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the computer device described above can refer to the corresponding process in the aforementioned image detection method embodiment, and will not be repeated here.
[0148] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0149] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions. The method implemented when the program instructions are executed can refer to the various embodiments of the image detection method of the present application.
[0150] The computer-readable storage medium may be an internal storage unit of the computer device described in the above 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.
[0151] Furthermore, the computer-usable 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 blockchain nodes, etc. The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods, each of which contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. The blockchain may include the underlying blockchain platform, the platform product service layer, and the application service layer.
[0152] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0153] It should also be understood that the term "and / or" used in the specification of this application and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.
[0154] The serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. The above description is only a specific implementation mode 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 various 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. An image detection method, characterized in that: include: Obtaining a target image to be processed; Acquire a trained image detection model, wherein the image detection model includes a feature extraction model and an image classification model, wherein the feature extraction model is obtained by training a feature filter in the target detection model according to a reinforcement learning algorithm, and the image classification model is obtained by training a classifier in the target detection model according to an ensemble learning algorithm; Inputting the target image into the feature extraction model to perform feature extraction processing to obtain image feature information corresponding to the target image; The image feature information is input into the image classification model for classification prediction to obtain a classification prediction result corresponding to the target image.
2. The image detection method according to claim 1, characterized in that: The step of inputting the target image into the feature extraction model for feature extraction processing to obtain image feature information corresponding to the target image includes: Extracting a plurality of initial feature vectors corresponding to the target image; Screening the plurality of initial feature vectors to obtain a target feature vector; Based on the target feature vector, image feature information in the target image is extracted.
3. The image detection method according to claim 2, characterized in that: The screening process of the plurality of initial feature vectors to obtain a target feature vector includes: Performing screening actions on the multiple initial feature vectors in sequence, and calculating the mean of the strategy reward function values corresponding to the multiple screening actions; Calculating feature similarities between any two of the initial feature vectors to obtain multiple feature similarities; Marking the initial feature vectors corresponding to the feature similarities greater than the mean as key feature vectors, and adding them to the preset feature table; All key feature vectors in the feature table are used as the target feature vectors.
4. The image detection method according to claim 2, characterized in that: The image feature information includes a feature map; and extracting the image feature information in the target image based on the target feature vector includes: Generating a detection frame for the target feature vector to obtain a target detection frame in the target image; Based on the target detection frame, the target image is segmented and extracted to obtain the feature map.
5. The image detection method according to claim 4, characterized in that: The generating a detection frame for the target feature vector to obtain a target detection frame in the target image includes: Generate a detection frame for the target image according to the target feature vector to obtain at least one initial detection frame; All the initial detection frames are screened and optimized to obtain the target detection frame.
6. The image detection method according to claim 5, characterized in that: The screening and optimizing of all the initial detection frames to obtain the target detection frame includes: Classifying all the initial detection frames, and determining the initial detection frame corresponding to the foreground type as the first detection frame; Adjust the ranges of the plurality of first detection frames according to the range of the object in the target image to obtain a plurality of second detection frames; Scoring the plurality of second detection frames, and taking a second detection frame having a score greater than a preset score as the target detection frame.
7. The image detection method according to claim 1, characterized in that: Before obtaining the trained image detection model, the method further includes: Obtain sample images to be trained; Based on the reinforcement learning algorithm, the sample image is input into the feature filter in the target detection model for iterative training to obtain the feature extraction model; Before obtaining the trained image detection model, the method further includes: Obtaining feature information of sample images to be trained; Based on the ensemble learning algorithm, the sample image feature information is input into the classifier in the target detection model for iterative training to obtain the image classification model.
8. An image detection device, characterized in that: The image detection device comprises: An image acquisition module, used for acquiring a target image to be processed; A model acquisition module is used to acquire a trained image detection model, wherein the image detection model includes a feature extraction model and an image classification model, wherein the feature extraction model is obtained by training a feature filter in the target detection model according to a reinforcement learning algorithm, and the image classification model is obtained by training a classifier in the target detection model according to an ensemble learning algorithm; A feature extraction module is used to input the target image into the feature extraction model for feature extraction processing to obtain image feature information corresponding to the target image; The classification prediction module is used to input the image feature information into the image classification model for classification prediction to obtain the classification prediction result corresponding to the target image.
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 used to execute the computer program and implement the image detection method according to any one of claims 1 to 7 when executing the computer program.
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 image detection method according to any one of claims 1 to 7.
Citation Information
Cited By
Helicobacter pylori fluorescence image fine tuning detection method and device and readable storage medium thereof
CN121147226A
Helicobacter pylori fluorescence image fine-tuning detection method and device and readable storage medium thereof
CN121147226B