Container lockhole identification method, system, equipment and medium
Through the improved HOG algorithm and AdaBoost-SVM cascade classification model, the problems of edge detection instability and noise interference in container keyhole recognition are solved, and higher recognition accuracy and robustness are achieved.
Patent Information
- Application Number
- CN202510373580.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-07-11
AI Technical Summary
The prior art has problems in the identification of container keyholes, such as unstable edge detection, large noise interference, and low wear keyhole recognition rate in the identification of container keyholes. In particular, the Hough circle detection effect is poor, resulting in low recognition rate.
The improved HOG algorithm is used to introduce a direction adjustable filter to calculate gradient information in multiple directions, and combined with the AdaBoost-SVM cascading classification model, the identification accuracy is improved by training a multi-level cascading classifier.
Improves the robustness and recognition rate of keyhole detection, reduces the false alarm rate, and enhances performance in nonlinear and small sample recognition environments.
Smart Images

Figure CN120298781A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and particularly relates to a method, system, device and medium for identifying a container keyhole. Background Art
[0002] Identifying the position of a container keyhole is the key to accurately lifting a container. Most container lifting devices fix and lift the container through the keyhole. Identifying the keyhole is crucial for realizing the automation of large-scale mechanical equipment. Since the color difference near the container keyhole is small, while the contrast between light and dark of the hole is strong, the prior art often uses color features to locate the position of the container body and the preliminary position of the keyhole, and then performs edge detection and Hough transform on the preliminary position of the keyhole to identify and locate the accurate position of the keyhole. However, this method has the following drawbacks: the edge detection effect of the keyhole using Hough circle is unstable; the uneven strip on the surface of the container body will bring strong noise interference, resulting in a high false alarm rate when using Candy edge detection; and the effect on worn keyholes is not good, with a low recognition rate, etc. Summary of the Invention
[0003] Aiming at the deficiencies in the prior art, the present invention provides a method, system, device and medium for identifying a container keyhole, which can improve the recognition rate of the target.
[0004] The present invention provides the following technical solutions:
[0005] In a first aspect, a method for identifying a container keyhole is provided, including:
[0006] Collecting an image containing a container keyhole;
[0007] Introducing a directionally adjustable filter into the HOG algorithm to calculate gradient information in multiple directions, so as to improve the HOG algorithm, and using the improved HOG algorithm to extract features from the collected image containing the target;
[0008] Training an AdaBoost-SVM cascade classification model, where the AdaBoost-SVM cascade classification model includes multiple levels of cascade classifiers; each level of cascade classifier includes weak classifiers less than a set number and meeting the overall false alarm rate threshold, or includes a set number of weak classifiers and a trained and updated SVM classifier;
[0009] Using the trained AdaBoost-SVM cascade classification model to perform target recognition on the extracted features and obtaining a recognition result.
[0010] Optionally, the using the improved HOG algorithm to extract features from the collected image containing the target specifically includes:
[0011] Preprocessing the collected image;
[0012] Linearly combine multiple base filters in different directions to generate a directionally controllable filter;
[0013] Use the directionally controllable filter to calculate the gradient information of the acquired image in different directions, and select the direction with the largest gradient magnitude for each pixel of the acquired image as the main direction;
[0014] Divide the acquired image into cells of a set size, and obtain the gradient direction histogram of each cell according to the main direction and gradient information of each pixel;
[0015] Combine multiple cells into blocks, and perform a normalization operation on the histograms within each block;
[0016] Stitch together the normalized histograms of all blocks to form the final HOG feature vector.
[0017] Optionally, the linearly combining multiple base filters in different directions to generate a directionally controllable filter is specifically:
[0018] Generate base filters G0(x, y), G 45 (x, y), G 90 (x, y) at 0°, 45°, and 90° according to the first and second derivatives of the Gaussian function, and linearly combine the three base filters to generate a directionally controllable filter G θ (x, y);
[0019] The output of the directionally controllable filter G θ (x, y) is:
[0020] G θ (x, y) = G0(x, y)cos 2 (θ) + G 45 (x, y)sin(2θ) + G 90 (x, y)sin 2 (θ)
[0021] where θ is the desired direction angle.
[0022] Optionally, the calculating the gradient information of the acquired image in different directions using the directionally controllable filter is specifically:
[0023] Convolve the output G θ (x, y) of the directionally controllable filter with the input image I(x, y) to calculate the directional gradient I θ (x, y), the gradient magnitude M(x, y), and the gradient direction θ(x, y);
[0024] I θ(x, y) = I(x, y) * G θ (x, y)
[0025]
[0026]
[0027] where I θx (x, y) and I θy (x, y) are the gradient values in the x - direction and y - direction respectively.
[0028] Optionally, training the AdaBoost - SVM cascade classification model includes training the cascade classifiers of a set number of levels in sequence, specifically:
[0029] Initialize the parameters of the AdaBoost - SVM cascade classification model: D0 = 0, F0 = 1, i = 0; where D0 is the initial classification accuracy, F0 is the initial false - alarm rate, and i is the index of the current classifier layer;
[0030] Train the cascade classifier of each level of AdaBoost until the set number of levels q is reached, then output all levels of cascade classifiers that meet the set requirements to form the AdaBoost - SVM cascade classification model;
[0031] Among them, training the cascade classifier of the i - th level of AdaBoost specifically includes:
[0032] Train multiple weak classifiers of the i - th level cascade classifier and calculate the misclassification rate ε of each weak classifier m ;
[0033]
[0034] where is the weight of the sample, h(x j ) is the prediction result of the current weak classifier, y j is the true label of the sample, and N is the total number of samples;
[0035] According to the misclassification rate ε of each weak classifier m , calculate the weight α of each weak classifier m and update the weight of the sample;
[0036]
[0037]
[0038] where is the sample weight of the next weak classifier;
[0039] Calculate the total false positive rate F of the current weak classifier at level i i ;
[0040]
[0041] where M is the number of weak classifiers at the current level i;
[0042] If the total false positive rate F of the weak classifier at the current level i i is less than the set overall false positive rate threshold, then train the next-level cascade classifier; otherwise, determine whether the number of weak classifiers at the current level i is less than the set upper limit value. If so, increase the number of weak classifiers at the current level i. Otherwise, introduce an SVM classifier for training until the false positive rate after classification by the SVM classifier meets the set overall false positive rate threshold and the classification accuracy meets the set threshold.
[0043] Optionally, the objective function for training the SVM classifier is:
[0044]
[0045] K(x i , x j ) = φ(x i ) · φ(x j )
[0046] where α i and α j are the Lagrange multipliers of samples i and j respectively, y i and y j are the categories of samples i and j respectively, +1 or -1, K(x i , x j ) is the kernel function, and φ(x i ) and φ(x j ) are the feature mapping functions of samples i and j respectively;
[0047] Optionally, the false positive rate F of the SVM classifier i is:
[0048]
[0049] where FP is the number of misclassified negative samples and TN is the number of correctly classified negative samples;
[0050] The classification accuracy D of the SVM classifier i is:
[0051]
[0052] where TP is the number of correctly classified positive samples and FN is the number of misclassified positive samples.
[0053] In a second aspect, a recognition system for a container keyhole is provided, including:
[0054] An acquisition module for acquiring an image containing the container keyhole;
[0055] A feature extraction module for introducing a steerable filter in the HOG algorithm to calculate gradient information in multiple directions, so as to improve the HOG algorithm, and using the improved HOG algorithm to extract features from the acquired image containing the target;
[0056] A training module for training an AdaBoost-SVM cascade classification model, where the AdaBoost-SVM cascade classification model includes multiple levels of cascade classifiers; each level of cascade classifier includes weak classifiers less than a set number and meeting the overall false alarm rate threshold or includes a set number of weak classifiers and a trained and updated SVM classifier;
[0057] A target recognition module for using the trained AdaBoost-SVM cascade classification model to perform target recognition on the extracted features and obtaining a recognition result.
[0058] In a third aspect, a computer device is provided, including a processor and a memory; wherein, when the processor executes the computer program stored in the memory, the steps of the recognition method for the container keyhole described in any item of the first aspect are implemented.
[0059] In a fourth aspect, a computer-readable storage medium is provided for storing a computer program; when the computer program is executed by a processor, the steps of the recognition method for the container keyhole described in any item of the first aspect are implemented.
[0060] Compared with the prior art, the beneficial effects of the present invention are:
[0061] By introducing steerable filters, this method realizes gradient interpolation calculation in any direction through a set of basis filters, thereby obtaining richer directional features. Compared with the traditional HOG calculation method, the present application can enhance the target edge and structural features at multiple scales and in multiple directions, improve the integrity and accuracy of feature extraction, and make the keyhole detection more robust. In the AdaBoost-SVM cascade classification model of the present application, the advantages of the AdaBoost algorithm and the SVM algorithm are integrated, quickly eliminating simple negative samples in the initial stage, reducing the calculation amount, improving the efficiency, and being able to automatically adjust the classification strategy, taking into account both the efficiency and the fine classification requirements, and improving the recognition ability in non-linear, small sample and high-dimensional pattern recognition. Description of the Drawings
[0062] Figure 1It is the flowchart of the steps of the method for identifying the keyhole of a container of the present invention;
[0063] Figure 2 It is the training flowchart of the AdaBoost-SVM cascade classification model of the present invention;
[0064] Figure 3 It is the structural block diagram of the system for identifying the keyhole of a container of the present invention. Specific embodiments
[0065] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and should not be used to limit the protection scope of the present invention.
[0066] It should be noted that the term "including" and any variation thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0067] Embodiment 1
[0068] As Figure 1 shown, a method for identifying the keyhole of a container includes the following steps:
[0069] S1: Collect an image containing the keyhole of the container.
[0070] When collecting the image of the keyhole of the container, when the position of the keyhole of the container is determined, the camera can be directly used for shooting and collection. Of course, in some other embodiments, the images of the container can also be collected from different angles by a binocular camera. Before image collection, the binocular camera is calibrated with the help of the MATLAB calibration toolbox. By collecting images with a calibration board and performing calibration, the relative position and direction parameters between the cameras can be obtained, and then the two-dimensional image information collected is converted into a three-dimensional space position, so as to facilitate positioning the position of the keyhole target of the container, and then the camera is used to shoot images for keyhole identification.
[0071] S2: Introduce a directionally tunable filter in the HOG algorithm to calculate the gradient information in multiple directions, so as to improve the HOG algorithm, and use the improved HOG algorithm to extract features from the collected image containing the target.
[0072] Step S2 specifically includes:
[0073] S2.1: Preprocess the collected image.
[0074] The preprocessing includes grayscale processing, Gaussian smoothing to reduce noise, etc.
[0075] S2.2: Linearly combine multiple base filters in different directions to generate a directionally controllable filter.
[0076] Generate base filters G0(x, y), G 45 (x, y), G 90 (x, y) at 0°, 45°, and 90° according to the first and second derivatives of the Gaussian function, and linearly combine the three base filters to generate a directionally controllable filter G θ (x, y);
[0077] The output of the directionally controllable filter G θ (x, y) is:
[0078] G θ (x, y) = G0(x, y) cos 2 (θ) + G 45 (x, y) sin(2θ) + G 90 (x, y) sin 2 (θ)
[0079] where θ is the desired direction angle.
[0080] Specifically, the first derivative of the Gaussian function:
[0081]
[0082] The second derivative of the Gaussian function:
[0083]
[0084] The base filters G0(x, y), G 45 (x, y), G 90 (x, y) are respectively:
[0085] Horizontal direction (0°): G0(x, y) = G”(x)(y)
[0086] Vertical direction (90°): G 90 (x, y) = G(x)G”(y)
[0087] 45° direction: G 45 (x, y) = G”(x)G”(y).
[0088] S2.3: Use the directionally controllable filter to calculate the gradient information of the acquired image in different directions, and select the direction with the largest gradient magnitude for each pixel point of the acquired image as the main direction.
[0089] The gradient information includes the directional gradient, gradient magnitude, and gradient direction.
[0090] Step S2.3 specifically is: Using the output G θ (x, y) of the direction controllable filter to convolve with the input image I(x, y) to calculate the directional gradient I θ (x, y), the gradient magnitude M(x, y) and the gradient direction θ(x, y);
[0091] I θ (x, y) = I(x, y) * G θ (x, y)
[0092]
[0093]
[0094] where, I θx (x, y) and I θy (x, y) are the gradient values in the x - direction and y - direction respectively.
[0095] Select the direction with the largest gradient magnitude for each pixel of the acquired image as the main direction. As an example, it is: 0° (horizontal direction), 45° direction, 90° (vertical direction). Select the direction with the largest gradient magnitude for each pixel as the main direction:
[0096] M(x, y) = max{M θ1 (x, y), M θ2 (x, y), M θ3 (x, y)}
[0097] In the formula, θ1, θ2, θ3 are the three directions respectively.
[0098] S2.4: Divide the acquired image into cells of a set size, and obtain the gradient direction histogram of each cell according to the main direction and gradient information of each pixel.
[0099] The cell (Cell) is optionally 8 * 8 pixels.
[0100] Gradient direction histogram calculation: Set 9 direction bins (for example, between 0° - 180°, with each 20° as a bin). Calculate the gradient direction histogram of each pixel:
[0101]
[0102] where, w(x, y) is the gradient magnitude, δ is the unit impulse function, and h i is the gradient magnitude of the i - th bin.
[0103] S2.5: Combine multiple cells into blocks, and perform a normalization operation on the histograms within each block.
[0104] Form multiple cells into a block. For example, 2 * 2 cells form a block, and perform L2 normalization on the histogram within each block:
[0105]
[0106] In the formula, h is the HOG feature vector of the block; ε is a small value to prevent division by zero.
[0107] S2.6: Concatenate the normalized histograms of all blocks to form the final HOG feature vector.
[0108] By introducing a steerable filter to calculate the directional gradient, this method improves the accuracy of the HOG for the image gradient direction, thereby enhancing the robustness of target recognition. The final HOG feature vector is input into the trained AdaBoost - SVM cascade classification model for classification and recognition. The final HOG feature vector not only retains the target shape features of HOG, but also introduces the multi - directional enhancement information of the steerable filter, improving the accuracy and stability of target recognition.
[0109] Introduce a steerable filter (Steerable Filters). This method realizes the interpolation calculation of gradients in any direction through a set of basis filters, thereby obtaining richer directional features. Compared with the traditional HOG calculation method, it can enhance the target edge and structure features at multiple scales and in multiple directions, improve the integrity and accuracy of feature extraction, and make the keyhole detection more robust.
[0110] S3: Train the AdaBoost - SVM cascade classification model. The AdaBoost - SVM cascade classification model includes multiple levels of cascade classifiers; each level of cascade classifier includes weak classifiers with a number less than the set number and meeting the overall false - positive rate threshold, or includes the set number of weak classifiers and the trained and updated SVM classifier.
[0111] As Figure 2 shown, training the AdaBoost - SVM cascade classification model includes training the cascade classifiers of the set number of levels in sequence. Specifically:
[0112] S31: Initialize the parameters of the AdaBoost - SVM cascade classification model: D0 = 0, F0 = 1, i = 0; where D0 is the initial classification accuracy, F0 is the initial false - positive rate, and i is the index of the current classifier layer.
[0113] Before training, it is necessary to collect training data and perform preprocessing, including normalizing or standardizing features to ensure that the impact of each feature on the model is balanced. The dataset is divided into a training set and a test set to prepare for subsequent model training and performance evaluation.
[0114] Before starting training, it is necessary to set the overall false alarm rate threshold and the maximum number of weak classifiers in each stage of the cascade classifier.
[0115] The resolution of the collected images is 846*462. The keyhole areas in the sample images are manually marked and all keyhole areas are scaled to the size of the smallest keyhole, which is 120*84, as positive samples (some keyhole samples with severe occlusion are excluded). At the same time, non-keyhole areas with the same size as the positive samples and twice the quantity are marked as negative samples. Assuming that 7500 positive samples and 15000 negative samples are required, a positive and negative sample library is formed.
[0116] S32: Train each stage of the cascade classifier until the set number of stages q is reached, then output all stages of the cascade classifier that meet the set requirements to form an AdaBoost-SVM cascade classification model.
[0117] Among them, training the cascade classifier of the i-th stage of AdaBoost specifically includes:
[0118] S321: Train multiple weak classifiers of the i-th stage of the cascade classifier and calculate the misclassification rate ε of each weak classifier m ;
[0119]
[0120] Among them, is the weight of the sample, h(x j ) is the prediction result of the current weak classifier, y j is the true label of the sample, and N is the total number of samples.
[0121] The training of weak classifiers can refer to existing technologies. A weak classifier can optionally be a decision stump or a simple SVM.
[0122] S322: According to the misclassification rate ε m of each weak classifier, calculate the weight α m of each weak classifier and update the weight of the sample;
[0123]
[0124]
[0125] Among them, is the sample weight of the next weak classifier.
[0126] S323: Calculate the total false alarm rate F of the current i-level weak classifier i ; Among them, M is the number of weak classifiers in the current i-th level.
[0127] S324: If the total false alarm rate F of the weak classifier at the current level i i If the value is less than the set overall false alarm rate threshold, the next level of cascade classifier is trained until the set number of levels is reached; otherwise, it is determined whether the number of weak classifiers at the current i-th level is less than the set upper limit. If so, the number of weak classifiers at the current i-th level is increased; otherwise, the SVM classifier is introduced for training until the false alarm rate after classification by the SVM classifier meets the set overall false alarm rate threshold and the classification accuracy meets the set threshold.
[0128] In some other embodiments, if the total false alarm rate F of the weak classifier at the current level i is i is less than the set overall false alarm rate threshold, and the total false alarm rate F of the weak classifier at the current level i i Less than the total false alarm rate F of the weak classifier at the previous i-1 level i-1 The product of the weak classifier and the empirical adjustment coefficient f is used to train the next level of cascade classifier. Otherwise, the number of weak classifiers is increased or the training of SVM classifier is introduced.
[0129] In this embodiment, the SVM classification boundary is calculated and the kernel function is used for nonlinear mapping: K(x i ,x j )=φ(x i )·φ(x j )
[0130] The objective function J for training the SVM classifier is:
[0131]
[0132] Among them, α i and α j are the Lagrange multipliers of samples i and j, y i and j are the categories of samples i and j, +1 or -1, K(x i ,x j ) is the kernel function, φ(x i ) and φ(x j ) are the feature mapping functions of samples i and j respectively; the objective function is to find the best hyperplane to maximize the classification interval.
[0133] Calculate the false positive rate F of the SVM classifier i for:
[0134]
[0135] Among them, FP is the number of misclassified negative samples, and TN is the number of correctly classified negative samples.
[0136] Classification accuracy D i is:
[0137] Among them, TP is the number of correctly classified positive samples, and FN is the number of misclassified positive samples.
[0138] If the false alarm rate of the SVM classifier is less than the set overall false alarm rate threshold and the classification accuracy is less than the set threshold, the training is stopped; otherwise, the hyperparameters of the SVM (such as kernel function parameters) are adjusted.
[0139] After the AdaBoost-SVM cascade classification model is trained, the test data needs to be finally classified after being processed by the AdaBoost-SVM cascade filter. The model is evaluated using criteria such as accuracy, recall rate, and F1 score to ensure that it has good classification effects.
[0140] S4: Use the trained AdaBoost-SVM cascade classification model to perform target recognition on the extracted features and obtain the recognition results.
[0141] Embodiment 2
[0142] As Figure 3 shown, an identification system for a container keyhole includes:
[0143] An acquisition module, configured to acquire an image containing a container keyhole;
[0144] A feature extraction module, configured to introduce a directionally tunable filter in the HOG algorithm to calculate gradient information in multiple directions, so as to improve the HOG algorithm, and use the improved HOG algorithm to extract features from the acquired image containing the target;
[0145] A training module, configured to train an AdaBoost-SVM cascade classification model, where the AdaBoost-SVM cascade classification model includes multiple levels of cascade classifiers; each level of cascade classifier includes weak classifiers with a number less than the set number and meeting the overall false alarm rate threshold or includes a set number of weak classifiers and a trained and updated SVM classifier;
[0146] A target recognition module, configured to use the trained AdaBoost-SVM cascade classification model to perform target recognition on the extracted features and obtain the recognition results.
[0147] For a more specific process of the above method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be elaborated herein.
[0148] Embodiment 3
[0149] The present invention provides a computer device, including a processor and a memory; wherein, when the processor executes the computer program stored in the memory, the steps of the above-mentioned method for identifying the keyhole of a container are realized.
[0150] For a more specific process of the above method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.
[0151] Embodiment 4
[0152] The present invention provides a computer-readable storage medium for storing a computer program; when the computer program is executed by a processor, the steps of the above-mentioned method for identifying the keyhole of a container are realized.
[0153] For a more specific process of the above method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.
[0154] In this specification, each embodiment is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. For the systems, devices, and storage media disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the description of the method part.
[0155] Those skilled in the art can clearly understand that the technologies in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solutions in the embodiments of the present invention, in essence, or the parts that contribute to the prior art can be embodied in the form of a software product. The computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disc, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments of the present invention.
[0156] The above is only the preferred embodiment of the present invention. The protection scope of the present invention is not limited to the above embodiments. All technical solutions falling within the idea of the present invention belong to the protection scope of the present invention. It should be noted that for those of ordinary skill in the art in this technical field, several improvements and refinements made without departing from the principle of the present invention should be regarded as within the protection scope of the present invention.
Claims
1. A method for identifying a keyhole of a container, characterized in that, Including: Collecting an image containing a container keyhole; Introducing a directionally tunable filter into the HOG algorithm to calculate gradient information in multiple directions, so as to improve the HOG algorithm, and using the improved HOG algorithm to extract features from the collected image containing the target; Training an AdaBoost-SVM cascade classification model, where the AdaBoost-SVM cascade classification model includes multiple levels of cascade classifiers; each level of cascade classifier includes weak classifiers less than a set number and meeting the overall false alarm rate threshold or includes a set number of weak classifiers and a trained and updated SVM classifier; Using the trained AdaBoost-SVM cascade classification model to perform target recognition on the extracted features and obtaining a recognition result.
2. The identification method of the container keyhole according to claim 1, wherein The using the improved HOG algorithm to extract features from the collected image containing the target specifically includes: Preprocessing the collected image; Linearly combining multiple base filters with different directions to generate a directionally controllable filter; Using the directionally controllable filter to calculate the gradient information of the collected image in different directions, and selecting the direction with the largest gradient magnitude for each pixel point of the collected image as the main direction; Dividing the collected image into cells of a set size, and obtaining a gradient direction histogram for each cell according to the main direction and gradient information of each pixel point; Combining multiple cells into blocks and performing a normalization operation on the histograms within each block; Stitching the normalized histograms of all blocks to form a final HOG feature vector.
3. The method for identifying the keyhole of a container according to claim 2, wherein, The linearly combining multiple base filters with different directions to generate a directionally controllable filter is specifically: Generate the basis filters G0(x,y), G 45 (x,y), G 90 (x,y), and linearly combine the three basis filters to generate the directionally controllable filter G θ (x,y); The directionally controllable filter G θ (x,y) outputs: G θ (x,y) = G0(x,y) cos 2 (θ) + G 45 (x,y) sin(2θ) + G 90 (x,y) sin 2 (θ) where θ is the required direction angle.
4. The method for identifying the keyhole of a container according to claim 2, characterized in that, The using the directionally controllable filter to calculate the gradient information of the collected image in different directions is specifically: Output G of the directionally controllable filter θ (x, y) is convolved with the input image I(x, y) to calculate the directional gradient I θ (x, y), the gradient magnitude M(x, y), and the gradient direction θ(x, y); I θ (x,y) = I(x,y) * G θ (x,y) Among them, I θx (x, y) and I θy (x, y) are the gradient values in the x - direction and y - direction respectively.
5. The method for identifying the keyhole of a container according to claim 1, wherein The training the AdaBoost-SVM cascade classification model includes training the cascade classifiers of a set number of levels in sequence, specifically: Initializing the parameters of the AdaBoost-SVM cascade classification model as D0 = 0, F0 = 1, i = 0; where D0 is the initial classification accuracy, F0 is the initial false alarm rate, and i is the index of the current classifier layer; Training the cascade classifier of each level of AdaBoost until reaching the set number of levels q, then outputting all levels of cascade classifiers that meet the set requirements to form an AdaBoost-SVM cascade classification model; where training the cascade classifier of the i-th level of AdaBoost specifically includes: Train multiple weak classifiers of the i-th stage cascade classifier and calculate the misclassification rate ε of each weak classifier m ; Among them, is the weight of the sample, h(x j ) is the prediction result of the current weak classifier, y j is the true label of the sample, and N is the total number of samples; According to the misclassification rate ε of each weak classifier m , calculate the weight α of each weak classifier m and update the weights of the samples; Among them, is the sample weight of the next weak classifier; Calculate the total false positive rate F of the current weak classifier at level i i ; where M is the number of weak classifiers of the current i-th level; If the total false positive rate F of the weak classifier at the current i-th level i is less than the set overall false positive rate threshold, then train the cascade classifier at the next level; otherwise, determine whether the number of weak classifiers at the current i-th level is less than the set upper limit value. If so, increase the number of weak classifiers at the current i-th level. Otherwise, introduce the SVM classifier for training until the false positive rate after classification by the SVM classifier meets the set overall false positive rate threshold and the classification accuracy meets the set threshold.
6. The identification method of the container keyhole according to claim 5, characterized in that, The objective function for training the SVM classifier is: K(x i ,x j ) = φ(x i )·φ(x j ) where α i and α j are the Lagrange multipliers of samples i and j respectively, y i and y j are the classes of samples i and j respectively, +1 or -1, K(x i , x j ) is the kernel function, φ(x i ) and φ(x j ) are the feature mapping functions of samples i and j respectively.
7. The identification method of the container keyhole according to claim 5, characterized in that The false positive rate F of the SVM classifier i is as follows: where FP is the number of misclassified negative samples and TN is the number of correctly classified negative samples; The classification accuracy D of the SVM classifier i is as follows: where TP is the number of correctly classified positive samples and FN is the number of misclassified positive samples.
8. An identification system for a container keyhole, characterized in that Including: A collection module for collecting an image containing a container keyhole; A feature extraction module for introducing a directionally tunable filter into the HOG algorithm to calculate gradient information in multiple directions, so as to improve the HOG algorithm, and using the improved HOG algorithm to extract features from the collected image containing the target; A training module for training an AdaBoost-SVM cascade classification model, where the AdaBoost-SVM cascade classification model includes multiple levels of cascade classifiers; each level of cascade classifier includes weak classifiers with a number less than a set number and meeting the overall false alarm rate threshold, or includes a set number of weak classifiers and a trained and updated SVM classifier; A target recognition module for using the trained AdaBoost-SVM cascade classification model to perform target recognition on the extracted features and obtain a recognition result.
9. A computer device, characterized in that, It includes a processor and a memory; wherein, when the processor executes the computer program stored in the memory, the steps of the identification method of the container keyhole according to any one of claims 1-7 are implemented.
10. A computer-readable storage medium, characterized in that, For storing a computer program; when the computer program is executed by the processor, the steps of the identification method of the container keyhole according to any one of claims 1-7 are implemented.