Based on Matlab deep learning target detection algorithm system GUI, single target, multi-target detection

        Deep learning is a powerful machine learning method that can be used to train robust object detectors. There are various methods for object detection, including Faster R-CNN and you only look once (YOLO) v2! The author of this article integrates single-target and multi-target systems into one, and only needs to replace the data set target, which is simple and convenient, and all operations can be completed through the visual button! 

        The system supports the detection of various objects, including: helmets, cars, fire smoke, traffic signs, fatigue driving, masks, vehicles, pedestrians, steel defects, cracks, pill boxes, license plates, faces, signal lights, etc.

        With the large-scale application of deep learning in the field of target detection, the accuracy and speed of target detection technology have been rapidly improved, and it has been widely used in pedestrian detection, face detection, text detection, traffic sign and signal light detection, and remote sensing image detection. . This paper reviews the target detection methods based on the research of relevant literature at home and abroad. First, the research status of the target detection field as well as the data sets and performance indicators to test the target detection algorithm are introduced. The process architecture, performance effect, advantages and disadvantages of some typical algorithms of detection algorithm, two-stage target detection algorithm based on region proposal and single-stage target detection algorithm based on regression analysis are described in detail, and some new emerging in recent years are also added. Finally, some common application scenarios of target detection are explained, and the future development trend is analyzed in combination with current research hotspots.

         Highly integrated system! You can complete training and detection with fool-like operations, and support video and image loading and recognition methods!

An overview of target detection 

        Before deep learning methods were applied to the field of target detection, the field of target detection developed slowly. In the ImageNet[2] classification task in 2012, the application of convolutional neural networks greatly improved the effect of image classification tasks. Under this promotion, Girshick et al. [3] used regions with CNN features (R-CNN) in the field of target detection for the first time, and achieved a huge improvement in the detection effect. Since then, the combination of deep learning and target detection tasks has made target detection The field has begun to develop rapidly and has been widely used in practice. Object detection has broad application prospects, and has achieved good results in the fields of monitoring and security, automatic driving, remote sensing detection, and medical image lesion detection.

2. Load the dataset

        Just put the specified dataset xml and pictures in the relevant directory, and then click on the data selection!

% Display first few rows of the data set.
vehicleDataset(1:4,:)

shuffledIndices = randperm(height(vehicleDataset));
idx = floor(0.6 * length(shuffledIndices) );

trainingIdx = 1:idx;
trainingDataTbl = vehicleDataset(shuffledIndices(trainingIdx),:);

validationIdx = idx+1 : idx + 1 + floor(0.1 * length(shuffledIndices) );
validationDataTbl = vehicleDataset(shuffledIndices(validationIdx),:);

testIdx = validationIdx(end)+1 : length(shuffledIndices);
testDataTbl = vehicleDataset(shuffledIndices(testIdx),:);

3. Create target detection

The function automatically creates target detection networks such as YOLO and RCNN based on the pre-trained ResNet-50 feature extraction network.

  • network input size
  • anchor box
  • Feature extraction network

        First, specify the network input size and the number of classes. When choosing a network input size, consider the minimum size required by the network itself, the size of the training images, and the computational cost of processing the data based on the chosen size. If feasible, choose a network input size that is close to the training image size and larger than the input size required by the network. To reduce the computational cost of running the example, specify a network input size of [224 224 3], which is the minimum size required to run the network.

Fourth, data enhancement

% Visualize the augmented images.
augmentedData = cell(4,1);
for k = 1:4
    data = read(augmentedTrainingData);
    augmentedData{k} = insertShape(data{1},'Rectangle',data{2});
    reset(augmentedTrainingData);
end
figure
montage(augmentedData,'BorderSize',10)

5. Training object detector

        Use the  trainingOptions specified network training options. Will be  'ValidationData' set to preprocessed validation data. will be  'CheckpointPath' set to a temporary location. This saves a partially trained detector during training. If training is interrupted due to, for example, a power outage or system failure, you can resume training from the saved checkpoint.

options = trainingOptions('sgdm', ...
        'MiniBatchSize',16, ....
        'InitialLearnRate',1e-3, ...
        'MaxEpochs',20, ... 
        'CheckpointPath',tempdir, ...
        'ValidationData',preprocessedValidationData);

6. Use the test set to evaluate the detector

        Evaluate the trained object detector on a large number of images to measure its performance. Computer Vision Toolbox™ provides object detector evaluation functions for measuring common metrics such as average precision ( evaluateDetectionPrecision) and log-average leak detection ( evaluateDetectionMissRate). For this example, the average precision metric is used to evaluate performance. Average precision provides a single number that combines the ability of the detector to classify correctly (precision) and the ability of the detector to find all relevant objects (recall). Apply the same preprocessing transformation applied to the training data to the test data. Note that data augmentation does not apply to test data. Test data should be representative of the original data and remain unchanged for unbiased evaluation.

figure
plot(recall,precision)
xlabel('Recall')
ylabel('Precision')
grid on
title(sprintf('Average Precision = %.2f',ap))

 7. Test

        You can choose pictures and videos, highly integrated! Simple operation!

such as vehicle detection,


For details, please click : 1341703358 .  Target detection technology based on deep learning has become a popular direction in the field of computer vision due to its huge advantages, such as strong generalization ability, outstanding effect in complex scenes, and broad application prospects. Pedestrian detection, face detection, text detection, Traffic sign and signal light detection and remote sensing image detection are common application scenarios for target detection. By comparing different target detection algorithms, it can be seen that the two-stage target detection algorithm first uses the algorithm to extract the candidate area, and then the candidate frame target The second correction is performed, which has high precision and accurate positioning, but the training is complex and computationally expensive, and it is difficult to achieve real-time detection; the single-stage target detection algorithm has no candidate region recommendation process, and can determine the target category and locate the target in one stage. The model is simple and The speed is fast, but the detection accuracy of small targets and dense targets needs to be improved. In recent years, video target detection, salient target detection and GAN-based target detection have a good momentum of development. New target detection algorithms such as NASFPN, EfficientDet , YOLOF, etc. also provide new ideas for the development of the field of target detection. With the further in-depth study of target detection technology based on deep learning, it is believed that its application field will be more extensive, and it will bring greater benefits to the survival and development of human beings. benefit.

Guess you like

Origin blog.csdn.net/Jiangtagong/article/details/124250723