Method and device for classifying objects in target sensing area
By collecting magnetic field signal data in the target sensing area of the security gate and using the target classification model for classification, the problem of inability to effectively classify and identify different metal objects in the prior art is solved, and high-accurate metal object recognition is achieved.
Patent Information
- Application Number
- CN202411431373.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-02-11
AI Technical Summary
The prior art cannot effectively classify and identify different metal objects passing through security gates, and the recognition accuracy is low.
By setting up a signal acquisition device in the target sensing area, magnetic field signal data is obtained, and data classification is performed using the target classification model. This model is trained through sample signal data sets and can distinguish the characteristic signals of different metal objects.
Effective classification and identification of different metal objects is achieved, the accuracy of identification is improved, and the method is highly practical and robust.
Smart Images

Figure CN119416050A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a method and device for classifying objects in a target sensing area. Background Art
[0002] In recent years, the rail transit industry has developed rapidly, and rail transit in most cities will use security gates to identify objects passing through the security gates. In the related technology, there is a method of identifying metal objects through traditional metal detection gates, but this method cannot further classify metal objects and the recognition accuracy is low. Summary of the invention
[0003] The present application aims to solve at least one of the technical problems existing in the related art. To this end, the present application proposes a method and device for classifying objects in a target sensing area, which can effectively distinguish different metal objects, has strong practicality and robustness, and has high classification and recognition accuracy.
[0004] In a first aspect, the present application provides a method for classifying objects in a target sensing area, wherein a signal collection device is provided in the target sensing area, and the method comprises:
[0005] Acquire magnetic field signal data collected by the signal collection device in the target sensing area; the target sensing area is used for the object to pass through;
[0006] The magnetic field signal data is input into a target classification model to obtain category information corresponding to a target object passing through the target sensing area output by the target classification model; the target classification model is trained using a sample signal data set as a sample and outputting category information of a target object corresponding to the sample signal data set as a goal, wherein the sample signal data set includes sub-data sets of multiple categories, and the feature values corresponding to each signal data in each sub-data set of the category are in different intervals.
[0007] According to the method for classifying objects within a target sensing area provided in an embodiment of the present application, a sample signal data set containing signal data of multiple categories is obtained, and a target classification model is trained with the sample signal data set as a sample and with the output of category information of the target object as a goal. The collected magnetic field signal data is input into the trained target classification model, and the category of the target object output by the target classification model can be obtained, and different metal objects can be effectively distinguished. The method has strong practicality and robustness, and the accuracy of classification and recognition is high.
[0008] In one embodiment of the present application, a method for classifying objects in a target sensing area, wherein the target classification model is trained with a sample signal data set as a sample and with the goal of outputting category information of a target object corresponding to the sample signal data set, comprises:
[0009] Acquire a sub-dataset of a target category among the multiple categories and a sub-dataset of other categories among the multiple categories except the target category; the feature value corresponding to each signal data in the sub-dataset of the target category is within a target interval, and the feature value corresponding to each signal data in the sub-dataset of other categories is not within the target interval;
[0010] constructing the sample signal dataset based on the sub-dataset of the target category and the sub-datasets of the other categories;
[0011] The sub-dataset of the target category and the sub-datasets of the other categories are input into the target classification model, so as to train the target classification model with the output of category information of the target object corresponding to the sample signal dataset as the goal.
[0012] In one embodiment of the present application, the object classification method in the target sensing area is obtained by training based on the following steps:
[0013] Build the previous classification model;
[0014] Inputting the sample signal data set into the previous classification model to obtain a first prediction result corresponding to each sample signal data output by the previous classification model;
[0015] Training a next classification model corresponding to the previous classification model based on the plurality of first prediction results and the sample signal data set;
[0016] Update the next classification model to the previous classification model, and repeat the steps of "inputting the sample signal data set into the previous classification model to obtain the first prediction result corresponding to each sample signal data output by the previous classification model; training the next classification model corresponding to the previous classification model based on multiple first prediction results and the sample signal data set" until the target iteration condition is met, and train the target classification model based on multiple classification models corresponding to the iterative process.
[0017] In an object classification method within a target sensing area according to an embodiment of the present application, the training of a next classification model corresponding to the previous classification model based on the plurality of first prediction results and the sample signal data set includes:
[0018] Constructing a target loss function based on the difference between the first prediction result corresponding to each of the sample signal data and the sample category label;
[0019] The next classification module is trained based on the target loss function.
[0020] In a method for classifying objects in a target sensing area according to an embodiment of the present application, the training of the next classification module based on the target loss function includes:
[0021] Based on the target loss function, a greedy algorithm is used to determine a target partition node from a plurality of candidate partition nodes corresponding to each of the sample signal data;
[0022] Based on the target partition node, the next classification model is trained.
[0023] In an object classification method within a target sensing area according to an embodiment of the present application, the target classification model is trained based on multiple classification models corresponding to an iterative process, including:
[0024] Determine the weight corresponding to each classification model based on the target loss function corresponding to each classification model;
[0025] Based on the weights corresponding to the classification models, multiple classification models are weighted and combined into the target classification model.
[0026] In a method for classifying objects in a target sensing area according to an embodiment of the present application, obtaining category information corresponding to a target object passing through the target sensing area output by the target classification model includes:
[0027] When the amplitude difference of the magnetic field signal data in the target time period before and after the object passes through the target sensing area is greater than the target threshold, it is determined that there is a target object passing through the target sensing area, and the magnetic field signal data is input into the target classification model to obtain the category information corresponding to the target object output by the target classification model.
[0028] In a second aspect, the present application provides an object classification device in a target sensing area, wherein a signal collection device is provided in the target sensing area, and the device comprises:
[0029] A first processing module is used to obtain magnetic field signal data collected by the signal collection device in the target sensing area; the target sensing area is used for the object to pass through;
[0030] The second processing module is used to input the magnetic field signal data into a target classification model to obtain the category information corresponding to the target object passing through the target sensing area output by the target classification model; the target classification model is trained with a sample signal data set as a sample and with the goal of outputting the category information of the target object corresponding to the sample signal data set, and the sample signal data set includes sub-data sets of multiple categories, and the intervals of the feature values corresponding to each signal data in the sub-data sets of each category are different.
[0031] According to the device for classifying objects within a target sensing area provided in an embodiment of the present application, a sample signal data set containing signal data of multiple categories is obtained, and a target classification model is trained with the sample signal data set as a sample and with the output of category information of the target object as a goal. The collected magnetic field signal data is input into the trained target classification model, and the category of the target object output by the target classification model can be obtained, so that different metal objects can be effectively distinguished, and the device has strong practicality and robustness, and has high accuracy in classification and recognition.
[0032] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for classifying objects within a target sensing area as described in the first aspect above is implemented.
[0033] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for classifying objects within a target sensing area as described in the first aspect above is implemented.
[0034] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method for classifying objects in a target sensing area as described in the first aspect above.
[0035] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:
[0036] By obtaining a sample signal data set containing signal data of multiple categories, and using the sample signal data set as a sample, and training a target classification model with the output of the category information of the target object as the goal, the collected magnetic field signal data is input into the trained target classification model, the category of the target object output by the target classification model can be obtained, and different metal objects can be effectively distinguished. It has strong practicality and robustness, and the accuracy of classification and recognition is high.
[0037] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0039] Figure 1 This is one of the flow charts of the method for classifying objects in a target sensing area provided in an embodiment of the present application;
[0040] Figure 2 is a schematic diagram of the principle of the object classification method within the target sensing area provided in an embodiment of the present application;
[0041] Figure 3 This is a second flow chart of the method for classifying objects in a target sensing area provided in an embodiment of the present application;
[0042] Figure 4 is a schematic diagram of the structure of an object classification device within a target sensing area provided in an embodiment of the present application;
[0043] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0045] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0046] In conjunction with the accompanying drawings, the object classification method within the target sensing area, the object classification device within the target sensing area, the electronic device and the readable storage medium provided in the embodiments of the present application are described in detail through specific embodiments and their application scenarios.
[0047] The object classification method within the target sensing area may be applied to a terminal, and may be specifically executed by hardware or software in the terminal.
[0048] The terminal includes, but is not limited to, a portable communication device such as a mobile phone or tablet computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad). It should also be understood that in some embodiments, the terminal may not be a portable communication device, but a desktop computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad).
[0049] In the following various embodiments, a terminal including a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, a mouse and a joystick.
[0050] The object classification method within the target sensing area provided in the embodiment of the present application may be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the object classification method within the target sensing area. The electronic devices mentioned in the embodiment of the present application include but are not limited to mobile phones, tablet computers, computers, cameras, and wearable devices. The object classification method within the target sensing area provided in the embodiment of the present application is described below using an electronic device as an example of the execution subject.
[0051] like Figure 1 As shown, the method for classifying objects in the target sensing area includes: step 110 and step 120.
[0052] Step 110, obtaining magnetic field signal data collected by a signal collection device in a target sensing area;
[0053] In this step, a signal acquisition device is provided in the target sensing area, and the signal acquisition device can be used to collect magnetic field signal data.
[0054] The signal acquisition device may be a sensor installed in the target sensing area. For example, an image sensor, an X-ray machine, a millimeter wave scanner, a metal detector or a laser scanner may be installed in the target sensing area.
[0055] For example, when a user passes through a security door, a sensor may be installed on the security door frame.
[0056] The target sensing area may include multiple sub-areas.
[0057] The induction coil in the security door can be divided into multiple sub-areas, and induction components of equal length can form a complete sub-area.
[0058] For example, the induction coil in the security door may be divided into 10, 12 or other numbers of sub-areas.
[0059] The target sensing area is used for objects to pass through.
[0060] When an object passes through the target sensing area, the magnetic field signal data will change.
[0061] When the properties of the objects are different, the distribution of the magnetic field signal data corresponding to the objects is also different.
[0062] Objects may include both metallic and non-metallic objects.
[0063] Metal objects are magnetic and conductive, and different metal objects have different distributions in the magnetic field.
[0064] Magnetic field signal data is used to characterize the distribution of objects in the magnetic field.
[0065] In some embodiments, initial signal data corresponding to each target sensing area may be acquired, and the initial signal data may be cleaned to obtain magnetic field signal data.
[0066] In this embodiment, the initial signal data is cleaned to remove outliers in the initial signal data, or to replace outliers with normal values. For example, outliers may be replaced with means or medians.
[0067] When there are missing values in the initial signal data, the missing values can be handled by filling, interpolating or deleting.
[0068] A high-pass filter may be used to remove low-frequency noise in the initial signal data to retain high-frequency signals in the initial signal data.
[0069] For example, parameters such as the filter cutoff frequency can be adjusted according to the specific frequency characteristics of the signal.
[0070] When a plurality of initial signal data are acquired based on different equipment, the initial signal data may be standardized or normalized.
[0071] Step 120: input each magnetic field signal data into a target classification model, and obtain the category information corresponding to the target object passing through the target sensing area output by the target classification model;
[0072] In this step, the target classification model can be trained based on the sample signal data set and the sample category labels corresponding to the sample signal data set.
[0073] The sample signal data set includes a plurality of sample signal data.
[0074] The sample signal data is acquired based on time series collection.
[0075] Each sample signal data may correspond to a sample category label.
[0076] A sample signal data set can be constructed based on the magnetic field signal data corresponding to the metal object.
[0077] For example, metal objects may include mobile phones, computers, and metal prohibited items (such as controlled knives or guns).
[0078] Metal objects are magnetic and conductive. Based on the physical properties of metal objects, signal features related to the physical properties can be extracted to obtain a sample signal data set. For example, a sample signal data set can be obtained from multiple signal data based on magnetic field strength and resistivity changes.
[0079] The target classification model is trained with the sample signal data set as samples and with the goal of outputting category information of the target object corresponding to the sample signal data set.
[0080] The sample signal data set may include sub-data sets of multiple categories, and the characteristic values corresponding to each signal data in each sub-data set of each category are in different intervals.
[0081] For example, multiple categories could include knives, guns, and electronics, among others.
[0082] The signal data may be converted into characteristic values, for example, the signal data may be converted into coordinate values, etc.
[0083] A large amount of signal data generated when a known target object passes through the target sensing area can be collected, and each sample can be marked to generate a sample category label (i.e., the category of the target object).
[0084] The classification model can be trained using a labeled sample signal data set, and the model parameters can be iteratively optimized so that the model can distinguish target objects of different categories.
[0085] A training set and a test set can be obtained based on the sample signal data set and the sample category labels, the target classification model can be trained based on the training set, and the target classification model can be tested based on the test set.
[0086] The target classification model can include multiple weak learners, such as decision trees or logistic regression.
[0087] In the actual implementation process, each weak learner can be trained separately using the training set, and then the prediction results of multiple weak learners can be integrated using the ensemble learning method.
[0088] According to the method for classifying objects within a target sensing area provided in an embodiment of the present application, a sample signal data set containing signal data of multiple categories is obtained, and a target classification model is trained with the sample signal data set as a sample and with the output of category information of the target object as a goal. The collected magnetic field signal data is input into the trained target classification model, and the category of the target object output by the target classification model can be obtained, and different metal objects can be effectively distinguished. The method has strong practicality and robustness, and the accuracy of classification and recognition is high.
[0089] In some embodiments, the target classification model is trained with the sample signal dataset as a sample and with the goal of outputting the category information of the target object corresponding to the sample signal dataset, which may include:
[0090] Obtain a sub-dataset of a target category among multiple categories and a sub-dataset of other categories except the target category among multiple categories;
[0091] Construct a sample signal dataset based on the sub-dataset of the target category and the sub-datasets of other categories;
[0092] The sub-dataset of the target category and the sub-datasets of other categories are input into the target classification model to output the category information of the target object corresponding to the sample signal dataset as the target training target classification model.
[0093] In this embodiment, the target category is metal contraband, and the characteristic value corresponding to each signal data in the sub-data set of the target category is within the target range.
[0094] The target interval may include multiple sub-intervals, and the characteristic values of the signal data corresponding to different categories of metal contraband are in different sub-intervals.
[0095] The eigenvalues corresponding to the signal data in the sub-datasets of other categories are not within the target range.
[0096] According to the method for classifying objects within a target sensing area provided in an embodiment of the present application, a sample data set is constructed using a sub-data set corresponding to metal contraband and a sub-data set corresponding to other categories of metal, and a target classification model is trained based on the sample data set, so that the target classification model can determine the category of a passing target object based on the interval in which the eigenvalues corresponding to the magnetic field signal data are located, thereby improving the classification accuracy of the target classification model.
[0097] In some embodiments, the target classification model can be trained based on the following steps:
[0098] Build the previous classification model;
[0099] Input the sample signal data set into the previous classification model to obtain the first prediction result corresponding to each sample signal data output by the previous classification model;
[0100] Training a next classification model corresponding to the previous classification model based on the plurality of first prediction results and the sample signal data set;
[0101] Update the next classification model to the previous classification model, and repeat the steps of "inputting the sample signal data set into the previous classification model, obtaining the first prediction result corresponding to each sample signal data output by the previous classification model; training the next classification model corresponding to the previous classification model based on multiple first prediction results and the sample signal data set" until the target iteration conditions are met, and train the target classification model based on multiple classification models corresponding to the iterative process.
[0102] In this embodiment, the previous classification model can be constructed based on logistic regression, decision tree or support vector machine.
[0103] The previous classification model can predict a constant, for example, the mean or median of the target values of all training samples.
[0104] The sample signal data set includes a plurality of sample signal data.
[0105] The sample signal data set is input into the previous classification model, and the first prediction result corresponding to each sample signal data output by the previous classification model can be obtained.
[0106] Each sample signal data corresponds to a sample category label (ie, the true value corresponding to the sample signal data).
[0107] Based on the first prediction result (prediction value) corresponding to the sample signal data and the sample category label (true value), the residual corresponding to the sample signal data can be calculated.
[0108] The next classification model can be built based on the residual and sample signal dataset.
[0109] The next classification model can be a weak learner, such as a decision tree, a linear classifier, a K-Nearest Neighbors (KNN), a naive Bayes classifier, and a logistic regression, etc. It can be selected based on user needs and is not limited in this application.
[0110] Among them, decision trees can be used to segment data sets. For example, decision trees can be used for binary classification based on feature thresholds.
[0111] Linear classifiers can include perceptrons, etc.
[0112] The sample signal data set can be input into the updated previous classification model, and then the prediction result output by the previous classification model can be obtained, so as to build the next classification model based on the prediction result to update the previous classification model again.
[0113] After a new classification model (such as a new decision tree) is constructed, the constructed classification model can be added to the current model, and the current model can update the prediction value of each sample according to the newly constructed classification model.
[0114] When the number of iterations reaches a set threshold, the iteration can be stopped and the last updated classification model can be determined as the target classification model.
[0115] Alternatively, the iteration can be stopped when the performance on the validation set no longer improves. For example, the iteration can be terminated early using the early stopping method.
[0116] In some embodiments, a classification model may be constructed based on parameters of the classification model and thresholds corresponding to the parameters.
[0117] In this embodiment, the parameters of the classification model may include maximum depth (max_depth), minimum child node weight (min_child_weight), minimum number of child node samples (min_child_samples), sample sampling rate (subsample) and column sampling rate (colsample_bytree), etc.
[0118] Classification models can include decision trees, with a maximum depth of the number of nodes in the longest path from the root to a leaf in the decision tree.
[0119] You can set the maximum depth to start from a smaller value and gradually increase it. When the performance on the validation set starts to decrease, it indicates that overfitting may have occurred and you can reduce the depth.
[0120] You can set a threshold corresponding to the maximum depth. When the maximum depth exceeds the set threshold, stop increasing the depth of the decision tree.
[0121] When the weight of a node (e.g., the sum of the gradients of all samples of the node) is less than the threshold corresponding to the minimum child node weight, stop splitting the node.
[0122] When the number of samples of a child node after the split is less than the threshold corresponding to the minimum number of samples of the child node, the splitting can be stopped.
[0123] The sample sampling rate is used to control the proportion of samples used for training when each tree is built. The sample sampling rate can be set to a value less than 1 to prevent overfitting.
[0124] For example, the sample sampling rate may be set to any value between 0.5 and 1, or may be set to other values, which are not limited in this application.
[0125] The column sampling rate is the proportion of features that are randomly selected when building each tree.
[0126] In some embodiments, constructing a next classification model corresponding to a previous classification model based on the plurality of first prediction results and the sample signal data set may include:
[0127] Constructing a target loss function based on the difference between the first prediction result corresponding to each sample signal data and the sample category label;
[0128] The next classification module is trained based on the target loss function.
[0129] In this embodiment, the difference is used to characterize the difference between the prediction result of the previous classification model and the true value, as well as the rate of change of the difference.
[0130] The difference can include classification error, probability difference or distance measure, etc.
[0131] Based on the first prediction result and the sample category label, the gradient (first-order derivative) and Hessian matrix (second-order derivative) of each sample signal data can be calculated.
[0132] Different weights can be assigned to samples according to their differences. For example, higher weights can be assigned to samples with larger differences, and smaller weights can be assigned to samples with smaller differences.
[0133] Two or more loss functions can be mixed to obtain the target loss function.
[0134] For example, the sum-of-squares loss function and the cross-entropy loss function can be combined to construct a target loss function.
[0135] In actual implementation, the expression of the Sum Squared Error function can be:
[0136]
[0137] Where P is the total number of training patterns, K is the total number of output units, and t k,p is the kth target value of pattern p, o k,p is the kth output obtained for pattern p.
[0138] The expression of the cross entropy loss function (Cross Entropy) can be:
[0139]
[0140] Where P is the total number of training patterns, K is the total number of output units, and t k,p is the kth target value of pattern p, o k,p is the kth output obtained for pattern p.
[0141] Combining the square sum loss function and the cross entropy loss function, the target loss function (hybrid loss function) is constructed:
[0142]
[0143] Among them, E se is the sum-of-squares loss function, E ce is the cross entropy loss function, s1 and s2 are scalar values, which are the proportions given to the loss function, where s1+s2=1 and the value max se and max ce is the approximate maximum produced by the single loss function for the problem before training.
[0144] In this application, by combining the two loss functions to construct the target loss function, the generalization ability of the model is effectively improved. By switching to the cross entropy loss function, the minimum value found by the sum of squares loss function can be further utilized to improve the performance of the model.
[0145] A greedy algorithm may be used to train the next classification model, or other algorithms may be used, which are not limited in this application.
[0146] For example, when a greedy algorithm is used to construct the next classification model, all possible features and splitting points can be traversed, and the gain after splitting can be calculated, and the splitting point with the largest gain can be selected for splitting.
[0147] In some embodiments, training the next classification module based on the target loss function may include:
[0148] Based on the target loss function and the difference, a greedy algorithm is used to determine the target partition node from multiple candidate partition nodes corresponding to each sample signal data;
[0149] Divide the nodes based on the target and train the next classification model.
[0150] In this embodiment,
[0151] The candidate partition nodes are the eigenvalues corresponding to the sample signal data.
[0152] In the actual execution process, a candidate classification model can be constructed based on the candidate partition node, and then the gain corresponding to the candidate classification model can be calculated, where the gain corresponding to the candidate classification model is the reduction of the target loss function before and after the split.
[0153] By comparing the gain values under different candidate split nodes and combining the difference, the split node that can minimize the loss function and is sensitive to gradient information can be selected from multiple candidate split nodes as the final target split node.
[0154] After the target partition node is determined, the next classification model can be constructed based on the target partition node.
[0155] According to the object classification method within the target sensing area provided in the embodiment of the present application, a greedy algorithm is used to train the next classification model, and new tree models are gradually added to minimize the target loss function, thereby improving the prediction accuracy of the model.
[0156] In some embodiments, training a target classification model based on multiple classification models corresponding to the iterative process may include:
[0157] Based on the target loss function corresponding to each classification model, determine the weight corresponding to each classification model;
[0158] Based on the weights corresponding to each classification model, multiple classification models are weighted and combined into a target classification model.
[0159] In this embodiment, the weight corresponding to the classification model can be determined based on the error corresponding to the classification model. For example, when the error of the classification model is small, the weight corresponding to the classification model can be adjusted to a larger value; when the error of the classification model is large, the weight corresponding to the classification model can be adjusted to a smaller value.
[0160] The target classification model may be trained in the form of an additive model. For example, all classification models may be weightedly combined based on the weights corresponding to the classification models to obtain the target classification model.
[0161] Combine the following Figure 2 , taking the XGBoost (eXtreme Gradient Boosting) algorithm as an example, the training process of the target classification model is explained in detail.
[0162] In the actual implementation process, XGBoost is built from a series of decision tree models, such as Figure 2 As shown in Figure 2, multiple decision tree models can be combined to form a powerful prediction model, namely the target classification model.
[0163] During the calculation process, the decision tree can fit the residuals of all previous decision trees, such as Figure 2 As shown, the direction of each weak learner (decision tree) is unidirectional.
[0164] The model can be fitted to the values after Sigmoid mapping. The mapped values are represented as predicted values. The loss can be calculated through the target loss function, and the next decision tree can be constructed based on this loss.
[0165] The calculation process is as follows:
[0166] Initialization is performed based on the following formula (i.e., building the previous classification model):
[0167]
[0168] Then, the first group of weak learners (the next classification model corresponding to the previous classification model) is constructed by the following formula:
[0169]
[0170] The second group of weak learners is constructed based on the following formula:
[0171]
[0172] Construct the Mth group of weak learners based on the following formula:
[0173]
[0174] in, is the predicted value of the Mth group of weak learners, f M (x i ) is an approximate function, x i It is the attribute value or characteristic content of the data.
[0175] The objective function can be expressed as: Among them, L is the loss function and O is the regularization term.
[0176] Using g i represents f N (x i ), h i represents f N (x i ) is the second-order derivative of:
[0177]
[0178]
[0179] in, It can be expressed as a constant C, so the objective function can be transformed into:
[0180]
[0181] Among them, T is the number of decision tree leaves, λ and γ are hyperparameters representing the pruning parameter and the training penalty weight respectively, ω j is the leaf node weight, the optimal value of the leaf node, equivalent to f i (x), for v j Take the derivative and then iterate.
[0182]
[0183] Yes j Taking partial derivatives we get: Substituting it into the above formula, we get the expression of the loss function:
[0184]
[0185] Assume that the sum of the first-order and second-order derivatives of the left and right subtrees of the current node are represented as G L , H L , G R , H R , then the expectation maximization can be expressed as:
[0186]
[0187] Substituting the target loss function, we can Replace the loss function in the expression as follows:
[0188]
[0189] Similarly, by taking the derivative of the above formula and expressing the first-order derivative and the second-order derivative respectively, we can get something similar to The loss function expression of .
[0190] In some embodiments, tools such as XGBoost4J-Spark or XGBoost4J-Flink can be used to perform distributed training on multiple machines to increase the training speed.
[0191] In some embodiments, a variety of parallelization strategies may be used to train the target classification model.
[0192] In this embodiment, feature parallelism, data parallelism, and tree structure parallelism may be used to increase the training speed, thereby increasing the convergence speed and training accuracy of the model.
[0193] In this application, by using machine learning methods to classify and calculate security gate signal data, and using the effective information of numerical features to learn autonomous features, the stable signal of metal signals in the magnetic field signal of the security gate can be effectively explained, and it has strong practicality and robustness.
[0194] According to the object classification method within the target sensing area provided in the embodiment of the present application, by adopting the XGBoost algorithm to train the target classification model, multiple groups of weak learners can be iteratively optimized and combined into a strong classifier at the same time, and the distribution characteristics of metal objects in the magnetic field can be summarized and summarized, and converted into stable features as multiple groups of weak learners for training. The trained target classification model has high performance and high prediction accuracy.
[0195] like Figure 3 As shown, in some embodiments, obtaining category information corresponding to the target object may include:
[0196] Based on the signal strength of each magnetic field signal data, each magnetic field signal data is processed to obtain a first detection result corresponding to each target sensing area;
[0197] The first detection result includes processing magnetic field signal data corresponding to the absence of a target object of the first category passing through the target sensing area, and obtaining detection results corresponding to each target sensing area.
[0198] In this embodiment, the signal strength is used to characterize the signal quality or energy corresponding to the magnetic field signal data.
[0199] The first detection result includes whether a target object of the first category passes through the target sensing area, or whether a target object of the first category does not pass through the target sensing area.
[0200] Among them, the first category can include non-prohibited items such as electronic products.
[0201] The magnetic field signal data for which the corresponding detection result has not been determined can be processed again to obtain the detection result corresponding to the target sensing area.
[0202] In the actual execution process, it is possible to determine whether the signal strength of the magnetic field signal data corresponding to each target sensing area is greater than the strength threshold, and retain the magnetic field signal data with signal strength greater than the strength threshold, and convert it into a feature value and input it into the target classification model.
[0203] According to the threshold range, it can be determined whether there is an electronic product passing through the target sensing area corresponding to the magnetic field signal data, and the first detection result corresponding to each sub-area included in the target sensing area is output.
[0204] By traversing all sub-regions, the sub-regions can be combined with adjacent sub-regions with stronger signals and satisfying the amplitude difference, so as to judge the metal objects from a global perspective.
[0205] The amplitude difference may be a difference between signal strengths corresponding to adjacent timestamps.
[0206] By processing and judging the stable signals corresponding to the combined area, the category information corresponding to the target object passing through the target sensing area can be obtained.
[0207] In some embodiments, supplementary identification may be performed on signals that are strong but non-stationary.
[0208] According to the object classification method within the target sensing area provided in the embodiment of the present application, by inputting the magnetic field signal data of each sub-area into the target classification model, the category information corresponding to the target object passing through the target sensing area output by the target classification model can be obtained. It can be applicable to magnetic field signals at different frequencies at the same time, and solves the magnetic field interference problem of multiple doors side by side and similar frequency interference. The same classification results and recognition accuracy can still be obtained under side-by-side or similar frequency interference, and the recognition accuracy is high.
[0209] In some embodiments, obtaining category information corresponding to a target object passing through a target sensing area output by a target classification model may include:
[0210] When the amplitude difference of the magnetic field signal data in the target time period before and after the object passes through the target sensing area is greater than the target threshold, it is determined that there is a target object passing through the target sensing area, and the magnetic field signal data is input into the target classification model to obtain the category information corresponding to the target object output by the target classification model.
[0211] In this embodiment, whether the object is a metal object can be determined based on the fluctuation of the magnetic field signal data corresponding to the object collected by the signal collection device in the target time period before and after the object passes through the target sensing area.
[0212] When the amplitude difference of the magnetic field signal data is not greater than the target threshold, it can be determined that the object is a non-metallic object.
[0213] When the amplitude difference of the magnetic field signal data is greater than the target threshold, it can be determined that the object is a metal object, that is, the object is a target object.
[0214] The object classification device within the target sensing area provided by the present application is described below. The object classification device within the target sensing area described below and the object classification method within the target sensing area described above can refer to each other.
[0215] The object classification method in the target sensing area provided in the embodiment of the present application can be executed by a device for classifying objects in the target sensing area. In the embodiment of the present application, the device for classifying objects in the target sensing area is taken as an example to illustrate the device for classifying objects in the target sensing area provided in the embodiment of the present application.
[0216] The embodiment of the present application also provides a device for classifying objects within a target sensing area.
[0217] like Figure 4 As shown, in the device for classifying objects in the target sensing area, a signal collection device is arranged in the target sensing area, and the device includes: a first processing module 410 and a second processing module 420 .
[0218] The first processing module 410 is used to obtain magnetic field signal data collected by a signal collection device in a target sensing area; the target sensing area is used for objects to pass through;
[0219] The second processing module 420 is used to input the magnetic field signal data into the target classification model to obtain the category information corresponding to the target object passing through the target sensing area output by the target classification model; the target classification model is trained with the sample signal data set as a sample and with the output of the category information of the target object corresponding to the sample signal data set as a goal, and the sample signal data set includes sub-data sets of multiple categories, and the characteristic values corresponding to each signal data in the sub-data sets of each category are in different intervals.
[0220] According to the device for classifying objects within a target sensing area provided in an embodiment of the present application, a sample signal data set containing signal data of multiple categories is obtained, and a target classification model is trained with the sample signal data set as a sample and with the output of category information of the target object as a goal. The collected magnetic field signal data is input into the trained target classification model, and the category of the target object output by the target classification model can be obtained, so that different metal objects can be effectively distinguished, and the device has strong practicality and robustness, and has high accuracy in classification and recognition.
[0221] In some embodiments, the second processing module 420 may also be used to:
[0222] Obtain a sub-dataset of a target category among multiple categories and a sub-dataset of other categories except the target category among multiple categories; the characteristic value corresponding to each signal data in the sub-dataset of the target category is within the target interval, and the characteristic value corresponding to each signal data in the sub-dataset of other categories is not within the target interval;
[0223] Construct a sample signal dataset based on the sub-dataset of the target category and the sub-datasets of other categories;
[0224] The sub-dataset of the target category and the sub-datasets of other categories are input into the target classification model to output the category information of the target object corresponding to the sample signal dataset as the target training target classification model.
[0225] In some embodiments, the second processing module 420 may also be used to:
[0226] Build the previous classification model;
[0227] Inputting the sample signal data set into the previous classification model to obtain a first prediction result corresponding to each sample signal data output by the previous classification model;
[0228] Training a next classification model corresponding to the previous classification model based on the plurality of first prediction results and the sample signal data set;
[0229] Update the next classification model to the previous classification model, and repeat the steps of "inputting the sample signal data set into the previous classification model, obtaining the first prediction result corresponding to each sample signal data output by the previous classification model; training the next classification model corresponding to the previous classification model based on multiple first prediction results and the sample signal data set" until the target iteration conditions are met, and train the target classification model based on multiple classification models corresponding to the iterative process.
[0230] In some embodiments, the second processing module 420 may also be used to:
[0231] Constructing a target loss function based on the difference between the first prediction result corresponding to each sample signal data and the sample category label;
[0232] The next classification module is trained based on the target loss function.
[0233] In some embodiments, the second processing module 420 may also be used to:
[0234] Based on the target loss function, a greedy algorithm is used to determine the target partition node from multiple candidate partition nodes corresponding to each sample signal data;
[0235] Divide the nodes based on the target and train the next classification model.
[0236] In some embodiments, the second processing module 420 may also be used to:
[0237] Based on the target loss function corresponding to each classification model, determine the weight corresponding to each classification model;
[0238] Based on the weights corresponding to each classification model, multiple classification models are weighted and combined into a target classification model.
[0239] In some embodiments, the second processing module 420 may also be used to:
[0240] When the amplitude difference of the magnetic field signal data in the target time period before and after the object passes through the target sensing area is greater than the target threshold, it is determined that there is a target object passing through the target sensing area, and the magnetic field signal data is input into the target classification model to obtain the category information corresponding to the target object output by the target classification model.
[0241] The object classification device in the target sensing area in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than the terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc. It can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not specifically limited.
[0242] The object classification device in the target sensing area in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0243] The object classification device within the target sensing area provided by the embodiment of the present application can achieve Figures 1 to 3 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0244] In some embodiments, Figure 5 As shown, an embodiment of the present application also provides an electronic device 500, including a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor 501. When the program is executed by the processor 501, each process of the above-mentioned method for classifying objects in the target sensing area is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0245] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0246] On the other hand, the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the various processes of the above-mentioned object classification method embodiment within the target sensing area, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0247] On the other hand, the present application also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the various processes of the above-mentioned object classification method embodiment within the target sensing area, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0248] On the other hand, an embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned object classification method embodiment within the target sensing area, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0249] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0250] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0251] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution can be essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for 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 embodiment.
[0252] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for classifying objects in a target sensing area, characterized in that: A signal acquisition device is provided in the target sensing area, and the method comprises: Acquire magnetic field signal data collected by the signal collection device in the target sensing area; the target sensing area is used for the object to pass through; The magnetic field signal data is input into a target classification model to obtain category information corresponding to a target object passing through the target sensing area output by the target classification model; the target classification model is trained using a sample signal data set as a sample and outputting category information of a target object corresponding to the sample signal data set as a goal, wherein the sample signal data set includes sub-data sets of multiple categories, and the feature values corresponding to each signal data in each sub-data set of the category are in different intervals.
2. The method for classifying objects in a target sensing area according to claim 1, characterized in that: The target classification model is trained by taking the sample signal data set as a sample and outputting the category information of the target object corresponding to the sample signal data set as a goal, and includes: Acquire a sub-dataset of a target category among the multiple categories and a sub-dataset of other categories among the multiple categories except the target category; the feature value corresponding to each signal data in the sub-dataset of the target category is within a target interval, and the feature value corresponding to each signal data in the sub-dataset of other categories is not within the target interval; constructing the sample signal dataset based on the sub-dataset of the target category and the sub-datasets of the other categories; The sub-dataset of the target category and the sub-datasets of the other categories are input into the target classification model, so as to train the target classification model with the output of category information of the target object corresponding to the sample signal dataset as the goal.
3. The method for classifying objects in a target sensing area according to claim 1, characterized in that: The target classification model is trained based on the following steps: Build the previous classification model; Inputting the sample signal data set into the previous classification model to obtain a first prediction result corresponding to each sample signal data output by the previous classification model; Training a next classification model corresponding to the previous classification model based on the plurality of first prediction results and the sample signal data set; Update the next classification model to the previous classification model, and repeat the steps of "inputting the sample signal data set into the previous classification model to obtain the first prediction result corresponding to each sample signal data output by the previous classification model; training the next classification model corresponding to the previous classification model based on multiple first prediction results and the sample signal data set" until the target iteration condition is met, and train the target classification model based on multiple classification models corresponding to the iterative process.
4. The method for classifying objects in a target sensing area according to claim 3, characterized in that: The training of a next classification model corresponding to the previous classification model based on the plurality of first prediction results and the sample signal data set includes: Constructing a target loss function based on the difference between the first prediction result corresponding to each of the sample signal data and the sample category label; The next classification module is trained based on the target loss function.
5. The method for classifying objects in a target sensing area according to claim 4, characterized in that: The training of the next classification module based on the target loss function comprises: Based on the target loss function, a greedy algorithm is used to determine a target partition node from a plurality of candidate partition nodes corresponding to each of the sample signal data; Based on the target partition node, the next classification model is trained.
6. The method for classifying objects in a target sensing area according to claim 3, characterized in that: The training of the target classification model based on multiple classification models corresponding to the iterative process includes: Determine the weight corresponding to each classification model based on the target loss function corresponding to each classification model; Based on the weights corresponding to the classification models, multiple classification models are weighted and combined into the target classification model.
7. The method for classifying objects in a target sensing area according to any one of claims 1 to 6, characterized in that: The obtaining of category information corresponding to the target object passing through the target sensing area output by the target classification model includes: When the amplitude difference of the magnetic field signal data in the target time period before and after the object passes through the target sensing area is greater than the target threshold, it is determined that there is a target object passing through the target sensing area, and the magnetic field signal data is input into the target classification model to obtain the category information corresponding to the target object output by the target classification model.
8. A device for classifying objects in a target sensing area, characterized in that: A signal acquisition device is provided in the target sensing area, and the device comprises: A first processing module is used to obtain magnetic field signal data collected by the signal collection device in the target sensing area; the target sensing area is used for the object to pass through; The second processing module is used to input the magnetic field signal data into a target classification model to obtain the category information corresponding to the target object passing through the target sensing area output by the target classification model; the target classification model is trained with a sample signal data set as a sample and with the goal of outputting the category information of the target object corresponding to the sample signal data set, and the sample signal data set includes sub-data sets of multiple categories, and the intervals of the feature values corresponding to each signal data in the sub-data sets of each category are different.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method for classifying objects in a target sensing area as described in any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for classifying objects in a target sensing area as described in any one of claims 1 to 7 is implemented.