A vehicle detection method, an electronic terminal and a computer readable storage medium
Patent Information
- Application Number
- CN202610738569.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-26
- Publication Date
- 2026-08-21
AI Technical Summary
[0003]现有技术中的车辆检测一般为二分类结果,即只输出是否改装的结果,检测结果和维度较为单一
[0015]本申请的有益效果是:区别于现有技术的情况,本申请提供的车辆检测方法,包括:采集目标车辆的待识别图像,对待识别图像进行检测,确定目标车辆对应的车系信息和车牌信息,并基于车牌信息从目标库内获取目标车辆的登记图像和登记信息;基于车系信息和登记信息确定目标车辆是否为套牌车,若否,对待识别图像和登记图像进行分割,得到目标车辆各部件对应的待识别局部图像和登记局部图像;利用检测模型对待识别局部图像和登记局部图像进行处理,确定目标车辆是否存在结构性异常和/或外观异常。本申请的方法不仅能够识别车辆是否为套牌车,还能确定车辆是否改装以及是结构性改装还是外观改装,检测结果和维度多样化,实现对车辆的精准检测。
Smart Images

Figure CN122618318A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle inspection technology, and in particular to a vehicle inspection method, an electronic terminal, and a computer-readable storage medium. Background Technology
[0002] With the rapid development of intelligent transportation systems and urban video networks, fine-grained analysis of vehicle appearance is becoming increasingly important in scenarios such as traffic management. Vehicle modifications (such as replacing body kits, adding spoilers, or changing wheel designs) not only affect the accuracy of vehicle recognition and detection but may also pose safety hazards. Therefore, automatic detection of vehicle modifications is of significant practical importance.
[0003] Existing vehicle detection technologies typically produce binary results, meaning they only output whether a vehicle has been modified, resulting in relatively limited detection results and dimensions. Summary of the Invention
[0004] This application mainly provides a vehicle detection method, an electronic terminal, and a computer-readable storage medium. This method can not only identify whether a vehicle is using a fake license plate, but also determine whether the vehicle has been modified, and whether the modification is structural or cosmetic. The detection results and dimensions are diversified, enabling accurate vehicle detection.
[0005] To solve the above-mentioned technical problems, the first technical solution adopted in this application is: to provide a vehicle detection method, including: The system collects images of the target vehicle to be identified, detects the images to be identified, determines the vehicle series information and license plate information of the target vehicle, and obtains the registration image and registration information of the target vehicle from the target database based on the license plate information. Determine whether the target vehicle is a counterfeit vehicle based on vehicle series information and registration information; Whether or not the response is positive, the image to be identified and the registered image are segmented to obtain the local images to be identified and the local images to be registered corresponding to each component of the target vehicle; The detection model is used to process the local image to be identified and the registered local image to determine whether the target vehicle has structural and / or appearance anomalies. The detection model includes a twin network module and a reconstruction network module; the reconstruction network module is connected to the twin network module; the twin network module is used to determine whether the target vehicle has structural anomalies, and the reconstruction network module is used to determine whether the target vehicle has cosmetic anomalies.
[0006] In one embodiment, a detection model is used to process the local image to be identified and the registered local image to determine whether the target vehicle has structural anomalies and / or appearance anomalies, including: The twin network module is used to process the local image to be identified and the registered local image to output the features to be identified; and the structural anomalies of the target vehicle are determined based on the features to be identified. The reconstruction network module is used to determine whether the target vehicle has any appearance abnormalities based on the features to be identified.
[0007] In one embodiment, the twin network module includes: a first encoder, a second encoder, a feature fusion layer, a multilayer perceptron layer, and a classification output layer. The feature fusion layer is connected to the first encoder and the second encoder, the multilayer perceptron layer is connected to the feature fusion layer, and the classification output layer is connected to the multilayer perceptron layer. The twin network module processes the local image to be identified and the registered local image to output the features to be identified, including: The first encoder is used to process the local image to be identified to obtain a first output feature; and the second encoder is used to process the local image to obtain a second output feature. The first output feature and the second output feature are fused using a feature fusion layer to obtain the fused feature; the fused feature and the first output feature are used as the features to be identified. Determining whether a target vehicle has structural anomalies based on the features to be identified includes: The fused features are processed using a multi-layer perceptron layer, and the classification output layer outputs the classification results, which characterize whether the target vehicle has structural anomalies.
[0008] In one embodiment, a feature fusion layer is used to fuse the first output feature and the second output feature to obtain a fused feature, including: The first output feature is split according to the scale level to obtain the first split feature, and the second output feature is split to obtain the second split feature; The distance between the first and second split features corresponding to each scale level is calculated, and the calculated distance is processed using an attention mechanism to obtain the initial fused features corresponding to each scale level. The fusion features are obtained based on the initial fusion features corresponding to each scale level.
[0009] In one embodiment, the reconstruction network module is used to determine whether a target vehicle has any appearance anomalies based on the features to be identified, including: The fused features and the first output features are upsampled to obtain the first feature image; and the local image to be identified is downsampled to obtain the second feature image. Calculate the distance between each feature in the first feature image and the second feature image to obtain the difference heatmap; The presence of any exterior anomalies in the target vehicle is determined based on the difference heat map.
[0010] In one embodiment, determining whether a target vehicle has any appearance anomalies based on a difference heatmap includes: The proportion of differences corresponding to the local image to be identified is determined based on the difference heatmap. The overall difference percentage of the target vehicle is obtained based on the difference percentages corresponding to all local images to be identified. If the overall difference percentage is greater than a preset value, it is determined that the target vehicle has an appearance abnormality.
[0011] In one embodiment, the vehicle series information includes at least one of the following: the brand, sub-brand, and model year of the target vehicle; The target vehicle components include at least one of the following: front bumper area, rear bumper area, grille area, hood area, left headlight area, right headlight area, left fender area, right fender area, front fender area, rear fender area, windshield, roof, left front door, left rear door, right front door, right rear door, trunk lid, and taillights.
[0012] In one embodiment, the method further includes: Display a heatmap showing the differences.
[0013] To solve the above-mentioned technical problems, the second technical solution adopted in this application is: to provide an electronic terminal, which includes a memory and a processor coupled to each other, the processor being used to execute program instructions stored in the memory, and the processor being used to execute program data to implement the steps in the vehicle detection method described above.
[0014] To solve the above-mentioned technical problems, the third technical solution adopted in this application is: to provide a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, to implement the steps in the vehicle detection method described above.
[0015] The beneficial effects of this application are as follows: Unlike existing technologies, the vehicle detection method provided in this application includes: acquiring an image of a target vehicle to be identified; detecting the image to be identified; determining the vehicle series information and license plate information corresponding to the target vehicle; and obtaining the registration image and registration information of the target vehicle from a target database based on the license plate information; determining whether the target vehicle is a cloned vehicle based on the vehicle series information and registration information; if not, segmenting the image to be identified and the registration image to obtain the local images to be identified and the local images to be registered corresponding to each component of the target vehicle; and processing the local images to be identified and the local images to be registered using a detection model to determine whether the target vehicle has structural anomalies and / or appearance anomalies. The method of this application can not only identify whether a vehicle is a cloned vehicle, but also determine whether the vehicle has been modified and whether the modification is structural or cosmetic. The detection results and dimensions are diversified, achieving accurate vehicle detection. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a flowchart illustrating the first embodiment of the vehicle inspection method provided in this application; Figure 2 This is a schematic diagram of an embodiment of the detection model provided in this application; Figure 3 yes Figure 1 A schematic flowchart of an embodiment of step S14; Figure 4 This is a schematic diagram of another embodiment of the detection model provided in this application; Figure 5 This is a schematic diagram of the framework of an embodiment of the electronic terminal provided in this application; Figure 6 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation
[0018] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0019] In the following description, specific details such as particular system architectures, interfaces, and technologies are presented for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.
[0020] In this article, the term "and / or" simply describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Furthermore, "more" in this article means two or more objects.
[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0022] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0023] The vehicle detection method provided in this application can be implemented by a server or terminal alone, or by a server and terminal working together. In some embodiments, the terminal or server can implement the vehicle detection method provided in this application by running a computer program. For example, the computer program can be a native program or software module in an operating system; it can be a native application (APP), i.e., a program that needs to be installed in the operating system to run, such as a client that supports virtual scenes, such as a game APP; it can also be a mini-program, i.e., a program that only needs to be downloaded to a browser environment to run; or it can be a mini-program that can be embedded in any APP. In short, the above-mentioned computer program can be any form of application, module, or plugin.
[0024] To enable those skilled in the art to better understand the technical solution of this application, the vehicle detection method provided in this application will be described in further detail below with reference to the accompanying drawings and specific embodiments.
[0025] Please see Figure 1 This is a flowchart illustrating the first embodiment of the vehicle inspection method of this application. The vehicle inspection method of this application includes: Step S11: Collect the image of the target vehicle to be identified, detect the image to be identified, determine the vehicle series information and license plate information corresponding to the target vehicle, and obtain the registration image and registration information of the target vehicle from the target database based on the license plate information.
[0026] Specifically, an initial image of the target vehicle is acquired and input into the object detection network model. The model detects and locates the target vehicle in the initial image, outputting the bounding box coordinates of the target vehicle. The image defined by these bounding box coordinates is then used as the image to be identified for the target vehicle. It should be noted that the object detection network model is based on deep learning and is trained on a training set of data.
[0027] Specifically, the image to be recognized is input into the vehicle classification network and the license plate recognition network, respectively, to obtain the vehicle series information and license plate information corresponding to the target vehicle. The vehicle series information includes at least one of the target vehicle's brand, sub-brand, and model year. After obtaining the license plate information, the registration image and registration information of the target vehicle are retrieved from the target database based on the license plate information.
[0028] In one embodiment, the corresponding registration image can be retrieved from the vehicle registration database based on image search; in another embodiment, the license plate number of the target vehicle can be determined based on the image to be identified, and the vehicle registration database can be searched based on the license plate number to determine the registration image of the target vehicle.
[0029] Step S12: Determine whether the target vehicle is a cloned vehicle based on the vehicle series information and the registration information.
[0030] Specifically, the registration information and vehicle series information are compared to determine whether the vehicle brand, sub-brand, model year, etc., are consistent. If they are inconsistent, it is determined to be a counterfeit vehicle and is reported, for example, as "suspected counterfeit vehicle". If they are consistent, it is confirmed that it is not a counterfeit vehicle, and step S13 is executed.
[0031] Step S13: Segment the image to be identified and the registered image to obtain the local images to be identified and the local images to be registered corresponding to each component of the target vehicle.
[0032] For example, the image to be identified and the registered image are respectively input into the vehicle component segmentation network to obtain the local images to be identified and the registered local images corresponding to each component of the target vehicle.
[0033] Specifically, the vehicle components include at least one of the following: front bumper area, rear bumper area, grille area, hood area, left headlight area, right headlight area, left fender area, right fender area, front fender area, rear fender area, windshield, roof, left front door, left rear door, right front door, right rear door, trunk lid, and taillights.
[0034] Step S14: Use the detection model to process the local image to be identified and the registered local image to determine whether the target vehicle has structural anomalies and / or appearance anomalies.
[0035] In one embodiment, image registration is performed between the local image to be identified and the registered local image. The registered local image to be identified and the registered local image are then input into a detection model. The detection model is used to process the local image to be identified and the registered local image to determine whether there are any abnormalities in the target vehicle. The abnormalities include structural abnormalities and / or appearance abnormalities.
[0036] It should be noted that structural anomalies include, for example, modifications to certain parts of the target vehicle, while cosmetic anomalies include, for example, modifications to the vehicle's paintwork.
[0037] The vehicle detection method of this application can not only identify whether a vehicle has been modified, but also determine whether it is a structural modification or an appearance modification. The detection results and dimensions are diversified, enabling accurate vehicle detection.
[0038] In one embodiment, combined with Figure 2 , Figure 2This is a schematic diagram of the structure of an embodiment of the detection model of this application. The detection model includes a twin network module and a reconstruction network module; the reconstruction network module is connected to the twin network module. The twin network module is used to determine whether the target vehicle has structural anomalies, and the reconstruction network module is used to determine whether the target vehicle has cosmetic anomalies.
[0039] Combination Figure 3 In one embodiment, step S14 specifically includes: Step S131: Use the twin network module to process the local image to be identified and the registered local image to output the features to be identified; and determine whether the target vehicle has structural anomalies based on the features to be identified.
[0040] The local image to be identified is denoted as ImgA, and the registered local image is denoted as ImgB. The local image to be identified, ImgA, and the registered local image, ImgB, are respectively input into the Siamese network model to obtain the features to be identified. Based on the features to be identified, it is determined whether the target vehicle has structural anomalies.
[0041] In one specific embodiment, combined with Figure 2 The twin network module includes: a first encoder, a second encoder, and a feature fusion layer (as shown in the diagram). The network consists of a multilayer perceptron (MLP) layer, a classification output layer, a feature fusion layer connected to the first encoder and the second encoder, a multilayer perceptron layer connected to the feature fusion layer, and a classification output layer connected to the multilayer perceptron layer. The first encoder and the second encoder share the network weights W.
[0042] Specifically, the local image ImgA to be identified is input into the first encoder, which processes the local image ImgA to obtain the first output feature F. A The registered local image ImgB is input into the second encoder, which processes the registered local image ImgB to obtain the second output feature F. B The first encoder and the second encoder can be implemented using any mainstream feature extraction network, including but not limited to ResNet, ConvNeXt, VisionTransformer (ViT), etc.
[0043] The first output feature F is used in the feature fusion layer. A Second output feature F B By performing fusion, fusion characteristics are obtained. F fuse .
[0044] In one specific embodiment, the first output feature F is determined according to the scale level. A Perform the splitting to obtain the first splitting feature. The second output feature F B Perform splitting to obtain the second splitting feature. ,in, , indicating the feature scale level.
[0045] The first splitting feature at each scale level is analyzed according to the corresponding scale level. With the second splitting feature The fusion process is then performed. Specifically, the distance between the first and second split features corresponding to each scale level is calculated, and an attention mechanism is used to process the calculated distances to obtain the initial fused features for each scale level. The initial fused features are represented as follows: ; in, The initial fusion features at the i-th scale level, To calculate the L1 distance between the first splitting feature and the second splitting feature at the i-th scale level, This is an attention mechanism algorithm.
[0046] In one embodiment, to improve the perception of features such as the direction of the modified area's edge, the attention mechanism algorithm is a direction-aware multi-scale spatial attention scheme. For example, the first segmented feature... With the second splitting feature As input feature X, input feature X is fed into a convolutional module containing convolutional kernels in four directions, and the responses corresponding to each convolutional kernel are obtained respectively. ,in Response in four directions The L2 normalization operation is performed using the following formula: ; in, A constant to prevent the denominator from being 0.
[0047] Normalized features After global average pooling, a lightweight MLP is used to learn directional weights. Then, the learned weights are multiplied by the normalized features and activated with a sigmoid function to obtain the spatial attention map. The specific formula is as follows: ; ; in, For the Sigmoid function, The learnable dynamic weights are generated by a lightweight MLP. This is a spatial attention map.
[0048] The spatial attention map is multiplied by the input feature X to obtain the output feature, as shown in the following formula:
[0049] This represents broadcast multiplication. F out This indicates the output features.
[0050] After obtaining the initial fusion features corresponding to each scale level, the fusion features are obtained based on the initial fusion features corresponding to each scale level. F fuse . Fusing features F fuse and the first output feature F A As a feature to be identified.
[0051] In one specific embodiment, a multilayer perceptron layer is used to fuse features. F fuse The process is performed, and the classification output layer is used to output the classification results, which characterize whether the target vehicle has structural anomalies.
[0052] In one specific embodiment, the fusion feature F fuse The input is fed into a multilayer perceptron (MLP) layer to predict the modification type of the current local region. For example, this could be based on fused features corresponding to all local regions. F fuse If all local regions are found to be inconsistent, meaning the structure of all local regions of the target vehicle matches the structure of the registered image, then the target vehicle has not undergone structural modifications. If a local region contains structural modifications, it is determined whether that modification type is in the list of safe modifications for that local region. If one or more unsafe modification types are present, the target vehicle is judged to be abnormal. Specifically, in this embodiment, the classification output layer will output two classification results: one indicating no structural modifications and the other indicating structural modifications.
[0053] Step S132: Use the reconstruction network module to determine whether the target vehicle has any appearance abnormalities based on the features to be identified.
[0054] In another embodiment, a reconstruction network module is further used to determine whether the target vehicle has any appearance anomalies based on the features to be identified.
[0055] Specifically, the reconstruction network module is used to determine whether the target vehicle has any appearance abnormalities based on the fused features and the first output features (i.e. the features to be identified).
[0056] In one specific embodiment, the fused features and the first output features are upsampled to obtain a first feature image; and the local image to be identified is downsampled to obtain a second feature image. Exemplarily, the reconstruction network module includes a decoder that upsamples the first output features F... A and fusion features F fuse The input is fed into the decoder to obtain a first feature image RecA with the same scale as the local image ImgA to be identified. In one embodiment, the first feature image RecA and the local image ImgA to be identified have the same size. In another embodiment, the size of the first feature image RecA may be half or a quarter of the size of the local image ImgA to be identified.
[0057] Furthermore, the local image ImgA to be identified is downsampled to obtain the second feature image. In one embodiment, the second feature image The dimensions are the same as those of the first feature image RecA. Calculate the dimensions of the first feature image RecA and the second feature image. The distance between each feature is used to obtain a difference heatmap, and the specific calculation formula is as follows: ; Where |||2 represents the L2 norm, HeadMapA This represents a heatmap of differences.
[0058] The presence of appearance anomalies in a target vehicle is determined based on a difference heatmap. In one specific embodiment, the proportion of difference corresponding to the current local image to be identified is determined based on the difference heatmap. For example, a dynamic threshold algorithm is used to determine the difference regions in the difference heatmap, and the proportion of difference region area relative to the local image to be identified is calculated, thereby determining the proportion of difference corresponding to the current local image to be identified. The overall proportion of difference of the target vehicle is obtained based on the proportions of difference corresponding to all local images to be identified; specifically, the sum of the proportions of difference corresponding to all local images to be identified is calculated to obtain the overall proportion of difference of the target vehicle. In one specific embodiment, the proportions of difference of each local region of the vehicle target are accumulated according to the weight corresponding to each local region (which can be determined according to the proportion of each local region relative to the overall image to be identified, or according to other rules) to obtain the overall proportion of difference of the target vehicle. If the overall proportion of difference is greater than a preset value, it is determined that the target vehicle has appearance anomalies.
[0059] It should be noted that abnormal appearance includes abnormal color or pattern. For example, if the proportion of the vehicle's exterior area occupied by color or pattern modifications exceeds a threshold, then an abnormal appearance can be identified.
[0060] In one embodiment of this application, after obtaining the difference heatmap, the difference heatmap can also be displayed. Since the difference heatmap can indicate whether the target vehicle has any appearance abnormalities, displaying the difference heatmap can visualize the appearance modification.
[0061] Understandably, the detection model of this application outputs four types of results: structural modification and no structural modification; appearance modification and no appearance modification. Compared with the existing binary classification results (i.e., only outputting whether or not the vehicle has been modified), the method of this application can not only identify whether the vehicle has been modified, but also determine whether it is a structural modification or an appearance modification. The detection results and dimensions are diversified, enabling accurate detection of the vehicle.
[0062] It should be noted that the detection model needs to be trained before it can be used to detect structural and / or cosmetic anomalies. The training data consists of two parts: structural modification data and cosmetic paint modification data. For structural modification data, augmented datasets of different vehicle models can be added to the existing before-and-after data of modified vehicles. For cosmetic paint modification datasets, vehicles of the same model year but different colors can be used as training data. Each vehicle target's components are extracted using a segmentation network, registered, and then labeled with their corresponding local region image pairs. These images are then fed into the initial network for training.
[0063] by Figure 2 Taking the detection model shown as an example, a total of 4 loss functions are involved in network training, namely: modification type classification loss function, pixel-level reconstruction loss, perceptual loss, and SSIM (Structural Similarity Loss) structural similarity loss.
[0064] The cross-entropy loss function is used for classification of modification types to measure the difference between the model's predicted modification type and the labeled type. The formula is as follows: ; Where C represents the total number of defined modification categories. For real labels, The predicted probability for category c. Losses are categorized by modification type.
[0065] The pixel-level reconstruction loss is the absolute error between the original image and the feature image, as shown in the following formula: ; Where ImgA represents the original image, i.e., the local image to be identified, RecA represents the feature image, i.e., the first feature image, and ||1 represents the L1 norm. This represents the pixel-level reconstruction loss.
[0066] Perceptual loss is determined based on high-level semantic difference, improving structural consistency. The specific formula is as follows: ; in, This indicates that the data has passed through the i-th level feature of the encoder. Let ||||2 represent the perceived loss, and let L2 norm be |||2.
[0067] SSIM structural similarity loss is used to maintain local structural consistency, and the specific formula is as follows: ; in, , and These are the mean values of the input parameters x and y, respectively. Let x be the covariance of y. and Let x be the variance of y. and To stabilize the term and prevent the denominator from being zero, The range of pixel values. and It is a constant, usually 0.01 or 0.03. The loss function is SSIM structural similarity loss.
[0068] That is, the total loss function is ;in, , , and These are the weights of each loss function.
[0069] Figure 2 The detection model shown has a reconstruction network module consisting of only one decoder, which is trained based on the first output feature F. A and fusion features F fuse Training can improve resource utilization.
[0070] In another embodiment, the network reconstruction module may further include two decoders, such as... Figure 4 As shown, one of the decoders is trained based on the first output feature F. A and fusion features F fuse During training, another decoder is trained based on the second output feature F. B and fusion features F fuse Conducting training can improve training effectiveness.
[0071] based on Figure 4 The pixel-level reconstruction loss formula for the detection model shown is as follows: ; Where ImgB represents the registered local image, and RecB represents the feature image, also known as the third feature image, which is a combination of the fused features and the second output feature F. B The result was obtained after upsampling.
[0072] The formula for perceived loss is: ; The formula for SSIM structural similarity is: .
[0073] The method of this application can, based on determining whether a vehicle target has been modified, further accurately quantify the proportion of its color or pattern modification to the total exterior area of the vehicle, and precisely locate the specific parts of the vehicle's structural modifications, thereby achieving a method for fine-grained perception and interpretable assessment of changes in vehicle appearance.
[0074] The detection model in this application is trained using an unsupervised training method, which reduces the difficulty of collecting training data.
[0075] Please see Figure 5 , Figure 5 This is a schematic diagram of a framework of an embodiment of the electronic terminal provided in this application. The electronic terminal 80 includes a memory 81 and a processor 82 coupled to each other. The processor 82 is used to execute program instructions stored in the memory 81 to implement the steps of any of the vehicle detection method embodiments described above. In a specific implementation scenario, the terminal 80 may include, but is not limited to, a microcomputer or a server. In addition, the terminal 80 may also include mobile devices such as laptops and tablets, which are not limited here.
[0076] Specifically, processor 82 controls itself and memory 81 to implement the steps of any of the vehicle detection method embodiments described above. Processor 82 can also be referred to as a CPU (Central Processing Unit). Processor 82 may be an integrated circuit chip with signal processing capabilities. Processor 82 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. A general-purpose processor can be a microprocessor or any conventional processor. Furthermore, processor 82 can be implemented using integrated circuit chips.
[0077] Please see Figure 6 , Figure 6 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium provided in this application. The computer-readable storage medium 90 stores program instructions 901 that can be executed by a processor. The program instructions 901 are used to implement the steps of any of the vehicle detection methods described in the embodiments.
[0078] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0079] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0080] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.
[0081] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0082] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0083] The above are merely embodiments of this application and do not limit the scope of patent protection of this application. Any equivalent structural or procedural changes made using the content of this application’s specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of this application.
Claims
1. A vehicle inspection method, characterized in that, include: The system acquires an image of the target vehicle to be identified, detects the image to be identified, determines the vehicle series information and license plate information corresponding to the target vehicle, and obtains the registration image and registration information of the target vehicle from the target database based on the license plate information. Based on the vehicle series information and the registration information, determine whether the target vehicle is a counterfeit vehicle; In response to no, the image to be identified and the registered image are segmented to obtain the local images to be identified and the registered local images corresponding to each component of the target vehicle; The detection model is used to process the local image to be identified and the registered local image to determine whether the target vehicle has structural anomalies and / or appearance anomalies. The detection model includes a twin network module and a reconstruction network module; the reconstruction network module is connected to the twin network module; the twin network module is used to determine whether the target vehicle has structural anomalies, and the reconstruction network module is used to determine whether the target vehicle has appearance anomalies.
2. The method according to claim 1, characterized in that, The detection model is used to process the local image to be identified and the registered local image to determine whether the target vehicle has structural and / or appearance anomalies, including: The twin network module processes the local image to be identified and the registered local image to output the features to be identified; and determines whether the target vehicle has structural anomalies based on the features to be identified. The reconstruction network module is used to determine whether the target vehicle has any appearance abnormalities based on the features to be identified.
3. The method according to claim 2, characterized in that, The twin network module includes: a first encoder, a second encoder, a feature fusion layer, a multilayer perceptron layer, and a classification output layer. The feature fusion layer is connected to the first encoder and the second encoder, the multilayer perceptron layer is connected to the feature fusion layer, and the classification output layer is connected to the multilayer perceptron layer. The twin network module processes the local image to be identified and the registered local image to output the features to be identified, including: The first encoder is used to process the local image to be identified to obtain a first output feature; and the second encoder is used to process the registered local image to obtain a second output feature. The first output feature and the second output feature are fused using the feature fusion layer to obtain a fused feature; the fused feature and the first output feature are used as the feature to be identified. Determining whether the target vehicle has structural anomalies based on the features to be identified includes: The fused features are processed using the multilayer perceptron layer, and the classification output layer outputs the classification result, which characterizes whether the target vehicle has structural anomalies.
4. The method according to claim 3, characterized in that, The feature fusion layer fuses the first output feature and the second output feature to obtain a fused feature, including: The first output feature is split according to the scale level to obtain the first split feature, and the second output feature is split to obtain the second split feature; The distance between the first split feature and the second split feature corresponding to each scale level is calculated, and the calculated distance is processed using an attention mechanism to obtain the initial fusion feature corresponding to each scale level. The fusion features are obtained based on the initial fusion features corresponding to each scale level.
5. The method according to claim 3, characterized in that, The reconstruction network module uses the features to be identified to determine whether the target vehicle has any appearance anomalies, including: The fused features and the first output features are upsampled to obtain a first feature image; and the local image to be identified is downsampled to obtain a second feature image. Calculate the distance between each feature in the first feature image and the second feature image to obtain a difference heatmap; The difference heatmap is used to determine whether the target vehicle has any appearance abnormalities.
6. The method according to claim 5, characterized in that, Determining whether the target vehicle has any appearance anomalies based on the difference heatmap includes: The proportion of differences corresponding to the current local image to be identified is determined based on the difference heatmap. The overall difference percentage of the target vehicle is obtained based on the difference percentage of all local images to be identified. If the overall difference percentage is greater than a preset value, it is determined that the target vehicle has an appearance abnormality.
7. The method according to claim 1, characterized in that, Vehicle information includes at least one of the following: the brand, sub-brand, and model year of the target vehicle; The target vehicle components include at least one of the following: front bumper area, rear bumper area, grille area, hood area, left headlight area, right headlight area, left fender area, right fender area, front fender area, rear fender area, windshield, roof, left front door, left rear door, right front door, right rear door, trunk lid, and taillights.
8. The method according to claim 5, characterized in that, The method further includes: The difference heatmap is displayed.
9. An electronic terminal, characterized in that, The electronic terminal includes a memory and a processor coupled to each other. The processor is used to execute program instructions stored in the memory and to execute program data to implement the steps in the vehicle detection method as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the vehicle detection method as described in any one of claims 1 to 8.