Detection model determination method based on ResNeXt-50 network structure
Through the detection model determination method based on the ResNeXt-50 network structure, the problem of inefficient manual verification in large-scale virus detection is solved, and the accuracy and efficient determination of automated virus detection results are achieved.
Patent Information
- Application Number
- CN202311356050.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-18
- Publication Date
- 2025-04-18
AI Technical Summary
In large-scale virus detection scenarios, manual verification of virus detection results is inefficient, and abnormal photos make it difficult to confirm the results, affecting the detection efficiency.
The detection model determination method based on the ResNeXt-50 network structure is adopted, and the virus detection sample images are grouped, trained and verified to construct the target virus detection model with the best performance, which is used to automate the determination of virus detection results.
It improves the efficiency of determining virus detection results, reduces the time for manual verification, and enhances the accuracy of detection results, especially when handling abnormal photos.
Smart Images

Figure CN119850509A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of biological detection, and in particular to a detection model determination method based on a ResNeXt-50 network structure. Background Art
[0002] With the rapid development of virus detection technology, detection kits are widely used in various virus detection scenarios. Taking the detection kit for the new coronavirus as an example, the detection kit includes two detection areas. When red bands appear in both detection areas, the virus test result is determined to be positive. For highly contagious viruses, the person being tested can use the detection kit to test independently, but the person being tested also needs to upload a photo of the detection kit to the detection platform. The staff of the detection platform verifies the virus test results of the person being tested based on the photo of the detection kit, so as to count the number of people with positive virus test results and the number of people with negative virus test results in different areas.
[0003] However, when there are a large number of people being tested in an area, manual verification takes a lot of time, resulting in low efficiency in determining virus test results. In addition, there are abnormal situations such as the brightness of the test kit photos taken by the tested people is too high, which makes it impossible for the staff to clearly see the color band changes of the test kit, and it is necessary to notify the tested people to retake photos of the test kit, resulting in low efficiency in determining virus test results. Summary of the invention
[0004] The purpose of the embodiment of the present invention is to provide a device for solving the problem of low efficiency of virus detection results.
[0005] In order to achieve the above objectives, in a first aspect, the present application provides a detection model determination method based on a ResNeXt-50 network structure, and the detection model determination method based on a ResNeXt-50 network structure includes:
[0006] Grouping all sample images of virus detection obtained to obtain at least one verification set and a training set corresponding to each verification set;
[0007] Build a preset model based on the ResNeXt-50 network structure;
[0008] Input each group of training sets into the preset model for training, and obtain at least one trained preset model;
[0009] Input each validation set into the trained preset model to verify the performance of each trained preset model;
[0010] The trained preset model with the best performance is determined as the target virus detection model.
[0011] In combination with the first aspect, in a first possible implementation manner, all acquired sample images are grouped to obtain each group of verification sets and a training set corresponding to each group of verification sets, including:
[0012] Determine all acquired sample images into at least one sample set;
[0013] Determine each sample set as a validation set;
[0014] For each validation set, the sample set other than the validation set is determined as the training set corresponding to the validation set.
[0015] In combination with the first aspect, in a second possible implementation, the sample images include a first sample image whose detection result label is a first titer positive, a second sample image whose detection result label is a second titer positive, a third sample image whose detection result label is a third titer positive, a fourth sample image whose detection result label is a negative, and a fifth sample image whose detection result label is an invalid category, the first titer is smaller than the second titer, and the second titer is smaller than the third titer.
[0016] In combination with the first aspect, in a third possible implementation manner, each group of training sets is input into a preset model for training to obtain at least one trained preset model, including:
[0017] Inputting sample images in the training set into a grouped convolutional layer of a preset model to obtain at least two groups of grouped image features for each sample image, wherein the preset model includes a grouped convolutional layer and an output head;
[0018] Merge the grouped image features of each sample image to obtain image merge features of each sample image;
[0019] Input the image merging features of each sample image into the output head to obtain the prediction result;
[0020] The preset model is trained using the prediction results and the detection result labels to obtain a trained preset model.
[0021] In combination with the third possible implementation manner of the first aspect, in a fourth possible implementation manner, the sample images in the training set are input into the grouped convolution layer of the preset model to obtain at least two groups of grouped image features for each sample image, including:
[0022] Inputting the image features of the sample images in the training set into the compression excitation network of the preset model to obtain the weight of each channel, wherein the preset model also includes the compression excitation network;
[0023] The image features of the sample images are weighted based on the weight of each channel, and the weighted image features of the sample images are input into the grouped convolution layer to obtain at least two groups of grouped image features for each sample image.
[0024] In combination with the third possible implementation manner of the first aspect, in a fifth possible implementation manner, inputting the image merging feature of each sample image into an output head to obtain a prediction result includes:
[0025] Inputting the image merged features of each sample image into the channel attention layer of the preset model to obtain the first improved image features of each sample image, wherein the preset model further includes a channel attention layer and a spatial attention layer;
[0026] Inputting the first improved image feature of each sample image into the spatial attention layer to obtain the second improved image feature of each sample image;
[0027] The second improved image feature of each sample image is input into the output head to obtain a prediction result.
[0028] In combination with the first aspect, in a sixth possible implementation manner, each group of verification sets is input into a trained preset model respectively, and the performance of each trained preset model is verified respectively, including:
[0029] Input each validation set into the trained preset model, and calculate the accuracy, recall and precision of each trained preset model.
[0030] Determine the F1 score of each trained preset model based on the recall rate and precision rate of each trained preset model;
[0031] The performance of each trained preset model is verified based on its accuracy, recall, precision, and F1 score.
[0032] In a second aspect, the present application provides a method for determining a test result. The method for determining a test result:
[0033] Acquire a target image of the detection kit;
[0034] The target image is input into the target virus detection model to obtain the detection result of the detection kit, wherein the target virus detection model is obtained according to the detection model determination method based on the ResNeXt-50 network structure as in the first aspect.
[0035] In a third aspect, the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the detection model determination method based on the ResNeXt-50 network structure as in the first aspect is implemented, or the detection result determination method as in the second aspect is implemented.
[0036] In a fourth aspect, the present application provides a machine-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the detection model determination method based on the ResNeXt-50 network structure as in the first aspect is implemented, or the detection result determination method as in the second aspect is implemented.
[0037] The present application provides a detection model determination method based on the ResNeXt-50 network structure, and the detection model determination method based on the ResNeXt-50 network structure includes: grouping all sample images of virus detection obtained to obtain at least one verification set and a training set corresponding to each verification set; based on the ResNeXt-50 network structure, building a preset model; inputting each training set into the preset model for training to obtain at least one trained preset model; inputting each verification set into the trained preset model to verify the performance of each trained preset model; and determining the trained preset model with the best performance as the target virus detection model. The target virus detection model is obtained by training, and then the target virus detection model can detect the target virus, without manually determining the virus detection result, thereby improving the efficiency of determining the virus detection result. At the same time, the target virus detection model is obtained by training the preset model based on the ResNeXt-50 network structure, and the target virus detection model has a low amount of calculation and parameter, and can efficiently output more accurate virus detection results.
[0038] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0040] Figure 1 A flow chart of a method for determining a detection model based on a ResNeXt-50 network structure provided in an embodiment of the present application is shown;
[0041] Figure 2 An example diagram showing an image of a detection kit provided in an embodiment of the present application is shown;
[0042] Figure 3A partial structural schematic diagram of a preset model provided in an embodiment of the present application is shown;
[0043] Figure 4 A flow chart of a method for determining a detection result provided in an embodiment of the present application is shown;
[0044] Figure 5 A schematic diagram showing the structure of a model determination device provided in an embodiment of the present application is shown;
[0045] Figure 6 A schematic diagram of the structure of a detection result determination device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0046] The specific implementation of the embodiment of the present invention will be described in detail below in conjunction with the accompanying drawings in the embodiment of the present invention. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0047] The components of the embodiments of the present invention generally described and shown in the drawings herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0048] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present invention, are intended only to indicate specific features, numbers, steps, operations, elements, components or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components or combinations of the foregoing items.
[0049] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.
[0050] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present invention belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present invention.
[0051] Example 1
[0052] See also Figure 1 , Figure 1 A flow chart of a method for determining a detection model based on a ResNeXt-50 network structure provided in an embodiment of the present application is shown. Figure 1 The detection model determination method based on the ResNeXt-50 network structure includes:
[0053] S110, grouping all acquired sample images for virus detection to obtain at least one verification set and a training set corresponding to each verification set.
[0054] Obtain sample images for virus detection, wherein the sample images include actual results of virus detection, and the actual results include positive results, negative results, and invalid results. Group all sample images for virus detection obtained to obtain at least one validation set and a training set corresponding to each validation set. In order to enable the target virus detection model finally obtained to detect viruses, the training set is used to train the model. The validation set is used to verify the training to determine whether the trained model can output accurate virus detection results.
[0055] In the process of training the model, it is necessary to obtain at least one set of validation sets and training sets. The more training sets and validation sets are obtained, the higher the performance of the trained model will be, and the more accurate virus detection results can be output. It should be understood that a test set can also be obtained according to actual needs to test the trained model, which will not be elaborated here.
[0056] In an embodiment of the present application, all sample images acquired are grouped to obtain each verification set and a training set corresponding to each verification set, including:
[0057] Determine all acquired sample images into at least one sample set;
[0058] Determine each sample set as a validation set;
[0059] For each validation set, the sample set other than the validation set is determined as the training set corresponding to the validation set.
[0060] All sample images obtained are determined as at least one sample set. It should be understood that each sample set should include sample images of positive results, sample images of negative results, and sample images of invalid categories to improve the performance of the obtained target virus detection model.
[0061] Each group of sample sets is determined as a validation set, and for each validation set, the sample sets other than the validation set are determined as the training set corresponding to the validation set. Specifically, after obtaining k groups of sample sets, the kth group of sample sets is determined as the kth validation set, and the k-1th group of sample sets other than the kth group are determined as the training set corresponding to the kth validation set. The validation set corresponding to each group of training sets is not used to train the preset model, so that the validation set can more accurately verify the performance of the preset model after training.
[0062] In an embodiment of the present application, the sample images include a first sample image whose detection result label is a first titer positive, a second sample image whose detection result label is a second titer positive, a third sample image whose detection result label is a third titer positive, a fourth sample image whose detection result label is a negative, and a fifth sample image whose detection result label is an invalid category, the first titer is smaller than the second titer, and the second titer is smaller than the third titer.
[0063] See also Figure 2 , Figure 2 An example diagram of an image of a detection kit provided in an embodiment of the present application is shown.
[0064] The virus detection results include positive results, negative results and invalid results, wherein an invalid result is a result that cannot determine whether the virus detection is negative or positive. For ease of understanding, in the embodiment of the present application, the detection of new coronavirus is taken as an example, and the detection kit of the new coronavirus includes a C-line area and a T-line area as shown in the figure. The shaded areas in the figure are respectively the C-line area and the T-line area where red ribbons appear. In the case where red ribbons appear in both the C-line area and the T-line area, the virus detection result is determined to be a positive result. In the case where only a red ribbon appears in the C-line area, the virus detection result is determined to be a negative result. In the case where no red ribbon appears in the C-line area, the virus detection result is determined to be an invalid category.
[0065] The virus titer refers to the amount of virus that infects half of the models within a specific period of time. The higher the virus titer, the more obvious the red bands appear in both the C-line area and the T-line area. It should be understood that the first titer, the second titer, and the third titer are all set according to actual needs and are not limited here. For ease of understanding, in the embodiments of the present application, the first titer is a 10% virus titer, the second titer is a 20% virus titer, and the third titer is a virus titer greater than 50%.
[0066] By training the preset model with the first sample image whose detection result label is positive for the first titer, the second sample image whose detection result label is positive for the second titer, and the third sample image whose detection result label is positive for the third titer, the target virus detection model can identify the color band display results of the detection kits with different virus titers, and avoid the target virus detection model from mistakenly outputting the color band display results of low virus titers as negative results or invalid categories. The target virus detection model obtained by the present application has higher performance and can output more accurate virus detection results.
[0067] For ease of understanding, for example, if only the third sample image with a third positive titer is used to train the preset model, a target virus detection model is obtained. When obtaining the virus detection result, if the input result is an image of the test kit with a first positive titer or a second positive titer to the target virus detection model, due to the large difference in the third sample image with a third positive titer, it is easy to cause the model to make an unconfident judgment, which in turn causes the target virus detection model to mistakenly output a negative result or an invalid category output result.
[0068] S120, builds a preset model based on the ResNeXt-50 network structure.
[0069] In the embodiment of the present application, a preset model is constructed based on the ResNeXt (event immediately)-50 network structure. Specifically, the ResNeXt-50 network structure is used as the backbone of the preset model. In the visual task of virus detection, the target virus detection model is obtained by training with the preset model, which can improve the accuracy of the output results of the model. At the same time, the amount of calculation and the amount of parameters are reduced, so that the model can output results more quickly.
[0070] S130, inputting each group of training sets into the preset model for training, and obtaining at least one trained preset model.
[0071] For ease of understanding, the k-fold cross-validation model performance is used in the embodiments of the present application. Specifically, k groups of validation sets and k groups of training sets corresponding to the k groups of validation sets are obtained. Each group of training sets is input into the preset model for training to obtain at least one trained preset model, that is, the kth group of training sets is input into the preset model for modeling to obtain k trained preset models.
[0072] When each group of training sets is input into the preset model for training, the error between the output result of the preset model and the actual result of the sample image in the training set is used to dynamically adjust the parameters of the preset model, so that the preset model gradually improves its fitting ability and obtains the trained preset model.
[0073] In an embodiment of the present application, each group of training sets is input into a preset model for training, and at least one trained preset model is obtained, including:
[0074] Inputting sample images in the training set into a grouped convolutional layer of a preset model to obtain at least two groups of grouped image features for each sample image, wherein the preset model includes a grouped convolutional layer and an output head;
[0075] Merge the grouped image features of each sample image to obtain image merge features of each sample image;
[0076] Input the image merging features of each sample image into the output head to obtain the prediction result;
[0077] The preset model is trained using the prediction results and the detection result labels to obtain a trained preset model.
[0078] For the non-grouped convolution layer, the input channels are fully connected during the convolution process, that is, all input channels are processed simultaneously. In the embodiment of the present application, the preset model adopts a grouped convolution layer to classify all input channels into at least two groups. The sample images in the training set are input to the grouped convolution layer, and the input channels in each group are convolved to obtain at least two groups of grouped image features for each sample image. The grouped image features of each sample image are merged to obtain the image merged features of each sample image, that is, the relief image features of the detection kit.
[0079] Input the image merging features of each sample image into the output head to obtain the prediction result;
[0080] The preset model is trained using the prediction results and test result labels to obtain a trained preset model that can output virus test results. When processing images of the test kit, the model is required to output highly accurate output results, and the model processing speed is usually slow. By processing the image through the grouped convolutional layer, the amount of calculation and parameters of the model can be further reduced. On the basis of maintaining the performance of the target virus detection model, the target virus detection model is made lighter and can output results faster.
[0081] In an embodiment of the present application, the sample images in the training set are input into the grouped convolution layer of the preset model to obtain at least two groups of grouped image features for each sample image, including:
[0082] Inputting the image features of the sample images in the training set into the compression excitation network of the preset model to obtain the weight of each channel, wherein the preset model also includes the compression excitation network;
[0083] The image features of the sample images are weighted based on the weight of each channel, and the weighted image features of the sample images are input into the grouped convolution layer to obtain at least two groups of grouped image features for each sample image.
[0084] The preset model also includes a compressed excitation network, which is used to learn the relationship between channels before inputting the sample images in the training set into the grouped convolutional layer input to adjust the weights of the feature maps and further improve the performance of the model.
[0085] For ease of understanding, in the embodiments of the present application, the compression excitation network is used to segment, transform and aggregate the image features of the sample image. Specifically, the image features of the sample images in the training set are input into the compression excitation network, and the input image features are averaged and pooled to obtain the average value of each channel. Channel weights are learned to weight the feature expressions of important channels and weaken the feature expressions of unimportant channels. For ease of understanding, in the embodiments of the present application, a multilayer perceptron is used to learn channel weights, and the average value of each channel is input into the multilayer perceptron, which outputs a weight vector with the same number of channels, that is, the weight of each channel is obtained.
[0086] In an embodiment of the present application, the image merging features of each sample image are input to the output head to obtain a prediction result, including:
[0087] Inputting the image merged features of each sample image into the channel attention layer of the preset model to obtain the first improved image features of each sample image, wherein the preset model further includes a channel attention layer and a spatial attention layer;
[0088] Inputting the first improved image feature of each sample image into the spatial attention layer to obtain the second improved image feature of each sample image;
[0089] The second improved image feature of each sample image is input into the output head to obtain a prediction result.
[0090] When obtaining the virus detection results, it is only necessary to confirm whether red ribbons appear in both the C-line area and the T-line area of the test kit. The attention mechanism is used to enable the model to invest more attention resources in the C-line area and the T-line area of the test kit. In an embodiment of the present application, the preset model also includes a channel attention layer and a spatial attention layer. The image merging features of each sample image are input into the channel attention layer to obtain the first improved image features of each sample image. Each feature channel is weighted using the channel attention layer, and the weighted feature channels are merged to obtain the first improved image features of the sample image, which is the image features that determine the important feature channels.
[0091] The first improved image feature of each sample image is input into the spatial attention layer to obtain the second improved image feature of each sample image. The feature map of each feature channel is weighted by the spatial attention layer, and the weighted feature maps are merged to obtain the second improved image feature, which is the image feature that determines the important image position on the important feature channel. The second improved image feature of each sample image is input into the output head, and the attention mechanism is used to make the model devote more attention resources to the C-line area and T-line area of the detection kit, thereby training the preset model.
[0092] See also Figure 3 , Figure 3 A partial structural schematic diagram of the preset model provided in an embodiment of the present application is shown.
[0093] The compressed excitation network 210 sequentially passes through the grouped convolution layer 220, the channel attention layer 230, the spatial attention layer 240 and the output head 250. Before the grouped convolution layer 220, the compressed excitation network 210 uses the compressed excitation network 210 to segment, transform and aggregate the image features of the sample image, and then uses the grouped convolution layer 220 to perform grouped convolution, so that the model can adjust the channel weights before grouped convolution, thereby enabling the model to better capture important image features.
[0094] After the group convolution, the channel attention layer 230 and the spatial attention layer 240 are used to improve the image features so that the model will pay more attention to the C-line area and the T-line area of the test kit, and then the image features are input to the output head 250 to train the preset model. It should be understood that the preset model also includes other network structures, which are set according to actual needs and are no longer shown in the figure.
[0095] S140, input each group of verification sets into the trained preset models respectively, and verify the performance of each trained preset model respectively.
[0096] After obtaining k trained preset models, each group of verification sets is input into the trained preset model respectively to verify the performance of each trained preset model respectively, that is, the kth group of verification sets is input into the kth trained preset model to verify the k trained preset models respectively.
[0097] The virus detection results output by each trained preset model are respectively verified in the verification set to obtain the verification error of each trained preset model. The performance of each trained preset model is determined according to the verification error of each trained preset model.
[0098] In an embodiment of the present application, each group of verification sets is input into the trained preset model respectively, and the performance of each trained preset model is verified respectively, including:
[0099] Input each validation set into the trained preset model, and calculate the accuracy, recall and precision of each trained preset model.
[0100] Determine the F1 score of each trained preset model based on the recall rate and precision rate of each trained preset model;
[0101] The performance of each trained preset model is verified based on its accuracy, recall, precision, and F1 score.
[0102] After obtaining the trained preset model, it is necessary to verify whether the trained preset model determines the required requirements and outputs the correct virus detection results. Input each set of verification sets into the trained preset model, and calculate the accuracy, recall and precision of each trained preset model.
[0103] For ease of understanding, in the embodiments of the present application, positive results or negative results are positive examples, and invalid categories are negative examples. A correctly classified positive example is when the actual virus detection result is a positive result and the output result of the model corresponds to a positive result, or when the actual virus detection result is a negative result and the output result of the model corresponds to a negative result. A correctly classified positive example is when the actual virus detection result is an invalid category and the output result of the model corresponds to an invalid category.
[0104] A misclassified positive example is when the actual virus detection result is positive but the model output result is not positive, or when the actual virus detection result is negative but the model output result is not negative. A misclassified positive example is when the actual virus detection result is an invalid category but the model output result is not an invalid category.
[0105] The ratio of correctly classified positive and negative examples to all samples involved in the classification is the accuracy of the preset model after training:
[0106]
[0107] Among them, Accuracy is the accuracy of the preset model after training, TP is the correctly classified positive example, TN is the correctly classified negative example, FP is the incorrectly classified positive example, and FN is the incorrectly classified negative example.
[0108] The accuracy of the preset model after training is:
[0109]
[0110] Among them, Precision is the accuracy of the preset model after training, TP is the positive example of correct classification, and FP is the positive example of incorrect classification.
[0111] The recall rate of the preset model after training is:
[0112]
[0113] Among them, Recall is the recall rate of the preset model after training, TP is the correctly classified positive example, and FN is the incorrectly classified negative example.
[0114] The maximum value of the F1 score is 1 and the minimum value is 0. It is used to measure the performance index of the model. Specifically, the F1 score of the preset model after training is:
[0115]
[0116] Among them, F1 is the F1 score of the preset model after training, Precision is the precision of the preset model after training, and Recall is the recall rate of the preset model after training.
[0117] Verify the performance of each trained preset model based on its accuracy, recall, precision, and F1 score. Perform quantitative analysis on the trained preset model to measure the virus recognition performance of the model.
[0118] S150, determining the preset model after training with the best performance as the target virus detection model.
[0119] The preset model is trained using multiple training sets, and the preset model with the best performance after training is determined as the target virus detection model. The optimal parameters of the preset model are determined using limited sample images for virus detection. It should be understood that the target virus detection model is used to output the virus detection results of the target virus. The target virus is selected according to actual needs and is not limited here.
[0120] The present application provides a detection model determination method based on the ResNeXt-50 network structure, and the detection model determination method based on the ResNeXt-50 network structure includes: grouping all sample images of virus detection obtained to obtain at least one verification set and a training set corresponding to each verification set; based on the ResNeXt-50 network structure, building a preset model; inputting each training set into the preset model for training to obtain at least one trained preset model; inputting each verification set into the trained preset model to verify the performance of each trained preset model; and determining the trained preset model with the best performance as the target virus detection model. The target virus detection model is obtained by training, and then the target virus detection model can detect the target virus, without manually determining the virus detection result, thereby improving the efficiency of determining the virus detection result. At the same time, the target virus detection model is obtained by training the preset model based on the ResNeXt-50 network structure, and the target virus detection model has a low amount of calculation and parameter, and can efficiently output more accurate virus detection results.
[0121] Example 2
[0122] See also Figure 4 , Figure 4 A flow chart of a method for determining a detection result provided in an embodiment of the present application is shown. Figure 4 The method for determining the test results in includes:
[0123] S310, acquiring a target image of the detection kit.
[0124] After the virus detection is completed using the detection kit, a target image of the detection kit is obtained. Specifically, an image acquisition device such as a camera can be used to acquire an image of the detection kit to obtain the target image of the detection kit.
[0125] S320, inputting the target image into the target virus detection model to obtain the detection result of the detection kit, wherein the target virus detection model is obtained according to the detection model determination method based on the ResNeXt-50 network structure as in Example 1.
[0126] The target image is input into the target virus detection model, and the detection kit is identified using the target virus detection model to obtain the output result of the target virus detection model. According to the confidence of the output result of the target virus detection model, the detection result of the detection kit is obtained.
[0127] It should be understood that the test results of the detection kit include positive results, negative results and invalid categories. Specifically, when the confidence of the target virus detection model output result is less than or equal to the preset confidence, the test result of the detection kit is determined to be an invalid category. When the confidence of the target virus detection model output result is greater than the preset confidence, the target virus detection model output result is determined to be an invalid category.
[0128] Example 3
[0129] See also Figure 5 , Figure 5 A schematic diagram of the structure of a model determination device provided in an embodiment of the present application is shown. Figure 5 The model determination device 400 in the embodiment includes:
[0130] The sample image grouping module 410 is used to group all the acquired sample images for virus detection to obtain at least one verification set and a training set corresponding to each verification set;
[0131] A preset model building module 420 is used to build a preset model based on the ResNeXt-50 network structure;
[0132] A preset model training module 430, used to input each group of the training sets into the preset model for training, to obtain at least one trained preset model;
[0133] A model performance verification module 440 is used to input each group of the verification sets into the trained preset model to verify the performance of each of the trained preset models;
[0134] The target model determination module 450 is used to determine the trained preset model with the best performance as the target virus detection model.
[0135] In the embodiment of the present application, the sample image grouping module 410 includes:
[0136] A sample set determination submodule, used to determine all acquired sample images into at least one sample set;
[0137] A validation set determination submodule is used to determine each sample set as a validation set;
[0138] The training set determination submodule is used to determine, for each of the verification sets, a sample set other than the verification set as a training set corresponding to the verification set.
[0139] In an embodiment of the present application, the sample images include a first sample image whose detection result label is a first positive titer, a second sample image whose detection result label is a second positive titer, a third sample image whose detection result label is a third positive titer, a fourth sample image whose detection structure label is negative, and a fifth sample image whose detection result label is an invalid category, the first titer is smaller than the second titer, and the second titer is smaller than the third titer.
[0140] In an embodiment of the present application, the preset model training module 430 includes:
[0141] A grouped convolution module, used to input sample images in a training set into a grouped convolution layer of a preset model to obtain at least two groups of grouped image features for each sample image, wherein the preset model includes a grouped convolution layer and an output head;
[0142] A feature merging module, used for merging the grouped image features of each of the sample images to obtain image merging features of each of the sample images;
[0143] An output head module, used for inputting the image merging features of each sample image into the output head to obtain a prediction result;
[0144] The model training module is used to train the preset model using the prediction result and the detection result label to obtain a trained preset model.
[0145] In an embodiment of the present application, the grouped convolution module includes:
[0146] A compression excitation submodule, used to input the image features of the sample images in the training set into the compression excitation network of the preset model to obtain the weight of each channel, wherein the preset model also includes the compression excitation network;
[0147] The image feature acquisition submodule is used to weight the image features of the sample image based on the weight of each channel, and input the weighted image features of the sample image into the grouped convolution layer to obtain at least two groups of grouped image features for each of the sample images.
[0148] In an embodiment of the present application, the feature merging module includes:
[0149] A first feature improvement submodule, used for inputting the image merging feature of each sample image into the channel attention layer of the preset model to obtain the first improved image feature of each sample image, wherein the preset model also includes the channel attention layer and the spatial attention layer;
[0150] A second feature improvement submodule, used for inputting the first improved image feature of each of the sample images into the spatial attention layer to obtain a second improved image feature of each of the sample images;
[0151] The training submodule is used to input the second improved image feature of each sample image into the output head to train the preset model.
[0152] In an embodiment of the present application, the model performance verification module 440 includes:
[0153] A parameter calculation submodule, used to input each group of the verification sets into the trained preset model, and calculate the accuracy, recall and precision of each trained preset model;
[0154] An F1 score determination submodule, configured to determine the F1 score of each of the trained preset models based on the recall rate and the precision rate of each of the trained preset models;
[0155] The performance verification submodule is used to verify the performance of each of the trained preset models according to the accuracy, recall, precision and F1 score of each of the trained preset models.
[0156] The model determination device 400 is used to execute the corresponding steps in the above-mentioned detection model determination method based on the ResNeXt-50 network structure, and the specific implementation of each function is not described one by one here. In addition, the optional examples in embodiment 1 are also applicable to the model determination device 400 of embodiment 3.
[0157] Example 4
[0158] See also Figure 6 , Figure 6 A schematic diagram of the structure of a detection result determination device provided in an embodiment of the present application is shown. Figure 6 The detection result determination device 500 in the embodiment includes:
[0159] A target image acquisition module 510, used to acquire a target image of the detection kit;
[0160] The detection result obtaining module 520 is used to input the target image into the target virus detection model to obtain the detection result of the detection kit, wherein the target virus detection model is obtained according to the detection model determination method based on the ResNeXt-50 network structure as described in Example 1.
[0161] The detection result determination device 500 is used to execute the corresponding steps in the above detection result determination method, and the specific implementation of each function is not described one by one here. In addition, the optional examples in embodiment 2 are also applicable to the detection result determination device 500 of embodiment 4.
[0162] An embodiment of the present application also provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the computer program implements the detection model determination method based on the ResNeXt-50 network structure as described in Example 1, or implements the detection result determination method as described in Example 2.
[0163] The sample image grouping module 410, preset model building module 420, model performance verification module 430, target model determination module 440, target image acquisition module 510 and detection result acquisition module 520 in this embodiment are all stored in the memory as program units, and the processor executes the above program units stored in the memory to implement corresponding functions.
[0164] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set to solve the problem of low efficiency of virus detection results by adjusting kernel parameters.
[0165] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0166] An embodiment of the present application also provides a machine-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the detection model determination method based on the ResNeXt-50 network structure as described in Example 1 is implemented, or the detection result determination method as described in Example 2 is implemented.
[0167] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0168] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0169] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0170] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0171] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0172] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0173] Machine-readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0174] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device 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, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0175] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A detection model determination method based on ResNeXt-50 network structure, characterized in that: The detection model determination method based on the ResNeXt-50 network structure includes: Grouping all acquired sample images for virus detection to obtain at least one verification set and a training set corresponding to each verification set; Build a preset model based on the ResNeXt-50 network structure; Inputting each group of the training sets into the preset model for training, respectively, to obtain at least one trained preset model; Inputting each group of the verification sets into the trained preset models respectively, and verifying the performance of each of the trained preset models respectively; The trained preset model with the best performance is determined as the target virus detection model.
2. The detection model determination method based on the ResNeXt-50 network structure according to claim 1, characterized in that: The step of grouping all acquired sample images to obtain each group of verification sets and a training set corresponding to each group of the verification sets includes: Determine all acquired sample images into at least one sample set; Determine each sample set as a validation set; For each of the verification sets, a sample set other than the verification set is determined as a training set corresponding to the verification set.
3. The detection model determination method based on the ResNeXt-50 network structure according to claim 1, characterized in that: The sample images include a first sample image whose detection result label is a first positive titer, a second sample image whose detection result label is a second positive titer, a third sample image whose detection result label is a third positive titer, a fourth sample image whose detection result label is a negative, and a fifth sample image whose detection result label is an invalid category, wherein the first titer is smaller than the second titer, and the second titer is smaller than the third titer.
4. The detection model determination method based on the ResNeXt-50 network structure according to claim 1, characterized in that: The step of inputting each group of the training sets into the preset model for training to obtain at least one trained preset model comprises: Inputting the sample images in the training set into the grouped convolution layer of the preset model to obtain at least two groups of grouped image features for each of the sample images, wherein the preset model includes a grouped convolution layer and an output head; Merging the grouped image features of each of the sample images to obtain image merging features of each of the sample images; Inputting the image merging features of each of the sample images into the output head to obtain a prediction result; The preset model is trained using the prediction result and the detection result label to obtain a trained preset model.
5. The detection model determination method based on the ResNeXt-50 network structure according to claim 4 is characterized in that: The step of inputting the sample images in the training set into the grouped convolutional layer of the preset model to obtain at least two groups of grouped image features for each of the sample images comprises: Inputting the image features of the sample images in the training set into the compression excitation network of the preset model to obtain the weight of each channel, wherein the preset model also includes the compression excitation network; The image features of the sample images are weighted based on the weight of each of the channels, and the weighted image features of the sample images are input into the grouped convolutional layer to obtain at least two groups of grouped image features for each of the sample images.
6. The detection model determination method based on the ResNeXt-50 network structure according to claim 4 is characterized in that: The step of inputting the image merging feature of each sample image into the output head to obtain a prediction result includes: Inputting the image merging feature of each of the sample images into the channel attention layer of the preset model to obtain the first improved image feature of each of the sample images, wherein the preset model further includes the channel attention layer and the spatial attention layer; Inputting the first improved image feature of each of the sample images into the spatial attention layer to obtain the second improved image feature of each of the sample images; The second improved image feature of each sample image is input into the output head to obtain a prediction result.
7. The detection model determination method based on the ResNeXt-50 network structure according to claim 1, characterized in that: The step of inputting each group of the verification sets into the trained preset models to verify the performance of each of the trained preset models comprises: Input each group of the validation sets into the trained preset model, and calculate the accuracy, recall and precision of each trained preset model; Based on the recall rate and the precision rate of each of the trained preset models, respectively determine the F1 score of each of the trained preset models; The performance of each trained preset model is verified respectively according to the accuracy, recall, precision and F1 score of each trained preset model.
8. A method for determining a test result, characterized in that: The test result determination method: Acquire a target image of the detection kit; The target image is input into a target virus detection model to obtain a detection result of the detection kit, wherein the target virus detection model is obtained according to the detection model determination method based on the ResNeXt-50 network structure as described in any one of claims 1 to 7.
9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, it implements the detection model determination method based on the ResNeXt-50 network structure as described in any one of claims 1 to 7, or implements the detection result determination method as described in claim 8.
10. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores a computer program, and when the computer program is executed by the processor, it implements the detection model determination method based on the ResNeXt-50 network structure as described in any one of claims 1 to 7, or implements the detection result determination method as described in claim 8.
Citation Information
Cited By
Road collapse hidden danger detection method and electronic equipment
CN121169910A