Semantic segmentation-based cluster defect detection model, method and system
By using the encoder-decoder structure and the semantic segmentation model of multi-scale bar convolutional attention module in the detection of ear defects, the problems of high computing costs and low efficiency in the existing technology are solved, and efficient and accurate ear defects are achieved. Test.
Patent Information
- Application Number
- CN202410975217.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-11-15
AI Technical Summary
The existing fruit ear defect detection methods have problems such as high calculation cost, low efficiency and low accuracy, which limits their practicality in practical applications.
A fruit ear defect detection model based on semantic segmentation is adopted, an encoder-decoder structure symmetric design is adopted, and a multi-scale bar convolutional attention module (MSCAB) is introduced to optimize the model training and evaluation through the composite loss function and comprehensive evaluation system.
The parameter amount of the model is significantly reduced, the accuracy of image features is improved, the operation efficiency is ensured to meet the actual production deployment needs, and the detection efficiency and accuracy are improved.
Smart Images

Figure CN118968056A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of ear defect detection, and in particular relates to an ear defect detection model, method and system based on semantic segmentation. Background Art
[0002] Ear crops not only play an important role in the agricultural field, but also have a far-reaching impact on the national economy. However, the appearance quality of ear crops is directly related to their market value, and ear surface defects are the main factor affecting the appearance quality of ears. These problems not only reduce the quality of ear crops, but also have a negative impact on the normal operation of the ear crop industry chain. Therefore, efficient and accurate detection of ear surface defects is particularly critical. At present, the ear defect detection process mainly relies on traditional manual visual judgment, which is inefficient and easily affected by subjective factors, which limits the further development of post-harvest processing of ear defects. Therefore, for the development of the ear crop industry, how to reduce the detection cost and improve the efficiency and accuracy of ear defect detection has become a hot research topic.
[0003] The development of digital image processing technology has provided a new idea for solving this problem. By performing preprocessing operations such as filtering, graying, and binarization on the image, features such as shape, texture, and color are extracted for identification. This method based on digital image processing has been widely used in detection and identification in the agricultural field, covering a variety of crops such as wheat, cucumber, tomato, and apple. Although digital image processing has a certain fast processing capability in image information processing and feature extraction, these methods are affected by environmental factors such as lighting and background in practical applications, which may lead to a decrease in recognition accuracy. In recent years, with the rapid progress of computer hardware and deep learning technology, major breakthroughs have been made in the field of image recognition, especially in tasks such as classification, target detection, and semantic segmentation, showing its excellent application potential. Although semantic segmentation technology has shown its outstanding recognition performance in the agricultural field, there are still few studies on post-harvest defect detection of ear crops. The existing defect detection methods have the problems of high computational cost, low efficiency, and low accuracy, which limits their practicality in actual ear defect detection. Summary of the invention
[0004] Purpose of the invention: The present invention proposes a fruit ear defect detection model, method and system based on semantic segmentation, the purpose of which is to solve the problems of high computational cost, low efficiency and low accuracy of existing methods.
[0005] Technical solution: The present invention proposes a fruit ear defect detection model, method and system based on semantic segmentation. The core architecture of the model adopts an encoder-decoder structure symmetrical design, which is composed of an encoder and a decoder in sequence, and introduces jump connections; wherein, both the encoder and the decoder introduce a multi-scale strip convolutional attention block (Multi-scaleStrip Convolutional Attention Block, MSCAB module).
[0006] Furthermore, the encoder includes a convolutional layer, a BN layer, a ReLU activation function layer, downsampling and feature fusion.
[0007] Furthermore, the decoder includes a convolutional layer, a BN layer, a ReLU activation function layer, upsampling and feature fusion.
[0008] Furthermore, the MSCAB module includes: 5×5 convolution (Conv 5×5), 1×k and k×1 strip convolutions of three scales, and 1×1 convolution combination, where k≥1 and k is an integer.
[0009] Furthermore, the main steps of the MSCAB module are: using 5×5 convolution to aggregate local features, then using three scales of 1×k and k×1 strip convolution to perform convolution operations, and finally using 1×1 convolution to achieve cross-channel integration and interaction of key image features, where the combined parameters of the three scales of 1×k and k×1 strip convolution are expressed as:
[0010]
[0011] Parameters is the combined parameter of 1×k and k×1 strip convolution, c in , C out are the number of input channels and the number of output channels respectively;
[0012] The entire multi-scale strip convolution attention module is expressed as:
[0013]
[0014] Out is the output of the MSCAB module, F is the original feature input, conv 1×k and Conv k×1 It is a multi-scale strip convolution. i Aggregate the convolutional features of multiple branches and perform attention weighting operations Is to convert Conv 1×1 Fit the convolution features of each scale and perform element-matrix multiplication on the original features F.
[0015] The present invention also proposes a method for detecting ear defects based on semantic segmentation, the steps of which are:
[0016] S1. Data preparation: Construct a fruit ear image dataset for training the detection model, perform semantic segmentation and annotation on the dataset, and divide the annotated dataset into a training set and a test set.
[0017] S2. Training model: Use the training set to train the detection model and set a suitable loss function;
[0018] S3, evaluation model: use the test set to evaluate the trained detection model;
[0019] S4. Application model: perform ear defect detection through the detection model that has passed the evaluation.
[0020] Furthermore, in step S1, the image format of the ear image data set includes an RGB image format.
[0021] Furthermore, the loss function in step S2 is a composite loss function, wherein the composite loss function is composed of a cross entropy loss and a Dice loss, which is expressed as:
[0022] L=L CE +L Dice (3)
[0023] L CE is the cross entropy loss, L Dice It is the Dice loss.
[0024] Furthermore, the evaluation in step S3 adopts a comprehensive evaluation system, including evaluating the performance of the model in terms of accuracy and segmentation quality, and the practicality of the model, wherein pixel-level accuracy, intersection-over-union ratio, and Dice coefficient are used to evaluate the performance of the model in terms of accuracy and segmentation quality, and computational complexity, model parameter quantity, response time, and number of frames processed per second are used to evaluate the practicality of the model.
[0025] The present invention also proposes a fruit ear defect detection model system based on semantic segmentation, including a hardware part and a software part, wherein the hardware part includes a detection object placement table, a photo-taking mechanism and an image transmission mechanism; the software part includes an application program into which the fruit ear defect detection model is integrated.
[0026] Beneficial effects: The present invention uses Unet as the basic architecture, and the core architecture adopts a symmetrical design of the encoder-decoder structure, which is composed of an encoder and a decoder in sequence, and introduces jump connections; wherein, both the encoder and the decoder introduce a multi-scale strip convolution attention module. By integrating the multi-scale strip convolution attention module into the encoder and the decoder, it is possible to effectively capture and enhance image features at different scales while significantly reducing the number of model parameters, achieving a comprehensive understanding and accurate segmentation of the image from local details to the whole, and ensuring that the operating efficiency meets the actual production deployment requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is the network architecture of the ear defect detection model;
[0028] Figure 2 The specific structure of the multi-scale grouped convolutional attention module;
[0029] Figure 3 is the encoder network structure;
[0030] Figure 4 is the decoder network structure;
[0031] Figure 5 For segmentation comparison visualization;
[0032] Figure 6 Visualization of the output feature map;
[0033] Figure 7 The curve changes of each model training process;
[0034] Figure 8 Visualize the segmentation image features for each model;
[0035] Fig. 9 It is a system for detecting ear defects. DETAILED DESCRIPTION
[0036] The embodiments of the present invention will be described in detail below with reference to examples, but those skilled in the art will appreciate that the following examples are only used to illustrate the present invention and should not be construed as limiting the scope of the present invention.
[0037] The specific structure of the ear defect detection model based on semantic segmentation is as follows: Figure 1 As shown in Figure 1, the detection model consists of an encoder and a decoder. The design of each stage of the encoder includes convolution layer (Conv 3×3), BN layer, ReLU activation function layer, MSCAB module, feature fusion and downsampling. The design of each stage of the decoder includes upsampling, feature fusion, convolution layer, BN layer, ReLU activation function layer. The MSCAB module is introduced in both the encoder and the decoder. The specific structure of the MSCAB module is as follows: Figure 2As shown in Figure 2, the combined parameters of the three scales of 1×k and k×1 strip convolutions are expressed as follows:
[0038]
[0039] Among them, Prameters is the combined parameter of 1×k and k×1 strip convolution, C in , C out are the number of input channels and the number of output channels respectively;
[0040] The entire multi-scale strip convolution attention module is expressed as:
[0041]
[0042] Where Out is the output of the MSCAB module, F is the original feature input, and Conv 1×k and Conv k×1 It is a multi-scale strip convolution. i Aggregate the convolutional features of multiple branches and perform attention weighting operations Conv 1×1 Fit the convolution features of each scale and perform element-matrix multiplication on the original features F.
[0043] The key features of the encoder output are passed to the decoder through the skip connection technology. The numbers 64, 128, 256, 512, and 1024 represent the dimensions of the output feature layer. When training the detection model, Conv3×3 in each stage of the encoder is responsible for extracting local features from the input data. The BN layer normalizes the extracted features. The ReLU activation function layer introduces nonlinear characteristics to the network, enabling the network to learn complex data distributions. The combination of Conv3×3, BN, and ReLU enhances the stability and generalization of the network. In order to further enhance the feature extraction capability of each stage, the MSCAB module is introduced. This module first uses Conv5×5 to aggregate local information to capture a wider range of image features, and then simulates equivalent k×k convolutions through three scales of 1×k and k×1 strip convolutions. This process significantly reduces parameters and computation while maintaining the same receptive field. Finally, the cross-channel integration and interaction of key image features are achieved through the Conv1×1 convolution operation, further enhancing the feature representation capability of the model. The encoder network structure is as follows: Figure 3As shown. At the same time, in order to gradually reduce the size of the feature map and deepen the abstract level of the model, the maximum pooling operation is used for downsampling between each stage. The image features obtained by downsampling are input into the next layer of convolution to continue the same operation process. After the encoder's downsampling is completed, the decoder uses upsampling and jump connections to restore the spatial resolution and lost detail information reduced by multiple downsampling to reconstruct the image features. During the reconstruction process, each stage restores the feature map to the same size as the original image through feature fusion, convolution layer (Conv3×3), BN layer, ReLU activation function layer, and the introduced MSCAB module. The decoder network structure is shown as follows: Figure 4 shown.
[0044] A method for detecting ear defects based on semantic segmentation, comprising the following steps:
[0045] S1. Data preparation: Construct a fruit ear image dataset for training the detection model, perform semantic segmentation and annotation on the dataset, and divide the annotated dataset into a training set and a test set.
[0046] S2. Training model: Use the training set to train the detection model and set a suitable loss function;
[0047] S3, evaluation model: use the test set to evaluate the trained detection model;
[0048] S4. Application model: perform ear defect detection through the detection model that has passed the evaluation.
[0049] Furthermore, the image format of the ear image data set in step S1 includes an RGB image format.
[0050] Furthermore, the loss function in step S2 is a composite loss function, wherein the composite loss function is composed of a cross entropy loss and a Dice loss, and is expressed as:
[0051] L=L CE +L Dice (3)
[0052] L CE is the cross entropy loss, L Dice It is the Dice loss.
[0053] The present invention uses cross entropy loss to deal with the problem of class imbalance. Class weights are set based on the ratio of the number of pixels of each category in the training set to adjust the contribution of each category in the loss function. The calculation formula is as follows:
[0054]
[0055] N represents the number of pixels, C represents the number of categories, and wj represents the class weight of the jth class, y i,j represents the probability distribution of the true label, Represents the model prediction probability distribution.
[0056] The present invention uses Dice loss to compare the ratio of the intersection of the predicted result and the true label to their union, so as to calculate the similarity between the loss prediction result and the true label, so as to promote the model to accurately segment rare categories. The calculation formula is as follows:
[0057]
[0058] y i represents the true label, Represents the label predicted by the model.
[0059] By combining cross entropy loss with Dice loss and introducing category weights, the detection model constructed by the present invention can effectively deal with the problem of category imbalance, ensuring that all categories including rare categories are fully learned, thereby improving the overall accuracy of semantic segmentation and model robustness.
[0060] Furthermore, the evaluation in step S3 adopts a comprehensive evaluation system, including evaluating the performance of the model in terms of accuracy and segmentation quality, and the practicality of the model. The performance of the model in terms of accuracy and segmentation quality is evaluated by using the intersection over union (IoU), Dice coefficient, and pixel-level accuracy, and the practicality of the model is evaluated by using the computational complexity, the number of model parameters, the response time, and the number of frames processed per second, as follows:
[0061] The present invention takes the average value of IoU for all categories to obtain the average intersection-over-union ratio, thereby providing a measure of the overall segmentation performance of the detection model. IoU provides a separate evaluation for each category by calculating the ratio of the intersection and union of the model's predicted mask to the true mask. The calculation formula is:
[0062]
[0063] TP stands for True Positives, FP stands for False Positives, FN stands for False Negatives, and TN stands for True Negatives.
[0064] The present invention measures the similarity between the predicted area and the real area by the Dice coefficient, which has strong robustness to the data set with imbalanced categories. The closer the Dice coefficient is to 1, the more consistent the predicted result is with the real label. The calculation formula is:
[0065]
[0066] The present invention measures the ratio of the number of pixels correctly predicted by the detection model to the total number of pixels through pixel-level accuracy, which can simply and intuitively reflect the accuracy of the detection model's prediction at the pixel level. The calculation formula is as follows:
[0067]
[0068] The present invention measures the complexity of the detection model by FLOPs, which can reflect the computational workload of the detection model when performing forward inference. The number of FLOPs depends on the structure of the detection model, the number of layers and the size of the input data. The number of parameters that need to be learned in the detection model is analyzed by parameter quantity, including weights and biases. The response speed of the detection model is measured by delay, that is, the time required for the detection model to perform a single inference or training. The number of image frames processed per second by the detection model during the inference or training process is characterized by FPS to detect the smoothness of model processing.
[0069] By setting the above comprehensive evaluation indicators, the present invention not only ensures the high accuracy of the detection model in segmentation performance, but also takes into account its efficiency and feasibility in practical applications, in order to achieve the best balance in practical applications.
[0070] A system of a fruit ear defect detection model based on semantic segmentation includes a hardware part and a software part, wherein the hardware part includes a detection object placement table, a photo-taking mechanism and an image transmission mechanism, and the software part includes an application program integrated with the fruit ear defect detection model.
[0071] In order to demonstrate the advantages of the ear defect detection model based on semantic segmentation, the present invention is further described below using corn defect detection as an example. The experiment of the present invention is built based on the deep learning framework of Pytorch version 1.13, and the hardware environment used in the experiment consists of NVIDIA GeForce RTX 3090Ti GPU and Intel(R) Core(TM) i9-12900F CPU. The relevant software development environment is Python 3.9.5, supplemented by CUDA 11.6 to optimize computing efficiency. In order to improve the efficiency of model training, the Adam optimization algorithm is selected, and the initial learning rate is set to 1×10 -4. In this experiment, all models were trained for 200 training cycles, and the size of the input image was uniformly cropped to 512×512 pixels. The present invention selects corn ears for verification. The experimental corn samples used were collected from the Zengcheng Experimental Base of South China Agricultural University. The selected varieties include Huameitian No. 8, No. 9 and No. 12. The shooting equipment used in the experiment is Nikon D7000, which has an original image resolution of up to 4948×3280 pixels. In view of the high resolution of the original pictures and each picture contains about ten corns, in order to ensure the efficiency of data processing and the feasibility of model training, each original picture was cropped to obtain an image of a single corn. In order to meet the requirements of the semantic segmentation model for data format, Labelme software was used for fine semantic segmentation annotation. The software supports users to distinguish and annotate different categories in the image with different colors. For example, corn, missing kernels, diseases and background are marked in red, green, yellow and black respectively. Furthermore, the annotated dataset is divided into a training set and a test set, where the training set contains 1728 images and the test set contains 192 images, in order to systematically evaluate the effectiveness of the proposed method. Through this method, a dataset containing 1920 high-definition RGB format images is constructed. The training set is first used for training, and the test set is used to detect the training effect of the model to ensure the high accuracy and reliability of the experimental results.
[0072] Example 1
[0073] 1.1 Comparison of IoU, Dice, and Pixel Accuracy between the Baseline Model and Multi-Scale Strip Convolution Kernel Combination
[0074] The benchmark model (Conv 3×3) and the model of multi-scale strip convolution kernel combination (using convolution kernels of size 7, 11 and 21) are selected for comparison, and the corresponding IoU index, Dice index, and pixel accuracy index are shown in Table 1, Table 2, and Table 3. By observing Table 1, Table 2, and Table 3, it can be seen that whether it is detecting corn, missing grains, lesions, or background, the detection model provided by the present invention uses a model with a combination of strip convolution kernels of size 7, 11, and 21, and the segmentation effect achieved has obvious advantages. Compared with the benchmark model using only 3×3 convolution kernels, the model of multi-scale strip convolution kernel combination has improved IoU, pixel accuracy, and Dice coefficient by 1.23%, 2.39%, and 1.51%, respectively. Whether using convolution kernels of strip convolution kernels of size 7, 11, and 21 alone or in combination, the model performance can be improved to varying degrees, which verifies the effectiveness of large-scale convolution kernels in improving the segmentation effect of the model.
[0075] Table 1 IoU index comparison
[0076]
[0077] Table 2 Comparison of Dice indicators
[0078]
[0079] Table 3 Comparison of pixel accuracy indicators
[0080]
[0081] 1.2 Comparison of segmentation of baseline model and combined size strip convolution kernel, and visualization of output feature map
[0082] In order to gain a deeper understanding of the specific role of the multi-scale convolution kernel in the model, the features before and after using the MSCAB module were visualized and analyzed. The segmentation comparison visualization is shown in the figure below. Figure 5 As shown, the visualization of the output feature map is as follows Figure 6 As shown in the figure. After the 3×3 convolution processing, the model is not accurate enough in the distribution of attention weights for missing kernels and disease features, especially the missing kernels in small areas are completely ignored. After the introduction of the MSCAB module, the model not only pays enough attention to the smaller missing kernel areas, but also has a more reasonable distribution of attention weights for missing kernels and disease areas. By performing feature visualization analysis on the MSCAB module introduced in the model, the significant advantages of the multi-scale strip convolution kernel in improving the model segmentation performance and corn defect detection capabilities are further verified.
[0083] Example 2
[0084] When deeply analyzing the role of the MSCAB module in improving operating efficiency, the performance difference between using large-scale strip convolution kernels and ungrouped convolution kernels is compared. The results are shown in Tables 4 and 5, where "↑" indicates performance improvement and "↓" indicates performance degradation. Experiments show that the strip convolution kernel structure surpasses the ungrouped design in key segmentation performance indicators such as MIoU, average PA, and average Dice coefficient. This advantage stems from the effective matching and feature extraction of the strip convolution kernel along the distribution direction of corn kernel features. From the perspective of model complexity, the strip convolution kernel reduces GFLOPs and parameters by 22.19% and 8.08% respectively compared to the ungrouped convolution kernel, and achieves a 41.09% performance improvement in latency and FPS, proving that it not only improves segmentation accuracy, but also significantly optimizes operating efficiency.
[0085] Table 4 Comparison of detection performance indicators
[0086]
[0087] Table 5 Comparison of operating efficiency performance indicators
[0088]
[0089] Example 3
[0090] In order to prove that the detection model proposed in this paper has a better effect on the detection of ear defects, this section uses the training set and the test set to compare the existing UNet, Attention-UNet, Res-UNet, PSPNet and DeepLabv3+ models, and compares the experimental results obtained. The curve changes during the training process are shown in Figure 2. Figure 7 As shown in the figure. The results show that within 200 training cycles, the loss of all models gradually decreased and stabilized after 100 cycles. From the 140th to the 200th cycle, all models achieved the best performance. The performance of this model is better than that of the comparison model at all stages, especially the lowest value in training and validation loss, showing outstanding learning and generalization capabilities. Table 6 shows the segmentation performance comparison results of each model and the baseline model UNet, where "↑" indicates performance improvement and "↓" indicates performance degradation. The results show that although Res-UNet increases the network depth, it fails to surpass UNet in the main performance indicators, indicating that increasing depth is not the only factor for performance improvement. In contrast, Attention-UNet shows the potential of the attention mechanism to improve segmentation performance by adding an attention mechanism to the decoder. The poor performance of PSPNet and DeepLabv3+ further highlights the relative advantages of UNet and proves the rationality of choosing UNet as the basis for improvement. The detection model of the present invention surpasses UNet and other comparison models in MIoU, Avg-Dice and Avg-PA segmentation performance indicators, with improvements of 1.68%, 2.42% and 0.89% respectively, proving the effectiveness and advancement of the detection model proposed in the present invention.
[0091] In order to comprehensively evaluate the segmentation effects of different models, the features of corn images segmented by each model were visualized and analyzed, focusing on three key quality factors of corn, missing kernels, and diseases, such as Figure 8 The results show that although all models performed well in identifying corn diseases, when identifying small missing kernel features, except for the detection model proposed in the present invention, other models misidentified missing kernels as corn kernels. This result highlights the significant advantages of the detection model proposed in the present invention in the precise segmentation of details, and proves its high efficiency in the application of ear defect detection.
[0092] Table 6 Experimental results of this model and existing models
[0093]
[0094] Example 4
[0095] By using the detection models or methods of embodiments 1 to 3, in combination with a fruit ear defect detection device, a fruit ear defect detection system (such as Fig. 9 As shown), the system consists of a hardware part and a software part, wherein the hardware part includes a detection object placement table, a camera mechanism and an image transmission mechanism; the software part includes an application program into which the detection model is integrated.
[0096] In summary, the present invention uses UNet as the basis for improvement to improve the structure of the ear defect detection model. The core architecture of the model adopts a symmetrical design of the encoder-decoder structure, which is composed of an encoder and a decoder in sequence, and transmits original features between the encoder and the decoder through jump connections; wherein, both the encoder and the decoder introduce a multi-scale strip convolution attention module. In view of the high computational cost and low efficiency problems caused by large-scale convolution kernels in existing methods, the present invention integrates a multi-scale strip convolution attention module into the encoder and the decoder, which can significantly reduce the number of model parameters while effectively capturing and strengthening image features at different scales, achieving a comprehensive understanding and accurate segmentation of the image from local details to the whole, and ensuring that the operating efficiency meets the actual production deployment requirements.
[0097] 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 fruit ear defect detection model based on semantic segmentation, characterized in that: The core architecture of the model adopts a symmetrical encoder-decoder structure design, which is composed of an encoder and a decoder in sequence, and introduces jump connections; wherein, both the encoder and the decoder introduce multi-scale strip convolution attention modules.
2. A semantic segmentation-based ear defect detection model according to claim 1, characterized in that: The encoder includes a convolution layer, a BN layer, a ReLU activation function layer, downsampling and feature fusion.
3. The ear defect detection model based on semantic segmentation according to claim 1 is characterized in that: The decoder includes a convolution layer, a BN layer, a ReLU activation function layer, upsampling and feature fusion.
4. The ear defect detection model based on semantic segmentation according to claim 1 is characterized in that: The multi-scale strip convolution attention module includes: 5×5 convolution, 1×k and k×1 strip convolutions of three scales, and 1×1 convolution combination, where k≥1 and k is an integer.
5. The ear defect detection model based on semantic segmentation according to claim 4 is characterized in that: The main steps of the multi-scale strip convolution attention module are: using 5×5 convolution to aggregate local features, then using three scales of 1×k and k×1 strip convolution to perform convolution operations, and finally using 1×1 convolution to achieve cross-channel integration and interaction of key image features. The combined parameters of the three scales of 1×k and k×1 strip convolution are expressed as: Parameters is the combined parameter of 1×k and k×1 strip convolution, C in , C out are the number of input channels and the number of output channels respectively; The entire multi-scale strip convolution attention module is expressed as: Out is the output of the multi-scale strip convolution attention module, F is the original feature input, Conv 1×k and Conv k×1 It is a multi-scale strip convolution. i Aggregate the convolutional features of multiple branches and perform attention weighting operations Conv 1×1 Fit the convolution features of each scale and perform element-matrix multiplication on the original features F.
6. A method for detecting ear defects based on semantic segmentation according to any one of claims 1 to 5, characterized in that: The following steps are involved: S1. Data preparation: Construct a fruit ear image dataset for training the detection model, perform semantic segmentation and annotation on the dataset, and divide the annotated dataset into a training set and a test set. S2. Training model: Use the training set to train the detection model and set a suitable loss function; S3, evaluation model: use the test set to evaluate the trained detection model; S4. Application model: perform ear defect detection through the detection model that has passed the evaluation.
7. The method for detecting ear defects based on semantic segmentation according to claim 6, characterized in that: The image format of the ear image data set in step S1 includes RGB image format.
8. The method for detecting ear defects based on semantic segmentation according to claim 6, characterized in that: The loss function in step S2 is a composite loss function, which is composed of a cross entropy loss function and a Dice loss, and is expressed as: L=L CE +L Dice (3) L CE is the cross entropy loss function, L Dice It is the Dice loss.
9. The method for detecting ear defects based on semantic segmentation according to claim 6, characterized in that: The evaluation in step S3 adopts a comprehensive evaluation system, which includes evaluating the performance of the model in terms of accuracy and segmentation quality, and the practicality of the model. The pixel-level accuracy, intersection-over-union ratio, and Dice coefficient are used to evaluate the performance of the model in terms of accuracy and segmentation quality, and the computational complexity, the number of model parameters, the response time, and the number of frames processed per second are used to evaluate the practicality of the model.
10. A system for detecting ear defects based on semantic segmentation according to any one of claims 1 to 5 or any one of claims 6 to 9, characterized in that: It consists of a hardware part and a software part. The hardware part includes a detection object placement table, a camera mechanism and an image transmission mechanism; the software part includes the application program into which the detection model is integrated.
Citation Information
Patent Citations
Semantic segmentation method based on improved multi-scale full convolutional network
CN114220098A
Efficient semantic segmentation method based on SAC-UNet
CN117475150A
Multi-attention codec network and system applied to skin lesion segmentation
CN117496144A
Remote sensing image semantic segmentation method based on multi-scale attention and double encoders
CN117496151A
Medical image segmentation method based on u-net
US20220309674A1
Cited By
Plant leaf scab segmentation method and system based on RGB-D cross-modal fusion
CN120374650A
